Updates for new wxToolBar API

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-03-27 01:10:28 +00:00
parent be86ffe39e
commit c12de7f83a
8 changed files with 45 additions and 48 deletions

View File

@@ -21,28 +21,27 @@ class TestFloatBar(wxFrame):
tb.SetTitle("Floating!") tb.SetTitle("Floating!")
self.CreateStatusBar() self.CreateStatusBar()
tb.AddSimpleTool(10, images.getNewBitmap(), "New", "Long help for 'New'") tb.AddSimpleTool(10, '', images.getNewBitmap(), "New", "Long help for 'New'")
EVT_TOOL(self, 10, self.OnToolClick) EVT_TOOL(self, 10, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick)
tb.AddSimpleTool(20, images.getOpenBitmap(), "Open") tb.AddSimpleTool(20, '', images.getOpenBitmap(), "Open")
EVT_TOOL(self, 20, self.OnToolClick) EVT_TOOL(self, 20, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick)
tb.AddSeparator() tb.AddSeparator()
tb.AddSimpleTool(30, images.getCopyBitmap(), "Copy") tb.AddSimpleTool(30, '', images.getCopyBitmap(), "Copy")
EVT_TOOL(self, 30, self.OnToolClick) EVT_TOOL(self, 30, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick)
tb.AddSimpleTool(40, images.getPasteBitmap(), "Paste") tb.AddSimpleTool(40, '', images.getPasteBitmap(), "Paste")
EVT_TOOL(self, 40, self.OnToolClick) EVT_TOOL(self, 40, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick)
tb.AddSeparator() tb.AddSeparator()
tb.AddTool(60, images.getTog1Bitmap(), images.getTog2Bitmap(), tb.AddCheckTool(60, '', images.getTog1Bitmap(), images.getTog2Bitmap())
shortHelpString="Toggle with 2 bitmaps", isToggle=true)
EVT_TOOL(self, 60, self.OnToolClick) EVT_TOOL(self, 60, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 60, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 60, self.OnToolRClick)
tb.Realize() tb.Realize()
@@ -65,8 +64,6 @@ class TestFloatBar(wxFrame):
def OnToolRClick(self, event): def OnToolRClick(self, event):
self.log.WriteText("tool %s right-clicked\n" % event.GetId()) self.log.WriteText("tool %s right-clicked\n" % event.GetId())
# def test(self, event):
# self.log.WriteText("Button clicked!")
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------

View File

@@ -23,32 +23,32 @@ class TestToolBar(wxFrame):
self.CreateStatusBar() self.CreateStatusBar()
tb.AddSimpleTool(10, images.getNewBitmap(), "New", "Long help for 'New'") tb.AddSimpleTool(10, '', images.getNewBitmap(), "New", "Long help for 'New'")
EVT_TOOL(self, 10, self.OnToolClick) EVT_TOOL(self, 10, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick)
tb.AddSimpleTool(20, images.getOpenBitmap(), "Open", "Long help for 'Open'") tb.AddSimpleTool(20, '', images.getOpenBitmap(), "Open", "Long help for 'Open'")
EVT_TOOL(self, 20, self.OnToolClick) EVT_TOOL(self, 20, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick)
tb.AddSeparator() tb.AddSeparator()
tb.AddSimpleTool(30, images.getCopyBitmap(), "Copy", "Long help for 'Copy'") tb.AddSimpleTool(30, '', images.getCopyBitmap(), "Copy", "Long help for 'Copy'")
EVT_TOOL(self, 30, self.OnToolClick) EVT_TOOL(self, 30, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick)
tb.AddSimpleTool(40, images.getPasteBitmap(), "Paste", "Long help for 'Paste'") tb.AddSimpleTool(40, '', images.getPasteBitmap(), "Paste", "Long help for 'Paste'")
EVT_TOOL(self, 40, self.OnToolClick) EVT_TOOL(self, 40, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick) EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick)
tb.AddSeparator() tb.AddSeparator()
tool = tb.AddTool(50, images.getTog1Bitmap(), tool = tb.AddCheckTool(50, '', images.getTog1Bitmap(),
shortHelpString="Toggle this", isToggle=true) shortHelp="Toggle this")
EVT_TOOL(self, 50, self.OnToolClick) EVT_TOOL(self, 50, self.OnToolClick)
tb.AddTool(60, images.getTog1Bitmap(), images.getTog2Bitmap(), #tb.AddCheckTool(60, '', images.getTog1Bitmap(), images.getTog2Bitmap(),
shortHelpString="Toggle with 2 bitmaps", isToggle=true) # shortHelp="Toggle with 2 bitmaps")
EVT_TOOL(self, 60, self.OnToolClick) #EVT_TOOL(self, 60, self.OnToolClick)
EVT_TOOL_ENTER(self, -1, self.OnToolEnter) EVT_TOOL_ENTER(self, -1, self.OnToolEnter)
EVT_TOOL_RCLICKED(self, -1, self.OnToolRClick) # Match all EVT_TOOL_RCLICKED(self, -1, self.OnToolRClick) # Match all

