Adds wxSplitterWindow support, patch from Steve Hartwell.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
015c495184
commit
68ae5821b6
@ -1,27 +1,34 @@
|
||||
"""
|
||||
A simple script to encode all the images the XRCed needs into a Python module
|
||||
"""
|
||||
|
||||
import sys, os, glob
|
||||
from wxPython.tools import img2py
|
||||
from wx.tools import img2py
|
||||
|
||||
output = 'images.py'
|
||||
def main():
|
||||
output = 'images.py'
|
||||
|
||||
# get the list of PNG files
|
||||
files = glob.glob('src-images/*.png')
|
||||
# get the list of PNG files
|
||||
files = glob.glob('src-images/*.png')
|
||||
files.sort()
|
||||
|
||||
# Truncate the inages module
|
||||
open(output, 'w')
|
||||
# Truncate the inages module
|
||||
open(output, 'w')
|
||||
|
||||
# call img2py on each file
|
||||
for file in files:
|
||||
# call img2py on each file
|
||||
for file in files:
|
||||
|
||||
# extract the basename to be used as the image name
|
||||
name = os.path.splitext(os.path.basename(file))[0]
|
||||
# extract the basename to be used as the image name
|
||||
name = os.path.splitext(os.path.basename(file))[0]
|
||||
|
||||
# encode it
|
||||
if file == files[0]:
|
||||
cmd = "-u -i -n %s %s %s" % (name, file, output)
|
||||
else:
|
||||
cmd = "-a -u -i -n %s %s %s" % (name, file, output)
|
||||
img2py.main(cmd.split())
|
||||
# encode it
|
||||
if file == files[0]:
|
||||
cmd = "-u -i -n %s %s %s" % (name, file, output)
|
||||
else:
|
||||
cmd = "-a -u -i -n %s %s %s" % (name, file, output)
|
||||
img2py.main(cmd.split())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -51,13 +51,13 @@ class Panel(wxNotebook):
|
||||
topSizer = page.GetSizer()
|
||||
sizer = topSizer.GetChildren()[0].GetSizer()
|
||||
for w in page.GetChildren():
|
||||
sizer.RemoveWindow(w)
|
||||
sizer.Remove(w)
|
||||
if isinstance(w, ParamPage):
|
||||
# With SetParent, we wouldn't need this
|
||||
w.Reparent(self.cacheParent)
|
||||
else:
|
||||
w.Destroy()
|
||||
topSizer.RemoveSizer(sizer)
|
||||
topSizer.Remove(sizer)
|
||||
# Create new windows
|
||||
sizer = wxBoxSizer(wxVERTICAL)
|
||||
# Special case - resize html window
|
||||
|
@ -706,6 +706,17 @@ class ParamOrient(RadioBox):
|
||||
if not value: value = 'wxHORIZONTAL'
|
||||
self.SetStringSelection(self.seulav[value])
|
||||
|
||||
class ParamOrientation(RadioBox):
|
||||
values = {'horizontal': 'horizontal', 'vertical': 'vertical'}
|
||||
seulav = {'horizontal': 'horizontal', 'vertical': 'vertical'}
|
||||
def __init__(self, parent, name):
|
||||
RadioBox.__init__(self, parent, -1, choices=self.values.keys(), name=name)
|
||||
def GetValue(self):
|
||||
return self.values[self.GetStringSelection()]
|
||||
def SetValue(self, value):
|
||||
if not value: value = 'vertical'
|
||||
self.SetStringSelection(self.seulav[value])
|
||||
|
||||
class ParamFile(PPanel):
|
||||
def __init__(self, parent, name):
|
||||
PPanel.__init__(self, parent, name)
|
||||
|
BIN
wxPython/wx/tools/XRCed/src-images/ToolSplitterWindow.png
Normal file
BIN
wxPython/wx/tools/XRCed/src-images/ToolSplitterWindow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 182 B |
@ -83,6 +83,7 @@ class Tools(wxPanel):
|
||||
(ID_NEW.LIST_CTRL, images.getToolListCtrlBitmap()),
|
||||
|
||||
(ID_NEW.NOTEBOOK, images.getToolNotebookBitmap()),
|
||||
(ID_NEW.SPLITTER_WINDOW, images.getToolSplitterWindowBitmap()),
|
||||
|
||||
(ID_NEW.UNKNOWN, images.getToolUnknownBitmap())]
|
||||
]
|
||||
@ -245,7 +246,8 @@ class Tools(wxPanel):
|
||||
self.EnableGroup(GROUP_CONTROLS)
|
||||
self.EnableGroupItems(GROUP_CONTROLS,
|
||||
[ ID_NEW.TREE_CTRL,
|
||||
ID_NEW.NOTEBOOK ],
|
||||
ID_NEW.NOTEBOOK,
|
||||
ID_NEW.SPLITTER_WINDOW ],
|
||||
False)
|
||||
elif state == STATE_MENU:
|
||||
self.EnableGroup(GROUP_MENUS)
|
||||
|
@ -73,6 +73,7 @@ class ID_NEW:
|
||||
LIST_CTRL = wxNewId()
|
||||
CHECK_LIST = wxNewId()
|
||||
NOTEBOOK = wxNewId()
|
||||
SPLITTER_WINDOW = wxNewId()
|
||||
SCROLLED_WINDOW = wxNewId()
|
||||
HTML_WINDOW = wxNewId()
|
||||
CALENDAR_CTRL = wxNewId()
|
||||
@ -146,6 +147,7 @@ class PullDownMenu:
|
||||
ID_NEW.LIST_CTRL: 'wxListCtrl',
|
||||
ID_NEW.CHECK_LIST: 'wxCheckListBox',
|
||||
ID_NEW.NOTEBOOK: 'wxNotebook',
|
||||
ID_NEW.SPLITTER_WINDOW: 'wxSplitterWindow',
|
||||
ID_NEW.SCROLLED_WINDOW: 'wxScrolledWindow',
|
||||
ID_NEW.HTML_WINDOW: 'wxHtmlWindow',
|
||||
ID_NEW.CALENDAR_CTRL: 'wxCalendarCtrl',
|
||||
@ -172,6 +174,7 @@ class PullDownMenu:
|
||||
self.containers = [
|
||||
(ID_NEW.PANEL, 'Panel', 'Create panel'),
|
||||
(ID_NEW.NOTEBOOK, 'Notebook', 'Create notebook control'),
|
||||
(ID_NEW.SPLITTER_WINDOW, 'SplitterWindow', 'Create splitter window'),
|
||||
(ID_NEW.TOOL_BAR, 'ToolBar', 'Create toolbar'),
|
||||
]
|
||||
self.sizers = [
|
||||
@ -221,6 +224,7 @@ class PullDownMenu:
|
||||
['container', 'Containers',
|
||||
(ID_NEW.PANEL, 'Panel', 'Create panel'),
|
||||
(ID_NEW.NOTEBOOK, 'Notebook', 'Create notebook control'),
|
||||
(ID_NEW.SPLITTER_WINDOW, 'SplitterWindow', 'Create splitter window'),
|
||||
(ID_NEW.TOOL_BAR, 'ToolBar', 'Create toolbar'),
|
||||
],
|
||||
['sizer', 'Sizers',
|
||||
|
@ -496,6 +496,13 @@ class xxxNotebook(xxxContainer):
|
||||
paramDict = {'usenotebooksizer': ParamBool}
|
||||
winStyles = ['wxNB_FIXEDWIDTH', 'wxNB_LEFT', 'wxNB_RIGHT', 'wxNB_BOTTOM']
|
||||
|
||||
class xxxSplitterWindow(xxxContainer):
|
||||
allParams = ['orientation', 'sashpos', 'minsize', 'pos', 'size', 'style']
|
||||
paramDict = {'orientation': ParamOrientation, 'sashpos': ParamUnit, 'minsize': ParamUnit }
|
||||
winStyles = ['wxSP_3D', 'wxSP_3DSASH', 'wxSP_3DBORDER', 'wxSP_BORDER',
|
||||
'wxSP_NOBORDER', 'wxSP_PERMIT_UNSPLIT', 'wxSP_LIVE_UPDATE',
|
||||
'wxSP_NO_XP_THEME' ]
|
||||
|
||||
class xxxGenericDirCtrl(xxxObject):
|
||||
allParams = ['defaultfolder', 'filter', 'defaultfilter', 'pos', 'size', 'style']
|
||||
paramDict = {'defaultfilter': ParamInt}
|
||||
@ -785,6 +792,7 @@ xxxDict = {
|
||||
'wxListCtrl': xxxListCtrl,
|
||||
'wxCheckListBox': xxxCheckList,
|
||||
'wxNotebook': xxxNotebook,
|
||||
'wxSplitterWindow': xxxSplitterWindow,
|
||||
'notebookpage': xxxNotebookPage,
|
||||
'wxHtmlWindow': xxxHtmlWindow,
|
||||
'wxCalendarCtrl': xxxCalendarCtrl,
|
||||
|
Loading…
Reference in New Issue
Block a user