mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-10 05:47:09 +01:00
Add toolbar
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -142,6 +142,7 @@ INCLUDES = [ 'defs',
|
||||
'spinctrl',
|
||||
'tglbtn',
|
||||
'scrolbar',
|
||||
'toolbar',
|
||||
|
||||
# toplevel and dialogs
|
||||
'nonownedwnd',
|
||||
|
||||
@@ -71,7 +71,6 @@ def run():
|
||||
class wxDropTarget;
|
||||
class wxCaret;
|
||||
class wxImageHandler;
|
||||
class wxToolBar;
|
||||
class wxExecuteEnv;
|
||||
"""))
|
||||
|
||||
|
||||
@@ -32,11 +32,7 @@ def run():
|
||||
|
||||
c = module.find('wxFrame')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
# TODO: Remove these when wxToolBar is added to Phoenix
|
||||
module.addGlobalStr('wxToolBarNameStr', c)
|
||||
module.insertItemBefore(c, etgtools.GlobalVarDef(type='const int', name='wxTB_HORIZONTAL'))
|
||||
|
||||
|
||||
c.find('wxFrame.title').default = 'wxEmptyString'
|
||||
c.find('Create.title').default = 'wxEmptyString'
|
||||
|
||||
|
||||
58
etg/toolbar.py
Normal file
58
etg/toolbar.py
Normal file
@@ -0,0 +1,58 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/toolbar.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 07-Mar-2012
|
||||
# Copyright: (c) 2012 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_core"
|
||||
NAME = "toolbar" # Base name of the file to generate to for this script
|
||||
DOCSTRING = ""
|
||||
|
||||
# The classes and/or the basename of the Doxygen XML files to be processed by
|
||||
# this script.
|
||||
ITEMS = [ "wxToolBarToolBase",
|
||||
"wxToolBar",
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def run():
|
||||
# Parse the XML file(s) building a collection of Extractor objects
|
||||
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
|
||||
etgtools.parseDoxyXML(module, ITEMS)
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
# Tweak the parsed meta objects in the module object as needed for
|
||||
# customizing the generated code and docstrings.
|
||||
|
||||
module.insertItem(0, etgtools.WigCode("""\
|
||||
// forward declarations
|
||||
class wxToolBarBase;
|
||||
"""))
|
||||
|
||||
c = module.find('wxToolBarToolBase')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
c.abstract = True
|
||||
module.addGlobalStr('wxToolBarNameStr', c)
|
||||
|
||||
|
||||
c = module.find('wxToolBar')
|
||||
c.find('SetBitmapResource').ignore()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
38
unittests/test_toolbar.py
Normal file
38
unittests/test_toolbar.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class toolbar_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_toolbar1(self):
|
||||
wx.TOOL_STYLE_BUTTON
|
||||
wx.TOOL_STYLE_SEPARATOR
|
||||
wx.TOOL_STYLE_CONTROL
|
||||
|
||||
wx.TB_HORIZONTAL
|
||||
wx.TB_VERTICAL
|
||||
wx.TB_TOP
|
||||
wx.TB_LEFT
|
||||
wx.TB_BOTTOM
|
||||
wx.TB_RIGHT
|
||||
|
||||
wx.TB_3DBUTTONS
|
||||
wx.TB_FLAT
|
||||
wx.TB_DOCKABLE
|
||||
wx.TB_NOICONS
|
||||
wx.TB_TEXT
|
||||
wx.TB_NODIVIDER
|
||||
wx.TB_NOALIGN
|
||||
wx.TB_HORZ_LAYOUT
|
||||
wx.TB_HORZ_TEXT
|
||||
wx.TB_NO_TOOLTIPS
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user