View File

@@ -69,7 +69,7 @@ Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwayssk
Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core
;;%(MSLU)s %(MSLU)s
Source: "wxPython\wxc.pyd"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\wxc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\wxc.pyd.manifest"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\wxc.pyd.manifest"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\gridc.pyd"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\gridc.pyd"; DestDir: "{app}\wxPython"; Components: core
@@ -310,8 +310,8 @@ def main():
PYVER = PYVER + "-hybrid" PYVER = PYVER + "-hybrid"
MSLU='' MSLU=''
## if len(sys.argv) > 1 and sys.argv[1] == "UNICODE=1": if len(sys.argv) > 1 and sys.argv[1] == "UNICODE=1":
## MSLU=r'Source: "%(WXDIR)s\lib\unicows.dll"; DestDir: "{app}\wxPython"; Components: core' % vars() MSLU=r'Source: "%(WXDIR)s\lib\unicows.dll"; DestDir: "{code:GetPythonDir}"; Components: core' % vars()
f = open(ISSFILE, "w") f = open(ISSFILE, "w")
f.write(ISS_Template % vars()) f.write(ISS_Template % vars())

View File

@@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree
# flags and values that affect this script # flags and values that affect this script
#---------------------------------------------------------------------- #----------------------------------------------------------------------
VERSION = "2.3.3pre2u" VERSION = "2.3.3pre2"
DESCRIPTION = "Cross platform GUI toolkit for Python" DESCRIPTION = "Cross platform GUI toolkit for Python"
AUTHOR = "Robin Dunn" AUTHOR = "Robin Dunn"
AUTHOR_EMAIL = "Robin Dunn <robin@alldunn.com>" AUTHOR_EMAIL = "Robin Dunn <robin@alldunn.com>"

View File

@@ -1 +1 @@
ver = '2.3.3pre2u' ver = '2.3.3pre2'

View File

