Skip to content

Commit

Permalink
add bookmark buttons to toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
hltj committed Nov 7, 2014
1 parent 87ea265 commit 5af68c4
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 33 deletions.
70 changes: 70 additions & 0 deletions images/bmkclearall.xpm
@@ -0,0 +1,70 @@
/* XPM */
static char * bmkclearall_xpm[] = {
"16 15 52 1",
" c None",
". c #3F48CC",
"+ c #ED1C24",
"@ c #00A2E8",
"# c #99D9EA",
"$ c #BA4025",
"% c #5F5F5F",
"& c #AAAAAA",
"* c #606060",
"= c #434343",
"- c #666FD7",
"; c #9E9E9E",
"> c #353535",
", c #3E3E3E",
"' c #7A7A7A",
") c #D3EFF5",
"! c #929292",
"~ c #404040",
"{ c #262626",
"] c #A4A9E8",
"^ c #4F4F4F",
"/ c #686868",
"( c #565656",
"_ c #454545",
": c #474747",
"< c #646464",
"[ c #939393",
"} c #535353",
"| c #717171",
"1 c #7B7B7B",
"2 c #747474",
"3 c #797979",
"4 c #555555",
"5 c #8F8F8F",
"6 c #5B5B5B",
"7 c #777777",
"8 c #00A1E8",
"9 c #BEBEBE",
"0 c #363636",
"a c #808080",
"b c #191919",
"c c #959595",
"d c #1E1E1E",
"e c #696969",
"f c #222222",
"g c #2C2C2C",
"h c #D9D9D9",
"i c #010101",
"j c #676767",
"k c #8E8E8E",
"l c #090909",
"m c #B6B6B6",
" ",
".............. ",
".+++++@######. ",
".+..............",
".+.@+++++######.",
".+.@+++++######.",
".+.@+++++######.",
".+.@+++$%&###*=-",
".@.@++@;>,')!~{]",
".@.@+@@@^/(_:<<.",
".@.@@@@@[}|12_#.",
"...@@@@@@34567#.",
" .@@8@890ab|=c.",
" ......def.=}g.",
" hij klm"};
26 changes: 26 additions & 0 deletions images/bmknext.xpm
@@ -0,0 +1,26 @@
/* XPM */
static char * bmknext_xpm[] = {
"16 15 8 1",
" c None",
". c #3F48CC",
"+ c #00A2E8",
"@ c #ED1C24",
"# c #99D9EA",
"$ c #880015",
"% c #FFFF80",
"& c #00A1E8",
" ",
" ",
"................",
".+@@@@@+#######.",
".+@@@@@+#######.",
".+@@@@@+#######.",
".+@@@@@+#######.",
".+@@+@@+##$$$$#.",
".+@+++@+##$%%$#.",
".+++++++##$%%$#.",
".+++++++$$$%%$$$",
".++&+&++$%%%%%%$",
".........$%%%%$ ",
" $%%$ ",
" $$ "};
25 changes: 25 additions & 0 deletions images/bmkprev.xpm
@@ -0,0 +1,25 @@
/* XPM */
static char * bmkprev_xpm[] = {
"16 15 7 1",
" c None",
". c #880015",
"+ c #FFFF80",
"@ c #3F48CC",
"# c #00A2E8",
"$ c #ED1C24",
"% c #99D9EA",
" .. ",
" .++. ",
"@@@@@@@@@.++++.@",
"@#$$$$$#.++++++.",
"@#$$$$$#...++...",
"@#$$$$$#%%.++.%@",
"@#$$$$$#%%.++.%@",
"@#$$#$$#%%....%@",
"@#$###$#%%%%%%%@",
"@#######%%%%%%%@",
"@#######%%%%%%%@",
"@#######%%%%%%%@",
"@@@@@@@@@@@@@@@@",
" ",
" "};
24 changes: 24 additions & 0 deletions images/bmktoggle.xpm
@@ -0,0 +1,24 @@
/* XPM */
static char * bmktoggle_xpm[] = {
"16 15 6 1",
" c None",
". c #3F48CC",
"+ c #00A2E8",
"@ c #ED1C24",
"# c #99D9EA",
"$ c #00A1E8",
" ",
" ",
"................",
".+@@@@@+#######.",
".+@@@@@+#######.",
".+@@@@@+#######.",
".+@@@@@+#######.",
".+@@+@@+#######.",
".+@+++@+#######.",
".+++++++#######.",
".+++++++#######.",
".++$+$++#######.",
"................",
" ",
" "};
Binary file modified po/es.gmo
Binary file not shown.
2 changes: 1 addition & 1 deletion po/es.po
Expand Up @@ -2413,7 +2413,7 @@ msgid "Insert date and time at current position"
msgstr "Inserta fecha y hora"

