nobody at rubyforge.org
2007-Mar-19 22:24 UTC
[Wxruby-development] [900] branches/wxruby2/wxwidgets_282/swig/classes: Initial commit of AUI core classes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[900] branches/wxruby2/wxwidgets_282/swig/classes: Initial commit of AUI core classes</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>900</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-03-19 18:24:51 -0400 (Mon, 19 Mar 2007)</dd> </dl> <h3>Log Message</h3> <pre>Initial commit of AUI core classes</pre> <h3>Added Paths</h3> <ul> <li><a href="#brancheswxruby2wxwidgets_282swigclassesAuiManageri">branches/wxruby2/wxwidgets_282/swig/classes/AuiManager.i</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesAuiPaneInfoi">branches/wxruby2/wxwidgets_282/swig/classes/AuiPaneInfo.i</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesincludewxAuiManagerh">branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiManager.h</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesincludewxAuiPaneInfoh">branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiPaneInfo.h</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="brancheswxruby2wxwidgets_282swigclassesAuiManageri"></a> <div class="addfile"><h4>Added: branches/wxruby2/wxwidgets_282/swig/classes/AuiManager.i (0 => 900)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/AuiManager.i         (rev 0) +++ branches/wxruby2/wxwidgets_282/swig/classes/AuiManager.i        2007-03-19 22:24:51 UTC (rev 900) </span><span class="lines">@@ -0,0 +1,15 @@ </span><ins>+# Copyright 2004-2007 by Kevin Smith +# released under the MIT-style wxruby2 license + +%include "../common.i" + +%module(directors="1") wxAuiManager + +%{ +#include <wx/aui/aui.h> +%} + +%import "include/wxEvtHandler.h" +%import "include/wxObject.h" + +%include "include/wxAuiManager.h" </ins></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesAuiPaneInfoi"></a> <div class="addfile"><h4>Added: branches/wxruby2/wxwidgets_282/swig/classes/AuiPaneInfo.i (0 => 900)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/AuiPaneInfo.i         (rev 0) +++ branches/wxruby2/wxwidgets_282/swig/classes/AuiPaneInfo.i        2007-03-19 22:24:51 UTC (rev 900) </span><span class="lines">@@ -0,0 +1,78 @@ </span><ins>+# Copyright 2004-2007 by Kevin Smith +# released under the MIT-style wxruby2 license + +%include "../common.i" + +%module(directors="1") wxAuiPaneInfo + +%{ +#include <wx/aui/aui.h> +%} + +// Inconsistent with the rest of the Wx API, the AUIPaneINfo +// has attribute setters that are the name of the attribute eg XXX(''...''), +// rather than SetXXX(''...''), and attribute getters that are C++ public +// members. In Ruby these can''t be distinguished, so we have to rename +// all the problem methods. We do the others too for consistency + +// boolean flags +%rename(SetBottomDockable) wxAuiPaneInfo::BottomDockable(bool b = true); +%rename(SetCaptionVisible) wxAuiPaneInfo::CaptionVisible(bool b = true); +%rename(SetCloseButton) wxAuiPaneInfo::CloseButton(bool b = true); +%rename(SetDestroyOnClose) wxAuiPaneInfo::DestroyOnClose(bool b = true); +%rename(SetDockable) wxAuiPaneInfo::Dockable(bool b = true); +%rename(SetFloatable) wxAuiPaneInfo::Floatable(bool b = true); +%rename(SetGripper) wxAuiPaneInfo::Gripper(bool b = true); +%rename(SetLeftDockable) wxAuiPaneInfo::LeftDockable(bool b = true); +%rename(SetMaximizeButton) wxAuiPaneInfo::MaximizeButton(bool b = true); +%rename(SetMinimizeButton) wxAuiPaneInfo::MinimizeButton(bool b = true); +%rename(SetPaneBorder) wxAuiPaneInfo::PaneBorder(bool b = true); +%rename(SetPinButton) wxAuiPaneInfo::PinButton(bool b = true); +%rename(SetMinimizeButton) wxAuiPaneInfo::MinimizeButton(bool b = true); +%rename(SetResizable) wxAuiPaneInfo::Resizable(bool b = true); +%rename(SetRightDockable) wxAuiPaneInfo::RightDockable(bool b = true); +%rename(SetTopDockable) wxAuiPaneInfo::TopDockable(bool b = true); + +// attribute-like settings +%rename(SetPosition) wxAuiPaneInfo::Position(int pos); +%rename(SetRow) wxAuiPaneInfo::Row(int row); + +// members +%immutable wxAuiPaneInfo::best_size; +%rename(GetBestSize) wxAuiPaneInfo::best_size; +%rename(SetBestSize) wxAuiPaneInfo::BestSize(const wxSize& size); +%rename(SetBestSize) wxAuiPaneInfo::BestSize(int x, int y); + +%immutable wxAuiPaneInfo::caption; +%rename(GetCaption) wxAuiPaneInfo::caption; +%rename(SetCaption) wxAuiPaneInfo::Caption(const wxString& c); + +%immutable wxAuiPaneInfo::floating_pos; +%rename(GetFloatingPosition) wxAuiPaneInfo::floating_pos; +%rename(SetFloatingPosition) wxAuiPaneInfo::FloatingPosition(const wxPoint& pos); +%rename(SetFloatingPosition) wxAuiPaneInfo::FloatingPosition(int x, int y); + +%immutable wxAuiPaneInfo::floating_size; +%rename(GetFloatingSize) wxAuiPaneInfo::floating_size; +%rename(SetFloatingSize) wxAuiPaneInfo::FloatingSize(const wxSize& size); +%rename(SetFloatingSize) wxAuiPaneInfo::FloatingSize(int x, int y); + +%immutable wxAuiPaneInfo::max_size; +%rename(GetMaxSize) wxAuiPaneInfo::max_size; +%rename(SetMaxSize) wxAuiPaneInfo::MaxSize(const wxSize& size); +%rename(SetMaxSize) wxAuiPaneInfo::MaxSize(int x, int y); + +%immutable wxAuiPaneInfo::min_size; +%rename(GetMinSize) wxAuiPaneInfo::min_size; +%rename(SetMinSize) wxAuiPaneInfo::MinSize(const wxSize& size); +%rename(SetMinSize) wxAuiPaneInfo::MinSize(int x, int y); + +%immutable wxAuiPaneInfo::name; +%rename(GetName) wxAuiPaneInfo::name; +%rename(SetName) wxAuiPaneInfo::Name(const wxString& n); + +%immutable wxAuiPaneInfo::window; +%rename(GetWindow) wxAuiPaneInfo::window; +%rename(SetWindow) wxAuiPaneInfo::Window(wxWindow* w); + +%include "include/wxAuiPaneInfo.h" </ins></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesincludewxAuiManagerh"></a> <div class="addfile"><h4>Added: branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiManager.h (0 => 900)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiManager.h         (rev 0) +++ branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiManager.h        2007-03-19 22:24:51 UTC (rev 900) </span><span class="lines">@@ -0,0 +1,206 @@ </span><ins>+// Copyright 2007 by Kevin Smith +// released under the MIT-style wxruby2 license + +#if !defined(_wxAuiManager_h_) +#define _wxAuiManager_h_ + +class wxAuiManager : public wxEvtHandler +{ +friend class wxAuiFloatingFrame; + +public: + + wxAuiManager(wxWindow* managed_wnd = NULL, + unsigned int flags = wxAUI_MGR_DEFAULT); + virtual ~wxAuiManager(); + void UnInit(); + + void SetFlags(unsigned int flags); + unsigned int GetFlags() const; + + void SetManagedWindow(wxWindow* managed_wnd); + wxWindow* GetManagedWindow() const; + + static wxAuiManager* GetManager(wxWindow* window); + + void SetArtProvider(wxAuiDockArt* art_provider); + wxAuiDockArt* GetArtProvider() const; + + wxAuiPaneInfo& GetPane(wxWindow* window); + wxAuiPaneInfo& GetPane(const wxString& name); + wxAuiPaneInfoArray& GetAllPanes(); + + bool AddPane(wxWindow* window, + const wxAuiPaneInfo& pane_info); + + bool AddPane(wxWindow* window, + const wxAuiPaneInfo& pane_info, + const wxPoint& drop_pos); + + bool AddPane(wxWindow* window, + int direction = wxLEFT, + const wxString& caption = wxEmptyString); + + bool InsertPane(wxWindow* window, + const wxAuiPaneInfo& insert_location, + int insert_level = wxAUI_INSERT_PANE); + + bool DetachPane(wxWindow* window); + + void Update(); + + wxString SavePaneInfo(wxAuiPaneInfo& pane); + void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane); + wxString SavePerspective(); + bool LoadPerspective(const wxString& perspective, bool update = true); + + void SetDockSizeConstraint(double width_pct, double height_pct); + void GetDockSizeConstraint(double* width_pct, double* height_pct) const; + + void ClosePane(wxAuiPaneInfo& pane_info); + void MaximizePane(wxAuiPaneInfo& pane_info); + void RestorePane(wxAuiPaneInfo& pane_info); + void RestoreMaximizedPane(); + +public: + + virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p); + + void StartPaneDrag( + wxWindow* pane_window, + const wxPoint& offset); + + wxRect CalculateHintRect( + wxWindow* pane_window, + const wxPoint& pt, + const wxPoint& offset); + + void DrawHintRect( + wxWindow* pane_window, + const wxPoint& pt, + const wxPoint& offset); + + virtual void ShowHint(const wxRect& rect); + virtual void HideHint(); + +protected: + + void UpdateHintWindowConfig(); + + void DoFrameLayout(); + + void LayoutAddPane(wxSizer* container, + wxAuiDockInfo& dock, + wxAuiPaneInfo& pane, + wxAuiDockUIPartArray& uiparts, + bool spacer_only); + + void LayoutAddDock(wxSizer* container, + wxAuiDockInfo& dock, + wxAuiDockUIPartArray& uiparts, + bool spacer_only); + + wxSizer* LayoutAll(wxAuiPaneInfoArray& panes, + wxAuiDockInfoArray& docks, + wxAuiDockUIPartArray& uiparts, + bool spacer_only = false); + + /* virtual bool ProcessDockResult(wxAuiPaneInfo& target, +         const wxAuiPaneInfo& new_pos); */ +        bool ProcessDockResult(wxAuiPaneInfo& target, + const wxAuiPaneInfo& new_pos); + + bool DoDrop(wxAuiDockInfoArray& docks, + wxAuiPaneInfoArray& panes, + wxAuiPaneInfo& drop, + const wxPoint& pt, + const wxPoint& action_offset = wxPoint(0,0)); + + wxAuiDockUIPart* HitTest(int x, int y); + wxAuiDockUIPart* GetPanePart(wxWindow* pane); + int GetDockPixelOffset(wxAuiPaneInfo& test); + void OnFloatingPaneMoveStart(wxWindow* window); + void OnFloatingPaneMoving(wxWindow* window, wxDirection dir ); + void OnFloatingPaneMoved(wxWindow* window, wxDirection dir); + void OnFloatingPaneActivated(wxWindow* window); + void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt); + void OnFloatingPaneResized(wxWindow* window, const wxSize& size); + void Render(wxDC* dc); + void Repaint(wxDC* dc = NULL); + void ProcessMgrEvent(wxAuiManagerEvent& event); + void UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part, + const wxMouseEvent& event); + void GetPanePositionsAndSizes(wxAuiDockInfo& dock, + wxArrayInt& positions, + wxArrayInt& sizes); + + +public: + + // public events (which can be invoked externally) + void OnRender(wxAuiManagerEvent& evt); + void OnPaneButton(wxAuiManagerEvent& evt); + +protected: + + // protected events + void OnPaint(wxPaintEvent& evt); + void OnEraseBackground(wxEraseEvent& evt); + void OnSize(wxSizeEvent& evt); + void OnSetCursor(wxSetCursorEvent& evt); + void OnLeftDown(wxMouseEvent& evt); + void OnLeftUp(wxMouseEvent& evt); + void OnMotion(wxMouseEvent& evt); + void OnLeaveWindow(wxMouseEvent& evt); + void OnChildFocus(wxChildFocusEvent& evt); + void OnHintFadeTimer(wxTimerEvent& evt); + void OnFindManager(wxAuiManagerEvent& evt); + +protected: + + enum + { + actionNone = 0, + actionResize, + actionClickButton, + actionClickCaption, + actionDragToolbarPane, + actionDragFloatingPane + }; + +protected: + + wxWindow* m_frame; // the window being managed + wxAuiDockArt* m_art; // dock art object which does all drawing + unsigned int m_flags; // manager flags wxAUI_MGR_* + + wxAuiPaneInfoArray m_panes; // array of panes structures + wxAuiDockInfoArray m_docks; // array of docks structures + wxAuiDockUIPartArray m_uiparts; // array of UI parts (captions, buttons, etc) + + int m_action; // current mouse action + wxPoint m_action_start; // position where the action click started + wxPoint m_action_offset; // offset from upper left of the item clicked + wxAuiDockUIPart* m_action_part; // ptr to the part the action happened to + wxWindow* m_action_window; // action frame or window (NULL if none) + wxRect m_action_hintrect; // hint rectangle for the action + wxRect m_last_rect; + wxAuiDockUIPart* m_hover_button;// button uipart being hovered over + wxRect m_last_hint; // last hint rectangle + wxPoint m_last_mouse_move; // last mouse move position (see OnMotion) + bool m_skipping; + bool m_has_maximized; + + double m_dock_constraint_x; // 0.0 .. 1.0; max pct of window width a dock can consume + double m_dock_constraint_y; // 0.0 .. 1.0; max pct of window height a dock can consume + + wxFrame* m_hint_wnd; // transparent hint window, if supported by platform + wxTimer m_hint_fadetimer; // transparent fade timer + wxByte m_hint_fadeamt; // transparent fade amount + wxByte m_hint_fademax; // maximum value of hint fade + + void* m_reserved; + +}; + +#endif </ins></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesincludewxAuiPaneInfoh"></a> <div class="addfile"><h4>Added: branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiPaneInfo.h (0 => 900)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiPaneInfo.h         (rev 0) +++ branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiPaneInfo.h        2007-03-19 22:24:51 UTC (rev 900) </span><span class="lines">@@ -0,0 +1,228 @@ </span><ins>+// Copyright 2007 by Kevin Smith +// released under the MIT-style wxruby2 license + +#if !defined(_wxAuiPaneInfo_h_) +#define _wxAuiPaneInfo_h_ + +class wxAuiPaneInfo +{ +public: + + wxAuiPaneInfo() + { + window = NULL; + frame = NULL; + state = 0; + dock_direction = wxAUI_DOCK_LEFT; + dock_layer = 0; + dock_row = 0; + dock_pos = 0; + floating_pos = wxDefaultPosition; + floating_size = wxDefaultSize; + best_size = wxDefaultSize; + min_size = wxDefaultSize; + max_size = wxDefaultSize; + dock_proportion = 0; + + DefaultPane(); + } + + ~wxAuiPaneInfo() {} + + // Write the safe parts of a newly loaded PaneInfo structure "source" into "this" + // used on loading perspectives etc. + void SafeSet(wxAuiPaneInfo source) + { + // note source is not passed by reference so we can overwrite, to keep the + // unsafe bits of "dest" + source.window = window; + source.frame = frame; + source.buttons = buttons; + // now assign + *this = source; + } + + bool IsOk() const { return (window != NULL) ? true : false; } + bool IsFixed() const { return !HasFlag(optionResizable); } + bool IsResizable() const { return HasFlag(optionResizable); } + bool IsShown() const { return !HasFlag(optionHidden); } + bool IsFloating() const { return HasFlag(optionFloating); } + bool IsDocked() const { return !HasFlag(optionFloating); } + bool IsToolbar() const { return HasFlag(optionToolbar); } + bool IsTopDockable() const { return HasFlag(optionTopDockable); } + bool IsBottomDockable() const { return HasFlag(optionBottomDockable); } + bool IsLeftDockable() const { return HasFlag(optionLeftDockable); } + bool IsRightDockable() const { return HasFlag(optionRightDockable); } + bool IsFloatable() const { return HasFlag(optionFloatable); } + bool IsMovable() const { return HasFlag(optionMovable); } + bool IsDestroyOnClose() const { return HasFlag(optionDestroyOnClose); } + bool IsMaximized() const { return HasFlag(optionMaximized); } + bool HasCaption() const { return HasFlag(optionCaption); } + bool HasGripper() const { return HasFlag(optionGripper); } + bool HasBorder() const { return HasFlag(optionPaneBorder); } + bool HasCloseButton() const { return HasFlag(buttonClose); } + bool HasMaximizeButton() const { return HasFlag(buttonMaximize); } + bool HasMinimizeButton() const { return HasFlag(buttonMinimize); } + bool HasPinButton() const { return HasFlag(buttonPin); } + bool HasGripperTop() const { return HasFlag(optionGripperTop); } + + wxAuiPaneInfo& Window(wxWindow* w) { window = w; return *this; } + wxAuiPaneInfo& Name(const wxString& n) { name = n; return *this; } + wxAuiPaneInfo& Caption(const wxString& c) { caption = c; return *this; } + wxAuiPaneInfo& Left() { dock_direction = wxAUI_DOCK_LEFT; return *this; } + wxAuiPaneInfo& Right() { dock_direction = wxAUI_DOCK_RIGHT; return *this; } + wxAuiPaneInfo& Top() { dock_direction = wxAUI_DOCK_TOP; return *this; } + wxAuiPaneInfo& Bottom() { dock_direction = wxAUI_DOCK_BOTTOM; return *this; } + wxAuiPaneInfo& Center() { dock_direction = wxAUI_DOCK_CENTER; return *this; } + wxAuiPaneInfo& Centre() { dock_direction = wxAUI_DOCK_CENTRE; return *this; } + wxAuiPaneInfo& Direction(int direction) { dock_direction = direction; return *this; } + wxAuiPaneInfo& Layer(int layer) { dock_layer = layer; return *this; } + wxAuiPaneInfo& Row(int row) { dock_row = row; return *this; } + wxAuiPaneInfo& Position(int pos) { dock_pos = pos; return *this; } + wxAuiPaneInfo& BestSize(const wxSize& size) { best_size = size; return *this; } + wxAuiPaneInfo& MinSize(const wxSize& size) { min_size = size; return *this; } + wxAuiPaneInfo& MaxSize(const wxSize& size) { max_size = size; return *this; } + wxAuiPaneInfo& BestSize(int x, int y) { best_size.Set(x,y); return *this; } + wxAuiPaneInfo& MinSize(int x, int y) { min_size.Set(x,y); return *this; } + wxAuiPaneInfo& MaxSize(int x, int y) { max_size.Set(x,y); return *this; } + wxAuiPaneInfo& FloatingPosition(const wxPoint& pos) { floating_pos = pos; return *this; } + wxAuiPaneInfo& FloatingPosition(int x, int y) { floating_pos.x = x; floating_pos.y = y; return *this; } + wxAuiPaneInfo& FloatingSize(const wxSize& size) { floating_size = size; return *this; } + wxAuiPaneInfo& FloatingSize(int x, int y) { floating_size.Set(x,y); return *this; } + wxAuiPaneInfo& Fixed() { return SetFlag(optionResizable, false); } + wxAuiPaneInfo& Resizable(bool resizable = true) { return SetFlag(optionResizable, resizable); } + wxAuiPaneInfo& Dock() { return SetFlag(optionFloating, false); } + wxAuiPaneInfo& Float() { return SetFlag(optionFloating, true); } + wxAuiPaneInfo& Hide() { return SetFlag(optionHidden, true); } + wxAuiPaneInfo& Show(bool show = true) { return SetFlag(optionHidden, !show); } + wxAuiPaneInfo& CaptionVisible(bool visible = true) { return SetFlag(optionCaption, visible); } + wxAuiPaneInfo& Maximize() { return SetFlag(optionMaximized, true); } + wxAuiPaneInfo& Restore() { return SetFlag(optionMaximized, false); } + wxAuiPaneInfo& PaneBorder(bool visible = true) { return SetFlag(optionPaneBorder, visible); } + wxAuiPaneInfo& Gripper(bool visible = true) { return SetFlag(optionGripper, visible); } + wxAuiPaneInfo& GripperTop(bool attop = true) { return SetFlag(optionGripperTop, attop); } + wxAuiPaneInfo& CloseButton(bool visible = true) { return SetFlag(buttonClose, visible); } + wxAuiPaneInfo& MaximizeButton(bool visible = true) { return SetFlag(buttonMaximize, visible); } + wxAuiPaneInfo& MinimizeButton(bool visible = true) { return SetFlag(buttonMinimize, visible); } + wxAuiPaneInfo& PinButton(bool visible = true) { return SetFlag(buttonPin, visible); } + wxAuiPaneInfo& DestroyOnClose(bool b = true) { return SetFlag(optionDestroyOnClose, b); } + wxAuiPaneInfo& TopDockable(bool b = true) { return SetFlag(optionTopDockable, b); } + wxAuiPaneInfo& BottomDockable(bool b = true) { return SetFlag(optionBottomDockable, b); } + wxAuiPaneInfo& LeftDockable(bool b = true) { return SetFlag(optionLeftDockable, b); } + wxAuiPaneInfo& RightDockable(bool b = true) { return SetFlag(optionRightDockable, b); } + wxAuiPaneInfo& Floatable(bool b = true) { return SetFlag(optionFloatable, b); } + wxAuiPaneInfo& Movable(bool b = true) { return SetFlag(optionMovable, b); } + + wxAuiPaneInfo& Dockable(bool b = true) + { + return TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b); + } + + wxAuiPaneInfo& DefaultPane() + { + state |= optionTopDockable | optionBottomDockable | + optionLeftDockable | optionRightDockable | + optionFloatable | optionMovable | optionResizable | + optionCaption | optionPaneBorder | buttonClose; + return *this; + } + + wxAuiPaneInfo& CentrePane() { return CenterPane(); } + wxAuiPaneInfo& CenterPane() + { + state = 0; + return Center().PaneBorder().Resizable(); + } + + wxAuiPaneInfo& ToolbarPane() + { + DefaultPane(); + state |= (optionToolbar | optionGripper); + state &= ~(optionResizable | optionCaption); + if (dock_layer == 0) + dock_layer = 10; + return *this; + } + + wxAuiPaneInfo& SetFlag(unsigned int flag, bool option_state) + { + if (option_state) + state |= flag; + else + state &= ~flag; + return *this; + } + + bool HasFlag(unsigned int flag) const + { + return (state & flag) ? true:false; + } + +public: + + // NOTE: You can add and subtract flags from this list, + // but do not change the values of the flags, because + // they are stored in a binary integer format in the + // perspective string. If you really need to change the + // values around, you''ll have to ensure backwards-compatibility + // in the perspective loading code. + enum wxAuiPaneState + { + optionFloating = 1 << 0, + optionHidden = 1 << 1, + optionLeftDockable = 1 << 2, + optionRightDockable = 1 << 3, + optionTopDockable = 1 << 4, + optionBottomDockable = 1 << 5, + optionFloatable = 1 << 6, + optionMovable = 1 << 7, + optionResizable = 1 << 8, + optionPaneBorder = 1 << 9, + optionCaption = 1 << 10, + optionGripper = 1 << 11, + optionDestroyOnClose = 1 << 12, + optionToolbar = 1 << 13, + optionActive = 1 << 14, + optionGripperTop = 1 << 15, + optionMaximized = 1 << 16, + + buttonClose = 1 << 21, + buttonMaximize = 1 << 22, + buttonMinimize = 1 << 23, + buttonPin = 1 << 24, + + buttonCustom1 = 1 << 26, + buttonCustom2 = 1 << 27, + buttonCustom3 = 1 << 28, + + savedHiddenState = 1 << 30, // used internally + actionPane = 1 << 31 // used internally + }; + +public: + wxString name; // name of the pane + wxString caption; // caption displayed on the window + + wxWindow* window; // window that is in this pane + wxFrame* frame; // floating frame window that holds the pane + unsigned int state; // a combination of wxPaneState values + + int dock_direction; // dock direction (top, bottom, left, right, center) + int dock_layer; // layer number (0 = innermost layer) + int dock_row; // row number on the docking bar (0 = first row) + int dock_pos; // position inside the row (0 = first position) + + wxSize best_size; // size that the layout engine will prefer + wxSize min_size; // minimum size the pane window can tolerate + wxSize max_size; // maximum size the pane window can tolerate + + wxPoint floating_pos; // position while floating + wxSize floating_size; // size while floating + int dock_proportion; // proportion while docked + + wxAuiPaneButtonArray buttons; // buttons on the pane + + wxRect rect; // current rectangle (populated by wxAUI) +}; + +#endif </ins></span></pre> </div> </div> </body> </html>
Maybe Matching Threads
- [916] branches/wxruby2/wxwidgets_282: More Wx::AUI classes, event hooks and sample
- [1012] trunk/wxruby2/doc/textile: Added docs for AUI Advanced User Interface classes
- X86 does not follow -fuse-init-array
- [cfe-dev] Disabling vectorisation at '-O3'
- [cfe-dev] Disabling vectorisation at '-O3'