@@ -1748,8 +1748,8 @@ static PyObject *_wrap_wxToolBarBase_AddCheckTool(PyObject *self, PyObject *args
wxString * _arg2; wxString * _arg2;
wxBitmap * _arg3; wxBitmap * _arg3;
wxBitmap * _arg4 = (wxBitmap *) &wxNullBitmap; wxBitmap * _arg4 = (wxBitmap *) &wxNullBitmap;
wxString * _arg5 = (wxString *) &wxEmptyString; wxString * _arg5 = (wxString *) &wxPyEmptyString;
wxString * _arg6 = (wxString *) &wxEmptyString; wxString * _arg6 = (wxString *) &wxPyEmptyString;
PyObject * _arg7 = (PyObject *) NULL; PyObject * _arg7 = (PyObject *) NULL;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj2 = 0; PyObject * _obj2 = 0;
@@ -1842,8 +1842,8 @@ static PyObject *_wrap_wxToolBarBase_AddRadioTool(PyObject *self, PyObject *args
wxString * _arg2; wxString * _arg2;
wxBitmap * _arg3; wxBitmap * _arg3;
wxBitmap * _arg4 = (wxBitmap *) &wxNullBitmap; wxBitmap * _arg4 = (wxBitmap *) &wxNullBitmap;
wxString * _arg5 = (wxString *) &wxEmptyString; wxString * _arg5 = (wxString *) &wxPyEmptyString;
wxString * _arg6 = (wxString *) &wxEmptyString; wxString * _arg6 = (wxString *) &wxPyEmptyString;
PyObject * _arg7 = (PyObject *) NULL; PyObject * _arg7 = (PyObject *) NULL;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj2 = 0; PyObject * _obj2 = 0;
@@ -1938,8 +1938,8 @@ static PyObject *_wrap_wxToolBarBase_InsertTool(PyObject *self, PyObject *args,
wxBitmap * _arg4; wxBitmap * _arg4;
wxBitmap * _arg5 = (wxBitmap *) &wxNullBitmap; wxBitmap * _arg5 = (wxBitmap *) &wxNullBitmap;
wxItemKind _arg6 = (wxItemKind ) wxITEM_NORMAL; wxItemKind _arg6 = (wxItemKind ) wxITEM_NORMAL;
wxString * _arg7 = (wxString *) &wxEmptyString; wxString * _arg7 = (wxString *) &wxPyEmptyString;
wxString * _arg8 = (wxString *) &wxEmptyString; wxString * _arg8 = (wxString *) &wxPyEmptyString;
PyObject * _arg9 = (PyObject *) NULL; PyObject * _arg9 = (PyObject *) NULL;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj3 = 0; PyObject * _obj3 = 0;
@@ -2030,8 +2030,8 @@ static PyObject *_wrap_wxToolBarBase_InsertSimpleTool(PyObject *self, PyObject *
wxString * _arg3; wxString * _arg3;
wxBitmap * _arg4; wxBitmap * _arg4;
wxItemKind _arg5 = (wxItemKind ) wxITEM_NORMAL; wxItemKind _arg5 = (wxItemKind ) wxITEM_NORMAL;
wxString * _arg6 = (wxString *) &wxEmptyString; wxString * _arg6 = (wxString *) &wxPyEmptyString;
wxString * _arg7 = (wxString *) &wxEmptyString; wxString * _arg7 = (wxString *) &wxPyEmptyString;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj3 = 0; PyObject * _obj3 = 0;
PyObject * _argo4 = 0; PyObject * _argo4 = 0;

View File

@@ -206,8 +206,8 @@ public:
const wxString& label, const wxString& label,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxPyEmptyString,
const wxString& longHelp = wxEmptyString, const wxString& longHelp = wxPyEmptyString,
PyObject *clientData = NULL) PyObject *clientData = NULL)
{ {
wxPyUserData* udata = NULL; wxPyUserData* udata = NULL;
@@ -223,8 +223,8 @@ public:
const wxString& label, const wxString& label,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxPyEmptyString,
const wxString& longHelp = wxEmptyString, const wxString& longHelp = wxPyEmptyString,
PyObject *clientData = NULL) PyObject *clientData = NULL)
{ {
wxPyUserData* udata = NULL; wxPyUserData* udata = NULL;
@@ -242,8 +242,8 @@ public:
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap,
wxItemKind kind = wxITEM_NORMAL, wxItemKind kind = wxITEM_NORMAL,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxPyEmptyString,
const wxString& longHelp = wxEmptyString, const wxString& longHelp = wxPyEmptyString,
PyObject *clientData = NULL) PyObject *clientData = NULL)
{ {
wxPyUserData* udata = NULL; wxPyUserData* udata = NULL;
@@ -259,8 +259,8 @@ public:
const wxString& label, const wxString& label,
const wxBitmap& bitmap, const wxBitmap& bitmap,
wxItemKind kind = wxITEM_NORMAL, wxItemKind kind = wxITEM_NORMAL,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxPyEmptyString,
const wxString& longHelp = wxEmptyString) const wxString& longHelp = wxPyEmptyString)
{ {
return self->InsertTool(pos, id, label, bitmap, wxNullBitmap, kind, return self->InsertTool(pos, id, label, bitmap, wxNullBitmap, kind,
shortHelp, longHelp); shortHelp, longHelp);

View File

@@ -1058,18 +1058,18 @@ class Frame(wxFrame):
# Create toolbar # Create toolbar
tb = self.CreateToolBar(wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT) tb = self.CreateToolBar(wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT)
tb.SetToolBitmapSize((24, 23)) tb.SetToolBitmapSize((24, 23))
tb.AddSimpleTool(wxID_NEW, images.getNewBitmap(), 'New', 'New file') tb.AddSimpleTool(wxID_NEW, '', images.getNewBitmap(), 'New', 'New file')
tb.AddSimpleTool(wxID_OPEN, images.getOpenBitmap(), 'Open', 'Open file') tb.AddSimpleTool(wxID_OPEN, '', images.getOpenBitmap(), 'Open', 'Open file')
tb.AddSimpleTool(wxID_SAVE, images.getSaveBitmap(), 'Save', 'Save file') tb.AddSimpleTool(wxID_SAVE, '', images.getSaveBitmap(), 'Save', 'Save file')
tb.AddControl(wxStaticLine(tb, -1, size=(-1,23), style=wxLI_VERTICAL)) tb.AddControl(wxStaticLine(tb, -1, size=(-1,23), style=wxLI_VERTICAL))
tb.AddSimpleTool(wxID_CUT, images.getCutBitmap(), 'Cut', 'Cut') tb.AddSimpleTool(wxID_CUT, '', images.getCutBitmap(), 'Cut', 'Cut')
tb.AddSimpleTool(wxID_COPY, images.getCopyBitmap(), 'Copy', 'Copy') tb.AddSimpleTool(wxID_COPY, '', images.getCopyBitmap(), 'Copy', 'Copy')
tb.AddSimpleTool(wxID_PASTE, images.getPasteBitmap(), 'Paste', 'Paste') tb.AddSimpleTool(wxID_PASTE, '', images.getPasteBitmap(), 'Paste', 'Paste')
tb.AddControl(wxStaticLine(tb, -1, size=(-1,23), style=wxLI_VERTICAL)) tb.AddControl(wxStaticLine(tb, -1, size=(-1,23), style=wxLI_VERTICAL))
tb.AddSimpleTool(self.ID_TEST, images.getTestBitmap(), 'Test', 'Test window') tb.AddSimpleTool(self.ID_TEST, '', images.getTestBitmap(), 'Test', 'Test window')
tb.AddSimpleTool(self.ID_REFRESH, images.getRefreshBitmap(), tb.AddSimpleTool(self.ID_REFRESH, '', images.getRefreshBitmap(),
'Refresh', 'Refresh view') 'Refresh', 'Refresh view')
tb.AddSimpleTool(self.ID_AUTO_REFRESH, images.getAutoRefreshBitmap(), tb.AddSimpleTool(self.ID_AUTO_REFRESH, '', images.getAutoRefreshBitmap(),
'Auto-refresh', 'Toggle auto-refresh mode', true) 'Auto-refresh', 'Toggle auto-refresh mode', true)
if wxGetOsVersion()[0] == wxGTK: if wxGetOsVersion()[0] == wxGTK:
tb.AddSeparator() # otherwise auto-refresh sticks in status line tb.AddSeparator() # otherwise auto-refresh sticks in status line
@@ -1910,7 +1910,7 @@ class App(wxApp):
wc.Flush() wc.Flush()
def main(): def main():
app = App() app = App(0)
app.MainLoop() app.MainLoop()
app.OnExit() app.OnExit()