Added support for the wxAUI Notebook
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
14
wxPython/demo/AUI.py → wxPython/demo/AUI_DockingWindowMgr.py
Executable file → Normal file
14
wxPython/demo/AUI.py → wxPython/demo/AUI_DockingWindowMgr.py
Executable file → Normal file
@@ -67,7 +67,7 @@ class PyAUIFrame(wx.Frame):
|
|||||||
|
|
||||||
# tell FrameManager to manage this frame
|
# tell FrameManager to manage this frame
|
||||||
self._mgr = wx.aui.FrameManager()
|
self._mgr = wx.aui.FrameManager()
|
||||||
self._mgr.SetFrame(self)
|
self._mgr.SetManagedWindow(self)
|
||||||
|
|
||||||
self._perspectives = []
|
self._perspectives = []
|
||||||
self.n = 0
|
self.n = 0
|
||||||
@@ -477,13 +477,13 @@ class PyAUIFrame(wx.Frame):
|
|||||||
|
|
||||||
flag = 0
|
flag = 0
|
||||||
|
|
||||||
if wx.Platform != "__WXMSW__" and wx.Platform != '__WXMAC__':
|
## if wx.Platform != "__WXMSW__" and wx.Platform != '__WXMAC__':
|
||||||
if event.GetId() == ID_TransparentDrag or \
|
## if event.GetId() == ID_TransparentDrag or \
|
||||||
event.GetId() == ID_TransparentHint or \
|
## event.GetId() == ID_TransparentHint or \
|
||||||
event.GetId() == ID_TransparentHintFade:
|
## event.GetId() == ID_TransparentHintFade:
|
||||||
|
|
||||||
wx.MessageBox("This option is presently only available on wxMSW and wxMac")
|
## wx.MessageBox("This option is presently only available on wxMSW and wxMac")
|
||||||
return
|
## return
|
||||||
|
|
||||||
if event.GetId() == ID_AllowFloating:
|
if event.GetId() == ID_AllowFloating:
|
||||||
flag = wx.aui.AUI_MGR_ALLOW_FLOATING
|
flag = wx.aui.AUI_MGR_ALLOW_FLOATING
|
60
wxPython/demo/AUI_Notebook.py
Normal file
60
wxPython/demo/AUI_Notebook.py
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
|
||||||
|
import wx
|
||||||
|
import wx.aui
|
||||||
|
|
||||||
|
|
||||||
|
text = """\
|
||||||
|
Hello!
|
||||||
|
|
||||||
|
Welcome to this little demo of draggable tabs using the wx.aui module.
|
||||||
|
|
||||||
|
To try it out, drag a tab from the top of the window all the way to
|
||||||
|
the bottom. After releasing the mouse, the tab will dock at the
|
||||||
|
hinted position. Then try it again with the remaining tabs in various
|
||||||
|
other positions. Finally, try dragging a tab to an existing tab ctrl.
|
||||||
|
You'll soon see that very complex tab layouts may be achieved.
|
||||||
|
"""
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestPanel(wx.Panel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
self.log = log
|
||||||
|
wx.Panel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
self.nb = wx.aui.AuiMultiNotebook(self)
|
||||||
|
page = wx.TextCtrl(self.nb, -1, text, style=wx.TE_MULTILINE)
|
||||||
|
self.nb.AddPage(page, "Welcome")
|
||||||
|
|
||||||
|
for num in range(1, 5):
|
||||||
|
page = wx.TextCtrl(self.nb, -1, "This is page %d" % num ,
|
||||||
|
style=wx.TE_MULTILINE)
|
||||||
|
self.nb.AddPage(page, "Tab Number %d" % num)
|
||||||
|
|
||||||
|
sizer = wx.BoxSizer()
|
||||||
|
sizer.Add(self.nb, 1, wx.EXPAND)
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """<html><body>
|
||||||
|
<h2><center>Say something nice here</center></h2>
|
||||||
|
|
||||||
|
</body></html>
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import sys,os
|
||||||
|
import run
|
||||||
|
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|
||||||
|
|
@@ -48,7 +48,8 @@ _treeList = [
|
|||||||
# new stuff
|
# new stuff
|
||||||
('Recent Additions/Updates', [
|
('Recent Additions/Updates', [
|
||||||
'AnalogClock',
|
'AnalogClock',
|
||||||
'AUI',
|
'AUI_DockingWindowMgr',
|
||||||
|
'AUI_Notebook',
|
||||||
'CheckListCtrlMixin',
|
'CheckListCtrlMixin',
|
||||||
'Pickers',
|
'Pickers',
|
||||||
'PseudoDC',
|
'PseudoDC',
|
||||||
@@ -59,7 +60,7 @@ _treeList = [
|
|||||||
|
|
||||||
# managed windows == things with a (optional) caption you can close
|
# managed windows == things with a (optional) caption you can close
|
||||||
('Frames and Dialogs', [
|
('Frames and Dialogs', [
|
||||||
'AUI',
|
'AUI_DockingWindowMgr',
|
||||||
'Dialog',
|
'Dialog',
|
||||||
'Frame',
|
'Frame',
|
||||||
'MDIWindows',
|
'MDIWindows',
|
||||||
@@ -128,6 +129,7 @@ _treeList = [
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
('"Book" Controls', [
|
('"Book" Controls', [
|
||||||
|
'AUI_Notebook',
|
||||||
'Choicebook',
|
'Choicebook',
|
||||||
'Listbook',
|
'Listbook',
|
||||||
'Notebook',
|
'Notebook',
|
||||||
|
@@ -495,6 +495,7 @@ swig_sources = run_swig(['aui.i'], 'src', GENDIR, PKGDIR,
|
|||||||
opj(WXDIR, 'include/wx/aui/framemanager.h'),
|
opj(WXDIR, 'include/wx/aui/framemanager.h'),
|
||||||
opj(WXDIR, 'include/wx/aui/floatpane.h'),
|
opj(WXDIR, 'include/wx/aui/floatpane.h'),
|
||||||
opj(WXDIR, 'include/wx/aui/dockart.h'),
|
opj(WXDIR, 'include/wx/aui/dockart.h'),
|
||||||
|
opj(WXDIR, 'include/wx/aui/auibook.h'),
|
||||||
])
|
])
|
||||||
if not MONOLITHIC:
|
if not MONOLITHIC:
|
||||||
auiLib = makeLibName('aui')
|
auiLib = makeLibName('aui')
|
||||||
|
@@ -139,7 +139,8 @@ The following example shows a simple implementation that utilizes
|
|||||||
#define wxDEPRECATED(decl)
|
#define wxDEPRECATED(decl)
|
||||||
|
|
||||||
|
|
||||||
// We'll let SWIG handle the function overloading for these
|
// 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::MaxSize(int x, int y);
|
||||||
%ignore wxPaneInfo::MinSize(int x, int y);
|
%ignore wxPaneInfo::MinSize(int x, int y);
|
||||||
%ignore wxPaneInfo::BestSize(int x, int y);
|
%ignore wxPaneInfo::BestSize(int x, int y);
|
||||||
@@ -169,12 +170,21 @@ The following example shows a simple implementation that utilizes
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%nokwargs wxAuiTabContainer::SetActivePage;
|
||||||
|
|
||||||
|
%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();
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Get all our defs from the REAL header files.
|
// Get all our defs from the REAL header files.
|
||||||
%include framemanager.h
|
%include framemanager.h
|
||||||
%include dockart.h
|
%include dockart.h
|
||||||
%include floatpane.h
|
%include floatpane.h
|
||||||
|
%include auibook.h
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Methods to inject into the FrameManager class that will sort out calls to
|
// Methods to inject into the FrameManager class that will sort out calls to
|
||||||
@@ -241,6 +251,7 @@ The following example shows a simple implementation that utilizes
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
// A wxDocArt lcass that knows how to forward virtuals to Python methods
|
||||||
class wxPyDockArt : public wxDefaultDockArt
|
class wxPyDockArt : public wxDefaultDockArt
|
||||||
{
|
{
|
||||||
wxPyDockArt() : wxDefaultDockArt() {}
|
wxPyDockArt() : wxDefaultDockArt() {}
|
||||||
|
Reference in New Issue
Block a user