ID_SizeReportContent = wx.NewId()
ID_CreatePerspective = wx.NewId()
ID_CopyPerspective = wx.NewId()
-ID_AllowFloating = wx.NewId()
-ID_AllowActivePane = wx.NewId()
+
ID_TransparentHint = wx.NewId()
-ID_TransparentHintFade = wx.NewId()
+ID_VenetianBlindsHint = wx.NewId()
+ID_RectangleHint = wx.NewId()
+ID_NoHint = wx.NewId()
+ID_HintFade = wx.NewId()
+ID_AllowFloating = wx.NewId()
+ID_NoVenetianFade = wx.NewId()
ID_TransparentDrag = wx.NewId()
-ID_DisableVenetianBlinds = wx.NewId()
-ID_DisableVenetianBlindsFade = wx.NewId()
+ID_AllowActivePane = wx.NewId()
ID_NoGradient = wx.NewId()
ID_VerticalGradient = wx.NewId()
ID_HorizontalGradient = wx.NewId()
+
ID_Settings = wx.NewId()
ID_About = wx.NewId()
ID_FirstPerspective = ID_CreatePerspective+1000
+
+
#----------------------------------------------------------------------
def GetMondrianData():
return \
wx.Frame.__init__(self, parent, id, title, pos, size, style)
# tell FrameManager to manage this frame
- self._mgr = wx.aui.FrameManager()
+ self._mgr = wx.aui.AuiManager()
self._mgr.SetManagedWindow(self)
self._perspectives = []
view_menu.Append(ID_SizeReportContent, "Use a Size Reporter for the Content Pane")
options_menu = wx.Menu()
+ options_menu.AppendRadioItem(ID_TransparentHint, "Transparent Hint")
+ options_menu.AppendRadioItem(ID_VenetianBlindsHint, "Venetian Blinds Hint")
+ options_menu.AppendRadioItem(ID_RectangleHint, "Rectangle Hint")
+ options_menu.AppendRadioItem(ID_NoHint, "No Hint")
+ options_menu.AppendSeparator();
+ options_menu.AppendCheckItem(ID_HintFade, "Hint Fade-in")
options_menu.AppendCheckItem(ID_AllowFloating, "Allow Floating")
- options_menu.AppendCheckItem(ID_TransparentHint, "Transparent Hint")
- options_menu.AppendCheckItem(ID_TransparentHintFade, "Transparent Hint Fade-in")
+ options_menu.AppendCheckItem(ID_NoVenetianFade, "Disable Venetian Blinds Hint Fade-in")
options_menu.AppendCheckItem(ID_TransparentDrag, "Transparent Drag")
- options_menu.AppendCheckItem(ID_DisableVenetianBlinds, "Disable Venetian Blinds Effect")
- options_menu.AppendCheckItem(ID_DisableVenetianBlindsFade, "Disable Venetian Blinds Fade-in")
options_menu.AppendCheckItem(ID_AllowActivePane, "Allow Active Pane")
- options_menu.AppendSeparator()
+ options_menu.AppendSeparator();
options_menu.AppendRadioItem(ID_NoGradient, "No Caption Gradient")
options_menu.AppendRadioItem(ID_VerticalGradient, "Vertical Caption Gradient")
options_menu.AppendRadioItem(ID_HorizontalGradient, "Horizontal Caption Gradient")
- options_menu.AppendSeparator()
+ options_menu.AppendSeparator();
options_menu.Append(ID_Settings, "Settings Pane")
-
+
self._perspectives_menu = wx.Menu()
self._perspectives_menu.Append(ID_CreatePerspective, "Create Perspective")
self._perspectives_menu.Append(ID_CopyPerspective, "Copy Perspective Data To Clipboard")
tb5.Realize()
# add a bunch of panes
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test1").Caption("Pane Caption").Top())
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test2").Caption("Client Size Reporter").
Bottom().Position(1))
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test3").Caption("Client Size Reporter").
Bottom())
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test4").Caption("Pane Caption").
Left())
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test5").Caption("Pane Caption").
Right())
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test6").Caption("Client Size Reporter").
Right().Row(1))
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test7").Caption("Client Size Reporter").
Left().Layer(1))
- self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.AuiPaneInfo().
Name("test8").Caption("Tree Pane").
Left().Layer(1).Position(1))
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test9").Caption("Min Size 200x100").
BestSize(wx.Size(200,100)).MinSize(wx.Size(200,100)).
Bottom().Layer(1))
- self._mgr.AddPane(self.CreateTextCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateTextCtrl(), wx.aui.AuiPaneInfo().
Name("test10").Caption("Text Pane").
Bottom().Layer(1).Position(1))
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("test11").Caption("Fixed Pane").
Bottom().Layer(1).Position(2).Fixed())
- self._mgr.AddPane(SettingsPanel(self, self), wx.aui.PaneInfo().
+ self._mgr.AddPane(SettingsPanel(self, self), wx.aui.AuiPaneInfo().
Name("settings").Caption("Dock Manager Settings").
Dockable(False).Float().Hide())
# create some center panes
- self._mgr.AddPane(self.CreateGrid(), wx.aui.PaneInfo().Name("grid_content").
+ self._mgr.AddPane(self.CreateGrid(), wx.aui.AuiPaneInfo().Name("grid_content").
CenterPane().Hide())
- self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.PaneInfo().Name("tree_content").
+ self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.AuiPaneInfo().Name("tree_content").
CenterPane().Hide())
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().Name("sizereport_content").
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().Name("sizereport_content").
CenterPane().Hide())
- self._mgr.AddPane(self.CreateTextCtrl(), wx.aui.PaneInfo().Name("text_content").
+ self._mgr.AddPane(self.CreateTextCtrl(), wx.aui.AuiPaneInfo().Name("text_content").
CenterPane().Hide())
- self._mgr.AddPane(self.CreateHTMLCtrl(), wx.aui.PaneInfo().Name("html_content").
+ self._mgr.AddPane(self.CreateHTMLCtrl(), wx.aui.AuiPaneInfo().Name("html_content").
CenterPane())
# add the toolbars to the manager
- self._mgr.AddPane(tb1, wx.aui.PaneInfo().
+ self._mgr.AddPane(tb1, wx.aui.AuiPaneInfo().
Name("tb1").Caption("Big Toolbar").
ToolbarPane().Top().
LeftDockable(False).RightDockable(False))
- self._mgr.AddPane(tb2, wx.aui.PaneInfo().
+ self._mgr.AddPane(tb2, wx.aui.AuiPaneInfo().
Name("tb2").Caption("Toolbar 2").
ToolbarPane().Top().Row(1).
LeftDockable(False).RightDockable(False))
- self._mgr.AddPane(tb3, wx.aui.PaneInfo().
+ self._mgr.AddPane(tb3, wx.aui.AuiPaneInfo().
Name("tb3").Caption("Toolbar 3").
ToolbarPane().Top().Row(1).Position(1).
LeftDockable(False).RightDockable(False))
- self._mgr.AddPane(tb4, wx.aui.PaneInfo().
+ self._mgr.AddPane(tb4, wx.aui.AuiPaneInfo().
Name("tb4").Caption("Sample Bookmark Toolbar").
ToolbarPane().Top().Row(2).
LeftDockable(False).RightDockable(False))
- self._mgr.AddPane(tb5, wx.aui.PaneInfo().
+ self._mgr.AddPane(tb5, wx.aui.AuiPaneInfo().
Name("tbvert").Caption("Sample Vertical Toolbar").
ToolbarPane().Left().GripperTop().
TopDockable(False).BottomDockable(False))
self._mgr.AddPane(wx.Button(self, -1, "Test Button"),
- wx.aui.PaneInfo().Name("tb5").
+ wx.aui.AuiPaneInfo().Name("tb5").
ToolbarPane().Top().Row(2).Position(1).
LeftDockable(False).RightDockable(False))
self.Bind(wx.EVT_MENU, self.OnCreateSizeReport, id=ID_CreateSizeReport)
self.Bind(wx.EVT_MENU, self.OnCreatePerspective, id=ID_CreatePerspective)
self.Bind(wx.EVT_MENU, self.OnCopyPerspective, id=ID_CopyPerspective)
+
self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_AllowFloating)
self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_TransparentHint)
- self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_TransparentHintFade)
+ self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_VenetianBlindsHint)
+ self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_RectangleHint)
+ self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_NoHint)
+ self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_HintFade)
+ self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_NoVenetianFade)
self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_TransparentDrag)
- self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_DisableVenetianBlinds)
- self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_DisableVenetianBlindsFade)
self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_AllowActivePane)
+
self.Bind(wx.EVT_MENU, self.OnGradient, id=ID_NoGradient)
self.Bind(wx.EVT_MENU, self.OnGradient, id=ID_VerticalGradient)
self.Bind(wx.EVT_MENU, self.OnGradient, id=ID_HorizontalGradient)
self.Bind(wx.EVT_MENU, self.OnClose, id=wx.ID_EXIT)
self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About)
- self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_AllowFloating)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_TransparentHint)
- self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_TransparentHintFade)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_VenetianBlindsHint)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_RectangleHint)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_NoHint)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_HintFade)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_AllowFloating)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_NoVenetianFade)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_TransparentDrag)
- self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_DisableVenetianBlinds)
- self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_DisableVenetianBlindsFade)
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_AllowActivePane)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_NoGradient)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_VerticalGradient)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_HorizontalGradient)
+
self.Bind(wx.EVT_MENU_RANGE, self.OnRestorePerspective, id=ID_FirstPerspective,
id2=ID_FirstPerspective+1000)
if caption in ["Tree Pane", "Dock Manager Settings", "Fixed Pane"]:
msg = "Are You Sure You Want To Close This Pane?"
- dlg = wx.MessageDialog(self, msg, "PyAUI Question",
+ dlg = wx.MessageDialog(self, msg, "AUI Question",
wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_QUESTION)
if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
def OnManagerFlag(self, event):
flag = 0
-
- if event.GetId() == ID_AllowFloating:
- flag = wx.aui.AUI_MGR_ALLOW_FLOATING
+ eid = event.GetId()
- elif event.GetId() == ID_TransparentDrag:
- flag = wx.aui.AUI_MGR_TRANSPARENT_DRAG
-
- elif event.GetId() == ID_TransparentHint:
- flag = wx.aui.AUI_MGR_TRANSPARENT_HINT
+ if eid in [ ID_TransparentHint, ID_VenetianBlindsHint, ID_RectangleHint, ID_NoHint ]:
+ flags = self._mgr.GetFlags()
+ flags &= ~wx.aui.AUI_MGR_TRANSPARENT_HINT
+ flags &= ~wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT
+ flags &= ~wx.aui.AUI_MGR_RECTANGLE_HINT
+ self._mgr.SetFlags(flags)
- elif event.GetId() == ID_TransparentHintFade:
- flag = wx.aui.AUI_MGR_TRANSPARENT_HINT_FADE
-
- elif event.GetId() == ID_AllowActivePane:
+ if eid == ID_AllowFloating:
+ flag = wx.aui.AUI_MGR_ALLOW_FLOATING
+ elif eid == ID_TransparentDrag:
+ flag = wx.aui.AUI_MGR_TRANSPARENT_DRAG
+ elif eid == ID_HintFade:
+ flag = wx.aui.AUI_MGR_HINT_FADE
+ elif eid == ID_NoVenetianFade:
+ flag = wx.aui.AUI_MGR_NO_VENETIAN_BLINDS_FADE
+ elif eid == ID_AllowActivePane:
flag = wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE
-
- elif event.GetId() == ID_DisableVenetianBlinds:
- flag = wx.aui.AUI_MGR_DISABLE_VENETIAN_BLINDS
-
- elif event.GetId() == ID_DisableVenetianBlindsFade:
- flag = wx.aui.AUI_MGR_DISABLE_VENETIAN_BLINDS_FADE
-
+ elif eid == ID_TransparentHint:
+ flag = wx.aui.AUI_MGR_TRANSPARENT_HINT
+ elif eid == ID_VenetianBlindsHint:
+ flag = wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT
+ elif eid == ID_RectangleHint:
+ flag = wx.aui.AUI_MGR_RECTANGLE_HINT
+
self._mgr.SetFlags(self._mgr.GetFlags() ^ flag)
def OnUpdateUI(self, event):
flags = self._mgr.GetFlags()
-
- if event.GetId() == ID_NoGradient:
+ eid = event.GetId()
+
+ if eid == ID_NoGradient:
event.Check(self._mgr.GetArtProvider().GetMetric(wx.aui.AUI_ART_GRADIENT_TYPE) == wx.aui.AUI_GRADIENT_NONE)
-
- elif event.GetId() == ID_VerticalGradient:
+
+ elif eid == ID_VerticalGradient:
event.Check(self._mgr.GetArtProvider().GetMetric(wx.aui.AUI_ART_GRADIENT_TYPE) == wx.aui.AUI_GRADIENT_VERTICAL)
-
- elif event.GetId() == ID_HorizontalGradient:
+
+ elif eid == ID_HorizontalGradient:
event.Check(self._mgr.GetArtProvider().GetMetric(wx.aui.AUI_ART_GRADIENT_TYPE) == wx.aui.AUI_GRADIENT_HORIZONTAL)
-
- elif event.GetId() == ID_AllowFloating:
+
+ elif eid == ID_AllowFloating:
event.Check((flags & wx.aui.AUI_MGR_ALLOW_FLOATING) != 0)
- elif event.GetId() == ID_TransparentDrag:
+ elif eid == ID_TransparentDrag:
event.Check((flags & wx.aui.AUI_MGR_TRANSPARENT_DRAG) != 0)
- elif event.GetId() == ID_TransparentHint:
+ elif eid == ID_TransparentHint:
event.Check((flags & wx.aui.AUI_MGR_TRANSPARENT_HINT) != 0)
- elif event.GetId() == ID_TransparentHintFade:
- event.Check((flags & wx.aui.AUI_MGR_TRANSPARENT_HINT_FADE) != 0)
-
- elif event.GetId() == ID_DisableVenetianBlinds:
- event.Check((flags & wx.aui.AUI_MGR_DISABLE_VENETIAN_BLINDS) != 0)
-
- elif event.GetId() == ID_DisableVenetianBlindsFade:
- event.Check((flags & wx.aui.AUI_MGR_DISABLE_VENETIAN_BLINDS_FADE) != 0)
+ elif eid == ID_VenetianBlindsHint:
+ event.Check((flags & wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT) != 0)
+
+ elif eid == ID_RectangleHint:
+ event.Check((flags & wx.aui.AUI_MGR_RECTANGLE_HINT) != 0)
+
+ elif eid == ID_NoHint:
+ event.Check(((wx.aui.AUI_MGR_TRANSPARENT_HINT |
+ wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT |
+ wx.aui.AUI_MGR_RECTANGLE_HINT) & flags) == 0)
+
+ elif eid == ID_HintFade:
+ event.Check((flags & wx.aui.AUI_MGR_HINT_FADE) != 0);
+
+ elif eid == ID_NoVenetianFade:
+ event.Check((flags & wx.aui.AUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0);
+
def OnCreateTree(self, event):
- self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.AuiPaneInfo().
Name("Test").Caption("Tree Control").
Float().FloatingPosition(self.GetStartPosition()).
FloatingSize(wx.Size(150, 300)))
def OnCreateGrid(self, event):
- self._mgr.AddPane(self.CreateGrid(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateGrid(), wx.aui.AuiPaneInfo().
Name("Test").Caption("Grid").
Float().FloatingPosition(self.GetStartPosition()).
FloatingSize(wx.Size(300, 200)))
def OnCreateHTML(self, event):
- self._mgr.AddPane(self.CreateHTMLCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateHTMLCtrl(), wx.aui.AuiPaneInfo().
Name("Test").Caption("HTML Content").
Float().FloatingPosition(self.GetStartPosition()).
FloatingSize(wx.Size(300, 200)))
def OnCreateText(self, event):
- self._mgr.AddPane(self.CreateTextCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateTextCtrl(), wx.aui.AuiPaneInfo().
Name("Test").Caption("Text Control").
Float().FloatingPosition(self.GetStartPosition()))
self._mgr.Update()
def OnCreateSizeReport(self, event):
- self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.PaneInfo().
+ self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().
Name("Test").Caption("Client Size Reporter").
Float().FloatingPosition(self.GetStartPosition()))
self._mgr.Update()
tree = wx.TreeCtrl(self, -1, wx.Point(0, 0), wx.Size(160, 250),
wx.TR_DEFAULT_STYLE | wx.NO_BORDER)
- root = tree.AddRoot("PyAUI Project")
+ root = tree.AddRoot("AUI Project")
items = []
imglist = wx.ImageList(16, 16, True, 2)
self.log = log
wx.Panel.__init__(self, parent, -1)
- self.nb = wx.aui.AuiMultiNotebook(self)
+ self.nb = wx.aui.AuiNotebook(self)
page = wx.TextCtrl(self.nb, -1, text, style=wx.TE_MULTILINE)
self.nb.AddPage(page, "Welcome")
wx.Image: Gained support for TGA image file format.
+wx.aui: The classes in the wx.aui module have been renamed to be more
+consistent with each other, and make it easier to recognize in the
+docs and etc. that they belong together.
+
+ FrameManager --> AuiManager
+ FrameManagerEvent --> AuiManagerEvent
+ PaneInfo --> AuiPaneInfo
+ FloatingPane --> AuiFloatingPane
+ DockArt --> AuiDockArt
+ TabArt --> AuiTabArt
+ AuiMultiNotebook --> AuiNotebook
+ AuiNotebookEvent --> AuiNotebookEvent
+
your overridden methods like this::
def OnBeginDocument(self, start, end):
- # do something here
- return self.base_OnBeginDocument(start, end)
+ # do something here
+ return self.base_OnBeginDocument(start, end)
You can now call the base class method the normal way, like this::
def OnBeginDocument(self, start, end):
- # do something here
- return Printout.OnBeginDocument(self, start, end)
+ # do something here
+ return Printout.OnBeginDocument(self, start, end)
Or like this with super()::
def OnBeginDocument(self, start, end):
- # do something here
- return super(MyPrintout, self).OnBeginDocument(start, end)
+ # do something here
+ return super(MyPrintout, self).OnBeginDocument(start, end)
Note that the old way with the "base_*" function still works, but you
will get a DeprecationWarning from calling base_OnBeginDocument. The
TypeError if the compared object is not compatible, but to just return
a boolean as expected. For example::
- wx.Colour(64,0,64) == 123 ==> False
+ wx.Colour(64,0,64) == 123 ==> False
wxMSW: Fixed (again) sizing/positioning issues of calling Realize on
a wx.ToolBar that is not manaaged directly by a frame and that is
want to force the options to be required then you can just add a True
parameter, like this::
- import wxversion
- wxversion.select("2.6-unicode", True)
- import wx
+ import wxversion
+ wxversion.select("2.6-unicode", True)
+ import wx
Tweaked wx.lib.buttons such that flat buttons (e.g. have no bevel and
a wx.BORDER_NONE style flag) paint themed backgrounds if there are
sample. For example, load the Button sample and then do the following
in the PyShell::
- >>> b = frame.demoPage.GetChildren()[0]
- >>> for x in range(0, 500, 10):
- ... b.Move((x, 50))
- ... app.Yield(True)
- ... wx.MilliSleep(10)
+ >>> b = frame.demoPage.GetChildren()[0]
+ >>> for x in range(0, 500, 10):
+ ... b.Move((x, 50))
+ ... app.Yield(True)
+ ... wx.MilliSleep(10)
wxGTK: Applied wxNO_BORDER patch (#1098374) for text control and combo
effects\" such as transparent window dragging as well as frame
animation.
-**PyAUI adheres to the following principles**
+**wx.aui adheres to the following principles**
- Use native floating frames to obtain a native look and feel for
all platforms;
size=(800, 600), style=wx.DEFAULT_FRAME_STYLE):
wx.Frame.__init__(self, parent, id, title, pos, size, style)
- self._mgr = wx.aui.FrameManager(self)
+ self._mgr = wx.aui.AuiManager(self)
# create several text controls
text1 = wx.TextCtrl(self, -1, 'Pane 1 - sample text',
// We'll skip making wrappers for these, they have overloads that take a
// wxSize or wxPoint
-%ignore wxPaneInfo::MaxSize(int x, int y);
-%ignore wxPaneInfo::MinSize(int x, int y);
-%ignore wxPaneInfo::BestSize(int x, int y);
-%ignore wxPaneInfo::FloatingPosition(int x, int y);
-%ignore wxPaneInfo::FloatingSize(int x, int y);
+%ignore wxAuiPaneInfo::MaxSize(int x, int y);
+%ignore wxAuiPaneInfo::MinSize(int x, int y);
+%ignore wxAuiPaneInfo::BestSize(int x, int y);
+%ignore wxAuiPaneInfo::FloatingPosition(int x, int y);
+%ignore wxAuiPaneInfo::FloatingSize(int x, int y);
// But for these we will do the overloading (see %pythoncode below) so let's
// rename the C++ versions
-%rename(_GetPaneByWidget) wxFrameManager::GetPane(wxWindow* window);
-%rename(_GetPaneByName) wxFrameManager::GetPane(const wxString& name);
+%rename(_GetPaneByWidget) wxAuiManager::GetPane(wxWindow* window);
+%rename(_GetPaneByName) wxAuiManager::GetPane(const wxString& name);
-%rename(_AddPane1) wxFrameManager::AddPane(wxWindow* window, const wxPaneInfo& pane_info);
-%rename(_AddPane2) wxFrameManager::AddPane(wxWindow* window, int direction = wxLEFT,
- const wxString& caption = wxEmptyString);
+%rename(_AddPane1) wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info);
+%rename(_AddPane2) wxAuiManager::AddPane(wxWindow* window, int direction = wxLEFT,
+ const wxString& caption = wxEmptyString);
-%rename(AddPaneAtPos) wxFrameManager::AddPane(wxWindow* window,
- const wxPaneInfo& pane_info,
- const wxPoint& drop_pos);
+%rename(AddPaneAtPos) wxAuiManager::AddPane(wxWindow* window,
+ const wxPaneInfo& pane_info,
+ const wxPoint& drop_pos);
// A typemap for the return value of wxFrameManager::GetAllPanes
-%typemap(out) wxPaneInfoArray& {
+%typemap(out) wxAuiPaneInfoArray& {
$result = PyList_New(0);
for (size_t i=0; i < $1->GetCount(); i++) {
- PyObject* pane_obj = SWIG_NewPointerObj((void*)(&$1->Item(i)), SWIGTYPE_p_wxPaneInfo, 0);
+ PyObject* pane_obj = SWIG_NewPointerObj((void*)(&$1->Item(i)), SWIGTYPE_p_wxAuiPaneInfo, 0);
PyList_Append($result, pane_obj);
}
}
%pythonAppend wxAuiTabCtrl::wxAuiTabCtrl "self._setOORInfo(self)";
-%pythonAppend wxAuiMultiNotebook::wxAuiMultiNotebook "self._setOORInfo(self)";
-%pythonAppend wxAuiMultiNotebook::wxAuiMultiNotebook() "self._setOORInfo(self)";
-%ignore wxAuiMultiNotebook::~wxAuiMultiNotebook;
-%rename(PreAuiMultiNotebook) wxAuiMultiNotebook::wxAuiMultiNotebook();
+%pythonAppend wxAuiNotebook::wxAuiNotebook "self._setOORInfo(self)";
+%pythonAppend wxAuiNotebook::wxAuiNotebook() "self._setOORInfo(self)";
+%ignore wxAuiiNotebook::~wxAuiNotebook;
+%rename(PreAuiNotebook) wxAuiNotebook::wxAuiNotebook();
//---------------------------------------------------------------------------
// Get all our defs from the REAL header files.
// Methods to inject into the FrameManager class that will sort out calls to
// the overloaded versions of GetPane and AddPane
-%extend wxFrameManager {
+%extend wxAuiManager {
%pythoncode {
def GetPane(self, item):
"""
pane info, and defaults to ``wx.LEFT``. The pane caption may
also be specified as an extra parameter in this form.
"""
- if type(info) == PaneInfo:
+ if type(info) == AuiPaneInfo:
return self._AddPane1(window, info)
else:
# This Is AddPane2
}
}
-%extend wxDockInfo {
- ~wxDockInfo() {}
+%extend wxAuiDockInfo {
+ ~wxAuiDockInfo() {}
}
-%extend wxDockUIPart {
- ~wxDockUIPart() {}
+%extend wxAuiDockUIPart {
+ ~wxAuiDockUIPart() {}
}
-%extend wxPaneButton {
- ~wxPaneButton() {}
+%extend wxAuiPaneButton {
+ ~wxAuiPaneButton() {}
}
//---------------------------------------------------------------------------
%{
// A wxDocArt class that knows how to forward virtuals to Python methods
-class wxPyDockArt : public wxDefaultDockArt
+class wxPyAuiDockArt : public wxAuiDefaultDockArt
{
- wxPyDockArt() : wxDefaultDockArt() {}
+ wxPyAuiDockArt() : wxAuiDefaultDockArt() {}
DEC_PYCALLBACK_INT_INT(GetMetric);
DEC_PYCALLBACK_VOID_INTINT(SetMetric);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawSash(dc, window, orientation, rect);
+ wxAuiDefaultDockArt::DrawSash(dc, window, orientation, rect);
}
virtual void DrawBackground(wxDC& dc,
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawBackground(dc, window, orientation, rect);
+ wxAuiDefaultDockArt::DrawBackground(dc, window, orientation, rect);
}
virtual void DrawCaption(wxDC& dc,
wxWindow* window,
const wxString& text,
const wxRect& rect,
- wxPaneInfo& pane)
+ wxAuiPaneInfo& pane)
{
bool found;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* otext = wx2PyString(text);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
- PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
+ PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxAuiPaneInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOO)",
odc, owin, otext, orect, opane));
Py_DECREF(odc);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawCaption(dc, window, text, rect, pane);
+ wxAuiDefaultDockArt::DrawCaption(dc, window, text, rect, pane);
}
virtual void DrawGripper(wxDC& dc,
wxWindow* window,
const wxRect& rect,
- wxPaneInfo& pane)
+ wxAuiPaneInfo& pane)
{
bool found;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyObject* odc = wxPyMake_wxObject(&dc, false);
PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
- PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
+ PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxAuiPaneInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOO)", odc, owin, orect, opane));
Py_DECREF(odc);
Py_DECREF(orect);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawGripper(dc, window, rect, pane);
+ wxAuiDefaultDockArt::DrawGripper(dc, window, rect, pane);
}
virtual void DrawBorder(wxDC& dc,
wxWindow* window,
const wxRect& rect,
- wxPaneInfo& pane)
+ wxAuiPaneInfo& pane)
{
bool found;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyObject* odc = wxPyMake_wxObject(&dc, false);
PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
- PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
+ PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxAuiPaneInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", odc, orect, opane));
Py_DECREF(odc);
Py_DECREF(owin);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawBorder(dc, window, rect, pane);
+ wxAuiDefaultDockArt::DrawBorder(dc, window, rect, pane);
}
virtual void DrawPaneButton(wxDC& dc,
int button,
int button_state,
const wxRect& rect,
- wxPaneInfo& pane)
+ wxAuiPaneInfo& pane)
{
bool found;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyObject* odc = wxPyMake_wxObject(&dc, false);
PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
- PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
+ PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxAuiPaneInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiIOO)",
odc, owin, button, button_state,
orect, opane));
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawPaneButton(dc, window, button, button_state, rect, pane);
+ wxAuiDefaultDockArt::DrawPaneButton(dc, window, button, button_state, rect, pane);
}
PYPRIVATE;
};
-IMP_PYCALLBACK_INT_INT(wxPyDockArt, wxDefaultDockArt, GetMetric);
-IMP_PYCALLBACK_VOID_INTINT(wxPyDockArt, wxDefaultDockArt, SetMetric);
-IMP_PYCALLBACK__INTFONT(wxPyDockArt, wxDefaultDockArt, SetFont);
-IMP_PYCALLBACK_FONT_INT(wxPyDockArt, wxDefaultDockArt, GetFont);
-IMP_PYCALLBACK_COLOUR_INT(wxPyDockArt, wxDefaultDockArt, GetColour);
-IMP_PYCALLBACK__INTCOLOUR(wxPyDockArt, wxDefaultDockArt, SetColour);
+IMP_PYCALLBACK_INT_INT(wxPyAuiDockArt, wxAuiDefaultDockArt, GetMetric);
+IMP_PYCALLBACK_VOID_INTINT(wxPyAuiDockArt, wxAuiDefaultDockArt, SetMetric);
+IMP_PYCALLBACK__INTFONT(wxPyAuiDockArt, wxAuiDefaultDockArt, SetFont);
+IMP_PYCALLBACK_FONT_INT(wxPyAuiDockArt, wxAuiDefaultDockArt, GetFont);
+IMP_PYCALLBACK_COLOUR_INT(wxPyAuiDockArt, wxAuiDefaultDockArt, GetColour);
+IMP_PYCALLBACK__INTCOLOUR(wxPyAuiDockArt, wxAuiDefaultDockArt, SetColour);
%}
-DocStr(wxPyDockArt,
-"This version of the `DockArt` class has been instrumented to be
+DocStr(wxPyAuiDockArt,
+"This version of the `AuiDockArt` class has been instrumented to be
subclassable in Python and to reflect all calls to the C++ base class
methods to the Python methods implemented in the derived class.", "");
-class wxPyDockArt : public wxDefaultDockArt
+class wxPyAuiDockArt : public wxAuiDefaultDockArt
{
- %pythonAppend wxPyDockArt "self._setCallbackInfo(self, PyDockArt)"
- wxPyDocArt();
+ %pythonAppend wxPyAuiDockArt "self._setCallbackInfo(self, PyAuiDockArt)"
+ wxPyAuiDocArt();
};
//---------------------------------------------------------------------------
-%extend wxAuiMultiNotebook {
+%extend wxAuiNotebook {
%property(PageCount, GetPageCount, doc="See `GetPageCount`");
%property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
}
}
-%extend wxFrameManager {
+%extend wxAuiManager {
%property(AllPanes, GetAllPanes, doc="See `GetAllPanes`");
%property(ArtProvider, GetArtProvider, SetArtProvider, doc="See `GetArtProvider` and `SetArtProvider`");
%property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
}
-%extend wxFrameManagerEvent {
+%extend wxAuiManagerEvent {
%property(Button, GetButton, SetButton, doc="See `GetButton` and `SetButton`");
%property(DC, GetDC, SetDC, doc="See `GetDC` and `SetDC`");
%property(Pane, GetPane, SetPane, doc="See `GetPane` and `SetPane`");
%{
// A wxTabArt class that knows how to forward virtuals to Python methods
-class wxPyTabArt : public wxDefaultTabArt
+class wxPyAuiTabArt : public wxAuiDefaultTabArt
{
- wxPyTabArt() : wxDefaultTabArt() {}
+ wxPyAuiTabArt() : wxAuiDefaultTabArt() {}
virtual void DrawBackground( wxDC* dc,
}
wxPyEndBlockThreads(blocked);
if (!found)
- wxDefaultTabArt::DrawBackground(dc, rect);
+ wxAuiDefaultTabArt::DrawBackground(dc, rect);
}
virtual void DrawTab( wxDC* dc,
const wxRect& in_rect,
const wxString& caption,
bool active,
+ bool with_close_button,
wxRect* out_rect,
int* x_extent)
{
PyObject* orect = wxPyConstructObject((void*)&in_rect, wxT("wxRect"), 0);
PyObject* otext = wx2PyString(caption);
PyObject* ro;
- ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OOOi)", odc, orect, otext, (int)active));
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue(
+ "(OOOii)",
+ odc, orect, otext,
+ (int)active, (int)with_close_button));
if (ro) {
if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
PyObject* o1 = PySequence_GetItem(ro, 0);
}
wxPyEndBlockThreads(blocked);
if (!found)
- wxDefaultTabArt::DrawTab(dc, in_rect, caption, active, out_rect, x_extent);
+ wxAuiDefaultTabArt::DrawTab(dc, in_rect, caption, active, with_close_button, out_rect, x_extent);
}
}
wxPyEndBlockThreads(blocked);
if (!found)
- wxDefaultTabArt::DrawButton(dc, in_rect, bitmap_id, button_state, orientation, bitmap_override, out_rect);
+ wxAuiDefaultTabArt::DrawButton(dc, in_rect, bitmap_id, button_state, orientation, bitmap_override, out_rect);
}
virtual wxSize GetTabSize( wxDC* dc,
const wxString& caption,
bool active,
+ bool with_close_button,
int* x_extent)
{
bool found;
PyObject* odc = wxPyMake_wxObject(dc, false);
PyObject* otext = wx2PyString(caption);
PyObject* ro;
- ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OOi)", odc, otext, (int)active));
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue(
+ "(OOi)", odc, otext, (int)active, (int)with_close_button));
if (ro) {
if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
PyObject* o1 = PySequence_GetItem(ro, 0);
}
wxPyEndBlockThreads(blocked);
if (!found)
- rv = wxDefaultTabArt::GetTabSize(dc, caption, active, x_extent);
+ rv = wxAuiDefaultTabArt::GetTabSize(dc, caption, active, with_close_button, x_extent);
return rv;
}
};
-IMP_PYCALLBACK__FONT(wxPyTabArt, wxDefaultTabArt, SetNormalFont);
-IMP_PYCALLBACK__FONT(wxPyTabArt, wxDefaultTabArt, SetSelectedFont);
-IMP_PYCALLBACK__FONT(wxPyTabArt, wxDefaultTabArt, SetMeasuringFont);
-IMP_PYCALLBACK_INT_WIN(wxPyTabArt, wxDefaultTabArt, GetBestTabCtrlSize);
+IMP_PYCALLBACK__FONT(wxPyAuiTabArt, wxAuiDefaultTabArt, SetNormalFont);
+IMP_PYCALLBACK__FONT(wxPyAuiTabArt, wxAuiDefaultTabArt, SetSelectedFont);
+IMP_PYCALLBACK__FONT(wxPyAuiTabArt, wxAuiDefaultTabArt, SetMeasuringFont);
+IMP_PYCALLBACK_INT_WIN(wxPyAuiTabArt, wxAuiDefaultTabArt, GetBestTabCtrlSize);
%}
-DocStr(wxPyTabArt,
+DocStr(wxPyAuiTabArt,
"This version of the `TabArt` class has been instrumented to be
subclassable in Python and to reflect all calls to the C++ base class
methods to the Python methods implemented in the derived class.", "");
-class wxPyTabArt : public wxDefaultTabArt
+class wxPyAuiTabArt : public wxAuiDefaultTabArt
{
- %pythonAppend wxPyTabArt "self._setCallbackInfo(self, PyTabArt)"
- wxPyTabArt();
+ %pythonAppend wxPyAuiTabArt "self._setCallbackInfo(self, PyAuiTabArt)"
+ wxPyAuiTabArt();
};