From: John L. <jr...@us...> - 2007-05-09 01:40:26
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24417/wxLua/samples Modified Files: editor.wx.lua Log Message: Rearrange a few menu items and add more accelerators Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** editor.wx.lua 9 Mar 2007 06:10:20 -0000 1.45 --- editor.wx.lua 9 May 2007 01:40:22 -0000 1.46 *************** *** 43,50 **** local ID_NEW = wx.wxID_NEW local ID_OPEN = wx.wxID_OPEN local ID_SAVE = wx.wxID_SAVE local ID_SAVEAS = wx.wxID_SAVEAS local ID_SAVEALL = NewID() - local ID_CLOSE = NewID() local ID_EXIT = wx.wxID_EXIT -- Edit menu --- 43,50 ---- local ID_NEW = wx.wxID_NEW local ID_OPEN = wx.wxID_OPEN + local ID_CLOSE = NewID() local ID_SAVE = wx.wxID_SAVE local ID_SAVEAS = wx.wxID_SAVEAS local ID_SAVEALL = NewID() local ID_EXIT = wx.wxID_EXIT -- Edit menu *************** *** 57,61 **** local ID_AUTOCOMPLETE = NewID() local ID_AUTOCOMPLETE_ENABLE = NewID() - local ID_CLEAROUTPUT = NewID() local ID_COMMENT = NewID() local ID_FOLD = NewID() --- 57,60 ---- *************** *** 73,76 **** --- 72,77 ---- local ID_ATTACH_DEBUG = NewID() local ID_START_DEBUG = NewID() + local ID_USECONSOLE = NewID() + local ID_STOP_DEBUG = NewID() local ID_STEP = NewID() *************** *** 82,86 **** local ID_VIEWWATCHWINDOW = NewID() local ID_SHOWHIDEWINDOW = NewID() ! local ID_USECONSOLE = NewID() -- Help menu local ID_ABOUT = wx.wxID_ABOUT --- 83,87 ---- local ID_VIEWWATCHWINDOW = NewID() local ID_SHOWHIDEWINDOW = NewID() ! local ID_CLEAROUTPUT = NewID() -- Help menu local ID_ABOUT = wx.wxID_ABOUT *************** *** 132,136 **** editorID = 100 -- window id to create editor pages with, incremented for new editors exitingProgram = false -- are we currently exiting, ID_EXIT ! autoCompleteEnable = true wxkeywords = nil -- a string of the keywords for scintilla of wxLua's wx.XXX items font = nil -- fonts to use for the editor --- 133,137 ---- editorID = 100 -- window id to create editor pages with, incremented for new editors exitingProgram = false -- are we currently exiting, ID_EXIT ! autoCompleteEnable = true -- value of ID_AUTOCOMPLETE_ENABLE menu item wxkeywords = nil -- a string of the keywords for scintilla of wxLua's wx.XXX items font = nil -- fonts to use for the editor *************** *** 820,827 **** { ID_NEW, "&New\tCtrl-N", "Create an empty document" }, { ID_OPEN, "&Open...\tCtrl-O", "Open an existing document" }, { ID_SAVE, "&Save\tCtrl-S", "Save the current document" }, { ID_SAVEAS, "Save &As...\tAlt-S", "Save the current document to a file with a new name" }, { ID_SAVEALL, "Save A&ll...\tCtrl-Shift-S", "Save all open documents" }, - { ID_CLOSE, "&Close page\tCtrl+W", "Close the current editor window" }, { }, { ID_EXIT, "E&xit\tAlt-X", "Exit Program" }} --- 821,829 ---- { ID_NEW, "&New\tCtrl-N", "Create an empty document" }, { ID_OPEN, "&Open...\tCtrl-O", "Open an existing document" }, + { ID_CLOSE, "&Close page\tCtrl+W", "Close the current editor window" }, + { }, { ID_SAVE, "&Save\tCtrl-S", "Save the current document" }, { ID_SAVEAS, "Save &As...\tAlt-S", "Save the current document to a file with a new name" }, { ID_SAVEALL, "Save A&ll...\tCtrl-Shift-S", "Save all open documents" }, { }, { ID_EXIT, "E&xit\tAlt-X", "Exit Program" }} *************** *** 1116,1131 **** { ID_COPY, "&Copy\tCtrl-C", "Copy selected text to the clipboard" }, { ID_PASTE, "&Paste\tCtrl-V", "Insert clipboard text at cursor" }, ! { ID_SELECTALL, "Select &All\tCtrl-A", "Select all text in the editor" }, { }, { ID_UNDO, "&Undo\tCtrl-Z", "Undo the last action" }, { ID_REDO, "&Redo\tCtrl-Y", "Redo the last action undone" }, { }, ! { ID_AUTOCOMPLETE, "Complete Identifier\tCtrl+K", "Complete the current identifier" }, { ID_AUTOCOMPLETE_ENABLE, "Auto complete Identifiers", "Auto complete while typing", wx.wxITEM_CHECK }, { }, ! { ID_COMMENT, "Comment/Uncomment\tCtrl-Q", "Comment or uncomment current or selected lines"}, ! { ID_FOLD, "Fold/Unfold all\tF12", "Fold or unfold all code folds"}, { }, ! { ID_CLEAROUTPUT, "Clear output", "Clear the output window" } } menuBar:Append(editMenu, "&Edit") --- 1118,1132 ---- { ID_COPY, "&Copy\tCtrl-C", "Copy selected text to the clipboard" }, { ID_PASTE, "&Paste\tCtrl-V", "Insert clipboard text at cursor" }, ! { ID_SELECTALL, "Select A&ll\tCtrl-A", "Select all text in the editor" }, { }, { ID_UNDO, "&Undo\tCtrl-Z", "Undo the last action" }, { ID_REDO, "&Redo\tCtrl-Y", "Redo the last action undone" }, { }, ! { ID_AUTOCOMPLETE, "Complete &Identifier\tCtrl+K", "Complete the current identifier" }, { ID_AUTOCOMPLETE_ENABLE, "Auto complete Identifiers", "Auto complete while typing", wx.wxITEM_CHECK }, { }, ! { ID_COMMENT, "C&omment/Uncomment\tCtrl-Q", "Comment or uncomment current or selected lines"}, { }, ! { ID_FOLD, "&Fold/Unfold all\tF12", "Fold or unfold all code folds"} } menuBar:Append(editMenu, "&Edit") *************** *** 1207,1222 **** end) - function ClearOutput(event) - errorLog:SetReadOnly(false) - errorLog:ClearAll() - errorLog:SetReadOnly(true) - end - - frame:Connect(ID_CLEAROUTPUT, wx.wxEVT_COMMAND_MENU_SELECTED, ClearOutput) - frame:Connect(ID_CLEAROUTPUT, wx.wxEVT_UPDATE_UI, - function(event) - event:Enable(errorLog and errorLog:IsShown()) - end) - frame:Connect(ID_COMMENT, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) --- 1208,1211 ---- *************** *** 1637,1659 **** debugMenu = wx.wxCreateMenu{ ! { ID_TOGGLEBREAKPOINT, "Toggle Breakpoint\tF9", "Toggle Breakpoint" }, { }, ! { ID_COMPILE, "Compile\tF7", "Test compile the wxLua program" }, ! { ID_RUN, "Run\tF6", "Execute the current file" }, ! { ID_ATTACH_DEBUG, "Attach\tShift-F6", "Allow a client to start a debugging session" }, ! { ID_START_DEBUG, "Start Debugging\tShift-F5", "Start a debugging session" }, { ID_USECONSOLE, "Console", "Use console when running", wx.wxITEM_CHECK }, { }, ! { ID_STOP_DEBUG, "Stop Debugging\tShift-F12", "Stop and end the debugging session" }, ! { ID_STEP, "Step\tF11", "Step into the next line" }, ! { ID_STEP_OVER, "Step Over\tShift-F11", "Step over the next line" }, ! { ID_STEP_OUT, "Step Out\tF8", "Step out of the current function" }, ! { ID_CONTINUE, "Continue\tF5", "Run the program at full speed" }, ! { ID_BREAK, "Break\tF12", "Stop execution of the program at the next executed line of code" }, { }, ! { ID_VIEWCALLSTACK, "View Call Stack", "View the LUA call stack" }, ! { ID_VIEWWATCHWINDOW, "View Watches", "View the Watch window" }, { }, ! { ID_SHOWHIDEWINDOW, "View Output Window\tF8", "View or Hide the output window"}} menuBar:Append(debugMenu, "&Debug") --- 1626,1649 ---- debugMenu = wx.wxCreateMenu{ ! { ID_TOGGLEBREAKPOINT, "Toggle &Breakpoint\tF9", "Toggle Breakpoint" }, { }, ! { ID_COMPILE, "&Compile\tF7", "Test compile the wxLua program" }, ! { ID_RUN, "&Run\tF6", "Execute the current file" }, ! { ID_ATTACH_DEBUG, "&Attach\tShift-F6", "Allow a client to start a debugging session" }, ! { ID_START_DEBUG, "&Start Debugging\tShift-F5", "Start a debugging session" }, { ID_USECONSOLE, "Console", "Use console when running", wx.wxITEM_CHECK }, { }, ! { ID_STOP_DEBUG, "S&top Debugging\tShift-F12", "Stop and end the debugging session" }, ! { ID_STEP, "St&ep\tF11", "Step into the next line" }, ! { ID_STEP_OVER, "Step &Over\tShift-F11", "Step over the next line" }, ! { ID_STEP_OUT, "Step O&ut\tF8", "Step out of the current function" }, ! { ID_CONTINUE, "Co&ntinue\tF5", "Run the program at full speed" }, ! { ID_BREAK, "&Break\tF12", "Stop execution of the program at the next executed line of code" }, { }, ! { ID_VIEWCALLSTACK, "V&iew Call Stack", "View the LUA call stack" }, ! { ID_VIEWWATCHWINDOW, "View &Watches", "View the Watch window" }, { }, ! { ID_SHOWHIDEWINDOW, "View &Output Window\tF8", "View or Hide the output window" }, ! { ID_CLEAROUTPUT, "C&lear output", "Clear the output window" } } menuBar:Append(debugMenu, "&Debug") *************** *** 2161,2167 **** end) ! frame:Connect(ID_USECONSOLE, wx.wxEVT_COMMAND_MENU_SELECTED, ! function (event) ! menuBar:Check(ID_USECONSOLE, menuBar:IsChecked(ID_USECONSOLE)) end) --- 2151,2164 ---- end) ! function ClearOutput(event) ! errorLog:SetReadOnly(false) ! errorLog:ClearAll() ! errorLog:SetReadOnly(true) ! end ! ! frame:Connect(ID_CLEAROUTPUT, wx.wxEVT_COMMAND_MENU_SELECTED, ClearOutput) ! frame:Connect(ID_CLEAROUTPUT, wx.wxEVT_UPDATE_UI, ! function(event) ! event:Enable(errorLog and errorLog:IsShown()) end) *************** *** 2169,2172 **** --- 2166,2173 ---- -- Create the Help menu and attach the callback functions + helpMenu = wx.wxCreateMenu{ + { ID_ABOUT, "&About\tF1", "About wxLua IDE" }} + menuBar:Append(helpMenu, "&Help") + function DisplayAbout(event) local page = [[ *************** *** 2240,2247 **** end - helpMenu = wx.wxCreateMenu{ - { ID_ABOUT, "&About\tF1", "About wxLua IDE" }} - menuBar:Append(helpMenu, "&Help") - frame:Connect(ID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED, DisplayAbout) --- 2241,2244 ---- |