#: ../src/wxmedit_frame.cpp:1303
msgid "Toggle Bookmark "
msgid "Toggle Bookmark"
msgstr "Alternar Marcador"

#: ../src/wxmedit_frame.cpp:1303
Expand Down
Binary file modified po/ja_JP.gmo
Binary file not shown.
2 changes: 1 addition & 1 deletion po/ja_JP.po
Expand Up @@ -2409,7 +2409,7 @@ msgid "Insert date and time at current position"
msgstr "現在位置に日付と時間を挿入"

#: ../src/wxmedit_frame.cpp:1303
msgid "Toggle Bookmark "
msgid "Toggle Bookmark"
msgstr "ブックマークの切り替え"

#: ../src/wxmedit_frame.cpp:1303
Expand Down
Binary file modified po/zh_CN.gmo
Binary file not shown.
2 changes: 1 addition & 1 deletion po/zh_CN.po
Expand Up @@ -2414,7 +2414,7 @@ msgid "Insert date and time at current position"
msgstr "插入日期、时间到当前位置"

#: ../src/wxmedit_frame.cpp:1303
msgid "Toggle Bookmark "
msgid "Toggle Bookmark"
msgstr "设置/取消书签"

#: ../src/wxmedit_frame.cpp:1303
Expand Down
Binary file modified po/zh_TW.gmo
Binary file not shown.
2 changes: 1 addition & 1 deletion po/zh_TW.po
Expand Up @@ -2409,7 +2409,7 @@ msgid "Insert date and time at current position"
msgstr "插入日期、時間到目前位置"

#: ../src/wxmedit_frame.cpp:1303
msgid "Toggle Bookmark "
msgid "Toggle Bookmark"
msgstr "設定/取消書籤"

#: ../src/wxmedit_frame.cpp:1303
Expand Down
85 changes: 56 additions & 29 deletions src/wxmedit_frame.cpp
Expand Up @@ -115,8 +115,17 @@
#include "../images/replace.xpm"
#define replace_xpm_idx (findprev_xpm_idx+1)

#include "../images/bmktoggle.xpm"
#define bmktoggle_xpm_idx (replace_xpm_idx+1)
#include "../images/bmknext.xpm"
#define bmknext_xpm_idx (bmktoggle_xpm_idx+1)
#include "../images/bmkprev.xpm"
#define bmkprev_xpm_idx (bmknext_xpm_idx+1)
#include "../images/bmkclearall.xpm"
#define bmkclearall_xpm_idx (bmkprev_xpm_idx+1)

#include "../images/fontname.xpm"
#define fontname_xpm_idx (replace_xpm_idx+1)
#define fontname_xpm_idx (bmkclearall_xpm_idx+1)
#include "../images/fontsize.xpm"
#define fontsize_xpm_idx (fontname_xpm_idx+1)
#include "../images/font.xpm"
Expand Down Expand Up @@ -1324,11 +1333,11 @@ CommandData CommandTable[]=

{ ecInsertDateTime, 1, menuInsertDateTime, wxT("menuInsertDateTime"), _("Insert Dat&e and Time"), wxT("F7"), wxITEM_NORMAL, -1, 0, _("Insert date and time at current position")},

