From: John L. <jr...@us...> - 2009-02-21 03:16:38
|
Update of /cvsroot/wxlua/wxLua/samples In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4972/samples Modified Files: scribble.wx.lua Log Message: better comments Index: scribble.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/scribble.wx.lua,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** scribble.wx.lua 22 Jan 2008 04:45:39 -0000 1.25 --- scribble.wx.lua 21 Feb 2009 02:05:01 -0000 1.26 *************** *** 315,320 **** -- Create the menubar local fileMenu = wx.wxMenu() ! fileMenu:Append(wx.wxID_NEW, "&New...\tCtrl+N", "Begin a new drawing") ! fileMenu:Append(wx.wxID_OPEN, "&Open...\tCtrl+O", "Open an existing drawing") fileMenu:AppendSeparator() fileMenu:Append(wx.wxID_SAVE, "&Save\tCtrl+S", "Save the drawing lines") --- 315,320 ---- -- Create the menubar local fileMenu = wx.wxMenu() ! fileMenu:Append(wx.wxID_NEW, "&New...\tCtrl+N", "Begin a new drawing") ! fileMenu:Append(wx.wxID_OPEN, "&Open...\tCtrl+O", "Open an existing drawing") fileMenu:AppendSeparator() fileMenu:Append(wx.wxID_SAVE, "&Save\tCtrl+S", "Save the drawing lines") *************** *** 322,331 **** fileMenu:Append(ID_SAVEBITMAP, "Save &bitmap...", "Save the drawing as a bitmap file") fileMenu:AppendSeparator() ! fileMenu:Append(wx.wxID_EXIT, "E&xit\tCtrl+Q", "Quit the program") local editMenu = wx.wxMenu() editMenu:Append(ID_PENCOLOUR, "Set pen &color\tCtrl+R", "Set the color of the pen to draw with") editMenu:Append(ID_PENWIDTH, "Set pen &width\tCtrl+T", "Set width of the pen to draw with") ! -- Styles really only work for long lines, when you change direction the styles -- blur into each other and just look like a solid line. --editMenu:Append(ID_PENSTYLE, "Set &Style\tCtrl+Y", "Set style of the pen to draw with") --- 322,331 ---- fileMenu:Append(ID_SAVEBITMAP, "Save &bitmap...", "Save the drawing as a bitmap file") fileMenu:AppendSeparator() ! fileMenu:Append(wx.wxID_EXIT, "E&xit\tCtrl+Q", "Quit the program") local editMenu = wx.wxMenu() editMenu:Append(ID_PENCOLOUR, "Set pen &color\tCtrl+R", "Set the color of the pen to draw with") editMenu:Append(ID_PENWIDTH, "Set pen &width\tCtrl+T", "Set width of the pen to draw with") ! -- Pen styles really only work for long lines, when you change direction the styles -- blur into each other and just look like a solid line. --editMenu:Append(ID_PENSTYLE, "Set &Style\tCtrl+Y", "Set style of the pen to draw with") *************** *** 347,352 **** -- Create the toolbar toolBar = frame:CreateToolBar(wx.wxNO_BORDER + wx.wxTB_FLAT + wx.wxTB_DOCKABLE) ! -- note: Ususally the bmp size isn't necessary, but the HELP icon is not the right size in MSW local toolBmpSize = toolBar:GetToolBitmapSize() toolBar:AddTool(wx.wxID_NEW, "New", wx.wxArtProvider.GetBitmap(wx.wxART_NORMAL_FILE, wx.wxART_MENU, toolBmpSize), "Create an empty scribble") toolBar:AddTool(wx.wxID_OPEN, "Open", wx.wxArtProvider.GetBitmap(wx.wxART_FILE_OPEN, wx.wxART_MENU, toolBmpSize), "Open an existing scribble") --- 347,355 ---- -- Create the toolbar toolBar = frame:CreateToolBar(wx.wxNO_BORDER + wx.wxTB_FLAT + wx.wxTB_DOCKABLE) ! -- Note: Ususally the bmp size isn't necessary, but the HELP icon is not the right size in MSW local toolBmpSize = toolBar:GetToolBitmapSize() + -- Note: Each temp bitmap returned by the wxArtProvider needs to be garbage collected + -- and there is no way to call delete() on them. See collectgarbage("collect") + -- at the end of this function. toolBar:AddTool(wx.wxID_NEW, "New", wx.wxArtProvider.GetBitmap(wx.wxART_NORMAL_FILE, wx.wxART_MENU, toolBmpSize), "Create an empty scribble") toolBar:AddTool(wx.wxID_OPEN, "Open", wx.wxArtProvider.GetBitmap(wx.wxART_FILE_OPEN, wx.wxART_MENU, toolBmpSize), "Open an existing scribble") *************** *** 354,363 **** toolBar:AddTool(wx.wxID_SAVEAS, "Save as", wx.wxArtProvider.GetBitmap(wx.wxART_NEW_DIR, wx.wxART_MENU, toolBmpSize), "Save the current scribble to a new file") toolBar:AddSeparator() ! toolBar:AddTool(wx.wxID_COPY, "Copy", wx.wxArtProvider.GetBitmap(wx.wxART_COPY, wx.wxART_MENU, toolBmpSize), "Copy image to clipboard") toolBar:AddSeparator() ! toolBar:AddTool(wx.wxID_UNDO, "Undo", wx.wxArtProvider.GetBitmap(wx.wxART_UNDO, wx.wxART_MENU, toolBmpSize), "Undo last line drawn") toolBar:AddSeparator() ! penWidthSpinCtrl = wx.wxSpinCtrl(toolBar, ID_PENWIDTH_SPINCTRL, "3", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxSP_ARROW_KEYS, 1, 100, currentPen:GetWidth()) --- 357,366 ---- toolBar:AddTool(wx.wxID_SAVEAS, "Save as", wx.wxArtProvider.GetBitmap(wx.wxART_NEW_DIR, wx.wxART_MENU, toolBmpSize), "Save the current scribble to a new file") toolBar:AddSeparator() ! toolBar:AddTool(wx.wxID_COPY, "Copy", wx.wxArtProvider.GetBitmap(wx.wxART_COPY, wx.wxART_MENU, toolBmpSize), "Copy image to clipboard") toolBar:AddSeparator() ! toolBar:AddTool(wx.wxID_UNDO, "Undo", wx.wxArtProvider.GetBitmap(wx.wxART_UNDO, wx.wxART_MENU, toolBmpSize), "Undo last line drawn") toolBar:AddSeparator() ! penWidthSpinCtrl = wx.wxSpinCtrl(toolBar, ID_PENWIDTH_SPINCTRL, tostring(currentPen:GetWidth()), wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxSP_ARROW_KEYS, 1, 100, currentPen:GetWidth()) |