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:
@@ -1,17 +1,22 @@
|
|||||||
|
"""
|
||||||
|
A simple script to encode all the images the XRCed needs into a Python module
|
||||||
|
"""
|
||||||
|
|
||||||
import sys, os, glob
|
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
|
# get the list of PNG files
|
||||||
files = glob.glob('src-images/*.png')
|
files = glob.glob('src-images/*.png')
|
||||||
|
files.sort()
|
||||||
|
|
||||||
# Truncate the inages module
|
# Truncate the inages module
|
||||||
open(output, 'w')
|
open(output, 'w')
|
||||||
|
|
||||||
# call img2py on each file
|
# call img2py on each file
|
||||||
for file in files:
|
for file in files:
|
||||||
|
|
||||||
# extract the basename to be used as the image name
|
# extract the basename to be used as the image name
|
||||||
name = os.path.splitext(os.path.basename(file))[0]
|
name = os.path.splitext(os.path.basename(file))[0]
|
||||||
@@ -24,4 +29,6 @@ for file in files:
|
|||||||
img2py.main(cmd.split())
|
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()
|
topSizer = page.GetSizer()
|
||||||
sizer = topSizer.GetChildren()[0].GetSizer()
|
sizer = topSizer.GetChildren()[0].GetSizer()
|
||||||
for w in page.GetChildren():
|
for w in page.GetChildren():
|
||||||
sizer.RemoveWindow(w)
|
sizer.Remove(w)
|
||||||
if isinstance(w, ParamPage):
|
if isinstance(w, ParamPage):
|
||||||
# With SetParent, we wouldn't need this
|
# With SetParent, we wouldn't need this
|
||||||
w.Reparent(self.cacheParent)
|
w.Reparent(self.cacheParent)
|
||||||
else:
|
else:
|
||||||
w.Destroy()
|
w.Destroy()
|
||||||
topSizer.RemoveSizer(sizer)
|
topSizer.Remove(sizer)
|
||||||
# Create new windows
|
# Create new windows
|
||||||
sizer = wxBoxSizer(wxVERTICAL)
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
# Special case - resize html window
|
# Special case - resize html window
|
||||||
|
@@ -706,6 +706,17 @@ class ParamOrient(RadioBox):
|
|||||||
if not value: value = 'wxHORIZONTAL'
|
if not value: value = 'wxHORIZONTAL'
|
||||||
self.SetStringSelection(self.seulav[value])
|
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):
|
class ParamFile(PPanel):
|
||||||
def __init__(self, parent, name):
|
def __init__(self, parent, name):
|
||||||
PPanel.__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.LIST_CTRL, images.getToolListCtrlBitmap()),
|
||||||
|
|
||||||
(ID_NEW.NOTEBOOK, images.getToolNotebookBitmap()),
|
(ID_NEW.NOTEBOOK, images.getToolNotebookBitmap()),
|
||||||
|
(ID_NEW.SPLITTER_WINDOW, images.getToolSplitterWindowBitmap()),
|
||||||
|
|
||||||
(ID_NEW.UNKNOWN, images.getToolUnknownBitmap())]
|
(ID_NEW.UNKNOWN, images.getToolUnknownBitmap())]
|
||||||
]
|
]
|
||||||
@@ -245,7 +246,8 @@ class Tools(wxPanel):
|
|||||||
self.EnableGroup(GROUP_CONTROLS)
|
self.EnableGroup(GROUP_CONTROLS)
|
||||||
self.EnableGroupItems(GROUP_CONTROLS,
|
self.EnableGroupItems(GROUP_CONTROLS,
|
||||||
[ ID_NEW.TREE_CTRL,
|
[ ID_NEW.TREE_CTRL,
|
||||||
ID_NEW.NOTEBOOK ],
|
ID_NEW.NOTEBOOK,
|
||||||
|
ID_NEW.SPLITTER_WINDOW ],
|
||||||
False)
|
False)
|
||||||
elif state == STATE_MENU:
|
elif state == STATE_MENU:
|
||||||
self.EnableGroup(GROUP_MENUS)
|
self.EnableGroup(GROUP_MENUS)
|
||||||
|
@@ -73,6 +73,7 @@ class ID_NEW:
|
|||||||
LIST_CTRL = wxNewId()
|
LIST_CTRL = wxNewId()
|
||||||
CHECK_LIST = wxNewId()
|
CHECK_LIST = wxNewId()
|
||||||
NOTEBOOK = wxNewId()
|
NOTEBOOK = wxNewId()
|
||||||
|
SPLITTER_WINDOW = wxNewId()
|
||||||
SCROLLED_WINDOW = wxNewId()
|
SCROLLED_WINDOW = wxNewId()
|
||||||
HTML_WINDOW = wxNewId()
|
HTML_WINDOW = wxNewId()
|
||||||
CALENDAR_CTRL = wxNewId()
|
CALENDAR_CTRL = wxNewId()
|
||||||
@@ -146,6 +147,7 @@ class PullDownMenu:
|
|||||||
ID_NEW.LIST_CTRL: 'wxListCtrl',
|
ID_NEW.LIST_CTRL: 'wxListCtrl',
|
||||||
ID_NEW.CHECK_LIST: 'wxCheckListBox',
|
ID_NEW.CHECK_LIST: 'wxCheckListBox',
|
||||||
ID_NEW.NOTEBOOK: 'wxNotebook',
|
ID_NEW.NOTEBOOK: 'wxNotebook',
|
||||||
|
ID_NEW.SPLITTER_WINDOW: 'wxSplitterWindow',
|
||||||
ID_NEW.SCROLLED_WINDOW: 'wxScrolledWindow',
|
ID_NEW.SCROLLED_WINDOW: 'wxScrolledWindow',
|
||||||
ID_NEW.HTML_WINDOW: 'wxHtmlWindow',
|
ID_NEW.HTML_WINDOW: 'wxHtmlWindow',
|
||||||
ID_NEW.CALENDAR_CTRL: 'wxCalendarCtrl',
|
ID_NEW.CALENDAR_CTRL: 'wxCalendarCtrl',
|
||||||
@@ -172,6 +174,7 @@ class PullDownMenu:
|
|||||||
self.containers = [
|
self.containers = [
|
||||||
(ID_NEW.PANEL, 'Panel', 'Create panel'),
|
(ID_NEW.PANEL, 'Panel', 'Create panel'),
|
||||||
(ID_NEW.NOTEBOOK, 'Notebook', 'Create notebook control'),
|
(ID_NEW.NOTEBOOK, 'Notebook', 'Create notebook control'),
|
||||||
|
(ID_NEW.SPLITTER_WINDOW, 'SplitterWindow', 'Create splitter window'),
|
||||||
(ID_NEW.TOOL_BAR, 'ToolBar', 'Create toolbar'),
|
(ID_NEW.TOOL_BAR, 'ToolBar', 'Create toolbar'),
|
||||||
]
|
]
|
||||||
self.sizers = [
|
self.sizers = [
|
||||||
@@ -221,6 +224,7 @@ class PullDownMenu:
|
|||||||
['container', 'Containers',
|
['container', 'Containers',
|
||||||
(ID_NEW.PANEL, 'Panel', 'Create panel'),
|
(ID_NEW.PANEL, 'Panel', 'Create panel'),
|
||||||
(ID_NEW.NOTEBOOK, 'Notebook', 'Create notebook control'),
|
(ID_NEW.NOTEBOOK, 'Notebook', 'Create notebook control'),
|
||||||
|
(ID_NEW.SPLITTER_WINDOW, 'SplitterWindow', 'Create splitter window'),
|
||||||
(ID_NEW.TOOL_BAR, 'ToolBar', 'Create toolbar'),
|
(ID_NEW.TOOL_BAR, 'ToolBar', 'Create toolbar'),
|
||||||
],
|
],
|
||||||
['sizer', 'Sizers',
|
['sizer', 'Sizers',
|
||||||
|
@@ -496,6 +496,13 @@ class xxxNotebook(xxxContainer):
|
|||||||
paramDict = {'usenotebooksizer': ParamBool}
|
paramDict = {'usenotebooksizer': ParamBool}
|
||||||
winStyles = ['wxNB_FIXEDWIDTH', 'wxNB_LEFT', 'wxNB_RIGHT', 'wxNB_BOTTOM']
|
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):
|
class xxxGenericDirCtrl(xxxObject):
|
||||||
allParams = ['defaultfolder', 'filter', 'defaultfilter', 'pos', 'size', 'style']
|
allParams = ['defaultfolder', 'filter', 'defaultfilter', 'pos', 'size', 'style']
|
||||||
paramDict = {'defaultfilter': ParamInt}
|
paramDict = {'defaultfilter': ParamInt}
|
||||||
@@ -785,6 +792,7 @@ xxxDict = {
|
|||||||
'wxListCtrl': xxxListCtrl,
|
'wxListCtrl': xxxListCtrl,
|
||||||
'wxCheckListBox': xxxCheckList,
|
'wxCheckListBox': xxxCheckList,
|
||||||
'wxNotebook': xxxNotebook,
|
'wxNotebook': xxxNotebook,
|
||||||
|
'wxSplitterWindow': xxxSplitterWindow,
|
||||||
'notebookpage': xxxNotebookPage,
|
'notebookpage': xxxNotebookPage,
|
||||||
'wxHtmlWindow': xxxHtmlWindow,
|
'wxHtmlWindow': xxxHtmlWindow,
|
||||||
'wxCalendarCtrl': xxxCalendarCtrl,
|
'wxCalendarCtrl': xxxCalendarCtrl,
|
||||||
|
Reference in New Issue
Block a user