{ 0, 1, 0, 0, 0, 0, wxITEM_SEPARATOR, -1, 0, 0},
{ 0, 1, menuToggleBookmark, wxT("menuToggleBookmark"), _("Toggle Bookmark "), wxT("Ctrl-F2"), wxITEM_NORMAL, -1, 0, _("Toggle Bookmark at current line")},
{ 0, 1, menuGotoNextBookmark, wxT("menuGotoNextBookmark"), _("Go To Next Bookmark"), wxT("F2"), wxITEM_NORMAL, -1, 0, _("Go to the next bookmark")},
{ 0, 1, menuGotoPreviousBookmark, wxT("menuGotoPreviousBookmark"), _("Go To Previous Bookmark"), wxT("Shift-F2"), wxITEM_NORMAL, -1, 0, _("Go to the previous bookmark")},
{ 0, 1, menuClearAllBookmarks, wxT("menuClearAllBookmarks"), _("Clear All Bookmarks"), 0, wxITEM_NORMAL, -1, 0, _("Clear all bookmarks")},
{ 0, 1, 0, 0, 0, 0, wxITEM_SEPARATOR, -1, 0, 0},
{ 0, 1, menuToggleBookmark, wxT("menuToggleBookmark"), _("Toggle Bookmark"), wxT("Ctrl-F2"), wxITEM_NORMAL, bmktoggle_xpm_idx, 0, _("Toggle Bookmark at current line")},
{ 0, 1, menuGotoNextBookmark, wxT("menuGotoNextBookmark"), _("Go To Next Bookmark"), wxT("F2"), wxITEM_NORMAL, bmknext_xpm_idx, 0, _("Go to the next bookmark")},
{ 0, 1, menuGotoPreviousBookmark, wxT("menuGotoPreviousBookmark"), _("Go To Previous Bookmark"), wxT("Shift-F2"), wxITEM_NORMAL, bmkprev_xpm_idx, 0, _("Go to the previous bookmark")},
{ 0, 1, menuClearAllBookmarks, wxT("menuClearAllBookmarks"), _("Clear All Bookmarks"), 0, wxITEM_NORMAL, bmkclearall_xpm_idx, 0, _("Clear all bookmarks")},

{ 0, 1, 0, 0, 0, 0, wxITEM_SEPARATOR, -1, 0, 0},
{ 0, 1, menuAdvanced, wxT("menuAdvanced"), _("Ad&vanced"), 0, wxITEM_NORMAL, -1, &g_Menu_Edit_Advanced, 0},
Expand Down Expand Up @@ -1914,6 +1923,10 @@ void MadEditFrame::CreateGUIControls()
m_ImageList->Add(wxBitmap(findnext_xpm));
m_ImageList->Add(wxBitmap(findprev_xpm));
m_ImageList->Add(wxBitmap(replace_xpm));
m_ImageList->Add(wxBitmap(bmktoggle_xpm));
m_ImageList->Add(wxBitmap(bmknext_xpm));
m_ImageList->Add(wxBitmap(bmkprev_xpm));
m_ImageList->Add(wxBitmap(bmkclearall_xpm));
m_ImageList->Add(wxBitmap(fontname_xpm));
m_ImageList->Add(wxBitmap(fontsize_xpm));
m_ImageList->Add(wxBitmap(font_xpm));
Expand Down Expand Up @@ -2163,38 +2176,52 @@ void MadEditFrame::CreateGUIControls()

//WxToolBar1
//WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuNew, _T("New"), m_ImageList->GetBitmap(new_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("New File") );
WxToolBar1->AddTool(menuOpen, _T("Open"), m_ImageList->GetBitmap(fileopen_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Open File") );
WxToolBar1->AddTool(menuSave, _T("Save"), m_ImageList->GetBitmap(filesave_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Save File") );
WxToolBar1->AddTool(menuSaveAll, _T("SaveAll"), m_ImageList->GetBitmap(saveall_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Save All Files") );
WxToolBar1->AddTool(menuClose, _T("Close"), m_ImageList->GetBitmap(fileclose_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Close File") );
WxToolBar1->AddTool(menuCloseAll, _T("CloseAll"), m_ImageList->GetBitmap(closeall_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Close All Files") );
WxToolBar1->AddTool(menuNew, _T("New"), m_ImageList->GetBitmap(new_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("New File") );
WxToolBar1->AddTool(menuOpen, _T("Open"), m_ImageList->GetBitmap(fileopen_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Open File") );
WxToolBar1->AddTool(menuSave, _T("Save"), m_ImageList->GetBitmap(filesave_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Save File") );
WxToolBar1->AddTool(menuSaveAll, _T("SaveAll"), m_ImageList->GetBitmap(saveall_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Save All Files") );
WxToolBar1->AddTool(menuClose, _T("Close"), m_ImageList->GetBitmap(fileclose_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Close File") );
WxToolBar1->AddTool(menuCloseAll, _T("CloseAll"), m_ImageList->GetBitmap(closeall_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Close All Files") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuUndo, _T("Undo"), m_ImageList->GetBitmap(undo_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Undo") );
WxToolBar1->AddTool(menuRedo, _T("Redo"), m_ImageList->GetBitmap(redo_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Redo") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuCut, _T("Cut"), m_ImageList->GetBitmap(cut_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Cut") );
WxToolBar1->AddTool(menuCopy, _T("Copy"), m_ImageList->GetBitmap(copy_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Copy") );
WxToolBar1->AddTool(menuPaste, _T("Paste"), m_ImageList->GetBitmap(paste_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Paste") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuCut, _T("Cut"), m_ImageList->GetBitmap(cut_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Cut") );
WxToolBar1->AddTool(menuCopy, _T("Copy"), m_ImageList->GetBitmap(copy_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Copy") );
WxToolBar1->AddTool(menuPaste, _T("Paste"), m_ImageList->GetBitmap(paste_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Paste") );
WxToolBar1->AddTool(menuIncreaseIndent, _T("IncIndent"), m_ImageList->GetBitmap(indent_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Increase Indent") );
WxToolBar1->AddTool(menuDecreaseIndent, _T("DecIndent"), m_ImageList->GetBitmap(unindent_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Decrease Indent") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuIncreaseIndent, _T("IncIndent"), m_ImageList->GetBitmap(indent_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Increase Indent") );
WxToolBar1->AddTool(menuDecreaseIndent, _T("DecIndent"), m_ImageList->GetBitmap(unindent_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Decrease Indent") );
WxToolBar1->AddTool(menuComment, _T("Comment"), m_ImageList->GetBitmap(comment_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Comment") );
WxToolBar1->AddTool(menuUncomment, _T("Uncomment"), m_ImageList->GetBitmap(uncomment_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Uncomment") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuComment, _T("Comment"), m_ImageList->GetBitmap(comment_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Comment") );
WxToolBar1->AddTool(menuUncomment, _T("Uncomment"), m_ImageList->GetBitmap(uncomment_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Uncomment") );
WxToolBar1->AddTool(menuFind, _T("Find"), m_ImageList->GetBitmap(find_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Find") );
WxToolBar1->AddTool(menuFindNext, _T("FindNext"), m_ImageList->GetBitmap(findnext_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Find Next") );
WxToolBar1->AddTool(menuFindPrevious, _T("FindPrev"), m_ImageList->GetBitmap(findprev_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Find Previous") );
WxToolBar1->AddTool(menuReplace, _T("Replace"), m_ImageList->GetBitmap(replace_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Replace") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuFind, _T("Find"), m_ImageList->GetBitmap(find_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Find") );
WxToolBar1->AddTool(menuFindNext, _T("FindNext"), m_ImageList->GetBitmap(findnext_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Find Next") );
WxToolBar1->AddTool(menuFindPrevious, _T("FindPrev"), m_ImageList->GetBitmap(findprev_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Find Previous") );
WxToolBar1->AddTool(menuReplace, _T("Replace"), m_ImageList->GetBitmap(replace_xpm_idx),wxNullBitmap, wxITEM_NORMAL, _("Replace") );
WxToolBar1->AddTool(menuToggleBookmark, _T("ToggleBookmark"), m_ImageList->GetBitmap(bmktoggle_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Toggle Bookmark") );
WxToolBar1->AddTool(menuGotoNextBookmark, _T("GotoNextBookmark"), m_ImageList->GetBitmap(bmknext_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Go To Next Bookmark") );
WxToolBar1->AddTool(menuGotoPreviousBookmark, _T("GotoPreviousBookmark"), m_ImageList->GetBitmap(bmkprev_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Go To Previous Bookmark") );
WxToolBar1->AddTool(menuClearAllBookmarks, _T("ClearAllBookmarks"), m_ImageList->GetBitmap(bmkclearall_xpm_idx), wxNullBitmap, wxITEM_NORMAL, _("Clear All Bookmarks") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuNoWrap, _T("NoWrap"), m_ImageList->GetBitmap(nowrap_xpm_idx),wxNullBitmap, wxITEM_CHECK, _("No Line Wrap") );
WxToolBar1->AddTool(menuWrapByWindow, _T("WrapByWindow"), m_ImageList->GetBitmap(wrapbywin_xpm_idx),wxNullBitmap, wxITEM_CHECK, _("Wrap Lines by Window") );
WxToolBar1->AddTool(menuWrapByColumn, _T("WrapByColumn"), m_ImageList->GetBitmap(wrapbycol_xpm_idx),wxNullBitmap, wxITEM_CHECK, _("Wrap Lines by Max Columns") );
WxToolBar1->AddTool(menuNoWrap, _T("NoWrap"), m_ImageList->GetBitmap(nowrap_xpm_idx), wxNullBitmap, wxITEM_CHECK, _("No Line Wrap") );
WxToolBar1->AddTool(menuWrapByWindow, _T("WrapByWindow"), m_ImageList->GetBitmap(wrapbywin_xpm_idx), wxNullBitmap, wxITEM_CHECK, _("Wrap Lines by Window") );
WxToolBar1->AddTool(menuWrapByColumn, _T("WrapByColumn"), m_ImageList->GetBitmap(wrapbycol_xpm_idx), wxNullBitmap, wxITEM_CHECK, _("Wrap Lines by Max Columns") );

WxToolBar1->AddSeparator();
WxToolBar1->AddTool(menuTextMode, _T("TextMode"), m_ImageList->GetBitmap(textmode_xpm_idx),wxNullBitmap, wxITEM_CHECK, _("Text Mode") );
WxToolBar1->AddTool(menuColumnMode, _T("ColumnMode"), m_ImageList->GetBitmap(columnmode_xpm_idx),wxNullBitmap, wxITEM_CHECK, _("Column Mode") );
WxToolBar1->AddTool(menuHexMode, _T("HexMode"), m_ImageList->GetBitmap(hexmode_xpm_idx),wxNullBitmap, wxITEM_CHECK, _("Hex Mode") );
WxToolBar1->AddTool(menuTextMode, _T("TextMode"), m_ImageList->GetBitmap(textmode_xpm_idx), wxNullBitmap, wxITEM_CHECK, _("Text Mode") );
WxToolBar1->AddTool(menuColumnMode, _T("ColumnMode"), m_ImageList->GetBitmap(columnmode_xpm_idx), wxNullBitmap, wxITEM_CHECK, _("Column Mode") );
WxToolBar1->AddTool(menuHexMode, _T("HexMode"), m_ImageList->GetBitmap(hexmode_xpm_idx), wxNullBitmap, wxITEM_CHECK, _("Hex Mode") );

WxToolBar1->Realize();

//WxToolBar1->EnableTool(wxID_NEW, false);
Expand Down

0 comments on commit 5af68c4

Please sign in to comment.