From 4cbc57f086cee690f397ac5622d3f1d7153b300e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 21 Jan 2002 22:34:42 +0000 Subject: [PATCH] Tidied/commented FL header files, regenerated docs and filled out Category section. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/docs/latex/fl/baglayout.tex | 12 +- contrib/docs/latex/fl/bariterator.tex | 18 +- contrib/docs/latex/fl/category.tex | 95 +- contrib/docs/latex/fl/cbantiflickerplugin.tex | 31 +- contrib/docs/latex/fl/cbbardimhandlerbase.tex | 29 +- contrib/docs/latex/fl/cbbardragplugin.tex | 78 +- contrib/docs/latex/fl/cbbarhintsplugin.tex | 50 +- contrib/docs/latex/fl/cbbarinfo.tex | 18 +- contrib/docs/latex/fl/cbbarshapedata.tex | 10 +- contrib/docs/latex/fl/cbbarspy.tex | 43 +- contrib/docs/latex/fl/cbclosebox.tex | 10 +- contrib/docs/latex/fl/cbcollapsebox.tex | 11 +- .../docs/latex/fl/cbcommonpaneproperties.tex | 14 +- contrib/docs/latex/fl/cbcustomizebarevent.tex | 11 +- .../docs/latex/fl/cbcustomizelayoutevent.tex | 11 +- contrib/docs/latex/fl/cbdiminfo.tex | 36 +- contrib/docs/latex/fl/cbdockbox.tex | 11 +- contrib/docs/latex/fl/cbdockpane.tex | 243 +- contrib/docs/latex/fl/cbdrawbardecorevent.tex | 11 +- .../docs/latex/fl/cbdrawbarhandlesevent.tex | 11 +- contrib/docs/latex/fl/cbdrawhintrectevent.tex | 10 +- .../docs/latex/fl/cbdrawpanebkgroundevent.tex | 11 +- .../docs/latex/fl/cbdrawpanedecorevent.tex | 11 +- .../docs/latex/fl/cbdrawrowbkgroundevent.tex | 11 +- contrib/docs/latex/fl/cbdrawrowdecorevent.tex | 11 +- .../docs/latex/fl/cbdrawrowhandlesevent.tex | 11 +- .../docs/latex/fl/cbdyntoolbardimhandler.tex | 13 +- .../docs/latex/fl/cbfinishdrawinareaevent.tex | 11 +- contrib/docs/latex/fl/cbfloatedbarwindow.tex | 32 +- contrib/docs/latex/fl/cbgcupdatesmgr.tex | 155 +- contrib/docs/latex/fl/cbhiddenbarinfo.tex | 8 +- .../docs/latex/fl/cbhintanimationplugin.tex | 28 +- contrib/docs/latex/fl/cbhintanimtimer.tex | 9 +- contrib/docs/latex/fl/cbinsertbarevent.tex | 11 +- contrib/docs/latex/fl/cblayoutrowevent.tex | 10 +- contrib/docs/latex/fl/cblayoutrowsevent.tex | 11 +- contrib/docs/latex/fl/cbleftdclickevent.tex | 11 +- contrib/docs/latex/fl/cbleftdownevent.tex | 10 +- contrib/docs/latex/fl/cbleftupevent.tex | 11 +- contrib/docs/latex/fl/cbminibutton.tex | 35 +- contrib/docs/latex/fl/cbmotionevent.tex | 11 +- contrib/docs/latex/fl/cbpanedrawplugin.tex | 82 +- contrib/docs/latex/fl/cbpluginbase.tex | 38 +- contrib/docs/latex/fl/cbpluginevent.tex | 25 +- contrib/docs/latex/fl/cbremovebarevent.tex | 11 +- contrib/docs/latex/fl/cbresizebarevent.tex | 11 +- contrib/docs/latex/fl/cbresizerowevent.tex | 11 +- contrib/docs/latex/fl/cbrightdownevent.tex | 11 +- contrib/docs/latex/fl/cbrightupevent.tex | 11 +- contrib/docs/latex/fl/cbrowdragplugin.tex | 110 +- contrib/docs/latex/fl/cbrowinfo.tex | 16 +- contrib/docs/latex/fl/cbrowlayoutplugin.tex | 64 +- .../latex/fl/cbsimplecustomizationplugin.tex | 21 +- contrib/docs/latex/fl/cbsimpleupdatesmgr.tex | 39 +- contrib/docs/latex/fl/cbsizebarwndevent.tex | 11 +- .../docs/latex/fl/cbstartbardraggingevent.tex | 11 +- .../docs/latex/fl/cbstartdrawinareaevent.tex | 10 +- contrib/docs/latex/fl/cbupdatemgrdata.tex | 25 +- .../docs/latex/fl/cbupdatesmanagerbase.tex | 50 +- contrib/docs/latex/fl/classes.tex | 9 +- contrib/docs/latex/fl/dynamictoolbar.tex | 78 +- contrib/docs/latex/fl/dyntoolinfo.tex | 9 +- contrib/docs/latex/fl/framelayout.tex | 282 +- contrib/docs/latex/fl/garbagecollector.tex | 34 +- contrib/docs/latex/fl/gcitem.tex | 6 +- contrib/docs/latex/fl/layoutmanagerbase.tex | 12 +- contrib/docs/latex/fl/makefile.vc | 2 +- contrib/docs/latex/fl/morphinfot.tex | 8 +- contrib/docs/latex/fl/newbitmapbutton.tex | 54 +- contrib/docs/latex/fl/toollayoutitem.tex | 8 +- contrib/docs/latex/fl/toolwindow.tex | 59 +- contrib/include/wx/fl/antiflickpl.h | 66 +- contrib/include/wx/fl/bardragpl.h | 193 +- contrib/include/wx/fl/barhintspl.h | 110 +- contrib/include/wx/fl/cbcustom.h | 28 +- contrib/include/wx/fl/controlbar.h | 2397 ++++++++++------- contrib/include/wx/fl/dynbarhnd.h | 6 +- contrib/include/wx/fl/dyntbar.h | 215 +- contrib/include/wx/fl/dyntbarhnd.h | 20 +- contrib/include/wx/fl/frmview.h | 138 +- contrib/include/wx/fl/garbagec.h | 72 +- contrib/include/wx/fl/gcupdatesmgr.h | 176 +- contrib/include/wx/fl/hintanimpl.h | 116 +- contrib/include/wx/fl/newbmpbtn.h | 207 +- contrib/include/wx/fl/panedrawpl.h | 176 +- contrib/include/wx/fl/rowdragpl.h | 261 +- contrib/include/wx/fl/rowlayoutpl.h | 123 +- contrib/include/wx/fl/toolwnd.h | 291 +- contrib/include/wx/fl/updatesmgr.h | 54 +- contrib/src/fl/antiflickpl.cpp | 8 +- contrib/src/fl/bardragpl.cpp | 15 +- contrib/src/fl/barhintspl.cpp | 6 +- contrib/src/fl/cbcustom.cpp | 6 +- contrib/src/fl/controlbar.cpp | 28 +- contrib/src/fl/dyntbar.cpp | 525 ++-- contrib/src/fl/dyntbarhnd.cpp | 20 +- contrib/src/fl/files.lst | 1 - contrib/src/fl/flVC.dsp | 4 - contrib/src/fl/frmview.cpp | 6 +- contrib/src/fl/garbagec.cpp | 198 +- contrib/src/fl/gcupdatesmgr.cpp | 508 ++-- contrib/src/fl/hintanimpl.cpp | 416 +-- contrib/src/fl/newbmpbtn.cpp | 15 +- contrib/src/fl/panedrawpl.cpp | 1740 ++++++------ contrib/src/fl/rowdragpl.cpp | 2010 +++++++------- contrib/src/fl/rowlayoutpl.cpp | 6 +- contrib/src/fl/toolwnd.cpp | 6 +- contrib/src/fl/updatesmgr.cpp | 374 +-- 108 files changed, 7514 insertions(+), 5329 deletions(-) diff --git a/contrib/docs/latex/fl/baglayout.tex b/contrib/docs/latex/fl/baglayout.tex index aabed77ce1..0e7224b185 100644 --- a/contrib/docs/latex/fl/baglayout.tex +++ b/contrib/docs/latex/fl/baglayout.tex @@ -1,19 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% dyntbar.h at 05/Jan/02 22:50:56 +% dyntbar.h at 21/Jan/02 21:14:18 % \section{\class{BagLayout}}\label{baglayout} -layouts items in left-to-right order from -top towards bottom +BagLayout lays out items in left-to-right order from +top to bottom. \wxheading{Derived from} \helpref{LayoutManagerBase}{layoutmanagerbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -23,3 +27,5 @@ top towards bottom \func{void}{Layout}{\param{const wxSize\& }{parentDim}, \param{wxSize\& }{resultingDim}, \param{wxLayoutItemArrayT\& }{items}, \param{int }{horizGap}, \param{int }{vertGap}} +Constructor. + diff --git a/contrib/docs/latex/fl/bariterator.tex b/contrib/docs/latex/fl/bariterator.tex index 2b919c5138..3dca28c9f9 100644 --- a/contrib/docs/latex/fl/bariterator.tex +++ b/contrib/docs/latex/fl/bariterator.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{wxBarIterator}}\label{wxbariterator} -used for traversing through all bars of all rows in the pane +Used for traversing through all bars of all rows in the pane. \wxheading{Derived from} No base class +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,27 +26,33 @@ No base class \func{}{wxBarIterator}{\param{RowArrayT\& }{rows}} +Constructor, taking row array. + \membersection{wxBarIterator::BarInfo}\label{wxbariteratorbarinfo} \func{cbBarInfo\&}{BarInfo}{\void} +Gets the current bar information. + \membersection{wxBarIterator::Next}\label{wxbariteratornext} \func{bool}{Next}{\void} -TRUE, if next bar is available +Advances the iterator and returns TRUE if a bar is available. \membersection{wxBarIterator::Reset}\label{wxbariteratorreset} \func{void}{Reset}{\void} +Resets the iterator to the start of the first row. + \membersection{wxBarIterator::RowInfo}\label{wxbariteratorrowinfo} \func{cbRowInfo\&}{RowInfo}{\void} -returns reference to currently traversed row +Returns a reference to the currently traversed row. diff --git a/contrib/docs/latex/fl/category.tex b/contrib/docs/latex/fl/category.tex index 55d1c86a97..9a0e8ae0a5 100644 --- a/contrib/docs/latex/fl/category.tex +++ b/contrib/docs/latex/fl/category.tex @@ -3,28 +3,89 @@ \setfooter{\thepage}{}{}{}{}{\thepage}% A classification of FL classes by category. -\twocolwidtha{5cm} -\begin{comment} -{\large {\bf Service classes}} +{\large {\bf Plugin classes}} -\overview{wxMPService class overview}{wxmpserviceoverview} +Plugins can be added to frame layouts to extend behaviour. -Service classes reduce the diversity of PMF classes, by making -them comply to a common interface. A service class serves as an interface (or -mix-in class in C++ terms), which cannot itself represent an -independent object. It should be inherited as a second (or -third) base class. +\twocolwidtha{6cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\helpref{cbAntiflickerPlugin}{cbantiflickerplugin}}{Double-buffering class} +\twocolitem{\helpref{cbBarDragPlugin}{cbbardragplugin}}{Implements drag behaviour.} +\twocolitem{\helpref{cbBarHintsPlugin}{cbbarhintsplugin}}{Implements bar decoration and sizing behaviour.} +\twocolitem{\helpref{cbHintAnimationPlugin}{cbhintanimationplugin}}{Draws animated hints when the user drags a pane.} +\twocolitem{\helpref{cbPaneDrawPlugin}{cbpanedrawplugin}}{Implements most of MFC-style control bar implementation.} +\twocolitem{\helpref{cbPluginBase}{cbpluginbase}}{Abstract base class for all control-bar related plugins.} +\twocolitem{\helpref{cbRowDragPlugin}{cbrowdragplugin}}{Implements row-dragging functionality.} +\twocolitem{\helpref{cbRowLayoutPlugin}{cbrowlayoutplugin}}{Implements row layout functionality.} +\twocolitem{\helpref{cbSimpleCustomizationPlugin}{cbsimplecustomizationplugin}}{Enables customization of a bar.} +\twocolitem{\helpref{cbBarSpy}{cbbarspy}}{Helper class used for spying for unhandled mouse events on control bars and forwarding them to the frame layout.} +\end{twocollist} + +{\large {\bf Window classes}} + +Windows classes (note that the mini-button implementations are not true windows +in that they do not derive from wxWindow). + +\twocolwidtha{6cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\helpref{wxToolWindow}{wxtoolwindow}}{A small frame that paints its own titlebar.} +\twocolitem{\helpref{cbFloatedBarWindow}{cbfloatedbarwindow}}{A kind of wxToolWindow implementing floating windows.} +\twocolitem{\helpref{cbMiniButton}{cbminibutton}}{Base class for wxToolWindow titlebar buttons.} +\twocolitem{\helpref{cbCloseBox}{cbclosebox}}{Close button for wxToolWindow titlebar.} +\twocolitem{\helpref{cbCollapseBox}{cbcollapsebox}}{Collapse button for wxToolWindow titlebar.} +\twocolitem{\helpref{cbDockBox}{cbdockbox}}{Dock button for wxToolWindow titlebar.} +\twocolitem{\helpref{cbCloseBox}{cbclosebox}}{Close button for wxToolWindow titlebar.} +\twocolitem{\helpref{wxNewBitmapButton}{wxnewbitmapbutton}}{Alternative bitmap button class.} +\end{twocollist} + +{\large {\bf Layout management classes}} + +These classes relate to the layout management framework. + +\twocolwidtha{6cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\helpref{cbDockPane}{cbdockpane}}{Manages containment and control of bars in a prent frame.} +\twocolitem{\helpref{BagLayout}{baglayout}}{BagLayout lays out items in left-to-right order from top to bottom.} +\twocolitem{\helpref{cbUpdatesManagerBase}{cbupdatesmanagerbase}}{An abstract interface for display update optimization logic.} +\twocolitem{\helpref{cbSimpleUpdatesMgr}{cbsimpleupdatesmgr}}{Implements optimized logic for refreshing areas of frame layout that need to be updated.} +\twocolitem{\helpref{cbGCUpdatesMgr}{cbgcupdatesmgr}}{Implements optimized logic for refresh, based on a garbage collection algorithm.} +\twocolitem{\helpref{GarbageCollector}{garbagecollector}}{A garbage collection algorithm for use in display refresh optimization.} +\twocolitem{\helpref{wxFrameLayout}{wxframelayout}}{Manages containment and docking of control bars, which can be docked along the top, bottom, right, or left side of the parent frame.} +\end{twocollist} + +{\large {\bf Event classes}} -Derived services classes all derive from wxEvtHandler as well as -wxPMService. +Events are used to decouple parts of the layout framework. +\twocolwidtha{6cm} \begin{twocollist}\itemsep=0pt -\twocolitem{\helpref{wxPMService}{wxpmservice}}{Base class} -\twocolitem{\helpref{wxPMBootstrapService}{wxpmbootstrapservice}}{Boot strap service} -\twocolitem{\helpref{wxPMLAlgorithm}{wxpmlalgorithm}}{Layout algorithm service} -\twocolitem{\helpref{wxPMSashLayoutAlgorithm}{wxpmsashlayoutalgorithm}}{Sash layout algorithm service} -\twocolitem{\helpref{wxPMPane}{wxpmpane}}{Base class for panes lying outside the MDI client area} +\twocolitem{\helpref{cbCustomizeBarEvent}{cbcustomizebarevent}}{Class for bar customization events.} +\twocolitem{\helpref{cbCustomizeLayoutEvent}{cbcustomizelayoutevent}}{Class for layout customization events.} +\twocolitem{\helpref{cbDrawBarDecorEvent}{cbdrawbardecorevent}}{Class for bar decoration drawing events.} +\twocolitem{\helpref{cbDrawBarHandlesEvent}{cbdrawbarhandlesevent}}{Class for bar handles drawing events.} +\twocolitem{\helpref{cbDrawHintRectEvent}{cbdrawhintrectevent}}{Class for hint-rectangle drawing events.} +\twocolitem{\helpref{cbDrawPaneBkGroundEvent}{cbdrawpanebkgroundevent}}{Class for pane background drawing events.} +\twocolitem{\helpref{cbDrawPaneDecorEvent}{cbdrawpanedecorevent}}{Class for pane decoration drawing events.} +\twocolitem{\helpref{cbDrawRowBkGroundEvent}{cbdrawrowbkgroundevent}}{Class for row background drawing events.} +\twocolitem{\helpref{cbDrawRowDecorEvent}{cbdrawrowdecorevent}}{Class for row decoration drawing events.} +\twocolitem{\helpref{cbDrawRowHandlesEvent}{cbdrawrowhandlesevent}}{Class for row handles drawing events.} +\twocolitem{\helpref{cbFinishDrawInAreaEvent}{cbfinishdrawinareaevent}}{Class for finish drawing in area events.} +\twocolitem{\helpref{cbInsertBarEvent}{cbinsertbarevent}}{Class for bar insertion events.} +\twocolitem{\helpref{cbLayoutRowEvent}{cblayoutrowevent}}{Class for single row layout events.} +\twocolitem{\helpref{cbLayoutRowsEvent}{cblayoutrowsevent}}{Class for multiple rows layout events.} +\twocolitem{\helpref{cbLeftDClickEvent}{cbleftdclickevent}}{Class for mouse left double click events.} +\twocolitem{\helpref{cbLeftDownEvent}{cbleftdownevent}}{Class for mouse left down events.} +\twocolitem{\helpref{cbLeftUpEvent}{cbleftupevent}}{Class for mouse left up events.} +\twocolitem{\helpref{cbMotionEvent}{cbmotionevent}}{Class for mouse motion events.} +\twocolitem{\helpref{cbPluginEvent}{cbpluginevent}}{Base class for all control-bar plugin events.} +\twocolitem{\helpref{cbRemoveBarEvent}{cbremovebarevent}}{Class for bar removal events.} +\twocolitem{\helpref{cbResizeBarEvent}{cbresizebarevent}}{Class for bar resize events.} +\twocolitem{\helpref{cbResizeRowEvent}{cbresizerowevent}}{Class for row resize events.} +\twocolitem{\helpref{cbRightDownEvent}{cbrightdownevent}}{Class for mouse right down events.} +\twocolitem{\helpref{cbRightUpEvent}{cbrightupevent}}{Class for mouse right up events.} +\twocolitem{\helpref{cbSizeBarWndEvent}{cbsizebarwndevent}}{Class for bar window resize events.} +\twocolitem{\helpref{cbStartBarDraggingEvent}{cbstartbardraggingevent}}{Class for start-bar-dragging events.} +\twocolitem{\helpref{cbStartDrawInAreaEvent}{cbstartdrawinareaevent}}{Class for start drawing in area events.} \end{twocollist} -\end{comment} diff --git a/contrib/docs/latex/fl/cbantiflickerplugin.tex b/contrib/docs/latex/fl/cbantiflickerplugin.tex index 95cf62629f..01217e839e 100644 --- a/contrib/docs/latex/fl/cbantiflickerplugin.tex +++ b/contrib/docs/latex/fl/cbantiflickerplugin.tex @@ -1,15 +1,26 @@ % % automatically generated by HelpGen $Revision$ from -% antiflickpl.h at 05/Jan/02 22:50:56 +% antiflickpl.h at 21/Jan/02 21:14:17 % \section{\class{cbAntiflickerPlugin}}\label{cbantiflickerplugin} + +Implements double-buffering to reduce flicker. +Bitmap and memory DC buffers are shared 'resources' among all instances of +antiflicker plugins within the application. + +Locking for multithreaded applications is not yet implemented. + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,45 +30,59 @@ \func{}{cbAntiflickerPlugin}{\void} +Default constructor. + \func{}{cbAntiflickerPlugin}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor taking frame layout panel, and pane mask. + \membersection{cbAntiflickerPlugin::\destruct{cbAntiflickerPlugin}}\label{cbantiflickerplugindtor} \func{}{\destruct{cbAntiflickerPlugin}}{\void} +Destructor. + \membersection{cbAntiflickerPlugin::AllocNewBuffer}\label{cbantiflickerpluginallocnewbuffer} \func{wxDC*}{AllocNewBuffer}{\param{const wxRect\& }{forArea}} +Allocates a suitable buffer. + \membersection{cbAntiflickerPlugin::FindSuitableBuffer}\label{cbantiflickerpluginfindsuitablebuffer} \func{wxDC*}{FindSuitableBuffer}{\param{const wxRect\& }{forArea}} -returns NULL, if sutable buffer is not present +Finds a suitable buffer. Returns NULL if a suitable buffer is not present. \membersection{cbAntiflickerPlugin::GetClientDC}\label{cbantiflickerplugingetclientdc} \func{wxDC\&}{GetClientDC}{\void} +Gets the client device context. + \membersection{cbAntiflickerPlugin::GetWindowDC}\label{cbantiflickerplugingetwindowdc} \func{wxDC\&}{GetWindowDC}{\void} +Gets the window device context. + \membersection{cbAntiflickerPlugin::OnFinishDrawInArea}\label{cbantiflickerpluginonfinishdrawinarea} \func{void}{OnFinishDrawInArea}{\param{cbFinishDrawInAreaEvent\& }{event}} +Handler for plugin event. + \membersection{cbAntiflickerPlugin::OnStartDrawInArea}\label{cbantiflickerpluginonstartdrawinarea} \func{void}{OnStartDrawInArea}{\param{cbStartDrawInAreaEvent\& }{event}} -handlers for plugin events +Handler for plugin event. diff --git a/contrib/docs/latex/fl/cbbardimhandlerbase.tex b/contrib/docs/latex/fl/cbbardimhandlerbase.tex index 7b8522a498..b66e9d154b 100644 --- a/contrib/docs/latex/fl/cbbardimhandlerbase.tex +++ b/contrib/docs/latex/fl/cbbardimhandlerbase.tex @@ -1,6 +1,6 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:58 +% controlbar.h at 21/Jan/02 21:14:13 % @@ -8,15 +8,19 @@ Abstract interface for bar-size handler classes. - These objects receive notifications, whenever the docking - state of the bar is changed, thus they have a possibility - to adjust the values in cbDimInfo::mSizes accordingly. - Specific handlers can be hooked to specific types of bars. - +These objects receive notifications whenever the docking +state of the bar is changed, thus they provide the possibility +to adjust the values in cbDimInfo::mSizes accordingly. +Specific handlers can be hooked up to specific types of bar. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -28,28 +32,35 @@ Abstract interface for bar-size handler classes. to multiple bars, it's instance is reference-counted -initial reference count is 0, since handler is not used, until the -first invocation of AddRef() +Default constructor. The initial reference count is 0, since +the handler is not used until the first invocation of AddRef(). \membersection{cbBarDimHandlerBase::AddRef}\label{cbbardimhandlerbaseaddref} \func{void}{AddRef}{\void} +Increments the reference count. + \membersection{cbBarDimHandlerBase::OnChangeBarState}\label{cbbardimhandlerbaseonchangebarstate} \func{void}{OnChangeBarState}{\param{cbBarInfo* }{pBar}, \param{int }{newState}} -"bar-state-changes" notification +Responds to "bar-state-changes" notifications. \membersection{cbBarDimHandlerBase::OnResizeBar}\label{cbbardimhandlerbaseonresizebar} \func{void}{OnResizeBar}{\param{cbBarInfo* }{pBar}, \param{const wxSize\& }{given}, \param{wxSize\& }{preferred}} +Responds to bar resize notifications. + \membersection{cbBarDimHandlerBase::RemoveRef}\label{cbbardimhandlerbaseremoveref} \func{void}{RemoveRef}{\void} +Decrements the reference count, and if the count is at zero, +delete 'this'. + diff --git a/contrib/docs/latex/fl/cbbardragplugin.tex b/contrib/docs/latex/fl/cbbardragplugin.tex index 946769121e..46863514f0 100644 --- a/contrib/docs/latex/fl/cbbardragplugin.tex +++ b/contrib/docs/latex/fl/cbbardragplugin.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% bardragpl.h at 05/Jan/02 22:50:56 +% bardragpl.h at 21/Jan/02 21:14:17 % \section{\class{cbBarDragPlugin}}\label{cbbardragplugin} + +Plugin class implementing bar dragging. + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,14 +26,20 @@ \func{}{cbBarDragPlugin}{\void} +Default constructor. + \func{}{cbBarDragPlugin}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor taking a parent frame, and flag. See cbPluginBase. + \membersection{cbBarDragPlugin::\destruct{cbBarDragPlugin}}\label{cbbardragplugindtor} \func{}{\destruct{cbBarDragPlugin}}{\void} +Destructor. + \membersection{cbBarDragPlugin::AdjustHintRect}\label{cbbardragpluginadjusthintrect} @@ -34,141 +47,200 @@ the thicker rectangle is drawn using hatched brush, the default border width for this rectangle is 8 pix. +Internal implementation function. \membersection{cbBarDragPlugin::CalcOnScreenDims}\label{cbbardragplugincalconscreendims} \func{void}{CalcOnScreenDims}{\param{wxRect\& }{rect}} +Internal implementation function. + \membersection{cbBarDragPlugin::ClipPosInFrame}\label{cbbardragpluginclipposinframe} \func{void}{ClipPosInFrame}{\param{wxPoint\& }{pos}} +Internal implementation function. + \membersection{cbBarDragPlugin::ClipRectInFrame}\label{cbbardragplugincliprectinframe} \func{void}{ClipRectInFrame}{\param{wxRect\& }{rect}} +Internal implementation function. + \membersection{cbBarDragPlugin::DoDrawHintRect}\label{cbbardragplugindodrawhintrect} \func{void}{DoDrawHintRect}{\param{wxRect\& }{rect}, \param{bool }{isInClientRect}} +Internal implementation function. +Draw the hint rectangle. + \membersection{cbBarDragPlugin::DrawHintRect}\label{cbbardragplugindrawhintrect} \func{void}{DrawHintRect}{\param{wxRect\& }{rect}, \param{bool }{isInClientRect}} +Internal implementation function. +Draw the visual hint while dragging. + \membersection{cbBarDragPlugin::EraseHintRect}\label{cbbardragpluginerasehintrect} \func{void}{EraseHintRect}{\param{wxRect\& }{rect}, \param{bool }{isInClientRect}} +Internal implementation function. +Erase the visual hint while dragging. + \membersection{cbBarDragPlugin::FinishTracking}\label{cbbardragpluginfinishtracking} \func{void}{FinishTracking}{\void} +Internal implementation function. +Stop showing the visual hint while dragging. + \membersection{cbBarDragPlugin::GetBarHeightInPane}\label{cbbardragplugingetbarheightinpane} \func{int}{GetBarHeightInPane}{\param{cbDockPane* }{pPane}} +Internal implementation function. + \membersection{cbBarDragPlugin::GetBarWidthInPane}\label{cbbardragplugingetbarwidthinpane} \func{int}{GetBarWidthInPane}{\param{cbDockPane* }{pPane}} +Internal implementation function. + \membersection{cbBarDragPlugin::GetDistanceToPane}\label{cbbardragplugingetdistancetopane} \func{int}{GetDistanceToPane}{\param{cbDockPane* }{pPane}, \param{wxPoint\& }{mousePos}} +Internal implementation function. + \membersection{cbBarDragPlugin::HitTestPanes}\label{cbbardragpluginhittestpanes} \func{cbDockPane*}{HitTestPanes}{\param{wxRect\& }{rect}} +Internal implementation function. Finds the pane +under the specified rectangle. + \func{cbDockPane*}{HitTestPanes}{\param{wxPoint\& }{pos}} +Internal implementation function. Finds the pane +under the specified point. + \membersection{cbBarDragPlugin::HitsPane}\label{cbbardragpluginhitspane} \func{bool}{HitsPane}{\param{cbDockPane* }{pPane}, \param{wxRect\& }{rect}} +Internal implementation function. + \membersection{cbBarDragPlugin::IsInClientArea}\label{cbbardragpluginisinclientarea} \func{bool}{IsInClientArea}{\param{wxPoint\& }{mousePos}} +Internal implementation function. + \func{bool}{IsInClientArea}{\param{wxRect\& }{rect}} +Internal implementation function. + \membersection{cbBarDragPlugin::IsInOtherPane}\label{cbbardragpluginisinotherpane} \func{bool}{IsInOtherPane}{\param{wxPoint\& }{mousePos}} +Internal implementation function. + \membersection{cbBarDragPlugin::OnDrawHintRect}\label{cbbardragpluginondrawhintrect} \func{void}{OnDrawHintRect}{\param{cbDrawHintRectEvent\& }{event}} -handles event, which oriniates from itself +Handles event, which originates from itself. \membersection{cbBarDragPlugin::OnLButtonDown}\label{cbbardragpluginonlbuttondown} \func{void}{OnLButtonDown}{\param{cbLeftDownEvent\& }{event}} +Handler for plugin event. + \membersection{cbBarDragPlugin::OnLButtonUp}\label{cbbardragpluginonlbuttonup} \func{void}{OnLButtonUp}{\param{cbLeftUpEvent\& }{event}} +Handler for plugin event. + \membersection{cbBarDragPlugin::OnLDblClick}\label{cbbardragpluginonldblclick} \func{void}{OnLDblClick}{\param{cbLeftDClickEvent\& }{event}} +Handler for plugin event. + \membersection{cbBarDragPlugin::OnMouseMove}\label{cbbardragpluginonmousemove} \func{void}{OnMouseMove}{\param{cbMotionEvent\& }{event}} -handlers for plugin events +Handler for plugin event. \membersection{cbBarDragPlugin::OnStartBarDragging}\label{cbbardragpluginonstartbardragging} \func{void}{OnStartBarDragging}{\param{cbStartBarDraggingEvent\& }{event}} +Handler for plugin event. + \membersection{cbBarDragPlugin::RectToScr}\label{cbbardragpluginrecttoscr} \func{void}{RectToScr}{\param{wxRect\& }{frameRect}, \param{wxRect\& }{scrRect}} +Internal implementation function. +Converts the given rectangle from window to screen coordinates. + \membersection{cbBarDragPlugin::ShowHint}\label{cbbardragpluginshowhint} \func{void}{ShowHint}{\param{bool }{prevWasInClient}} +Internal implementation function. +Show the hint; called within OnMouseMove. + \membersection{cbBarDragPlugin::StartTracking}\label{cbbardragpluginstarttracking} \func{void}{StartTracking}{\void} on-screen hint-tracking related methods +Internal implementation function. +Start showing a visual hint while dragging. \membersection{cbBarDragPlugin::StickToPane}\label{cbbardragpluginsticktopane} \func{void}{StickToPane}{\param{cbDockPane* }{pPane}, \param{wxPoint\& }{mousePos}} +Internal implementation function. + \membersection{cbBarDragPlugin::UnstickFromPane}\label{cbbardragpluginunstickfrompane} \func{void}{UnstickFromPane}{\param{cbDockPane* }{pPane}, \param{wxPoint\& }{mousePos}} +Internal implementation function. + diff --git a/contrib/docs/latex/fl/cbbarhintsplugin.tex b/contrib/docs/latex/fl/cbbarhintsplugin.tex index 40177916c6..ab34fa295b 100644 --- a/contrib/docs/latex/fl/cbbarhintsplugin.tex +++ b/contrib/docs/latex/fl/cbbarhintsplugin.tex @@ -1,19 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% barhintspl.h at 05/Jan/02 22:50:56 +% barhintspl.h at 21/Jan/02 21:14:18 % \section{\class{cbBarHintsPlugin}}\label{cbbarhintsplugin} -Intercepts bar-decoration and sizing events, draws 3d-hints - around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x - +This class intercepts bar-decoration and sizing events, and draws 3D hints +around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -23,95 +27,129 @@ Intercepts bar-decoration and sizing events, draws 3d-hints \func{}{cbBarHintsPlugin}{\void} +Default constructor. + \func{}{cbBarHintsPlugin}{\param{wxFrameLayout* }{pLayout}, \param{int }{paneMask = wxALL\_PANES}} +Constructor, taking parent frame and pane mask flag. + \membersection{cbBarHintsPlugin::\destruct{cbBarHintsPlugin}}\label{cbbarhintsplugindtor} \func{}{\destruct{cbBarHintsPlugin}}{\void} +Destructor. + \membersection{cbBarHintsPlugin::CreateBoxes}\label{cbbarhintsplugincreateboxes} \func{void}{CreateBoxes}{\void} +Helper function: creates close and collapse boxes. + \membersection{cbBarHintsPlugin::DoDrawHint}\label{cbbarhintsplugindodrawhint} \func{void}{DoDrawHint}{\param{wxDC\& }{dc}, \param{wxRect\& }{rect}, \param{int }{pos}, \param{int }{boxOfs}, \param{int }{grooveOfs}, \param{bool }{isFixed}} +Helper function: draws a hint. + \membersection{cbBarHintsPlugin::Draw3DBox}\label{cbbarhintsplugindraw3dbox} \func{void}{Draw3DBox}{\param{wxDC\& }{dc}, \param{const wxPoint\& }{pos}, \param{bool }{pressed}} -drawing helpers +Helper function: draws a 3D box. \membersection{cbBarHintsPlugin::DrawCloseBox}\label{cbbarhintsplugindrawclosebox} \func{void}{DrawCloseBox}{\param{wxDC\& }{dc}, \param{const wxPoint\& }{pos}, \param{bool }{pressed}} +Helper function: draws a close box. + \membersection{cbBarHintsPlugin::DrawCollapseBox}\label{cbbarhintsplugindrawcollapsebox} \func{void}{DrawCollapseBox}{\param{wxDC\& }{dc}, \param{const wxPoint\& }{pos}, \param{bool }{atLeft}, \param{bool }{disabled}, \param{bool }{pressed}} +Helper function: draws a collapse box. + \membersection{cbBarHintsPlugin::DrawGrooves}\label{cbbarhintsplugindrawgrooves} \func{void}{DrawGrooves}{\param{wxDC\& }{dc}, \param{const wxPoint\& }{pos}, \param{int }{length}} +Helper function: draws grooves. + \membersection{cbBarHintsPlugin::ExcludeHints}\label{cbbarhintspluginexcludehints} \func{void}{ExcludeHints}{\param{wxRect\& }{rect}, \param{cbBarInfo\& }{info}} +Helper function. + \membersection{cbBarHintsPlugin::GetHintsLayout}\label{cbbarhintsplugingethintslayout} \func{void}{GetHintsLayout}{\param{wxRect\& }{rect}, \param{cbBarInfo\& }{info}, \param{int\& }{boxOfs}, \param{int\& }{grooveOfs}, \param{int\& }{pos}} +Helper function: gets the layout of a hint. + \membersection{cbBarHintsPlugin::HitTestHints}\label{cbbarhintspluginhittesthints} \func{int}{HitTestHints}{\param{cbBarInfo\& }{info}, \param{const wxPoint\& }{pos}} +Helper function: returns information about the hint under the given position. + \membersection{cbBarHintsPlugin::OnDrawBarDecorations}\label{cbbarhintspluginondrawbardecorations} \func{void}{OnDrawBarDecorations}{\param{cbDrawBarDecorEvent\& }{event}} +Handles a plugin event. + \membersection{cbBarHintsPlugin::OnInitPlugin}\label{cbbarhintspluginoninitplugin} \func{void}{OnInitPlugin}{\void} +Called to initialize this plugin. + \membersection{cbBarHintsPlugin::OnLeftDown}\label{cbbarhintspluginonleftdown} \func{void}{OnLeftDown}{\param{cbLeftDownEvent\& }{event}} +Handles a plugin event. + \membersection{cbBarHintsPlugin::OnLeftUp}\label{cbbarhintspluginonleftup} \func{void}{OnLeftUp}{\param{cbLeftUpEvent\& }{event}} +Handles a plugin event. + \membersection{cbBarHintsPlugin::OnMotion}\label{cbbarhintspluginonmotion} \func{void}{OnMotion}{\param{cbMotionEvent\& }{event}} +Handles a plugin event. + \membersection{cbBarHintsPlugin::OnSizeBarWindow}\label{cbbarhintspluginonsizebarwindow} \func{void}{OnSizeBarWindow}{\param{cbSizeBarWndEvent\& }{event}} -handlers of plugin-events +Handles a plugin event. \membersection{cbBarHintsPlugin::SetGrooveCount}\label{cbbarhintspluginsetgroovecount} \func{void}{SetGrooveCount}{\param{int }{nGrooves}} +Set the number of grooves to be shown in the pane. + diff --git a/contrib/docs/latex/fl/cbbarinfo.tex b/contrib/docs/latex/fl/cbbarinfo.tex index a5e548a1fe..6632630b8c 100644 --- a/contrib/docs/latex/fl/cbbarinfo.tex +++ b/contrib/docs/latex/fl/cbbarinfo.tex @@ -1,15 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbBarInfo}}\label{cbbarinfo} + +Helper class used internally by the wxFrameLayout class. +Holds and manages bar information. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,18 +27,26 @@ \func{}{cbBarInfo}{\void} +Constructor. + \membersection{cbBarInfo::\destruct{cbBarInfo}}\label{cbbarinfodtor} \func{}{\destruct{cbBarInfo}}{\void} +Destructor. + \membersection{cbBarInfo::IsExpanded}\label{cbbarinfoisexpanded} \constfunc{bool}{IsExpanded}{\void} +Returns TRUE if this bar is expanded. + \membersection{cbBarInfo::IsFixed}\label{cbbarinfoisfixed} \constfunc{bool}{IsFixed}{\void} +Returns TRUE if this bar is fixed. + diff --git a/contrib/docs/latex/fl/cbbarshapedata.tex b/contrib/docs/latex/fl/cbbarshapedata.tex index fdf521eca5..c498aadb9a 100644 --- a/contrib/docs/latex/fl/cbbarshapedata.tex +++ b/contrib/docs/latex/fl/cbbarshapedata.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbBarShapeData}}\label{cbbarshapedata} -used for storing original bar's postions in the row, when the "non-destructive-friction" -option is turned ON +Used for storing the original bar's positions in the row, when the 'non-destructive-friction' +option is turned on. \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} diff --git a/contrib/docs/latex/fl/cbbarspy.tex b/contrib/docs/latex/fl/cbbarspy.tex index ed132715ca..03ad032dcd 100644 --- a/contrib/docs/latex/fl/cbbarspy.tex +++ b/contrib/docs/latex/fl/cbbarspy.tex @@ -1,24 +1,47 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:58 +% controlbar.h at 21/Jan/02 21:14:13 % \section{\class{cbBarSpy}}\label{cbbarspy} -FIXME:: somehow in debug v. originall wxASSERT's are not compiled in... -\#undef wxASSERT -\#define wxASSERT(x) if ( !(x) ) throw; -helper class, used for spying for not-handled mouse events on control-bars -and forwarding them to the frame layout +Helper class, used for spying for unhandled mouse events on control bars +and forwarding them to the frame layout. \wxheading{Derived from} \helpref{wxEvtHandler}{wxevthandler} +\wxheading{Include files} + + + \wxheading{Data structures} +{\small \begin{verbatim} +typedef cbBarInfo* BarInfoPtrT +\end{verbatim}} +forward declarations + +{\small \begin{verbatim} +typedef cbRowInfo* RowInfoPtrT +\end{verbatim}} +enumeration of hittest results, see cbDockPane::HitTestPaneItems(..) +\begin{verbatim} +enum CB_HITTEST_RESULT +{ + CB_NO_ITEMS_HITTED, + + CB_UPPER_ROW_HANDLE_HITTED, + CB_LOWER_ROW_HANDLE_HITTED, + CB_LEFT_BAR_HANDLE_HITTED, + CB_RIGHT_BAR_HANDLE_HITTED, + CB_BAR_CONTENT_HITTED +} +\end{verbatim} + \latexignore{\rtfignore{\wxheading{Members}}} @@ -26,18 +49,24 @@ and forwarding them to the frame layout \func{}{cbBarSpy}{\param{wxFrameLayout* }{pPanel}} +Constructor, taking a parent pane. + \func{}{cbBarSpy}{\void} +Default constructor. + \membersection{cbBarSpy::ProcessEvent}\label{cbbarspyprocessevent} \func{bool}{ProcessEvent}{\param{wxEvent\& }{event}} -overriden +Performs special event processing. \membersection{cbBarSpy::SetBarWindow}\label{cbbarspysetbarwindow} \func{void}{SetBarWindow}{\param{wxWindow* }{pWnd}} +Sets the bar window. + diff --git a/contrib/docs/latex/fl/cbclosebox.tex b/contrib/docs/latex/fl/cbclosebox.tex index bc36103aa0..d0fdef5775 100644 --- a/contrib/docs/latex/fl/cbclosebox.tex +++ b/contrib/docs/latex/fl/cbclosebox.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% toolwnd.h at 05/Jan/02 22:50:58 +% toolwnd.h at 21/Jan/02 21:14:17 % \section{\class{cbCloseBox}}\label{cbclosebox} -classes specific to wxFrameLayout engine (FOR NOW in here...) +cbCloseBox is a window close button, used in a wxToolWindow titlebar. \wxheading{Derived from} \helpref{cbMiniButton}{cbminibutton} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,3 +26,5 @@ classes specific to wxFrameLayout engine (FOR NOW in here...) \func{void}{Draw}{\param{wxDC\& }{dc}} +Draws the close button appearance. + diff --git a/contrib/docs/latex/fl/cbcollapsebox.tex b/contrib/docs/latex/fl/cbcollapsebox.tex index 0399514724..99b9e98ed9 100644 --- a/contrib/docs/latex/fl/cbcollapsebox.tex +++ b/contrib/docs/latex/fl/cbcollapsebox.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% toolwnd.h at 05/Jan/02 22:50:58 +% toolwnd.h at 21/Jan/02 21:14:17 % \section{\class{cbCollapseBox}}\label{cbcollapsebox} + +cbCollapseBox is a window collapse button, used in a wxToolWindow titlebar. + \wxheading{Derived from} \helpref{cbMiniButton}{cbminibutton} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{void}{Draw}{\param{wxDC\& }{dc}} +Draws the collapse button appearance. + diff --git a/contrib/docs/latex/fl/cbcommonpaneproperties.tex b/contrib/docs/latex/fl/cbcommonpaneproperties.tex index 24e2147317..3a895bc4da 100644 --- a/contrib/docs/latex/fl/cbcommonpaneproperties.tex +++ b/contrib/docs/latex/fl/cbcommonpaneproperties.tex @@ -1,19 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbCommonPaneProperties}}\label{cbcommonpaneproperties} -structure holds configuration options, - which are usually the same for all panes in - frame layout - +A structure holding configuration options, +which are usually the same for all panes in +a frame layout. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} diff --git a/contrib/docs/latex/fl/cbcustomizebarevent.tex b/contrib/docs/latex/fl/cbcustomizebarevent.tex index fd1dbea1b3..3020c231f1 100644 --- a/contrib/docs/latex/fl/cbcustomizebarevent.tex +++ b/contrib/docs/latex/fl/cbcustomizebarevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:17 % \section{\class{cbCustomizeBarEvent}}\label{cbcustomizebarevent} + +Class for bar customization events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbCustomizeBarEvent}{\param{cbBarInfo* }{pBar}, \param{const wxPoint\& }{clickPos}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information, mouse position, and pane. + diff --git a/contrib/docs/latex/fl/cbcustomizelayoutevent.tex b/contrib/docs/latex/fl/cbcustomizelayoutevent.tex index 1c13e53e64..33f717e174 100644 --- a/contrib/docs/latex/fl/cbcustomizelayoutevent.tex +++ b/contrib/docs/latex/fl/cbcustomizelayoutevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:17 % \section{\class{cbCustomizeLayoutEvent}}\label{cbcustomizelayoutevent} + +Class for layout customization events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbCustomizeLayoutEvent}{\param{const wxPoint\& }{clickPos}} +Constructor, taking mouse position. + diff --git a/contrib/docs/latex/fl/cbdiminfo.tex b/contrib/docs/latex/fl/cbdiminfo.tex index 9cf4bb5c86..4a7121499c 100644 --- a/contrib/docs/latex/fl/cbdiminfo.tex +++ b/contrib/docs/latex/fl/cbdiminfo.tex @@ -1,18 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:13 % \section{\class{cbDimInfo}}\label{cbdiminfo} -helper classes (used internally by wxFrameLayout class) holds and manages information about bar dimensions +Helper class used internally by the wxFrameLayout class. +Holds and manages information about bar dimensions. \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,31 +27,54 @@ helper classes (used internally by wxFrameLayout class) holds and manages inform \func{}{cbDimInfo}{\param{cbBarDimHandlerBase* }{pDimHandler}, \param{bool }{isFixed}} +Constructor. +isFixed is TRUE if vertical/horizontal dimensions cannot be manually adjusted +by the user using resizing handles. If FALSE, the frame-layout +automatically places resizing handles among bars that do are not fixed. + \func{}{cbDimInfo}{\param{int }{dh\_x}, \param{int }{dh\_y}, \param{int }{dv\_x}, \param{int }{dv\_y}, \param{int }{f\_x}, \param{int }{f\_y}, \param{bool }{isFixed = TRUE}, \param{int }{horizGap = 6}, \param{int }{vertGap = 6}, \param{cbBarDimHandlerBase* }{pDimHandler = NULL}} -dims when docked horizontally +Constructor taking dimenstion information. +dh\_x, dh\_y are the dimensions when docked horizontally. +dv\_x, dv\_y are the dimensions when docked vertically. +f\_x, f\_y are the dimensions when floating. +For information on isFixed, see comments above. +horizGap is the left/right gap, separating decorations +from the bar's actual wndow, filled with the frame's background colour. +The dimension is given in the frame's coordinates. +vertGap is the top/bottom gap, separating decorations +from the bar's actual wndow, filled with the frame's background colour. +The dimension is given in the frame's coordinates. \func{}{cbDimInfo}{\param{int }{x}, \param{int }{y}, \param{bool }{isFixed = TRUE}, \param{int }{gap = 6}, \param{cbBarDimHandlerBase* }{pDimHandler = NULL}} +Constructor. + \func{}{cbDimInfo}{\void} +Default constructor. + \membersection{cbDimInfo::\destruct{cbDimInfo}}\label{cbdiminfodtor} \func{}{\destruct{cbDimInfo}}{\void} -destroys handler automatically, if present +Destructor. Destroys handler automatically, if present. \membersection{cbDimInfo::GetDimHandler}\label{cbdiminfogetdimhandler} \func{cbBarDimHandlerBase*}{GetDimHandler}{\void} +Returns the handler, if any. + \membersection{cbDimInfo::operator=}\label{cbdiminfooperatorassign} \func{const cbDimInfo\& operator}{operator=}{\param{const cbDimInfo\& }{other}} +Assignment operator. + diff --git a/contrib/docs/latex/fl/cbdockbox.tex b/contrib/docs/latex/fl/cbdockbox.tex index 1d38535a74..35d214b988 100644 --- a/contrib/docs/latex/fl/cbdockbox.tex +++ b/contrib/docs/latex/fl/cbdockbox.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% toolwnd.h at 05/Jan/02 22:50:58 +% toolwnd.h at 21/Jan/02 21:14:17 % \section{\class{cbDockBox}}\label{cbdockbox} + +cbDockBox is a window dock button, used in a wxToolWindow titlebar. + \wxheading{Derived from} \helpref{cbMiniButton}{cbminibutton} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{void}{Draw}{\param{wxDC\& }{dc}} +Draws the dock button appearance. + diff --git a/contrib/docs/latex/fl/cbdockpane.tex b/contrib/docs/latex/fl/cbdockpane.tex index e86f66bd84..ac63f65bb4 100644 --- a/contrib/docs/latex/fl/cbdockpane.tex +++ b/contrib/docs/latex/fl/cbdockpane.tex @@ -1,19 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbDockPane}}\label{cbdockpane} -class manages containment and control of control-bars - along one of the four edges of the parent frame - +This class manages containment and control of control bars +along one of the four edges of the parent frame. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -23,413 +27,552 @@ class manages containment and control of control-bars \func{}{cbDockPane}{\param{int }{alignment}, \param{wxFrameLayout* }{pPanel}} +Constructor, taking alignment and layout panel. + \func{}{cbDockPane}{\void} -public members +public members Default constructor. + \membersection{cbDockPane::\destruct{cbDockPane}}\label{cbdockpanedtor} \func{}{\destruct{cbDockPane}}{\void} +Destructor. + \membersection{cbDockPane::BarPresent}\label{cbdockpanebarpresent} \func{bool}{BarPresent}{\param{cbBarInfo* }{pBar}} -TRUE, if the given bar node presents in this pane +Returns TRUE if the given bar is present in this pane. \membersection{cbDockPane::CalcLengthRatios}\label{cbdockpanecalclengthratios} \func{void}{CalcLengthRatios}{\param{cbRowInfo* }{pInRow}} +Calculate lengths. +Internal function called by plugins. + \membersection{cbDockPane::ContractBar}\label{cbdockpanecontractbar} \func{void}{ContractBar}{\param{cbBarInfo* }{pBar}} +Contracts the bar. +Internal function called by plugins. + \membersection{cbDockPane::DoInsertBar}\label{cbdockpanedoinsertbar} \func{void}{DoInsertBar}{\param{cbBarInfo* }{pBar}, \param{int }{rowNo}} +Inserts the bar at the given row number. +Internal function called by plugins. + \membersection{cbDockPane::DrawHorizHandle}\label{cbdockpanedrawhorizhandle} \func{void}{DrawHorizHandle}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{width}} +Row/bar resizing related helper-method. + \membersection{cbDockPane::DrawVertHandle}\label{cbdockpanedrawverthandle} \func{void}{DrawVertHandle}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{height}} -protected really (accessed only by plugins) row/bar resizing related helper-methods +protected really (accessed only by plugins) Row/bar resizing related helper-method. \membersection{cbDockPane::ExpandBar}\label{cbdockpaneexpandbar} \func{void}{ExpandBar}{\param{cbBarInfo* }{pBar}} +Expands the bar. +Internal function called by plugins. + \membersection{cbDockPane::FinishDrawInArea}\label{cbdockpanefinishdrawinarea} \func{void}{FinishDrawInArea}{\param{const wxRect\& }{area}} +Generates cbFinishDrawInAreaEvent and sends it to the layout. +Internal function called by plugins. + \membersection{cbDockPane::FrameToPane}\label{cbdockpaneframetopane} -\func{void}{FrameToPane}{\param{wxRect* }{pRect}} +\func{void}{FrameToPane}{\param{int* }{x}, \param{int* }{y}} +Coordinate translation between parent's frame and this pane. +Internal function called by plugins. -\func{void}{FrameToPane}{\param{int* }{x}, \param{int* }{y}} -coordinate translation between parent's frame and this pane +\func{void}{FrameToPane}{\param{wxRect* }{pRect}} + +Coordinate translation between parent's frame and this pane. +Internal function called by plugins. \membersection{cbDockPane::GetAlignment}\label{cbdockpanegetalignment} \func{int}{GetAlignment}{\void} +Returns the alignment for this pane. The value is one of +FL\_ALIGN\_TOP, FL\_ALIGN\_BOTTOM, FL\_ALIGN\_LEFT, FL\_ALIGN\_RIGHT. + \membersection{cbDockPane::GetBarInfoByWindow}\label{cbdockpanegetbarinfobywindow} \func{cbBarInfo*}{GetBarInfoByWindow}{\param{wxWindow* }{pBarWnd}} +Finds the bar information by corresponding window. + \membersection{cbDockPane::GetBarResizeRange}\label{cbdockpanegetbarresizerange} \func{void}{GetBarResizeRange}{\param{cbBarInfo* }{pBar}, \param{int* }{from}, \param{int* }{till}, \param{bool }{forLeftHandle}} +Returns the bar's resize range. + \membersection{cbDockPane::GetDockingState}\label{cbdockpanegetdockingstate} \func{int}{GetDockingState}{\void} +Returns wxCBAR\_DOCKED\_HORIZONTALLY if the alignment is top or bottom, +or wxCBAR\_DOCKED\_VERTICALLY otherwise. + \membersection{cbDockPane::GetFirstRow}\label{cbdockpanegetfirstrow} \func{cbRowInfo*}{GetFirstRow}{\void} -convenience method +Returns the first row. \membersection{cbDockPane::GetMinimalRowHeight}\label{cbdockpanegetminimalrowheight} \func{int}{GetMinimalRowHeight}{\param{cbRowInfo* }{pRow}} +Returns the minimal row height for the given row. +Internal function called by plugins. + \membersection{cbDockPane::GetNotFixedBarsCount}\label{cbdockpanegetnotfixedbarscount} \func{int}{GetNotFixedBarsCount}{\param{cbRowInfo* }{pRow}} +Returns the number of bars whose size is not fixed. +Internal function called by plugins. + \membersection{cbDockPane::GetPaneHeight}\label{cbdockpanegetpaneheight} \func{int}{GetPaneHeight}{\void} -retuns height, in pane's coordinates +Returns the height in the pane's coordinates. \membersection{cbDockPane::GetRealRect}\label{cbdockpanegetrealrect} \func{wxRect\&}{GetRealRect}{\void} +Returns the bounds of the pane, in parent coordinates. + \membersection{cbDockPane::GetRow}\label{cbdockpanegetrow} \func{cbRowInfo*}{GetRow}{\param{int }{row}} -protected really (accessed only by plugins) +protected really (accessed only by plugins) Returns the row info for a row index. Internal function called by plugins. + \membersection{cbDockPane::GetRowAt}\label{cbdockpanegetrowat} -\func{int}{GetRowAt}{\param{int }{upperY}, \param{int }{lowerY}} +\func{int}{GetRowAt}{\param{int }{paneY}} +Returns the row at the given vertical position. +Returns -1 if the row is not present at given vertical position. +Internal function called by plugins. -\func{int}{GetRowAt}{\param{int }{paneY}} -return -1, if row is not present at given vertical position +\func{int}{GetRowAt}{\param{int }{upperY}, \param{int }{lowerY}} + +Returns the row between the given vertical positions. +Returns -1 if the row is not present. +Internal function called by plugins. \membersection{cbDockPane::GetRowIndex}\label{cbdockpanegetrowindex} \func{int}{GetRowIndex}{\param{cbRowInfo* }{pRow}} +Returns the row index for the given row info. Internal function called by plugins. + \membersection{cbDockPane::GetRowList}\label{cbdockpanegetrowlist} \func{RowArrayT\&}{GetRowList}{\void} -used by updates-managers +Returns an array of rows. Used by updates-managers. \membersection{cbDockPane::GetRowResizeRange}\label{cbdockpanegetrowresizerange} \func{void}{GetRowResizeRange}{\param{cbRowInfo* }{pRow}, \param{int* }{from}, \param{int* }{till}, \param{bool }{forUpperHandle}} +Returns the row's resize range. + \membersection{cbDockPane::GetRowShapeData}\label{cbdockpanegetrowshapedata} \func{void}{GetRowShapeData}{\param{cbRowInfo* }{pRow}, \param{wxList* }{pLst}} -cbBarShapeData objects will be placed to given pLst (see comments on cbBarShapeData) - - -\membersection{cbDockPane::GetRowWidth}\label{cbdockpanegetrowwidth} - -\func{int}{GetRowWidth}{\param{wxList* }{pRow}} +Returns row shape data. +cbBarShapeData objects will be added to the given pLst. +cbBarShapeData is used for storing the original bar's positions in the row, +when the 'non-destructive-friction' option is turned on. \membersection{cbDockPane::GetRowY}\label{cbdockpanegetrowy} \func{int}{GetRowY}{\param{cbRowInfo* }{pRow}} +Gets the vertical position at the given row. +Internal function called by plugins. + \membersection{cbDockPane::HasNotFixedBarsLeft}\label{cbdockpanehasnotfixedbarsleft} \func{bool}{HasNotFixedBarsLeft}{\param{cbBarInfo* }{pBar}} +Returns TRUE if there are any variable-sized rows to the left of this one. +Internal function called by plugins. + \membersection{cbDockPane::HasNotFixedBarsRight}\label{cbdockpanehasnotfixedbarsright} \func{bool}{HasNotFixedBarsRight}{\param{cbBarInfo* }{pBar}} +Returns TRUE if there are any variable-sized rows to the right of this one. +Internal function called by plugins. + \membersection{cbDockPane::HasNotFixedRowsAbove}\label{cbdockpanehasnotfixedrowsabove} \func{bool}{HasNotFixedRowsAbove}{\param{cbRowInfo* }{pRow}} +Returns TRUE if there are any variable-sized rows above this one. +Internal function called by plugins. + \membersection{cbDockPane::HasNotFixedRowsBelow}\label{cbdockpanehasnotfixedrowsbelow} \func{bool}{HasNotFixedRowsBelow}{\param{cbRowInfo* }{pRow}} +Returns TRUE if there are any variable-sized rows below this one. +Internal function called by plugins. + \membersection{cbDockPane::HasPoint}\label{cbdockpanehaspoint} \func{bool}{HasPoint}{\param{const wxPoint\& }{pos}, \param{int }{x}, \param{int }{y}, \param{int }{width}, \param{int }{height}} +Returns TRUE if pos is within the given rectangle. +Internal function called by plugins. + \membersection{cbDockPane::HitTestPaneItems}\label{cbdockpanehittestpaneitems} \func{int}{HitTestPaneItems}{\param{const wxPoint\& }{pos}, \param{cbRowInfo** }{ppRow}, \param{cbBarInfo** }{ppBar}} -returns result of hit-testing items in the pane, -see CB\_HITTEST\_RESULTS enumeration -position in pane's coordinates +Returns the result of hit-testing items in the pane. +See CB\_HITTEST\_RESULT enumerated type. +pos is the position in this pane's coordinates. \membersection{cbDockPane::InitLinksForRow}\label{cbdockpaneinitlinksforrow} \func{void}{InitLinksForRow}{\param{cbRowInfo* }{pRow}} +Sets up links between bars. +Internal function called by plugins. + \membersection{cbDockPane::InitLinksForRows}\label{cbdockpaneinitlinksforrows} \func{void}{InitLinksForRows}{\void} +Sets up links between bars. +Internal function called by plugins. + \membersection{cbDockPane::InsertBar}\label{cbdockpaneinsertbar} -\func{void}{InsertBar}{\param{cbBarInfo* }{pBar}, \param{const wxRect\& }{atRect}} +\func{void}{InsertBar}{\param{cbBarInfo* }{pBarInfo}} -rect given in the parent frame's coordinates +Inserts bar and sets its position according to the preferred settings +given in pBarInfo. -\func{void}{InsertBar}{\param{cbBarInfo* }{pBar}, \param{cbRowInfo* }{pIntoRow}} +\func{void}{InsertBar}{\param{cbBarInfo* }{pBar}, \param{const wxRect\& }{rect}} -inserts bar into the given row, with dimensions and position -stored in pBarInfo->mBounds. Returns the node of inserted bar +Inserts the bar into this pane. rect is given in the parent frame's coordinates. -\func{void}{InsertBar}{\param{cbBarInfo* }{pBarInfo}} +\func{void}{InsertBar}{\param{cbBarInfo* }{pBar}, \param{cbRowInfo* }{pIntoRow}} -inserts bar, sets its position according to the preferred settings -given in (*pBarInfo) structure +Inserts the bar into the given row, with dimensions and position +stored in pBarInfo->mBounds. Returns the node of inserted bar. \membersection{cbDockPane::InsertRow}\label{cbdockpaneinsertrow} \func{void}{InsertRow}{\param{cbRowInfo* }{pRow}, \param{cbRowInfo* }{pBeforeRow}} -does not refresh the inserted row immediately, -if pBeforeRowNode arg. is NULL, row is appended to the end of pane's row list +Inserts a row. Does not refresh the inserted row immediately. +If pBeforeRowNode is NULL, the row is appended to the end of pane's row list. \membersection{cbDockPane::IsFixedSize}\label{cbdockpaneisfixedsize} \func{bool}{IsFixedSize}{\param{cbBarInfo* }{pInfo}} -layout "AI" helpers: +Returns TRUE if the bar's dimension information indicates a fixed size. +Internal function called by plugins. \membersection{cbDockPane::IsHorizontal}\label{cbdockpaneishorizontal} \func{bool}{IsHorizontal}{\void} +Returns TRUE if the pane is aligned to the top or bottom. + \membersection{cbDockPane::MatchesMask}\label{cbdockpanematchesmask} \func{bool}{MatchesMask}{\param{int }{paneMask}} +Returns TRUE if the given mask matches the pane's mask. + \membersection{cbDockPane::PaintBar}\label{cbdockpanepaintbar} \func{void}{PaintBar}{\param{cbBarInfo* }{pBar}, \param{wxDC\& }{dc}} +Calls PaintBarDecorations and PaintBarHandles. +Internal function called by plugins. + \membersection{cbDockPane::PaintBarDecorations}\label{cbdockpanepaintbardecorations} \func{void}{PaintBarDecorations}{\param{cbBarInfo* }{pBar}, \param{wxDC\& }{dc}} -protected really (accessed only by plugins) methods for incramental on-screen refreshing of the pane -(simply, they are wrappers around corresponding plugin-events) +protected really (accessed only by plugins) Generates a cbDrawBarDecorEvent and sends it to the layout to paint the bar decorations. +Internal function called by plugins. \membersection{cbDockPane::PaintBarHandles}\label{cbdockpanepaintbarhandles} \func{void}{PaintBarHandles}{\param{cbBarInfo* }{pBar}, \param{wxDC\& }{dc}} +Generates a cbDrawBarHandlesEvent and sends it to the layout to paint the bar handles. +Internal function called by plugins. + \membersection{cbDockPane::PaintPane}\label{cbdockpanepaintpane} \func{void}{PaintPane}{\param{wxDC\& }{dc}} +Paints the pane background, the row background and decorations, +and finally the pane decorations. +Internal function called by plugins. + \membersection{cbDockPane::PaintPaneBackground}\label{cbdockpanepaintpanebackground} \func{void}{PaintPaneBackground}{\param{wxDC\& }{dc}} +Generates cbDrawPaneBkGroundEvent and sends it to the layout. +Internal function called by plugins. + \membersection{cbDockPane::PaintPaneDecorations}\label{cbdockpanepaintpanedecorations} \func{void}{PaintPaneDecorations}{\param{wxDC\& }{dc}} +Generates cbDrawPaneDecorEvent and sends it to the layout. +Internal function called by plugins. + \membersection{cbDockPane::PaintRow}\label{cbdockpanepaintrow} \func{void}{PaintRow}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Calls PaintRowBackground, PaintRowDecorations, PaintRowHandles. +Internal function called by plugins. + \membersection{cbDockPane::PaintRowBackground}\label{cbdockpanepaintrowbackground} \func{void}{PaintRowBackground}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Generates cbDrawRowBkGroundEvent and sends it to the layout. +Internal function called by plugins. + \membersection{cbDockPane::PaintRowDecorations}\label{cbdockpanepaintrowdecorations} \func{void}{PaintRowDecorations}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Calls PaintBarDecorations for each row. +Internal function called by plugins. + \membersection{cbDockPane::PaintRowHandles}\label{cbdockpanepaintrowhandles} \func{void}{PaintRowHandles}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Generates cbDrawRowHandlesEvent and cbDrawRowDecorEvent and sends them to the layout. +Internal function called by plugins. + \membersection{cbDockPane::PaneToFrame}\label{cbdockpanepanetoframe} \func{void}{PaneToFrame}{\param{wxRect* }{pRect}} +Coordinate translation between parent's frame and this pane. +Internal function called by plugins. + \func{void}{PaneToFrame}{\param{int* }{x}, \param{int* }{y}} +Coordinate translation between parent's frame and this pane. +Internal function called by plugins. + \membersection{cbDockPane::RecalcLayout}\label{cbdockpanerecalclayout} \func{void}{RecalcLayout}{\void} +Generates events to perform layout calculations. + \membersection{cbDockPane::RecalcRowLayout}\label{cbdockpanerecalcrowlayout} \func{void}{RecalcRowLayout}{\param{cbRowInfo* }{pRow}} +Generates a cbLayoutRowEvent event to recalculate row layouts. +Internal function called by plugins. + \membersection{cbDockPane::RemoveBar}\label{cbdockpaneremovebar} \func{void}{RemoveBar}{\param{cbBarInfo* }{pBar}} -does not destroys the info bar , only removes it's reference -from this pane +Removes the bar from this pane. Does not destroy the bar. \membersection{cbDockPane::RemoveRow}\label{cbdockpaneremoverow} \func{void}{RemoveRow}{\param{cbRowInfo* }{pRow}} -does not destroy the row object, only removes the corresponding -node from this pane +Removes the row from this pane. Does not destroy the row object. \membersection{cbDockPane::ResizeBar}\label{cbdockpaneresizebar} \func{void}{ResizeBar}{\param{cbBarInfo* }{pBar}, \param{int }{ofs}, \param{bool }{forLeftHandle}} +Row/bar resizing related helper-method. + \membersection{cbDockPane::ResizeRow}\label{cbdockpaneresizerow} \func{void}{ResizeRow}{\param{cbRowInfo* }{pRow}, \param{int }{ofs}, \param{bool }{forUpperHandle}} +Row/bar resizing related helper-method. + \membersection{cbDockPane::SetBoundsInParent}\label{cbdockpanesetboundsinparent} \func{void}{SetBoundsInParent}{\param{const wxRect\& }{rect}} -set the position and dims. of the pane in parent frame's coordinates +Set the position and dimensions of the pane in the parent frame's coordinates. \membersection{cbDockPane::SetMargins}\label{cbdockpanesetmargins} \func{void}{SetMargins}{\param{int }{top}, \param{int }{bottom}, \param{int }{left}, \param{int }{right}} -sets pane's margins in frame's coordinate orientations +Sets pane's margins in frame's coordinate orientations. \membersection{cbDockPane::SetPaneWidth}\label{cbdockpanesetpanewidth} \func{void}{SetPaneWidth}{\param{int }{width}} -sets pane's width in pane's coordinates (including margins) +Sets pane's width in the pane's coordinates (including margins). \membersection{cbDockPane::SetRowHeight}\label{cbdockpanesetrowheight} \func{void}{SetRowHeight}{\param{cbRowInfo* }{pRow}, \param{int }{newHeight}} -given row height includes height of row handles, if present +Sets the row height for the given height. newHeight includes the height of row handles, if present. +Internal function called by plugins. \membersection{cbDockPane::SetRowShapeData}\label{cbdockpanesetrowshapedata} \func{void}{SetRowShapeData}{\param{cbRowInfo* }{pRowNode}, \param{wxList* }{pLst}} -sets the shape to the given row, using the data provided in pLst +Sets the shape data for the given row, using the data provided in pLst. +cbBarShapeData is used for storing the original bar's positions in the row, +when the 'non-destructive-friction' option is turned on. \membersection{cbDockPane::SizeBar}\label{cbdockpanesizebar} \func{void}{SizeBar}{\param{cbBarInfo* }{pBar}} +Generates a cbSizeBarWndEvent and sends it to the layout. +Internal function called by plugins. + \membersection{cbDockPane::SizePaneObjects}\label{cbdockpanesizepaneobjects} \func{void}{SizePaneObjects}{\void} +Calls SizeRowObjects for each row. +Internal function called by plugins. + \membersection{cbDockPane::SizeRowObjects}\label{cbdockpanesizerowobjects} \func{void}{SizeRowObjects}{\param{cbRowInfo* }{pRow}} +Calls SizeBar for each bar in the row. +Internal function called by plugins. + \membersection{cbDockPane::StartDrawInArea}\label{cbdockpanestartdrawinarea} \func{wxDC*}{StartDrawInArea}{\param{const wxRect\& }{area}} +Generates cbStartDrawInAreaEvent and sends it to the layout. +Internal function called by plugins. + \membersection{cbDockPane::SyncRowFlags}\label{cbdockpanesyncrowflags} \func{void}{SyncRowFlags}{\param{cbRowInfo* }{pRow}} -re-setups flags in the row-information structure, so that -the would match the changed state of row-items correctly +Sets up flags in the row information structure, so that +they match the changed state of row items correctly. +Internal function called by plugins. diff --git a/contrib/docs/latex/fl/cbdrawbardecorevent.tex b/contrib/docs/latex/fl/cbdrawbardecorevent.tex index 8e1940c9f3..6af82757e2 100644 --- a/contrib/docs/latex/fl/cbdrawbardecorevent.tex +++ b/contrib/docs/latex/fl/cbdrawbardecorevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawBarDecorEvent}}\label{cbdrawbardecorevent} + +Class for bar decoration drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawBarDecorEvent}{\param{cbBarInfo* }{pBar}, \param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information, device context, and pane. + diff --git a/contrib/docs/latex/fl/cbdrawbarhandlesevent.tex b/contrib/docs/latex/fl/cbdrawbarhandlesevent.tex index 354d327ba0..1f600905ad 100644 --- a/contrib/docs/latex/fl/cbdrawbarhandlesevent.tex +++ b/contrib/docs/latex/fl/cbdrawbarhandlesevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawBarHandlesEvent}}\label{cbdrawbarhandlesevent} + +Class for bar handles drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawBarHandlesEvent}{\param{cbBarInfo* }{pBar}, \param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information, device context, and pane. + diff --git a/contrib/docs/latex/fl/cbdrawhintrectevent.tex b/contrib/docs/latex/fl/cbdrawhintrectevent.tex index 0a9090ef3a..46ec60ed01 100644 --- a/contrib/docs/latex/fl/cbdrawhintrectevent.tex +++ b/contrib/docs/latex/fl/cbdrawhintrectevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawHintRectEvent}}\label{cbdrawhintrectevent} + +Class for hint-rectangle drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -20,4 +27,5 @@ \func{}{cbDrawHintRectEvent}{\param{const wxRect\& }{rect}, \param{bool }{isInClient}, \param{bool }{eraseRect}, \param{bool }{lastTime}} e.g. with fat/hatched border +Constructor, taking hint rectangle and three flags. diff --git a/contrib/docs/latex/fl/cbdrawpanebkgroundevent.tex b/contrib/docs/latex/fl/cbdrawpanebkgroundevent.tex index 11fb7d5550..895b98f898 100644 --- a/contrib/docs/latex/fl/cbdrawpanebkgroundevent.tex +++ b/contrib/docs/latex/fl/cbdrawpanebkgroundevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawPaneBkGroundEvent}}\label{cbdrawpanebkgroundevent} + +Class for pane background drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawPaneBkGroundEvent}{\param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking device context and pane. + diff --git a/contrib/docs/latex/fl/cbdrawpanedecorevent.tex b/contrib/docs/latex/fl/cbdrawpanedecorevent.tex index bdf99939a1..27573caf76 100644 --- a/contrib/docs/latex/fl/cbdrawpanedecorevent.tex +++ b/contrib/docs/latex/fl/cbdrawpanedecorevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawPaneDecorEvent}}\label{cbdrawpanedecorevent} + +Class for pane decoration drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawPaneDecorEvent}{\param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking device context and pane. + diff --git a/contrib/docs/latex/fl/cbdrawrowbkgroundevent.tex b/contrib/docs/latex/fl/cbdrawrowbkgroundevent.tex index c7a43b91d7..07e491f391 100644 --- a/contrib/docs/latex/fl/cbdrawrowbkgroundevent.tex +++ b/contrib/docs/latex/fl/cbdrawrowbkgroundevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawRowBkGroundEvent}}\label{cbdrawrowbkgroundevent} + +Class for row background drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawRowBkGroundEvent}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking row information, device context, and pane. + diff --git a/contrib/docs/latex/fl/cbdrawrowdecorevent.tex b/contrib/docs/latex/fl/cbdrawrowdecorevent.tex index 290fda5edc..d487970234 100644 --- a/contrib/docs/latex/fl/cbdrawrowdecorevent.tex +++ b/contrib/docs/latex/fl/cbdrawrowdecorevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawRowDecorEvent}}\label{cbdrawrowdecorevent} + +Class for row decoration drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawRowDecorEvent}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking row information, device context, and pane. + diff --git a/contrib/docs/latex/fl/cbdrawrowhandlesevent.tex b/contrib/docs/latex/fl/cbdrawrowhandlesevent.tex index 0e8a1f9ac6..00366f61f9 100644 --- a/contrib/docs/latex/fl/cbdrawrowhandlesevent.tex +++ b/contrib/docs/latex/fl/cbdrawrowhandlesevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbDrawRowHandlesEvent}}\label{cbdrawrowhandlesevent} + +Class for row handles drawing events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbDrawRowHandlesEvent}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}, \param{cbDockPane* }{pPane}} +Constructor, taking row information, device context, and pane. + diff --git a/contrib/docs/latex/fl/cbdyntoolbardimhandler.tex b/contrib/docs/latex/fl/cbdyntoolbardimhandler.tex index 1d4019b065..fb00a9b864 100644 --- a/contrib/docs/latex/fl/cbdyntoolbardimhandler.tex +++ b/contrib/docs/latex/fl/cbdyntoolbardimhandler.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% dyntbarhnd.h at 05/Jan/02 22:50:56 +% dyntbarhnd.h at 21/Jan/02 21:14:19 % \section{\class{cbDynToolBarDimHandler}}\label{cbdyntoolbardimhandler} + +Dynamic toolbar dimension handler. + \wxheading{Derived from} \helpref{cbBarDimHandlerBase}{cbbardimhandlerbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,8 +26,12 @@ \func{void}{OnChangeBarState}{\param{cbBarInfo* }{pBar}, \param{int }{newState}} +Called when the bar changes state. + \membersection{cbDynToolBarDimHandler::OnResizeBar}\label{cbdyntoolbardimhandleronresizebar} \func{void}{OnResizeBar}{\param{cbBarInfo* }{pBar}, \param{const wxSize\& }{given}, \param{wxSize\& }{preferred}} +Called when a bar is resized. + diff --git a/contrib/docs/latex/fl/cbfinishdrawinareaevent.tex b/contrib/docs/latex/fl/cbfinishdrawinareaevent.tex index 39fe8377bf..066f339572 100644 --- a/contrib/docs/latex/fl/cbfinishdrawinareaevent.tex +++ b/contrib/docs/latex/fl/cbfinishdrawinareaevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbFinishDrawInAreaEvent}}\label{cbfinishdrawinareaevent} + +Class for finish drawing in area events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbFinishDrawInAreaEvent}{\param{const wxRect\& }{area}, \param{cbDockPane* }{pPane}} +Constructor, taking rectangular area and pane. + diff --git a/contrib/docs/latex/fl/cbfloatedbarwindow.tex b/contrib/docs/latex/fl/cbfloatedbarwindow.tex index 417df44a52..0785403f77 100644 --- a/contrib/docs/latex/fl/cbfloatedbarwindow.tex +++ b/contrib/docs/latex/fl/cbfloatedbarwindow.tex @@ -1,15 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% toolwnd.h at 05/Jan/02 22:50:58 +% toolwnd.h at 21/Jan/02 21:14:17 % \section{\class{cbFloatedBarWindow}}\label{cbfloatedbarwindow} + +cbFloatedBarWindow is a kind of wxToolWindow, +implementing floating toolbars. + \wxheading{Derived from} \helpref{wxToolWindow}{wxtoolwindow} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,49 +27,63 @@ \func{}{cbFloatedBarWindow}{\void} +Default constructor. + \membersection{cbFloatedBarWindow::GetBar}\label{cbfloatedbarwindowgetbar} \func{cbBarInfo*}{GetBar}{\void} +Returns the bar information for this window. + \membersection{cbFloatedBarWindow::GetPreferredSize}\label{cbfloatedbarwindowgetpreferredsize} \func{wxSize}{GetPreferredSize}{\param{const wxSize\& }{given}} -overriden methods of wxToolWindow +Overridden function returning the preferred size. \membersection{cbFloatedBarWindow::HandleTitleClick}\label{cbfloatedbarwindowhandletitleclick} \func{bool}{HandleTitleClick}{\param{wxMouseEvent\& }{event}} +Overridden function responding to mouse button clicks on the titlebar. + \membersection{cbFloatedBarWindow::OnDblClick}\label{cbfloatedbarwindowondblclick} \func{void}{OnDblClick}{\param{wxMouseEvent\& }{event}} +Responds to double-click mouse events. + \membersection{cbFloatedBarWindow::OnMiniButtonClicked}\label{cbfloatedbarwindowonminibuttonclicked} \func{void}{OnMiniButtonClicked}{\param{int }{btnIdx}} +Overridden function responding to mouse clicks on mini-buttons. + \membersection{cbFloatedBarWindow::PositionFloatedWnd}\label{cbfloatedbarwindowpositionfloatedwnd} \func{void}{PositionFloatedWnd}{\param{int }{scrX}, \param{int }{scrY}, \param{int }{width}, \param{int }{height}} -given coordinates are those of the bar itself -floated container window's position and size -are ajusted accordingly +Position the floating window. The given coordinates +are those of the bar itself; the floated container window's +position and size are ajusted accordingly. \membersection{cbFloatedBarWindow::SetBar}\label{cbfloatedbarwindowsetbar} \func{void}{SetBar}{\param{cbBarInfo* }{pBar}} +Sets the bar information for this window. + \membersection{cbFloatedBarWindow::SetLayout}\label{cbfloatedbarwindowsetlayout} \func{void}{SetLayout}{\param{wxFrameLayout* }{pLayout}} +Sets the layout for this window. + diff --git a/contrib/docs/latex/fl/cbgcupdatesmgr.tex b/contrib/docs/latex/fl/cbgcupdatesmgr.tex index 6450e54fc4..18f31ca525 100644 --- a/contrib/docs/latex/fl/cbgcupdatesmgr.tex +++ b/contrib/docs/latex/fl/cbgcupdatesmgr.tex @@ -1,83 +1,90 @@ % % automatically generated by HelpGen $Revision$ from -% gcupdatesmgr.h at 05/Jan/02 22:50:57 +% gcupdatesmgr.h at 21/Jan/02 21:14:19 % \section{\class{cbGCUpdatesMgr}}\label{cbgcupdatesmgr} -class implements optimized logic for refreshing - areas of frame layout - which actually need to be updated. - Is used as default updates-manager by wxFrameLayout. - - it is called "Garbage Collecting" u.mgr for it's implementation - tries to find out dependencies between bars, and to order - them ito "hierarchy", this hierarchical sorting resembles - implemenation of heap-garbage collectors, which resolve - dependencies between references. - - Example: there are situations where the order of moving - the windows does matter: - - case 1) - ------ --- - | A | |B| - ------ ---> | | - --- --- ------ - |B| | A | - | | ------ - --- - (future) - (past) - - past/future positions of A and B windows completely overlapp, i.e. - depend on each other, and there is not solution for - moving the windows witout refreshing both of them, - -- we have cyclic dependency here. The gc. alg will - find this cyclic dependecy and will force "refresh" - after movement. - - case 2) - - ------ - | A | - ------ ---> - --- - |B| ------ - | | | A | - --- ------ - --- - |B| - | | - --- - - (future) - (past) - - in this case past/future positions do not overlapp, thus - it's enough only to move windows, without refreshing them. - GC will "notice" it. - - there is also third case, when overlapping is partial - in this case the refershing can be also avoided by - moving windows in the order of "most-dependant" towards the - "least-dependent". GC handles this automatically, by - sorting windows by their dependency-level (or "hierarchy") - - See garbagec.h for more details of this method, garbagec.h/cpp - implement sorting of generic-dependencies (does not deal - with graphical objects directly) - - Summary: improves performance when complex/large windows are - moved around, by reducing number of repaints. Also helps - to avoid dirty non-client areas of moved windows - in some special cases of "overlapping anomalies" - +This class implements optimized logic for refreshing +the areas of frame layout that actually need to be updated. +It is used as the default updates manager by wxFrameLayout. + +It is called 'Garbage Collecting' updates manager because +its implementation tries to find out dependencies between bars, +and to order them into a 'hierarchy'. This hierarchical sorting resembles +the implementation of heap-garbage collectors, which resolve +dependencies between references. + +Example: there are situations where the order in which the user +moves windows does matter. + +\begin{verbatim} + case 1) + ------ --- + | A | |B| + ------ ---> | | + --- --- ------ + |B| | A | + | | ------ + --- + (future) + (past) +\end{verbatim} + +Past/future positions of A and B windows completely overlap, i.e. +depend on each other, and there is no solution for +moving the windows without refreshing both of them +-- we have a cyclic dependency here. The garbage collection algorithm will +find this cyclic dependecy and will force refresh after movement. + +\begin{verbatim} + case 2) + + ------ + | A | + ------ ---> + --- + |B| ------ + | | | A | + --- ------ + --- + |B| + | | + --- + + (future) + (past) +\end{verbatim} + +In this case past/future positions do not overlap, so +it is enough only to move windows without refreshing them. +Garbage collection will 'notice' this. + +There is also a third case, when overlapping is partial. +In this case the refreshing can also be avoided by +moving windows in the order of 'most-dependant' towards the +'least-dependent'. GC handles this automatically, by +sorting windows by their dependency-level (or 'hierarchy'). + +See garbagec.h for more details of this method; garbagec.h/cpp +implement sorting of generic dependencies and does not deal +with graphical objects directly. + +Summary: garbage collection improves performance when complex or large +windows are moved around, by reducing the number of repaints. It also helps +to avoid dirty non-client areas of moved windows +in some special cases of 'overlapping anomalies'. + \wxheading{Derived from} \helpref{cbSimpleUpdatesMgr}{cbsimpleupdatesmgr} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -87,30 +94,38 @@ class implements optimized logic for refreshing \func{}{cbGCUpdatesMgr}{\void} +Default constructor. + \func{}{cbGCUpdatesMgr}{\param{wxFrameLayout* }{pPanel}} +Constructor, taking a frame layout. + \membersection{cbGCUpdatesMgr::AddItem}\label{cbgcupdatesmgradditem} \func{void}{AddItem}{\param{wxList\& }{itemList}, \param{cbBarInfo* }{pBar}, \param{cbDockPane* }{pPane}, \param{wxRect\& }{curBounds}, \param{wxRect\& }{prevBounds}} +Internal function for repositioning items. + \membersection{cbGCUpdatesMgr::DoRepositionItems}\label{cbgcupdatesmgrdorepositionitems} \func{void}{DoRepositionItems}{\param{wxList\& }{items}} +Internal function for repositioning items. + \membersection{cbGCUpdatesMgr::OnStartChanges}\label{cbgcupdatesmgronstartchanges} \func{void}{OnStartChanges}{\void} -notificiactions received from Frame Layout : +Receives notifications from the frame layout. \membersection{cbGCUpdatesMgr::UpdateNow}\label{cbgcupdatesmgrupdatenow} \func{void}{UpdateNow}{\void} -refreshes parts of the frame layout, which need an update +Refreshes the parts of the frame layout which need an update. diff --git a/contrib/docs/latex/fl/cbhiddenbarinfo.tex b/contrib/docs/latex/fl/cbhiddenbarinfo.tex index bd85b5139e..f8dafe295e 100644 --- a/contrib/docs/latex/fl/cbhiddenbarinfo.tex +++ b/contrib/docs/latex/fl/cbhiddenbarinfo.tex @@ -1,17 +1,21 @@ % % automatically generated by HelpGen $Revision$ from -% rowdragpl.h at 05/Jan/02 22:50:57 +% rowdragpl.h at 21/Jan/02 21:14:19 % \section{\class{cbHiddenBarInfo}}\label{cbhiddenbarinfo} -internal helper-class +Internal helper class. \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} diff --git a/contrib/docs/latex/fl/cbhintanimationplugin.tex b/contrib/docs/latex/fl/cbhintanimationplugin.tex index 27746fde12..9048400042 100644 --- a/contrib/docs/latex/fl/cbhintanimationplugin.tex +++ b/contrib/docs/latex/fl/cbhintanimationplugin.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% hintanimpl.h at 05/Jan/02 22:50:57 +% hintanimpl.h at 21/Jan/02 21:14:18 % \section{\class{cbHintAnimationPlugin}}\label{cbhintanimationplugin} + +A plugin to draw animated hints when the user drags a pane. + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,44 +26,62 @@ \func{}{cbHintAnimationPlugin}{\void} +Default constructor. + \func{}{cbHintAnimationPlugin}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor, taking a layout panel and pane mask. + \membersection{cbHintAnimationPlugin::\destruct{cbHintAnimationPlugin}}\label{cbhintanimationplugindtor} \func{}{\destruct{cbHintAnimationPlugin}}{\void} +Destructor. + \membersection{cbHintAnimationPlugin::DoDrawHintRect}\label{cbhintanimationplugindodrawhintrect} \func{void}{DoDrawHintRect}{\param{wxRect\& }{rect}, \param{bool }{isInClientRect}} +Internal function for drawing a hint rectangle. + \membersection{cbHintAnimationPlugin::DrawHintRect}\label{cbhintanimationplugindrawhintrect} \func{void}{DrawHintRect}{\param{wxRect\& }{rect}, \param{bool }{isInClientRect}} +Internal function for drawing a hint rectangle. + \membersection{cbHintAnimationPlugin::EraseHintRect}\label{cbhintanimationpluginerasehintrect} \func{void}{EraseHintRect}{\param{wxRect\& }{rect}, \param{bool }{isInClientRect}} +Internal function for erasing a hint rectangle. + \membersection{cbHintAnimationPlugin::FinishTracking}\label{cbhintanimationpluginfinishtracking} \func{void}{FinishTracking}{\void} +Internal function for finishing tracking. + \membersection{cbHintAnimationPlugin::OnDrawHintRect}\label{cbhintanimationpluginondrawhintrect} \func{void}{OnDrawHintRect}{\param{cbDrawHintRectEvent\& }{event}} +Event handler respoding to hint draw events. + \membersection{cbHintAnimationPlugin::RectToScr}\label{cbhintanimationpluginrecttoscr} \func{void}{RectToScr}{\param{wxRect\& }{frameRect}, \param{wxRect\& }{scrRect}} +Internal function for translating coordinates. + \membersection{cbHintAnimationPlugin::StartTracking}\label{cbhintanimationpluginstarttracking} @@ -64,4 +89,5 @@ speed is constant. Default: TRUE TBD:: get/set methods for above members +Internal function for starting tracking. diff --git a/contrib/docs/latex/fl/cbhintanimtimer.tex b/contrib/docs/latex/fl/cbhintanimtimer.tex index 0570cbf127..b5d20b216c 100644 --- a/contrib/docs/latex/fl/cbhintanimtimer.tex +++ b/contrib/docs/latex/fl/cbhintanimtimer.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% hintanimpl.h at 05/Jan/02 22:50:57 +% hintanimpl.h at 21/Jan/02 21:14:19 % \section{\class{cbHintAnimTimer}}\label{cbhintanimtimer} + +A private helper class. + \wxheading{Derived from} \helpref{wxTimer}{wxtimer} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} diff --git a/contrib/docs/latex/fl/cbinsertbarevent.tex b/contrib/docs/latex/fl/cbinsertbarevent.tex index e43e3ec66f..8599ebe38f 100644 --- a/contrib/docs/latex/fl/cbinsertbarevent.tex +++ b/contrib/docs/latex/fl/cbinsertbarevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbInsertBarEvent}}\label{cbinsertbarevent} + +Class for bar insertion events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbInsertBarEvent}{\param{cbBarInfo* }{pBar}, \param{cbRowInfo* }{pIntoRow}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information, row information, and pane. + diff --git a/contrib/docs/latex/fl/cblayoutrowevent.tex b/contrib/docs/latex/fl/cblayoutrowevent.tex index 2769f658f1..70362bac24 100644 --- a/contrib/docs/latex/fl/cblayoutrowevent.tex +++ b/contrib/docs/latex/fl/cblayoutrowevent.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbLayoutRowEvent}}\label{cblayoutrowevent} -bar/row events category +Class for single row layout events. \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,3 +26,5 @@ bar/row events category \func{}{cbLayoutRowEvent}{\param{cbRowInfo* }{pRow}, \param{cbDockPane* }{pPane}} +Constructor, taking row information and pane. + diff --git a/contrib/docs/latex/fl/cblayoutrowsevent.tex b/contrib/docs/latex/fl/cblayoutrowsevent.tex index 872f1c3bd0..af71f09533 100644 --- a/contrib/docs/latex/fl/cblayoutrowsevent.tex +++ b/contrib/docs/latex/fl/cblayoutrowsevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbLayoutRowsEvent}}\label{cblayoutrowsevent} + +Class for multiple rows layout events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbLayoutRowsEvent}{\param{cbDockPane* }{pPane}} +Constructor, taking pane. + diff --git a/contrib/docs/latex/fl/cbleftdclickevent.tex b/contrib/docs/latex/fl/cbleftdclickevent.tex index c3f1a52231..a41fd5a4a5 100644 --- a/contrib/docs/latex/fl/cbleftdclickevent.tex +++ b/contrib/docs/latex/fl/cbleftdclickevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbLeftDClickEvent}}\label{cbleftdclickevent} + +Class for mouse left double click events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbLeftDClickEvent}{\param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking mouse position and pane. + diff --git a/contrib/docs/latex/fl/cbleftdownevent.tex b/contrib/docs/latex/fl/cbleftdownevent.tex index 0d18a830ee..4988afaca1 100644 --- a/contrib/docs/latex/fl/cbleftdownevent.tex +++ b/contrib/docs/latex/fl/cbleftdownevent.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbLeftDownEvent}}\label{cbleftdownevent} -event classes, for each corresponding event type (24 currnetly...uhh) **mouse-events category +Class for mouse left down events. \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,3 +26,5 @@ event classes, for each corresponding event type (24 currnetly...uhh) **mouse-ev \func{}{cbLeftDownEvent}{\param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking mouse position and pane. + diff --git a/contrib/docs/latex/fl/cbleftupevent.tex b/contrib/docs/latex/fl/cbleftupevent.tex index f90ff73215..67bfe5cbf0 100644 --- a/contrib/docs/latex/fl/cbleftupevent.tex +++ b/contrib/docs/latex/fl/cbleftupevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbLeftUpEvent}}\label{cbleftupevent} + +Class for mouse left up events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbLeftUpEvent}{\param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking mouse position and pane. + diff --git a/contrib/docs/latex/fl/cbminibutton.tex b/contrib/docs/latex/fl/cbminibutton.tex index a8b9bc4079..f2b8325d77 100644 --- a/contrib/docs/latex/fl/cbminibutton.tex +++ b/contrib/docs/latex/fl/cbminibutton.tex @@ -1,15 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% toolwnd.h at 05/Jan/02 22:50:58 +% toolwnd.h at 21/Jan/02 21:14:17 % \section{\class{cbMiniButton}}\label{cbminibutton} + +cbMiniButton is the base class for a small button that can be placed in a wxToolWindow +titlebar. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,58 +27,83 @@ \func{}{cbMiniButton}{\void} +Default constructor. + \membersection{cbMiniButton::Draw}\label{cbminibuttondraw} \func{void}{Draw}{\param{wxDC\& }{dc}} +Draws the button. Override this to implement +the desired appearance. + \membersection{cbMiniButton::Enable}\label{cbminibuttonenable} \func{void}{Enable}{\param{bool }{enable}} +Enable or disable the button. + \membersection{cbMiniButton::HitTest}\label{cbminibuttonhittest} \func{bool}{HitTest}{\param{const wxPoint\& }{pos}} +Returns TRUE if the given position was over the button. + \membersection{cbMiniButton::IsPressed}\label{cbminibuttonispressed} \func{bool}{IsPressed}{\void} +Returns TRUE if this button is pressed. + \membersection{cbMiniButton::OnLeftDown}\label{cbminibuttononleftdown} \func{void}{OnLeftDown}{\param{const wxPoint\& }{pos}} +Responds to a left down event. + \membersection{cbMiniButton::OnLeftUp}\label{cbminibuttononleftup} \func{void}{OnLeftUp}{\param{const wxPoint\& }{pos}} +Responds to a left up event. + \membersection{cbMiniButton::OnMotion}\label{cbminibuttononmotion} \func{void}{OnMotion}{\param{const wxPoint\& }{pos}} +Responds to a mouse move event. + \membersection{cbMiniButton::Refresh}\label{cbminibuttonrefresh} \func{void}{Refresh}{\void} +Refreshes the button. + \membersection{cbMiniButton::Reset}\label{cbminibuttonreset} \func{void}{Reset}{\void} +Reset the button. + \membersection{cbMiniButton::SetPos}\label{cbminibuttonsetpos} \func{void}{SetPos}{\param{const wxPoint\& }{pos}} +Set the position of the button. + \membersection{cbMiniButton::WasClicked}\label{cbminibuttonwasclicked} \func{bool}{WasClicked}{\void} +Returns TRUE if the button was clicked. + diff --git a/contrib/docs/latex/fl/cbmotionevent.tex b/contrib/docs/latex/fl/cbmotionevent.tex index 0413519cf2..d5c977016e 100644 --- a/contrib/docs/latex/fl/cbmotionevent.tex +++ b/contrib/docs/latex/fl/cbmotionevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbMotionEvent}}\label{cbmotionevent} + +Class for mouse motion events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbMotionEvent}{\param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking mouse position and pane. + diff --git a/contrib/docs/latex/fl/cbpanedrawplugin.tex b/contrib/docs/latex/fl/cbpanedrawplugin.tex index 66e247aacc..550121ec09 100644 --- a/contrib/docs/latex/fl/cbpanedrawplugin.tex +++ b/contrib/docs/latex/fl/cbpanedrawplugin.tex @@ -1,23 +1,27 @@ % % automatically generated by HelpGen $Revision$ from -% panedrawpl.h at 05/Jan/02 22:50:57 +% panedrawpl.h at 21/Jan/02 21:14:19 % \section{\class{cbPaneDrawPlugin}}\label{cbpanedrawplugin} -Simple, but all-in-one plugin implementation. Resembles look \& feel of - to MFC control-bars. Handles painting of pane and items in it. - Fires bar/layout customization event, when user right-clicks bar/pane. - Hooking an instance of this and row-layouting plugins per each pane, - would be enough for the frame layout to function properly. - (they are plugged in autimatically by wxFrameLayout class) - +Simple but all-in-one plugin implementation. Resembles the look and feel of +to MFC control-bars. The class handles painting of the pane and the items in it; +it generates bar/layout customization events, when the user right-clicks the bar/pane. +Hooking an instance of this and row-layout plugins for each pane +would be enough for the frame layout to function properly +(they are plugged in automatically by the wxFrameLayout class). + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -27,155 +31,213 @@ Simple, but all-in-one plugin implementation. Resembles look \& feel of \func{}{cbPaneDrawPlugin}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor taking frame layout pane and a pane mask. + \func{}{cbPaneDrawPlugin}{\void} +Default constructor. + \membersection{cbPaneDrawPlugin::\destruct{cbPaneDrawPlugin}}\label{cbpanedrawplugindtor} \func{}{\destruct{cbPaneDrawPlugin}}{\void} +Destructor. + \membersection{cbPaneDrawPlugin::Clone}\label{cbpanedrawpluginclone} \func{cbPluginBase*}{Clone}{\void} +Clone function, returning a new instance of this class. + \membersection{cbPaneDrawPlugin::DrawBarInnerShadeRect}\label{cbpanedrawplugindrawbarinnershaderect} \func{void}{DrawBarInnerShadeRect}{\param{cbBarInfo* }{pBar}, \param{wxDC\& }{dc}} +Internal helper: draws the inner bar shading. + \membersection{cbPaneDrawPlugin::DrawDraggedHandle}\label{cbpanedrawplugindrawdraggedhandle} \func{void}{DrawDraggedHandle}{\param{const wxPoint\& }{pos}, \param{cbDockPane\& }{pane}} -helpers +Internal helper: draws the dragged handle. \membersection{cbPaneDrawPlugin::DrawLowerRowHandle}\label{cbpanedrawplugindrawlowerrowhandle} \func{void}{DrawLowerRowHandle}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Internal helper: draws the lower row handle. + \membersection{cbPaneDrawPlugin::DrawLowerRowShades}\label{cbpanedrawplugindrawlowerrowshades} \func{void}{DrawLowerRowShades}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}, \param{int }{level}} +Internal helper: draws the lower row shading. + \membersection{cbPaneDrawPlugin::DrawPaneShade}\label{cbpanedrawplugindrawpaneshade} \func{void}{DrawPaneShade}{\param{wxDC\& }{dc}, \param{int }{alignment}} +Internal helper: draws the pane shading. + \membersection{cbPaneDrawPlugin::DrawPaneShadeForRow}\label{cbpanedrawplugindrawpaneshadeforrow} \func{void}{DrawPaneShadeForRow}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Internal helper: draws the pane shading for a row. + \membersection{cbPaneDrawPlugin::DrawShade}\label{cbpanedrawplugindrawshade} \func{void}{DrawShade}{\param{int }{level}, \param{wxRect\& }{rect}, \param{int }{alignment}, \param{wxDC\& }{dc}} +Internal helper: draws shading. + \membersection{cbPaneDrawPlugin::DrawShade1}\label{cbpanedrawplugindrawshade1} \func{void}{DrawShade1}{\param{int }{level}, \param{wxRect\& }{rect}, \param{int }{alignment}, \param{wxDC\& }{dc}} +Internal helper: draws shading. + \membersection{cbPaneDrawPlugin::DrawUpperRowHandle}\label{cbpanedrawplugindrawupperrowhandle} \func{void}{DrawUpperRowHandle}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}} +Internal helper: draws the upper row handle. + \membersection{cbPaneDrawPlugin::DrawUpperRowShades}\label{cbpanedrawplugindrawupperrowshades} \func{void}{DrawUpperRowShades}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}, \param{int }{level}} +Internal helper: draws the upper row shading. + \membersection{cbPaneDrawPlugin::OnDrawBarDecorations}\label{cbpanedrawpluginondrawbardecorations} \func{void}{OnDrawBarDecorations}{\param{cbDrawBarDecorEvent\& }{event}} +Handler for draw bar decorations events. + \membersection{cbPaneDrawPlugin::OnDrawBarHandles}\label{cbpanedrawpluginondrawbarhandles} \func{void}{OnDrawBarHandles}{\param{cbDrawBarHandlesEvent\& }{event}} +Handler for draw bar handles events. + \membersection{cbPaneDrawPlugin::OnDrawPaneBackground}\label{cbpanedrawpluginondrawpanebackground} \func{void}{OnDrawPaneBackground}{\param{cbDrawPaneBkGroundEvent\& }{event}} +Handler for draw pane background events. + \membersection{cbPaneDrawPlugin::OnDrawPaneDecorations}\label{cbpanedrawpluginondrawpanedecorations} \func{void}{OnDrawPaneDecorations}{\param{cbDrawPaneDecorEvent\& }{event}} +Handler for draw pane decoration events. + \membersection{cbPaneDrawPlugin::OnDrawRowBackground}\label{cbpanedrawpluginondrawrowbackground} \func{void}{OnDrawRowBackground}{\param{cbDrawRowBkGroundEvent\& }{event}} +Handler for draw row background events. + \membersection{cbPaneDrawPlugin::OnDrawRowDecorations}\label{cbpanedrawpluginondrawrowdecorations} \func{void}{OnDrawRowDecorations}{\param{cbDrawRowDecorEvent\& }{event}} +Handler for draw row decoration events. + \membersection{cbPaneDrawPlugin::OnDrawRowHandles}\label{cbpanedrawpluginondrawrowhandles} \func{void}{OnDrawRowHandles}{\param{cbDrawRowHandlesEvent\& }{event}} +Handler for draw row handles events. + \membersection{cbPaneDrawPlugin::OnFinishDrawInArea}\label{cbpanedrawpluginonfinishdrawinarea} \func{void}{OnFinishDrawInArea}{\param{cbFinishDrawInAreaEvent\& }{event}} +Handler for finish draw in area events. + \membersection{cbPaneDrawPlugin::OnLButtonDown}\label{cbpanedrawpluginonlbuttondown} \func{void}{OnLButtonDown}{\param{cbLeftDownEvent\& }{event}} -handlers for plugin-events +Handler for left mouse button down events. \membersection{cbPaneDrawPlugin::OnLButtonUp}\label{cbpanedrawpluginonlbuttonup} \func{void}{OnLButtonUp}{\param{cbLeftUpEvent\& }{event}} +Handler for left mouse button up events. + \membersection{cbPaneDrawPlugin::OnLDblClick}\label{cbpanedrawpluginonldblclick} \func{void}{OnLDblClick}{\param{cbLeftDClickEvent\& }{event}} +Handler for left double-click mouse button down events. + \membersection{cbPaneDrawPlugin::OnMouseMove}\label{cbpanedrawpluginonmousemove} \func{void}{OnMouseMove}{\param{cbMotionEvent\& }{event}} +Handler for mouse move events. + \membersection{cbPaneDrawPlugin::OnRButtonUp}\label{cbpanedrawpluginonrbuttonup} \func{void}{OnRButtonUp}{\param{cbRightUpEvent\& }{event}} +Handler for right mouse button up events. + \membersection{cbPaneDrawPlugin::OnSizeBarWindow}\label{cbpanedrawpluginonsizebarwindow} \func{void}{OnSizeBarWindow}{\param{cbSizeBarWndEvent\& }{event}} +Handler for bar size events. + \membersection{cbPaneDrawPlugin::OnStartDrawInArea}\label{cbpanedrawpluginonstartdrawinarea} \func{void}{OnStartDrawInArea}{\param{cbStartDrawInAreaEvent\& }{event}} +Handler for start draw in area events. + \membersection{cbPaneDrawPlugin::SetDarkPixel}\label{cbpanedrawpluginsetdarkpixel} \func{void}{SetDarkPixel}{\param{int }{x}, \param{int }{y}, \param{wxDC\& }{dc}} +Internal helper: sets a dark pixel at the given location. + \membersection{cbPaneDrawPlugin::SetLightPixel}\label{cbpanedrawpluginsetlightpixel} \func{void}{SetLightPixel}{\param{int }{x}, \param{int }{y}, \param{wxDC\& }{dc}} +Internal helper: sets a light pixel at the given location. + diff --git a/contrib/docs/latex/fl/cbpluginbase.tex b/contrib/docs/latex/fl/cbpluginbase.tex index 1eb69526a3..b99f88ea4c 100644 --- a/contrib/docs/latex/fl/cbpluginbase.tex +++ b/contrib/docs/latex/fl/cbpluginbase.tex @@ -1,18 +1,25 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbPluginBase}}\label{cbpluginbase} -abstract base class for all control-bar related plugins - +Abstract base class for all control-bar related plugins. +Note: pointer positions of mouse events sent to plugins +are always in the pane's coordinates (the pane to which +this plugin is hooked). + \wxheading{Derived from} \helpref{wxEvtHandler}{wxevthandler} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,44 +29,49 @@ abstract base class for all control-bar related plugins \func{}{cbPluginBase}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor taking layout panel and a mask. + \func{}{cbPluginBase}{\void} +Default constructor. + \membersection{cbPluginBase::\destruct{cbPluginBase}}\label{cbpluginbasedtor} \func{}{\destruct{cbPluginBase}}{\void} -NOTE:: pointer positions of mouse-events sent to plugins -are always in pane's coordinates (pane's to which -this plugin is hooked) -destroys the whole plugin chain of connected plagins +Destructor. Destroys the whole plugin chain of connected plugins. \membersection{cbPluginBase::GetPaneMask}\label{cbpluginbasegetpanemask} \func{int}{GetPaneMask}{\void} +Returns the pane mask. + \membersection{cbPluginBase::IsReady}\label{cbpluginbaseisready} \func{bool}{IsReady}{\void} +Returns TRUE if the plugin is ready to receive events. + \membersection{cbPluginBase::OnInitPlugin}\label{cbpluginbaseoninitplugin} \func{void}{OnInitPlugin}{\void} -override this method to do plugin-specific initialization -(at this point plugin is already attached to the frame layout, -and pane masks are set) +Override this method to do plugin-specific initialization. +At this point plugin is already attached to the frame layout, +and pane masks are set. \membersection{cbPluginBase::ProcessEvent}\label{cbpluginbaseprocessevent} \func{bool}{ProcessEvent}{\param{wxEvent\& }{event}} -overriden, to determine whether the target pane specified in the -event, matches the pane mask of this plugin (specific plugins -do not override this method) +Overridden to determine whether the target pane specified in the +event matches the pane mask of this plugin (specific plugins +do not override this method). diff --git a/contrib/docs/latex/fl/cbpluginevent.tex b/contrib/docs/latex/fl/cbpluginevent.tex index ed9b146098..a96058c49f 100644 --- a/contrib/docs/latex/fl/cbpluginevent.tex +++ b/contrib/docs/latex/fl/cbpluginevent.tex @@ -1,22 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbPluginEvent}}\label{cbpluginevent} ------------------------------------------------------------- - "API" for developing custom plugins of Frame Layout Engine - TODO:: documentation - ------------------------------------------------------------ - base class for all control-bar plugin events +Base class for all control-bar plugin events. +This is not a dynamically-creatable class. \wxheading{Derived from} \helpref{wxEvent}{wxevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -26,18 +27,12 @@ \func{}{cbPluginEvent}{\param{wxEventType }{eventType}, \param{cbDockPane* }{pPane}} +Constructor, taking event type and pane. + \membersection{cbPluginEvent::Clone}\label{cbplugineventclone} \constfunc{wxEvent*}{Clone}{\void} -OLD STUFF:: - // FOR NOW FOR NOW:: all-in-one plugin event structure - wxNode* mpObjNode; - wxNode* mpObjNodeAux; - wxPoint mPos; - wxSize mSize; - wxDC* mpDC; - bool mAuxBoolVal; - Not used, but required +Not used, but required. diff --git a/contrib/docs/latex/fl/cbremovebarevent.tex b/contrib/docs/latex/fl/cbremovebarevent.tex index f9b16ac841..bac004c048 100644 --- a/contrib/docs/latex/fl/cbremovebarevent.tex +++ b/contrib/docs/latex/fl/cbremovebarevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbRemoveBarEvent}}\label{cbremovebarevent} + +Class for bar removal events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbRemoveBarEvent}{\param{cbBarInfo* }{pBar}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information and pane. + diff --git a/contrib/docs/latex/fl/cbresizebarevent.tex b/contrib/docs/latex/fl/cbresizebarevent.tex index 5f7b45fb3e..83680efb8b 100644 --- a/contrib/docs/latex/fl/cbresizebarevent.tex +++ b/contrib/docs/latex/fl/cbresizebarevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbResizeBarEvent}}\label{cbresizebarevent} + +Class for bar resize events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbResizeBarEvent}{\param{cbBarInfo* }{pBar}, \param{cbRowInfo* }{pRow}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information, row information, and pane. + diff --git a/contrib/docs/latex/fl/cbresizerowevent.tex b/contrib/docs/latex/fl/cbresizerowevent.tex index be09a06c44..dc1c37ee63 100644 --- a/contrib/docs/latex/fl/cbresizerowevent.tex +++ b/contrib/docs/latex/fl/cbresizerowevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbResizeRowEvent}}\label{cbresizerowevent} + +Class for row resize events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbResizeRowEvent}{\param{cbRowInfo* }{pRow}, \param{int }{handleOfs}, \param{bool }{forUpperHandle}, \param{cbDockPane* }{pPane}} +Constructor, taking row information, two parameters of currently unknown use, and pane. + diff --git a/contrib/docs/latex/fl/cbrightdownevent.tex b/contrib/docs/latex/fl/cbrightdownevent.tex index 2ed4171532..a186da067c 100644 --- a/contrib/docs/latex/fl/cbrightdownevent.tex +++ b/contrib/docs/latex/fl/cbrightdownevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbRightDownEvent}}\label{cbrightdownevent} + +Class for mouse right down events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbRightDownEvent}{\param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking mouse position and pane. + diff --git a/contrib/docs/latex/fl/cbrightupevent.tex b/contrib/docs/latex/fl/cbrightupevent.tex index 536fc93e00..5306145a3f 100644 --- a/contrib/docs/latex/fl/cbrightupevent.tex +++ b/contrib/docs/latex/fl/cbrightupevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:15 % \section{\class{cbRightUpEvent}}\label{cbrightupevent} + +Class for mouse right up events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbRightUpEvent}{\param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking mouse position and pane. + diff --git a/contrib/docs/latex/fl/cbrowdragplugin.tex b/contrib/docs/latex/fl/cbrowdragplugin.tex index 1c0e6b586f..f63642d332 100644 --- a/contrib/docs/latex/fl/cbrowdragplugin.tex +++ b/contrib/docs/latex/fl/cbrowdragplugin.tex @@ -1,21 +1,25 @@ % % automatically generated by HelpGen $Revision$ from -% rowdragpl.h at 05/Jan/02 22:50:57 +% rowdragpl.h at 21/Jan/02 21:14:19 % \section{\class{cbRowDragPlugin}}\label{cbrowdragplugin} -Plugin adds row-dragging fuctionality to the pane. - Handles mouse/movement and pane-background erasing plugin-events. - Behaviour and appearence resembles drag \& drop posotioning - of the toolbar-rows int Netscape Comunicator 4.xx. - +This plugin adds row-dragging functionality to the pane. +It handles mouse movement and pane background-erasing plugin events. +The behaviour and appearance resembles drag and drop positioning +of the toolbar rows in Netscape Communicator 4.xx. + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -25,229 +29,311 @@ Plugin adds row-dragging fuctionality to the pane. \func{}{cbRowDragPlugin}{\param{wxFrameLayout* }{pLayout}, \param{int }{paneMask = wxALL\_PANES}} +Constructor, taking paren layout frame and pane mask. + \func{}{cbRowDragPlugin}{\void} +Default constructor. + \membersection{cbRowDragPlugin::\destruct{cbRowDragPlugin}}\label{cbrowdragplugindtor} \func{}{\destruct{cbRowDragPlugin}}{\void} +Destructor. + \membersection{cbRowDragPlugin::CaptureDCArea}\label{cbrowdragplugincapturedcarea} \func{wxBitmap*}{CaptureDCArea}{\param{wxDC\& }{dc}, \param{wxRect\& }{area}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::CheckPrevItemInFocus}\label{cbrowdragplugincheckpreviteminfocus} \func{void}{CheckPrevItemInFocus}{\param{cbRowInfo* }{pRow}, \param{int }{iconIdx}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::Clone}\label{cbrowdragpluginclone} \func{cbPluginBase*}{Clone}{\void} +Clone function, returning a new instance of this class. + \membersection{cbRowDragPlugin::CollapseRow}\label{cbrowdragplugincollapserow} \func{void}{CollapseRow}{\param{cbRowInfo* }{pRow}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::Draw3DPattern}\label{cbrowdragplugindraw3dpattern} \func{void}{Draw3DPattern}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::Draw3DRect}\label{cbrowdragplugindraw3drect} \func{void}{Draw3DRect}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}, \param{wxBrush\& }{bkBrush}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawCollapsedRowIcon}\label{cbrowdragplugindrawcollapsedrowicon} \func{void}{DrawCollapsedRowIcon}{\param{int }{index}, \param{wxDC\& }{dc}, \param{bool }{isHighlighted}} -overridables (appearence-depedent) +Draws collapsed row icon (appearance-dependent). \membersection{cbRowDragPlugin::DrawCollapsedRowsBorder}\label{cbrowdragplugindrawcollapsedrowsborder} \func{void}{DrawCollapsedRowsBorder}{\param{wxDC\& }{dc}} +Draws collapsed rows border (appearance-dependent). + \membersection{cbRowDragPlugin::DrawEmptyRow}\label{cbrowdragplugindrawemptyrow} \func{void}{DrawEmptyRow}{\param{wxDC\& }{dc}, \param{wxRect\& }{rowBounds}} +Draws empty row (appearance-dependent). + \membersection{cbRowDragPlugin::DrawOrtoRomb}\label{cbrowdragplugindrawortoromb} \func{void}{DrawOrtoRomb}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}, \param{wxBrush\& }{bkBrush}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawRectShade}\label{cbrowdragplugindrawrectshade} \func{void}{DrawRectShade}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}, \param{int }{level}, \param{wxPen\& }{upperPen}, \param{wxPen\& }{lowerPen}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawRomb}\label{cbrowdragplugindrawromb} \func{void}{DrawRomb}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}, \param{wxBrush\& }{bkBrush}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawRombShades}\label{cbrowdragplugindrawrombshades} \func{void}{DrawRombShades}{\param{wxPoint\& }{p1}, \param{wxPoint\& }{p2}, \param{wxPoint\& }{p3}, \param{wxPoint\& }{p4}, \param{wxDC\& }{dc}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawRowDragHint}\label{cbrowdragplugindrawrowdraghint} \func{void}{DrawRowDragHint}{\param{cbRowInfo* }{pRow}, \param{wxDC\& }{dc}, \param{bool }{isHighlighted}} +Draws row drag hint (appearance-dependent). + \membersection{cbRowDragPlugin::DrawRowsDragHintsBorder}\label{cbrowdragplugindrawrowsdraghintsborder} \func{void}{DrawRowsDragHintsBorder}{\param{wxDC\& }{dc}} +Draws rows drag hints border (appearance-dependent). + \membersection{cbRowDragPlugin::DrawTrianDown}\label{cbrowdragplugindrawtriandown} \func{void}{DrawTrianDown}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawTrianRight}\label{cbrowdragplugindrawtrianright} \func{void}{DrawTrianRight}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}} +Implements 'hard-coded metafile' for Netscape Navigator look. + \membersection{cbRowDragPlugin::DrawTrianUp}\label{cbrowdragplugindrawtrianup} \func{void}{DrawTrianUp}{\param{wxRect\& }{inRect}, \param{wxDC\& }{dc}} -"hard-coded metafile" for NN-look +Implements 'hard-coded metafile' for Netscape Navigator look. \membersection{cbRowDragPlugin::ExpandRow}\label{cbrowdragpluginexpandrow} \func{void}{ExpandRow}{\param{int }{collapsedIconIdx}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::FinishOnScreenDraw}\label{cbrowdragpluginfinishonscreendraw} \func{void}{FinishOnScreenDraw}{\void} +Helper for drag and drop. + \membersection{cbRowDragPlugin::GetCollapsedIconsPos}\label{cbrowdragplugingetcollapsediconspos} \func{int}{GetCollapsedIconsPos}{\void} +Helper for drag and drop. + \membersection{cbRowDragPlugin::GetCollapsedInconRect}\label{cbrowdragplugingetcollapsedinconrect} \func{void}{GetCollapsedInconRect}{\param{int }{iconIdx}, \param{wxRect\& }{rect}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::GetCollapsedRowIconHeight}\label{cbrowdragplugingetcollapsedrowiconheight} \func{int}{GetCollapsedRowIconHeight}{\void} +Gets the collapsed row icon height. + \membersection{cbRowDragPlugin::GetFirstRow}\label{cbrowdragplugingetfirstrow} \func{cbRowInfo*}{GetFirstRow}{\void} +Helper for drag and drop. + \membersection{cbRowDragPlugin::GetHRowsCountForPane}\label{cbrowdragplugingethrowscountforpane} \func{int}{GetHRowsCountForPane}{\param{cbDockPane* }{pPane}} -helpers for drag\&drop +Helper for drag and drop. \membersection{cbRowDragPlugin::GetRowDragHintWidth}\label{cbrowdragplugingetrowdraghintwidth} \func{int}{GetRowDragHintWidth}{\void} +Gets the row drag hint width. + \membersection{cbRowDragPlugin::GetRowHintRect}\label{cbrowdragplugingetrowhintrect} \func{void}{GetRowHintRect}{\param{cbRowInfo* }{pRow}, \param{wxRect\& }{rect}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::HitTestCollapsedRowIcon}\label{cbrowdragpluginhittestcollapsedrowicon} \func{bool}{HitTestCollapsedRowIcon}{\param{int }{iconIdx}, \param{const wxPoint\& }{pos}} +Test for the collapsed row icon position. + \membersection{cbRowDragPlugin::HitTestRowDragHint}\label{cbrowdragpluginhittestrowdraghint} \func{bool}{HitTestRowDragHint}{\param{cbRowInfo* }{pRow}, \param{const wxPoint\& }{pos}} +Test for the row drag hint position. + \membersection{cbRowDragPlugin::InsertDraggedRowBefore}\label{cbrowdragplugininsertdraggedrowbefore} \func{void}{InsertDraggedRowBefore}{\param{cbRowInfo* }{pBeforeRow}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::ItemIsInFocus}\label{cbrowdragpluginitemisinfocus} \func{bool}{ItemIsInFocus}{\void} +Helper for drag and drop. + \membersection{cbRowDragPlugin::OnDrawPaneBackground}\label{cbrowdragpluginondrawpanebackground} \func{void}{OnDrawPaneBackground}{\param{cbDrawPaneDecorEvent\& }{event}} +Handles pane drawing plugin events (appearance-independent logic). + \membersection{cbRowDragPlugin::OnInitPlugin}\label{cbrowdragpluginoninitplugin} \func{void}{OnInitPlugin}{\void} +Called to initialize this plugin. + \membersection{cbRowDragPlugin::OnLButtonDown}\label{cbrowdragpluginonlbuttondown} \func{void}{OnLButtonDown}{\param{cbLeftDownEvent\& }{event}} +Handles left button down plugin events (appearance-independent logic). + \membersection{cbRowDragPlugin::OnLButtonUp}\label{cbrowdragpluginonlbuttonup} \func{void}{OnLButtonUp}{\param{cbLeftUpEvent\& }{event}} +Handles left button up plugin events (appearance-independent logic). + \membersection{cbRowDragPlugin::OnMouseMove}\label{cbrowdragpluginonmousemove} \func{void}{OnMouseMove}{\param{cbMotionEvent\& }{event}} -handlers for plugin events (appearence-independent logic) +Handles mouse move plugin events (appearance-independent logic). \membersection{cbRowDragPlugin::PrepareForRowDrag}\label{cbrowdragpluginprepareforrowdrag} \func{void}{PrepareForRowDrag}{\void} +Helper for drag and drop. + \membersection{cbRowDragPlugin::SetMouseCapture}\label{cbrowdragpluginsetmousecapture} \func{void}{SetMouseCapture}{\param{bool }{captureOn}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::SetPaneMargins}\label{cbrowdragpluginsetpanemargins} \func{void}{SetPaneMargins}{\void} +Sets the pane margins. + \membersection{cbRowDragPlugin::ShowDraggedRow}\label{cbrowdragpluginshowdraggedrow} \func{void}{ShowDraggedRow}{\param{int }{offset}} +Helper for drag and drop. + \membersection{cbRowDragPlugin::ShowPaneImage}\label{cbrowdragpluginshowpaneimage} \func{void}{ShowPaneImage}{\void} +Helper for drag and drop. + + +\membersection{cbRowDragPlugin::UnhighlightItemInFocus}\label{cbrowdragpluginunhighlightiteminfocus} -\membersection{cbRowDragPlugin::UnhiglightItemInFocus}\label{cbrowdragpluginunhiglightiteminfocus} +\func{void}{UnhighlightItemInFocus}{\void} -\func{void}{UnhiglightItemInFocus}{\void} +Helper for drag and drop. diff --git a/contrib/docs/latex/fl/cbrowinfo.tex b/contrib/docs/latex/fl/cbrowinfo.tex index f3dfd7dd55..318b26dc5f 100644 --- a/contrib/docs/latex/fl/cbrowinfo.tex +++ b/contrib/docs/latex/fl/cbrowinfo.tex @@ -1,15 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:13 % \section{\class{cbRowInfo}}\label{cbrowinfo} + +Helper class used internally by the wxFrameLayout class. +Holds and manages information about bar rows. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,15 +27,19 @@ \func{}{cbRowInfo}{\void} +Constructor. + \membersection{cbRowInfo::\destruct{cbRowInfo}}\label{cbrowinfodtor} \func{}{\destruct{cbRowInfo}}{\void} +Destructor. + \membersection{cbRowInfo::GetFirstBar}\label{cbrowinfogetfirstbar} \func{cbBarInfo*}{GetFirstBar}{\void} -convenience method +Returns the first bar. diff --git a/contrib/docs/latex/fl/cbrowlayoutplugin.tex b/contrib/docs/latex/fl/cbrowlayoutplugin.tex index 29993e4d27..25a6d517b0 100644 --- a/contrib/docs/latex/fl/cbrowlayoutplugin.tex +++ b/contrib/docs/latex/fl/cbrowlayoutplugin.tex @@ -1,19 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% rowlayoutpl.h at 05/Jan/02 22:50:58 +% rowlayoutpl.h at 21/Jan/02 21:14:19 % \section{\class{cbRowLayoutPlugin}}\label{cbrowlayoutplugin} -Simple implementation of plugin, which handles row-layouting - requests sent from Frame Layout - +Simple implementation of a plugin which handles row layout +requests sent from a frame layout. + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -23,132 +27,178 @@ Simple implementation of plugin, which handles row-layouting \func{}{cbRowLayoutPlugin}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor taking frame layout pane and pane mask. + \func{}{cbRowLayoutPlugin}{\void} +Default constructor. + \membersection{cbRowLayoutPlugin::AdjustLengthOfInserted}\label{cbrowlayoutpluginadjustlengthofinserted} \func{void}{AdjustLengthOfInserted}{\param{cbRowInfo* }{pRow}, \param{cbBarInfo* }{pTheBar}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::ApplyLengthRatios}\label{cbrowlayoutpluginapplylengthratios} \func{void}{ApplyLengthRatios}{\param{cbRowInfo* }{pRow}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::CalcRowHeight}\label{cbrowlayoutplugincalcrowheight} \func{int}{CalcRowHeight}{\param{cbRowInfo\& }{row}} -row-layouting helpers (simulate "bar-friction") +Row layout helper simulating bar 'friction'. \membersection{cbRowLayoutPlugin::CheckIfAtTheBoundary}\label{cbrowlayoutplugincheckifattheboundary} \func{void}{CheckIfAtTheBoundary}{\param{cbBarInfo* }{pTheBar}, \param{cbRowInfo\& }{rowInfo}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::DetectBarHandles}\label{cbrowlayoutplugindetectbarhandles} \func{void}{DetectBarHandles}{\param{cbRowInfo* }{pRow}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::DoInsertBar}\label{cbrowlayoutplugindoinsertbar} \func{void}{DoInsertBar}{\param{cbBarInfo* }{pTheBar}, \param{cbRowInfo\& }{row}} +Insert the bar before the given row. + \membersection{cbRowLayoutPlugin::ExpandNotFixedBars}\label{cbrowlayoutpluginexpandnotfixedbars} \func{void}{ExpandNotFixedBars}{\param{cbRowInfo* }{pRow}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::FitBarsToRange}\label{cbrowlayoutpluginfitbarstorange} \func{void}{FitBarsToRange}{\param{int }{from}, \param{int }{till}, \param{cbBarInfo* }{pTheBar}, \param{cbRowInfo* }{pRow}} -not-fixed-bars layouting related helpers +Internal helper relating to not-fixed-bars layout. \membersection{cbRowLayoutPlugin::GetRowFreeSpace}\label{cbrowlayoutplugingetrowfreespace} \func{int}{GetRowFreeSpace}{\param{cbRowInfo* }{pRow}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::InsertBefore}\label{cbrowlayoutplugininsertbefore} \func{void}{InsertBefore}{\param{cbBarInfo* }{pBeforeBar}, \param{cbBarInfo* }{pTheBar}, \param{cbRowInfo\& }{row}} +Insert the bar before the given row. + \membersection{cbRowLayoutPlugin::LayoutItemsVertically}\label{cbrowlayoutpluginlayoutitemsvertically} \func{void}{LayoutItemsVertically}{\param{cbRowInfo\& }{row}} +Row layout helper simulating bar 'friction'. + \membersection{cbRowLayoutPlugin::MinimzeNotFixedBars}\label{cbrowlayoutpluginminimzenotfixedbars} \func{void}{MinimzeNotFixedBars}{\param{cbRowInfo* }{pRow}, \param{cbBarInfo* }{pBarToPreserve}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::OnInsertBar}\label{cbrowlayoutpluginoninsertbar} \func{void}{OnInsertBar}{\param{cbInsertBarEvent\& }{event}} +Responds to bar insertion event. + \membersection{cbRowLayoutPlugin::OnLayoutRow}\label{cbrowlayoutpluginonlayoutrow} \func{void}{OnLayoutRow}{\param{cbLayoutRowEvent\& }{event}} +Responds to row layout event. + \membersection{cbRowLayoutPlugin::OnLayoutRows}\label{cbrowlayoutpluginonlayoutrows} \func{void}{OnLayoutRows}{\param{cbLayoutRowsEvent\& }{event}} +Responds to rows layout event. + \membersection{cbRowLayoutPlugin::OnRemoveBar}\label{cbrowlayoutpluginonremovebar} \func{void}{OnRemoveBar}{\param{cbRemoveBarEvent\& }{event}} +Responds to bar removal event. + \membersection{cbRowLayoutPlugin::OnResizeRow}\label{cbrowlayoutpluginonresizerow} \func{void}{OnResizeRow}{\param{cbResizeRowEvent\& }{event}} -event handlers +Responds to row resize event. \membersection{cbRowLayoutPlugin::RecalcLengthRatios}\label{cbrowlayoutpluginrecalclengthratios} \func{void}{RecalcLengthRatios}{\param{cbRowInfo* }{pRow}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::RelayoutNotFixedBarsAround}\label{cbrowlayoutpluginrelayoutnotfixedbarsaround} \func{void}{RelayoutNotFixedBarsAround}{\param{cbBarInfo* }{pTheBar}, \param{cbRowInfo* }{pRow}} +Internal helper relating to not-fixed-bars layout. + \membersection{cbRowLayoutPlugin::ShiftLeftTrashold}\label{cbrowlayoutpluginshiftlefttrashold} \func{void}{ShiftLeftTrashold}{\param{cbBarInfo* }{pTheBar}, \param{cbRowInfo\& }{row}} +Row layout helper simulating bar 'friction'. + \membersection{cbRowLayoutPlugin::ShiftRightTrashold}\label{cbrowlayoutpluginshiftrighttrashold} \func{void}{ShiftRightTrashold}{\param{cbBarInfo* }{pTheBar}, \param{cbRowInfo\& }{row}} +Row layout helper simulating bar 'friction'. + \membersection{cbRowLayoutPlugin::SlideLeftSideBars}\label{cbrowlayoutpluginslideleftsidebars} \func{void}{SlideLeftSideBars}{\param{cbBarInfo* }{pTheBar}} +Row layout helper simulating bar 'friction'. + \membersection{cbRowLayoutPlugin::SlideRightSideBars}\label{cbrowlayoutpluginsliderightsidebars} \func{void}{SlideRightSideBars}{\param{cbBarInfo* }{pTheBar}} +Row layout helper simulating bar 'friction'. + \membersection{cbRowLayoutPlugin::StickRightSideBars}\label{cbrowlayoutpluginstickrightsidebars} \func{void}{StickRightSideBars}{\param{cbBarInfo* }{pToBar}} +Row layout helper simulating bar 'friction'. + diff --git a/contrib/docs/latex/fl/cbsimplecustomizationplugin.tex b/contrib/docs/latex/fl/cbsimplecustomizationplugin.tex index 25778efc10..39176f0958 100644 --- a/contrib/docs/latex/fl/cbsimplecustomizationplugin.tex +++ b/contrib/docs/latex/fl/cbsimplecustomizationplugin.tex @@ -1,15 +1,24 @@ % % automatically generated by HelpGen $Revision$ from -% cbcustom.h at 05/Jan/02 22:50:56 +% cbcustom.h at 21/Jan/02 21:14:18 % \section{\class{cbSimpleCustomizationPlugin}}\label{cbsimplecustomizationplugin} + +This class enables customization of a bar, popping up a +menu and handling basic customization such as floating +and horizontal/vertical alignment of the bar. + \wxheading{Derived from} \helpref{cbPluginBase}{cbpluginbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,25 +28,31 @@ \func{}{cbSimpleCustomizationPlugin}{\param{wxFrameLayout* }{pPanel}, \param{int }{paneMask = wxALL\_PANES}} +Constructor, taking parent pane and a pane mask flag. + \func{}{cbSimpleCustomizationPlugin}{\void} +Default constructor. + \membersection{cbSimpleCustomizationPlugin::OnCustomizeBar}\label{cbsimplecustomizationpluginoncustomizebar} \func{void}{OnCustomizeBar}{\param{cbCustomizeBarEvent\& }{event}} -plugin-event handlers +Plugin event handler for cbCustomizeBarEvent. \membersection{cbSimpleCustomizationPlugin::OnCustomizeLayout}\label{cbsimplecustomizationpluginoncustomizelayout} \func{void}{OnCustomizeLayout}{\param{cbCustomizeLayoutEvent\& }{event}} +Plugin event handler for cbCustomizeLayoutEvent. + \membersection{cbSimpleCustomizationPlugin::OnMenuItemSelected}\label{cbsimplecustomizationpluginonmenuitemselected} \func{void}{OnMenuItemSelected}{\param{wxCommandEvent\& }{event}} -menu-event handler +Menu event handler. diff --git a/contrib/docs/latex/fl/cbsimpleupdatesmgr.tex b/contrib/docs/latex/fl/cbsimpleupdatesmgr.tex index e08ac5e518..b9a3c97e3e 100644 --- a/contrib/docs/latex/fl/cbsimpleupdatesmgr.tex +++ b/contrib/docs/latex/fl/cbsimpleupdatesmgr.tex @@ -1,19 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% updatesmgr.h at 05/Jan/02 22:50:58 +% updatesmgr.h at 21/Jan/02 21:14:18 % \section{\class{cbSimpleUpdatesMgr}}\label{cbsimpleupdatesmgr} -class implements slightly optimized logic for refreshing - areas of frame layout - which actually need to be updated. - +This class implements slightly optimized logic for refreshing +the areas of frame layout that actually need to be updated. + \wxheading{Derived from} \helpref{cbUpdatesManagerBase}{cbupdatesmanagerbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -23,51 +27,72 @@ class implements slightly optimized logic for refreshing \func{}{cbSimpleUpdatesMgr}{\void} +Default constructor. + \func{}{cbSimpleUpdatesMgr}{\param{wxFrameLayout* }{pPanel}} +Constructor taking frame layout panel. + \membersection{cbSimpleUpdatesMgr::OnBarWillChange}\label{cbsimpleupdatesmgronbarwillchange} \func{void}{OnBarWillChange}{\param{cbBarInfo* }{pBar}, \param{cbRowInfo* }{pInRow}, \param{cbDockPane* }{pInPane}} +Notification received from Frame Layout in the order in which +they would usually be invoked. + \membersection{cbSimpleUpdatesMgr::OnFinishChanges}\label{cbsimpleupdatesmgronfinishchanges} \func{void}{OnFinishChanges}{\void} +Notification received from Frame Layout in the order in which +they would usually be invoked. + \membersection{cbSimpleUpdatesMgr::OnPaneMarginsWillChange}\label{cbsimpleupdatesmgronpanemarginswillchange} \func{void}{OnPaneMarginsWillChange}{\param{cbDockPane* }{pPane}} +Notification received from Frame Layout in the order in which +they would usually be invoked. + \membersection{cbSimpleUpdatesMgr::OnPaneWillChange}\label{cbsimpleupdatesmgronpanewillchange} \func{void}{OnPaneWillChange}{\param{cbDockPane* }{pPane}} +Notification received from Frame Layout in the order in which +they would usually be invoked. + \membersection{cbSimpleUpdatesMgr::OnRowWillChange}\label{cbsimpleupdatesmgronrowwillchange} \func{void}{OnRowWillChange}{\param{cbRowInfo* }{pRow}, \param{cbDockPane* }{pInPane}} +Notification received from Frame Layout in the order in which +they would usually be invoked. + \membersection{cbSimpleUpdatesMgr::OnStartChanges}\label{cbsimpleupdatesmgronstartchanges} \func{void}{OnStartChanges}{\void} -notificiactions received from Frame Layout (in the order, in which -they usually would be invoked) +Notification received from Frame Layout in the order in which +they would usually be invoked. \membersection{cbSimpleUpdatesMgr::UpdateNow}\label{cbsimpleupdatesmgrupdatenow} \func{void}{UpdateNow}{\void} -refreshes parts of the frame layout, which need an update +Refreshes the parts of the frame layoutthat need an update. \membersection{cbSimpleUpdatesMgr::WasChanged}\label{cbsimpleupdatesmgrwaschanged} \func{bool}{WasChanged}{\param{cbUpdateMgrData\& }{data}, \param{wxRect\& }{currentBounds}} +Helper function. + diff --git a/contrib/docs/latex/fl/cbsizebarwndevent.tex b/contrib/docs/latex/fl/cbsizebarwndevent.tex index 5af196f9de..a464b321d9 100644 --- a/contrib/docs/latex/fl/cbsizebarwndevent.tex +++ b/contrib/docs/latex/fl/cbsizebarwndevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:00 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbSizeBarWndEvent}}\label{cbsizebarwndevent} + +Class for bar window resize events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbSizeBarWndEvent}{\param{cbBarInfo* }{pBar}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information and pane. + diff --git a/contrib/docs/latex/fl/cbstartbardraggingevent.tex b/contrib/docs/latex/fl/cbstartbardraggingevent.tex index 9290ab75b0..0a0c39f0b9 100644 --- a/contrib/docs/latex/fl/cbstartbardraggingevent.tex +++ b/contrib/docs/latex/fl/cbstartbardraggingevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbStartBarDraggingEvent}}\label{cbstartbardraggingevent} + +Class for start-bar-dragging events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,3 +26,5 @@ \func{}{cbStartBarDraggingEvent}{\param{cbBarInfo* }{pBar}, \param{const wxPoint\& }{pos}, \param{cbDockPane* }{pPane}} +Constructor, taking bar information, mouse position, and pane. + diff --git a/contrib/docs/latex/fl/cbstartdrawinareaevent.tex b/contrib/docs/latex/fl/cbstartdrawinareaevent.tex index 29f2c6cec4..5f206c9b99 100644 --- a/contrib/docs/latex/fl/cbstartdrawinareaevent.tex +++ b/contrib/docs/latex/fl/cbstartdrawinareaevent.tex @@ -1,15 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:51:01 +% controlbar.h at 21/Jan/02 21:14:16 % \section{\class{cbStartDrawInAreaEvent}}\label{cbstartdrawinareaevent} + +Class for start drawing in area events. + \wxheading{Derived from} \helpref{cbPluginEvent}{cbpluginevent} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -20,4 +27,5 @@ \func{}{cbStartDrawInAreaEvent}{\param{const wxRect\& }{area}, \param{wxDC** }{ppDCForArea}, \param{cbDockPane* }{pPane}} to the obtained buffer-context should be placed +Constructor, taking rectangular area, device context pointer to a pointer, and pane. diff --git a/contrib/docs/latex/fl/cbupdatemgrdata.tex b/contrib/docs/latex/fl/cbupdatemgrdata.tex index 049d5b84cd..13e5ded718 100644 --- a/contrib/docs/latex/fl/cbupdatemgrdata.tex +++ b/contrib/docs/latex/fl/cbupdatemgrdata.tex @@ -1,21 +1,24 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:58 +% controlbar.h at 21/Jan/02 21:14:13 % \section{\class{cbUpdateMgrData}}\label{cbupdatemgrdata} -structure, which is present in each item of layout, - it used by any specific updates-manager to store - auxilary information to be used by it's specific - updating algorithm - +A structure that is present in each item of layout, +used by any particular updates-manager to store +auxiliary information to be used by its updating algorithm. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -25,25 +28,33 @@ structure, which is present in each item of layout, \func{}{cbUpdateMgrData}{\void} -is-dirty flag is set TRUE initially +Default constructor. Is-dirty flag is set TRUE initially. \membersection{cbUpdateMgrData::IsDirty}\label{cbupdatemgrdataisdirty} \func{bool}{IsDirty}{\void} +Returns the is-dirty flag. + \membersection{cbUpdateMgrData::SetCustomData}\label{cbupdatemgrdatasetcustomdata} \func{void}{SetCustomData}{\param{wxObject* }{pCustomData}} +Set custom data. + \membersection{cbUpdateMgrData::SetDirty}\label{cbupdatemgrdatasetdirty} \func{void}{SetDirty}{\param{bool }{isDirty = TRUE}} +Set the dirty flag. + \membersection{cbUpdateMgrData::StoreItemState}\label{cbupdatemgrdatastoreitemstate} \func{void}{StoreItemState}{\param{const wxRect\& }{boundsInParent}} +Store the item state. + diff --git a/contrib/docs/latex/fl/cbupdatesmanagerbase.tex b/contrib/docs/latex/fl/cbupdatesmanagerbase.tex index e52dbf44e7..b5c71937ec 100644 --- a/contrib/docs/latex/fl/cbupdatesmanagerbase.tex +++ b/contrib/docs/latex/fl/cbupdatesmanagerbase.tex @@ -1,20 +1,24 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:59 +% controlbar.h at 21/Jan/02 21:14:14 % \section{\class{cbUpdatesManagerBase}}\label{cbupdatesmanagerbase} -class declares abstract interface for optimized logic, which should refresh - areas of frame layout - that actually need to be updated. Should be extended, - to implement custom updating strategy - +This class declares an abstract interface for optimized logic that should refresh +areas of frame layout that actually need to be updated. This should be extended in future +to implement a custom updating strategy. + \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -24,57 +28,85 @@ class declares abstract interface for optimized logic, which should refresh \func{}{cbUpdatesManagerBase}{\param{wxFrameLayout* }{pPanel}} +Constructor taking layout panel. + \func{}{cbUpdatesManagerBase}{\void} +Default constructor + \membersection{cbUpdatesManagerBase::\destruct{cbUpdatesManagerBase}}\label{cbupdatesmanagerbasedtor} \func{}{\destruct{cbUpdatesManagerBase}}{\void} +Destructor. + \membersection{cbUpdatesManagerBase::OnBarWillChange}\label{cbupdatesmanagerbaseonbarwillchange} \func{void}{OnBarWillChange}{\param{cbBarInfo* }{pBar}, \param{cbRowInfo* }{pInRow}, \param{cbDockPane* }{pInPane}} +This function receives a notification from the frame layout (in the order in which +they would usually be invoked). Custom updates-managers may utilize +these notifications to implement a more fine-grained updating strategy. + \membersection{cbUpdatesManagerBase::OnFinishChanges}\label{cbupdatesmanagerbaseonfinishchanges} \func{void}{OnFinishChanges}{\void} +This function receives a notification from the frame layout (in the order in which +they would usually be invoked). Custom updates-managers may utilize +these notifications to implement a more fine-grained updating strategy. + \membersection{cbUpdatesManagerBase::OnPaneMarginsWillChange}\label{cbupdatesmanagerbaseonpanemarginswillchange} \func{void}{OnPaneMarginsWillChange}{\param{cbDockPane* }{pPane}} +This function receives a notification from the frame layout (in the order in which +they would usually be invoked). Custom updates-managers may utilize +these notifications to implement a more fine-grained updating strategy. + \membersection{cbUpdatesManagerBase::OnPaneWillChange}\label{cbupdatesmanagerbaseonpanewillchange} \func{void}{OnPaneWillChange}{\param{cbDockPane* }{pPane}} +This function receives a notification from the frame layout (in the order in which +they would usually be invoked). Custom updates-managers may utilize +these notifications to implement a more fine-grained updating strategy. + \membersection{cbUpdatesManagerBase::OnRowWillChange}\label{cbupdatesmanagerbaseonrowwillchange} \func{void}{OnRowWillChange}{\param{cbRowInfo* }{pRow}, \param{cbDockPane* }{pInPane}} +This function receives a notification from the frame layout (in the order in which +they would usually be invoked). Custom updates-managers may utilize +these notifications to implement a more fine-grained updating strategy. + \membersection{cbUpdatesManagerBase::OnStartChanges}\label{cbupdatesmanagerbaseonstartchanges} \func{void}{OnStartChanges}{\void} -notificiactions received from frame-layout (in the order, in which -they usually would be invoked). Custom updates-managers may utilize -these notifications to implement more "fine-grained" updating strategy +This function receives a notification from the frame layout (in the order in which +they would usually be invoked). Custom updates-managers may utilize +these notifications to implement a more fine-grained updating strategy. \membersection{cbUpdatesManagerBase::SetLayout}\label{cbupdatesmanagerbasesetlayout} \func{void}{SetLayout}{\param{wxFrameLayout* }{pLayout}} +Sets the associated layout. + \membersection{cbUpdatesManagerBase::UpdateNow}\label{cbupdatesmanagerbaseupdatenow} \func{void}{UpdateNow}{\void} -refreshes parts of the frame layout, which need an update +Refreshes parts of the frame layout that need an update. diff --git a/contrib/docs/latex/fl/classes.tex b/contrib/docs/latex/fl/classes.tex index 14d6ec003b..b6a6283310 100644 --- a/contrib/docs/latex/fl/classes.tex +++ b/contrib/docs/latex/fl/classes.tex @@ -34,9 +34,9 @@ \input cbfinishdrawinareaevent.tex \input cbfloatedbarwindow.tex \input cbgcupdatesmgr.tex -\input cbhiddenbarinfo.tex +%\input cbhiddenbarinfo.tex \input cbhintanimationplugin.tex -\input cbhintanimtimer.tex +%\input cbhintanimtimer.tex \input cbinsertbarevent.tex \input cblayoutrowevent.tex \input cblayoutrowsevent.tex @@ -67,11 +67,10 @@ \input dyntoolinfo.tex \input framelayout.tex \input framemanager.tex -\input frameview.tex +%\input frameview.tex \input garbagecollector.tex -\input gcitem.tex \input layoutmanagerbase.tex -\input morphinfot.tex +%\input morphinfot.tex \input newbitmapbutton.tex \input toollayoutitem.tex \input toolwindow.tex diff --git a/contrib/docs/latex/fl/dynamictoolbar.tex b/contrib/docs/latex/fl/dynamictoolbar.tex index 4b0438e6e0..5767281260 100644 --- a/contrib/docs/latex/fl/dynamictoolbar.tex +++ b/contrib/docs/latex/fl/dynamictoolbar.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% dyntbar.h at 05/Jan/02 22:50:56 +% dyntbar.h at 21/Jan/02 21:14:18 % \section{\class{wxDynamicToolBar}}\label{wxdynamictoolbar} -class manages containment and layouting of tool-windows +wxDynamicToolBar manages containment and layout of tool windows. \wxheading{Derived from} \helpref{wxToolBarBase}{wxtoolbarbase} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,164 +26,202 @@ class manages containment and layouting of tool-windows \func{}{wxDynamicToolBar}{\void} +Default constructor. + \func{}{wxDynamicToolBar}{\param{wxWindow* }{parent}, \param{const wxWindowID }{id}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{const long }{style = wxNO\_BORDER}, \param{const int }{orientation = wxVERTICAL}, \param{const int }{RowsOrColumns = 1}, \param{const wxString\& }{name = wxToolBarNameStr}} +Constructor: see the documentation for wxToolBar for details. + \membersection{wxDynamicToolBar::\destruct{wxDynamicToolBar}}\label{wxdynamictoolbardtor} \func{}{\destruct{wxDynamicToolBar}}{\void} +Destructor. + \membersection{wxDynamicToolBar::AddSeparator}\label{wxdynamictoolbaraddseparator} \func{void}{AddSeparator}{\param{wxWindow* }{pSepartorWnd = NULL}} +Adds a separator. See the documentation for wxToolBar for details. + \membersection{wxDynamicToolBar::AddTool}\label{wxdynamictoolbaraddtool} \func{void}{AddTool}{\param{int }{toolIndex}, \param{wxWindow* }{pToolWindow}, \param{const wxSize\& }{size = wxDefaultSize}} -overridables +Adds a tool. See the documentation for wxToolBar for details. \func{void}{AddTool}{\param{int }{toolIndex}, \param{const wxString\& }{imageFileName}, \param{wxBitmapType }{imageFileType = wxBITMAP\_TYPE\_BMP}, \param{const wxString\& }{labelText = ""}, \param{bool }{alignTextRight = FALSE}, \param{bool }{isFlat = TRUE}} +Adds a tool. See the documentation for wxToolBar for details. + \func{void}{AddTool}{\param{int }{toolIndex}, \param{wxBitmap }{labelBmp}, \param{const wxString\& }{labelText = ""}, \param{bool }{alignTextRight = FALSE}, \param{bool }{isFlat = TRUE}} +Adds a tool. See the documentation for wxToolBar for details. + \func{wxToolBarToolBase*}{AddTool}{\param{const int }{toolIndex}, \param{const wxBitmap\& }{bitmap}, \param{const wxBitmap\& }{pushedBitmap = wxNullBitmap}, \param{const bool }{toggle = FALSE}, \param{const long }{xPos = -1}, \param{const long }{yPos = -1}, \param{wxObject* }{clientData = NULL}, \param{const wxString\& }{helpString1 = ""}, \param{const wxString\& }{helpString2 = ""}} -method from wxToolBarBase (for compatibility), only -first two arguments are valid +Method from wxToolBarBase (for compatibility), only +the first two arguments are valid. +See the documentation for wxToolBar for details. \membersection{wxDynamicToolBar::Create}\label{wxdynamictoolbarcreate} \func{bool}{Create}{\param{wxWindow* }{parent}, \param{const wxWindowID }{id}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{const long }{style = wxNO\_BORDER}, \param{const int }{orientation = wxVERTICAL}, \param{const int }{RowsOrColumns = 1}, \param{const wxString\& }{name = wxToolBarNameStr}} +Creation function: see the documentation for wxToolBar for details. + + +\membersection{wxDynamicToolBar::CreateDefaultLayout}\label{wxdynamictoolbarcreatedefaultlayout} -\membersection{wxDynamicToolBar::CreateDefaulLayout}\label{wxdynamictoolbarcreatedefaullayout} +\func{LayoutManagerBase*}{CreateDefaultLayout}{\void} -\func{LayoutManagerBase*}{CreateDefaulLayout}{\void} +Creates the default layout (BagLayout). \membersection{wxDynamicToolBar::CreateTool}\label{wxdynamictoolbarcreatetool} \func{wxToolBarToolBase*}{CreateTool}{\param{wxControl* }{control}} +Creates a toolbar tool. + \func{wxToolBarToolBase*}{CreateTool}{\param{int }{id}, \param{const wxBitmap\& }{bitmap1}, \param{const wxBitmap\& }{bitmap2}, \param{bool }{toggle}, \param{wxObject* }{clientData}, \param{const wxString\& }{shortHelpString}, \param{const wxString\& }{longHelpString}} -the functions to create toolbar tools +Creates a toolbar tool. \membersection{wxDynamicToolBar::DoDeleteTool}\label{wxdynamictoolbardodeletetool} \func{bool}{DoDeleteTool}{\param{size\_t }{pos}, \param{wxToolBarToolBase* }{tool}} -the tool is still in m\_tools list when this function is called, it will -only be deleted from it if it succeeds +Deletes a tool. The tool is still in m\_tools list when this function is called, and it will +only be deleted from it if it succeeds. \membersection{wxDynamicToolBar::DoEnableTool}\label{wxdynamictoolbardoenabletool} \func{void}{DoEnableTool}{\param{wxToolBarToolBase* }{tool}, \param{bool }{enable}} -called when the tools enabled flag changes +Called when the tools enabled flag changes. \membersection{wxDynamicToolBar::DoInsertTool}\label{wxdynamictoolbardoinserttool} \func{bool}{DoInsertTool}{\param{size\_t }{pos}, \param{wxToolBarToolBase* }{tool}} +Inserts a tool at the given position. + \membersection{wxDynamicToolBar::DoSetToggle}\label{wxdynamictoolbardosettoggle} \func{void}{DoSetToggle}{\param{wxToolBarToolBase* }{tool}, \param{bool }{toggle}} -called when the tools "can be toggled" flag changes +Called when the tools 'can be toggled' flag changes. \membersection{wxDynamicToolBar::DoToggleTool}\label{wxdynamictoolbardotoggletool} \func{void}{DoToggleTool}{\param{wxToolBarToolBase* }{tool}, \param{bool }{toggle}} -called when the tool is toggled +Called when the tool is toggled. \membersection{wxDynamicToolBar::DrawSeparator}\label{wxdynamictoolbardrawseparator} \func{void}{DrawSeparator}{\param{wxDynToolInfo\& }{info}, \param{wxDC\& }{dc}} -the default implementation draws shaded line +Draws a separator. The default implementation draws a shaded line. \membersection{wxDynamicToolBar::EnableTool}\label{wxdynamictoolbarenabletool} \func{void}{EnableTool}{\param{const int }{toolIndex}, \param{const bool }{enable = TRUE}} +Enables or disables the given tool. + \membersection{wxDynamicToolBar::FindToolForPosition}\label{wxdynamictoolbarfindtoolforposition} \constfunc{wxToolBarToolBase*}{FindToolForPosition}{\param{wxCoord }{x}, \param{wxCoord }{y}} -stuff from the 2.1.15 +Finds a tool for the given position. \membersection{wxDynamicToolBar::GetPreferredDim}\label{wxdynamictoolbargetpreferreddim} \func{void}{GetPreferredDim}{\param{const wxSize\& }{givenDim}, \param{wxSize\& }{prefDim}} +Returns the preferred dimension, taking the given dimension and a reference to the result. + \membersection{wxDynamicToolBar::GetToolInfo}\label{wxdynamictoolbargettoolinfo} \func{wxDynToolInfo*}{GetToolInfo}{\param{int }{toolIndex}} +Returns tool information for the given tool index. + \membersection{wxDynamicToolBar::Layout}\label{wxdynamictoolbarlayout} \func{bool}{Layout}{\void} -see definitions of orientation types +Performs layout. See definitions of orientation types. \membersection{wxDynamicToolBar::OnEraseBackground}\label{wxdynamictoolbaronerasebackground} \func{void}{OnEraseBackground}{\param{wxEraseEvent\& }{event}} +Responds to background erase events. Currently does nothing. + \membersection{wxDynamicToolBar::OnPaint}\label{wxdynamictoolbaronpaint} \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}} +Responds to paint events, drawing separators. + \membersection{wxDynamicToolBar::OnSize}\label{wxdynamictoolbaronsize} \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} -event handlers +Responds to size events, calling Layout. \membersection{wxDynamicToolBar::Realize}\label{wxdynamictoolbarrealize} \func{bool}{Realize}{\void} -overriden from wxToolBarBase +Overriden from wxToolBarBase; does nothing. \membersection{wxDynamicToolBar::RemveTool}\label{wxdynamictoolbarremvetool} \func{void}{RemveTool}{\param{int }{toolIndex}} +Removes the given tool. Misspelt in order not to clash with a similar function +in the base class. + \membersection{wxDynamicToolBar::SetLayout}\label{wxdynamictoolbarsetlayout} \func{void}{SetLayout}{\param{LayoutManagerBase* }{pLayout}} +Sets the layout for this toolbar. + \membersection{wxDynamicToolBar::SizeToolWindows}\label{wxdynamictoolbarsizetoolwindows} \func{void}{SizeToolWindows}{\void} +Internal function for sizing tool windows. + diff --git a/contrib/docs/latex/fl/dyntoolinfo.tex b/contrib/docs/latex/fl/dyntoolinfo.tex index 8faf4b561a..99deb6c10b 100644 --- a/contrib/docs/latex/fl/dyntoolinfo.tex +++ b/contrib/docs/latex/fl/dyntoolinfo.tex @@ -1,14 +1,21 @@ % % automatically generated by HelpGen $Revision$ from -% dyntbar.h at 05/Jan/02 22:50:56 +% dyntbar.h at 21/Jan/02 21:14:18 % \section{\class{wxDynToolInfo}}\label{wxdyntoolinfo} + +This class holds dynamic toolbar item information. + \wxheading{Derived from} \helpref{wxToolLayoutItem}{wxtoollayoutitem} +\wxheading{Include files} + + + \wxheading{Data structures} diff --git a/contrib/docs/latex/fl/framelayout.tex b/contrib/docs/latex/fl/framelayout.tex index ce8e1aaa1c..8be3975b57 100644 --- a/contrib/docs/latex/fl/framelayout.tex +++ b/contrib/docs/latex/fl/framelayout.tex @@ -1,20 +1,24 @@ % % automatically generated by HelpGen $Revision$ from -% controlbar.h at 05/Jan/02 22:50:58 +% controlbar.h at 21/Jan/02 21:14:13 % \section{\class{wxFrameLayout}}\label{wxframelayout} -wxFrameLayout manages containment and docking of control bars. - which can be docked along top, bottom, righ, or left side of the - parent frame - +wxFrameLayout manages containment and docking of control bars, +which can be docked along the top, bottom, right, or left side of the +parent frame. + \wxheading{Derived from} \helpref{wxEvtHandler}{wxevthandler} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -24,160 +28,188 @@ wxFrameLayout manages containment and docking of control bars. \func{}{wxFrameLayout}{\param{wxWindow* }{pParentFrame}, \param{wxWindow* }{pFrameClient = NULL}, \param{bool }{activateNow = TRUE}} +Constructor, taking parent window, the (MDI) client of the parent if there +is one, and flag specifying whether to activate the layout. + \func{}{wxFrameLayout}{\void} -used only while serializing +Default constructor, used only for serialization. \membersection{wxFrameLayout::\destruct{wxFrameLayout}}\label{wxframelayoutdtor} \func{}{\destruct{wxFrameLayout}}{\void} -(doesn't destroy bar windows) +Destructor. It does not destroy the bar windows. \membersection{wxFrameLayout::Activate}\label{wxframelayoutactivate} \func{void}{Activate}{\void} -Can be called after some other layout has been deactivated, -and this one must "take over" the current contents of frame window. -Effectively hooks itself to the frame window, re-displays all not-hidden -bar-windows and repaints decorations +Activate can be called after some other layout has been deactivated, +and this one must take over the current contents of the frame window. +Effectively hooks itself to the frame window, re-displays all non-hidden +bar windows and repaints the decorations. \membersection{wxFrameLayout::AddBar}\label{wxframelayoutaddbar} \func{void}{AddBar}{\param{wxWindow* }{pBarWnd}, \param{const cbDimInfo\& }{dimInfo}, \param{int }{alignment = FL\_ALIGN\_TOP}, \param{int }{rowNo = 0}, \param{int }{columnPos = 0}, \param{const wxString\& }{name = "bar"}, \param{bool }{spyEvents = FALSE}, \param{int }{state = wxCBAR\_DOCKED\_HORIZONTALLY}} -Adds bar information to frame-layout, appearence of layout is not refreshed -immediately, RefreshNow() can be called if necessary. -NOTES:: argument pBarWnd can by NULL, resulting bar decorations to be drawn +Adds bar information to the frame layout. The appearance of the layout is not refreshed +immediately; RefreshNow() can be called if necessary. +Notes: the argument pBarWnd can by NULL, resulting in bar decorations to be drawn around the empty rectangle (filled with default background colour). -Argument dimInfo, can be re-used for adding any number of bars, since -it is not used directly, instead it's members are copied. If dimensions- -handler is present, it's instance shared (reference counted). Dimension -handler should always be allocated on the heap!) +Argument dimInfo can be reused for adding any number of bars, since +it is not used directly - instead its members are copied. If the dimensions +handler is present, its instance is shared (reference counted). The dimension +handler should always be allocated on the heap. +pBarWnd is the window to be managed. +dimInfo contains dimension information. +alignment is a value such as FL\_ALIGN\_TOP. +rowNo is the vertical position or row in the pane (if in docked state). +columnPos is the horizontal position within the row in pixels (if in docked state). +name is a name by which the bar can be referred in layout customization dialogs. +If spyEvents is TRUE, input events for the bar should be "spyed" in order +to forward unhandled mouse clicks to the frame layout, for example to enable +easy draggablity of toolbars just by clicking on their interior regions. +For widgets like text/tree control this value should be FALSE, +since there's no certain way to detect whether the event was actually handled. +state is the initial state, such as wxCBAR\_DOCKED\_HORIZONTALLY, +wxCBAR\_FLOATING, wxCBAR\_HIDDEN. \membersection{wxFrameLayout::AddPlugin}\label{wxframelayoutaddplugin} \func{void}{AddPlugin}{\param{wxClassInfo* }{pPlInfo}, \param{int }{paneMask = wxALL\_PANES}} -"Advanced" methods for plugin-configuration using their dynamic class information (e.g. CLASSINFO(pluginClass) ) first checks if plugin of the given class is already "hooked up", -if not, adds it to the top of plugins chain +An advanced methods for plugin configuration using their +dynamic class information, for example CLASSINFO(pluginClass). +First checks if the plugin of the given class is already "hooked up". +If not, adds it to the top of the plugins chain. \membersection{wxFrameLayout::AddPluginBefore}\label{wxframelayoutaddpluginbefore} \func{void}{AddPluginBefore}{\param{wxClassInfo* }{pNextPlInfo}, \param{wxClassInfo* }{pPlInfo}, \param{int }{paneMask = wxALL\_PANES}} -first checks if plugin of the givne class already hooked, -if so, removes it, and then inserts it to the chain -before plugin of the class given by "pNextPlInfo" -NOTE:: this method is "handy" in some cases, where the order -of plugin-chain could be important, e.g. one plugin overrides -some functionallity of the other already hooked plugin, -thefore the former should be hooked before the one -who's functionality is being overriden +First checks if the plugin of the given class is already hooked. +If so, removes it, and then inserts it into the chain +before the plugin of the class given by pNextPlInfo. +Note: this method is handy in some cases where the order +of the plugin-chain could be important, for example when one plugin overrides +some functionality of another already-hooked plugin, +so that the former plugin should be hooked before the one +whose functionality is being overridden. \membersection{wxFrameLayout::ApplyBarProperties}\label{wxframelayoutapplybarproperties} \func{void}{ApplyBarProperties}{\param{cbBarInfo* }{pBar}} -reflects changes in bar information structure visually -(e.g. moves bar, changes it's dimension info, pane to which it is docked) +Reflects changes in bar information structure visually. +For example, moves the bar, changes its dimension information, +or changes the pane to which it is docked. \membersection{wxFrameLayout::CanReparent}\label{wxframelayoutcanreparent} \func{bool}{CanReparent}{\void} -NOTE:: reparenting of windows may NOT work on all platforms -(reparenting allows control-bars to be floated) +Returns TRUE if the platform allows reparenting. This may not return TRUE +for all platforms. Reparenting allows control bars to be floated. \membersection{wxFrameLayout::CaptureEventsForPane}\label{wxframelayoutcaptureeventsforpane} \func{void}{CaptureEventsForPane}{\param{cbDockPane* }{toPane}} -called by plugins ( also captures/releases mouse in parent frame) +Called by plugins; also captures the mouse in the parent frame. \membersection{wxFrameLayout::CaptureEventsForPlugin}\label{wxframelayoutcaptureeventsforplugin} \func{void}{CaptureEventsForPlugin}{\param{cbPluginBase* }{pPlugin}} -captures/releases user-input event's for the given plugin -Input events are: mouse movement, mouse clicks, keyboard input +Captures user input events for the given plugin. +Input events are: mouse movement, mouse clicks, keyboard input. \membersection{wxFrameLayout::CreateCursors}\label{wxframelayoutcreatecursors} \func{void}{CreateCursors}{\void} +Creates the cursors. + \membersection{wxFrameLayout::CreateUpdatesManager}\label{wxframelayoutcreateupdatesmanager} \func{cbUpdatesManagerBase*}{CreateUpdatesManager}{\void} -factory method +Returns a new cbGCUpdatesMgr object. \membersection{wxFrameLayout::Deactivate}\label{wxframelayoutdeactivate} \func{void}{Deactivate}{\void} -unhooks itself from frame window, and hides all not-hidden windows -NOTE:: two frame-layouts should not be active at the same time in the -same frame window, it would cause messy overlapping of bar windows -from both layouts +Deactivate unhooks itself from frame window, and hides all non-hidden windows. +Note: two frame layouts should not be active at the same time in the +same frame window, since it would cause messy overlapping of bar windows +from both layouts. \membersection{wxFrameLayout::DestroyBarWindows}\label{wxframelayoutdestroybarwindows} \func{void}{DestroyBarWindows}{\void} +Destroys the bar windows. + \membersection{wxFrameLayout::DoSetBarState}\label{wxframelayoutdosetbarstate} \func{void}{DoSetBarState}{\param{cbBarInfo* }{pBar}} +Applies the state to the window objects. + \membersection{wxFrameLayout::EnableFloating}\label{wxframelayoutenablefloating} \func{void}{EnableFloating}{\param{bool }{enable = TRUE}} -(by default floating of control-bars is ON) +Enables floating behaviour. By default floating of control bars is on. \membersection{wxFrameLayout::FindBarByName}\label{wxframelayoutfindbarbyname} \func{cbBarInfo*}{FindBarByName}{\param{const wxString\& }{name}} -methods for access and modification of bars in frame layout +Finds the bar in the framelayout, by name. \membersection{wxFrameLayout::FindBarByWindow}\label{wxframelayoutfindbarbywindow} \func{cbBarInfo*}{FindBarByWindow}{\param{const wxWindow* }{pWnd}} +Finds the bar in the framelayout, by window. + \membersection{wxFrameLayout::FindPlugin}\label{wxframelayoutfindplugin} \func{cbPluginBase*}{FindPlugin}{\param{wxClassInfo* }{pPlInfo}} -returns NULL, if plugin of the given class is not hooked +Finds a plugin with the given class, or returns NULL if a plugin of the given +class is not hooked. \membersection{wxFrameLayout::FirePluginEvent}\label{wxframelayoutfirepluginevent} \func{void}{FirePluginEvent}{\param{cbPluginEvent\& }{event}} -plugin-related methods **should be used, instead of passing the event to ProcessEvent(..) method -of the top-plugin directly. This method checks if events are currently +This function should be used instead of passing the event to the ProcessEvent method +of the top-level plugin directly. This method checks if events are currently captured and ensures that plugin-event is routed correctly. @@ -185,361 +217,439 @@ captured and ensures that plugin-event is routed correctly. \func{void}{ForwardMouseEvent}{\param{wxMouseEvent\& }{event}, \param{cbDockPane* }{pToPane}, \param{int }{eventType}} -delegated from "bar-spy" +Delegated from "bar-spy". \membersection{wxFrameLayout::GetBarPane}\label{wxframelayoutgetbarpane} \func{cbDockPane*}{GetBarPane}{\param{cbBarInfo* }{pBar}} -returns panes, to which the given bar belongs +Returns the pane to which the given bar belongs. \membersection{wxFrameLayout::GetBars}\label{wxframelayoutgetbars} \func{BarArrayT\&}{GetBars}{\void} +Gets an array of bars. + \membersection{wxFrameLayout::GetClientHeight}\label{wxframelayoutgetclientheight} \func{int}{GetClientHeight}{\void} +Returns the client height. + \membersection{wxFrameLayout::GetClientRect}\label{wxframelayoutgetclientrect} \func{wxRect\&}{GetClientRect}{\void} +Returns the client's rectangle. + \membersection{wxFrameLayout::GetClientWidth}\label{wxframelayoutgetclientwidth} \func{int}{GetClientWidth}{\void} +Returns the client width. + \membersection{wxFrameLayout::GetFrameClient}\label{wxframelayoutgetframeclient} \func{wxWindow*}{GetFrameClient}{\void} +Returns the frame client, or NULL if not present. + \membersection{wxFrameLayout::GetPane}\label{wxframelayoutgetpane} \func{cbDockPane*}{GetPane}{\param{int }{alignment}} -see pane alignment types +Returns a pane for the given alignment. See pane alignment types. \membersection{wxFrameLayout::GetPaneProperties}\label{wxframelayoutgetpaneproperties} \func{void}{GetPaneProperties}{\param{cbCommonPaneProperties\& }{props}, \param{int }{alignment = FL\_ALIGN\_TOP}} -NOTE:: changing properties of panes, does not result immediate on-screen update +Gets the pane properties for the given alignment. \membersection{wxFrameLayout::GetPanesArray}\label{wxframelayoutgetpanesarray} \func{cbDockPane**}{GetPanesArray}{\void} -used by updates-managers +Returns an array of panes. Used by update managers. \membersection{wxFrameLayout::GetParentFrame}\label{wxframelayoutgetparentframe} \func{wxWindow\&}{GetParentFrame}{\void} +Returns the parent frame. + \membersection{wxFrameLayout::GetPrevClientRect}\label{wxframelayoutgetprevclientrect} \func{wxRect\&}{GetPrevClientRect}{\void} +Returns the previous client window rectangle. + \membersection{wxFrameLayout::GetTopPlugin}\label{wxframelayoutgettopplugin} \func{cbPluginBase\&}{GetTopPlugin}{\void} -returns current top-level plugin (the one which receives events first, -with an exception if input-events are currently captured by some other plugin) +Returns the current top-level plugin (the one that receives events first, +except if input events are currently captured by some other plugin). \membersection{wxFrameLayout::GetUpdatesManager}\label{wxframelayoutgetupdatesmanager} \func{cbUpdatesManagerBase\&}{GetUpdatesManager}{\void} -NOTE:: in future ubdates-manager will become a normal plugin +Returns a reference to the updates manager. +Note: in future, the updates manager will become a normal plugin. \membersection{wxFrameLayout::HasTopPlugin}\label{wxframelayouthastopplugin} \func{bool}{HasTopPlugin}{\void} +Returns true if there is a top plugin. + \membersection{wxFrameLayout::HideBarWindows}\label{wxframelayouthidebarwindows} \func{void}{HideBarWindows}{\void} -also hides the client window if presents +Hides the bar windows, and also the client window if present. \membersection{wxFrameLayout::HitTestPane}\label{wxframelayouthittestpane} \func{bool}{HitTestPane}{\param{cbDockPane* }{pPane}, \param{int }{x}, \param{int }{y}} +Returns TRUE if the position is within the given pane. + \membersection{wxFrameLayout::HitTestPanes}\label{wxframelayouthittestpanes} \func{cbDockPane*}{HitTestPanes}{\param{const wxRect\& }{rect}, \param{cbDockPane* }{pCurPane}} +Returns the pane for which the rectangle hit test succeeds, giving +preference to the given pane if supplied. + \membersection{wxFrameLayout::HookUpToFrame}\label{wxframelayouthookuptoframe} \func{void}{HookUpToFrame}{\void} +Hooks the layout up to the frame (pushes the layout onto the +frame's event handler stack). + \membersection{wxFrameLayout::InverseVisibility}\label{wxframelayoutinversevisibility} \func{void}{InverseVisibility}{\param{cbBarInfo* }{pBar}} +Toggles the bar between visible and hidden. + \membersection{wxFrameLayout::LocateBar}\label{wxframelayoutlocatebar} \func{bool}{LocateBar}{\param{cbBarInfo* }{pBarInfo}, \param{cbRowInfo** }{ppRow}, \param{cbDockPane** }{ppPane}} +The purpose of this function is unknown. + \membersection{wxFrameLayout::OnActivate}\label{wxframelayoutonactivate} \func{void}{OnActivate}{\param{wxActivateEvent\& }{event}} +Handles activation events. Currently does nothing. + \membersection{wxFrameLayout::OnEraseBackground}\label{wxframelayoutonerasebackground} \func{void}{OnEraseBackground}{\param{wxEraseEvent\& }{event}} +Handles background erase events. Currently does nothing. + \membersection{wxFrameLayout::OnIdle}\label{wxframelayoutonidle} \func{void}{OnIdle}{\param{wxIdleEvent\& }{event}} +Handles idle events. + \membersection{wxFrameLayout::OnKillFocus}\label{wxframelayoutonkillfocus} \func{void}{OnKillFocus}{\param{wxFocusEvent\& }{event}} +Handles focus kill events. Currently does nothing. + \membersection{wxFrameLayout::OnLButtonDown}\label{wxframelayoutonlbuttondown} \func{void}{OnLButtonDown}{\param{wxMouseEvent\& }{event}} +Event handler for a left down button event. + \membersection{wxFrameLayout::OnLButtonUp}\label{wxframelayoutonlbuttonup} \func{void}{OnLButtonUp}{\param{wxMouseEvent\& }{event}} +Event handler for a left button up event. + \membersection{wxFrameLayout::OnLDblClick}\label{wxframelayoutonldblclick} \func{void}{OnLDblClick}{\param{wxMouseEvent\& }{event}} +Event handler for a left doubleclick button event. + \membersection{wxFrameLayout::OnMouseMove}\label{wxframelayoutonmousemove} \func{void}{OnMouseMove}{\param{wxMouseEvent\& }{event}} +Event handler for a mouse move event. + \membersection{wxFrameLayout::OnPaint}\label{wxframelayoutonpaint} \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}} +Handles paint events, calling PaintPane for each pane. + \membersection{wxFrameLayout::OnRButtonDown}\label{wxframelayoutonrbuttondown} \func{void}{OnRButtonDown}{\param{wxMouseEvent\& }{event}} +Event handler for a right button down event. + \membersection{wxFrameLayout::OnRButtonUp}\label{wxframelayoutonrbuttonup} \func{void}{OnRButtonUp}{\param{wxMouseEvent\& }{event}} +Event handler for a right button up event. + \membersection{wxFrameLayout::OnSetFocus}\label{wxframelayoutonsetfocus} \func{void}{OnSetFocus}{\param{wxFocusEvent\& }{event}} +Handles focus set events. Currently does nothing. + \membersection{wxFrameLayout::OnSize}\label{wxframelayoutonsize} \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} -event handlers +Event handler for a size event. \membersection{wxFrameLayout::PopAllPlugins}\label{wxframelayoutpopallplugins} \func{void}{PopAllPlugins}{\void} +Pop all plugins. + \membersection{wxFrameLayout::PopPlugin}\label{wxframelayoutpopplugin} \func{void}{PopPlugin}{\void} +Similar to wxWindow's "push/pop-event-handler" methods, execept +that the plugin is deleted upon "popping". + \membersection{wxFrameLayout::PositionClientWindow}\label{wxframelayoutpositionclientwindow} \func{void}{PositionClientWindow}{\void} -called to set calculated layout to window objects +Called to apply the calculated layout to window objects. \membersection{wxFrameLayout::PositionPanes}\label{wxframelayoutpositionpanes} \func{void}{PositionPanes}{\void} +Called to apply the calculated layout to window objects. + \membersection{wxFrameLayout::PushDefaultPlugins}\label{wxframelayoutpushdefaultplugins} \func{void}{PushDefaultPlugins}{\void} -default plugins are : cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin, -cbAntiflickerPlugin, cbSimpleCustomizePlugin -this method is automatically invoked, if no plugins were found upon -fireing of the first plugin-event, i.e. wxFrameLayout *CONFIGURES* itself +Adds the default plugins. These are cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin, +cbAntiflickerPlugin, cbSimpleCustomizePlugin. +This method is automatically invoked if no plugins were found upon +firing of the first plugin-event, i.e. when wxFrameLayout configures itself. \membersection{wxFrameLayout::PushPlugin}\label{wxframelayoutpushplugin} \func{void}{PushPlugin}{\param{cbPluginBase* }{pPugin}} -similar to wxWindow's "push/pop-event-handler" methods, execept -that plugin is *deleted* upon "popping" +Similar to wxWindow's "push/pop-event-handler" methods, execept +that the plugin is deleted upon "popping". \membersection{wxFrameLayout::RecalcLayout}\label{wxframelayoutrecalclayout} \func{void}{RecalcLayout}{\param{bool }{repositionBarsNow = FALSE}} -recalcualtes layout of panes, and all bars/rows in each pane +Recalculates the layout of panes, and all bars/rows in each pane. \membersection{wxFrameLayout::RedockBar}\label{wxframelayoutredockbar} \func{bool}{RedockBar}{\param{cbBarInfo* }{pBar}, \param{const wxRect\& }{shapeInParent}, \param{cbDockPane* }{pToPane = NULL}, \param{bool }{updateNow = TRUE}} -can be used for repositioning already existing bars. The given bar is first removed +ReddockBar can be used for repositioning existing bars. The given bar is first removed from the pane it currently belongs to, and inserted into the pane, which "matches" -the given recantular area. If pToPane is not NULL, bar is docked to this given pane -to dock the bar which is floated, use wxFrameLayout::DockBar(..) method +the given rectangular area. If pToPane is not NULL, the bar is docked to this given pane. +To dock a bar which is floating, use the wxFrameLayout::DockBar method. \membersection{wxFrameLayout::RefreshNow}\label{wxframelayoutrefreshnow} \func{void}{RefreshNow}{\param{bool }{recalcLayout = TRUE}} -recalculates layoute and performs on-screen update of all panes +Recalculates layout and performs on-screen update of all panes. \membersection{wxFrameLayout::ReleaseEventsFromPane}\label{wxframelayoutreleaseeventsfrompane} \func{void}{ReleaseEventsFromPane}{\param{cbDockPane* }{fromPane}} +Called by plugins; also releases mouse in the parent frame. + \membersection{wxFrameLayout::ReleaseEventsFromPlugin}\label{wxframelayoutreleaseeventsfromplugin} \func{void}{ReleaseEventsFromPlugin}{\param{cbPluginBase* }{pPlugin}} +Releases user input events for the given plugin. +Input events are: mouse movement, mouse clicks, keyboard input + \membersection{wxFrameLayout::RemoveBar}\label{wxframelayoutremovebar} \func{void}{RemoveBar}{\param{cbBarInfo* }{pBar}} -removes bar from layout permanently, hides it's corresponding window if present +Removes the bar from the layout permanently, and hides its corresponding window if present. \membersection{wxFrameLayout::RemovePlugin}\label{wxframelayoutremoveplugin} \func{void}{RemovePlugin}{\param{wxClassInfo* }{pPlInfo}} -checks if plugin of the given class is hooked, removes -it if found -@param pPlInfo class information structure for the plugin -@note -@see wxFrameLayout::Method +Checks if the plugin of the given class is hooked, and removes +it if found. \membersection{wxFrameLayout::ReparentWindow}\label{wxframelayoutreparentwindow} \func{void}{ReparentWindow}{\param{wxWindow* }{pChild}, \param{wxWindow* }{pNewParent}} +Reparents pChild to have parent pNewParent. + \membersection{wxFrameLayout::RepositionFloatedBar}\label{wxframelayoutrepositionfloatedbar} \func{void}{RepositionFloatedBar}{\param{cbBarInfo* }{pBar}} +Applies the calculated layout to a floating bar. + \membersection{wxFrameLayout::RouteMouseEvent}\label{wxframelayoutroutemouseevent} \func{void}{RouteMouseEvent}{\param{wxMouseEvent\& }{event}, \param{int }{pluginEvtType}} +Routes the mouse event to the appropriate pane. + \membersection{wxFrameLayout::SetBarState}\label{wxframelayoutsetbarstate} \func{void}{SetBarState}{\param{cbBarInfo* }{pBar}, \param{int }{newStatem}, \param{bool }{updateNow}} -changes bar's docking state (see possible control bar states) +Changes the bar's docking state (see possible control bar states). \membersection{wxFrameLayout::SetFrameClient}\label{wxframelayoutsetframeclient} \func{void}{SetFrameClient}{\param{wxWindow* }{pFrameClient}} -passes the client window (e.g. MDI-client frame) to be controled by +Passes the client window (e.g. MDI client window) to be controlled by frame layout, the size and position of which should be adjusted to be -surrounded by controlbar panes, whenever frame is resized, or dimensions -of control panes change +surrounded by controlbar panes, whenever the frame is resized or the dimensions +of control panes change. \membersection{wxFrameLayout::SetMargins}\label{wxframelayoutsetmargins} \func{void}{SetMargins}{\param{int }{top}, \param{int }{bottom}, \param{int }{left}, \param{int }{right}, \param{int }{paneMask = wxALL\_PANES}} -TODO:: margins should go into cbCommonPaneProperties in the future -NOTE:: this method should be called before any custom plugins are attached +Sets the margins for the given panes. +The margins should go into cbCommonPaneProperties in the future. +Note: this method should be called before any custom plugins are attached. \membersection{wxFrameLayout::SetPaneBackground}\label{wxframelayoutsetpanebackground} \func{void}{SetPaneBackground}{\param{const wxColour\& }{colour}} +Sets the pane background colour. + \membersection{wxFrameLayout::SetPaneProperties}\label{wxframelayoutsetpaneproperties} \func{void}{SetPaneProperties}{\param{const cbCommonPaneProperties\& }{props}, \param{int }{paneMask = wxALL\_PANES}} +Sets the pane properties for the given alignment. +Note: changing properties of panes does not result immediate on-screen update. + \membersection{wxFrameLayout::SetTopPlugin}\label{wxframelayoutsettopplugin} \func{void}{SetTopPlugin}{\param{cbPluginBase* }{pPlugin}} -hooking custom plugins to frame layout -NOTE:: when hooking one plugin on top of the other - -use SetNextHandler(..) or similar methods +Hooking custom plugins to frame layout. +Note: when hooking one plugin on top of the other, +use SetNextHandler or similar methods of wxEvtHandler class to compose the chain of plugins, than pass the left-most handler in this chain to the above methods (assuming that events are delegated -from left-most towards right-most handler) -NOTE2:: this secenario is very inconvenient and "low-level", -use Add/Push/PopPlugin methods instead +from left-most towards right-most handler). +This secenario is very inconvenient and "low-level", +so use the Add/Push/PopPlugin methods instead. \membersection{wxFrameLayout::SetUpdatesManager}\label{wxframelayoutsetupdatesmanager} \func{void}{SetUpdatesManager}{\param{cbUpdatesManagerBase* }{pUMgr}} -destroys the previous manager if any, set the new one +Destroys the previous manager if any, and sets the new one. \membersection{wxFrameLayout::ShowFloatedWindows}\label{wxframelayoutshowfloatedwindows} \func{void}{ShowFloatedWindows}{\param{bool }{show}} +Shows all floated windows. + \membersection{wxFrameLayout::UnhookFromFrame}\label{wxframelayoutunhookfromframe} \func{void}{UnhookFromFrame}{\void} +Unhooks the layout from the frame. + diff --git a/contrib/docs/latex/fl/garbagecollector.tex b/contrib/docs/latex/fl/garbagecollector.tex index 2f851e4375..71f31dfdb2 100644 --- a/contrib/docs/latex/fl/garbagecollector.tex +++ b/contrib/docs/latex/fl/garbagecollector.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% garbagec.h at 05/Jan/02 22:50:57 +% garbagec.h at 21/Jan/02 21:14:19 % \section{\class{GarbageCollector}}\label{garbagecollector} -class implements extremely slow, but probably one of the most simple GC algorithms +This class implements an extremely slow but simple garbage collection algorithm. \wxheading{Derived from} No base class +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,71 +26,89 @@ No base class \func{}{GarbageCollector}{\void} +Default constructor. + \membersection{GarbageCollector::\destruct{GarbageCollector}}\label{garbagecollectordtor} \func{}{\destruct{GarbageCollector}}{\void} +Destructor. + \membersection{GarbageCollector::AddDependency}\label{garbagecollectoradddependency} \func{void}{AddDependency}{\param{void* }{pObj}, \param{void* }{pDependsOnObj}} +Prepare data for garbage collection. + \membersection{GarbageCollector::AddObject}\label{garbagecollectoraddobject} \func{void}{AddObject}{\param{void* }{pObj}, \param{int }{refCnt = 1}} -prepare data for GC alg. +Prepare data for garbage collection. \membersection{GarbageCollector::ArrangeCollection}\label{garbagecollectorarrangecollection} \func{void}{ArrangeCollection}{\void} -executes GC alg. +Executes garbage collection algorithm. \membersection{GarbageCollector::DestroyItemList}\label{garbagecollectordestroyitemlist} \func{void}{DestroyItemList}{\param{wxList\& }{lst}} +Destroys a list of items. + \membersection{GarbageCollector::FindItemNode}\label{garbagecollectorfinditemnode} \func{wxNode*}{FindItemNode}{\param{void* }{pForObj}} +Internal method for finding a node. + \membersection{GarbageCollector::FindReferenceFreeItemNode}\label{garbagecollectorfindreferencefreeitemnode} \func{wxNode*}{FindReferenceFreeItemNode}{\void} +Internal method for findind and freeing a node. + \membersection{GarbageCollector::GetCycledObjects}\label{garbagecollectorgetcycledobjects} \func{wxList\&}{GetCycledObjects}{\void} +Get cycled objects. + \membersection{GarbageCollector::GetRegularObjects}\label{garbagecollectorgetregularobjects} \func{wxList\&}{GetRegularObjects}{\void} -access results of the alg. +Accesses the results of the algorithm. \membersection{GarbageCollector::RemoveReferencesToNode}\label{garbagecollectorremovereferencestonode} \func{void}{RemoveReferencesToNode}{\param{wxNode* }{pItemNode}} +Remove references to this node. + \membersection{GarbageCollector::Reset}\label{garbagecollectorreset} \func{void}{Reset}{\void} -removes all data from GC +Removes all data from the garbage collector. \membersection{GarbageCollector::ResolveReferences}\label{garbagecollectorresolvereferences} \func{void}{ResolveReferences}{\void} +Internal method for resolving references. + diff --git a/contrib/docs/latex/fl/gcitem.tex b/contrib/docs/latex/fl/gcitem.tex index 633d9daac1..6e24a96f74 100644 --- a/contrib/docs/latex/fl/gcitem.tex +++ b/contrib/docs/latex/fl/gcitem.tex @@ -1,6 +1,6 @@ % % automatically generated by HelpGen $Revision$ from -% garbagec.h at 05/Jan/02 22:50:57 +% garbagec.h at 21/Jan/02 21:14:19 % @@ -10,5 +10,9 @@ No base class +\wxheading{Include files} + + + \wxheading{Data structures} diff --git a/contrib/docs/latex/fl/layoutmanagerbase.tex b/contrib/docs/latex/fl/layoutmanagerbase.tex index 65fd6ea7b0..9c99450260 100644 --- a/contrib/docs/latex/fl/layoutmanagerbase.tex +++ b/contrib/docs/latex/fl/layoutmanagerbase.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% dyntbar.h at 05/Jan/02 22:50:56 +% dyntbar.h at 21/Jan/02 21:14:18 % \section{\class{LayoutManagerBase}}\label{layoutmanagerbase} -base class for layouting algorithm implementations +This is a base class for layout algorithm implementations. \wxheading{Derived from} No base class +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,8 +26,12 @@ No base class \func{}{\destruct{LayoutManagerBase}}{\void} +Destructor. + \membersection{LayoutManagerBase::Layout}\label{layoutmanagerbaselayout} \func{void}{Layout}{\param{const wxSize\& }{parentDim}, \param{wxSize\& }{resultingDim}, \param{wxLayoutItemArrayT\& }{items}, \param{int }{horizGap}, \param{int }{vertGap}} +Constructor. + diff --git a/contrib/docs/latex/fl/makefile.vc b/contrib/docs/latex/fl/makefile.vc index 3a06374fb1..eabac7bd2f 100644 --- a/contrib/docs/latex/fl/makefile.vc +++ b/contrib/docs/latex/fl/makefile.vc @@ -85,7 +85,7 @@ $(DOCDIR)\htb\fl.htb: $(DOCDIR)\html\fl\fl.htm # In order to force document reprocessing touchmanual: - -touch $(WXDIR)\docs\latex\fl\manual.tex + -touch $(WXDIR)\contrib\docs\latex\fl\manual.tex updatedocs: touchmanual alldocs diff --git a/contrib/docs/latex/fl/morphinfot.tex b/contrib/docs/latex/fl/morphinfot.tex index 8f3ca3c89c..2b84131b7a 100644 --- a/contrib/docs/latex/fl/morphinfot.tex +++ b/contrib/docs/latex/fl/morphinfot.tex @@ -1,17 +1,21 @@ % % automatically generated by HelpGen $Revision$ from -% hintanimpl.h at 05/Jan/02 22:50:57 +% hintanimpl.h at 21/Jan/02 21:14:19 % \section{\class{MorphInfoT}}\label{morphinfot} -helper classes +A private helper class. \wxheading{Derived from} No base class +\wxheading{Include files} + + + \wxheading{Data structures} diff --git a/contrib/docs/latex/fl/newbitmapbutton.tex b/contrib/docs/latex/fl/newbitmapbutton.tex index ba7282490d..43c2b48762 100644 --- a/contrib/docs/latex/fl/newbitmapbutton.tex +++ b/contrib/docs/latex/fl/newbitmapbutton.tex @@ -1,18 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% newbmpbtn.h at 05/Jan/02 22:50:57 +% newbmpbtn.h at 21/Jan/02 21:14:19 % \section{\class{wxNewBitmapButton}}\label{wxnewbitmapbutton} -alternative class for wxBmpButton +This is an alternative class to wxBitmapButton. It is used +in the implementation of dynamic toolbars. \wxheading{Derived from} \helpref{wxPanel}{wxpanel} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -22,116 +27,151 @@ alternative class for wxBmpButton \func{}{wxNewBitmapButton}{\param{const wxBitmap\& }{labelBitmap = wxNullBitmap}, \param{const wxString\& }{labelText = ""}, \param{int }{alignText = NB\_ALIGN\_TEXT\_BOTTOM}, \param{bool }{isFlat = TRUE}, \param{int }{firedEventType = wxEVT\_COMMAND\_MENU\_SELECTED}, \param{int }{marginX = 2}, \param{int }{marginY = 2}, \param{int }{textToLabelGap = 2}, \param{bool }{isSticky = FALSE}} +Constructor. + \func{}{wxNewBitmapButton}{\param{const wxString\& }{bitmapFileName}, \param{const wxBitmapType }{bitmapFileType = wxBITMAP\_TYPE\_BMP}, \param{const wxString\& }{labelText = ""}, \param{int }{alignText = NB\_ALIGN\_TEXT\_BOTTOM}, \param{bool }{isFlat = TRUE}, \param{int }{firedEventType = wxEVT\_COMMAND\_MENU\_SELECTED}, \param{int }{marginX = 2}, \param{int }{marginY = 2}, \param{int }{textToLabelGap = 2}, \param{bool }{isSticky = FALSE}} -use this constructor if buttons have to be persistant +Use this constructor if buttons have to be persistant \membersection{wxNewBitmapButton::\destruct{wxNewBitmapButton}}\label{wxnewbitmapbuttondtor} \func{}{\destruct{wxNewBitmapButton}}{\void} +Destructor. + \membersection{wxNewBitmapButton::DestroyLabels}\label{wxnewbitmapbuttondestroylabels} \func{void}{DestroyLabels}{\void} +Internal function for destroying labels. + \membersection{wxNewBitmapButton::DrawDecorations}\label{wxnewbitmapbuttondrawdecorations} \func{void}{DrawDecorations}{\param{wxDC\& }{dc}} +Draws the decorations. + \membersection{wxNewBitmapButton::DrawLabel}\label{wxnewbitmapbuttondrawlabel} \func{void}{DrawLabel}{\param{wxDC\& }{dc}} +Draws the label. + \membersection{wxNewBitmapButton::DrawShade}\label{wxnewbitmapbuttondrawshade} \func{void}{DrawShade}{\param{int }{outerLevel}, \param{wxDC\& }{dc}, \param{wxPen\& }{upperLeftSidePen}, \param{wxPen\& }{lowerRightSidePen}} +Draws shading on the button. + \membersection{wxNewBitmapButton::GetStateLabel}\label{wxnewbitmapbuttongetstatelabel} \func{wxBitmap*}{GetStateLabel}{\void} -returns the label which match the current button state +Returns the label that matches the current button state. \membersection{wxNewBitmapButton::IsInWindow}\label{wxnewbitmapbuttonisinwindow} \func{bool}{IsInWindow}{\param{int }{x}, \param{int }{y}} +Returns TRUE if the given point is in the window. + \membersection{wxNewBitmapButton::OnEraseBackground}\label{wxnewbitmapbuttononerasebackground} \func{void}{OnEraseBackground}{\param{wxEraseEvent\& }{event}} +Responds to an erase background event. + \membersection{wxNewBitmapButton::OnKillFocus}\label{wxnewbitmapbuttononkillfocus} \func{void}{OnKillFocus}{\param{wxFocusEvent\& }{event}} +Responds to a kill focus event. + \membersection{wxNewBitmapButton::OnLButtonDown}\label{wxnewbitmapbuttononlbuttondown} \func{void}{OnLButtonDown}{\param{wxMouseEvent\& }{event}} -event handlers +Responds to a left mouse button down event. \membersection{wxNewBitmapButton::OnLButtonUp}\label{wxnewbitmapbuttononlbuttonup} \func{void}{OnLButtonUp}{\param{wxMouseEvent\& }{event}} +Responds to a left mouse button up event. + \membersection{wxNewBitmapButton::OnMouseMove}\label{wxnewbitmapbuttononmousemove} \func{void}{OnMouseMove}{\param{wxMouseEvent\& }{event}} +Responds to a mouse move event. + \membersection{wxNewBitmapButton::OnPaint}\label{wxnewbitmapbuttononpaint} \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}} +Responds to a paint event. + \membersection{wxNewBitmapButton::OnSize}\label{wxnewbitmapbuttononsize} \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} +Responds to a size event. + \membersection{wxNewBitmapButton::RenderAllLabelImages}\label{wxnewbitmapbuttonrenderalllabelimages} \func{void}{RenderAllLabelImages}{\void} +Renders label images. + \membersection{wxNewBitmapButton::RenderLabelImage}\label{wxnewbitmapbuttonrenderlabelimage} \func{void}{RenderLabelImage}{\param{wxBitmap*\& }{destBmp}, \param{wxBitmap* }{srcBmp}, \param{bool }{isEnabled = TRUE}, \param{bool }{isPressed = FALSE}} +Renders the label image. + \membersection{wxNewBitmapButton::RenderLabelImages}\label{wxnewbitmapbuttonrenderlabelimages} \func{void}{RenderLabelImages}{\void} +Renders label images. + \membersection{wxNewBitmapButton::Reshape}\label{wxnewbitmapbuttonreshape} \func{void}{Reshape}{\void} -should be called after Create(); +This function should be called after Create. It renders the labels, having +reloaded the button image if necessary. \membersection{wxNewBitmapButton::SetAlignments}\label{wxnewbitmapbuttonsetalignments} \func{void}{SetAlignments}{\param{int }{alignText = NB\_ALIGN\_TEXT\_BOTTOM}, \param{int }{marginX = 2}, \param{int }{marginY = 2}, \param{int }{textToLabelGap = 2}} +Sets the text alignment and margins. + \membersection{wxNewBitmapButton::SetLabel}\label{wxnewbitmapbuttonsetlabel} \func{void}{SetLabel}{\param{const wxBitmap\& }{labelBitmap}, \param{const wxString\& }{labelText = ""}} -overridables +Sets the label and optionally label text. diff --git a/contrib/docs/latex/fl/toollayoutitem.tex b/contrib/docs/latex/fl/toollayoutitem.tex index 6ec5293718..525ce6fb62 100644 --- a/contrib/docs/latex/fl/toollayoutitem.tex +++ b/contrib/docs/latex/fl/toollayoutitem.tex @@ -1,18 +1,22 @@ % % automatically generated by HelpGen $Revision$ from -% dyntbar.h at 05/Jan/02 22:50:56 +% dyntbar.h at 21/Jan/02 21:14:18 % \section{\class{wxToolLayoutItem}}\label{wxtoollayoutitem} -layout item +Tool layout item. \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Data structures} {\small \begin{verbatim} diff --git a/contrib/docs/latex/fl/toolwindow.tex b/contrib/docs/latex/fl/toolwindow.tex index 3e9e474f14..3e1eabbbec 100644 --- a/contrib/docs/latex/fl/toolwindow.tex +++ b/contrib/docs/latex/fl/toolwindow.tex @@ -1,15 +1,23 @@ % % automatically generated by HelpGen $Revision$ from -% toolwnd.h at 05/Jan/02 22:50:58 +% toolwnd.h at 21/Jan/02 21:14:17 % \section{\class{wxToolWindow}}\label{wxtoolwindow} + +A tool window is a special kind of frame that paints its own title, and +can be used to implement small floating windows. + \wxheading{Derived from} \helpref{wxFrame}{wxframe} +\wxheading{Include files} + + + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,122 +27,167 @@ \func{}{wxToolWindow}{\void} +Default constructor. + \membersection{wxToolWindow::\destruct{wxToolWindow}}\label{wxtoolwindowdtor} \func{}{\destruct{wxToolWindow}}{\void} +Destructor. + \membersection{wxToolWindow::AddMiniButton}\label{wxtoolwindowaddminibutton} \func{void}{AddMiniButton}{\param{cbMiniButton* }{pBtn}} -buttons are added in right-to-left order +Adds a button. Buttons are added in right-to-left order. \membersection{wxToolWindow::AdjustRectPos}\label{wxtoolwindowadjustrectpos} \func{void}{AdjustRectPos}{\param{const wxRect\& }{original}, \param{const wxSize\& }{newDim}, \param{wxRect\& }{newRect}} +Helper function. + \membersection{wxToolWindow::CalcResizedRect}\label{wxtoolwindowcalcresizedrect} \func{void}{CalcResizedRect}{\param{wxRect\& }{rect}, \param{wxPoint\& }{delta}, \param{const wxSize\& }{minDim}} +Calculate resized rectangle. + \membersection{wxToolWindow::DrawHintRect}\label{wxtoolwindowdrawhintrect} \func{void}{DrawHintRect}{\param{const wxRect\& }{r}} +Draws the hint rectangle. + \membersection{wxToolWindow::GetClient}\label{wxtoolwindowgetclient} \func{wxWindow*}{GetClient}{\void} +Returns the client window. + \membersection{wxToolWindow::GetMinimalWndDim}\label{wxtoolwindowgetminimalwnddim} \func{wxSize}{GetMinimalWndDim}{\void} +Helper function. + \membersection{wxToolWindow::GetPreferredSize}\label{wxtoolwindowgetpreferredsize} \func{wxSize}{GetPreferredSize}{\param{const wxSize\& }{given}} -overridables: +Returns the preferred size for the window. \membersection{wxToolWindow::GetScrMousePos}\label{wxtoolwindowgetscrmousepos} \func{void}{GetScrMousePos}{\param{wxMouseEvent\& }{event}, \param{wxPoint\& }{pos}} +Gets the mouse position in screen coordinates. + \membersection{wxToolWindow::GetScrWindowRect}\label{wxtoolwindowgetscrwindowrect} \func{void}{GetScrWindowRect}{\param{wxRect\& }{r}} +Maps client coordinates to screen coordinates. + \membersection{wxToolWindow::HandleTitleClick}\label{wxtoolwindowhandletitleclick} \func{bool}{HandleTitleClick}{\param{wxMouseEvent\& }{event}} +Handles clicking on the title. By default, does nothing. + \membersection{wxToolWindow::HitTestWindow}\label{wxtoolwindowhittestwindow} \func{int}{HitTestWindow}{\param{wxMouseEvent\& }{event}} +Tests if the mouse position is in this window. + \membersection{wxToolWindow::LayoutMiniButtons}\label{wxtoolwindowlayoutminibuttons} \func{void}{LayoutMiniButtons}{\void} +Lays out the buttons. + \membersection{wxToolWindow::OnEraseBackground}\label{wxtoolwindowonerasebackground} \func{void}{OnEraseBackground}{\param{wxEraseEvent\& }{event}} +Responds to an erase background event. + \membersection{wxToolWindow::OnLeftDown}\label{wxtoolwindowonleftdown} \func{void}{OnLeftDown}{\param{wxMouseEvent\& }{event}} +Responds to a mouse left down event. + \membersection{wxToolWindow::OnLeftUp}\label{wxtoolwindowonleftup} \func{void}{OnLeftUp}{\param{wxMouseEvent\& }{event}} +Responds to a mouse left up event. + \membersection{wxToolWindow::OnMiniButtonClicked}\label{wxtoolwindowonminibuttonclicked} \func{void}{OnMiniButtonClicked}{\param{int }{btnIdx}} +Called when a mini button is clicked. +By default, does nothing. + \membersection{wxToolWindow::OnMotion}\label{wxtoolwindowonmotion} \func{void}{OnMotion}{\param{wxMouseEvent\& }{event}} +Responds to a mouse move event. + \membersection{wxToolWindow::OnPaint}\label{wxtoolwindowonpaint} \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}} +Responds to a paint event. + \membersection{wxToolWindow::OnSize}\label{wxtoolwindowonsize} \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} +Responds to a size event. + \membersection{wxToolWindow::SetClient}\label{wxtoolwindowsetclient} \func{void}{SetClient}{\param{wxWindow* }{pWnd}} +Sets the client for this tool window. + \membersection{wxToolWindow::SetHintCursor}\label{wxtoolwindowsethintcursor} \func{void}{SetHintCursor}{\param{int }{type}} +Sets the hint cursor. + \membersection{wxToolWindow::SetTitleFont}\label{wxtoolwindowsettitlefont} \func{void}{SetTitleFont}{\param{wxFont\& }{font}} +Sets the title font. + diff --git a/contrib/include/wx/fl/antiflickpl.h b/contrib/include/wx/fl/antiflickpl.h index 332c45ea33..0ede3dfce6 100644 --- a/contrib/include/wx/fl/antiflickpl.h +++ b/contrib/include/wx/fl/antiflickpl.h @@ -6,7 +6,7 @@ // Created: 23/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __ANTIFLICKPL_G__ @@ -20,50 +20,66 @@ /* Implements double-buffering to reduce flicker. -Bitmap and memory DC buffers are shared "resources" among all instances of +Bitmap and memory DC buffers are shared 'resources' among all instances of antiflicker plugins within the application. -Locking for multithreaded applications is not yet implemented. +Locking for multithreaded applications is not yet implemented. */ class cbAntiflickerPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin ) + DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin ) protected: - static wxBitmap* mpVertBuf; - static wxBitmap* mpHorizBuf; - static wxMemoryDC* mpVertBufDc; - static wxMemoryDC* mpHorizBufDc; + static wxBitmap* mpVertBuf; + static wxBitmap* mpHorizBuf; + static wxMemoryDC* mpVertBufDc; + static wxMemoryDC* mpHorizBufDc; - static int mRefCount; + static int mRefCount; - wxDC* mpLRUBufDc; // last-recently-used buffer - wxRect mLRUArea; // last-recently-used area + wxDC* mpLRUBufDc; // last-recently-used buffer + wxRect mLRUArea; // last-recently-used area protected: - // Finds a suitable buffer. Returns NULL if a suitable buffer is not present. - wxDC* FindSuitableBuffer( const wxRect& forArea ); - // Allocates a suitable buffer. - wxDC* AllocNewBuffer( const wxRect& forArea ); + // Finds a suitable buffer. Returns NULL if a suitable buffer is not present. - wxDC& GetWindowDC(); - wxDC& GetClientDC(); + wxDC* FindSuitableBuffer( const wxRect& forArea ); + + // Allocates a suitable buffer. + + wxDC* AllocNewBuffer( const wxRect& forArea ); + + // Gets the window device context. + + wxDC& GetWindowDC(); + + // Gets the client device context. + + wxDC& GetClientDC(); public: - cbAntiflickerPlugin(void); + // Default constructor. + + cbAntiflickerPlugin(void); + + // Constructor taking frame layout panel, and pane mask. + + cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + + // Destructor. + + virtual ~cbAntiflickerPlugin(); - cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Handler for plugin event. - virtual ~cbAntiflickerPlugin(); + void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); - // Handler for plugin event. - void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); + // Handler for plugin event. - // Handler for plugin event. - void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ); + void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __ANTIFLICKPL_G__ */ diff --git a/contrib/include/wx/fl/bardragpl.h b/contrib/include/wx/fl/bardragpl.h index c314c169fa..4c42338af1 100644 --- a/contrib/include/wx/fl/bardragpl.h +++ b/contrib/include/wx/fl/bardragpl.h @@ -6,7 +6,7 @@ // Created: 23/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __BARDRAGPL_G__ @@ -19,149 +19,154 @@ #include "wx/fl/controlbar.h" #include "wx/fl/toolwnd.h" +/* +Plugin class implementing bar dragging. +*/ + class cbBarDragPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbBarDragPlugin ) + DECLARE_DYNAMIC_CLASS( cbBarDragPlugin ) protected: - // plugin is active only in bar-dragging state - bool mBarDragStarted; - bool mCanStick; // flag used to prevent "bouncing" of hint-rectangle - wxScreenDC* mpScrDc; // created while tracking hint-rect - wxCursor* mpCurCursor; + // plugin is active only in bar-dragging state + bool mBarDragStarted; + bool mCanStick; // flag used to prevent "bouncing" of hint-rectangle + wxScreenDC* mpScrDc; // created while tracking hint-rect + wxCursor* mpCurCursor; - // rectangle shows the position/dimensions of the bar, - // if it would be docked now + // rectangle shows the position/dimensions of the bar, + // if it would be docked now - wxRect mPrevHintRect; - wxRect mHintRect; + wxRect mPrevHintRect; + wxRect mHintRect; - int mMouseInRectX; - int mMouseInRectY; + int mMouseInRectX; + int mMouseInRectY; - cbDockPane* mpSrcPane; // pane, from which the bar was originally taken - int mBarWidthInSrcPane; + cbDockPane* mpSrcPane; // pane, from which the bar was originally taken + int mBarWidthInSrcPane; - cbDockPane* mpCurPane; + cbDockPane* mpCurPane; - cbBarInfo* mpDraggedBar; // bar, which is being dragged - bool mBarWasFloating; - wxRect mFloatedBarBounds; + cbBarInfo* mpDraggedBar; // bar, which is being dragged + bool mBarWasFloating; + wxRect mFloatedBarBounds; public: /*** public properties ***/ - int mInClientHintBorder; // when hint-rect moves within client window area, + int mInClientHintBorder; // when hint-rect moves within client window area, // the thicker rectangle is drawn using hatched brush, - // the default border width for this rectangle is 8 pix. + // the default border width for this rectangle is 8 pix. protected: - // Internal implementation function. - void AdjustHintRect( wxPoint& mousePos ); + // Internal implementation function. + void AdjustHintRect( wxPoint& mousePos ); + + // Internal implementation function. + void ClipRectInFrame( wxRect& rect ); - // Internal implementation function. - void ClipRectInFrame( wxRect& rect ); + // Internal implementation function. + void ClipPosInFrame( wxPoint& pos ); - // Internal implementation function. - void ClipPosInFrame( wxPoint& pos ); + // Internal implementation function. Finds the pane + // under the specified rectangle. + cbDockPane* HitTestPanes( wxRect& rect ); - // Internal implementation function. Finds the pane - // under the specified rectangle. - cbDockPane* HitTestPanes( wxRect& rect ); + // Internal implementation function. Finds the pane + // under the specified point. + cbDockPane* HitTestPanes( wxPoint& pos ); - // Internal implementation function. Finds the pane - // under the specified point. - cbDockPane* HitTestPanes( wxPoint& pos ); + // Internal implementation function. + bool HitsPane( cbDockPane* pPane, wxRect& rect ); - // Internal implementation function. - bool HitsPane( cbDockPane* pPane, wxRect& rect ); + // Internal implementation function. + void CalcOnScreenDims( wxRect& rect ); - // Internal implementation function. - void CalcOnScreenDims( wxRect& rect ); + // Internal implementation function. + int GetDistanceToPane( cbDockPane* pPane, wxPoint& mousePos ); - // Internal implementation function. - int GetDistanceToPane( cbDockPane* pPane, wxPoint& mousePos ); + // Internal implementation function. + bool IsInOtherPane ( wxPoint& mousePos ); - // Internal implementation function. - bool IsInOtherPane ( wxPoint& mousePos ); + // Internal implementation function. + bool IsInClientArea( wxPoint& mousePos ); - // Internal implementation function. - bool IsInClientArea( wxPoint& mousePos ); + // Internal implementation function. + bool IsInClientArea( wxRect& rect ); - // Internal implementation function. - bool IsInClientArea( wxRect& rect ); + // Internal implementation function. + void StickToPane( cbDockPane* pPane, wxPoint& mousePos ); - // Internal implementation function. - void StickToPane( cbDockPane* pPane, wxPoint& mousePos ); + // Internal implementation function. + void UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos ); - // Internal implementation function. - void UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos ); + // Internal implementation function. + int GetBarWidthInPane( cbDockPane* pPane ); - // Internal implementation function. - int GetBarWidthInPane( cbDockPane* pPane ); + // Internal implementation function. + int GetBarHeightInPane( cbDockPane* pPane ); - // Internal implementation function. - int GetBarHeightInPane( cbDockPane* pPane ); + // on-screen hint-tracking related methods - // on-screen hint-tracking related methods + // Internal implementation function. + // Start showing a visual hint while dragging. + void StartTracking(); - // Internal implementation function. - // Start showing a visual hint while dragging. - void StartTracking(); + // Internal implementation function. + // Draw the visual hint while dragging. + void DrawHintRect ( wxRect& rect, bool isInClientRect); - // Internal implementation function. - // Draw the visual hint while dragging. - void DrawHintRect ( wxRect& rect, bool isInClientRect); - // Internal implementation function. - // Erase the visual hint while dragging. - void EraseHintRect( wxRect& rect, bool isInClientRect); + // Internal implementation function. + // Erase the visual hint while dragging. + void EraseHintRect( wxRect& rect, bool isInClientRect); - // Internal implementation function. - // Stop showing the visual hint while dragging. - void FinishTracking(); + // Internal implementation function. + // Stop showing the visual hint while dragging. + void FinishTracking(); - // Internal implementation function. - // Draw the hint rectangle. - void DoDrawHintRect( wxRect& rect, bool isInClientRect); + // Internal implementation function. + // Draw the hint rectangle. + void DoDrawHintRect( wxRect& rect, bool isInClientRect); - // Internal implementation function. - // Converts the given rectangle from window to screen coordinates. - void RectToScr( wxRect& frameRect, wxRect& scrRect ); + // Internal implementation function. + // Converts the given rectangle from window to screen coordinates. + void RectToScr( wxRect& frameRect, wxRect& scrRect ); - // Internal implementation function. - // Show the hint; called within OnMouseMove. - void ShowHint( bool prevWasInClient ); + // Internal implementation function. + // Show the hint; called within OnMouseMove. + void ShowHint( bool prevWasInClient ); public: - // Default constructor. - cbBarDragPlugin(void); + // Default constructor. + cbBarDragPlugin(void); - // Constructor taking a parent frame, and flag. See cbPluginBase. - cbBarDragPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Constructor taking a parent frame, and flag. See cbPluginBase. + cbBarDragPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); - // Destructor. - virtual ~cbBarDragPlugin(); + // Destructor. + virtual ~cbBarDragPlugin(); - // Handler for plugin event. - void OnMouseMove( cbMotionEvent& event ); + // Handler for plugin event. + void OnMouseMove( cbMotionEvent& event ); - // Handler for plugin event. - void OnLButtonUp( cbLeftUpEvent& event ); + // Handler for plugin event. + void OnLButtonUp( cbLeftUpEvent& event ); - // Handler for plugin event. - void OnLButtonDown( cbLeftDownEvent& event ); + // Handler for plugin event. + void OnLButtonDown( cbLeftDownEvent& event ); - // Handler for plugin event. - void OnLDblClick( cbLeftDClickEvent& event ); + // Handler for plugin event. + void OnLDblClick( cbLeftDClickEvent& event ); - // Handles event, which originates from itself. - void OnDrawHintRect( cbDrawHintRectEvent& event ); + // Handles event, which originates from itself. + void OnDrawHintRect( cbDrawHintRectEvent& event ); - // Handler for plugin event. - void OnStartBarDragging( cbStartBarDraggingEvent& event ); + // Handler for plugin event. + void OnStartBarDragging( cbStartBarDraggingEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __BARDRAGPL_G__ */ diff --git a/contrib/include/wx/fl/barhintspl.h b/contrib/include/wx/fl/barhintspl.h index d6e0eb2954..c283cc1a71 100644 --- a/contrib/include/wx/fl/barhintspl.h +++ b/contrib/include/wx/fl/barhintspl.h @@ -6,7 +6,7 @@ // Created: 30/11/98 (my 22th birthday :-) // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __DRAGHINTSPL_G__ @@ -26,89 +26,89 @@ around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x class cbBarHintsPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin ) + DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin ) protected: - cbDockPane* mpPane; // is set up temorarely, while handling event + cbDockPane* mpPane; // is set up temorarely, while handling event - cbMiniButton* mBoxes[2]; + cbMiniButton* mBoxes[2]; - bool mBtnPressed; - bool mClosePressed; - cbBarInfo* mpClickedBar; - bool mDepressed; + bool mBtnPressed; + bool mClosePressed; + cbBarInfo* mpClickedBar; + bool mDepressed; protected: - // Helper function: draws a 3D box. - void Draw3DBox ( wxDC& dc, const wxPoint& pos, bool pressed ); + // Helper function: draws a 3D box. + void Draw3DBox ( wxDC& dc, const wxPoint& pos, bool pressed ); - // Helper function: draws a close box. - void DrawCloseBox ( wxDC& dc, const wxPoint& pos, bool pressed ); + // Helper function: draws a close box. + void DrawCloseBox ( wxDC& dc, const wxPoint& pos, bool pressed ); - // Helper function: draws a collapse box. - void DrawCollapseBox( wxDC& dc, const wxPoint& pos, - bool atLeft, bool disabled, bool pressed ); + // Helper function: draws a collapse box. + void DrawCollapseBox( wxDC& dc, const wxPoint& pos, + bool atLeft, bool disabled, bool pressed ); - // Helper function: draws grooves. - void DrawGrooves ( wxDC& dc, const wxPoint& pos, int length ); + // Helper function: draws grooves. + void DrawGrooves ( wxDC& dc, const wxPoint& pos, int length ); - // Helper function: draws a hint. - void DoDrawHint( wxDC& dc, wxRect& rect, int pos, int boxOfs, int grooveOfs, bool isFixed ); - - // Helper function: gets the layout of a hint. - void GetHintsLayout( wxRect& rect, cbBarInfo& info, - int& boxOfs, int& grooveOfs, int& pos ); + // Helper function: draws a hint. + void DoDrawHint( wxDC& dc, wxRect& rect, int pos, int boxOfs, int grooveOfs, bool isFixed ); - // Helper function: returns information about the hint under the given position. - int HitTestHints( cbBarInfo& info, const wxPoint& pos ); + // Helper function: gets the layout of a hint. + void GetHintsLayout( wxRect& rect, cbBarInfo& info, + int& boxOfs, int& grooveOfs, int& pos ); - // Helper function. - void ExcludeHints( wxRect& rect, cbBarInfo& info ); + // Helper function: returns information about the hint under the given position. + int HitTestHints( cbBarInfo& info, const wxPoint& pos ); - // Helper function: creates close and collapse boxes. - void CreateBoxes(); + // Helper function. + void ExcludeHints( wxRect& rect, cbBarInfo& info ); + + // Helper function: creates close and collapse boxes. + void CreateBoxes(); public: - /* public properties */ + /* public properties */ - bool mCloseBoxOn; // default: ON - bool mCollapseBoxOn; // default: ON - int mGrooveCount; // default: 2 (two shaded bars) - int mHintGap; // default: 5 (pixels from above, below, right and left) - int mXWeight; // default: 2 (width in pixels of lines which used for drawing cross) + bool mCloseBoxOn; // default: ON + bool mCollapseBoxOn; // default: ON + int mGrooveCount; // default: 2 (two shaded bars) + int mHintGap; // default: 5 (pixels from above, below, right and left) + int mXWeight; // default: 2 (width in pixels of lines which used for drawing cross) public: - // Default constructor. - cbBarHintsPlugin(void); + // Default constructor. + cbBarHintsPlugin(void); - // Constructor, taking parent frame and pane mask flag. - cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES ); + // Constructor, taking parent frame and pane mask flag. + cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES ); - // Destructor. + // Destructor. ~cbBarHintsPlugin(); - // Set the number of grooves to be shown in the pane. - void SetGrooveCount( int nGrooves ); + // Set the number of grooves to be shown in the pane. + void SetGrooveCount( int nGrooves ); - // Called to initialize this plugin. - void OnInitPlugin(); + // Called to initialize this plugin. + void OnInitPlugin(); - // Handles a plugin event. - void OnSizeBarWindow( cbSizeBarWndEvent& event ); + // Handles a plugin event. + void OnSizeBarWindow( cbSizeBarWndEvent& event ); - // Handles a plugin event. - void OnDrawBarDecorations( cbDrawBarDecorEvent& event ); + // Handles a plugin event. + void OnDrawBarDecorations( cbDrawBarDecorEvent& event ); - // Handles a plugin event. - void OnLeftDown( cbLeftDownEvent& event ); + // Handles a plugin event. + void OnLeftDown( cbLeftDownEvent& event ); - // Handles a plugin event. - void OnLeftUp ( cbLeftUpEvent& event ); + // Handles a plugin event. + void OnLeftUp ( cbLeftUpEvent& event ); - // Handles a plugin event. - void OnMotion ( cbMotionEvent& event ); + // Handles a plugin event. + void OnMotion ( cbMotionEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __DRAGHINTSPL_G__ */ diff --git a/contrib/include/wx/fl/cbcustom.h b/contrib/include/wx/fl/cbcustom.h index f6955f79ac..0445a23f62 100644 --- a/contrib/include/wx/fl/cbcustom.h +++ b/contrib/include/wx/fl/cbcustom.h @@ -6,7 +6,7 @@ // Created: 28/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __CBCUSTOM_G__ @@ -27,27 +27,27 @@ and horizontal/vertical alignment of the bar. class cbSimpleCustomizationPlugin : public cbPluginBase { public: - DECLARE_DYNAMIC_CLASS( cbSimpleCustomizationPlugin ) + DECLARE_DYNAMIC_CLASS( cbSimpleCustomizationPlugin ) - int mCustMenuItemId; + int mCustMenuItemId; public: - // Default constructor. - cbSimpleCustomizationPlugin(void); + // Default constructor. + cbSimpleCustomizationPlugin(void); - // Constructor, taking parent pane and a pane mask flag. - cbSimpleCustomizationPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Constructor, taking parent pane and a pane mask flag. + cbSimpleCustomizationPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); - // Plugin event handler for cbCustomizeBarEvent. - void OnCustomizeBar( cbCustomizeBarEvent& event ); + // Plugin event handler for cbCustomizeBarEvent. + void OnCustomizeBar( cbCustomizeBarEvent& event ); - // Plugin event handler for cbCustomizeLayoutEvent. - void OnCustomizeLayout( cbCustomizeLayoutEvent& event ); + // Plugin event handler for cbCustomizeLayoutEvent. + void OnCustomizeLayout( cbCustomizeLayoutEvent& event ); - // Menu event handler. - void OnMenuItemSelected( wxCommandEvent& event ); + // Menu event handler. + void OnMenuItemSelected( wxCommandEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __CBCUSTOM_G__ */ diff --git a/contrib/include/wx/fl/controlbar.h b/contrib/include/wx/fl/controlbar.h index 9073a4905c..168a718d0b 100644 --- a/contrib/include/wx/fl/controlbar.h +++ b/contrib/include/wx/fl/controlbar.h @@ -7,7 +7,7 @@ // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __CONTROLBAR_G__ @@ -72,9 +72,9 @@ WX_DEFINE_ARRAY( RowInfoPtrT, RowArrayT ); // masks for each pane -#define FL_ALIGN_TOP_PANE 0x0001 +#define FL_ALIGN_TOP_PANE 0x0001 #define FL_ALIGN_BOTTOM_PANE 0x0002 -#define FL_ALIGN_LEFT_PANE 0x0004 +#define FL_ALIGN_LEFT_PANE 0x0004 #define FL_ALIGN_RIGHT_PANE 0x0008 #define wxALL_PANES 0x000F @@ -83,20 +83,15 @@ WX_DEFINE_ARRAY( RowInfoPtrT, RowArrayT ); enum CB_HITTEST_RESULT { - CB_NO_ITEMS_HITTED, + CB_NO_ITEMS_HITTED, - CB_UPPER_ROW_HANDLE_HITTED, - CB_LOWER_ROW_HANDLE_HITTED, - CB_LEFT_BAR_HANDLE_HITTED, - CB_RIGHT_BAR_HANDLE_HITTED, - CB_BAR_CONTENT_HITTED + CB_UPPER_ROW_HANDLE_HITTED, + CB_LOWER_ROW_HANDLE_HITTED, + CB_LEFT_BAR_HANDLE_HITTED, + CB_RIGHT_BAR_HANDLE_HITTED, + CB_BAR_CONTENT_HITTED }; -// FIXME:: somehow in debug v. original wxASSERT's are not compiled in... - -//#undef wxASSERT -//#define wxASSERT(x) if ( !(x) ) throw; - /* Helper class, used for spying for unhandled mouse events on control bars and forwarding them to the frame layout. @@ -105,27 +100,27 @@ and forwarding them to the frame layout. class cbBarSpy : public wxEvtHandler { public: - DECLARE_DYNAMIC_CLASS( cbBarSpy ) + DECLARE_DYNAMIC_CLASS( cbBarSpy ) - wxFrameLayout* mpLayout; - wxWindow* mpBarWnd; + wxFrameLayout* mpLayout; + wxWindow* mpBarWnd; public: - // Default constructor. + // Default constructor. - cbBarSpy(void); + cbBarSpy(void); - // Constructor, taking a parent pane. + // Constructor, taking a parent pane. - cbBarSpy( wxFrameLayout* pPanel ); + cbBarSpy( wxFrameLayout* pPanel ); - // Sets the bar window. + // Sets the bar window. - void SetBarWindow( wxWindow* pWnd ); + void SetBarWindow( wxWindow* pWnd ); - // Performs special event processing. + // Performs special event processing. - virtual bool ProcessEvent(wxEvent& event); + virtual bool ProcessEvent(wxEvent& event); }; /* @@ -137,513 +132,513 @@ parent frame. class wxFrameLayout : public wxEvtHandler { public: - // Default constructor, used only for serialization. + // Default constructor, used only for serialization. - wxFrameLayout(); + wxFrameLayout(); - // Constructor, taking parent window, the (MDI) client of the parent if there - // is one, and flag specifying whether to activate the layout. + // Constructor, taking parent window, the (MDI) client of the parent if there + // is one, and flag specifying whether to activate the layout. - wxFrameLayout( wxWindow* pParentFrame, - wxWindow* pFrameClient = NULL, - bool activateNow = TRUE ); + wxFrameLayout( wxWindow* pParentFrame, + wxWindow* pFrameClient = NULL, + bool activateNow = TRUE ); - // Destructor. It does not destroy the bar windows. + // Destructor. It does not destroy the bar windows. - virtual ~wxFrameLayout(); + virtual ~wxFrameLayout(); - // Enables floating behaviour. By default floating of control bars is on. + // Enables floating behaviour. By default floating of control bars is on. - virtual void EnableFloating( bool enable = TRUE ); + virtual void EnableFloating( bool enable = TRUE ); - // Activate can be called after some other layout has been deactivated, - // and this one must take over the current contents of the frame window. - // - // Effectively hooks itself to the frame window, re-displays all non-hidden - // bar windows and repaints the decorations. + // Activate can be called after some other layout has been deactivated, + // and this one must take over the current contents of the frame window. + // + // Effectively hooks itself to the frame window, re-displays all non-hidden + // bar windows and repaints the decorations. - virtual void Activate(); + virtual void Activate(); - // Deactivate unhooks itself from frame window, and hides all non-hidden windows. - // - // Note: two frame layouts should not be active at the same time in the - // same frame window, since it would cause messy overlapping of bar windows - // from both layouts. + // Deactivate unhooks itself from frame window, and hides all non-hidden windows. + // + // Note: two frame layouts should not be active at the same time in the + // same frame window, since it would cause messy overlapping of bar windows + // from both layouts. - virtual void Deactivate(); + virtual void Deactivate(); - // Hides the bar windows, and also the client window if present. + // Hides the bar windows, and also the client window if present. - void HideBarWindows(); + void HideBarWindows(); - // Destroys the bar windows. + // Destroys the bar windows. - virtual void DestroyBarWindows(); + virtual void DestroyBarWindows(); - // Passes the client window (e.g. MDI client window) to be controlled by - // frame layout, the size and position of which should be adjusted to be - // surrounded by controlbar panes, whenever the frame is resized or the dimensions - // of control panes change. + // Passes the client window (e.g. MDI client window) to be controlled by + // frame layout, the size and position of which should be adjusted to be + // surrounded by controlbar panes, whenever the frame is resized or the dimensions + // of control panes change. - void SetFrameClient( wxWindow* pFrameClient ); + void SetFrameClient( wxWindow* pFrameClient ); - // Returns the frame client, or NULL if not present. + // Returns the frame client, or NULL if not present. - wxWindow* GetFrameClient(); + wxWindow* GetFrameClient(); - // Returns the parent frame. + // Returns the parent frame. - wxWindow& GetParentFrame() { return *mpFrame; } + wxWindow& GetParentFrame() { return *mpFrame; } - // Returns an array of panes. Used by update managers. + // Returns an array of panes. Used by update managers. - cbDockPane** GetPanesArray() { return mPanes; } + cbDockPane** GetPanesArray() { return mPanes; } - // Returns a pane for the given alignment. See pane alignment types. + // Returns a pane for the given alignment. See pane alignment types. - cbDockPane* GetPane( int alignment ) + cbDockPane* GetPane( int alignment ) - { return mPanes[alignment]; } + { return mPanes[alignment]; } - // Adds bar information to the frame layout. The appearance of the layout is not refreshed - // immediately; RefreshNow() can be called if necessary. - // - // Notes: the argument pBarWnd can by NULL, resulting in bar decorations to be drawn - // around the empty rectangle (filled with default background colour). - // Argument dimInfo can be reused for adding any number of bars, since - // it is not used directly - instead its members are copied. If the dimensions - // handler is present, its instance is shared (reference counted). The dimension - // handler should always be allocated on the heap. + // Adds bar information to the frame layout. The appearance of the layout is not refreshed + // immediately; RefreshNow() can be called if necessary. + // + // Notes: the argument pBarWnd can by NULL, resulting in bar decorations to be drawn + // around the empty rectangle (filled with default background colour). + // Argument dimInfo can be reused for adding any number of bars, since + // it is not used directly - instead its members are copied. If the dimensions + // handler is present, its instance is shared (reference counted). The dimension + // handler should always be allocated on the heap. - // pBarWnd is the window to be managed. + // pBarWnd is the window to be managed. - // dimInfo contains dimension information. + // dimInfo contains dimension information. - // alignment is a value such as FL_ALIGN_TOP. + // alignment is a value such as FL_ALIGN_TOP. - // rowNo is the vertical position or row in the pane (if in docked state). + // rowNo is the vertical position or row in the pane (if in docked state). - // columnPos is the horizontal position within the row in pixels (if in docked state). + // columnPos is the horizontal position within the row in pixels (if in docked state). - // name is a name by which the bar can be referred in layout customization dialogs. + // name is a name by which the bar can be referred in layout customization dialogs. - // If spyEvents is TRUE, input events for the bar should be "spyed" in order - // to forward unhandled mouse clicks to the frame layout, for example to enable - // easy draggablity of toolbars just by clicking on their interior regions. - // For widgets like text/tree control this value should be FALSE, - // since there's no certain way to detect whether the event was actually handled. + // If spyEvents is TRUE, input events for the bar should be "spyed" in order + // to forward unhandled mouse clicks to the frame layout, for example to enable + // easy draggablity of toolbars just by clicking on their interior regions. + // For widgets like text/tree control this value should be FALSE, + // since there's no certain way to detect whether the event was actually handled. - // state is the initial state, such as wxCBAR_DOCKED_HORIZONTALLY, - // wxCBAR_FLOATING, wxCBAR_HIDDEN. + // state is the initial state, such as wxCBAR_DOCKED_HORIZONTALLY, + // wxCBAR_FLOATING, wxCBAR_HIDDEN. - virtual void AddBar( wxWindow* pBarWnd, + virtual void AddBar( wxWindow* pBarWnd, const cbDimInfo& dimInfo, - // defaults: - int alignment = FL_ALIGN_TOP, - int rowNo = 0, - int columnPos = 0, - const wxString& name="bar", - bool spyEvents = FALSE, - int state = wxCBAR_DOCKED_HORIZONTALLY - ); + // defaults: + int alignment = FL_ALIGN_TOP, + int rowNo = 0, + int columnPos = 0, + const wxString& name="bar", + bool spyEvents = FALSE, + int state = wxCBAR_DOCKED_HORIZONTALLY + ); - // ReddockBar can be used for repositioning existing bars. The given bar is first removed - // from the pane it currently belongs to, and inserted into the pane, which "matches" - // the given rectangular area. If pToPane is not NULL, the bar is docked to this given pane. - // To dock a bar which is floating, use the wxFrameLayout::DockBar method. + // ReddockBar can be used for repositioning existing bars. The given bar is first removed + // from the pane it currently belongs to, and inserted into the pane, which "matches" + // the given rectangular area. If pToPane is not NULL, the bar is docked to this given pane. + // To dock a bar which is floating, use the wxFrameLayout::DockBar method. - virtual bool RedockBar( cbBarInfo* pBar, const wxRect& shapeInParent, - cbDockPane* pToPane = NULL, bool updateNow = TRUE ); + virtual bool RedockBar( cbBarInfo* pBar, const wxRect& shapeInParent, + cbDockPane* pToPane = NULL, bool updateNow = TRUE ); - // Finds the bar in the framelayout, by name. + // Finds the bar in the framelayout, by name. - cbBarInfo* FindBarByName( const wxString& name ); + cbBarInfo* FindBarByName( const wxString& name ); - // Finds the bar in the framelayout, by window. + // Finds the bar in the framelayout, by window. - cbBarInfo* FindBarByWindow( const wxWindow* pWnd ); + cbBarInfo* FindBarByWindow( const wxWindow* pWnd ); - // Gets an array of bars. + // Gets an array of bars. - BarArrayT& GetBars(); + BarArrayT& GetBars(); - // Changes the bar's docking state (see possible control bar states). + // Changes the bar's docking state (see possible control bar states). - void SetBarState( cbBarInfo* pBar, int newStatem, bool updateNow ); + void SetBarState( cbBarInfo* pBar, int newStatem, bool updateNow ); - // Toggles the bar between visible and hidden. + // Toggles the bar between visible and hidden. - void InverseVisibility( cbBarInfo* pBar ); + void InverseVisibility( cbBarInfo* pBar ); - // Reflects changes in bar information structure visually. - // For example, moves the bar, changes its dimension information, - // or changes the pane to which it is docked. + // Reflects changes in bar information structure visually. + // For example, moves the bar, changes its dimension information, + // or changes the pane to which it is docked. - void ApplyBarProperties( cbBarInfo* pBar ); + void ApplyBarProperties( cbBarInfo* pBar ); - // Removes the bar from the layout permanently, and hides its corresponding window if present. + // Removes the bar from the layout permanently, and hides its corresponding window if present. - void RemoveBar( cbBarInfo* pBar ); + void RemoveBar( cbBarInfo* pBar ); - // Recalculates the layout of panes, and all bars/rows in each pane. + // Recalculates the layout of panes, and all bars/rows in each pane. - virtual void RecalcLayout( bool repositionBarsNow = FALSE ); + virtual void RecalcLayout( bool repositionBarsNow = FALSE ); - // Returns the client height. + // Returns the client height. - int GetClientHeight(); + int GetClientHeight(); - // Returns the client width. + // Returns the client width. - int GetClientWidth(); + int GetClientWidth(); - // Returns the client's rectangle. + // Returns the client's rectangle. - wxRect& GetClientRect() { return mClntWndBounds; } + wxRect& GetClientRect() { return mClntWndBounds; } - // Returns a reference to the updates manager. - // Note: in future, the updates manager will become a normal plugin. + // Returns a reference to the updates manager. + // Note: in future, the updates manager will become a normal plugin. - cbUpdatesManagerBase& GetUpdatesManager(); + cbUpdatesManagerBase& GetUpdatesManager(); - // Destroys the previous manager if any, and sets the new one. + // Destroys the previous manager if any, and sets the new one. - void SetUpdatesManager( cbUpdatesManagerBase* pUMgr ); + void SetUpdatesManager( cbUpdatesManagerBase* pUMgr ); - // Gets the pane properties for the given alignment. + // Gets the pane properties for the given alignment. - virtual void GetPaneProperties( cbCommonPaneProperties& props, int alignment = FL_ALIGN_TOP ); + virtual void GetPaneProperties( cbCommonPaneProperties& props, int alignment = FL_ALIGN_TOP ); - // Sets the pane properties for the given alignment. - // Note: changing properties of panes does not result immediate on-screen update. + // Sets the pane properties for the given alignment. + // Note: changing properties of panes does not result immediate on-screen update. - virtual void SetPaneProperties( const cbCommonPaneProperties& props, - int paneMask = wxALL_PANES ); + virtual void SetPaneProperties( const cbCommonPaneProperties& props, + int paneMask = wxALL_PANES ); - // Sets the margins for the given panes. - // The margins should go into cbCommonPaneProperties in the future. - // - // Note: this method should be called before any custom plugins are attached. + // Sets the margins for the given panes. + // The margins should go into cbCommonPaneProperties in the future. + // + // Note: this method should be called before any custom plugins are attached. - virtual void SetMargins( int top, int bottom, int left, int right, - int paneMask = wxALL_PANES ); + virtual void SetMargins( int top, int bottom, int left, int right, + int paneMask = wxALL_PANES ); - // Sets the pane background colour. + // Sets the pane background colour. - virtual void SetPaneBackground( const wxColour& colour ); + virtual void SetPaneBackground( const wxColour& colour ); - // Recalculates layout and performs on-screen update of all panes. + // Recalculates layout and performs on-screen update of all panes. - void RefreshNow( bool recalcLayout = TRUE ); + void RefreshNow( bool recalcLayout = TRUE ); - // Event handler for a size event. + // Event handler for a size event. - void OnSize ( wxSizeEvent& event ); + void OnSize ( wxSizeEvent& event ); - // Event handler for a left down button event. + // Event handler for a left down button event. - void OnLButtonDown( wxMouseEvent& event ); + void OnLButtonDown( wxMouseEvent& event ); - // Event handler for a left doubleclick button event. + // Event handler for a left doubleclick button event. - void OnLDblClick ( wxMouseEvent& event ); + void OnLDblClick ( wxMouseEvent& event ); - // Event handler for a left button up event. + // Event handler for a left button up event. - void OnLButtonUp ( wxMouseEvent& event ); + void OnLButtonUp ( wxMouseEvent& event ); - // Event handler for a right button down event. + // Event handler for a right button down event. - void OnRButtonDown( wxMouseEvent& event ); + void OnRButtonDown( wxMouseEvent& event ); - // Event handler for a right button up event. + // Event handler for a right button up event. - void OnRButtonUp ( wxMouseEvent& event ); + void OnRButtonUp ( wxMouseEvent& event ); - // Event handler for a mouse move event. + // Event handler for a mouse move event. - void OnMouseMove ( wxMouseEvent& event ); + void OnMouseMove ( wxMouseEvent& event ); - // This function should be used instead of passing the event to the ProcessEvent method - // of the top-level plugin directly. This method checks if events are currently - // captured and ensures that plugin-event is routed correctly. + // This function should be used instead of passing the event to the ProcessEvent method + // of the top-level plugin directly. This method checks if events are currently + // captured and ensures that plugin-event is routed correctly. - virtual void FirePluginEvent( cbPluginEvent& event ); + virtual void FirePluginEvent( cbPluginEvent& event ); - // Captures user input events for the given plugin. - // Input events are: mouse movement, mouse clicks, keyboard input. + // Captures user input events for the given plugin. + // Input events are: mouse movement, mouse clicks, keyboard input. - virtual void CaptureEventsForPlugin ( cbPluginBase* pPlugin ); + virtual void CaptureEventsForPlugin ( cbPluginBase* pPlugin ); - // Releases user input events for the given plugin. - // Input events are: mouse movement, mouse clicks, keyboard input + // Releases user input events for the given plugin. + // Input events are: mouse movement, mouse clicks, keyboard input - virtual void ReleaseEventsFromPlugin( cbPluginBase* pPlugin ); + virtual void ReleaseEventsFromPlugin( cbPluginBase* pPlugin ); - // Called by plugins; also captures the mouse in the parent frame. + // Called by plugins; also captures the mouse in the parent frame. - void CaptureEventsForPane( cbDockPane* toPane ); + void CaptureEventsForPane( cbDockPane* toPane ); - // Called by plugins; also releases mouse in the parent frame. + // Called by plugins; also releases mouse in the parent frame. - void ReleaseEventsFromPane( cbDockPane* fromPane ); + void ReleaseEventsFromPane( cbDockPane* fromPane ); - // Returns the current top-level plugin (the one that receives events first, - // except if input events are currently captured by some other plugin). + // Returns the current top-level plugin (the one that receives events first, + // except if input events are currently captured by some other plugin). - virtual cbPluginBase& GetTopPlugin(); + virtual cbPluginBase& GetTopPlugin(); - // Hooking custom plugins to frame layout. - // - // Note: when hooking one plugin on top of the other, - // use SetNextHandler or similar methods - // of wxEvtHandler class to compose the chain of plugins, - // than pass the left-most handler in this chain to - // the above methods (assuming that events are delegated - // from left-most towards right-most handler). - // - // This secenario is very inconvenient and "low-level", - // so use the Add/Push/PopPlugin methods instead. + // Hooking custom plugins to frame layout. + // + // Note: when hooking one plugin on top of the other, + // use SetNextHandler or similar methods + // of wxEvtHandler class to compose the chain of plugins, + // than pass the left-most handler in this chain to + // the above methods (assuming that events are delegated + // from left-most towards right-most handler). + // + // This secenario is very inconvenient and "low-level", + // so use the Add/Push/PopPlugin methods instead. - virtual void SetTopPlugin( cbPluginBase* pPlugin ); + virtual void SetTopPlugin( cbPluginBase* pPlugin ); - // Similar to wxWindow's "push/pop-event-handler" methods, execept - // that the plugin is deleted upon "popping". + // Similar to wxWindow's "push/pop-event-handler" methods, execept + // that the plugin is deleted upon "popping". - virtual void PushPlugin( cbPluginBase* pPugin ); + virtual void PushPlugin( cbPluginBase* pPugin ); - // Similar to wxWindow's "push/pop-event-handler" methods, execept - // that the plugin is deleted upon "popping". + // Similar to wxWindow's "push/pop-event-handler" methods, execept + // that the plugin is deleted upon "popping". - virtual void PopPlugin(); + virtual void PopPlugin(); - // Pop all plugins. - virtual void PopAllPlugins(); + // Pop all plugins. + virtual void PopAllPlugins(); - // Adds the default plugins. These are cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin, - // cbAntiflickerPlugin, cbSimpleCustomizePlugin. - // - // This method is automatically invoked if no plugins were found upon - // firing of the first plugin-event, i.e. when wxFrameLayout configures itself. + // Adds the default plugins. These are cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin, + // cbAntiflickerPlugin, cbSimpleCustomizePlugin. + // + // This method is automatically invoked if no plugins were found upon + // firing of the first plugin-event, i.e. when wxFrameLayout configures itself. - virtual void PushDefaultPlugins(); + virtual void PushDefaultPlugins(); - // An advanced methods for plugin configuration using their - // dynamic class information, for example CLASSINFO(pluginClass). + // An advanced methods for plugin configuration using their + // dynamic class information, for example CLASSINFO(pluginClass). - // First checks if the plugin of the given class is already "hooked up". - // If not, adds it to the top of the plugins chain. + // First checks if the plugin of the given class is already "hooked up". + // If not, adds it to the top of the plugins chain. - virtual void AddPlugin( wxClassInfo* pPlInfo, int paneMask = wxALL_PANES ); + virtual void AddPlugin( wxClassInfo* pPlInfo, int paneMask = wxALL_PANES ); - // First checks if the plugin of the given class is already hooked. - // If so, removes it, and then inserts it into the chain - // before the plugin of the class given by pNextPlInfo. - // - // Note: this method is handy in some cases where the order - // of the plugin-chain could be important, for example when one plugin overrides - // some functionality of another already-hooked plugin, - // so that the former plugin should be hooked before the one - // whose functionality is being overridden. + // First checks if the plugin of the given class is already hooked. + // If so, removes it, and then inserts it into the chain + // before the plugin of the class given by pNextPlInfo. + // + // Note: this method is handy in some cases where the order + // of the plugin-chain could be important, for example when one plugin overrides + // some functionality of another already-hooked plugin, + // so that the former plugin should be hooked before the one + // whose functionality is being overridden. - virtual void AddPluginBefore( wxClassInfo* pNextPlInfo, wxClassInfo* pPlInfo, - int paneMask = wxALL_PANES ); + virtual void AddPluginBefore( wxClassInfo* pNextPlInfo, wxClassInfo* pPlInfo, + int paneMask = wxALL_PANES ); - // Checks if the plugin of the given class is hooked, and removes - // it if found. + // Checks if the plugin of the given class is hooked, and removes + // it if found. - virtual void RemovePlugin( wxClassInfo* pPlInfo ); + virtual void RemovePlugin( wxClassInfo* pPlInfo ); - // Finds a plugin with the given class, or returns NULL if a plugin of the given - // class is not hooked. + // Finds a plugin with the given class, or returns NULL if a plugin of the given + // class is not hooked. - virtual cbPluginBase* FindPlugin( wxClassInfo* pPlInfo ); + virtual cbPluginBase* FindPlugin( wxClassInfo* pPlInfo ); - // Returns true if there is a top plugin. + // Returns true if there is a top plugin. - bool HasTopPlugin(); + bool HasTopPlugin(); - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS( wxFrameLayout ) + DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS( wxFrameLayout ) public: /* protected really, acessed only by plugins and serializers */ - friend class cbDockPane; - friend class wxBarHandler; + friend class cbDockPane; + friend class wxBarHandler; - wxWindow* mpFrame; // parent frame - wxWindow* mpFrameClient; // client window - cbDockPane* mPanes[MAX_PANES]; // panes in the panel + wxWindow* mpFrame; // parent frame + wxWindow* mpFrameClient; // client window + cbDockPane* mPanes[MAX_PANES]; // panes in the panel - // misc. cursors - wxCursor* mpHorizCursor; - wxCursor* mpVertCursor; - wxCursor* mpNormalCursor; - wxCursor* mpDragCursor; - wxCursor* mpNECursor; // no-entry cursor + // misc. cursors + wxCursor* mpHorizCursor; + wxCursor* mpVertCursor; + wxCursor* mpNormalCursor; + wxCursor* mpDragCursor; + wxCursor* mpNECursor; // no-entry cursor - // pens for decoration and shades + // pens for decoration and shades - wxPen mDarkPen; // default wxSYS_COLOUR_3DSHADOW - wxPen mLightPen; // default wxSYS_COLOUR_3DHILIGHT - wxPen mGrayPen; // default wxSYS_COLOUR_3DFACE - wxPen mBlackPen; // default wxColour( 0, 0, 0) - wxPen mBorderPen; // default wxSYS_COLOUR_3DFACE + wxPen mDarkPen; // default wxSYS_COLOUR_3DSHADOW + wxPen mLightPen; // default wxSYS_COLOUR_3DHILIGHT + wxPen mGrayPen; // default wxSYS_COLOUR_3DFACE + wxPen mBlackPen; // default wxColour( 0, 0, 0) + wxPen mBorderPen; // default wxSYS_COLOUR_3DFACE - wxPen mNullPen; // transparent pen + wxPen mNullPen; // transparent pen - // pane to which the all mouse input is currently directed (caputred) + // pane to which the all mouse input is currently directed (caputred) - cbDockPane* mpPaneInFocus; + cbDockPane* mpPaneInFocus; - // pane, from which mouse pointer had just left + // pane, from which mouse pointer had just left - cbDockPane* mpLRUPane; + cbDockPane* mpLRUPane; - // bounds of client window in parent frame's coordinates + // bounds of client window in parent frame's coordinates - wxRect mClntWndBounds; - wxRect mPrevClntWndBounds; + wxRect mClntWndBounds; + wxRect mPrevClntWndBounds; - bool mFloatingOn; - wxPoint mNextFloatedWndPos; - wxSize mFloatingPosStep; + bool mFloatingOn; + wxPoint mNextFloatedWndPos; + wxSize mFloatingPosStep; - // current plugin (right-most) plugin which receives events first + // current plugin (right-most) plugin which receives events first - cbPluginBase* mpTopPlugin; + cbPluginBase* mpTopPlugin; - // plugin, which currently has captured all input events, otherwise NULL + // plugin, which currently has captured all input events, otherwise NULL - cbPluginBase* mpCaputesInput; + cbPluginBase* mpCaputesInput; - // list of event handlers which are "pushed" onto each bar, to catch - // mouse events which are not handled by bars, and froward them to the , - // frome-layout and further to plugins + // list of event handlers which are "pushed" onto each bar, to catch + // mouse events which are not handled by bars, and froward them to the , + // frome-layout and further to plugins - wxList mBarSpyList; + wxList mBarSpyList; - // list of top-most frames which contain floated bars + // list of top-most frames which contain floated bars - wxList mFloatedFrames; + wxList mFloatedFrames; - // linked list of references to all bars (docked/floated/hidden) + // linked list of references to all bars (docked/floated/hidden) - BarArrayT mAllBars; + BarArrayT mAllBars; - // FOR NOW:: dirty stuff... - bool mClientWndRefreshPending; - bool mRecalcPending; - bool mCheckFocusWhenIdle; + // FOR NOW:: dirty stuff... + bool mClientWndRefreshPending; + bool mRecalcPending; + bool mCheckFocusWhenIdle; public: /* protected really (accessed only by plugins) */ - // refrence to custom updates manager - cbUpdatesManagerBase* mpUpdatesMgr; + // refrence to custom updates manager + cbUpdatesManagerBase* mpUpdatesMgr; - // Called to apply the calculated layout to window objects. + // Called to apply the calculated layout to window objects. - void PositionClientWindow(); + void PositionClientWindow(); - // Called to apply the calculated layout to window objects. + // Called to apply the calculated layout to window objects. - void PositionPanes(); + void PositionPanes(); - // Creates the cursors. + // Creates the cursors. - void CreateCursors(); + void CreateCursors(); - // Applies the calculated layout to a floating bar. + // Applies the calculated layout to a floating bar. - void RepositionFloatedBar( cbBarInfo* pBar ); + void RepositionFloatedBar( cbBarInfo* pBar ); - // Applies the state to the window objects. + // Applies the state to the window objects. - void DoSetBarState( cbBarInfo* pBar ); + void DoSetBarState( cbBarInfo* pBar ); - // The purpose of this function is unknown. + // The purpose of this function is unknown. - bool LocateBar( cbBarInfo* pBarInfo, - cbRowInfo** ppRow, - cbDockPane** ppPane ); + bool LocateBar( cbBarInfo* pBarInfo, + cbRowInfo** ppRow, + cbDockPane** ppPane ); - // Returns TRUE if the position is within the given pane. + // Returns TRUE if the position is within the given pane. - bool HitTestPane( cbDockPane* pPane, int x, int y ); + bool HitTestPane( cbDockPane* pPane, int x, int y ); - // Returns the pane for which the rectangle hit test succeeds, giving - // preference to the given pane if supplied. + // Returns the pane for which the rectangle hit test succeeds, giving + // preference to the given pane if supplied. - cbDockPane* HitTestPanes( const wxRect& rect, cbDockPane* pCurPane ); + cbDockPane* HitTestPanes( const wxRect& rect, cbDockPane* pCurPane ); - // Returns the pane to which the given bar belongs. + // Returns the pane to which the given bar belongs. - cbDockPane* GetBarPane( cbBarInfo* pBar ); + cbDockPane* GetBarPane( cbBarInfo* pBar ); - // Delegated from "bar-spy". - void ForwardMouseEvent( wxMouseEvent& event, - cbDockPane* pToPane, - int eventType ); + // Delegated from "bar-spy". + void ForwardMouseEvent( wxMouseEvent& event, + cbDockPane* pToPane, + int eventType ); - // Routes the mouse event to the appropriate pane. + // Routes the mouse event to the appropriate pane. - void RouteMouseEvent( wxMouseEvent& event, int pluginEvtType ); + void RouteMouseEvent( wxMouseEvent& event, int pluginEvtType ); - // Shows all floated windows. + // Shows all floated windows. - void ShowFloatedWindows( bool show ); + void ShowFloatedWindows( bool show ); - // Unhooks the layout from the frame. + // Unhooks the layout from the frame. - void UnhookFromFrame(); + void UnhookFromFrame(); - // Hooks the layout up to the frame (pushes the layout onto the - // frame's event handler stack). + // Hooks the layout up to the frame (pushes the layout onto the + // frame's event handler stack). - void HookUpToFrame(); + void HookUpToFrame(); - // Returns TRUE if the platform allows reparenting. This may not return TRUE - // for all platforms. Reparenting allows control bars to be floated. + // Returns TRUE if the platform allows reparenting. This may not return TRUE + // for all platforms. Reparenting allows control bars to be floated. - bool CanReparent(); + bool CanReparent(); - // Reparents pChild to have parent pNewParent. + // Reparents pChild to have parent pNewParent. - void ReparentWindow( wxWindow* pChild, wxWindow* pNewParent ); + void ReparentWindow( wxWindow* pChild, wxWindow* pNewParent ); - // Returns the previous client window rectangle. + // Returns the previous client window rectangle. - wxRect& GetPrevClientRect() { return mPrevClntWndBounds; } + wxRect& GetPrevClientRect() { return mPrevClntWndBounds; } - // Handles paint events, calling PaintPane for each pane. + // Handles paint events, calling PaintPane for each pane. - void OnPaint( wxPaintEvent& event ); + void OnPaint( wxPaintEvent& event ); - // Handles background erase events. Currently does nothing. + // Handles background erase events. Currently does nothing. - void OnEraseBackground( wxEraseEvent& event ); + void OnEraseBackground( wxEraseEvent& event ); - // Handles focus kill events. Currently does nothing. + // Handles focus kill events. Currently does nothing. - void OnKillFocus( wxFocusEvent& event ); + void OnKillFocus( wxFocusEvent& event ); - // Handles focus set events. Currently does nothing. + // Handles focus set events. Currently does nothing. - void OnSetFocus( wxFocusEvent& event ); + void OnSetFocus( wxFocusEvent& event ); - // Handles activation events. Currently does nothing. + // Handles activation events. Currently does nothing. - void OnActivate( wxActivateEvent& event ); + void OnActivate( wxActivateEvent& event ); - // Handles idle events. + // Handles idle events. - void OnIdle( wxIdleEvent& event ); + void OnIdle( wxIdleEvent& event ); - // Returns a new cbGCUpdatesMgr object. + // Returns a new cbGCUpdatesMgr object. - virtual cbUpdatesManagerBase* CreateUpdatesManager(); + virtual cbUpdatesManagerBase* CreateUpdatesManager(); }; /* @@ -654,34 +649,34 @@ auxiliary information to be used by its updating algorithm. class cbUpdateMgrData : public wxObject { - DECLARE_DYNAMIC_CLASS( cbUpdateMgrData ) + DECLARE_DYNAMIC_CLASS( cbUpdateMgrData ) public: - wxRect mPrevBounds; // previous state of layout item (in parent frame's coordinates) + wxRect mPrevBounds; // previous state of layout item (in parent frame's coordinates) - bool mIsDirty; // overrides result of current-against-previous bounds comparison, - // i.e. requires item to be updated, regardless of it's current area + bool mIsDirty; // overrides result of current-against-previous bounds comparison, + // i.e. requires item to be updated, regardless of it's current area - wxObject* mpCustomData; // any custom data stored by specific updates mgr. + wxObject* mpCustomData; // any custom data stored by specific updates mgr. - // Default constructor. Is-dirty flag is set TRUE initially. + // Default constructor. Is-dirty flag is set TRUE initially. - cbUpdateMgrData(); + cbUpdateMgrData(); - // Store the item state. + // Store the item state. - void StoreItemState( const wxRect& boundsInParent ); + void StoreItemState( const wxRect& boundsInParent ); - // Set the dirty flag. + // Set the dirty flag. - void SetDirty( bool isDirty = TRUE ); + void SetDirty( bool isDirty = TRUE ); - // Set custom data. + // Set custom data. - void SetCustomData( wxObject* pCustomData ); + void SetCustomData( wxObject* pCustomData ); - // Returns the is-dirty flag. + // Returns the is-dirty flag. - inline bool IsDirty() { return mIsDirty; } + inline bool IsDirty() { return mIsDirty; } }; /* @@ -694,82 +689,120 @@ Specific handlers can be hooked up to specific types of bar. class cbBarDimHandlerBase : public wxObject { - DECLARE_ABSTRACT_CLASS( cbBarDimHandlerBase ) + DECLARE_ABSTRACT_CLASS( cbBarDimHandlerBase ) public: - int mRefCount; // since one dim-handler can be assigned - // to multiple bars, it's instance is - // reference-counted + int mRefCount; // since one dim-handler can be assigned + // to multiple bars, it's instance is + // reference-counted public: - // initial reference count is 0, since handler is not used, until the - // first invocation of AddRef() + // Default constructor. The initial reference count is 0, since + // the handler is not used until the first invocation of AddRef(). - cbBarDimHandlerBase(); + cbBarDimHandlerBase(); - void AddRef(); - void RemoveRef(); + // Increments the reference count. - // "bar-state-changes" notification - virtual void OnChangeBarState(cbBarInfo* pBar, int newState ) = 0; - virtual void OnResizeBar( cbBarInfo* pBar, const wxSize& given, wxSize& preferred ) = 0; -}; + void AddRef(); + + // Decrements the reference count, and if the count is at zero, + // delete 'this'. + + void RemoveRef(); -/* helper classes (used internally by wxFrameLayout class) */ + // Responds to "bar-state-changes" notifications. + + virtual void OnChangeBarState(cbBarInfo* pBar, int newState ) = 0; + + // Responds to bar resize notifications. + + virtual void OnResizeBar( cbBarInfo* pBar, const wxSize& given, wxSize& preferred ) = 0; +}; -// holds and manages information about bar dimensions +/* +Helper class used internally by the wxFrameLayout class. +Holds and manages information about bar dimensions. +*/ class cbDimInfo : public wxObject { - DECLARE_DYNAMIC_CLASS( cbDimInfo ) + DECLARE_DYNAMIC_CLASS( cbDimInfo ) public: - wxSize mSizes[MAX_BAR_STATES]; // preferred sizes for each possible bar state + wxSize mSizes[MAX_BAR_STATES]; // preferred sizes for each possible bar state - wxRect mBounds[MAX_BAR_STATES]; // saved positions and sizes for each - // possible state, values contain (-1)s if - // not initialized yet + wxRect mBounds[MAX_BAR_STATES]; // saved positions and sizes for each + // possible state, values contain (-1)s if + // not initialized yet - int mLRUPane; // pane to which this bar was docked before it was floated - // (FL_ALIGN_TOP,FL_ALIGN_BOTTOM,..) + int mLRUPane; // pane to which this bar was docked before it was floated + // (FL_ALIGN_TOP,FL_ALIGN_BOTTOM,..) - // top/bottom gap, separates decorations - // from the bar's actual window, filled - // with frame's beckground color, default: 0 + // top/bottom gap, separates decorations + // from the bar's actual window, filled + // with frame's beckground color, default: 0 - int mVertGap; + int mVertGap; - // left/right gap, separates decorations - // from the bar's actual window, filled - // with frame's beckground colour, default: 0 + // left/right gap, separates decorations + // from the bar's actual wndow, filled + // with frame's beckground colour, default: 0 - int mHorizGap; // NOTE:: gaps are given in frame's coord. orientation + int mHorizGap; // NOTE:: gaps are given in frame's coord. orientation - // TRUE, if vertical/horizotal dimensions cannot be mannualy adjusted - // by user using resizing handles. If FALSE, the frame-layout - // *automatically* places resizing handles among not-fixed bars + // TRUE, if vertical/horizontal dimensions cannot be mannualy adjusted + // by user using resizing handles. If FALSE, the frame-layout + // *automatically* places resizing handles among not-fixed bars - bool mIsFixed; + bool mIsFixed; - cbBarDimHandlerBase* mpHandler; // NULL, if no handler present + cbBarDimHandlerBase* mpHandler; // NULL, if no handler present public: - cbDimInfo(void); + // Default constructor. + + cbDimInfo(void); - cbDimInfo( cbBarDimHandlerBase* pDimHandler, - bool isFixed // (see comments on mIsFixed member) - ); + // Constructor. + // isFixed is TRUE if vertical/horizontal dimensions cannot be manually adjusted + // by the user using resizing handles. If FALSE, the frame-layout + // automatically places resizing handles among bars that do are not fixed. + + cbDimInfo( cbBarDimHandlerBase* pDimHandler, + bool isFixed // (see comments on mIsFixed member) + ); - cbDimInfo( int dh_x, int dh_y, // dims when docked horizontally - int dv_x, int dv_y, // dims when docked vertically - int f_x, int f_y, // dims when floating + // Constructor taking dimenstion information. + // + // dh_x, dh_y are the dimensions when docked horizontally. + // + // dv_x, dv_y are the dimensions when docked vertically. + // + // f_x, f_y are the dimensions when floating. + // + // For information on isFixed, see comments above. + // + // horizGap is the left/right gap, separating decorations + // from the bar's actual wndow, filled with the frame's background colour. + // The dimension is given in the frame's coordinates. + // + // vertGap is the top/bottom gap, separating decorations + // from the bar's actual wndow, filled with the frame's background colour. + // The dimension is given in the frame's coordinates. + + cbDimInfo( int dh_x, int dh_y, + int dv_x, int dv_y, + int f_x, int f_y, - bool isFixed = TRUE,// (see comments on mIsFixed member) - int horizGap = 6, // (see comments on mHorizGap member) - int vertGap = 6, // -/- + bool isFixed = TRUE, + int horizGap = 6, + int vertGap = 6, + + cbBarDimHandlerBase* pDimHandler = NULL + ); - cbBarDimHandlerBase* pDimHandler = NULL - ); + // Constructor. cbDimInfo( int x, int y, bool isFixed = TRUE, @@ -777,568 +810,770 @@ public: cbBarDimHandlerBase* pDimHandler = NULL ); - const cbDimInfo& operator=( const cbDimInfo& other ); + // Destructor. Destroys handler automatically, if present. - // destroys handler automatically, if present - ~cbDimInfo(); + ~cbDimInfo(); - inline cbBarDimHandlerBase* GetDimHandler() { return mpHandler; } + // Assignment operator. + + const cbDimInfo& operator=( const cbDimInfo& other ); + + // Returns the handler, if any. + + inline cbBarDimHandlerBase* GetDimHandler() { return mpHandler; } }; WX_DEFINE_ARRAY(float, cbArrayFloat); +/* +Helper class used internally by the wxFrameLayout class. +Holds and manages information about bar rows. +*/ + class cbRowInfo : public wxObject { - DECLARE_DYNAMIC_CLASS( cbRowInfo ) + DECLARE_DYNAMIC_CLASS( cbRowInfo ) public: - BarArrayT mBars; // row content + BarArrayT mBars; // row content - // row flags (set up according to row-relations) + // row flags (set up according to row-relations) - bool mHasUpperHandle; - bool mHasLowerHandle; - bool mHasOnlyFixedBars; - int mNotFixedBarsCnt; + bool mHasUpperHandle; + bool mHasLowerHandle; + bool mHasOnlyFixedBars; + int mNotFixedBarsCnt; - int mRowWidth; - int mRowHeight; - int mRowY; + int mRowWidth; + int mRowHeight; + int mRowY; - // stores precalculated row's bounds in parent frame's coordinates - wxRect mBoundsInParent; + // stores precalculated row's bounds in parent frame's coordinates + wxRect mBoundsInParent; - // info stored for updates-manager - cbUpdateMgrData mUMgrData; + // info stored for updates-manager + cbUpdateMgrData mUMgrData; - cbRowInfo* mpNext; - cbRowInfo* mpPrev; + cbRowInfo* mpNext; + cbRowInfo* mpPrev; - cbBarInfo* mpExpandedBar; // NULL, if non of the bars is currently expanded + cbBarInfo* mpExpandedBar; // NULL, if non of the bars is currently expanded - cbArrayFloat mSavedRatios; // length-ratios bofore some of the bars was expanded + cbArrayFloat mSavedRatios; // length-ratios bofore some of the bars was expanded public: - cbRowInfo(void); + // Constructor. + + cbRowInfo(void); - ~cbRowInfo(); + // Destructor. - // convenience method + ~cbRowInfo(); - inline cbBarInfo* GetFirstBar() + // Returns the first bar. - { return mBars.GetCount() ? mBars[0] : NULL; } + inline cbBarInfo* GetFirstBar() + + { return mBars.GetCount() ? mBars[0] : NULL; } }; +/* +Helper class used internally by the wxFrameLayout class. +Holds and manages bar information. +*/ + class cbBarInfo : public wxObject { - DECLARE_DYNAMIC_CLASS( cbBarInfo ) + DECLARE_DYNAMIC_CLASS( cbBarInfo ) public: - // textual name, by which this bar is refered in layout-customization dialogs - wxString mName; + // textual name, by which this bar is refered in layout-customization dialogs + wxString mName; - // stores bar's bounds in pane's coordinates - wxRect mBounds; + // stores bar's bounds in pane's coordinates + wxRect mBounds; - // stores precalculated bar's bounds in parent frame's coordinates - wxRect mBoundsInParent; + // stores precalculated bar's bounds in parent frame's coordinates + wxRect mBoundsInParent; - // back-ref to the row, which contains this bar - cbRowInfo* mpRow; + // back-ref to the row, which contains this bar + cbRowInfo* mpRow; - // are set up according to the types of the surrounding bars in the row - bool mHasLeftHandle; - bool mHasRightHandle; + // are set up according to the types of the surrounding bars in the row + bool mHasLeftHandle; + bool mHasRightHandle; - cbDimInfo mDimInfo; // preferred sizes for each, control bar state + cbDimInfo mDimInfo; // preferred sizes for each, control bar state - int mState; // (see definition of controlbar states) + int mState; // (see definition of controlbar states) - int mAlignment; // alignment of the pane to which this - // bar is currently placed + int mAlignment; // alignment of the pane to which this + // bar is currently placed - int mRowNo; // row, into which this bar would be placed, - // when in the docking state + int mRowNo; // row, into which this bar would be placed, + // when in the docking state - wxWindow* mpBarWnd; // the actual window object, NULL if no window - // is attached to the control bar (possible!) + wxWindow* mpBarWnd; // the actual window object, NULL if no window + // is attached to the control bar (possible!) - double mLenRatio; // length ratio among not-fixed-size bars + double mLenRatio; // length ratio among not-fixed-size bars - wxPoint mPosIfFloated; // stored last position when bar was in "floated" state - // poistion is stored in parent-window's coordinates + wxPoint mPosIfFloated; // stored last position when bar was in "floated" state + // poistion is stored in parent-window's coordinates - cbUpdateMgrData mUMgrData; // info stored for updates-manager + cbUpdateMgrData mUMgrData; // info stored for updates-manager - cbBarInfo* mpNext; // next. bar in the row - cbBarInfo* mpPrev; // prev. bar in the row + cbBarInfo* mpNext; // next. bar in the row + cbBarInfo* mpPrev; // prev. bar in the row public: - cbBarInfo(void); + // Constructor. + + cbBarInfo(void); + + // Destructor. - ~cbBarInfo(); + ~cbBarInfo(); - inline bool IsFixed() const { return mDimInfo.mIsFixed; } + // Returns TRUE if this bar is fixed. - inline bool IsExpanded() const { return this == mpRow->mpExpandedBar; } + inline bool IsFixed() const { return mDimInfo.mIsFixed; } + + // Returns TRUE if this bar is expanded. + + inline bool IsExpanded() const { return this == mpRow->mpExpandedBar; } }; -// used for storing original bar's postions in the row, when the "non-destructive-friction" -// option is turned ON +/* +Used for storing the original bar's positions in the row, when the 'non-destructive-friction' +option is turned on. +*/ class cbBarShapeData : public wxObject { public: - wxRect mBounds; - double mLenRatio; + wxRect mBounds; + double mLenRatio; }; -// used for traversing through all bars of all rows in the pane +/* +Used for traversing through all bars of all rows in the pane. +*/ class wxBarIterator { - RowArrayT* mpRows; - cbRowInfo* mpRow; - cbBarInfo* mpBar; + RowArrayT* mpRows; + cbRowInfo* mpRow; + cbBarInfo* mpBar; public: - wxBarIterator( RowArrayT& rows ); + // Constructor, taking row array. + + wxBarIterator( RowArrayT& rows ); + + // Resets the iterator to the start of the first row. + + void Reset(); - void Reset(); - bool Next(); // TRUE, if next bar is available + // Advances the iterator and returns TRUE if a bar is available. - cbBarInfo& BarInfo(); + bool Next(); - // returns reference to currently traversed row - cbRowInfo& RowInfo(); + // Gets the current bar information. + + cbBarInfo& BarInfo(); + + // Returns a reference to the currently traversed row. + + cbRowInfo& RowInfo(); }; -/* structure holds configuration options, - * which are usually the same for all panes in - * frame layout - */ +/* +A structure holding configuration options, +which are usually the same for all panes in +a frame layout. +*/ class cbCommonPaneProperties : public wxObject { - DECLARE_DYNAMIC_CLASS( cbCommonPaneProperties ) + DECLARE_DYNAMIC_CLASS( cbCommonPaneProperties ) + + // look-and-feel configuration - // look-and-feel configuration + bool mRealTimeUpdatesOn; // default: ON + bool mOutOfPaneDragOn; // default: ON + bool mExactDockPredictionOn; // default: OFF + bool mNonDestructFirctionOn; // default: OFF - bool mRealTimeUpdatesOn; // default: ON - bool mOutOfPaneDragOn; // default: ON - bool mExactDockPredictionOn; // default: OFF - bool mNonDestructFirctionOn; // default: OFF + bool mShow3DPaneBorderOn; // default: ON - bool mShow3DPaneBorderOn; // default: ON + // FOR NOW:: the below properties are reserved for the "future" - // FOR NOW:: the below properties are reserved for the "future" + bool mBarFloatingOn; // default: OFF + bool mRowProportionsOn; // default: OFF + bool mColProportionsOn; // default: ON + bool mBarCollapseIconsOn; // default: OFF + bool mBarDragHintsOn; // default: OFF - bool mBarFloatingOn; // default: OFF - bool mRowProportionsOn; // default: OFF - bool mColProportionsOn; // default: ON - bool mBarCollapseIconsOn; // default: OFF - bool mBarDragHintsOn; // default: OFF + // minimal dimensions for not-fixed bars in this pane (16x16 default) - // minimal dimensions for not-fixed bars in this pane (16x16 default) + wxSize mMinCBarDim; - wxSize mMinCBarDim; + // width/height of resizing sash - // width/height of resizing sash + int mResizeHandleSize; - int mResizeHandleSize; + // Default constructor. - cbCommonPaneProperties(void); + cbCommonPaneProperties(void); }; -/* class manages containment and control of control-bars - * along one of the four edges of the parent frame - */ +/* +This class manages containment and control of control bars +along one of the four edges of the parent frame. +*/ class cbDockPane : public wxObject { public: - DECLARE_DYNAMIC_CLASS( cbDockPane ) + DECLARE_DYNAMIC_CLASS( cbDockPane ) - // look-and-feel configuration for this pane - cbCommonPaneProperties mProps; + // look-and-feel configuration for this pane + cbCommonPaneProperties mProps; - // pane margins (in frame's coordinate-syst. orientation) + // pane margins (in frame's coordinate-syst. orientation) - int mLeftMargin; // default: 2 pixels - int mRightMargin; // default: 2 pixels - int mTopMargin; // default: 2 pixels - int mBottomMargin; // default: 2 pixels + int mLeftMargin; // default: 2 pixels + int mRightMargin; // default: 2 pixels + int mTopMargin; // default: 2 pixels + int mBottomMargin; // default: 2 pixels public: - // position of the pane in frame's coordinates - wxRect mBoundsInParent; + // position of the pane in frame's coordinates + wxRect mBoundsInParent; - // pane width and height in pane's coordinates - int mPaneWidth; - int mPaneHeight; + // pane width and height in pane's coordinates + int mPaneWidth; + int mPaneHeight; - int mAlignment; + int mAlignment; - // info stored for updates-manager - cbUpdateMgrData mUMgrData; + // info stored for updates-manager + cbUpdateMgrData mUMgrData; public: /* protected really */ - RowArrayT mRows; - wxFrameLayout* mpLayout; // back-ref + RowArrayT mRows; + wxFrameLayout* mpLayout; // back-ref - // transient properties + // transient properties - wxList mRowShapeData; // shapes of bars of recently modified row, - // stored when in "non-destructive-firction" mode - cbRowInfo* mpStoredRow; // row-info for which the shapes are stored + wxList mRowShapeData; // shapes of bars of recently modified row, + // stored when in "non-destructive-firction" mode + cbRowInfo* mpStoredRow; // row-info for which the shapes are stored - friend class wxFrameLayout; + friend class wxFrameLayout; public: /* protected really (accessed only by plugins) */ - cbRowInfo* GetRow( int row ); + // Returns the row info for a row index. Internal function called by plugins. + + cbRowInfo* GetRow( int row ); + + // Returns the row index for the given row info. Internal function called by plugins. + + int GetRowIndex( cbRowInfo* pRow ); + + // Returns the row at the given vertical position. + // Returns -1 if the row is not present at given vertical position. + // Internal function called by plugins. + + int GetRowAt( int paneY ); + + // Returns the row between the given vertical positions. + // Returns -1 if the row is not present. + // Internal function called by plugins. + + int GetRowAt( int upperY, int lowerY ); + + // Sets up flags in the row information structure, so that + // they match the changed state of row items correctly. + // Internal function called by plugins. + + void SyncRowFlags( cbRowInfo* pRow ); + + // Returns TRUE if the bar's dimension information indicates a fixed size. + // Internal function called by plugins. + + bool IsFixedSize( cbBarInfo* pInfo ); + + // Returns the number of bars whose size is not fixed. + // Internal function called by plugins. + + int GetNotFixedBarsCount( cbRowInfo* pRow ); + + // Gets the vertical position at the given row. + // Internal function called by plugins. + + int GetRowY( cbRowInfo* pRow ); + + // Returns TRUE if there are any variable-sized rows above this one. + // Internal function called by plugins. + + bool HasNotFixedRowsAbove( cbRowInfo* pRow ); + + // Returns TRUE if there are any variable-sized rows below this one. + // Internal function called by plugins. + + bool HasNotFixedRowsBelow( cbRowInfo* pRow ); + + // Returns TRUE if there are any variable-sized rows to the left of this one. + // Internal function called by plugins. + + bool HasNotFixedBarsLeft ( cbBarInfo* pBar ); + + // Returns TRUE if there are any variable-sized rows to the right of this one. + // Internal function called by plugins. - int GetRowIndex( cbRowInfo* pRow ); + bool HasNotFixedBarsRight( cbBarInfo* pBar ); - // return -1, if row is not present at given vertical position - int GetRowAt( int paneY ); - int GetRowAt( int upperY, int lowerY ); + // Calculate lengths. + // Internal function called by plugins. - // re-setups flags in the row-information structure, so that - // the would match the changed state of row-items correctly - void SyncRowFlags( cbRowInfo* pRow ); + virtual void CalcLengthRatios( cbRowInfo* pInRow ); - // layout "AI" helpers: + // Generates a cbLayoutRowEvent event to recalculate row layouts. + // Internal function called by plugins. - bool IsFixedSize( cbBarInfo* pInfo ); - int GetNotFixedBarsCount( cbRowInfo* pRow ); + virtual void RecalcRowLayout( cbRowInfo* pRow ); - int GetRowWidth( wxList* pRow ); + // Expands the bar. + // Internal function called by plugins. - int GetRowY( cbRowInfo* pRow ); + virtual void ExpandBar( cbBarInfo* pBar ); - bool HasNotFixedRowsAbove( cbRowInfo* pRow ); - bool HasNotFixedRowsBelow( cbRowInfo* pRow ); - bool HasNotFixedBarsLeft ( cbBarInfo* pBar ); - bool HasNotFixedBarsRight( cbBarInfo* pBar ); + // Contracts the bar. + // Internal function called by plugins. - virtual void CalcLengthRatios( cbRowInfo* pInRow ); - virtual void RecalcRowLayout( cbRowInfo* pRow ); + virtual void ContractBar( cbBarInfo* pBar ); - virtual void ExpandBar( cbBarInfo* pBar ); - virtual void ContractBar( cbBarInfo* pBar ); + // Sets up links between bars. + // Internal function called by plugins. - void InitLinksForRow( cbRowInfo* pRow ); - void InitLinksForRows(); + void InitLinksForRow( cbRowInfo* pRow ); - // coordinate translation between parent's frame and this pane + // Sets up links between bars. + // Internal function called by plugins. - void FrameToPane( int* x, int* y ); - void PaneToFrame( int* x, int* y ); - void FrameToPane( wxRect* pRect ); - void PaneToFrame( wxRect* pRect ); + void InitLinksForRows(); - inline bool HasPoint( const wxPoint& pos, int x, int y, int width, int height ); + // Coordinate translation between parent's frame and this pane. + // Internal function called by plugins. - int GetMinimalRowHeight( cbRowInfo* pRow ); + void FrameToPane( int* x, int* y ); - // given row height includes height of row handles, if present - void SetRowHeight( cbRowInfo* pRow, int newHeight ); + // Coordinate translation between parent's frame and this pane. + // Internal function called by plugins. - void DoInsertBar( cbBarInfo* pBar, int rowNo ); + void PaneToFrame( int* x, int* y ); + + // Coordinate translation between parent's frame and this pane. + // Internal function called by plugins. + + void FrameToPane( wxRect* pRect ); + + // Coordinate translation between parent's frame and this pane. + // Internal function called by plugins. + + void PaneToFrame( wxRect* pRect ); + + // Returns TRUE if pos is within the given rectangle. + // Internal function called by plugins. + + inline bool HasPoint( const wxPoint& pos, int x, int y, int width, int height ); + + // Returns the minimal row height for the given row. + // Internal function called by plugins. + + int GetMinimalRowHeight( cbRowInfo* pRow ); + + // Sets the row height for the given height. newHeight includes the height of row handles, if present. + // Internal function called by plugins. + + void SetRowHeight( cbRowInfo* pRow, int newHeight ); + + // Inserts the bar at the given row number. + // Internal function called by plugins. + + void DoInsertBar( cbBarInfo* pBar, int rowNo ); public: /* protected really (accessed only by plugins) */ - // methods for incramental on-screen refreshing of the pane - // (simply, they are wrappers around corresponding plugin-events) - - virtual void PaintBarDecorations( cbBarInfo* pBar, wxDC& dc ); - virtual void PaintBarHandles( cbBarInfo* pBar, wxDC& dc ); - virtual void PaintBar( cbBarInfo* pBar, wxDC& dc ); - virtual void PaintRowHandles( cbRowInfo* pRow, wxDC& dc ); - virtual void PaintRowBackground ( cbRowInfo* pRow, wxDC& dc ); - virtual void PaintRowDecorations( cbRowInfo* pRow, wxDC& dc ); - virtual void PaintRow( cbRowInfo* pRow, wxDC& dc ); - virtual void PaintPaneBackground( wxDC& dc ); - virtual void PaintPaneDecorations( wxDC& dc ); - virtual void PaintPane( wxDC& dc ); - virtual void SizeBar( cbBarInfo* pBar ); - virtual void SizeRowObjects( cbRowInfo* pRow ); - virtual void SizePaneObjects(); - - virtual wxDC* StartDrawInArea ( const wxRect& area ); - virtual void FinishDrawInArea( const wxRect& area ); + // Generates a cbDrawBarDecorEvent and sends it to the layout to paint the bar decorations. + // Internal function called by plugins. + + virtual void PaintBarDecorations( cbBarInfo* pBar, wxDC& dc ); + + // Generates a cbDrawBarHandlesEvent and sends it to the layout to paint the bar handles. + // Internal function called by plugins. + + virtual void PaintBarHandles( cbBarInfo* pBar, wxDC& dc ); + + // Calls PaintBarDecorations and PaintBarHandles. + // Internal function called by plugins. + + virtual void PaintBar( cbBarInfo* pBar, wxDC& dc ); + + // Generates cbDrawRowHandlesEvent and cbDrawRowDecorEvent and sends them to the layout. + // Internal function called by plugins. + + virtual void PaintRowHandles( cbRowInfo* pRow, wxDC& dc ); + + // Generates cbDrawRowBkGroundEvent and sends it to the layout. + // Internal function called by plugins. + + virtual void PaintRowBackground ( cbRowInfo* pRow, wxDC& dc ); + + // Calls PaintBarDecorations for each row. + // Internal function called by plugins. + + virtual void PaintRowDecorations( cbRowInfo* pRow, wxDC& dc ); + + // Calls PaintRowBackground, PaintRowDecorations, PaintRowHandles. + // Internal function called by plugins. + + virtual void PaintRow( cbRowInfo* pRow, wxDC& dc ); + + // Generates cbDrawPaneBkGroundEvent and sends it to the layout. + // Internal function called by plugins. + + virtual void PaintPaneBackground( wxDC& dc ); + + // Generates cbDrawPaneDecorEvent and sends it to the layout. + // Internal function called by plugins. + + virtual void PaintPaneDecorations( wxDC& dc ); + + // Paints the pane background, the row background and decorations, + // and finally the pane decorations. + // Internal function called by plugins. + + virtual void PaintPane( wxDC& dc ); + + // Generates a cbSizeBarWndEvent and sends it to the layout. + // Internal function called by plugins. + + virtual void SizeBar( cbBarInfo* pBar ); + + // Calls SizeBar for each bar in the row. + // Internal function called by plugins. + + virtual void SizeRowObjects( cbRowInfo* pRow ); + + // Calls SizeRowObjects for each row. + // Internal function called by plugins. + + virtual void SizePaneObjects(); + + // Generates cbStartDrawInAreaEvent and sends it to the layout. + // Internal function called by plugins. + + virtual wxDC* StartDrawInArea ( const wxRect& area ); + + // Generates cbFinishDrawInAreaEvent and sends it to the layout. + // Internal function called by plugins. + + virtual void FinishDrawInArea( const wxRect& area ); public: /* public members */ - cbDockPane(void); + // Default constructor. + + cbDockPane(void); + + // Constructor, taking alignment and layout panel. + + cbDockPane( int alignment, wxFrameLayout* pPanel ); + + // Sets pane's margins in frame's coordinate orientations. + + void SetMargins( int top, int bottom, int left, int right ); + + // Destructor. + + virtual ~cbDockPane(); + + // Removes the bar from this pane. Does not destroy the bar. + + virtual void RemoveBar( cbBarInfo* pBar ); + + // Inserts the bar into this pane. rect is given in the parent frame's coordinates. + + virtual void InsertBar( cbBarInfo* pBar, const wxRect& rect ); - cbDockPane( int alignment, wxFrameLayout* pPanel ); + // Inserts the bar into the given row, with dimensions and position + // stored in pBarInfo->mBounds. Returns the node of inserted bar. - // sets pane's margins in frame's coordinate orientations - void SetMargins( int top, int bottom, int left, int right ); + virtual void InsertBar( cbBarInfo* pBar, cbRowInfo* pIntoRow ); - virtual ~cbDockPane(); + // Inserts bar and sets its position according to the preferred settings + // given in pBarInfo. - // does not destroys the info bar , only removes it's reference - // from this pane + virtual void InsertBar( cbBarInfo* pBarInfo ); - virtual void RemoveBar( cbBarInfo* pBar ); + // Removes the row from this pane. Does not destroy the row object. - // rect given in the parent frame's coordinates + virtual void RemoveRow( cbRowInfo* pRow ); - virtual void InsertBar( cbBarInfo* pBar, const wxRect& atRect ); + // Inserts a row. Does not refresh the inserted row immediately. + // If pBeforeRowNode is NULL, the row is appended to the end of pane's row list. - // inserts bar into the given row, with dimensions and position - // stored in pBarInfo->mBounds. Returns the node of inserted bar + virtual void InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow ); - virtual void InsertBar( cbBarInfo* pBar, cbRowInfo* pIntoRow ); + // Sets pane's width in the pane's coordinates (including margins). - // inserts bar, sets its position according to the preferred settings - // given in (*pBarInfo) structure + void SetPaneWidth(int width); - virtual void InsertBar( cbBarInfo* pBarInfo ); + // Set the position and dimensions of the pane in the parent frame's coordinates. - // does not destroy the row object, only removes the corresponding - // node from this pane - virtual void RemoveRow( cbRowInfo* pRow ); + void SetBoundsInParent( const wxRect& rect ); - // does not refresh the inserted row immediately, - // if pBeforeRowNode arg. is NULL, row is appended to the end of pane's row list - virtual void InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow ); + // Returns the bounds of the pane, in parent coordinates. - // sets pane's width in pane's coordinates (including margins) - void SetPaneWidth(int width); + inline wxRect& GetRealRect() { return mBoundsInParent; } - // set the position and dims. of the pane in parent frame's coordinates - void SetBoundsInParent( const wxRect& rect ); + // Returns an array of rows. Used by updates-managers. - inline wxRect& GetRealRect() { return mBoundsInParent; } + inline RowArrayT& GetRowList() { return mRows; } - // used by updates-managers - inline RowArrayT& GetRowList() { return mRows; } + // Returns the first row. - // convenience method + inline cbRowInfo* GetFirstRow() - inline cbRowInfo* GetFirstRow() + { return mRows.GetCount() ? mRows[0] : NULL; } - { return mRows.GetCount() ? mRows[0] : NULL; } + // Returns TRUE if the given bar is present in this pane. - // TRUE, if the given bar node presents in this pane + bool BarPresent( cbBarInfo* pBar ); - bool BarPresent( cbBarInfo* pBar ); + // Returns the height in the pane's coordinates. - // retuns height, in pane's coordinates - int GetPaneHeight(); + int GetPaneHeight(); - int GetAlignment(); + // Returns the alignment for this pane. The value is one of + // FL_ALIGN_TOP, FL_ALIGN_BOTTOM, FL_ALIGN_LEFT, FL_ALIGN_RIGHT. - bool MatchesMask( int paneMask ); + int GetAlignment(); - inline bool IsHorizontal() - { - return (mAlignment == FL_ALIGN_TOP || - mAlignment == FL_ALIGN_BOTTOM ); - } + // Returns TRUE if the given mask matches the pane's mask. - virtual void RecalcLayout(); + bool MatchesMask( int paneMask ); - virtual int GetDockingState(); + // Returns TRUE if the pane is aligned to the top or bottom. - // returns result of hit-testing items in the pane, - // see CB_HITTEST_RESULTS enumeration + inline bool IsHorizontal() + { + return (mAlignment == FL_ALIGN_TOP || + mAlignment == FL_ALIGN_BOTTOM ); + } - virtual int HitTestPaneItems( const wxPoint& pos, // position in pane's coordinates - cbRowInfo** ppRow, - cbBarInfo** ppBar - ); + // Generates events to perform layout calculations. - void GetBarResizeRange( cbBarInfo* pBar, int* from, int *till, bool forLeftHandle ); - void GetRowResizeRange( cbRowInfo* pRow, int* from, int* till, bool forUpperHandle ); + virtual void RecalcLayout(); - cbBarInfo* GetBarInfoByWindow( wxWindow* pBarWnd ); + // Returns wxCBAR_DOCKED_HORIZONTALLY if the alignment is top or bottom, + // or wxCBAR_DOCKED_VERTICALLY otherwise. + + virtual int GetDockingState(); + + // Returns the result of hit-testing items in the pane. + // See CB_HITTEST_RESULT enumerated type. + // pos is the position in this pane's coordinates. + + virtual int HitTestPaneItems( const wxPoint& pos, + cbRowInfo** ppRow, + cbBarInfo** ppBar + ); + + // Returns the bar's resize range. + + void GetBarResizeRange( cbBarInfo* pBar, int* from, int *till, bool forLeftHandle ); + + // Returns the row's resize range. + + void GetRowResizeRange( cbRowInfo* pRow, int* from, int* till, bool forUpperHandle ); + + // Finds the bar information by corresponding window. + + cbBarInfo* GetBarInfoByWindow( wxWindow* pBarWnd ); public: /* protected really (accessed only by plugins) */ - // row/bar resizing related helper-methods + // Row/bar resizing related helper-method. - void DrawVertHandle ( wxDC& dc, int x, int y, int height ); - void DrawHorizHandle( wxDC& dc, int x, int y, int width ); + void DrawVertHandle ( wxDC& dc, int x, int y, int height ); - void ResizeRow( cbRowInfo* pRow, int ofs, bool forUpperHandle ); - void ResizeBar( cbBarInfo* pBar, int ofs, bool forLeftHandle ); + // Row/bar resizing related helper-method. - // cbBarShapeData objects will be placed to given pLst (see comments on cbBarShapeData) + void DrawHorizHandle( wxDC& dc, int x, int y, int width ); - void GetRowShapeData( cbRowInfo* pRow, wxList* pLst ); + // Row/bar resizing related helper-method. - // sets the shape to the given row, using the data provided in pLst - void SetRowShapeData( cbRowInfo* pRowNode, wxList* pLst ); + void ResizeRow( cbRowInfo* pRow, int ofs, bool forUpperHandle ); + + // Row/bar resizing related helper-method. + + void ResizeBar( cbBarInfo* pBar, int ofs, bool forLeftHandle ); + + // Returns row shape data. + // cbBarShapeData objects will be added to the given pLst. + // cbBarShapeData is used for storing the original bar's positions in the row, + // when the 'non-destructive-friction' option is turned on. + + void GetRowShapeData( cbRowInfo* pRow, wxList* pLst ); + + // Sets the shape data for the given row, using the data provided in pLst. + // cbBarShapeData is used for storing the original bar's positions in the row, + // when the 'non-destructive-friction' option is turned on. + + void SetRowShapeData( cbRowInfo* pRowNode, wxList* pLst ); }; /* - * class declares abstract interface for optimized logic, which should refresh - * areas of frame layout - that actually need to be updated. Should be extended, - * to implement custom updating strategy - */ +This class declares an abstract interface for optimized logic that should refresh +areas of frame layout that actually need to be updated. This should be extended in future +to implement a custom updating strategy. +*/ class cbUpdatesManagerBase : public wxObject { - DECLARE_ABSTRACT_CLASS( cbUpdatesManagerBase ) + DECLARE_ABSTRACT_CLASS( cbUpdatesManagerBase ) public: /* protected really, accessed by serializer (if any) */ - wxFrameLayout* mpLayout; + wxFrameLayout* mpLayout; public: - cbUpdatesManagerBase(void) - : mpLayout( 0 ) {} + // Default constructor - cbUpdatesManagerBase( wxFrameLayout* pPanel ) - : mpLayout( pPanel ) {} + cbUpdatesManagerBase(void) + : mpLayout( 0 ) {} - virtual ~cbUpdatesManagerBase() {} + // Constructor taking layout panel. - void SetLayout( wxFrameLayout* pLayout ) { mpLayout = pLayout; } + cbUpdatesManagerBase( wxFrameLayout* pPanel ) + : mpLayout( pPanel ) {} - // notificiactions received from frame-layout (in the order, in which - // they usually would be invoked). Custom updates-managers may utilize - // these notifications to implement more "fine-grained" updating strategy + // Destructor. - virtual void OnStartChanges() = 0; + virtual ~cbUpdatesManagerBase() {} - virtual void OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ) {} - virtual void OnBarWillChange( cbBarInfo* pBar, cbRowInfo* pInRow, cbDockPane* pInPane ) {} - virtual void OnPaneMarginsWillChange( cbDockPane* pPane ) {} - virtual void OnPaneWillChange( cbDockPane* pPane ) {} + // Sets the associated layout. - virtual void OnFinishChanges() {} + void SetLayout( wxFrameLayout* pLayout ) { mpLayout = pLayout; } - // refreshes parts of the frame layout, which need an update - virtual void UpdateNow() = 0; -}; + // This function receives a notification from the frame layout (in the order in which + // they would usually be invoked). Custom updates-managers may utilize + // these notifications to implement a more fine-grained updating strategy. -/*------------------------------------------------------------ - * "API" for developing custom plugins of Frame Layout Engine - * TODO:: documentation - *------------------------------------------------------------ - */ + virtual void OnStartChanges() = 0; -// base class for all control-bar plugin events + // This function receives a notification from the frame layout (in the order in which + // they would usually be invoked). Custom updates-managers may utilize + // these notifications to implement a more fine-grained updating strategy. -class cbPluginEvent : public wxEvent -{ - // NOTE:: plugin-event does not need to be a dynamic class + virtual void OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ) {} -public: - cbDockPane* mpPane; // NULL, if event is not addressed to any specific pane - - /* OLD STUFF:: - // FOR NOW FOR NOW:: all-in-one plugin event structure - wxNode* mpObjNode; - wxNode* mpObjNodeAux; - wxPoint mPos; - wxSize mSize; - wxDC* mpDC; - bool mAuxBoolVal; - */ - - // Not used, but required - virtual wxEvent* Clone() const { return NULL; } + // This function receives a notification from the frame layout (in the order in which + // they would usually be invoked). Custom updates-managers may utilize + // these notifications to implement a more fine-grained updating strategy. -#if wxCHECK_VERSION(2,3,0) - cbPluginEvent( wxEventType eventType, cbDockPane* pPane ) - : mpPane( pPane ) + virtual void OnBarWillChange( cbBarInfo* pBar, cbRowInfo* pInRow, cbDockPane* pInPane ) {} - { m_eventType = eventType; } -#else - cbPluginEvent( int eventType, cbDockPane* pPane ) - : mpPane( pPane ) + // This function receives a notification from the frame layout (in the order in which + // they would usually be invoked). Custom updates-managers may utilize + // these notifications to implement a more fine-grained updating strategy. - { m_eventType = eventType; } -#endif -}; + virtual void OnPaneMarginsWillChange( cbDockPane* pPane ) {} -// event types handled by plugins + // This function receives a notification from the frame layout (in the order in which + // they would usually be invoked). Custom updates-managers may utilize + // these notifications to implement a more fine-grained updating strategy. + + virtual void OnPaneWillChange( cbDockPane* pPane ) {} + + // This function receives a notification from the frame layout (in the order in which + // they would usually be invoked). Custom updates-managers may utilize + // these notifications to implement a more fine-grained updating strategy. -#if wxCHECK_VERSION(2,3,0) + virtual void OnFinishChanges() {} - extern wxEventType cbEVT_PL_LEFT_DOWN; - extern wxEventType cbEVT_PL_LEFT_UP; - extern wxEventType cbEVT_PL_RIGHT_DOWN; - extern wxEventType cbEVT_PL_RIGHT_UP; - extern wxEventType cbEVT_PL_MOTION; + // Refreshes parts of the frame layout that need an update. - extern wxEventType cbEVT_PL_LEFT_DCLICK; + virtual void UpdateNow() = 0; +}; - extern wxEventType cbEVT_PL_LAYOUT_ROW; - extern wxEventType cbEVT_PL_RESIZE_ROW; - extern wxEventType cbEVT_PL_LAYOUT_ROWS; - extern wxEventType cbEVT_PL_INSERT_BAR; - extern wxEventType cbEVT_PL_RESIZE_BAR; - extern wxEventType cbEVT_PL_REMOVE_BAR; - extern wxEventType cbEVT_PL_SIZE_BAR_WND; +/* +Base class for all control-bar plugin events. +This is not a dynamically-creatable class. +*/ - extern wxEventType cbEVT_PL_DRAW_BAR_DECOR; - extern wxEventType cbEVT_PL_DRAW_ROW_DECOR; - extern wxEventType cbEVT_PL_DRAW_PANE_DECOR; - extern wxEventType cbEVT_PL_DRAW_BAR_HANDLES; - extern wxEventType cbEVT_PL_DRAW_ROW_HANDLES; - extern wxEventType cbEVT_PL_DRAW_ROW_BKGROUND; - extern wxEventType cbEVT_PL_DRAW_PANE_BKGROUND; +class cbPluginEvent : public wxEvent +{ +public: + // NULL if event is not addressed to any specific pane. - extern wxEventType cbEVT_PL_START_BAR_DRAGGING; - extern wxEventType cbEVT_PL_DRAW_HINT_RECT; + cbDockPane* mpPane; - extern wxEventType cbEVT_PL_START_DRAW_IN_AREA; - extern wxEventType cbEVT_PL_FINISH_DRAW_IN_AREA; + // Not used, but required. - extern wxEventType cbEVT_PL_CUSTOMIZE_BAR; - extern wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT; + virtual wxEvent* Clone() const { return NULL; } - extern wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT; + // Constructor, taking event type and pane. -#else + cbPluginEvent( wxEventType eventType, cbDockPane* pPane ) + : mpPane( pPane ) - #define cbEVT_PL_LEFT_DOWN 0 - #define cbEVT_PL_LEFT_UP 1 - #define cbEVT_PL_RIGHT_DOWN 2 - #define cbEVT_PL_RIGHT_UP 3 - #define cbEVT_PL_MOTION 4 + { m_eventType = eventType; } +}; - #define cbEVT_PL_LEFT_DCLICK 5 +// event types handled by plugins - #define cbEVT_PL_LAYOUT_ROW 6 - #define cbEVT_PL_RESIZE_ROW 7 - #define cbEVT_PL_LAYOUT_ROWS 8 - #define cbEVT_PL_INSERT_BAR 9 - #define cbEVT_PL_RESIZE_BAR 10 - #define cbEVT_PL_REMOVE_BAR 11 - #define cbEVT_PL_SIZE_BAR_WND 12 +extern wxEventType cbEVT_PL_LEFT_DOWN; +extern wxEventType cbEVT_PL_LEFT_UP; +extern wxEventType cbEVT_PL_RIGHT_DOWN; +extern wxEventType cbEVT_PL_RIGHT_UP; +extern wxEventType cbEVT_PL_MOTION; - #define cbEVT_PL_DRAW_BAR_DECOR 13 - #define cbEVT_PL_DRAW_ROW_DECOR 14 - #define cbEVT_PL_DRAW_PANE_DECOR 15 - #define cbEVT_PL_DRAW_BAR_HANDLES 16 - #define cbEVT_PL_DRAW_ROW_HANDLES 17 - #define cbEVT_PL_DRAW_ROW_BKGROUND 18 - #define cbEVT_PL_DRAW_PANE_BKGROUND 19 +extern wxEventType cbEVT_PL_LEFT_DCLICK; - #define cbEVT_PL_START_BAR_DRAGGING 20 - #define cbEVT_PL_DRAW_HINT_RECT 21 +extern wxEventType cbEVT_PL_LAYOUT_ROW; +extern wxEventType cbEVT_PL_RESIZE_ROW; +extern wxEventType cbEVT_PL_LAYOUT_ROWS; +extern wxEventType cbEVT_PL_INSERT_BAR; +extern wxEventType cbEVT_PL_RESIZE_BAR; +extern wxEventType cbEVT_PL_REMOVE_BAR; +extern wxEventType cbEVT_PL_SIZE_BAR_WND; - #define cbEVT_PL_START_DRAW_IN_AREA 22 - #define cbEVT_PL_FINISH_DRAW_IN_AREA 23 +extern wxEventType cbEVT_PL_DRAW_BAR_DECOR; +extern wxEventType cbEVT_PL_DRAW_ROW_DECOR; +extern wxEventType cbEVT_PL_DRAW_PANE_DECOR; +extern wxEventType cbEVT_PL_DRAW_BAR_HANDLES; +extern wxEventType cbEVT_PL_DRAW_ROW_HANDLES; +extern wxEventType cbEVT_PL_DRAW_ROW_BKGROUND; +extern wxEventType cbEVT_PL_DRAW_PANE_BKGROUND; - #define cbEVT_PL_CUSTOMIZE_BAR 24 - #define cbEVT_PL_CUSTOMIZE_LAYOUT 25 +extern wxEventType cbEVT_PL_START_BAR_DRAGGING; +extern wxEventType cbEVT_PL_DRAW_HINT_RECT; - #define wxCUSTOM_CB_PLUGIN_EVENTS_START_AT 100 +extern wxEventType cbEVT_PL_START_DRAW_IN_AREA; +extern wxEventType cbEVT_PL_FINISH_DRAW_IN_AREA; -#endif // wxCHECK_VERSION(2,3,0) else +extern wxEventType cbEVT_PL_CUSTOMIZE_BAR; +extern wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT; -// forward decls, separated by categories +extern wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT; + +// Forward declarations, separated by categories. class cbLeftDownEvent; class cbLeftUpEvent; @@ -1372,7 +1607,7 @@ class cbFinishDrawInAreaEvent; class cbCustomizeBarEvent; class cbCustomizeLayoutEvent; -// defs. for handler-methods +// Definitions for for handler-methods. typedef void (wxEvtHandler::*cbLeftDownHandler )(cbLeftDownEvent&); typedef void (wxEvtHandler::*cbLeftUpHandler )(cbLeftUpEvent&); @@ -1406,485 +1641,615 @@ typedef void (wxEvtHandler::*cbFinishDrawInAreaHandler)(cbFinishDrawInAreaEvent& typedef void (wxEvtHandler::*cbCustomizeBarHandler )(cbCustomizeBarEvent&); typedef void (wxEvtHandler::*cbCustomizeLayoutHandler )(cbCustomizeLayoutEvent&); -// macros for creating event table entries for plugin-events - -#if wxCHECK_VERSION(2,3,0) - #define EVT_PL_LEFT_DOWN(func) wxEventTableEntry( cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_LEFT_UP(func) wxEventTableEntry( cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_RIGHT_DOWN(func) wxEventTableEntry( cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_RIGHT_UP(func) wxEventTableEntry( cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_MOTION(func) wxEventTableEntry( cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_LEFT_DCLICK(func) wxEventTableEntry( cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func, (wxObject *) NULL ), - - #define EVT_PL_LAYOUT_ROW(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_RESIZE_ROW(func) wxEventTableEntry( cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_LAYOUT_ROWS(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_INSERT_BAR(func) wxEventTableEntry( cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_RESIZE_BAR(func) wxEventTableEntry( cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_REMOVE_BAR(func) wxEventTableEntry( cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_SIZE_BAR_WND(func) wxEventTableEntry( cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func, (wxObject *) NULL ), - - #define EVT_PL_DRAW_BAR_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_ROW_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_PANE_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_BAR_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_ROW_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_ROW_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_PANE_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func, (wxObject *) NULL ), - - #define EVT_PL_START_BAR_DRAGGING(func) wxEventTableEntry( cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func, (wxObject *) NULL ), - #define EVT_PL_DRAW_HINT_RECT(func) wxEventTableEntry( cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func, (wxObject *) NULL ), - - - #define EVT_PL_START_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func, (wxObject *) NULL ), - #define EVT_PL_FINISH_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func, (wxObject *) NULL ), - - #define EVT_PL_CUSTOMIZE_BAR(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func, (wxObject *) NULL ), - #define EVT_PL_CUSTOMIZE_LAYOUT(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func, (wxObject *) NULL ), -#else - #define EVT_PL_LEFT_DOWN(func) { cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func }, - #define EVT_PL_LEFT_UP(func) { cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func }, - #define EVT_PL_RIGHT_DOWN(func) { cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func }, - #define EVT_PL_RIGHT_UP(func) { cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func }, - #define EVT_PL_MOTION(func) { cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func }, - #define EVT_PL_LEFT_DCLICK(func) { cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func }, - - #define EVT_PL_LAYOUT_ROW(func) { cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func }, - #define EVT_PL_RESIZE_ROW(func) { cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func }, - #define EVT_PL_LAYOUT_ROWS(func) { cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func }, - #define EVT_PL_INSERT_BAR(func) { cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func }, - #define EVT_PL_RESIZE_BAR(func) { cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func }, - #define EVT_PL_REMOVE_BAR(func) { cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func }, - #define EVT_PL_SIZE_BAR_WND(func) { cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func }, - - #define EVT_PL_DRAW_BAR_DECOR(func) { cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func }, - #define EVT_PL_DRAW_ROW_DECOR(func) { cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func }, - #define EVT_PL_DRAW_PANE_DECOR(func) { cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func }, - #define EVT_PL_DRAW_BAR_HANDLES(func) { cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func }, - #define EVT_PL_DRAW_ROW_HANDLES(func) { cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func }, - #define EVT_PL_DRAW_ROW_BKGROUND(func) { cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func }, - #define EVT_PL_DRAW_PANE_BKGROUND(func) { cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func }, - - #define EVT_PL_START_BAR_DRAGGING(func) { cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func }, - #define EVT_PL_DRAW_HINT_RECT(func) { cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func }, - - #define EVT_PL_START_DRAW_IN_AREA(func) { cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func }, - #define EVT_PL_FINISH_DRAW_IN_AREA(func) { cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func }, - - #define EVT_PL_CUSTOMIZE_BAR(func) { cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func }, - #define EVT_PL_CUSTOMIZE_LAYOUT(func) { cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func }, -#endif +// Macros for creating event table entries for plugin-events. + +#define EVT_PL_LEFT_DOWN(func) wxEventTableEntry( cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_LEFT_UP(func) wxEventTableEntry( cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_RIGHT_DOWN(func) wxEventTableEntry( cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_RIGHT_UP(func) wxEventTableEntry( cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_MOTION(func) wxEventTableEntry( cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_LEFT_DCLICK(func) wxEventTableEntry( cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func, (wxObject *) NULL ), + +#define EVT_PL_LAYOUT_ROW(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_RESIZE_ROW(func) wxEventTableEntry( cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_LAYOUT_ROWS(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_INSERT_BAR(func) wxEventTableEntry( cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_RESIZE_BAR(func) wxEventTableEntry( cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_REMOVE_BAR(func) wxEventTableEntry( cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_SIZE_BAR_WND(func) wxEventTableEntry( cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func, (wxObject *) NULL ), + +#define EVT_PL_DRAW_BAR_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_ROW_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_PANE_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_BAR_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_ROW_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_ROW_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_PANE_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func, (wxObject *) NULL ), + +#define EVT_PL_START_BAR_DRAGGING(func) wxEventTableEntry( cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func, (wxObject *) NULL ), +#define EVT_PL_DRAW_HINT_RECT(func) wxEventTableEntry( cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func, (wxObject *) NULL ), + + +#define EVT_PL_START_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func, (wxObject *) NULL ), +#define EVT_PL_FINISH_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func, (wxObject *) NULL ), + +#define EVT_PL_CUSTOMIZE_BAR(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func, (wxObject *) NULL ), +#define EVT_PL_CUSTOMIZE_LAYOUT(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func, (wxObject *) NULL ), + /* - * abstract base class for all control-bar related plugins - */ +Abstract base class for all control-bar related plugins. +Note: pointer positions of mouse events sent to plugins +are always in the pane's coordinates (the pane to which +this plugin is hooked). +*/ class cbPluginBase : public wxEvtHandler { - DECLARE_ABSTRACT_CLASS( cbPluginBase ) + DECLARE_ABSTRACT_CLASS( cbPluginBase ) public: + // Back-reference to the frame layout. + + wxFrameLayout* mpLayout; + + // Specifies panes for which this plugin receives events + // (see pane masks definitions). - wxFrameLayout* mpLayout; // back-reference to the frame layout + int mPaneMask; - // specifies panes, for which this plugin receives events - // (see pane masks definitions) - int mPaneMask; + // Is TRUE when plugin is ready to handle events. - bool mIsReady; // is TRUE, when plugin is ready to handle events + bool mIsReady; public: - cbPluginBase(void) + // Default constructor. - : mpLayout ( 0 ), - mPaneMask( wxALL_PANES ), - mIsReady ( FALSE ) - {} + cbPluginBase() - cbPluginBase( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ) + : mpLayout ( 0 ), + mPaneMask( wxALL_PANES ), + mIsReady ( FALSE ) + {} - : mpLayout ( pPanel ), - mPaneMask( paneMask ), - mIsReady ( FALSE ) - {} + // Constructor taking layout panel and a mask. - inline int GetPaneMask() { return mPaneMask; } + cbPluginBase( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ) - // NOTE:: pointer positions of mouse-events sent to plugins - // are always in pane's coordinates (pane's to which - // this plugin is hooked) + : mpLayout ( pPanel ), + mPaneMask( paneMask ), + mIsReady ( FALSE ) + {} - // destroys the whole plugin chain of connected plagins - virtual ~cbPluginBase(); + // Returns the pane mask. - // override this method to do plugin-specific initialization - // (at this point plugin is already attached to the frame layout, - // and pane masks are set) - virtual void OnInitPlugin() { mIsReady = TRUE; } + inline int GetPaneMask() { return mPaneMask; } - bool IsReady() { return mIsReady; } + // Destructor. Destroys the whole plugin chain of connected plugins. - // overriden, to determine whether the target pane specified in the - // event, matches the pane mask of this plugin (specific plugins - // do not override this method) + virtual ~cbPluginBase(); - virtual bool ProcessEvent(wxEvent& event); -}; + // Override this method to do plugin-specific initialization. + // At this point plugin is already attached to the frame layout, + // and pane masks are set. + + virtual void OnInitPlugin() { mIsReady = TRUE; } + + // Returns TRUE if the plugin is ready to receive events. + + bool IsReady() { return mIsReady; } -/*** event classes, for each corresponding event type (24 currnetly...uhh) ***/ + // Overridden to determine whether the target pane specified in the + // event matches the pane mask of this plugin (specific plugins + // do not override this method). -// mouse-events category + virtual bool ProcessEvent(wxEvent& event); +}; + +/* +Class for mouse left down events. +*/ class cbLeftDownEvent : public cbPluginEvent { public: - wxPoint mPos; + wxPoint mPos; + + // Constructor, taking mouse position and pane. - cbLeftDownEvent( const wxPoint& pos, cbDockPane* pPane ) + cbLeftDownEvent( const wxPoint& pos, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_LEFT_DOWN, pPane ), - mPos( pos ) - {} + : cbPluginEvent( cbEVT_PL_LEFT_DOWN, pPane ), + mPos( pos ) + {} }; +/* +Class for mouse left up events. +*/ + class cbLeftUpEvent : public cbPluginEvent { public: - wxPoint mPos; + wxPoint mPos; + + // Constructor, taking mouse position and pane. - cbLeftUpEvent( const wxPoint& pos, cbDockPane* pPane ) + cbLeftUpEvent( const wxPoint& pos, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_LEFT_UP, pPane ), - mPos( pos ) - {} + : cbPluginEvent( cbEVT_PL_LEFT_UP, pPane ), + mPos( pos ) + {} }; +/* +Class for mouse right down events. +*/ + class cbRightDownEvent : public cbPluginEvent { public: - wxPoint mPos; + wxPoint mPos; - cbRightDownEvent( const wxPoint& pos, cbDockPane* pPane ) + // Constructor, taking mouse position and pane. - : cbPluginEvent( cbEVT_PL_RIGHT_DOWN, pPane ), - mPos( pos ) - {} + cbRightDownEvent( const wxPoint& pos, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_RIGHT_DOWN, pPane ), + mPos( pos ) + {} }; +/* +Class for mouse right up events. +*/ + class cbRightUpEvent : public cbPluginEvent { public: - wxPoint mPos; + wxPoint mPos; - cbRightUpEvent( const wxPoint& pos, cbDockPane* pPane ) + // Constructor, taking mouse position and pane. - : cbPluginEvent( cbEVT_PL_RIGHT_UP, pPane ), - mPos( pos ) - {} + cbRightUpEvent( const wxPoint& pos, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_RIGHT_UP, pPane ), + mPos( pos ) + {} }; +/* +Class for mouse motion events. +*/ + class cbMotionEvent : public cbPluginEvent { public: - wxPoint mPos; + wxPoint mPos; + + // Constructor, taking mouse position and pane. - cbMotionEvent( const wxPoint& pos, cbDockPane* pPane ) + cbMotionEvent( const wxPoint& pos, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_MOTION, pPane ), - mPos( pos ) - {} + : cbPluginEvent( cbEVT_PL_MOTION, pPane ), + mPos( pos ) + {} }; +/* +Class for mouse left double click events. +*/ + class cbLeftDClickEvent : public cbPluginEvent { public: - wxPoint mPos; + wxPoint mPos; + + // Constructor, taking mouse position and pane. - cbLeftDClickEvent( const wxPoint& pos, cbDockPane* pPane ) + cbLeftDClickEvent( const wxPoint& pos, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_LEFT_DCLICK, pPane ), - mPos( pos ) - {} + : cbPluginEvent( cbEVT_PL_LEFT_DCLICK, pPane ), + mPos( pos ) + {} }; -// bar/row events category +/* +Class for single row layout events. +*/ class cbLayoutRowEvent : public cbPluginEvent { public: - cbRowInfo* mpRow; + cbRowInfo* mpRow; - cbLayoutRowEvent( cbRowInfo* pRow, cbDockPane* pPane ) + // Constructor, taking row information and pane. - : cbPluginEvent( cbEVT_PL_LAYOUT_ROW, pPane ), - mpRow( pRow ) - {} + cbLayoutRowEvent( cbRowInfo* pRow, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_LAYOUT_ROW, pPane ), + mpRow( pRow ) + {} }; +/* +Class for row resize events. +*/ + class cbResizeRowEvent : public cbPluginEvent { public: - cbRowInfo* mpRow; - int mHandleOfs; - bool mForUpperHandle; + cbRowInfo* mpRow; + int mHandleOfs; + bool mForUpperHandle; - cbResizeRowEvent( cbRowInfo* pRow, int handleOfs, bool forUpperHandle, cbDockPane* pPane ) + // Constructor, taking row information, two parameters of currently unknown use, and pane. - : cbPluginEvent( cbEVT_PL_RESIZE_ROW, pPane ), - mpRow( pRow ), - mHandleOfs( handleOfs ), - mForUpperHandle( forUpperHandle ) - {} + cbResizeRowEvent( cbRowInfo* pRow, int handleOfs, bool forUpperHandle, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_RESIZE_ROW, pPane ), + mpRow( pRow ), + mHandleOfs( handleOfs ), + mForUpperHandle( forUpperHandle ) + {} }; +/* +Class for multiple rows layout events. +*/ + class cbLayoutRowsEvent : public cbPluginEvent { public: - cbLayoutRowsEvent( cbDockPane* pPane ) + // Constructor, taking pane. - : cbPluginEvent( cbEVT_PL_LAYOUT_ROWS, pPane ) - {} + cbLayoutRowsEvent( cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_LAYOUT_ROWS, pPane ) + {} }; +/* +Class for bar insertion events. +*/ + class cbInsertBarEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; - cbRowInfo* mpRow; + cbBarInfo* mpBar; + cbRowInfo* mpRow; + + // Constructor, taking bar information, row information, and pane. - cbInsertBarEvent( cbBarInfo* pBar, cbRowInfo* pIntoRow, cbDockPane* pPane ) + cbInsertBarEvent( cbBarInfo* pBar, cbRowInfo* pIntoRow, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_INSERT_BAR, pPane ), + : cbPluginEvent( cbEVT_PL_INSERT_BAR, pPane ), - mpBar( pBar ), - mpRow( pIntoRow ) - {} + mpBar( pBar ), + mpRow( pIntoRow ) + {} }; +/* +Class for bar resize events. +*/ + class cbResizeBarEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; - cbRowInfo* mpRow; + cbBarInfo* mpBar; + cbRowInfo* mpRow; + + // Constructor, taking bar information, row information, and pane. - cbResizeBarEvent( cbBarInfo* pBar, cbRowInfo* pRow, cbDockPane* pPane ) + cbResizeBarEvent( cbBarInfo* pBar, cbRowInfo* pRow, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_RESIZE_BAR, pPane ), - mpBar( pBar ), - mpRow( pRow ) - {} + : cbPluginEvent( cbEVT_PL_RESIZE_BAR, pPane ), + mpBar( pBar ), + mpRow( pRow ) + {} }; +/* +Class for bar removal events. +*/ + class cbRemoveBarEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; + cbBarInfo* mpBar; - cbRemoveBarEvent( cbBarInfo* pBar, cbDockPane* pPane ) + // Constructor, taking bar information and pane. - : cbPluginEvent( cbEVT_PL_REMOVE_BAR, pPane ), - mpBar( pBar ) - {} + cbRemoveBarEvent( cbBarInfo* pBar, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_REMOVE_BAR, pPane ), + mpBar( pBar ) + {} }; +/* +Class for bar window resize events. +*/ + class cbSizeBarWndEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; - wxRect mBoundsInParent; + cbBarInfo* mpBar; + wxRect mBoundsInParent; - cbSizeBarWndEvent( cbBarInfo* pBar, cbDockPane* pPane ) + // Constructor, taking bar information and pane. - : cbPluginEvent( cbEVT_PL_SIZE_BAR_WND, pPane ), - mpBar( pBar ), - mBoundsInParent( pBar->mBoundsInParent ) - {} + cbSizeBarWndEvent( cbBarInfo* pBar, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_SIZE_BAR_WND, pPane ), + mpBar( pBar ), + mBoundsInParent( pBar->mBoundsInParent ) + {} }; +/* +Class for bar decoration drawing events. +*/ + class cbDrawBarDecorEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; - wxDC* mpDc; - wxRect mBoundsInParent; + cbBarInfo* mpBar; + wxDC* mpDc; + wxRect mBoundsInParent; + + // Constructor, taking bar information, device context, and pane. - cbDrawBarDecorEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane ) + cbDrawBarDecorEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_DRAW_BAR_DECOR, pPane ), - mpBar( pBar ), - mpDc( &dc ), - mBoundsInParent( pBar->mBoundsInParent ) - {} + : cbPluginEvent( cbEVT_PL_DRAW_BAR_DECOR, pPane ), + mpBar( pBar ), + mpDc( &dc ), + mBoundsInParent( pBar->mBoundsInParent ) + {} }; +/* +Class for row decoration drawing events. +*/ + class cbDrawRowDecorEvent : public cbPluginEvent { public: - cbRowInfo* mpRow; - wxDC* mpDc; + cbRowInfo* mpRow; + wxDC* mpDc; + + // Constructor, taking row information, device context, and pane. - cbDrawRowDecorEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane ) + cbDrawRowDecorEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_DRAW_ROW_DECOR, pPane ), - mpRow( pRow ), - mpDc( &dc ) - {} + : cbPluginEvent( cbEVT_PL_DRAW_ROW_DECOR, pPane ), + mpRow( pRow ), + mpDc( &dc ) + {} }; +/* +Class for pane decoration drawing events. +*/ + class cbDrawPaneDecorEvent : public cbPluginEvent { public: - wxDC* mpDc; + wxDC* mpDc; + + // Constructor, taking device context and pane. - cbDrawPaneDecorEvent( wxDC& dc, cbDockPane* pPane ) + cbDrawPaneDecorEvent( wxDC& dc, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_DRAW_PANE_DECOR, pPane ), - mpDc( &dc ) - {} + : cbPluginEvent( cbEVT_PL_DRAW_PANE_DECOR, pPane ), + mpDc( &dc ) + {} }; +/* +Class for bar handles drawing events. +*/ + class cbDrawBarHandlesEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; - wxDC* mpDc; + cbBarInfo* mpBar; + wxDC* mpDc; + + // Constructor, taking bar information, device context, and pane. - cbDrawBarHandlesEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane ) + cbDrawBarHandlesEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_DRAW_BAR_HANDLES, pPane ), - mpBar( pBar ), - mpDc( &dc ) - {} + : cbPluginEvent( cbEVT_PL_DRAW_BAR_HANDLES, pPane ), + mpBar( pBar ), + mpDc( &dc ) + {} }; +/* +Class for row handles drawing events. +*/ + class cbDrawRowHandlesEvent : public cbPluginEvent { public: - cbRowInfo* mpRow; - wxDC* mpDc; + cbRowInfo* mpRow; + wxDC* mpDc; + + // Constructor, taking row information, device context, and pane. - cbDrawRowHandlesEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane ) + cbDrawRowHandlesEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_DRAW_ROW_HANDLES, pPane ), - mpRow( pRow ), - mpDc( &dc ) - {} + : cbPluginEvent( cbEVT_PL_DRAW_ROW_HANDLES, pPane ), + mpRow( pRow ), + mpDc( &dc ) + {} }; +/* +Class for row background drawing events. +*/ + class cbDrawRowBkGroundEvent : public cbPluginEvent { public: - cbRowInfo* mpRow; - wxDC* mpDc; + cbRowInfo* mpRow; + wxDC* mpDc; - cbDrawRowBkGroundEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane ) + // Constructor, taking row information, device context, and pane. - : cbPluginEvent( cbEVT_PL_DRAW_ROW_BKGROUND, pPane ), - mpRow( pRow ), - mpDc( &dc ) - {} + cbDrawRowBkGroundEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_DRAW_ROW_BKGROUND, pPane ), + mpRow( pRow ), + mpDc( &dc ) + {} }; +/* +Class for pane background drawing events. +*/ + class cbDrawPaneBkGroundEvent : public cbPluginEvent { public: - wxDC* mpDc; + wxDC* mpDc; - cbDrawPaneBkGroundEvent( wxDC& dc, cbDockPane* pPane ) + // Constructor, taking device context and pane. - : cbPluginEvent( cbEVT_PL_DRAW_PANE_BKGROUND, pPane ), - mpDc( &dc ) - {} + cbDrawPaneBkGroundEvent( wxDC& dc, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_DRAW_PANE_BKGROUND, pPane ), + mpDc( &dc ) + {} }; +/* +Class for start-bar-dragging events. +*/ + class cbStartBarDraggingEvent : public cbPluginEvent { public: - cbBarInfo* mpBar; - wxPoint mPos; // is given in frame's coordinates + cbBarInfo* mpBar; + wxPoint mPos; // is given in frame's coordinates - cbStartBarDraggingEvent( cbBarInfo* pBar, const wxPoint& pos, cbDockPane* pPane ) + // Constructor, taking bar information, mouse position, and pane. - : cbPluginEvent( cbEVT_PL_START_BAR_DRAGGING, pPane ), - mpBar( pBar ), - mPos( pos ) - {} + cbStartBarDraggingEvent( cbBarInfo* pBar, const wxPoint& pos, cbDockPane* pPane ) + + : cbPluginEvent( cbEVT_PL_START_BAR_DRAGGING, pPane ), + mpBar( pBar ), + mPos( pos ) + {} }; +/* +Class for hint-rectangle drawing events. +*/ + class cbDrawHintRectEvent : public cbPluginEvent { public: - wxRect mRect; // is given in frame's coordinates + wxRect mRect; // is given in frame's coordinates - bool mLastTime; // indicates that this event finishes "session" of on-screen drawing, - // thus associated resources can be freed now - bool mEraseRect; // does not have any impact, if recangle is drawn using XOR-mask + bool mLastTime; // indicates that this event finishes "session" of on-screen drawing, + // thus associated resources can be freed now + bool mEraseRect; // does not have any impact, if recangle is drawn using XOR-mask - bool mIsInClient;// in cleint area hint could be drawn differently, - // e.g. with fat/hatched border + bool mIsInClient;// in cleint area hint could be drawn differently, + // e.g. with fat/hatched border - cbDrawHintRectEvent( const wxRect& rect, bool isInClient, bool eraseRect, bool lastTime ) + // Constructor, taking hint rectangle and three flags. - : cbPluginEvent( cbEVT_PL_DRAW_HINT_RECT, 0 ), - mRect ( rect ), - mLastTime ( lastTime ), - mEraseRect ( eraseRect ), - mIsInClient( isInClient ) - {} + cbDrawHintRectEvent( const wxRect& rect, bool isInClient, bool eraseRect, bool lastTime ) + + : cbPluginEvent( cbEVT_PL_DRAW_HINT_RECT, 0 ), + mRect ( rect ), + mLastTime ( lastTime ), + mEraseRect ( eraseRect ), + mIsInClient( isInClient ) + {} }; +/* +Class for start drawing in area events. +*/ + class cbStartDrawInAreaEvent : public cbPluginEvent { public: - wxRect mArea; - wxDC** mppDc; // points to pointer, where the reference - // to the obtained buffer-context should be placed + wxRect mArea; + wxDC** mppDc; // points to pointer, where the reference + // to the obtained buffer-context should be placed + + // Constructor, taking rectangular area, device context pointer to a pointer, and pane. - cbStartDrawInAreaEvent( const wxRect& area, wxDC** ppDCForArea, cbDockPane* pPane ) + cbStartDrawInAreaEvent( const wxRect& area, wxDC** ppDCForArea, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_START_DRAW_IN_AREA, pPane ), - mArea( area ), - mppDc( ppDCForArea ) - {} + : cbPluginEvent( cbEVT_PL_START_DRAW_IN_AREA, pPane ), + mArea( area ), + mppDc( ppDCForArea ) + {} }; +/* +Class for finish drawing in area events. +*/ + class cbFinishDrawInAreaEvent : public cbPluginEvent { public: - wxRect mArea; + wxRect mArea; + + // Constructor, taking rectangular area and pane. - cbFinishDrawInAreaEvent( const wxRect& area, cbDockPane* pPane ) + cbFinishDrawInAreaEvent( const wxRect& area, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_FINISH_DRAW_IN_AREA, pPane ), - mArea( area ) - {} + : cbPluginEvent( cbEVT_PL_FINISH_DRAW_IN_AREA, pPane ), + mArea( area ) + {} }; +/* +Class for bar customization events. +*/ + class cbCustomizeBarEvent : public cbPluginEvent { public: - wxPoint mClickPos; // in parent frame's coordinates - cbBarInfo* mpBar; + wxPoint mClickPos; // in parent frame's coordinates + cbBarInfo* mpBar; + + // Constructor, taking bar information, mouse position, and pane. - cbCustomizeBarEvent( cbBarInfo* pBar, const wxPoint& clickPos, cbDockPane* pPane ) + cbCustomizeBarEvent( cbBarInfo* pBar, const wxPoint& clickPos, cbDockPane* pPane ) - : cbPluginEvent( cbEVT_PL_CUSTOMIZE_BAR, pPane ), - mClickPos( clickPos ), - mpBar( pBar ) - {} + : cbPluginEvent( cbEVT_PL_CUSTOMIZE_BAR, pPane ), + mClickPos( clickPos ), + mpBar( pBar ) + {} }; +/* +Class for layout customization events. +*/ + class cbCustomizeLayoutEvent : public cbPluginEvent { public: - wxPoint mClickPos; // in parent frame's coordinates + wxPoint mClickPos; // in parent frame's coordinates + + // Constructor, taking mouse position. - cbCustomizeLayoutEvent( const wxPoint& clickPos ) + cbCustomizeLayoutEvent( const wxPoint& clickPos ) - : cbPluginEvent( cbEVT_PL_CUSTOMIZE_LAYOUT, 0 ), - mClickPos( clickPos ) - {} + : cbPluginEvent( cbEVT_PL_CUSTOMIZE_LAYOUT, 0 ), + mClickPos( clickPos ) + {} }; #endif /* __CONTROLBAR_G__ */ diff --git a/contrib/include/wx/fl/dynbarhnd.h b/contrib/include/wx/fl/dynbarhnd.h index 9b2933c054..84520cce7c 100644 --- a/contrib/include/wx/fl/dynbarhnd.h +++ b/contrib/include/wx/fl/dynbarhnd.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: dynbarhnd.h +// Purpose: This header simply includes controlbar.h. // Author: Aleksandras Gluchovas // Modified by: // Created: 23/01/99 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __DYNBARHND_G__ diff --git a/contrib/include/wx/fl/dyntbar.h b/contrib/include/wx/fl/dyntbar.h index 644308277a..ea075be582 100644 --- a/contrib/include/wx/fl/dyntbar.h +++ b/contrib/include/wx/fl/dyntbar.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: dyntbar.h +// Purpose: wxDynamicToolBar header // Author: Aleksandras Gluchovas // Modified by: // Created: ??/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __DYNTBAR_G__ @@ -19,13 +19,15 @@ #include "wx/tbarbase.h" #include "wx/dynarray.h" -// layout item +/* +Tool layout item. +*/ class wxToolLayoutItem : public wxObject { public: - wxRect mRect; - bool mIsSeparator; + wxRect mRect; + bool mIsSeparator; }; class wxDynToolInfo; @@ -33,160 +35,215 @@ class wxDynToolInfo; typedef wxToolLayoutItem* wxToolLayoutItemPtrT; typedef wxDynToolInfo* wxDynToolInfoPtrT; - WX_DEFINE_ARRAY( wxToolLayoutItemPtrT, wxLayoutItemArrayT ); WX_DEFINE_ARRAY( wxDynToolInfoPtrT, wxDynToolInfoArrayT ); -// base class for layouting algorithm implementations +/* +This is a base class for layout algorithm implementations. +*/ class LayoutManagerBase { public: - virtual void Layout( const wxSize& parentDim, - wxSize& resultingDim, - wxLayoutItemArrayT& items, - int horizGap, - int vertGap ) = 0; - - virtual ~LayoutManagerBase() {} + // Constructor. + virtual void Layout( const wxSize& parentDim, + wxSize& resultingDim, + wxLayoutItemArrayT& items, + int horizGap, + int vertGap ) = 0; + + // Destructor. + virtual ~LayoutManagerBase() {} }; -// layouts items in left-to-right order from -// top towards bottom +/* +BagLayout lays out items in left-to-right order from +top to bottom. +*/ class BagLayout : public LayoutManagerBase { public: - virtual void Layout( const wxSize& parentDim, - wxSize& resultingDim, - wxLayoutItemArrayT& items, - int horizGap, - int vertGap ); + // Constructor. + virtual void Layout( const wxSize& parentDim, + wxSize& resultingDim, + wxLayoutItemArrayT& items, + int horizGap, + int vertGap ); }; +/* +This class holds dynamic toolbar item information. +*/ + class wxDynToolInfo : public wxToolLayoutItem { - DECLARE_DYNAMIC_CLASS(wxDynToolInfo) + DECLARE_DYNAMIC_CLASS(wxDynToolInfo) public: - wxWindow* mpToolWnd; - int mIndex; - wxSize mRealSize; + wxWindow* mpToolWnd; + int mIndex; + wxSize mRealSize; }; -// layouting orientations for tools +// Layout orientations for tools #define LO_HORIZONTAL 0 #define LO_VERTICAL 1 #define LO_FIT_TO_WINDOW 2 -// class manages containment and layouting of tool-windows +/* +wxDynamicToolBar manages containment and layout of tool windows. +*/ class wxDynamicToolBar : public wxToolBarBase { - DECLARE_DYNAMIC_CLASS(wxDynamicToolBar) + DECLARE_DYNAMIC_CLASS(wxDynamicToolBar) protected: - friend class wxDynamicToolBarSerializer; + friend class wxDynamicToolBarSerializer; - wxDynToolInfoArrayT mTools; - LayoutManagerBase* mpLayoutMan; + wxDynToolInfoArrayT mTools; + LayoutManagerBase* mpLayoutMan; protected: - virtual void SizeToolWindows(); + // Internal function for sizing tool windows. + virtual void SizeToolWindows(); public: /* public properties */ - int mSepartorSize; // default: 8 - int mVertGap; // default: 0 - int mHorizGap; // default: 0 - + int mSepartorSize; // default: 8 + int mVertGap; // default: 0 + int mHorizGap; // default: 0 + public: - wxDynamicToolBar(); + // Default constructor. + + wxDynamicToolBar(); + + // Constructor: see the documentation for wxToolBar for details. + + wxDynamicToolBar(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + const long style = wxNO_BORDER, const int orientation = wxVERTICAL, + const int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr); + + // Destructor. - wxDynamicToolBar(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const long style = wxNO_BORDER, const int orientation = wxVERTICAL, - const int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr); + ~wxDynamicToolBar(void); - ~wxDynamicToolBar(void); + // Creation function: see the documentation for wxToolBar for details. - bool Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const long style = wxNO_BORDER, const int orientation = wxVERTICAL, const int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr); + bool Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + const long style = wxNO_BORDER, const int orientation = wxVERTICAL, const int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr); - // overridables + // Adds a tool. See the documentation for wxToolBar for details. - virtual void AddTool( int toolIndex, - wxWindow* pToolWindow, + virtual void AddTool( int toolIndex, + wxWindow* pToolWindow, const wxSize& size = wxDefaultSize ); - virtual void AddTool( int toolIndex, + // Adds a tool. See the documentation for wxToolBar for details. + + virtual void AddTool( int toolIndex, const wxString& imageFileName, wxBitmapType imageFileType = wxBITMAP_TYPE_BMP, const wxString& labelText = "", bool alignTextRight = FALSE, bool isFlat = TRUE ); - virtual void AddTool( int toolIndex, wxBitmap labelBmp, + // Adds a tool. See the documentation for wxToolBar for details. + + virtual void AddTool( int toolIndex, wxBitmap labelBmp, const wxString& labelText = "", bool alignTextRight = FALSE, bool isFlat = TRUE ); - // method from wxToolBarBase (for compatibility), only - // first two arguments are valid + // Method from wxToolBarBase (for compatibility), only + // the first two arguments are valid. + // See the documentation for wxToolBar for details. - virtual wxToolBarToolBase *AddTool(const int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap, + virtual wxToolBarToolBase *AddTool(const int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap, const bool toggle = FALSE, const long xPos = -1, const long yPos = -1, wxObject *clientData = NULL, const wxString& helpString1 = "", const wxString& helpString2 = ""); - virtual void AddSeparator( wxWindow* pSepartorWnd = NULL ); + // Adds a separator. See the documentation for wxToolBar for details. + + virtual void AddSeparator( wxWindow* pSepartorWnd = NULL ); + + // Returns tool information for the given tool index. + + wxDynToolInfo* GetToolInfo( int toolIndex ); + + // Removes the given tool. Misspelt in order not to clash with a similar function + // in the base class. + + void RemveTool( int toolIndex ); + + // Draws a separator. The default implementation draws a shaded line. - wxDynToolInfo* GetToolInfo( int toolIndex ); + virtual void DrawSeparator( wxDynToolInfo& info, wxDC& dc ); - void RemveTool( int toolIndex ); + // Performs layout. See definitions of orientation types. - // the default implementation draws shaded line - virtual void DrawSeparator( wxDynToolInfo& info, wxDC& dc ); + virtual bool Layout(); - // see definitions of orientation types - virtual bool Layout(); + // Returns the preferred dimension, taking the given dimension and a reference to the result. - virtual void GetPreferredDim( const wxSize& givenDim, wxSize& prefDim ); + virtual void GetPreferredDim( const wxSize& givenDim, wxSize& prefDim ); - virtual LayoutManagerBase* CreateDefaulLayout() { return new BagLayout(); } + // Creates the default layout (BagLayout). - virtual void SetLayout( LayoutManagerBase* pLayout ); + virtual LayoutManagerBase* CreateDefaultLayout() { return new BagLayout(); } - virtual void EnableTool(const int toolIndex, const bool enable = TRUE); + // Sets the layout for this toolbar. - // event handlers + virtual void SetLayout( LayoutManagerBase* pLayout ); - void OnSize( wxSizeEvent& event ); - void OnPaint( wxPaintEvent& event ); - void OnEraseBackground( wxEraseEvent& event ); + // Enables or disables the given tool. - // overriden from wxToolBarBase + virtual void EnableTool(const int toolIndex, const bool enable = TRUE); - virtual bool Realize(void); + // Responds to size events, calling Layout. - // stuff from the 2.1.15 + void OnSize( wxSizeEvent& event ); + + // Responds to paint events, drawing separators. + + void OnPaint( wxPaintEvent& event ); + + // Responds to background erase events. Currently does nothing. + + void OnEraseBackground( wxEraseEvent& event ); + + // Overriden from wxToolBarBase; does nothing. + + virtual bool Realize(void); + + // Finds a tool for the given position. virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; + // Inserts a tool at the given position. virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); - // the tool is still in m_tools list when this function is called, it will - // only be deleted from it if it succeeds + // Deletes a tool. The tool is still in m_tools list when this function is called, and it will + // only be deleted from it if it succeeds. + virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); - // called when the tools enabled flag changes + // Called when the tools enabled flag changes. + virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); - // called when the tool is toggled + // Called when the tool is toggled. + virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); - // called when the tools "can be toggled" flag changes + // Called when the tools 'can be toggled' flag changes. + virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); - // the functions to create toolbar tools + // Creates a toolbar tool. + virtual wxToolBarToolBase *CreateTool(int id, const wxBitmap& bitmap1, const wxBitmap& bitmap2, @@ -194,10 +251,12 @@ public: wxObject *clientData, const wxString& shortHelpString, const wxString& longHelpString); - virtual wxToolBarToolBase *CreateTool(wxControl *control); + // Creates a toolbar tool. + + virtual wxToolBarToolBase *CreateTool(wxControl *control); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __DYNTBAR_G__ */ diff --git a/contrib/include/wx/fl/dyntbarhnd.h b/contrib/include/wx/fl/dyntbarhnd.h index 1fed738ccf..f0ceaa5621 100644 --- a/contrib/include/wx/fl/dyntbarhnd.h +++ b/contrib/include/wx/fl/dyntbarhnd.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. +// Name: dyntbarhnd.h // Purpose: Contrib. demo // Author: Aleksandras Gluchovas // Modified by: // Created: 23/01/99 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __DYNTBARHND_G__ @@ -19,12 +19,22 @@ #include "wx/fl/controlbar.h" #include "wx/fl/dyntbar.h" +/* +Dynamic toolbar dimension handler. +*/ + class cbDynToolBarDimHandler : public cbBarDimHandlerBase { - DECLARE_DYNAMIC_CLASS( cbDynToolBarDimHandler ) + DECLARE_DYNAMIC_CLASS( cbDynToolBarDimHandler ) public: - void OnChangeBarState(cbBarInfo* pBar, int newState ); - void OnResizeBar( cbBarInfo* pBar, const wxSize& given, wxSize& preferred ); + + // Called when the bar changes state. + + void OnChangeBarState(cbBarInfo* pBar, int newState ); + + // Called when a bar is resized. + + void OnResizeBar( cbBarInfo* pBar, const wxSize& given, wxSize& preferred ); }; #endif /* __DYNTBARHND_G__ */ diff --git a/contrib/include/wx/fl/frmview.h b/contrib/include/wx/fl/frmview.h index 90f33702f6..b12e3fbbc5 100644 --- a/contrib/include/wx/fl/frmview.h +++ b/contrib/include/wx/fl/frmview.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: frmview.h +// Purpose: wxFrameView and wxFrameManager classes. // Author: Aleksandras Gluchovas // Modified by: // Created: 02/01/99 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __FRMVIEW_G__ @@ -28,112 +28,120 @@ class wxObjectStorage; class wxFrameManager; +/* +It is not clear what this class does. It is not used elsewhere in FL. +*/ + class wxFrameView : public wxEvtHandler { protected: - wxStringList mTopMenus; - wxFrameLayout* mpLayout; - wxFrameManager* mpFrameMgr; - bool mDoToolUpdates; + wxStringList mTopMenus; + wxFrameLayout* mpLayout; + wxFrameManager* mpFrameMgr; + bool mDoToolUpdates; - friend class wxFrameManager; - friend class wxFrameViewSerializer; + friend class wxFrameManager; + friend class wxFrameViewSerializer; protected: - void OnIdle( wxIdleEvent& event); - + void OnIdle( wxIdleEvent& event); + public: - wxFrameView(); - ~wxFrameView(); + wxFrameView(); + ~wxFrameView(); - virtual void Activate(); - virtual void Deactivate(); + virtual void Activate(); + virtual void Deactivate(); - wxFrame* GetParentFrame(); - wxWindow* GetClientWindow(); + wxFrame* GetParentFrame(); + wxWindow* GetClientWindow(); - wxFrameManager& GetFrameManager(); + wxFrameManager& GetFrameManager(); - void RegisterMenu( const wxString& topMenuName ); + void RegisterMenu( const wxString& topMenuName ); - void CreateLayout(); - wxFrameLayout* GetLayout(); - void SetLayout( wxFrameLayout* pLayout ); - void SetToolUpdates( bool doToolUpdates = TRUE ); + void CreateLayout(); + wxFrameLayout* GetLayout(); + void SetLayout( wxFrameLayout* pLayout ); + void SetToolUpdates( bool doToolUpdates = TRUE ); - // hooks for specific frame-views + // hooks for specific frame-views - virtual void OnInit() {} + virtual void OnInit() {} - virtual void OnSerialize( wxObjectStorage& store ) {} - virtual void OnActiveate() {} - virtual void OnDeactivate() {} + virtual void OnSerialize( wxObjectStorage& store ) {} + virtual void OnActiveate() {} + virtual void OnDeactivate() {} - // imp. is mandatory - virtual void OnRecreate() {} - virtual void OnInitMenus() {} + // imp. is mandatory + virtual void OnRecreate() {} + virtual void OnInitMenus() {} - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; class wxFrame; +/* +It is not clear what this class does. It is not used elsewhere in FL. +*/ + class wxFrameManager : wxObject { protected: - wxList mViews; - wxWindow* mpFrameWnd; - int mActiveViewNo; - wxWindow* mpClientWnd; + wxList mViews; + wxWindow* mpFrameWnd; + int mActiveViewNo; + wxWindow* mpClientWnd; #if 0 - wxObjectStorage mStore; + wxObjectStorage mStore; #endif - wxString mSettingsFile; + wxString mSettingsFile; protected: - void DoSerialize( wxObjectStorage& store ); - void DestroyViews(); - int GetViewNo( wxFrameView* pView ); - void EnableMenusForView( wxFrameView* pView, bool enable ); - void SyncAllMenus(); + void DoSerialize( wxObjectStorage& store ); + void DestroyViews(); + int GetViewNo( wxFrameView* pView ); + void EnableMenusForView( wxFrameView* pView, bool enable ); + void SyncAllMenus(); public: - wxFrameManager(); - ~wxFrameManager(); + wxFrameManager(); + ~wxFrameManager(); - // if file name is empty, views are are not saved/loaded + // if file name is empty, views are are not saved/loaded - virtual void Init( wxWindow* pMainFrame, const wxString& settingsFile = "" ); + virtual void Init( wxWindow* pMainFrame, const wxString& settingsFile = "" ); - // synonyms - wxFrame* GetParentFrame(); - wxWindow* GetParentWindow(); + // synonyms + wxFrame* GetParentFrame(); + wxWindow* GetParentWindow(); - int GetActiveViewNo(); - wxFrameView* GetActiveView(); - wxNode* GetActiveViewNode(); + int GetActiveViewNo(); + wxFrameView* GetActiveView(); + wxNode* GetActiveViewNode(); - wxFrameView* GetView( int viewNo ); + wxFrameView* GetView( int viewNo ); - void SetClinetWindow( wxWindow* pFrameClient ); - wxWindow* GetClientWindow(); + void SetClinetWindow( wxWindow* pFrameClient ); + wxWindow* GetClientWindow(); - void AddView( wxFrameView* pFrmView ); - void RemoveView( wxFrameView* pFrmView ); + void AddView( wxFrameView* pFrmView ); + void RemoveView( wxFrameView* pFrmView ); - void ActivateView( int viewNo ); - void ActivateView( wxFrameView* pFrmView ); - void DeactivateCurrentView(); + void ActivateView( int viewNo ); + void ActivateView( wxFrameView* pFrmView ); + void DeactivateCurrentView(); - wxObjectStorage& GetObjectStore(); + wxObjectStorage& GetObjectStore(); - void SaveViewsNow(); - bool ReloadViews(); + void SaveViewsNow(); + bool ReloadViews(); - bool ViewsAreLoaded(); + bool ViewsAreLoaded(); }; #endif /* __FRMVIEW_G__ */ diff --git a/contrib/include/wx/fl/garbagec.h b/contrib/include/wx/fl/garbagec.h index d710e9f7a3..1c70b6e84a 100644 --- a/contrib/include/wx/fl/garbagec.h +++ b/contrib/include/wx/fl/garbagec.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: garbagec.h +// Purpose: GarbageCollector class. // Author: Aleksandras Gluchovas (@Lithuania) // Modified by: // Created: ??/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GARBAGEC_G__ @@ -20,54 +20,72 @@ struct GCItem { - void* mpObj; - wxList mRefs; // references to other nodes + void* mpObj; + wxList mRefs; // references to other nodes }; inline void* gc_node_to_obj( wxNode* pGCNode ) { - return ( (GCItem*) (pGCNode->Data()) )->mpObj; + return ( (GCItem*) (pGCNode->Data()) )->mpObj; } -// class implements extremely slow, but probably one of the most simple GC algorithms +/* +This class implements an extremely slow but simple garbage collection algorithm. +*/ class GarbageCollector { protected: - wxList mAllNodes; - wxList mRegularLst; - wxList mCycledLst; + wxList mAllNodes; + wxList mRegularLst; + wxList mCycledLst; - wxNode* FindItemNode( void* pForObj ); - void ResolveReferences(); + // Internal method for finding a node. + wxNode* FindItemNode( void* pForObj ); - wxNode* FindReferenceFreeItemNode(); - void RemoveReferencesToNode( wxNode* pItemNode ); - void DestroyItemList( wxList& lst ); + // Internal method for resolving references. + void ResolveReferences(); + + // Internal method for findind and freeing a node. + wxNode* FindReferenceFreeItemNode(); + + // Remove references to this node. + void RemoveReferencesToNode( wxNode* pItemNode ); + + // Destroys a list of items. + void DestroyItemList( wxList& lst ); public: - GarbageCollector() {} + // Default constructor. + GarbageCollector() {} + + // Destructor. + virtual ~GarbageCollector(); + + // Prepare data for garbage collection. + + virtual void AddObject( void* pObj, int refCnt = 1 ); + + // Prepare data for garbage collection. - virtual ~GarbageCollector(); + virtual void AddDependency( void* pObj, void* pDependsOnObj ); - // prepare data for GC alg. + // Executes garbage collection algorithm. - virtual void AddObject( void* pObj, int refCnt = 1 ); - virtual void AddDependency( void* pObj, void* pDependsOnObj ); + virtual void ArrangeCollection(); - // executes GC alg. + // Accesses the results of the algorithm. - virtual void ArrangeCollection(); + wxList& GetRegularObjects(); - // access results of the alg. + // Get cycled objects. - wxList& GetRegularObjects(); - wxList& GetCycledObjects(); + wxList& GetCycledObjects(); - // removes all data from GC + // Removes all data from the garbage collector. - void Reset(); + void Reset(); }; #endif /* __GARBAGEC_G__ */ diff --git a/contrib/include/wx/fl/gcupdatesmgr.h b/contrib/include/wx/fl/gcupdatesmgr.h index e8fabc5acc..544e43ea23 100644 --- a/contrib/include/wx/fl/gcupdatesmgr.h +++ b/contrib/include/wx/fl/gcupdatesmgr.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: gcupdatesmgr.h +// Purpose: Header for cbGCUpdatesMgr class. // Author: Aleksandras Gluchovas // Modified by: // Created: 19/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GCUPDATESMGR_G__ @@ -22,101 +22,107 @@ #include "wx/fl/garbagec.h" /* - * class implements optimized logic for refreshing - * areas of frame layout - which actually need to be updated. - * Is used as default updates-manager by wxFrameLayout. - * - * it is called "Garbage Collecting" u.mgr for it's implementation - * tries to find out dependencies between bars, and to order - * them ito "hierarchy", this hierarchical sorting resembles - * implemenation of heap-garbage collectors, which resolve - * dependencies between references. - * - * Example: there are situations where the order of moving - * the windows does matter: - * - * case 1) - * ------ --- - * | A | |B| - * ------ ---> | | - * --- --- ------ - * |B| | A | - * | | ------ - * --- - * (future) - * (past) - * - * past/future positions of A and B windows completely overlapp, i.e. - * depend on each other, and there is not solution for - * moving the windows witout refreshing both of them, - * -- we have cyclic dependency here. The gc. alg will - * find this cyclic dependecy and will force "refresh" - * after movement. - * - * case 2) - * - * ------ - * | A | - * ------ ---> - * --- - * |B| ------ - * | | | A | - * --- ------ - * --- - * |B| - * | | - * --- - * - * (future) - * (past) - * - * in this case past/future positions do not overlapp, thus - * it's enough only to move windows, without refreshing them. - * GC will "notice" it. - * - * there is also third case, when overlapping is partial - * in this case the refershing can be also avoided by - * moving windows in the order of "most-dependant" towards the - * "least-dependent". GC handles this automatically, by - * sorting windows by their dependency-level (or "hierarchy") - * - * See garbagec.h for more details of this method, garbagec.h/cpp - * implement sorting of generic-dependencies (does not deal - * with graphical objects directly) - * - * Summary: improves performance when complex/large windows are - * moved around, by reducing number of repaints. Also helps - * to avoid dirty non-client areas of moved windows - * in some special cases of "overlapping anomalies" - */ +This class implements optimized logic for refreshing +the areas of frame layout that actually need to be updated. +It is used as the default updates manager by wxFrameLayout. + +It is called 'Garbage Collecting' updates manager because +its implementation tries to find out dependencies between bars, +and to order them into a 'hierarchy'. This hierarchical sorting resembles +the implementation of heap-garbage collectors, which resolve +dependencies between references. + +Example: there are situations where the order in which the user +moves windows does matter. + +\begin{verbatim} + case 1) + ------ --- + | A | |B| + ------ ---> | | + --- --- ------ + |B| | A | + | | ------ + --- + (future) + (past) +\end{verbatim} + +Past/future positions of A and B windows completely overlap, i.e. +depend on each other, and there is no solution for +moving the windows without refreshing both of them +-- we have a cyclic dependency here. The garbage collection algorithm will +find this cyclic dependecy and will force refresh after movement. + +\begin{verbatim} + case 2) + + ------ + | A | + ------ ---> + --- + |B| ------ + | | | A | + --- ------ + --- + |B| + | | + --- + + (future) + (past) +\end{verbatim} + +In this case past/future positions do not overlap, so +it is enough only to move windows without refreshing them. +Garbage collection will 'notice' this. + +There is also a third case, when overlapping is partial. +In this case the refreshing can also be avoided by +moving windows in the order of 'most-dependant' towards the +'least-dependent'. GC handles this automatically, by +sorting windows by their dependency-level (or 'hierarchy'). + +See garbagec.h for more details of this method; garbagec.h/cpp +implement sorting of generic dependencies and does not deal +with graphical objects directly. + +Summary: garbage collection improves performance when complex or large +windows are moved around, by reducing the number of repaints. It also helps +to avoid dirty non-client areas of moved windows +in some special cases of 'overlapping anomalies'. +*/ class cbGCUpdatesMgr : public cbSimpleUpdatesMgr { - DECLARE_DYNAMIC_CLASS( cbGCUpdatesMgr ) + DECLARE_DYNAMIC_CLASS( cbGCUpdatesMgr ) protected: - GarbageCollector mGC; + GarbageCollector mGC; - void DoRepositionItems( wxList& items ); + // Internal function for repositioning items. + void DoRepositionItems( wxList& items ); - void AddItem( wxList& itemList, - cbBarInfo* pBar, - cbDockPane* pPane, - wxRect& curBounds, - wxRect& prevBounds ); + // Internal function for repositioning items. + void AddItem( wxList& itemList, + cbBarInfo* pBar, + cbDockPane* pPane, + wxRect& curBounds, + wxRect& prevBounds ); public: - cbGCUpdatesMgr(void) {} + // Default constructor. + cbGCUpdatesMgr(void) {} - cbGCUpdatesMgr( wxFrameLayout* pPanel ); + // Constructor, taking a frame layout. + cbGCUpdatesMgr( wxFrameLayout* pPanel ); - // notificiactions received from Frame Layout : + // Receives notifications from the frame layout. + virtual void OnStartChanges(); - virtual void OnStartChanges(); - - // refreshes parts of the frame layout, which need an update - virtual void UpdateNow(); + // Refreshes the parts of the frame layout which need an update. + virtual void UpdateNow(); }; #endif /* __GCUPDATESMGR_G__ */ diff --git a/contrib/include/wx/fl/hintanimpl.h b/contrib/include/wx/fl/hintanimpl.h index 4d8d07a648..65a2d01b4c 100644 --- a/contrib/include/wx/fl/hintanimpl.h +++ b/contrib/include/wx/fl/hintanimpl.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: hintanimpl.h +// Purpose: Header for cbHintAnimationPlugin class. // Author: Aleksandras Gluchovas // Modified by: // Created: 9/11/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __HINTANIMPL_G__ @@ -22,98 +22,120 @@ class cbHintAnimTimer; +/* +A plugin to draw animated hints when the user drags a pane. +*/ + class cbHintAnimationPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbHintAnimationPlugin ) + DECLARE_DYNAMIC_CLASS( cbHintAnimationPlugin ) protected: - friend class cbHintAnimTimer; + friend class cbHintAnimTimer; - wxScreenDC* mpScrDc; // created while tracking hint-rect - cbHintAnimTimer* mpAnimTimer; + wxScreenDC* mpScrDc; // created while tracking hint-rect + cbHintAnimTimer* mpAnimTimer; - // FOR NOW:: try it without mutually exculisve locks - volatile wxRect mCurRect; + // FOR NOW:: try it without mutually exculisve locks + volatile wxRect mCurRect; - // state variables + // state variables - bool mAnimStarted; - bool mStopPending; + bool mAnimStarted; + bool mStopPending; - bool mPrevInClient; - bool mCurInClient; + bool mPrevInClient; + bool mCurInClient; - wxRect mPrevRect; + wxRect mPrevRect; public: - int mMorphDelay; // delay between frames in miliseconds, default: 20 - int mMaxFrames; // number of iterations for hint morphing, default: 30 - // (morph duration = mMorphDelay * mMaxFrames msec) + int mMorphDelay; // delay between frames in miliseconds, default: 20 + int mMaxFrames; // number of iterations for hint morphing, default: 30 + // (morph duration = mMorphDelay * mMaxFrames msec) - int mInClientHintBorder; // default: 4 pixels + int mInClientHintBorder; // default: 4 pixels - bool mAccelerationOn; // TRUE, if morph accelerates, otherwise morph - // speed is constant. Default: TRUE + bool mAccelerationOn; // TRUE, if morph accelerates, otherwise morph + // speed is constant. Default: TRUE - // TBD:: get/set methods for above members + // TBD:: get/set methods for above members protected: - void StartTracking(); - void DrawHintRect ( wxRect& rect, bool isInClientRect); - void EraseHintRect( wxRect& rect, bool isInClientRect); + // Internal function for starting tracking. + void StartTracking(); + + // Internal function for drawing a hint rectangle. + void DrawHintRect ( wxRect& rect, bool isInClientRect); - void FinishTracking(); + // Internal function for erasing a hint rectangle. + void EraseHintRect( wxRect& rect, bool isInClientRect); - void DoDrawHintRect( wxRect& rect, bool isInClientRect); + // Internal function for finishing tracking. + void FinishTracking(); - void RectToScr( wxRect& frameRect, wxRect& scrRect ); + // Internal function for drawing a hint rectangle. + void DoDrawHintRect( wxRect& rect, bool isInClientRect); + + // Internal function for translating coordinates. + void RectToScr( wxRect& frameRect, wxRect& scrRect ); public: - cbHintAnimationPlugin(void); + // Default constructor. + cbHintAnimationPlugin(); - ~cbHintAnimationPlugin(); + // Constructor, taking a layout panel and pane mask. + cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); - cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Destructor. + ~cbHintAnimationPlugin(); - void OnDrawHintRect( cbDrawHintRectEvent& event ); + // Event handler respoding to hint draw events. + void OnDrawHintRect( cbDrawHintRectEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; -// helper classes +/* +A private helper class. +*/ struct MorphInfoT { - wxPoint mFrom; - wxPoint mTill; + wxPoint mFrom; + wxPoint mTill; }; +/* +A private helper class. +*/ + class cbHintAnimTimer : public wxTimer { protected: - friend class cbHintAnimationPlugin; + friend class cbHintAnimationPlugin; - wxRect mPrevMorphed; + wxRect mPrevMorphed; - MorphInfoT mUpperLeft; - MorphInfoT mLowerRight; - int mCurIter; + MorphInfoT mUpperLeft; + MorphInfoT mLowerRight; + int mCurIter; - long mLock; + long mLock; - cbHintAnimationPlugin* mpPl; + cbHintAnimationPlugin* mpPl; - void MorphPoint( wxPoint& origin, MorphInfoT& info, wxPoint& point ); + void MorphPoint( wxPoint& origin, MorphInfoT& info, wxPoint& point ); public: - cbHintAnimTimer(void); + cbHintAnimTimer(void); - virtual void Notify(void); + virtual void Notify(void); - virtual bool Init( cbHintAnimationPlugin* pAnimPl, bool reinit ); + virtual bool Init( cbHintAnimationPlugin* pAnimPl, bool reinit ); }; #endif /* __HINTANIMPL_G__ */ diff --git a/contrib/include/wx/fl/newbmpbtn.h b/contrib/include/wx/fl/newbmpbtn.h index 1363d73829..609923f417 100644 --- a/contrib/include/wx/fl/newbmpbtn.h +++ b/contrib/include/wx/fl/newbmpbtn.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: newbmpbtn.h +// Purpose: wxNewBitmapButton header. // Author: Aleksandras Gluchovas // Modified by: // Created: ??/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __NEWBMPBTN_G__ @@ -19,7 +19,7 @@ #include "wx/button.h" #include "wx/string.h" -// button lable-text alignment types +// button label-text alignment types #define NB_ALIGN_TEXT_RIGHT 0 #define NB_ALIGN_TEXT_BOTTOM 1 @@ -31,89 +31,96 @@ class wxNewBitmapButton; class wxBorderLessBitmapButton; -// alternative class for wxBmpButton +/* +This is an alternative class to wxBitmapButton. It is used +in the implementation of dynamic toolbars. +*/ class wxNewBitmapButton: public wxPanel { - DECLARE_DYNAMIC_CLASS(wxNewBitmapButton) + DECLARE_DYNAMIC_CLASS(wxNewBitmapButton) protected: - friend class wxNewBitmapButtonSerializer; + friend class wxNewBitmapButtonSerializer; - int mTextToLabelGap; - int mMarginX; - int mMarginY; - int mTextAlignment; - bool mIsSticky; - bool mIsFlat; + int mTextToLabelGap; + int mMarginX; + int mMarginY; + int mTextAlignment; + bool mIsSticky; + bool mIsFlat; - wxString mLabelText; - wxString mImageFileName; - wxBitmapType mImageFileType; + wxString mLabelText; + wxString mImageFileName; + wxBitmapType mImageFileType; - wxBitmap mDepressedBmp; // source image for rendering - // labels for particular state + wxBitmap mDepressedBmp; // source image for rendering + // labels for particular state - wxBitmap mFocusedBmp; // may not be always present - - // only if mHasFocusedBmp is TRUE + wxBitmap mFocusedBmp; // may not be always present - + // only if mHasFocusedBmp is TRUE - wxBitmap* mpDepressedImg; - wxBitmap* mpPressedImg; - wxBitmap* mpDisabledImg; - wxBitmap* mpFocusedImg; + wxBitmap* mpDepressedImg; + wxBitmap* mpPressedImg; + wxBitmap* mpDisabledImg; + wxBitmap* mpFocusedImg; - // button state variables; - bool mDragStarted; - bool mIsPressed; - bool mIsInFocus; - bool mPrevPressedState; - bool mPrevInFocusState; + // button state variables; + bool mDragStarted; + bool mIsPressed; + bool mIsInFocus; + bool mPrevPressedState; + bool mPrevInFocusState; - bool mHasFocusedBmp; + bool mHasFocusedBmp; - // type of event which is fired upon depression of this button - int mFiredEventType; + // type of event which is fired upon depression of this button + int mFiredEventType; - // pens for drawing decorations (borders) - wxPen mBlackPen; - wxPen mDarkPen; - wxPen mGrayPen; - wxPen mLightPen; + // pens for drawing decorations (borders) + wxPen mBlackPen; + wxPen mDarkPen; + wxPen mGrayPen; + wxPen mLightPen; - bool mIsCreated; - int mSizeIsSet; + bool mIsCreated; + int mSizeIsSet; protected: - void DestroyLabels(); - // returns the label which match the current button state - virtual wxBitmap* GetStateLabel(); + // Internal function for destroying labels. + void DestroyLabels(); - virtual void DrawShade( int outerLevel, - wxDC& dc, - wxPen& upperLeftSidePen, - wxPen& lowerRightSidePen ); + // Returns the label that matches the current button state. + virtual wxBitmap* GetStateLabel(); - bool IsInWindow( int x,int y ); + // Draws shading on the button. + virtual void DrawShade( int outerLevel, + wxDC& dc, + wxPen& upperLeftSidePen, + wxPen& lowerRightSidePen ); + + // Returns TRUE if the given point is in the window. + bool IsInWindow( int x, int y ); public: - wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap, - const wxString& labelText = "", - int alignText = NB_ALIGN_TEXT_BOTTOM, - bool isFlat = TRUE, - // this is the default type of fired events - int firedEventType = wxEVT_COMMAND_MENU_SELECTED, - int marginX = 2, - int marginY = 2, - int textToLabelGap = 2, - bool isSticky = FALSE - ); - - // use this constructor if buttons have to be persistant - - wxNewBitmapButton( const wxString& bitmapFileName, + // Constructor. + wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap, + const wxString& labelText = "", + int alignText = NB_ALIGN_TEXT_BOTTOM, + bool isFlat = TRUE, + // this is the default type of fired events + int firedEventType = wxEVT_COMMAND_MENU_SELECTED, + int marginX = 2, + int marginY = 2, + int textToLabelGap = 2, + bool isSticky = FALSE + ); + + // Use this constructor if buttons have to be persistant + wxNewBitmapButton( const wxString& bitmapFileName, const wxBitmapType bitmapFileType = wxBITMAP_TYPE_BMP, const wxString& labelText = "", int alignText = NB_ALIGN_TEXT_BOTTOM, @@ -126,39 +133,61 @@ public: bool isSticky = FALSE ); - ~wxNewBitmapButton(); + // Destructor. + ~wxNewBitmapButton(); + + // This function should be called after Create. It renders the labels, having + // reloaded the button image if necessary. + virtual void Reshape(); + + // Sets the label and optionally label text. + virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = "" ); + + // Sets the text alignment and margins. + virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM, + int marginX = 2, + int marginY = 2, + int textToLabelGap = 2); + + // Draws the decorations. + virtual void DrawDecorations( wxDC& dc ); + + // Draws the label. + virtual void DrawLabel( wxDC& dc ); + + // Renders the label image. + virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp, + bool isEnabled = TRUE, + bool isPressed = FALSE); + + // Renders label images. + virtual void RenderLabelImages(); + + // Renders label images. + virtual void RenderAllLabelImages(); + + // Responds to a left mouse button down event. + void OnLButtonDown( wxMouseEvent& event ); - // should be called after Create(); - virtual void Reshape(); + // Responds to a left mouse button up event. + void OnLButtonUp( wxMouseEvent& event ); - // overridables - virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = "" ); - - virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM, - int marginX = 2, - int marginY = 2, - int textToLabelGap = 2); + // Responds to a mouse move event. + void OnMouseMove( wxMouseEvent& event ); - virtual void DrawDecorations( wxDC& dc ); - virtual void DrawLabel( wxDC& dc ); + // Responds to a size event. + void OnSize( wxSizeEvent& event ); - virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp, - bool isEnabled = TRUE, - bool isPressed = FALSE); + // Responds to a paint event. + void OnPaint( wxPaintEvent& event ); - virtual void RenderLabelImages(); - virtual void RenderAllLabelImages(); + // Responds to an erase background event. + void OnEraseBackground( wxEraseEvent& event ); - // event handlers - void OnLButtonDown( wxMouseEvent& event ); - void OnLButtonUp( wxMouseEvent& event ); - void OnMouseMove( wxMouseEvent& event ); - void OnSize( wxSizeEvent& event ); - void OnPaint( wxPaintEvent& event ); - void OnEraseBackground( wxEraseEvent& event ); - void OnKillFocus( wxFocusEvent& event ); + // Responds to a kill focus event. + void OnKillFocus( wxFocusEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __NEWBMPBTN_G__ */ diff --git a/contrib/include/wx/fl/panedrawpl.h b/contrib/include/wx/fl/panedrawpl.h index 4fe1adbdee..11272d3042 100644 --- a/contrib/include/wx/fl/panedrawpl.h +++ b/contrib/include/wx/fl/panedrawpl.h @@ -1,13 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Central header file for control-bar related classes -// +// Name: panedrawpl.h +// Purpose: cbPaneDrawPlugin class header. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __PANEDRAWPL_G__ @@ -20,99 +19,142 @@ #include "wx/fl/controlbar.h" /* - * Simple, but all-in-one plugin implementation. Resembles look & feel of - * to MFC control-bars. Handles painting of pane and items in it. - * Fires bar/layout customization event, when user right-clicks bar/pane. - * Hooking an instance of this and row-layouting plugins per each pane, - * would be enough for the frame layout to function properly. - * (they are plugged in autimatically by wxFrameLayout class) - */ +Simple but all-in-one plugin implementation. Resembles the look and feel of +MFC control-bars. The class handles painting of the pane and the items in it; +it generates bar/layout customization events, when the user right-clicks the bar/pane. +Hooking an instance of this and row-layout plugins for each pane +would be enough for the frame layout to function properly +(they are plugged in automatically by the wxFrameLayout class). +*/ class cbPaneDrawPlugin : public cbPluginBase { public: - DECLARE_DYNAMIC_CLASS( cbPaneDrawPlugin ) + DECLARE_DYNAMIC_CLASS( cbPaneDrawPlugin ) protected: - // resizing bars/rows state variables - bool mResizeStarted; - bool mResizeCursorOn; - wxPoint mDragOrigin; + // resizing bars/rows state variables + bool mResizeStarted; + bool mResizeCursorOn; + wxPoint mDragOrigin; - cbBarInfo* mpDraggedBar; // also used when in bar-drag action - cbRowInfo* mpResizedRow; + cbBarInfo* mpDraggedBar; // also used when in bar-drag action + cbRowInfo* mpResizedRow; - bool mRowHandleHitted; - bool mIsUpperHandle; - bool mBarHandleHitted; - bool mIsLeftHandle; - bool mBarContentHitted; + bool mRowHandleHitted; + bool mIsUpperHandle; + bool mBarHandleHitted; + bool mIsLeftHandle; + bool mBarContentHitted; - // contstraints for dragging the handle - wxRect mHandleDragArea; - bool mHandleIsVertical; - int mHandleOfs; - int mDraggedDelta; - wxPoint mPrevPos; + // contstraints for dragging the handle + wxRect mHandleDragArea; + bool mHandleIsVertical; + int mHandleOfs; + int mDraggedDelta; + wxPoint mPrevPos; - // used for handling, start-draw-in-area events - wxClientDC* mpClntDc; + // used for handling, start-draw-in-area events + wxClientDC* mpClntDc; - cbDockPane* mpPane; // is set up temorary short-cut, while handling event + cbDockPane* mpPane; // is set up temorary short-cut, while handling event protected: - // helpers - void DrawDraggedHandle( const wxPoint& pos, cbDockPane& pane ); + // Internal helper: draws the dragged handle. + void DrawDraggedHandle( const wxPoint& pos, cbDockPane& pane ); - virtual void DrawPaneShade( wxDC& dc, int alignment ); - virtual void DrawPaneShadeForRow( cbRowInfo* pRow, wxDC& dc ); + // Internal helper: draws the pane shading. + virtual void DrawPaneShade( wxDC& dc, int alignment ); - virtual void DrawUpperRowHandle( cbRowInfo* pRow, wxDC& dc ); - virtual void DrawLowerRowHandle( cbRowInfo* pRow, wxDC& dc ); + // Internal helper: draws the pane shading for a row. + virtual void DrawPaneShadeForRow( cbRowInfo* pRow, wxDC& dc ); - virtual void DrawUpperRowShades( cbRowInfo* pRow, wxDC& dc, int level ); - virtual void DrawLowerRowShades( cbRowInfo* pRow, wxDC& dc, int level ); + // Internal helper: draws the upper row handle. + virtual void DrawUpperRowHandle( cbRowInfo* pRow, wxDC& dc ); - virtual void DrawBarInnerShadeRect( cbBarInfo* pBar, wxDC& dc ); + // Internal helper: draws the lower row handle. + virtual void DrawLowerRowHandle( cbRowInfo* pRow, wxDC& dc ); - virtual void DrawShade( int level, wxRect& rect, int alignment, wxDC& dc ); - virtual void DrawShade1( int level, wxRect& rect, int alignment, wxDC& dc ); + // Internal helper: draws the upper row shading. + virtual void DrawUpperRowShades( cbRowInfo* pRow, wxDC& dc, int level ); - inline void SetLightPixel( int x, int y, wxDC& dc ); - inline void SetDarkPixel ( int x, int y, wxDC& dc ); + // Internal helper: draws the lower row shading. + virtual void DrawLowerRowShades( cbRowInfo* pRow, wxDC& dc, int level ); + + // Internal helper: draws the inner bar shading. + virtual void DrawBarInnerShadeRect( cbBarInfo* pBar, wxDC& dc ); + + // Internal helper: draws shading. + virtual void DrawShade( int level, wxRect& rect, int alignment, wxDC& dc ); + + // Internal helper: draws shading. + virtual void DrawShade1( int level, wxRect& rect, int alignment, wxDC& dc ); + + // Internal helper: sets a light pixel at the given location. + inline void SetLightPixel( int x, int y, wxDC& dc ); + + // Internal helper: sets a dark pixel at the given location. + inline void SetDarkPixel ( int x, int y, wxDC& dc ); public: - cbPaneDrawPlugin(void); + // Default constructor. + cbPaneDrawPlugin(); + + // Constructor taking frame layout pane and a pane mask. + cbPaneDrawPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + + // Destructor. + virtual ~cbPaneDrawPlugin(); + + // Clone function, returning a new instance of this class. + virtual cbPluginBase* Clone() { return new cbPaneDrawPlugin(0,0); } + + // Handler for left mouse button down events. + void OnLButtonDown( cbLeftDownEvent& event ); + + // Handler for left double-click mouse button down events. + void OnLDblClick ( cbLeftDClickEvent& event ); + + // Handler for left mouse button up events. + void OnLButtonUp ( cbLeftUpEvent& event ); + + // Handler for right mouse button up events. + void OnRButtonUp ( cbRightUpEvent& event ); + + // Handler for mouse move events. + void OnMouseMove ( cbMotionEvent& event ); + + // Handler for draw pane background events. + void OnDrawPaneBackground ( cbDrawPaneBkGroundEvent& event ); + + // Handler for draw pane decoration events. + void OnDrawPaneDecorations( cbDrawPaneDecorEvent& event ); - cbPaneDrawPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Handler for draw row decoration events. + void OnDrawRowDecorations ( cbDrawRowDecorEvent& event ); - virtual ~cbPaneDrawPlugin(); + // Handler for draw row handles events. + void OnDrawRowHandles ( cbDrawRowHandlesEvent& event ); - virtual cbPluginBase* Clone() { return new cbPaneDrawPlugin(0,0); } + // Handler for draw row background events. + void OnDrawRowBackground ( cbDrawRowBkGroundEvent& event ); - // handlers for plugin-events + // Handler for bar size events. + void OnSizeBarWindow ( cbSizeBarWndEvent& event ); - void OnLButtonDown( cbLeftDownEvent& event ); - void OnLDblClick ( cbLeftDClickEvent& event ); - void OnLButtonUp ( cbLeftUpEvent& event ); - void OnRButtonUp ( cbRightUpEvent& event ); - void OnMouseMove ( cbMotionEvent& event ); + // Handler for draw bar decorations events. + void OnDrawBarDecorations ( cbDrawBarDecorEvent& event ); - void OnDrawPaneBackground ( cbDrawPaneBkGroundEvent& event ); - void OnDrawPaneDecorations( cbDrawPaneDecorEvent& event ); + // Handler for draw bar handles events. + void OnDrawBarHandles ( cbDrawBarHandlesEvent& event ); - void OnDrawRowDecorations ( cbDrawRowDecorEvent& event ); - void OnDrawRowHandles ( cbDrawRowHandlesEvent& event ); - void OnDrawRowBackground ( cbDrawRowBkGroundEvent& event ); - - void OnSizeBarWindow ( cbSizeBarWndEvent& event ); - void OnDrawBarDecorations ( cbDrawBarDecorEvent& event ); - void OnDrawBarHandles ( cbDrawBarHandlesEvent& event ); + // Handler for start draw in area events. + void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); - void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); - void OnFinishDrawInArea ( cbFinishDrawInAreaEvent& event ); + // Handler for finish draw in area events. + void OnFinishDrawInArea ( cbFinishDrawInAreaEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __PANEDRAWPL_G__ */ diff --git a/contrib/include/wx/fl/rowdragpl.h b/contrib/include/wx/fl/rowdragpl.h index 6375d4f526..96036b5735 100644 --- a/contrib/include/wx/fl/rowdragpl.h +++ b/contrib/include/wx/fl/rowdragpl.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: rowdragpl.h +// Purpose: cbRowDragPlugin class header. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __ROWDRAGPL_G__ @@ -19,145 +19,212 @@ #include "wx/fl/controlbar.h" /* - * Plugin adds row-dragging fuctionality to the pane. - * Handles mouse/movement and pane-background erasing plugin-events. - * Behaviour and appearence resembles drag & drop posotioning - * of the toolbar-rows int Netscape Comunicator 4.xx. - */ +This plugin adds row-dragging functionality to the pane. +It handles mouse movement and pane background-erasing plugin events. +The behaviour and appearance resembles drag and drop positioning +of the toolbar rows in Netscape Communicator 4.xx. +*/ class cbRowDragPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbRowDragPlugin ) + DECLARE_DYNAMIC_CLASS( cbRowDragPlugin ) public: - // background colours for the highlighted/unhighlighted icons + // background colours for the highlighted/unhighlighted icons - wxColour mHightColor; // light-blue for NC-look - wxColour mLowColor; // light-gray -/- - wxColour mTrianInnerColor; // blue -/- - wxPen mTrianInnerPen; // black -/- + wxColour mHightColor; // light-blue for NC-look + wxColour mLowColor; // light-gray -/- + wxColour mTrianInnerColor; // blue -/- + wxPen mTrianInnerPen; // black -/- protected: - friend class cbRowDragPluginSerializer; + friend class cbRowDragPluginSerializer; - // drag & drop state variables - bool mDragStarted; - bool mDecisionMode; - wxPoint mDragOrigin; - int mCurDragOfs; - bool mCaptureIsOn; + // drag & drop state variables + bool mDragStarted; + bool mDecisionMode; + wxPoint mDragOrigin; + int mCurDragOfs; + bool mCaptureIsOn; - // saved margins of the pane - int mSvTopMargin; - int mSvBottomMargin; - int mSvLeftMargin; - int mSvRightMargin; + // saved margins of the pane + int mSvTopMargin; + int mSvBottomMargin; + int mSvLeftMargin; + int mSvRightMargin; - //on-screen drawing state variables - wxBitmap* mpPaneImage; - wxBitmap* mpRowImage; - wxBitmap* mpCombinedImage; + // on-screen drawing state variables + wxBitmap* mpPaneImage; + wxBitmap* mpRowImage; + wxBitmap* mpCombinedImage; - wxScreenDC* mpScrDc; - wxRect mCombRect; - wxSize mRowImgDim; - int mInitialRowOfs; + wxScreenDC* mpScrDc; + wxRect mCombRect; + wxSize mRowImgDim; + int mInitialRowOfs; - // NOTE:: if mpRowInFocus is not NULL, then mCollapsedIconInFocus is -1, - // and v.v. (two different items cannot be in focus at the same time) + // NOTE:: if mpRowInFocus is not NULL, then mCollapsedIconInFocus is -1, + // and v.v. (two different items cannot be in focus at the same time) - cbRowInfo* mpRowInFocus; - int mCollapsedIconInFocus; + cbRowInfo* mpRowInFocus; + int mCollapsedIconInFocus; - cbDockPane* mpPane; // is set up temorarely, while handling event + cbDockPane* mpPane; // is set up temorarely, while handling event - wxList mHiddenBars; + wxList mHiddenBars; - wxBitmap* CaptureDCArea( wxDC& dc, wxRect& area ); + // Helper for drag and drop. + wxBitmap* CaptureDCArea( wxDC& dc, wxRect& area ); - // helpers for drag&drop + // Helper for drag and drop. + int GetHRowsCountForPane( cbDockPane* pPane ); - int GetHRowsCountForPane( cbDockPane* pPane ); + // Helper for drag and drop. + void SetMouseCapture( bool captureOn ); - void SetMouseCapture( bool captureOn ); - void PrepareForRowDrag(); - void ShowDraggedRow( int offset ); - void ShowPaneImage(); - void FinishOnScreenDraw(); - void CollapseRow( cbRowInfo* pRow ); - void ExpandRow( int collapsedIconIdx ); - void InsertDraggedRowBefore( cbRowInfo* pBeforeRow ); - bool ItemIsInFocus(); - void CheckPrevItemInFocus( cbRowInfo* pRow, int iconIdx ); - void UnhiglightItemInFocus(); + // Helper for drag and drop. + void PrepareForRowDrag(); - cbRowInfo* GetFirstRow(); + // Helper for drag and drop. + void ShowDraggedRow( int offset ); - // "hard-coded metafile" for NN-look + // Helper for drag and drop. + void ShowPaneImage(); - virtual void DrawTrianUp( wxRect& inRect, wxDC& dc ); - virtual void DrawTrianDown( wxRect& inRect, wxDC& dc ); - virtual void DrawTrianRight( wxRect& inRect, wxDC& dc ); - virtual void Draw3DPattern( wxRect& inRect, wxDC& dc ); - virtual void DrawRombShades( wxPoint& p1, wxPoint& p2, wxPoint& p3, wxPoint& p4, wxDC& dc ); - virtual void DrawOrtoRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ); - virtual void DrawRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ); - virtual void Draw3DRect( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ); - virtual void DrawRectShade( wxRect& inRect, wxDC& dc, - int level, wxPen& upperPen, wxPen& lowerPen ); + // Helper for drag and drop. + void FinishOnScreenDraw(); - virtual void GetRowHintRect( cbRowInfo* pRow, wxRect& rect ); - virtual void GetCollapsedInconRect( int iconIdx, wxRect& rect ); + // Helper for drag and drop. + void CollapseRow( cbRowInfo* pRow ); - virtual int GetCollapsedIconsPos(); + // Helper for drag and drop. + void ExpandRow( int collapsedIconIdx ); + + // Helper for drag and drop. + void InsertDraggedRowBefore( cbRowInfo* pBeforeRow ); + + // Helper for drag and drop. + bool ItemIsInFocus(); + + // Helper for drag and drop. + void CheckPrevItemInFocus( cbRowInfo* pRow, int iconIdx ); + + // Helper for drag and drop. + void UnhighlightItemInFocus(); + + // Helper for drag and drop. + cbRowInfo* GetFirstRow(); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawTrianUp( wxRect& inRect, wxDC& dc ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawTrianDown( wxRect& inRect, wxDC& dc ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawTrianRight( wxRect& inRect, wxDC& dc ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void Draw3DPattern( wxRect& inRect, wxDC& dc ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawRombShades( wxPoint& p1, wxPoint& p2, wxPoint& p3, wxPoint& p4, wxDC& dc ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawOrtoRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void Draw3DRect( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ); + + // Implements 'hard-coded metafile' for Netscape Navigator look. + virtual void DrawRectShade( wxRect& inRect, wxDC& dc, + int level, wxPen& upperPen, wxPen& lowerPen ); + + // Helper for drag and drop. + virtual void GetRowHintRect( cbRowInfo* pRow, wxRect& rect ); + + // Helper for drag and drop. + virtual void GetCollapsedInconRect( int iconIdx, wxRect& rect ); + + // Helper for drag and drop. + virtual int GetCollapsedIconsPos(); public: - cbRowDragPlugin(void); + // Default constructor. + cbRowDragPlugin(); + + // Constructor, taking paren layout frame and pane mask. + cbRowDragPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES ); + + // Destructor. + virtual ~cbRowDragPlugin(); - cbRowDragPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES ); - virtual ~cbRowDragPlugin(); + // Clone function, returning a new instance of this class. + virtual cbPluginBase* Clone() { return new cbRowDragPlugin(NULL,0); } - virtual cbPluginBase* Clone() { return new cbRowDragPlugin(NULL,0); } + // Called to initialize this plugin. + virtual void OnInitPlugin(); - virtual void OnInitPlugin(); + // Handles mouse move plugin events (appearance-independent logic). + void OnMouseMove ( cbMotionEvent& event ); - // handlers for plugin events (appearence-independent logic) + // Handles left button down plugin events (appearance-independent logic). + void OnLButtonDown( cbLeftDownEvent& event ); - void OnMouseMove ( cbMotionEvent& event ); - void OnLButtonDown( cbLeftDownEvent& event ); - void OnLButtonUp ( cbLeftUpEvent& event ); - void OnDrawPaneBackground( cbDrawPaneDecorEvent& event ); + // Handles left button up plugin events (appearance-independent logic). + void OnLButtonUp ( cbLeftUpEvent& event ); - // overridables (appearence-depedent) + // Handles pane drawing plugin events (appearance-independent logic). + void OnDrawPaneBackground( cbDrawPaneDecorEvent& event ); - virtual void DrawCollapsedRowIcon( int index, wxDC& dc, bool isHighlighted ); - virtual void DrawCollapsedRowsBorder( wxDC& dc ); - virtual void DrawRowsDragHintsBorder( wxDC& dc ); - virtual void DrawRowDragHint( cbRowInfo* pRow, wxDC& dc, bool isHighlighted ); - virtual void DrawEmptyRow( wxDC& dc, wxRect& rowBounds ); + // Draws collapsed row icon (appearance-dependent). + virtual void DrawCollapsedRowIcon( int index, wxDC& dc, bool isHighlighted ); - virtual int GetCollapsedRowIconHeight(); - virtual int GetRowDragHintWidth(); + // Draws collapsed rows border (appearance-dependent). + virtual void DrawCollapsedRowsBorder( wxDC& dc ); - virtual void SetPaneMargins(); + // Draws rows drag hints border (appearance-dependent). + virtual void DrawRowsDragHintsBorder( wxDC& dc ); + // Draws row drag hint (appearance-dependent). + virtual void DrawRowDragHint( cbRowInfo* pRow, wxDC& dc, bool isHighlighted ); - virtual bool HitTestCollapsedRowIcon( int iconIdx, const wxPoint& pos ); - virtual bool HitTestRowDragHint( cbRowInfo* pRow, const wxPoint& pos ); + // Draws empty row (appearance-dependent). + virtual void DrawEmptyRow( wxDC& dc, wxRect& rowBounds ); - DECLARE_EVENT_TABLE() + // Gets the collapsed row icon height. + virtual int GetCollapsedRowIconHeight(); + + // Gets the row drag hint width. + virtual int GetRowDragHintWidth(); + + // Sets the pane margins. + virtual void SetPaneMargins(); + + // Test for the collapsed row icon position. + virtual bool HitTestCollapsedRowIcon( int iconIdx, const wxPoint& pos ); + + // Test for the row drag hint position. + virtual bool HitTestRowDragHint( cbRowInfo* pRow, const wxPoint& pos ); + + DECLARE_EVENT_TABLE() }; -// internal helper-class +/* +Internal helper class. +*/ class cbHiddenBarInfo : public wxObject { - DECLARE_DYNAMIC_CLASS( cbHiddenBarInfo ) + DECLARE_DYNAMIC_CLASS( cbHiddenBarInfo ) public: - cbBarInfo* mpBar; - int mRowNo; - int mIconNo; - int mAlignment; + cbBarInfo* mpBar; + int mRowNo; + int mIconNo; + int mAlignment; }; #endif /* __ROWDRAGPL_G__ */ diff --git a/contrib/include/wx/fl/rowlayoutpl.h b/contrib/include/wx/fl/rowlayoutpl.h index f44c74a9d8..aa9a670d32 100644 --- a/contrib/include/wx/fl/rowlayoutpl.h +++ b/contrib/include/wx/fl/rowlayoutpl.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: rowlayoutpl.h +// Purpose: cbRowLayoutPlugin header. // Author: Aleksandras Gluchovas // Modified by: // Created: 02/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __ROWLAYOUTPL_G__ @@ -19,68 +19,107 @@ #include "wx/fl/controlbar.h" /* - * Simple implementation of plugin, which handles row-layouting - * requests sent from Frame Layout - */ +Simple implementation of a plugin which handles row layout +requests sent from a frame layout. +*/ class cbRowLayoutPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin ) + DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin ) protected: - cbDockPane* mpPane; // is set up temorarely, while handling event + cbDockPane* mpPane; // is set up temporarily, while handling event protected: - // not-fixed-bars layouting related helpers + // Internal helper relating to not-fixed-bars layout. + void FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow ); - void FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow ); - void RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInfo* pRow ); - void MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve ); - int GetRowFreeSpace( cbRowInfo* pRow ); - - void RecalcLengthRatios( cbRowInfo* pRow ); - void ApplyLengthRatios( cbRowInfo* pRow ); - void ExpandNotFixedBars( cbRowInfo* pRow ); - void AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar ); + // Internal helper relating to not-fixed-bars layout. + void RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInfo* pRow ); - void DetectBarHandles( cbRowInfo* pRow ); - void CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& rowInfo ); + // Internal helper relating to not-fixed-bars layout. + void MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve ); + // Internal helper relating to not-fixed-bars layout. + int GetRowFreeSpace( cbRowInfo* pRow ); - // row-layouting helpers (simulate "bar-friction") - int CalcRowHeight( cbRowInfo& row ); - void LayoutItemsVertically( cbRowInfo& row ); + // Internal helper relating to not-fixed-bars layout. + void RecalcLengthRatios( cbRowInfo* pRow ); - void StickRightSideBars( cbBarInfo* pToBar ); + // Internal helper relating to not-fixed-bars layout. + void ApplyLengthRatios( cbRowInfo* pRow ); - void SlideLeftSideBars ( cbBarInfo* pTheBar ); - void SlideRightSideBars( cbBarInfo* pTheBar ); + // Internal helper relating to not-fixed-bars layout. + void ExpandNotFixedBars( cbRowInfo* pRow ); - void ShiftLeftTrashold ( cbBarInfo* pTheBar, cbRowInfo& row ); - void ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row ); + // Internal helper relating to not-fixed-bars layout. + void AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar ); - void InsertBefore( cbBarInfo* pBeforeBar, - cbBarInfo* pTheBar, - cbRowInfo& row - ); - void DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row ); + // Internal helper relating to not-fixed-bars layout. + void DetectBarHandles( cbRowInfo* pRow ); + + // Internal helper relating to not-fixed-bars layout. + void CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& rowInfo ); + + + // Row layout helper simulating bar 'friction'. + int CalcRowHeight( cbRowInfo& row ); + + // Row layout helper simulating bar 'friction'. + void LayoutItemsVertically( cbRowInfo& row ); + + + // Row layout helper simulating bar 'friction'. + void StickRightSideBars( cbBarInfo* pToBar ); + + + // Row layout helper simulating bar 'friction'. + void SlideLeftSideBars ( cbBarInfo* pTheBar ); + + // Row layout helper simulating bar 'friction'. + void SlideRightSideBars( cbBarInfo* pTheBar ); + + + // Row layout helper simulating bar 'friction'. + void ShiftLeftTrashold ( cbBarInfo* pTheBar, cbRowInfo& row ); + + // Row layout helper simulating bar 'friction'. + void ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row ); + + + // Insert the bar before the given row. + void InsertBefore( cbBarInfo* pBeforeBar, + cbBarInfo* pTheBar, + cbRowInfo& row + ); + + // Insert the bar before the given row. + void DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row ); public: + // Default constructor. + cbRowLayoutPlugin(void); + + // Constructor taking frame layout pane and pane mask. + cbRowLayoutPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + + // Responds to row resize event. + void OnResizeRow ( cbResizeRowEvent& event ); - cbRowLayoutPlugin(void); + // Responds to bar insertion event. + void OnInsertBar ( cbInsertBarEvent& event ); - cbRowLayoutPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Responds to bar removal event. + void OnRemoveBar ( cbRemoveBarEvent& event ); - // event handlers + // Responds to row layout event. + void OnLayoutRow ( cbLayoutRowEvent& event ); - void OnResizeRow ( cbResizeRowEvent& event ); - void OnInsertBar ( cbInsertBarEvent& event ); - void OnRemoveBar ( cbRemoveBarEvent& event ); - void OnLayoutRow ( cbLayoutRowEvent& event ); - void OnLayoutRows( cbLayoutRowsEvent& event ); + // Responds to rows layout event. + void OnLayoutRows( cbLayoutRowsEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __ROWLAYOUTPL_G__ */ diff --git a/contrib/include/wx/fl/toolwnd.h b/contrib/include/wx/fl/toolwnd.h index 8f7fd5cf18..efe9d125fc 100644 --- a/contrib/include/wx/fl/toolwnd.h +++ b/contrib/include/wx/fl/toolwnd.h @@ -1,12 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: toolwnd.h +// Purpose: wxToolWindow, cbMiniButton, cbCloseBox, cbCollapseBox, +// cbDockBox, cbFloatedBarWindow class declarations. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __TOOLWND_G__ @@ -31,184 +32,272 @@ typedef cbMiniButton* cbMinitButtonPtrT; WX_DEFINE_ARRAY( cbMinitButtonPtrT, cbMiniButtonArrayT ); +/* +A tool window is a special kind of frame that paints its own title, and +can be used to implement small floating windows. +*/ + class wxToolWindow : public wxFrame { - DECLARE_DYNAMIC_CLASS( wxToolWindow ) + DECLARE_DYNAMIC_CLASS( wxToolWindow ) -public: /** protected really, accessed only by serializers **/ +public: /** protected really, accessed only by serializers **/ - cbMiniButtonArrayT mButtons; - wxWindow* mpClientWnd; + cbMiniButtonArrayT mButtons; + wxWindow* mpClientWnd; - wxFont mTitleFont; + wxFont mTitleFont; - int mTitleHeight; - int mClntHorizGap; - int mClntVertGap; - int mWndVertGap; - int mWndHorizGap; - int mButtonGap; - int mInTitleMargin; - int mHintBorder; + int mTitleHeight; + int mClntHorizGap; + int mClntVertGap; + int mWndVertGap; + int mWndHorizGap; + int mButtonGap; + int mInTitleMargin; + int mHintBorder; - bool mResizeStarted; - bool mRealTimeUpdatesOn; + bool mResizeStarted; + bool mRealTimeUpdatesOn; - int mMTolerance; + int mMTolerance; - int mCursorType; - bool mMouseCaptured; + int mCursorType; + bool mMouseCaptured; - // drag&drop state variables + // drag&drop state variables - wxPoint mDragOrigin; - wxRect mInitialRect; - wxRect mPrevHintRect; - wxScreenDC* mpScrDc; + wxPoint mDragOrigin; + wxRect mInitialRect; + wxRect mPrevHintRect; + wxScreenDC* mpScrDc; protected: - void GetScrWindowRect( wxRect& r ); - void GetScrMousePos ( wxMouseEvent& event, wxPoint& pos ); - void SetHintCursor ( int type ); + // Maps client coordinates to screen coordinates. + void GetScrWindowRect( wxRect& r ); + + // Gets the mouse position in screen coordinates. + void GetScrMousePos ( wxMouseEvent& event, wxPoint& pos ); + + // Sets the hint cursor. + void SetHintCursor ( int type ); - void CalcResizedRect( wxRect& rect, wxPoint& delta, const wxSize& minDim ); - void AdjustRectPos( const wxRect& original, const wxSize& newDim, wxRect& newRect ); - wxSize GetMinimalWndDim(); + // Calculate resized rectangle. + void CalcResizedRect( wxRect& rect, wxPoint& delta, const wxSize& minDim ); - void DrawHintRect( const wxRect& r ); + // Helper function. + void AdjustRectPos( const wxRect& original, const wxSize& newDim, wxRect& newRect ); - int HitTestWindow( wxMouseEvent& event ); + // Helper function. + wxSize GetMinimalWndDim(); - void LayoutMiniButtons(); + // Draws the hint rectangle. + void DrawHintRect( const wxRect& r ); + + // Tests if the mouse position is in this window. + int HitTestWindow( wxMouseEvent& event ); + + // Lays out the buttons. + void LayoutMiniButtons(); public: - - wxToolWindow(); - ~wxToolWindow(); - void SetClient( wxWindow* pWnd ); - wxWindow* GetClient(); + // Default constructor. + wxToolWindow(); + + // Destructor. + ~wxToolWindow(); + + // Sets the client for this tool window. + void SetClient( wxWindow* pWnd ); + + // Returns the client window. + wxWindow* GetClient(); + + // Sets the title font. + void SetTitleFont( wxFont& font ); + + // Adds a button. Buttons are added in right-to-left order. + void AddMiniButton( cbMiniButton* pBtn ); + + // Responds to a paint event. + void OnPaint( wxPaintEvent& event ); + + // Responds to a mouse move event. + void OnMotion( wxMouseEvent& event ); - void SetTitleFont( wxFont& font ); + // Responds to a mouse left down event. + void OnLeftDown( wxMouseEvent& event ); - // buttons are added in right-to-left order - void AddMiniButton( cbMiniButton* pBtn ); + // Responds to a mouse left up event. + void OnLeftUp( wxMouseEvent& event ); - void OnPaint( wxPaintEvent& event ); + // Responds to a size event. + void OnSize( wxSizeEvent& event ); - void OnMotion( wxMouseEvent& event ); - void OnLeftDown( wxMouseEvent& event ); - void OnLeftUp( wxMouseEvent& event ); - void OnSize( wxSizeEvent& event ); + // Responds to an erase background event. + void OnEraseBackground( wxEraseEvent& event ); - void OnEraseBackground( wxEraseEvent& event ); + // Returns the preferred size for the window. + virtual wxSize GetPreferredSize( const wxSize& given ); - // overridables: + // Called when a mini button is clicked. + // By default, does nothing. + virtual void OnMiniButtonClicked( int btnIdx ) {} - virtual wxSize GetPreferredSize( const wxSize& given ); - virtual void OnMiniButtonClicked( int btnIdx ) {} - virtual bool HandleTitleClick( wxMouseEvent& event ) { return FALSE; } + // Handles clicking on the title. By default, does nothing. + virtual bool HandleTitleClick( wxMouseEvent& event ) { return FALSE; } - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; // FIXME:: the code below should be moved to a separate file #include "wx/fl/controlbar.h" +/* +cbMiniButton is the base class for a small button that can be placed in a wxToolWindow +titlebar. +*/ + class cbMiniButton : public wxObject { public: - wxPoint mPos; - wxSize mDim; - bool mVisible; - bool mEnabled; + wxPoint mPos; + wxSize mDim; + bool mVisible; + bool mEnabled; - wxFrameLayout* mpLayout; - cbDockPane* mpPane; - cbPluginBase* mpPlugin; + wxFrameLayout* mpLayout; + cbDockPane* mpPane; + cbPluginBase* mpPlugin; - wxWindow* mpWnd; + wxWindow* mpWnd; - bool mWasClicked; - bool mDragStarted; + bool mWasClicked; + bool mDragStarted; - bool mPressed; + bool mPressed; public: - cbMiniButton(); + // Default constructor. + cbMiniButton(); + + // Set the position of the button. + void SetPos( const wxPoint& pos ); + + // Returns TRUE if the given position was over the button. + bool HitTest( const wxPoint& pos ); + + // Responds to a left down event. + void OnLeftDown( const wxPoint& pos ); + + // Responds to a left up event. + void OnLeftUp( const wxPoint& pos ); + + // Responds to a mouse move event. + void OnMotion( const wxPoint& pos ); - void SetPos( const wxPoint& pos ); - bool HitTest( const wxPoint& pos ); + // Refreshes the button. + void Refresh(); - void OnLeftDown( const wxPoint& pos ); - void OnLeftUp( const wxPoint& pos ); - void OnMotion( const wxPoint& pos ); + // Draws the button. Override this to implement + // the desired appearance. + virtual void Draw( wxDC& dc ); - void Refresh(); - virtual void Draw( wxDC& dc ); + // Returns TRUE if the button was clicked. + bool WasClicked(); - bool WasClicked(); - void Reset(); + // Reset the button. + void Reset(); - void Enable( bool enable ) { mEnabled = enable; } + // Enable or disable the button. + void Enable( bool enable ) { mEnabled = enable; } - bool IsPressed() { return mPressed; } + // Returns TRUE if this button is pressed. + bool IsPressed() { return mPressed; } }; -// classes specific to wxFrameLayout engine (FOR NOW in here...) +/* +cbCloseBox is a window close button, used in a wxToolWindow titlebar. +*/ class cbCloseBox : public cbMiniButton { public: - virtual void Draw( wxDC& dc ); + // Draws the close button appearance. + virtual void Draw( wxDC& dc ); }; +/* +cbCollapseBox is a window collapse button, used in a wxToolWindow titlebar. +*/ + class cbCollapseBox : public cbMiniButton { public: - bool mIsAtLeft; + bool mIsAtLeft; - virtual void Draw( wxDC& dc ); + // Draws the collapse button appearance. + virtual void Draw( wxDC& dc ); }; +/* +cbDockBox is a window dock button, used in a wxToolWindow titlebar. +*/ + class cbDockBox : public cbMiniButton { public: - virtual void Draw( wxDC& dc ); + // Draws the dock button appearance. + virtual void Draw( wxDC& dc ); }; +/* +cbFloatedBarWindow is a kind of wxToolWindow, +implementing floating toolbars. +*/ + class cbFloatedBarWindow : public wxToolWindow { - DECLARE_DYNAMIC_CLASS( cbFloatedBarWindow ) + DECLARE_DYNAMIC_CLASS( cbFloatedBarWindow ) protected: - cbBarInfo* mpBar; - wxFrameLayout* mpLayout; + cbBarInfo* mpBar; + wxFrameLayout* mpLayout; - friend class cbFloatedBarWindowSerializer; + friend class cbFloatedBarWindowSerializer; public: - cbFloatedBarWindow(); + // Default constructor. + cbFloatedBarWindow(); + + // Sets the bar information for this window. + void SetBar( cbBarInfo* pBar ); + + // Sets the layout for this window. + void SetLayout( wxFrameLayout* pLayout ); - void SetBar( cbBarInfo* pBar ); - void SetLayout( wxFrameLayout* pLayout ); - cbBarInfo* GetBar(); + // Returns the bar information for this window. + cbBarInfo* GetBar(); - // given coordinates are those of the bar itself - // floated container window's position and size - // are ajusted accordingly + // Position the floating window. The given coordinates + // are those of the bar itself; the floated container window's + // position and size are ajusted accordingly. + void PositionFloatedWnd( int scrX, int scrY, + int width, int height ); - void PositionFloatedWnd( int scrX, int scrY, - int width, int height ); + // Overridden function returning the preferred size. + virtual wxSize GetPreferredSize( const wxSize& given ); - // overriden methods of wxToolWindow + // Overridden function responding to mouse clicks on mini-buttons. + virtual void OnMiniButtonClicked( int btnIdx ); - virtual wxSize GetPreferredSize( const wxSize& given ); - virtual void OnMiniButtonClicked( int btnIdx ); - virtual bool HandleTitleClick( wxMouseEvent& event ); + // Overridden function responding to mouse button clicks on the titlebar. + virtual bool HandleTitleClick( wxMouseEvent& event ); - void OnDblClick( wxMouseEvent& event ); + // Responds to double-click mouse events. + void OnDblClick( wxMouseEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __TOOLWND_G__ */ diff --git a/contrib/include/wx/fl/updatesmgr.h b/contrib/include/wx/fl/updatesmgr.h index e0e21c500b..0e71f2e5b6 100644 --- a/contrib/include/wx/fl/updatesmgr.h +++ b/contrib/include/wx/fl/updatesmgr.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: updatesmgr.h +// Purpose: cbSimpleUpdatesMgr class declaration // Author: Aleksandras Gluchovas (@Lithuania) // Modified by: // Created: 19/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __UPDATESMGR_G__ @@ -19,37 +19,51 @@ #include "wx/fl/controlbar.h" /* - * class implements slightly optimized logic for refreshing - * areas of frame layout - which actually need to be updated. - */ +This class implements slightly optimized logic for refreshing +the areas of frame layout that actually need to be updated. +*/ class cbSimpleUpdatesMgr : public cbUpdatesManagerBase { - DECLARE_DYNAMIC_CLASS( cbSimpleUpdatesMgr ) + DECLARE_DYNAMIC_CLASS( cbSimpleUpdatesMgr ) protected: - bool WasChanged( cbUpdateMgrData& data, wxRect& currentBounds ); + // Helper function. + bool WasChanged( cbUpdateMgrData& data, wxRect& currentBounds ); public: + // Default constructor. + cbSimpleUpdatesMgr() {} - cbSimpleUpdatesMgr(void) {} + // Constructor taking frame layout panel. + cbSimpleUpdatesMgr( wxFrameLayout* pPanel ); - cbSimpleUpdatesMgr( wxFrameLayout* pPanel ); + // Notification received from Frame Layout in the order in which + // they would usually be invoked. + virtual void OnStartChanges(); - // notificiactions received from Frame Layout (in the order, in which - // they usually would be invoked) + // Notification received from Frame Layout in the order in which + // they would usually be invoked. + virtual void OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ); - virtual void OnStartChanges(); + // Notification received from Frame Layout in the order in which + // they would usually be invoked. + virtual void OnBarWillChange( cbBarInfo* pBar, cbRowInfo* pInRow, cbDockPane* pInPane ); - virtual void OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ); - virtual void OnBarWillChange( cbBarInfo* pBar, cbRowInfo* pInRow, cbDockPane* pInPane ); - virtual void OnPaneMarginsWillChange( cbDockPane* pPane ); - virtual void OnPaneWillChange( cbDockPane* pPane ); + // Notification received from Frame Layout in the order in which + // they would usually be invoked. + virtual void OnPaneMarginsWillChange( cbDockPane* pPane ); - virtual void OnFinishChanges(); + // Notification received from Frame Layout in the order in which + // they would usually be invoked. + virtual void OnPaneWillChange( cbDockPane* pPane ); - // refreshes parts of the frame layout, which need an update - virtual void UpdateNow(); + // Notification received from Frame Layout in the order in which + // they would usually be invoked. + virtual void OnFinishChanges(); + + // Refreshes the parts of the frame layoutthat need an update. + virtual void UpdateNow(); }; #endif /* __UPDATESMGR_G__ */ diff --git a/contrib/src/fl/antiflickpl.cpp b/contrib/src/fl/antiflickpl.cpp index 419b186756..12ce48a1a7 100644 --- a/contrib/src/fl/antiflickpl.cpp +++ b/contrib/src/fl/antiflickpl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: antiflickpl.cpp +// Purpose: Double-buffering plugin class for reducing flickering. // Author: Aleksandras Gluchovas (@Lithuania) // Modified by: // Created: 23/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -115,7 +115,7 @@ wxDC* cbAntiflickerPlugin::AllocNewBuffer( const wxRect& forArea ) // excessive realocations later // check whether the given area is oriented horizontally - // or verticallya and choose correspoinding bitmap to create or + // or vertically and choose corresponding bitmap to create or // recreate if ( forArea.height > forArea.width ) diff --git a/contrib/src/fl/bardragpl.cpp b/contrib/src/fl/bardragpl.cpp index b48d254038..83ac65f395 100644 --- a/contrib/src/fl/bardragpl.cpp +++ b/contrib/src/fl/bardragpl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: bardragpl.cpp +// Purpose: cbBarDragPlugin implementation // Author: Aleksandras Gluchovas // Modified by: // Created: 23/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -293,8 +293,8 @@ void cbBarDragPlugin::StickToPane( cbDockPane* pPane, wxPoint& mousePos ) : mousePos.x > bounds.x; // NOTE:: about all the below min/max things: they are meant to ensure - // that mouse pointer doesn't overrun (leave) the hint-rectangle - // when dimensions it's are recalculated upon sticking it to the pane + // that the mouse pointer doesn't overrun (leave) the hint-rectangle + // when its dimensions are recalculated upon sticking it to the pane if ( pPane->IsHorizontal() && fromLowerEdge ) { @@ -341,10 +341,9 @@ void cbBarDragPlugin::StickToPane( cbDockPane* pPane, wxPoint& mousePos ) void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos ) { - // unsticking causes rectangle to get the shape, in which + // unsticking causes rectangle to get the shape in which // dragged control-bar would be when floated - int newWidth = mpDraggedBar->mDimInfo.mSizes[wxCBAR_FLOATING].x; int newHeight = mpDraggedBar->mDimInfo.mSizes[wxCBAR_FLOATING].y; @@ -471,7 +470,7 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient ) if ( mpSrcPane->mProps.mRealTimeUpdatesOn == FALSE ) { - // do hevy calculations first + // do heavy calculations first wxRect actualRect = mHintRect; // will be adjusted depending on drag-settings diff --git a/contrib/src/fl/barhintspl.cpp b/contrib/src/fl/barhintspl.cpp index 90985f7d17..eb1f671685 100644 --- a/contrib/src/fl/barhintspl.cpp +++ b/contrib/src/fl/barhintspl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: barhintspl.h +// Purpose: Implementation for cbBarHintsPlugin // Author: Aleksandras Gluchovas // Modified by: // Created: 30/11/98 (my 22th birthday :-) // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ diff --git a/contrib/src/fl/cbcustom.cpp b/contrib/src/fl/cbcustom.cpp index 43f5683ff3..61a14859c4 100644 --- a/contrib/src/fl/cbcustom.cpp +++ b/contrib/src/fl/cbcustom.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: cbcustom.cpp +// Purpose: cbSimpleCustomizationPlugin class declaration // Author: Aleksandras Gluchovas // Modified by: // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ diff --git a/contrib/src/fl/controlbar.cpp b/contrib/src/fl/controlbar.cpp index f0c1d02105..93234730f6 100644 --- a/contrib/src/fl/controlbar.cpp +++ b/contrib/src/fl/controlbar.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: controlbar.cpp +// Purpose: Implementation for main controlbar classes. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/09/98 @@ -50,7 +50,6 @@ // meet the new event paradigm as of wx2.3.0. Probably we // should find a way to make these be non-global, but this // works for right now. -#if wxCHECK_VERSION(2,3,0) wxEventType cbEVT_PL_LEFT_DOWN = wxNewEventType(); wxEventType cbEVT_PL_LEFT_UP = wxNewEventType(); wxEventType cbEVT_PL_RIGHT_DOWN = wxNewEventType(); @@ -85,7 +84,6 @@ wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT = wxNewEventType(); wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT = wxNewEventType(); -#endif // #if wxCHECK_VERSION(2,3,0) // some ascii-art, still can't get these *nice* cursors working on wx... :-( @@ -347,7 +345,7 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo mFloatingOn = CanReparent(); } -// NOTE:: below are the only plaftorm-check "ifdef"s in the docking system! +// NOTE:: below are the only platform-check "ifdef"s in the docking system! bool wxFrameLayout::CanReparent() { @@ -627,10 +625,10 @@ bool wxFrameLayout::RedockBar( cbBarInfo* pBar, pBarPane->RemoveBar( pBar ); - // FIXME FIXME:: the below recalc. may be a *huge* performance + // FIXME FIXME:: the recalculation below may be a *huge* performance // hit, it could be eliminated though... // but first the "pane-postion-changed" problem - // have to be fixed + // has to be fixed RecalcLayout( FALSE ); @@ -710,8 +708,8 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) if ( pBar->mState == wxCBAR_FLOATING && newState != wxCBAR_FLOATING ) { - // remove bar's window form the containing mini-frame - // and set it's parent to be layout's parent frame + // remove bar's window from the containing mini-frame + // and set its parent to be layout's parent frame if ( pBar->mpBarWnd ) { @@ -1176,15 +1174,15 @@ void wxFrameLayout::HideBarWindows() void wxFrameLayout::UnhookFromFrame() { // NOTE:: the SetEvtHandlerEnabled() method is not used - // here, since it is assumed, that unhooking layout + // here, since it is assumed that unhooking layout // from window may result destroying of the layout itself // // BUG BUG BUG (wx):: this would not be a problem if - // wxEvtHandler's destructor would check if + // wxEvtHandler's destructor checked if // this handler is currently the top-most // handler of some window, and additionally - // to the reconnecting itself from the chain - // it would also re-setup current event handler + // to the reconnecting itself from the chain. + // It would also re-setup current event handler // of the window using wxWindow::SetEventHandler() // FOR NOW:: @@ -2576,7 +2574,7 @@ void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow ) size_t i = 0; - // clac current-maximal-total-length of all maximized bars + // calc current-maximal-total-length of all maximized bars for ( i = 0; i != pInRow->mBars.GetCount(); ++i ) { @@ -2586,7 +2584,7 @@ void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow ) totalWidth += bar.mBounds.width; } - // set up persentages of occupied space for each maximized bar + // set up percentages of occupied space for each maximized bar for ( i = 0; i != pInRow->mBars.Count(); ++i ) { diff --git a/contrib/src/fl/dyntbar.cpp b/contrib/src/fl/dyntbar.cpp index d575be3a13..138f5a0b95 100644 --- a/contrib/src/fl/dyntbar.cpp +++ b/contrib/src/fl/dyntbar.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: dyntbar.cpp +// Purpose: wxDynamicToolBar implementation // Author: Aleksandras Gluchovas // Modified by: // Created: ??/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -16,7 +16,6 @@ // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" - #ifdef __BORLANDC__ #pragma hdrstop #endif @@ -34,94 +33,94 @@ IMPLEMENT_DYNAMIC_CLASS(wxDynamicToolBar, wxControl ) BEGIN_EVENT_TABLE( wxDynamicToolBar, wxControl ) - EVT_SIZE ( wxDynamicToolBar::OnSize ) - EVT_PAINT( wxDynamicToolBar::OnPaint ) - //EVT_ERASE_BACKGROUND( wxDynamicToolBar::OnEraseBackground ) + EVT_SIZE ( wxDynamicToolBar::OnSize ) + EVT_PAINT( wxDynamicToolBar::OnPaint ) + //EVT_ERASE_BACKGROUND( wxDynamicToolBar::OnEraseBackground ) END_EVENT_TABLE() /***** Implementation for class wxDynToolInfo *****/ - + IMPLEMENT_DYNAMIC_CLASS(wxDynToolInfo, wxToolLayoutItem) /***** Implementation for class wxDynamicToolBar *****/ wxDynamicToolBar::wxDynamicToolBar() - : mpLayoutMan( NULL ), - mSepartorSize( 8 ), - mVertGap ( 0 ), - mHorizGap( 0 ) + : mpLayoutMan( NULL ), + mSepartorSize( 8 ), + mVertGap ( 0 ), + mHorizGap( 0 ) { } wxDynamicToolBar::wxDynamicToolBar(wxWindow *parent, const wxWindowID id, - const wxPoint& pos, const wxSize& size, - const long style, const int orientation, - const int RowsOrColumns, const wxString& name ) - : mpLayoutMan( NULL ), - mSepartorSize( 8 ), - mVertGap ( 0 ), - mHorizGap( 0 ) + const wxPoint& pos, const wxSize& size, + const long style, const int orientation, + const int RowsOrColumns, const wxString& name ) + : mpLayoutMan( NULL ), + mSepartorSize( 8 ), + mVertGap ( 0 ), + mHorizGap( 0 ) { - Create(parent, id, pos, size, style, orientation, RowsOrColumns, name); + Create(parent, id, pos, size, style, orientation, RowsOrColumns, name); - SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE) ); + SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE) ); } bool wxDynamicToolBar::Create(wxWindow *parent, const wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const long style, - const int orientation, const int RowsOrColumns, - const wxString& name) + const wxPoint& pos, + const wxSize& size, + const long style, + const int orientation, const int RowsOrColumns, + const wxString& name) { - // cut&pasted from wxtbatsmpl.h + // cut&pasted from wxtbatsmpl.h - if ( ! wxWindow::Create(parent, id, pos, size, style, name) ) - return FALSE; + if ( ! wxWindow::Create(parent, id, pos, size, style, name) ) + return FALSE; - SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE )); + SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE )); - return TRUE; + return TRUE; } bool wxDynamicToolBar::Realize(void) { - // FOR NOW:: nothing - return TRUE; + // FOR NOW:: nothing + return TRUE; } wxDynamicToolBar::~wxDynamicToolBar(void) { - if ( mpLayoutMan ) + if ( mpLayoutMan ) delete mpLayoutMan; size_t i; - for( i = 0; i != mTools.Count(); ++i ) + for( i = 0; i != mTools.Count(); ++i ) { - delete mTools[i]; + delete mTools[i]; } } void wxDynamicToolBar::AddTool( int toolIndex, - wxWindow* pToolWindow, - const wxSize& size - ) + wxWindow* pToolWindow, + const wxSize& size + ) { - wxDynToolInfo* pInfo = new wxDynToolInfo(); + wxDynToolInfo* pInfo = new wxDynToolInfo(); - pInfo->mpToolWnd = pToolWindow; - pInfo->mIndex = toolIndex; - pInfo->mIsSeparator = FALSE; + pInfo->mpToolWnd = pToolWindow; + pInfo->mIndex = toolIndex; + pInfo->mIsSeparator = FALSE; - int x,y; - pToolWindow->GetSize( &x, &y ); - pInfo->mRealSize.x = x; - pInfo->mRealSize.y = y; - pInfo->mRect.width = x; - pInfo->mRect.height = y; + int x,y; + pToolWindow->GetSize( &x, &y ); + pInfo->mRealSize.x = x; + pInfo->mRealSize.y = y; + pInfo->mRect.width = x; + pInfo->mRect.height = y; - mTools.Add( pInfo ); + mTools.Add( pInfo ); } void wxDynamicToolBar::AddTool( int toolIndex, @@ -130,191 +129,191 @@ void wxDynamicToolBar::AddTool( int toolIndex, const wxString& labelText, bool alignTextRight, bool isFlat ) { - wxNewBitmapButton* pBtn = + wxNewBitmapButton* pBtn = - new wxNewBitmapButton( imageFileName, imageFileType, - labelText, - ( alignTextRight ) - ? NB_ALIGN_TEXT_RIGHT - : NB_ALIGN_TEXT_BOTTOM, - isFlat - ); + new wxNewBitmapButton( imageFileName, imageFileType, + labelText, + ( alignTextRight ) + ? NB_ALIGN_TEXT_RIGHT + : NB_ALIGN_TEXT_BOTTOM, + isFlat + ); - pBtn->Create( this, toolIndex ); + pBtn->Create( this, toolIndex ); - pBtn->Reshape(); - - AddTool( toolIndex, pBtn ); + pBtn->Reshape(); + + AddTool( toolIndex, pBtn ); } void wxDynamicToolBar::AddTool( int toolIndex, wxBitmap labelBmp, - const wxString& labelText, bool alignTextRight, - bool isFlat ) + const wxString& labelText, bool alignTextRight, + bool isFlat ) { - wxNewBitmapButton* pBtn = + wxNewBitmapButton* pBtn = - new wxNewBitmapButton( labelBmp, - labelText, - ( alignTextRight ) - ? NB_ALIGN_TEXT_RIGHT - : NB_ALIGN_TEXT_BOTTOM, - isFlat - ); + new wxNewBitmapButton( labelBmp, + labelText, + ( alignTextRight ) + ? NB_ALIGN_TEXT_RIGHT + : NB_ALIGN_TEXT_BOTTOM, + isFlat + ); - pBtn->Create( this, toolIndex ); + pBtn->Create( this, toolIndex ); - pBtn->Reshape(); - - AddTool( toolIndex, pBtn ); + pBtn->Reshape(); + + AddTool( toolIndex, pBtn ); } - wxToolBarToolBase* - wxDynamicToolBar::AddTool(const int toolIndex, const wxBitmap& bitmap, - const wxBitmap& pushedBitmap, - const bool toggle, const long xPos, - const long yPos, wxObject *clientData, - const wxString& helpString1, const wxString& helpString2) +wxToolBarToolBase* + wxDynamicToolBar::AddTool(const int toolIndex, const wxBitmap& bitmap, + const wxBitmap& pushedBitmap, + const bool toggle, const long xPos, + const long yPos, wxObject *clientData, + const wxString& helpString1, const wxString& helpString2) { - wxNewBitmapButton* pBmpBtn = new wxNewBitmapButton( bitmap ); + wxNewBitmapButton* pBmpBtn = new wxNewBitmapButton( bitmap ); - pBmpBtn->Create( this, toolIndex ); + pBmpBtn->Create( this, toolIndex ); - pBmpBtn->Reshape(); + pBmpBtn->Reshape(); - AddTool( toolIndex, pBmpBtn ); + AddTool( toolIndex, pBmpBtn ); - return NULL; + return NULL; } wxDynToolInfo* wxDynamicToolBar::GetToolInfo( int toolIndex ) { size_t i; - for( i = 0; i != mTools.Count(); ++i ) + for( i = 0; i != mTools.Count(); ++i ) { - if ( mTools[i]->mIndex == toolIndex ) + if ( mTools[i]->mIndex == toolIndex ) return mTools[i]; } - return NULL; + return NULL; } void wxDynamicToolBar::RemveTool( int toolIndex ) { size_t i; - for( i = 0; i != mTools.Count(); ++i ) + for( i = 0; i != mTools.Count(); ++i ) { - if ( mTools[i]->mIndex == toolIndex ) - { - if ( mTools[i]->mpToolWnd ) - { - mTools[i]->mpToolWnd->Destroy(); - } + if ( mTools[i]->mIndex == toolIndex ) + { + if ( mTools[i]->mpToolWnd ) + { + mTools[i]->mpToolWnd->Destroy(); + } delete mTools[i]; // HVL To be tested!!! #if wxCHECK_VERSION(2,3,2) - mTools.RemoveAt(i); + mTools.RemoveAt(i); #else - mTools.Remove(i); + mTools.Remove(i); #endif - Layout(); + Layout(); - return; - } + return; + } } - // TODO:: if not found, should it be an assertion? + // TODO:: if not found, should it be an assertion? } void wxDynamicToolBar::AddSeparator( wxWindow* pSepartorWnd ) { - wxDynToolInfo* pInfo = new wxDynToolInfo(); - - pInfo->mpToolWnd = pSepartorWnd; - pInfo->mIndex = -1; - pInfo->mIsSeparator = TRUE; - - if ( pSepartorWnd ) - { - pSepartorWnd->Create( this, -1 ); - - int x,y; - pSepartorWnd->GetSize( &x, &y ); - pInfo->mRealSize.x = x; - pInfo->mRealSize.y = y; - - pInfo->mRect.width = x; - pInfo->mRect.height = y; - } - else - { - pInfo->mRealSize.x = mSepartorSize; - pInfo->mRealSize.y = 0; - - pInfo->mRect.width = mSepartorSize; - pInfo->mRect.height = 0; - } - - mTools.Add( pInfo ); + wxDynToolInfo* pInfo = new wxDynToolInfo(); + + pInfo->mpToolWnd = pSepartorWnd; + pInfo->mIndex = -1; + pInfo->mIsSeparator = TRUE; + + if ( pSepartorWnd ) + { + pSepartorWnd->Create( this, -1 ); + + int x,y; + pSepartorWnd->GetSize( &x, &y ); + pInfo->mRealSize.x = x; + pInfo->mRealSize.y = y; + + pInfo->mRect.width = x; + pInfo->mRect.height = y; + } + else + { + pInfo->mRealSize.x = mSepartorSize; + pInfo->mRealSize.y = 0; + + pInfo->mRect.width = mSepartorSize; + pInfo->mRect.height = 0; + } + + mTools.Add( pInfo ); } void wxDynamicToolBar::OnEraseBackground( wxEraseEvent& event ) { - // FOR NOW:: nothing + // FOR NOW:: nothing } void wxDynamicToolBar::OnSize( wxSizeEvent& event ) { - //SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); + //SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); - Layout(); + Layout(); } void wxDynamicToolBar::DrawSeparator( wxDynToolInfo& info, wxDC& dc ) { - // check the orientation of separator - if ( info.mRect.width < info.mRect.height ) - { - int midX = info.mRect.x + info.mRect.width/2 - 1; - - dc.SetPen( *wxGREY_PEN ); - dc.DrawLine( midX, info.mRect.y, - midX, info.mRect.y + info.mRect.height+1 ); - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( midX+1, info.mRect.y, - midX+1, info.mRect.y + info.mRect.height+1 ); - } - else - { - int midY = info.mRect.y + info.mRect.height/2 - 1; - - dc.SetPen( *wxGREY_PEN ); - dc.DrawLine( info.mRect.x, midY, - info.mRect.x + info.mRect.width+1, midY ); - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( info.mRect.x, midY + 1, - info.mRect.x + info.mRect.width+1, midY + 1 ); - } + // check the orientation of separator + if ( info.mRect.width < info.mRect.height ) + { + int midX = info.mRect.x + info.mRect.width/2 - 1; + + dc.SetPen( *wxGREY_PEN ); + dc.DrawLine( midX, info.mRect.y, + midX, info.mRect.y + info.mRect.height+1 ); + + dc.SetPen( *wxWHITE_PEN ); + dc.DrawLine( midX+1, info.mRect.y, + midX+1, info.mRect.y + info.mRect.height+1 ); + } + else + { + int midY = info.mRect.y + info.mRect.height/2 - 1; + + dc.SetPen( *wxGREY_PEN ); + dc.DrawLine( info.mRect.x, midY, + info.mRect.x + info.mRect.width+1, midY ); + + dc.SetPen( *wxWHITE_PEN ); + dc.DrawLine( info.mRect.x, midY + 1, + info.mRect.x + info.mRect.width+1, midY + 1 ); + } } void wxDynamicToolBar::OnPaint( wxPaintEvent& event ) { - // draw separators if any + // draw separators if any - wxPaintDC dc(this); + wxPaintDC dc(this); size_t i; - for( i = 0; i != mTools.Count(); ++i ) - - if ( mTools[i]->mIsSeparator ) - { - // check if separator doesn't have it's own window - // if so, then draw it using built-in drawing method + for( i = 0; i != mTools.Count(); ++i ) + + if ( mTools[i]->mIsSeparator ) + { + // check if separator doesn't have it's own window + // if so, then draw it using built-in drawing method - if ( !mTools[i]->mpToolWnd ) + if ( !mTools[i]->mpToolWnd ) - DrawSeparator( *mTools[i], dc ); - } + DrawSeparator( *mTools[i], dc ); + } } // FOR NOW:: quick fix @@ -323,174 +322,174 @@ void wxDynamicToolBar::OnPaint( wxPaintEvent& event ) void wxDynamicToolBar::SizeToolWindows() { size_t i; - for( i = 0; i != mTools.Count(); ++i ) - { - wxDynToolInfo& info = *mTools[i]; - - if ( !info.mIsSeparator ) - { - - // center real rectangle within the rectangle - // provided by the layout manager - - int x = info.mRect.x; - int y = info.mRect.y + (info.mRect.height - info.mRealSize.y)/2; - - // FOR NOW FOR NOW:: quick & dirty fix - if ( info.mpToolWnd->IsKindOf( CLASSINFO( wxChoice ) ) ) - { - info.mpToolWnd->SetSize( x,y, - info.mRealSize.x - 3, - info.mRealSize.y); - } - else - info.mpToolWnd->SetSize( x,y, - info.mRealSize.x, - info.mRealSize.y ); - } - - // TBD:: size separator window if present - } + for( i = 0; i != mTools.Count(); ++i ) + { + wxDynToolInfo& info = *mTools[i]; + + if ( !info.mIsSeparator ) + { + + // center real rectangle within the rectangle + // provided by the layout manager + + int x = info.mRect.x; + int y = info.mRect.y + (info.mRect.height - info.mRealSize.y)/2; + + // FOR NOW FOR NOW:: quick & dirty fix + if ( info.mpToolWnd->IsKindOf( CLASSINFO( wxChoice ) ) ) + { + info.mpToolWnd->SetSize( x,y, + info.mRealSize.x - 3, + info.mRealSize.y); + } + else + info.mpToolWnd->SetSize( x,y, + info.mRealSize.x, + info.mRealSize.y ); + } + + // TBD:: size separator window if present + } } bool wxDynamicToolBar::Layout() { - if ( !mpLayoutMan ) - mpLayoutMan = CreateDefaulLayout(); + if ( !mpLayoutMan ) + mpLayoutMan = CreateDefaultLayout(); - int x,y; - GetSize( &x, &y ); - wxSize wndDim(x,y); - wxSize result; + int x,y; + GetSize( &x, &y ); + wxSize wndDim(x,y); + wxSize result; - wxLayoutItemArrayT items; + wxLayoutItemArrayT items; - // safe conversion + // safe conversion size_t i; - for( i = 0; i != mTools.Count(); ++i ) + for( i = 0; i != mTools.Count(); ++i ) items.Add( mTools[i] ); - mpLayoutMan->Layout( wndDim, result, items, mVertGap, mHorizGap );; + mpLayoutMan->Layout( wndDim, result, items, mVertGap, mHorizGap );; - SizeToolWindows(); + SizeToolWindows(); return TRUE; } void wxDynamicToolBar::GetPreferredDim( const wxSize& givenDim, wxSize& prefDim ) { - if ( !mpLayoutMan ) - mpLayoutMan = CreateDefaulLayout(); + if ( !mpLayoutMan ) + mpLayoutMan = CreateDefaultLayout(); - wxLayoutItemArrayT items; + wxLayoutItemArrayT items; - // safe conversion + // safe conversion size_t i; - for( i = 0; i != mTools.Count(); ++i ) + for( i = 0; i != mTools.Count(); ++i ) items.Add( mTools[i] ); - mpLayoutMan->Layout( givenDim, prefDim, items, mVertGap, mHorizGap );; + mpLayoutMan->Layout( givenDim, prefDim, items, mVertGap, mHorizGap );; } void wxDynamicToolBar::SetLayout( LayoutManagerBase* pLayout ) { - if ( mpLayoutMan ) + if ( mpLayoutMan ) delete mpLayoutMan; - mpLayoutMan = pLayout; + mpLayoutMan = pLayout; - Layout(); + Layout(); } void wxDynamicToolBar::EnableTool(const int toolIndex, const bool enable ) { - wxDynToolInfo* pInfo = GetToolInfo( toolIndex ); + wxDynToolInfo* pInfo = GetToolInfo( toolIndex ); - if ( !pInfo ) + if ( !pInfo ) return; - if ( pInfo->mIsSeparator || !pInfo->mpToolWnd ) + if ( pInfo->mIsSeparator || !pInfo->mpToolWnd ) return; - pInfo->mpToolWnd->Enable( enable ); + pInfo->mpToolWnd->Enable( enable ); } /***** Implementation for class BagLayout *****/ void BagLayout::Layout( const wxSize& parentDim, - wxSize& resultingDim, - wxLayoutItemArrayT& items, - int horizGap, - int vertGap - ) + wxSize& resultingDim, + wxLayoutItemArrayT& items, + int horizGap, + int vertGap + ) { - int maxWidth = 0; - int curY = 0; - int nRows = 0; + int maxWidth = 0; + int curY = 0; + int nRows = 0; - size_t i = 0; + size_t i = 0; - while( i < items.Count() ) - { - int curX = 0; - int height = 0; - // int nItems = 0; + while( i < items.Count() ) + { + int curX = 0; + int height = 0; + // int nItems = 0; - // int firstItem = i; - int itemsInRow = 0; + // int firstItem = i; + int itemsInRow = 0; - if ( nRows > 0 ) + if ( nRows > 0 ) curY += vertGap; - // step #1 - arrange horizontal positions of items in the row + // step #1 - arrange horizontal positions of items in the row - do - { - if ( itemsInRow > 0 ) + do + { + if ( itemsInRow > 0 ) curX += horizGap; - wxRect& r = items[i]->mRect; + wxRect& r = items[i]->mRect; - if ( curX + r.width > parentDim.x ) + if ( curX + r.width > parentDim.x ) { - if ( itemsInRow > 0 ) + if ( itemsInRow > 0 ) break; } - r.x = curX; - r.y = curY; + r.x = curX; + r.y = curY; - curX += r.width; + curX += r.width; - height = wxMax( height, r.height ); + height = wxMax( height, r.height ); - ++itemsInRow; - ++i; + ++itemsInRow; + ++i; - } while( i < items.Count() ); + } while( i < items.Count() ); - curY += height; + curY += height; - maxWidth = wxMax( maxWidth, curX ); - } + maxWidth = wxMax( maxWidth, curX ); + } - resultingDim.x = maxWidth; - resultingDim.y = curY; + resultingDim.x = maxWidth; + resultingDim.y = curY; } //////// stuff from 2.1.15 /////////// wxToolBarToolBase* wxDynamicToolBar::FindToolForPosition( wxCoord x, wxCoord y ) const { - return NULL; + return NULL; } bool wxDynamicToolBar::DoInsertTool( size_t pos, wxToolBarToolBase* tool ) { - return TRUE; + return TRUE; } bool wxDynamicToolBar::DoDeleteTool( size_t pos, wxToolBarToolBase* tool ) { - return TRUE; + return TRUE; } void wxDynamicToolBar::DoEnableTool( wxToolBarToolBase* tool, bool enable ) @@ -507,11 +506,11 @@ void wxDynamicToolBar::DoSetToggle( wxToolBarToolBase* tool, bool toggle ) wxToolBarToolBase* wxDynamicToolBar::CreateTool( int id, const wxBitmap& bitmap1, const wxBitmap& bitmap2, bool toggle, wxObject* clientData, const wxString& shortHelpString, const wxString& longHelpString ) { - return NULL; + return NULL; } wxToolBarToolBase* wxDynamicToolBar::CreateTool( wxControl* control ) { - return NULL; + return NULL; } diff --git a/contrib/src/fl/dyntbarhnd.cpp b/contrib/src/fl/dyntbarhnd.cpp index e375851436..2a819c5b9b 100644 --- a/contrib/src/fl/dyntbarhnd.cpp +++ b/contrib/src/fl/dyntbarhnd.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: dyntbarhnd.cpp +// Purpose: cbDynToolBarDimHandler implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 23/01/99 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -20,30 +20,28 @@ #pragma hdrstop #endif - #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wx/fl/dyntbarhnd.h" - /***** Implementation for class cbDynToolBarDimHandler *****/ IMPLEMENT_DYNAMIC_CLASS( cbDynToolBarDimHandler, cbBarDimHandlerBase ) void cbDynToolBarDimHandler::OnChangeBarState(cbBarInfo* pBar, int newState ) { - // nothing + // nothing } void cbDynToolBarDimHandler::OnResizeBar( cbBarInfo* pBar, - const wxSize& given, - wxSize& preferred ) + const wxSize& given, + wxSize& preferred ) { - wxASSERT( pBar->mpBarWnd ); // DBG:: should be present + wxASSERT( pBar->mpBarWnd ); // DBG:: should be present - wxDynamicToolBar* pTBar = (wxDynamicToolBar*)pBar->mpBarWnd; + wxDynamicToolBar* pTBar = (wxDynamicToolBar*)pBar->mpBarWnd; - pTBar->GetPreferredDim( given, preferred ); + pTBar->GetPreferredDim( given, preferred ); } diff --git a/contrib/src/fl/files.lst b/contrib/src/fl/files.lst index 662777828e..0a653d8b0d 100644 --- a/contrib/src/fl/files.lst +++ b/contrib/src/fl/files.lst @@ -12,7 +12,6 @@ FL_OBJECTS = \ newbmpbtn.$(OBJ_EXT) \ updatesmgr.$(OBJ_EXT) \ cbcustom.$(OBJ_EXT) \ - frmview.$(OBJ_EXT) \ panedrawpl.$(OBJ_EXT) \ controlbar.$(OBJ_EXT) \ garbagec.$(OBJ_EXT) \ diff --git a/contrib/src/fl/flVC.dsp b/contrib/src/fl/flVC.dsp index b01785d3a3..0d1adf1f93 100644 --- a/contrib/src/fl/flVC.dsp +++ b/contrib/src/fl/flVC.dsp @@ -188,10 +188,6 @@ SOURCE=.\dyntbarhnd.cpp # End Source File # Begin Source File -SOURCE=.\frmview.cpp -# End Source File -# Begin Source File - SOURCE=.\garbagec.cpp # End Source File # Begin Source File diff --git a/contrib/src/fl/frmview.cpp b/contrib/src/fl/frmview.cpp index 8787fe0d10..0ed194084f 100644 --- a/contrib/src/fl/frmview.cpp +++ b/contrib/src/fl/frmview.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: frmview.cpp +// Purpose: wxFrameView implementation. NOT USED IN FL. // Author: Aleksandras Gluchovas // Modified by: // Created: 02/01/99 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ diff --git a/contrib/src/fl/garbagec.cpp b/contrib/src/fl/garbagec.cpp index 049f944e93..564823928b 100644 --- a/contrib/src/fl/garbagec.cpp +++ b/contrib/src/fl/garbagec.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: garbagec.cpp +// Purpose: Garbage collection algorithm for optimizing refresh. // Author: Aleksandras Gluchovas // Modified by: // Created: 18/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -32,193 +32,193 @@ inline static GCItem& node_to_item( wxNode* pNode ) { - return *( (GCItem*)(pNode->Data()) ); + return *( (GCItem*)(pNode->Data()) ); } GarbageCollector::~GarbageCollector() { - Reset(); + Reset(); } /*** GC alg. helpers ***/ void GarbageCollector::DestroyItemList( wxList& lst ) { - wxNode* pNode = lst.First(); + wxNode* pNode = lst.First(); - while( pNode ) - { - delete &node_to_item( pNode ); + while( pNode ) + { + delete &node_to_item( pNode ); - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - lst.Clear(); + lst.Clear(); } wxNode* GarbageCollector::FindItemNode( void* pForObj ) { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.First(); - while( pNode ) - { - if ( node_to_item( pNode ).mpObj == pForObj ) + while( pNode ) + { + if ( node_to_item( pNode ).mpObj == pForObj ) - return pNode; + return pNode; - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - int avoidCompilerWarning = 0; - wxASSERT(avoidCompilerWarning); // DBG:: item should be present + int avoidCompilerWarning = 0; + wxASSERT(avoidCompilerWarning); // DBG:: item should be present - return 0; + return 0; } wxNode* GarbageCollector::FindReferenceFreeItemNode() { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.First(); - while( pNode ) - { - if ( node_to_item( pNode ).mRefs.Number() == 0 ) + while( pNode ) + { + if ( node_to_item( pNode ).mRefs.Number() == 0 ) - return pNode; + return pNode; - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - return 0; + return 0; } void GarbageCollector::RemoveReferencesToNode( wxNode* pItemNode ) { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.First(); - while( pNode ) - { - wxList& refLst = node_to_item( pNode ).mRefs; - wxNode* pRefNode = refLst.First(); + while( pNode ) + { + wxList& refLst = node_to_item( pNode ).mRefs; + wxNode* pRefNode = refLst.First(); - while( pRefNode ) - { - if ( pRefNode->Data() == (wxObject*)pItemNode ) - { - wxNode* pNext = pRefNode->Next(); + while( pRefNode ) + { + if ( pRefNode->Data() == (wxObject*)pItemNode ) + { + wxNode* pNext = pRefNode->Next(); - refLst.DeleteNode( pRefNode ); + refLst.DeleteNode( pRefNode ); - pRefNode = pNext; + pRefNode = pNext; - continue; - } - else pRefNode = pRefNode->Next(); - } + continue; + } + else pRefNode = pRefNode->Next(); + } - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } } void GarbageCollector::ResolveReferences() { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.First(); - while( pNode ) - { - GCItem& item = node_to_item( pNode ); + while( pNode ) + { + GCItem& item = node_to_item( pNode ); - wxNode* pRefNode = item.mRefs.First(); + wxNode* pRefNode = item.mRefs.First(); - while( pRefNode ) - { - pRefNode->SetData( (wxObject*) FindItemNode( (void*)pRefNode->Data() ) ); + while( pRefNode ) + { + pRefNode->SetData( (wxObject*) FindItemNode( (void*)pRefNode->Data() ) ); - pRefNode = pRefNode->Next(); - } + pRefNode = pRefNode->Next(); + } - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } } void GarbageCollector::AddObject( void* pObj, int refCnt ) { - // FOR NOW:: initial ref-count is not used + // FOR NOW:: initial ref-count is not used - GCItem* pItem = new GCItem(); + GCItem* pItem = new GCItem(); - pItem->mpObj = pObj; + pItem->mpObj = pObj; - mAllNodes.Append( (wxObject*) pItem ); + mAllNodes.Append( (wxObject*) pItem ); } void GarbageCollector::AddDependency( void* pObj, void* pDependsOnObj ) { - node_to_item( FindItemNode( pObj ) ).mRefs.Append( (wxObject*)pDependsOnObj ); + node_to_item( FindItemNode( pObj ) ).mRefs.Append( (wxObject*)pDependsOnObj ); } /*** GC alg. implementation ***/ void GarbageCollector::ArrangeCollection() { - ResolveReferences(); + ResolveReferences(); - do - { - // find node, which does not depend on anything + do + { + // find node, which does not depend on anything - wxNode* pItemNode = FindReferenceFreeItemNode(); + wxNode* pItemNode = FindReferenceFreeItemNode(); - if ( pItemNode ) - { - // append it to the list, where items are contained - // in the increasing order of dependencies + if ( pItemNode ) + { + // append it to the list, where items are contained + // in the increasing order of dependencies - mRegularLst.Append( pItemNode->Data() ); + mRegularLst.Append( pItemNode->Data() ); - mAllNodes.DeleteNode( pItemNode ); + mAllNodes.DeleteNode( pItemNode ); - // remove references to this current "least-dependent" node - // from reference lists of all the other nodes + // remove references to this current "least-dependent" node + // from reference lists of all the other nodes - RemoveReferencesToNode( pItemNode ); - } - else - { - // otherwise, what is left - all nodes, which - // are involved into cycled chains (rings) + RemoveReferencesToNode( pItemNode ); + } + else + { + // otherwise, what is left - all nodes, which + // are involved into cycled chains (rings) - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.First(); - while( pNode ) - { - mCycledLst.Append( pNode->Data() ); + while( pNode ) + { + mCycledLst.Append( pNode->Data() ); - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - break; - } + break; + } - // continue search for "least-dependent" nodes + // continue search for "least-dependent" nodes - } while(1); + } while(1); } wxList& GarbageCollector::GetRegularObjects() { - return mRegularLst; + return mRegularLst; } wxList& GarbageCollector::GetCycledObjects() { - return mCycledLst; + return mCycledLst; } void GarbageCollector::Reset() { - DestroyItemList( mAllNodes ); + DestroyItemList( mAllNodes ); - mRegularLst.Clear(); - mCycledLst.Clear(); + mRegularLst.Clear(); + mCycledLst.Clear(); } diff --git a/contrib/src/fl/gcupdatesmgr.cpp b/contrib/src/fl/gcupdatesmgr.cpp index dfe73d3811..5790666c9d 100644 --- a/contrib/src/fl/gcupdatesmgr.cpp +++ b/contrib/src/fl/gcupdatesmgr.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: gcupdatesmgr.cpp +// Purpose: cbGCUpdatesMgr class, optimizing refresh using GarbageCollector // Author: Aleksandras Gluchovas // Modified by: // Created: 19/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -30,30 +30,30 @@ static inline bool rect_hits_rect( const wxRect& r1, const wxRect& r2 ) { - if ( ( r2.x >= r1.x && r2.x <= r1.x + r1.width ) || - ( r1.x >= r2.x && r1.x <= r2.x + r2.width ) ) + if ( ( r2.x >= r1.x && r2.x <= r1.x + r1.width ) || + ( r1.x >= r2.x && r1.x <= r2.x + r2.width ) ) - if ( ( r2.y >= r1.y && r2.y <= r1.y + r1.height ) || - ( r1.y >= r2.y && r1.y <= r2.y + r2.height ) ) - - return 1; + if ( ( r2.y >= r1.y && r2.y <= r1.y + r1.height ) || + ( r1.y >= r2.y && r1.y <= r2.y + r2.height ) ) + + return 1; - return 0; + return 0; } // helper structure struct cbRectInfo { - cbBarInfo* mpBar; - cbDockPane* mpPane; - wxRect* mpCurBounds; - wxRect* mpPrevBounds; + cbBarInfo* mpBar; + cbDockPane* mpPane; + wxRect* mpCurBounds; + wxRect* mpPrevBounds; }; static inline cbRectInfo& node_to_rect_info( wxNode* pNode ) { - return *( (cbRectInfo*) (pNode->Data()) ); + return *( (cbRectInfo*) (pNode->Data()) ); } /***** Implementation for class cbSimpleUpdatesMgr *****/ @@ -61,350 +61,350 @@ static inline cbRectInfo& node_to_rect_info( wxNode* pNode ) IMPLEMENT_DYNAMIC_CLASS( cbGCUpdatesMgr, cbSimpleUpdatesMgr ) cbGCUpdatesMgr::cbGCUpdatesMgr( wxFrameLayout* pPanel ) - : cbSimpleUpdatesMgr( pPanel ) + : cbSimpleUpdatesMgr( pPanel ) {} void cbGCUpdatesMgr::AddItem( wxList& itemList, - cbBarInfo* pBar, - cbDockPane* pPane, - wxRect& curBounds, - wxRect& prevBounds ) + cbBarInfo* pBar, + cbDockPane* pPane, + wxRect& curBounds, + wxRect& prevBounds ) { - cbRectInfo* pInfo = new cbRectInfo(); + cbRectInfo* pInfo = new cbRectInfo(); - pInfo->mpBar = pBar; - pInfo->mpPane = pPane; - pInfo->mpCurBounds = &curBounds; - pInfo->mpPrevBounds = &prevBounds; + pInfo->mpBar = pBar; + pInfo->mpPane = pPane; + pInfo->mpCurBounds = &curBounds; + pInfo->mpPrevBounds = &prevBounds; - itemList.Append( (wxObject*) pInfo ); + itemList.Append( (wxObject*) pInfo ); } void cbGCUpdatesMgr::OnStartChanges() { - // memorize states of ALL items in the layout - - // this is quite excessive, but OK for the decent - // implementation of updates manager + // memorize states of ALL items in the layout - + // this is quite excessive, but OK for the decent + // implementation of updates manager - mpLayout->GetPrevClientRect() = mpLayout->GetClientRect(); + mpLayout->GetPrevClientRect() = mpLayout->GetClientRect(); - cbDockPane** panes = mpLayout->GetPanesArray(); + cbDockPane** panes = mpLayout->GetPanesArray(); - for( int n = 0; n != MAX_PANES; ++n ) - { - cbDockPane& pane = *(panes[n]); + for( int n = 0; n != MAX_PANES; ++n ) + { + cbDockPane& pane = *(panes[n]); - // store pane state - pane.mUMgrData.StoreItemState( pane.mBoundsInParent ); - pane.mUMgrData.SetDirty( FALSE ); + // store pane state + pane.mUMgrData.StoreItemState( pane.mBoundsInParent ); + pane.mUMgrData.SetDirty( FALSE ); - cbRowInfo* pRow = pane.GetFirstRow(); + cbRowInfo* pRow = pane.GetFirstRow(); - while ( pRow ) - { - cbBarInfo* pBar = pRow->GetFirstBar(); + while ( pRow ) + { + cbBarInfo* pBar = pRow->GetFirstBar(); - // store row state - pRow->mUMgrData.StoreItemState( pRow->mBoundsInParent ); - pRow->mUMgrData.SetDirty( FALSE ); + // store row state + pRow->mUMgrData.StoreItemState( pRow->mBoundsInParent ); + pRow->mUMgrData.SetDirty( FALSE ); - while( pBar ) - { - // store bar state - pBar->mUMgrData.StoreItemState( pBar->mBoundsInParent ); - pBar->mUMgrData.SetDirty( FALSE ); + while( pBar ) + { + // store bar state + pBar->mUMgrData.StoreItemState( pBar->mBoundsInParent ); + pBar->mUMgrData.SetDirty( FALSE ); - pBar = pBar->mpNext; - } + pBar = pBar->mpNext; + } - pRow = pRow->mpNext; - } - } + pRow = pRow->mpNext; + } + } } void cbGCUpdatesMgr::UpdateNow() { - cbDockPane** panes = mpLayout->GetPanesArray(); + cbDockPane** panes = mpLayout->GetPanesArray(); - wxRect& r1 = mpLayout->GetClientRect(); - wxRect& r2 = mpLayout->GetPrevClientRect(); + wxRect& r1 = mpLayout->GetClientRect(); + wxRect& r2 = mpLayout->GetPrevClientRect(); - // detect changes in client window's area + // detect changes in client window's area - bool clientWindowChanged = ( r1.x != r2.x || - r1.y != r2.y || - r1.width != r2.width || - r1.height != r2.height ); + bool clientWindowChanged = ( r1.x != r2.x || + r1.y != r2.y || + r1.width != r2.width || + r1.height != r2.height ); - // step #1 - detect changes in each row of each pane, - // and repaint decorations around changed windows + // step #1 - detect changes in each row of each pane, + // and repaint decorations around changed windows - wxList mBarsToResize; + wxList mBarsToResize; - int n; - for ( n = 0; n != MAX_PANES; ++n ) - { - cbDockPane& pane = *(panes[n]); + int n; + for ( n = 0; n != MAX_PANES; ++n ) + { + cbDockPane& pane = *(panes[n]); - bool paneChanged = WasChanged( pane.mUMgrData, pane.mBoundsInParent ); + bool paneChanged = WasChanged( pane.mUMgrData, pane.mBoundsInParent ); - if ( paneChanged ) - { - wxClientDC dc( &mpLayout->GetParentFrame() ); - pane.PaintPaneBackground( dc ); - } + if ( paneChanged ) + { + wxClientDC dc( &mpLayout->GetParentFrame() ); + pane.PaintPaneBackground( dc ); + } - wxRect realBounds; + wxRect realBounds; - cbRowInfo* pRow = pane.GetFirstRow(); + cbRowInfo* pRow = pane.GetFirstRow(); - while ( pRow ) - { - wxDC* pDc = 0; + while ( pRow ) + { + wxDC* pDc = 0; - cbBarInfo* pBar = pRow->GetFirstBar(); + cbBarInfo* pBar = pRow->GetFirstBar(); - bool rowChanged = FALSE; -// bool rowBkPainted = FALSE; + bool rowChanged = FALSE; +// bool rowBkPainted = FALSE; - // FIXME:: the below should not be fixed - cbBarInfo* barsToRepaint[128]; - // number of bars, that were changed in the current row - int nBars = 0; + // FIXME:: the below should not be fixed + cbBarInfo* barsToRepaint[128]; + // number of bars, that were changed in the current row + int nBars = 0; - wxRect r1 = pRow->mUMgrData.mPrevBounds; - wxRect r2 = pRow->mBoundsInParent; + wxRect r1 = pRow->mUMgrData.mPrevBounds; + wxRect r2 = pRow->mBoundsInParent; - if ( WasChanged( pRow->mUMgrData, pRow->mBoundsInParent ) ) - - rowChanged = TRUE; - else - while( pBar ) - { - if ( WasChanged( pBar->mUMgrData, pBar->mBoundsInParent ) ) - - barsToRepaint[nBars++] = pBar; + if ( WasChanged( pRow->mUMgrData, pRow->mBoundsInParent ) ) + + rowChanged = TRUE; + else + while( pBar ) + { + if ( WasChanged( pBar->mUMgrData, pBar->mBoundsInParent ) ) + + barsToRepaint[nBars++] = pBar; - pBar = pBar->mpNext; - } + pBar = pBar->mpNext; + } - if ( nBars || rowChanged ) - { - realBounds = pRow->mBoundsInParent; + if ( nBars || rowChanged ) + { + realBounds = pRow->mBoundsInParent; - // include 1-pixel thick shades around the row - realBounds.x -= 1; - realBounds.y -= 1; - realBounds.width += 2; - realBounds.height += 2; + // include 1-pixel thick shades around the row + realBounds.x -= 1; + realBounds.y -= 1; + realBounds.width += 2; + realBounds.height += 2; - pDc = pane.StartDrawInArea( realBounds ); - } + pDc = pane.StartDrawInArea( realBounds ); + } - if ( rowChanged ) - { - // postphone the resizement and refreshing the changed - // bar windows + if ( rowChanged ) + { + // postphone the resizement and refreshing the changed + // bar windows - cbBarInfo* pCurBar = pRow->GetFirstBar(); + cbBarInfo* pCurBar = pRow->GetFirstBar(); - while ( pCurBar ) - { - if ( WasChanged( pCurBar->mUMgrData, - pCurBar->mBoundsInParent ) ) + while ( pCurBar ) + { + if ( WasChanged( pCurBar->mUMgrData, + pCurBar->mBoundsInParent ) ) - AddItem( mBarsToResize, pCurBar, &pane, - pCurBar->mBoundsInParent, - pCurBar->mUMgrData.mPrevBounds ); + AddItem( mBarsToResize, pCurBar, &pane, + pCurBar->mBoundsInParent, + pCurBar->mUMgrData.mPrevBounds ); - pCurBar = pCurBar->mpNext; - } + pCurBar = pCurBar->mpNext; + } - // draw only their decorations now + // draw only their decorations now - pane.PaintRow( pRow, *pDc ); - } - else - if ( nBars != 0 ) - { - for ( int i = 0; i != nBars; ++i ) + pane.PaintRow( pRow, *pDc ); + } + else + if ( nBars != 0 ) + { + for ( int i = 0; i != nBars; ++i ) - // postphone the resizement and refreshing the changed - // bar windows + // postphone the resizement and refreshing the changed + // bar windows - AddItem( mBarsToResize, - barsToRepaint[i], - &pane, - barsToRepaint[i]->mBoundsInParent, - barsToRepaint[i]->mUMgrData.mPrevBounds ); + AddItem( mBarsToResize, + barsToRepaint[i], + &pane, + barsToRepaint[i]->mBoundsInParent, + barsToRepaint[i]->mUMgrData.mPrevBounds ); - // redraw decorations of entire row, regardless of how much - // of the bars were changed + // redraw decorations of entire row, regardless of how much + // of the bars were changed - pane.PaintRow( pRow, *pDc ); - } + pane.PaintRow( pRow, *pDc ); + } - if ( pDc ) - - pane.FinishDrawInArea( realBounds ); + if ( pDc ) + + pane.FinishDrawInArea( realBounds ); - pRow = pRow->mpNext; + pRow = pRow->mpNext; - } // end of while + } // end of while - if ( paneChanged ) - { - wxClientDC dc( &mpLayout->GetParentFrame() ); - pane.PaintPaneDecorations( dc ); - } + if ( paneChanged ) + { + wxClientDC dc( &mpLayout->GetParentFrame() ); + pane.PaintPaneDecorations( dc ); + } - } // end of for + } // end of for - if ( clientWindowChanged && !mpLayout->mClientWndRefreshPending ) - { - // ptr to client-window object is "marked" as NULL + if ( clientWindowChanged && !mpLayout->mClientWndRefreshPending ) + { + // ptr to client-window object is "marked" as NULL - AddItem( mBarsToResize, NULL, NULL, - mpLayout->GetClientRect(), - mpLayout->GetPrevClientRect() ); - } + AddItem( mBarsToResize, NULL, NULL, + mpLayout->GetClientRect(), + mpLayout->GetPrevClientRect() ); + } - // step #2 - do ordered refreshing and resizing of bar window objects now + // step #2 - do ordered refreshing and resizing of bar window objects now - DoRepositionItems( mBarsToResize ); + DoRepositionItems( mBarsToResize ); } void cbGCUpdatesMgr::DoRepositionItems( wxList& items ) { - wxNode* pNode1 = items.First(); + wxNode* pNode1 = items.First(); - while( pNode1 ) - { - cbRectInfo& info = node_to_rect_info( pNode1 ); + while( pNode1 ) + { + cbRectInfo& info = node_to_rect_info( pNode1 ); - wxNode* pNode2 = items.First(); + wxNode* pNode2 = items.First(); - // and node itself + // and node itself - mGC.AddObject( &info ); + mGC.AddObject( &info ); - while( pNode2 ) - { - if ( pNode2 != pNode1 ) // node should not depend on itself - { - // add references to objects, on which this object - // depends. Dependecy here indicates intersection of current - // bounds of this object with the initial bounds of the - // other object + while( pNode2 ) + { + if ( pNode2 != pNode1 ) // node should not depend on itself + { + // Add references to objects on which this object + // depends. Dependency here indicates intersection of current + // bounds of this object with the initial bounds of the + // other object. - cbRectInfo& otherInfo = node_to_rect_info( pNode2 ); + cbRectInfo& otherInfo = node_to_rect_info( pNode2 ); - if ( rect_hits_rect( *info.mpCurBounds, *otherInfo.mpPrevBounds ) ) - - // the node depends on node - mGC.AddDependency( &info, &otherInfo ); - } + if ( rect_hits_rect( *info.mpCurBounds, *otherInfo.mpPrevBounds ) ) + + // the node depends on node + mGC.AddDependency( &info, &otherInfo ); + } - pNode2 = pNode2->Next(); - } + pNode2 = pNode2->Next(); + } - pNode1 = pNode1->Next(); - } + pNode1 = pNode1->Next(); + } - mGC.ArrangeCollection(); // order nodes according "least-dependency" rule, - // and find out cycled chains + mGC.ArrangeCollection(); // order nodes according "least-dependency" rule, + // and find out cycled chains - // regular item nodes need to be resized, but not repainted (since - // they stand in linear (not cyclic) dependency with other - // regular nodes) + // Regular item nodes need to be resized, but not repainted (since + // they stand in linear (not cyclic) dependency with other + // regular nodes). - wxNode* pNode = mGC.GetRegularObjects().First(); + wxNode* pNode = mGC.GetRegularObjects().First(); - while ( pNode ) - { - cbRectInfo& info = *((cbRectInfo*)gc_node_to_obj(pNode)); + while ( pNode ) + { + cbRectInfo& info = *((cbRectInfo*)gc_node_to_obj(pNode)); - if ( info.mpBar == NULL ) - - mpLayout->PositionClientWindow(); - else - info.mpPane->SizeBar( info.mpBar ); + if ( info.mpBar == NULL ) + + mpLayout->PositionClientWindow(); + else + info.mpPane->SizeBar( info.mpBar ); - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - // cycled item nodes, need to be both resized and repainted + // cycled item nodes, need to be both resized and repainted - pNode = mGC.GetCycledObjects().First(); + pNode = mGC.GetCycledObjects().First(); - while ( pNode ) - { - cbRectInfo& info = *((cbRectInfo*)gc_node_to_obj(pNode)); + while ( pNode ) + { + cbRectInfo& info = *((cbRectInfo*)gc_node_to_obj(pNode)); - if ( info.mpBar == NULL ) - { - wxWindow* pClntWnd = mpLayout->GetFrameClient(); + if ( info.mpBar == NULL ) + { + wxWindow* pClntWnd = mpLayout->GetFrameClient(); - mpLayout->PositionClientWindow(); + mpLayout->PositionClientWindow(); - // FIXME FIXME:: excessive! + // FIXME FIXME:: excessive! - pClntWnd->Show( FALSE ); - pClntWnd->Show( TRUE ); + pClntWnd->Show( FALSE ); + pClntWnd->Show( TRUE ); - // OLD STUFF:: mpLayout->PositionClientWindow(); - } - else - if ( info.mpBar->mpBarWnd ) - { - wxWindow* pWnd = info.mpBar->mpBarWnd; + // OLD STUFF:: mpLayout->PositionClientWindow(); + } + else + if ( info.mpBar->mpBarWnd ) + { + wxWindow* pWnd = info.mpBar->mpBarWnd; - // resize - info.mpPane->SizeBar( info.mpBar ); + // resize + info.mpPane->SizeBar( info.mpBar ); - // repaint + // repaint - /* OLD STUFF:: bool isChoice = info.mpBar->IsKindOf( CLASSINFO( wxChoice ) ); + /* OLD STUFF:: bool isChoice = info.mpBar->IsKindOf( CLASSINFO( wxChoice ) ); - //#ifdef __WINDOWS__ - //int result = ::SendMessage( (HWND)pWnd->m_hWnd, WM_NCPAINT, 0, 0 ); - //#endif - */ + //#ifdef __WINDOWS__ + //int result = ::SendMessage( (HWND)pWnd->m_hWnd, WM_NCPAINT, 0, 0 ); + //#endif + */ - // FIXME FIXME:: there's no other way to repaint non-client area of the wxWindow!! - // so we do *excessive* "hide 'n show" + // FIXME FIXME:: there's no other way to repaint non-client area of the wxWindow!! + // so we do *excessive* "hide 'n show" - pWnd->Show(FALSE); - pWnd->Show(TRUE); - - pWnd->Refresh(); - } + pWnd->Show(FALSE); + pWnd->Show(TRUE); + + pWnd->Refresh(); + } - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - // release data prepared for GC alg. + // release data prepared for GC alg. - pNode = items.First(); + pNode = items.First(); - while( pNode ) - { - cbRectInfo* pInfo = (cbRectInfo*)(pNode->Data()); + while( pNode ) + { + cbRectInfo* pInfo = (cbRectInfo*)(pNode->Data()); - delete pInfo; + delete pInfo; - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - mGC.Reset(); // reinit GC + mGC.Reset(); // reinit GC - // FIXME:: this is a dirty-workaround for messy client-area, - // as a result of docking bar out of floated-container window + // FIXME:: this is a dirty-workaround for messy client-area, + // as a result of docking bar out of floated-container window - if ( mpLayout->mClientWndRefreshPending ) - { - mpLayout->PositionClientWindow(); - mpLayout->GetFrameClient()->Refresh(); - } + if ( mpLayout->mClientWndRefreshPending ) + { + mpLayout->PositionClientWindow(); + mpLayout->GetFrameClient()->Refresh(); + } } diff --git a/contrib/src/fl/hintanimpl.cpp b/contrib/src/fl/hintanimpl.cpp index 3453fe877f..56752d6f1d 100644 --- a/contrib/src/fl/hintanimpl.cpp +++ b/contrib/src/fl/hintanimpl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: hintanimpl.cpp +// Purpose: cbHintAnimationPlugin implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 9/11/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -37,111 +37,111 @@ IMPLEMENT_DYNAMIC_CLASS( cbHintAnimationPlugin, cbPluginBase ) BEGIN_EVENT_TABLE( cbHintAnimationPlugin, cbPluginBase ) - EVT_PL_DRAW_HINT_RECT( cbHintAnimationPlugin::OnDrawHintRect ) + EVT_PL_DRAW_HINT_RECT( cbHintAnimationPlugin::OnDrawHintRect ) END_EVENT_TABLE() cbHintAnimationPlugin::cbHintAnimationPlugin(void) - : mpScrDc( NULL ), - mpAnimTimer( 0 ), - mAnimStarted( FALSE ), - - mMorphDelay ( 5 ), - mMaxFrames ( 20 ), + : mpScrDc( NULL ), + mpAnimTimer( 0 ), + mAnimStarted( FALSE ), + + mMorphDelay ( 5 ), + mMaxFrames ( 20 ), mInClientHintBorder( 4 ), - mAccelerationOn( TRUE ) + mAccelerationOn( TRUE ) {} cbHintAnimationPlugin::cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask ) - : cbPluginBase( pPanel, paneMask ), - mpScrDc( NULL ), - mpAnimTimer( 0 ), - mAnimStarted( FALSE ), + : cbPluginBase( pPanel, paneMask ), + mpScrDc( NULL ), + mpAnimTimer( 0 ), + mAnimStarted( FALSE ), - mMorphDelay ( 5 ), - mMaxFrames ( 20 ), - mInClientHintBorder( 4 ), - mAccelerationOn( TRUE ) + mMorphDelay ( 5 ), + mMaxFrames ( 20 ), + mInClientHintBorder( 4 ), + mAccelerationOn( TRUE ) {} cbHintAnimationPlugin::~cbHintAnimationPlugin() { - if ( mpScrDc ) delete mpScrDc; + if ( mpScrDc ) delete mpScrDc; } /*** rect-tracking related methods ***/ void cbHintAnimationPlugin::OnDrawHintRect( cbDrawHintRectEvent& event ) { - if ( !mAnimStarted && !mpScrDc ) - { - StartTracking(); + if ( !mAnimStarted && !mpScrDc ) + { + StartTracking(); - mPrevInClient = event.mIsInClient; + mPrevInClient = event.mIsInClient; - mPrevRect = event.mRect; + mPrevRect = event.mRect; - mStopPending = FALSE; - } + mStopPending = FALSE; + } - if ( !event.mEraseRect ) - { - // pass on current hint-rect info to the animation "thread", in - // order to make adjustments to the morph-target on-the-fly + if ( !event.mEraseRect ) + { + // pass on current hint-rect info to the animation "thread", in + // order to make adjustments to the morph-target on-the-fly - mCurRect.x = event.mRect.x; - mCurRect.y = event.mRect.y; - mCurRect.width = event.mRect.width; - mCurRect.height = event.mRect.height; - } + mCurRect.x = event.mRect.x; + mCurRect.y = event.mRect.y; + mCurRect.width = event.mRect.width; + mCurRect.height = event.mRect.height; + } - // check the amount of change in the shape of hint, - // and start morph-effect if change is "sufficient" + // check the amount of change in the shape of hint, + // and start morph-effect if change is "sufficient" - int change = abs( mCurRect.width - mPrevRect.width ) + - abs( mCurRect.height - mPrevRect.height ); + int change = abs( mCurRect.width - mPrevRect.width ) + + abs( mCurRect.height - mPrevRect.height ); - if ( change > 10 && !event.mLastTime && !event.mEraseRect ) - { - if ( !mpAnimTimer ) + if ( change > 10 && !event.mLastTime && !event.mEraseRect ) + { + if ( !mpAnimTimer ) - mpAnimTimer = new cbHintAnimTimer(); + mpAnimTimer = new cbHintAnimTimer(); - // init the animation "thread", or reinit if already started + // init the animation "thread", or reinit if already started - mpAnimTimer->Init( this, mAnimStarted ); + mpAnimTimer->Init( this, mAnimStarted ); - mAnimStarted = TRUE; - } - else - if ( !mAnimStarted ) - { - DoDrawHintRect( event.mRect, event.mIsInClient ); + mAnimStarted = TRUE; + } + else + if ( !mAnimStarted ) + { + DoDrawHintRect( event.mRect, event.mIsInClient ); - if ( event.mLastTime ) + if ( event.mLastTime ) - FinishTracking(); + FinishTracking(); - mPrevInClient = event.mIsInClient; - } - else - { - mCurInClient = event.mIsInClient; + mPrevInClient = event.mIsInClient; + } + else + { + mCurInClient = event.mIsInClient; - if ( event.mLastTime && mpAnimTimer ) - { - mStopPending = TRUE; + if ( event.mLastTime && mpAnimTimer ) + { + mStopPending = TRUE; - if ( mpAnimTimer->mPrevMorphed.x != POS_UNDEFINED ) + if ( mpAnimTimer->mPrevMorphed.x != POS_UNDEFINED ) - // erase previous rect - DoDrawHintRect( mpAnimTimer->mPrevMorphed, mPrevInClient ); - } - } + // erase previous rect + DoDrawHintRect( mpAnimTimer->mPrevMorphed, mPrevInClient ); + } + } - mPrevRect = event.mRect; + mPrevRect = event.mRect; } #define _IMG_A 0xAA // Note: modified from _A to _IMG_A, _A was already defined (cygwin) @@ -150,109 +150,109 @@ void cbHintAnimationPlugin::OnDrawHintRect( cbDrawHintRectEvent& event ) #define _IMG_D 0x00 // Note: modified from _D to _IMG_D, for consistency reasons. static const unsigned char _gCheckerImg[16] = { _IMG_A,_IMG_B,_IMG_C,_IMG_D, - _IMG_A,_IMG_B,_IMG_C,_IMG_D, - _IMG_A,_IMG_B,_IMG_C,_IMG_D, - _IMG_A,_IMG_B,_IMG_C,_IMG_D - }; + _IMG_A,_IMG_B,_IMG_C,_IMG_D, + _IMG_A,_IMG_B,_IMG_C,_IMG_D, + _IMG_A,_IMG_B,_IMG_C,_IMG_D + }; void cbHintAnimationPlugin::StartTracking() { - mpScrDc = new wxScreenDC; + mpScrDc = new wxScreenDC; - wxScreenDC::StartDrawingOnTop(&mpLayout->GetParentFrame()); + wxScreenDC::StartDrawingOnTop(&mpLayout->GetParentFrame()); } void cbHintAnimationPlugin::DoDrawHintRect( wxRect& rect, bool isInClientRect) { - wxRect scrRect; + wxRect scrRect; - RectToScr( rect, scrRect ); + RectToScr( rect, scrRect ); - int prevLF = mpScrDc->GetLogicalFunction(); + int prevLF = mpScrDc->GetLogicalFunction(); - mpScrDc->SetLogicalFunction( wxXOR ); + mpScrDc->SetLogicalFunction( wxXOR ); - if ( isInClientRect ) - { - // BUG BUG BUG (wx):: somehow stippled brush works only - // when the bitmap created on stack, not - // as a member of the class + if ( isInClientRect ) + { + // BUG BUG BUG (wx):: somehow stippled brush works only + // when the bitmap created on stack, not + // as a member of the class - wxBitmap checker( (const char*)_gCheckerImg, 8,8 ); + wxBitmap checker( (const char*)_gCheckerImg, 8,8 ); - wxBrush checkerBrush( checker ); + wxBrush checkerBrush( checker ); - mpScrDc->SetPen( mpLayout->mNullPen ); - mpScrDc->SetBrush( checkerBrush ); + mpScrDc->SetPen( mpLayout->mNullPen ); + mpScrDc->SetBrush( checkerBrush ); - int half = mInClientHintBorder / 2; + int half = mInClientHintBorder / 2; - mpScrDc->DrawRectangle( scrRect.x - half, scrRect.y - half, - scrRect.width + 2*half, mInClientHintBorder ); + mpScrDc->DrawRectangle( scrRect.x - half, scrRect.y - half, + scrRect.width + 2*half, mInClientHintBorder ); - mpScrDc->DrawRectangle( scrRect.x - half, scrRect.y + scrRect.height - half, - scrRect.width + 2*half, mInClientHintBorder ); + mpScrDc->DrawRectangle( scrRect.x - half, scrRect.y + scrRect.height - half, + scrRect.width + 2*half, mInClientHintBorder ); - mpScrDc->DrawRectangle( scrRect.x - half, scrRect.y + half - 1, - mInClientHintBorder, scrRect.height - 2*half + 2); + mpScrDc->DrawRectangle( scrRect.x - half, scrRect.y + half - 1, + mInClientHintBorder, scrRect.height - 2*half + 2); - mpScrDc->DrawRectangle( scrRect.x + scrRect.width - half, - scrRect.y + half - 1, - mInClientHintBorder, scrRect.height - 2*half + 2); + mpScrDc->DrawRectangle( scrRect.x + scrRect.width - half, + scrRect.y + half - 1, + mInClientHintBorder, scrRect.height - 2*half + 2); - mpScrDc->SetBrush( wxNullBrush ); - } - else - { - // otherwise draw 1-pixel thin borders + mpScrDc->SetBrush( wxNullBrush ); + } + else + { + // otherwise draw 1-pixel thin borders - mpScrDc->SetPen( mpLayout->mBlackPen ); + mpScrDc->SetPen( mpLayout->mBlackPen ); - mpScrDc->DrawLine( scrRect.x, scrRect.y, - scrRect.x + scrRect.width, scrRect.y ); + mpScrDc->DrawLine( scrRect.x, scrRect.y, + scrRect.x + scrRect.width, scrRect.y ); - mpScrDc->DrawLine( scrRect.x, scrRect.y + 1, - scrRect.x, scrRect.y + scrRect.height ); + mpScrDc->DrawLine( scrRect.x, scrRect.y + 1, + scrRect.x, scrRect.y + scrRect.height ); - mpScrDc->DrawLine( scrRect.x+1, scrRect.y + scrRect.height, - scrRect.x + scrRect.width, scrRect.y + scrRect.height ); + mpScrDc->DrawLine( scrRect.x+1, scrRect.y + scrRect.height, + scrRect.x + scrRect.width, scrRect.y + scrRect.height ); - mpScrDc->DrawLine( scrRect.x + scrRect.width , scrRect.y, - scrRect.x + scrRect.width, scrRect.y + scrRect.height + 1); - } + mpScrDc->DrawLine( scrRect.x + scrRect.width , scrRect.y, + scrRect.x + scrRect.width, scrRect.y + scrRect.height + 1); + } - mpScrDc->SetLogicalFunction( prevLF ); + mpScrDc->SetLogicalFunction( prevLF ); } void cbHintAnimationPlugin::DrawHintRect ( wxRect& rect, bool isInClientRect) { - DoDrawHintRect( rect, isInClientRect ); + DoDrawHintRect( rect, isInClientRect ); } void cbHintAnimationPlugin::EraseHintRect( wxRect& rect, bool isInClientRect) { - DoDrawHintRect( rect, isInClientRect ); + DoDrawHintRect( rect, isInClientRect ); } void cbHintAnimationPlugin::FinishTracking() { - wxScreenDC::EndDrawingOnTop(); + wxScreenDC::EndDrawingOnTop(); - delete mpScrDc; + delete mpScrDc; - mpScrDc = NULL; + mpScrDc = NULL; } void cbHintAnimationPlugin::RectToScr( wxRect& frameRect, wxRect& scrRect ) { - scrRect = frameRect; + scrRect = frameRect; - int x = frameRect.x, y = frameRect.y; + int x = frameRect.x, y = frameRect.y; - mpLayout->GetParentFrame().ClientToScreen( &x, &y ); + mpLayout->GetParentFrame().ClientToScreen( &x, &y ); - scrRect.x = x; - scrRect.y = y; + scrRect.x = x; + scrRect.y = y; } /***** Implementation for class cbHintAnimTimer *****/ @@ -260,138 +260,138 @@ void cbHintAnimationPlugin::RectToScr( wxRect& frameRect, wxRect& scrRect ) cbHintAnimTimer::cbHintAnimTimer(void) { #ifdef __WINDOWS__ - mLock = 0L; + mLock = 0L; #endif - mPrevMorphed.x = POS_UNDEFINED; + mPrevMorphed.x = POS_UNDEFINED; } void cbHintAnimTimer::MorphPoint( wxPoint& origin, MorphInfoT& info, wxPoint& point ) { - // simulate lienar movement (FOR NOW:: without acceleration) + // simulate lienar movement (FOR NOW:: without acceleration) - double k; - - if ( mpPl->mAccelerationOn ) - - k = double( mCurIter*mCurIter ) / - double( (mpPl->mMaxFrames - 1)*(mpPl->mMaxFrames - 1) ); - else - k = double( mCurIter ) / double( mpPl->mMaxFrames - 1 ); + double k; + + if ( mpPl->mAccelerationOn ) + + k = double( mCurIter*mCurIter ) / + double( (mpPl->mMaxFrames - 1)*(mpPl->mMaxFrames - 1) ); + else + k = double( mCurIter ) / double( mpPl->mMaxFrames - 1 ); - point.x = int ( double ( info.mFrom.x + double (info.mTill.x - info.mFrom.x) * k ) ); + point.x = int ( double ( info.mFrom.x + double (info.mTill.x - info.mFrom.x) * k ) ); - point.y = int ( double ( info.mFrom.y + double (info.mTill.y - info.mFrom.y) * k ) ); + point.y = int ( double ( info.mFrom.y + double (info.mTill.y - info.mFrom.y) * k ) ); - point.x += origin.x; - point.y += origin.y; + point.x += origin.x; + point.y += origin.y; } void cbHintAnimTimer::Notify(void) { - // FIXME:: "clean" implementation should use mutex to sync - // between GUI and animation threads + // FIXME:: "clean" implementation should use mutex to sync + // between GUI and animation threads - if ( mpPl->mStopPending ) - { - Stop(); // top timer + if ( mpPl->mStopPending ) + { + Stop(); // top timer - mpPl->FinishTracking(); + mpPl->FinishTracking(); - mpPl->mStopPending = FALSE; - mpPl->mpAnimTimer = NULL; - mpPl->mAnimStarted = FALSE; + mpPl->mStopPending = FALSE; + mpPl->mpAnimTimer = NULL; + mpPl->mAnimStarted = FALSE; - mPrevMorphed.x = POS_UNDEFINED; + mPrevMorphed.x = POS_UNDEFINED; - delete this; + delete this; - return; - } + return; + } - wxPoint origin( mpPl->mCurRect.x, mpPl->mCurRect.y ); + wxPoint origin( mpPl->mCurRect.x, mpPl->mCurRect.y ); - wxPoint curUpper, curLower; + wxPoint curUpper, curLower; - MorphPoint( origin, mUpperLeft, curUpper ); - MorphPoint( origin, mLowerRight, curLower ); + MorphPoint( origin, mUpperLeft, curUpper ); + MorphPoint( origin, mLowerRight, curLower ); - if ( mPrevMorphed.x != POS_UNDEFINED ) + if ( mPrevMorphed.x != POS_UNDEFINED ) - // erase previous rect - mpPl->DoDrawHintRect( mPrevMorphed, mpPl->mPrevInClient ); + // erase previous rect + mpPl->DoDrawHintRect( mPrevMorphed, mpPl->mPrevInClient ); - wxRect morphed( curUpper.x, curUpper.y, - curLower.x - curUpper.x, - curLower.y - curUpper.y ); + wxRect morphed( curUpper.x, curUpper.y, + curLower.x - curUpper.x, + curLower.y - curUpper.y ); - // draw rect of current iteration - mpPl->DoDrawHintRect( morphed, - ( mCurIter != mpPl->mMaxFrames - 1 ) - ? mpPl->mPrevInClient : mpPl->mCurInClient ); + // draw rect of current iteration + mpPl->DoDrawHintRect( morphed, + ( mCurIter != mpPl->mMaxFrames - 1 ) + ? mpPl->mPrevInClient : mpPl->mCurInClient ); - mPrevMorphed = morphed; + mPrevMorphed = morphed; - if ( mCurIter == mpPl->mMaxFrames - 1 ) - { - Stop(); // top timer - - mpPl->FinishTracking(); - mpPl->mpAnimTimer = NULL; - mpPl->mAnimStarted = FALSE; + if ( mCurIter == mpPl->mMaxFrames - 1 ) + { + Stop(); // top timer + + mpPl->FinishTracking(); + mpPl->mpAnimTimer = NULL; + mpPl->mAnimStarted = FALSE; - mPrevMorphed.x = POS_UNDEFINED; + mPrevMorphed.x = POS_UNDEFINED; - delete this; - } - else - ++mCurIter; + delete this; + } + else + ++mCurIter; } bool cbHintAnimTimer::Init( cbHintAnimationPlugin* pAnimPl, bool reinit ) { - mpPl = pAnimPl; + mpPl = pAnimPl; - // morph-points are set up relatively to the upper-left corner - // of the current hint-rectangle + // morph-points are set up relatively to the upper-left corner + // of the current hint-rectangle - if ( !reinit ) - { - mUpperLeft.mFrom.x = mpPl->mPrevRect.x - mpPl->mCurRect.x; - mUpperLeft.mFrom.y = mpPl->mPrevRect.y - mpPl->mCurRect.y; + if ( !reinit ) + { + mUpperLeft.mFrom.x = mpPl->mPrevRect.x - mpPl->mCurRect.x; + mUpperLeft.mFrom.y = mpPl->mPrevRect.y - mpPl->mCurRect.y; - mLowerRight.mFrom.x = ( mUpperLeft.mFrom.x + mpPl->mPrevRect.width ); - mLowerRight.mFrom.y = ( mUpperLeft.mFrom.y + mpPl->mPrevRect.height ); - } - else - { - wxPoint origin( mpPl->mPrevRect.x, mpPl->mPrevRect.y ); + mLowerRight.mFrom.x = ( mUpperLeft.mFrom.x + mpPl->mPrevRect.width ); + mLowerRight.mFrom.y = ( mUpperLeft.mFrom.y + mpPl->mPrevRect.height ); + } + else + { + wxPoint origin( mpPl->mPrevRect.x, mpPl->mPrevRect.y ); - wxPoint curUpper, curLower; + wxPoint curUpper, curLower; - MorphPoint( origin, mUpperLeft, curUpper ); - MorphPoint( origin, mLowerRight, curLower ); + MorphPoint( origin, mUpperLeft, curUpper ); + MorphPoint( origin, mLowerRight, curLower ); - mUpperLeft.mFrom.x = curUpper.x - mpPl->mCurRect.x; - mUpperLeft.mFrom.y = curUpper.y - mpPl->mCurRect.y; + mUpperLeft.mFrom.x = curUpper.x - mpPl->mCurRect.x; + mUpperLeft.mFrom.y = curUpper.y - mpPl->mCurRect.y; - mLowerRight.mFrom.x = ( mUpperLeft.mFrom.x + curLower.x - curUpper.x ); - mLowerRight.mFrom.y = ( mUpperLeft.mFrom.y + curLower.y - curUpper.y ); - } + mLowerRight.mFrom.x = ( mUpperLeft.mFrom.x + curLower.x - curUpper.x ); + mLowerRight.mFrom.y = ( mUpperLeft.mFrom.y + curLower.y - curUpper.y ); + } - mUpperLeft.mTill.x = 0; - mUpperLeft.mTill.y = 0; + mUpperLeft.mTill.x = 0; + mUpperLeft.mTill.y = 0; - mLowerRight.mTill.x = mpPl->mCurRect.width; - mLowerRight.mTill.y = mpPl->mCurRect.height; + mLowerRight.mTill.x = mpPl->mCurRect.width; + mLowerRight.mTill.y = mpPl->mCurRect.height; - mCurIter = 1; - - if ( !reinit ) + mCurIter = 1; + + if ( !reinit ) - Start( mpPl->mMorphDelay ); + Start( mpPl->mMorphDelay ); - return TRUE; + return TRUE; } diff --git a/contrib/src/fl/newbmpbtn.cpp b/contrib/src/fl/newbmpbtn.cpp index 63adb414a0..968302b68f 100644 --- a/contrib/src/fl/newbmpbtn.cpp +++ b/contrib/src/fl/newbmpbtn.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: newbmpbtn.cpp +// Purpose: wxNewBitmapButton enhanced bitmap button class. // Author: Aleksandras Gluchovas // Modified by: // Created: ??/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -142,7 +142,7 @@ static void gray_out_pixmap( int* src, int* dest, int width, int height ) } while (1); } -// alg. for making the image look "grayed" (e.g. disabled button) +// algorithm for making the image look "grayed" (e.g. disabled button) // NOTE:: used GetPixel(), which is Windows-Only! void gray_out_image_on_dc( wxDC& dc, int width, int height ) @@ -198,7 +198,7 @@ void gray_out_image_on_dc( wxDC& dc, int width, int height ) /////////////////////////////// -/***** Impelementation for class wxNewBitmapButton *****/ +/***** Implementation for class wxNewBitmapButton *****/ IMPLEMENT_DYNAMIC_CLASS(wxNewBitmapButton, wxPanel) @@ -382,7 +382,7 @@ void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp, { if ( destBmp != 0 ) return; - // render lables on-demand + // render labels on-demand wxMemoryDC srcDc; srcDc.SelectObject( *srcBmp ); @@ -756,8 +756,7 @@ void wxNewBitmapButton::OnSize( wxSizeEvent& event ) } void wxNewBitmapButton::Reshape( ) -{ - +{ bool wasCreated = mIsCreated; mIsCreated = TRUE; diff --git a/contrib/src/fl/panedrawpl.cpp b/contrib/src/fl/panedrawpl.cpp index 7feaa75290..b5b06d3880 100644 --- a/contrib/src/fl/panedrawpl.cpp +++ b/contrib/src/fl/panedrawpl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: panedrawpl.cpp +// Purpose: cbPaneDrawPlugin implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -39,36 +39,36 @@ #define _IMG_D 0x00 // Note: modified from _D to _IMG_D, for consistency reasons. static const unsigned char _gCheckerImg[16] = { _IMG_A,_IMG_B,_IMG_C,_IMG_D, - _IMG_A,_IMG_B,_IMG_C,_IMG_D, - _IMG_A,_IMG_B,_IMG_C,_IMG_D, - _IMG_A,_IMG_B,_IMG_C,_IMG_D - }; + _IMG_A,_IMG_B,_IMG_C,_IMG_D, + _IMG_A,_IMG_B,_IMG_C,_IMG_D, + _IMG_A,_IMG_B,_IMG_C,_IMG_D + }; // FIXME:: The below code somehow doesn't work - cursors remain unchanged -// Used: controlbar.cpp(1268): set_cursor_bits( _gHorizCursorImg, bits, 32, 16 ); -// Used: controlbar.cpp(1272): set_cursor_bits( _gVertCursorImg, bits, 32, 16 ); +// Used: controlbar.cpp(1268): set_cursor_bits( _gHorizCursorImg, bits, 32, 16 ); +// Used: controlbar.cpp(1272): set_cursor_bits( _gVertCursorImg, bits, 32, 16 ); /* static void set_cursor_bits( const char** img, char* bits, int width, int height ) { - for( int i = 0; i != (width*height)/8; ++i ) - bits[i] = 0; + for( int i = 0; i != (width*height)/8; ++i ) + bits[i] = 0; - for( int y = 0; y != height; ++y ) - { - const char* row = img[0]; + for( int y = 0; y != height; ++y ) + { + const char* row = img[0]; - for( int x = 0; x != width; ++x ) - { - int bitNo = y*width + x; + for( int x = 0; x != width; ++x ) + { + int bitNo = y*width + x; - char value = ( row[x] != '.' ) ? 1 : 0; + char value = ( row[x] != '.' ) ? 1 : 0; - bits[ bitNo / sizeof(char) ] |= - ( ( bitNo %sizeof(char) ) << value ); - } + bits[ bitNo / sizeof(char) ] |= + ( ( bitNo %sizeof(char) ) << value ); + } - ++img; - } + ++img; + } } */ @@ -78,1189 +78,1189 @@ IMPLEMENT_DYNAMIC_CLASS( cbPaneDrawPlugin, cbPluginBase ) BEGIN_EVENT_TABLE( cbPaneDrawPlugin, cbPluginBase ) - EVT_PL_LEFT_DOWN ( cbPaneDrawPlugin::OnLButtonDown ) - EVT_PL_LEFT_UP ( cbPaneDrawPlugin::OnLButtonUp ) -// EVT_PL_LEFT_DCLICK ( cbPaneDrawPlugin::OnLDblClick ) - EVT_PL_RIGHT_UP ( cbPaneDrawPlugin::OnRButtonUp ) - EVT_PL_MOTION ( cbPaneDrawPlugin::OnMouseMove ) + EVT_PL_LEFT_DOWN ( cbPaneDrawPlugin::OnLButtonDown ) + EVT_PL_LEFT_UP ( cbPaneDrawPlugin::OnLButtonUp ) +// EVT_PL_LEFT_DCLICK ( cbPaneDrawPlugin::OnLDblClick ) + EVT_PL_RIGHT_UP ( cbPaneDrawPlugin::OnRButtonUp ) + EVT_PL_MOTION ( cbPaneDrawPlugin::OnMouseMove ) - EVT_PL_DRAW_PANE_BKGROUND ( cbPaneDrawPlugin::OnDrawPaneBackground ) - EVT_PL_DRAW_PANE_DECOR ( cbPaneDrawPlugin::OnDrawPaneDecorations ) + EVT_PL_DRAW_PANE_BKGROUND ( cbPaneDrawPlugin::OnDrawPaneBackground ) + EVT_PL_DRAW_PANE_DECOR ( cbPaneDrawPlugin::OnDrawPaneDecorations ) - EVT_PL_DRAW_ROW_DECOR ( cbPaneDrawPlugin::OnDrawRowDecorations ) - EVT_PL_DRAW_ROW_HANDLES ( cbPaneDrawPlugin::OnDrawRowHandles ) - EVT_PL_DRAW_ROW_BKGROUND ( cbPaneDrawPlugin::OnDrawRowBackground ) + EVT_PL_DRAW_ROW_DECOR ( cbPaneDrawPlugin::OnDrawRowDecorations ) + EVT_PL_DRAW_ROW_HANDLES ( cbPaneDrawPlugin::OnDrawRowHandles ) + EVT_PL_DRAW_ROW_BKGROUND ( cbPaneDrawPlugin::OnDrawRowBackground ) - EVT_PL_SIZE_BAR_WND ( cbPaneDrawPlugin::OnSizeBarWindow ) - EVT_PL_DRAW_BAR_DECOR ( cbPaneDrawPlugin::OnDrawBarDecorations ) - EVT_PL_DRAW_BAR_HANDLES ( cbPaneDrawPlugin::OnDrawBarHandles ) + EVT_PL_SIZE_BAR_WND ( cbPaneDrawPlugin::OnSizeBarWindow ) + EVT_PL_DRAW_BAR_DECOR ( cbPaneDrawPlugin::OnDrawBarDecorations ) + EVT_PL_DRAW_BAR_HANDLES ( cbPaneDrawPlugin::OnDrawBarHandles ) - EVT_PL_START_DRAW_IN_AREA ( cbPaneDrawPlugin::OnStartDrawInArea ) - EVT_PL_FINISH_DRAW_IN_AREA ( cbPaneDrawPlugin::OnFinishDrawInArea ) + EVT_PL_START_DRAW_IN_AREA ( cbPaneDrawPlugin::OnStartDrawInArea ) + EVT_PL_FINISH_DRAW_IN_AREA ( cbPaneDrawPlugin::OnFinishDrawInArea ) END_EVENT_TABLE() cbPaneDrawPlugin::cbPaneDrawPlugin(void) - : mResizeStarted ( FALSE ), + : mResizeStarted ( FALSE ), - mResizeCursorOn ( FALSE ), - mpDraggedBar ( NULL ), - mpResizedRow ( NULL ), + mResizeCursorOn ( FALSE ), + mpDraggedBar ( NULL ), + mpResizedRow ( NULL ), mRowHandleHitted ( FALSE ), - mIsUpperHandle ( FALSE ), - mBarHandleHitted ( FALSE ), - mIsLeftHandle ( FALSE ), - mBarContentHitted ( FALSE ), + mIsUpperHandle ( FALSE ), + mBarHandleHitted ( FALSE ), + mIsLeftHandle ( FALSE ), + mBarContentHitted ( FALSE ), - mpClntDc ( NULL ), - mpPane ( NULL ) + mpClntDc ( NULL ), + mpPane ( NULL ) {} cbPaneDrawPlugin::cbPaneDrawPlugin( wxFrameLayout* pPanel, int paneMask ) - : cbPluginBase( pPanel, paneMask ), - - // bar-row resizing state varaibles + : cbPluginBase( pPanel, paneMask ), + + // bar-row resizing state varaibles - mResizeStarted ( FALSE ), + mResizeStarted ( FALSE ), - mResizeCursorOn ( FALSE ), - mpDraggedBar ( NULL ), - mpResizedRow ( NULL ), + mResizeCursorOn ( FALSE ), + mpDraggedBar ( NULL ), + mpResizedRow ( NULL ), - mRowHandleHitted ( FALSE ), - mIsUpperHandle ( FALSE ), - mBarHandleHitted ( FALSE ), - mIsLeftHandle ( FALSE ), - mBarContentHitted ( FALSE ), + mRowHandleHitted ( FALSE ), + mIsUpperHandle ( FALSE ), + mBarHandleHitted ( FALSE ), + mIsLeftHandle ( FALSE ), + mBarContentHitted ( FALSE ), - mpClntDc ( NULL ), - mpPane ( NULL ) + mpClntDc ( NULL ), + mpPane ( NULL ) {} cbPaneDrawPlugin::~cbPaneDrawPlugin() { - // DBG:: - wxASSERT( mpClntDc == NULL ); + // DBG:: + wxASSERT( mpClntDc == NULL ); } void cbPaneDrawPlugin::DrawDraggedHandle( const wxPoint& pos, cbDockPane& pane ) { - wxScreenDC dc; - int ofsX = 0; - int ofsY = 0; + wxScreenDC dc; + int ofsX = 0; + int ofsY = 0; - wxPoint fpos = pos; - pane.PaneToFrame( &fpos.x, &fpos.y ); + wxPoint fpos = pos; + pane.PaneToFrame( &fpos.x, &fpos.y ); - // short-cut - int resizeHndSize = pane.mProps.mResizeHandleSize; + // short-cut + int resizeHndSize = pane.mProps.mResizeHandleSize; // "Required for X to specify that // that we wish to draw on top of all windows // - and we optimise by specifying the area // for creating the overlap window." --J.S. - wxScreenDC::StartDrawingOnTop(&mpLayout->GetParentFrame()); + wxScreenDC::StartDrawingOnTop(&mpLayout->GetParentFrame()); - mpLayout->GetParentFrame().ClientToScreen( &ofsX, &ofsY ); + mpLayout->GetParentFrame().ClientToScreen( &ofsX, &ofsY ); - int prevLF = dc.GetLogicalFunction(); + int prevLF = dc.GetLogicalFunction(); - // BUG BUG BUG (wx):: somehow stippled brush works only - // when the bitmap created on stack, not - // as a member of the class + // BUG BUG BUG (wx):: somehow stippled brush works only + // when the bitmap created on stack, not + // as a member of the class - wxBitmap checker( (const char*)_gCheckerImg, 8,8 ); + wxBitmap checker( (const char*)_gCheckerImg, 8,8 ); - wxBrush checkerBrush( checker ); + wxBrush checkerBrush( checker ); - dc.SetPen( mpLayout->mNullPen ); - dc.SetBrush( checkerBrush ); - dc.SetLogicalFunction( wxXOR ); + dc.SetPen( mpLayout->mNullPen ); + dc.SetBrush( checkerBrush ); + dc.SetLogicalFunction( wxXOR ); - if ( mHandleIsVertical ) - { - int delta = pos.x - mDragOrigin.x; + if ( mHandleIsVertical ) + { + int delta = pos.x - mDragOrigin.x; - if ( !pane.IsHorizontal() ) + if ( !pane.IsHorizontal() ) - delta = pos.y - mDragOrigin.y; + delta = pos.y - mDragOrigin.y; - int realHndOfs; - realHndOfs = pane.mBoundsInParent.x + pane.mLeftMargin + mHandleOfs; + int realHndOfs; + realHndOfs = pane.mBoundsInParent.x + pane.mLeftMargin + mHandleOfs; - int newX = realHndOfs + delta; + int newX = realHndOfs + delta; - if ( newX + resizeHndSize > mHandleDragArea.x + mHandleDragArea.width ) + if ( newX + resizeHndSize > mHandleDragArea.x + mHandleDragArea.width ) - newX = mHandleDragArea.x + mHandleDragArea.width - 1; + newX = mHandleDragArea.x + mHandleDragArea.width - 1; - if ( newX < mHandleDragArea.x ) + if ( newX < mHandleDragArea.x ) - newX = mHandleDragArea.x; + newX = mHandleDragArea.x; - mDraggedDelta = newX - realHndOfs; + mDraggedDelta = newX - realHndOfs; - dc.DrawRectangle( newX + ofsX, mHandleDragArea.y + ofsY, - resizeHndSize + 1, - mHandleDragArea.height+1 ); - } - else - { - // otherwise, draw horizontal handle + dc.DrawRectangle( newX + ofsX, mHandleDragArea.y + ofsY, + resizeHndSize + 1, + mHandleDragArea.height+1 ); + } + else + { + // otherwise, draw horizontal handle - int delta = pos.y - mDragOrigin.y; + int delta = pos.y - mDragOrigin.y; - if ( !pane.IsHorizontal() ) + if ( !pane.IsHorizontal() ) - delta = pos.x - mDragOrigin.x; + delta = pos.x - mDragOrigin.x; - int realHndOfs; - realHndOfs = pane.mBoundsInParent.y + pane.mTopMargin + mHandleOfs; + int realHndOfs; + realHndOfs = pane.mBoundsInParent.y + pane.mTopMargin + mHandleOfs; - int newY = realHndOfs + delta; + int newY = realHndOfs + delta; - if ( newY + resizeHndSize > mHandleDragArea.y + mHandleDragArea.height ) + if ( newY + resizeHndSize > mHandleDragArea.y + mHandleDragArea.height ) - newY = mHandleDragArea.y + mHandleDragArea.height - 1; + newY = mHandleDragArea.y + mHandleDragArea.height - 1; - if ( newY < mHandleDragArea.y ) + if ( newY < mHandleDragArea.y ) - newY = mHandleDragArea.y; + newY = mHandleDragArea.y; - mDraggedDelta = newY - realHndOfs; + mDraggedDelta = newY - realHndOfs; - dc.DrawRectangle( mHandleDragArea.x + ofsX, newY + ofsY, - mHandleDragArea.width + 1, - resizeHndSize + 1 ); - } + dc.DrawRectangle( mHandleDragArea.x + ofsX, newY + ofsY, + mHandleDragArea.width + 1, + resizeHndSize + 1 ); + } - dc.SetLogicalFunction( prevLF ); + dc.SetLogicalFunction( prevLF ); // "End drawing on top (frees the window used for drawing // over the screen)" --J.S. - wxScreenDC::EndDrawingOnTop(); + wxScreenDC::EndDrawingOnTop(); } void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) { - if ( !mResizeStarted ) - { - // if nothing is started, do hit-tests + if ( !mResizeStarted ) + { + // if nothing is started, do hit-tests - bool prevWasRowHandle = mRowHandleHitted; + bool prevWasRowHandle = mRowHandleHitted; - mBarContentHitted = FALSE; - mBarHandleHitted = FALSE; - mRowHandleHitted = FALSE; + mBarContentHitted = FALSE; + mBarHandleHitted = FALSE; + mRowHandleHitted = FALSE; - int testResult = - event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes - &mpResizedRow, - &mpDraggedBar ); + int testResult = + event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes + &mpResizedRow, + &mpDraggedBar ); - if ( testResult != CB_NO_ITEMS_HITTED ) - { - if ( testResult == CB_BAR_CONTENT_HITTED ) - { - // restore cursor, if non of the handles were hit - if ( mResizeCursorOn ) - { - // remove resizing hints + if ( testResult != CB_NO_ITEMS_HITTED ) + { + if ( testResult == CB_BAR_CONTENT_HITTED ) + { + // restore cursor, if non of the handles were hit + if ( mResizeCursorOn ) + { + // remove resizing hints - mpLayout->ReleaseEventsFromPane( event.mpPane ); - mpLayout->ReleaseEventsFromPlugin( this ); - - mResizeCursorOn = FALSE; + mpLayout->ReleaseEventsFromPane( event.mpPane ); + mpLayout->ReleaseEventsFromPlugin( this ); + + mResizeCursorOn = FALSE; - mBarContentHitted = TRUE; + mBarContentHitted = TRUE; - mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); - } + mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); + } - // TBD:: fire something like "mouse-over-bar" event + // TBD:: fire something like "mouse-over-bar" event - event.Skip(); // pass event to the next handler in the chain - return; - } + event.Skip(); // pass event to the next handler in the chain + return; + } - wxCursor* pCurs = NULL; + wxCursor* pCurs = NULL; - if ( testResult == CB_UPPER_ROW_HANDLE_HITTED || - testResult == CB_LOWER_ROW_HANDLE_HITTED) - { - if ( event.mpPane->IsHorizontal() ) + if ( testResult == CB_UPPER_ROW_HANDLE_HITTED || + testResult == CB_LOWER_ROW_HANDLE_HITTED) + { + if ( event.mpPane->IsHorizontal() ) - pCurs = mpLayout->mpVertCursor; - else - pCurs = mpLayout->mpHorizCursor; + pCurs = mpLayout->mpVertCursor; + else + pCurs = mpLayout->mpHorizCursor; - mRowHandleHitted = TRUE; - mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED ); - } - else - { - // otherwise, if inter-bar handle was hitted + mRowHandleHitted = TRUE; + mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED ); + } + else + { + // otherwise, if inter-bar handle was hitted - if ( event.mpPane->IsHorizontal() ) + if ( event.mpPane->IsHorizontal() ) - pCurs = mpLayout->mpHorizCursor; - else - pCurs = mpLayout->mpVertCursor; + pCurs = mpLayout->mpHorizCursor; + else + pCurs = mpLayout->mpVertCursor; - mBarHandleHitted = TRUE; - mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED ); - } + mBarHandleHitted = TRUE; + mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED ); + } - // avoid setting the same cursor twice + // avoid setting the same cursor twice - if ( !mResizeCursorOn || prevWasRowHandle != mRowHandleHitted ) - { - if ( !mResizeCursorOn ) - { - // caputre if not captured yet - mpLayout->CaptureEventsForPane( event.mpPane ); - mpLayout->CaptureEventsForPlugin( this ); - } + if ( !mResizeCursorOn || prevWasRowHandle != mRowHandleHitted ) + { + if ( !mResizeCursorOn ) + { + // caputre if not captured yet + mpLayout->CaptureEventsForPane( event.mpPane ); + mpLayout->CaptureEventsForPlugin( this ); + } - mpLayout->GetParentFrame().SetCursor( *pCurs ); - } + mpLayout->GetParentFrame().SetCursor( *pCurs ); + } - mResizeCursorOn = TRUE; + mResizeCursorOn = TRUE; - // handled is being dragged now, thus event is "eaten" by this plugin + // handled is being dragged now, thus event is "eaten" by this plugin - return; + return; - } // end of if (HitTestBarHandles()) + } // end of if (HitTestBarHandles()) - // restore cursor, if non of the handles were hit - if ( mResizeCursorOn ) - { - mpLayout->ReleaseEventsFromPane( event.mpPane ); - mpLayout->ReleaseEventsFromPlugin( this ); + // restore cursor, if non of the handles were hit + if ( mResizeCursorOn ) + { + mpLayout->ReleaseEventsFromPane( event.mpPane ); + mpLayout->ReleaseEventsFromPlugin( this ); - mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); + mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); - mResizeCursorOn = FALSE; - } + mResizeCursorOn = FALSE; + } - event.Skip(); // pass event to the next plugin - } + event.Skip(); // pass event to the next plugin + } - // othewise series of actions, if something has already started + // othewise series of actions, if something has already started - else - if ( mResizeStarted ) - { - // apply xor-mask twice - DrawDraggedHandle( mPrevPos, *event.mpPane ); + else + if ( mResizeStarted ) + { + // apply xor-mask twice + DrawDraggedHandle( mPrevPos, *event.mpPane ); - // draw handle in the new position - DrawDraggedHandle( event.mPos, *event.mpPane ); - mPrevPos = event.mPos; + // draw handle in the new position + DrawDraggedHandle( event.mPos, *event.mpPane ); + mPrevPos = event.mPos; - // handled is dragged, thus event is "eaten" by this plugin - } - else - event.Skip(); // pass event to the next plugin + // handled is dragged, thus event is "eaten" by this plugin + } + else + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::OnLDblClick( cbLeftDClickEvent& event ) { - if ( !mResizeCursorOn ) - { - cbBarInfo* pBarToFloat; - - if ( event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes - &mpResizedRow, - &pBarToFloat ) == CB_BAR_CONTENT_HITTED - ) - { - return; - } - - event.Skip(); - } + if ( !mResizeCursorOn ) + { + cbBarInfo* pBarToFloat; + + if ( event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes + &mpResizedRow, + &pBarToFloat ) == CB_BAR_CONTENT_HITTED + ) + { + return; + } + + event.Skip(); + } } void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event ) { - wxASSERT( !mResizeStarted ); + wxASSERT( !mResizeStarted ); - if ( mResizeCursorOn ) - { - mResizeStarted = TRUE; - mDragOrigin = event.mPos; - - // setup constraints for the dragging handle + if ( mResizeCursorOn ) + { + mResizeStarted = TRUE; + mDragOrigin = event.mPos; + + // setup constraints for the dragging handle - int from, till; - mHandleOfs = 0; - mHandleIsVertical = FALSE; + int from, till; + mHandleOfs = 0; + mHandleIsVertical = FALSE; - if ( mRowHandleHitted ) + if ( mRowHandleHitted ) - event.mpPane->GetRowResizeRange( mpResizedRow, &from, &till, mIsUpperHandle ); - else - // otherwise if bar handle was hitted - event.mpPane->GetBarResizeRange( mpDraggedBar, &from, &till, mIsLeftHandle ); - - if ( mRowHandleHitted ) - { - mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? FALSE : TRUE; + event.mpPane->GetRowResizeRange( mpResizedRow, &from, &till, mIsUpperHandle ); + else + // otherwise if bar handle was hitted + event.mpPane->GetBarResizeRange( mpDraggedBar, &from, &till, mIsLeftHandle ); + + if ( mRowHandleHitted ) + { + mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? FALSE : TRUE; - mHandleDragArea.x = 0; - mHandleDragArea.width = event.mpPane->mPaneWidth; + mHandleDragArea.x = 0; + mHandleDragArea.width = event.mpPane->mPaneWidth; - mHandleDragArea.y = from; - mHandleDragArea.height = till - from; + mHandleDragArea.y = from; + mHandleDragArea.height = till - from; - if ( mIsUpperHandle ) + if ( mIsUpperHandle ) - mHandleOfs = mpResizedRow->mRowY; - else - mHandleOfs = mpResizedRow->mRowY + - mpResizedRow->mRowHeight - - event.mpPane->mProps.mResizeHandleSize; - } - else - { - // otehrwise if bar handle dragged + mHandleOfs = mpResizedRow->mRowY; + else + mHandleOfs = mpResizedRow->mRowY + + mpResizedRow->mRowHeight - + event.mpPane->mProps.mResizeHandleSize; + } + else + { + // otehrwise if bar handle dragged -// cbRowInfo& rowInfo = *mpDraggedBar->mpRow; - wxRect& bounds = mpDraggedBar->mBounds; +// cbRowInfo& rowInfo = *mpDraggedBar->mpRow; + wxRect& bounds = mpDraggedBar->mBounds; - mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? TRUE : FALSE; + mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? TRUE : FALSE; - mHandleDragArea.x = from; - mHandleDragArea.width = till - from; + mHandleDragArea.x = from; + mHandleDragArea.width = till - from; - mHandleDragArea.y = bounds.y; - mHandleDragArea.height = bounds.height; + mHandleDragArea.y = bounds.y; + mHandleDragArea.height = bounds.height; - // left-side-handle mBounds - if ( mIsLeftHandle ) + // left-side-handle mBounds + if ( mIsLeftHandle ) - mHandleOfs = bounds.x; - else - mHandleOfs = bounds.x + - bounds.width - event.mpPane->mProps.mResizeHandleSize; + mHandleOfs = bounds.x; + else + mHandleOfs = bounds.x + + bounds.width - event.mpPane->mProps.mResizeHandleSize; - } + } - event.mpPane->PaneToFrame( &mHandleDragArea ); - DrawDraggedHandle(mDragOrigin, *event.mpPane); + event.mpPane->PaneToFrame( &mHandleDragArea ); + DrawDraggedHandle(mDragOrigin, *event.mpPane); - mPrevPos = mDragOrigin; + mPrevPos = mDragOrigin; - return; - // handled is dragged, thus event is "eaten" by this plugin - } - else - { - cbBarInfo* pDraggedBar; + return; + // handled is dragged, thus event is "eaten" by this plugin + } + else + { + cbBarInfo* pDraggedBar; - if ( event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes - &mpResizedRow, - &pDraggedBar ) == CB_BAR_CONTENT_HITTED - ) - { - int x = event.mPos.x, - y = event.mPos.y; + if ( event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes + &mpResizedRow, + &pDraggedBar ) == CB_BAR_CONTENT_HITTED + ) + { + int x = event.mPos.x, + y = event.mPos.y; - event.mpPane->PaneToFrame( &x, &y ); + event.mpPane->PaneToFrame( &x, &y ); - cbStartBarDraggingEvent dragEvt( pDraggedBar, wxPoint(x,y), event.mpPane ); + cbStartBarDraggingEvent dragEvt( pDraggedBar, wxPoint(x,y), event.mpPane ); - mpLayout->FirePluginEvent( dragEvt ); + mpLayout->FirePluginEvent( dragEvt ); - return; // event is "eaten" by this plugin - } - } + return; // event is "eaten" by this plugin + } + } - event.Skip(); // pass event to the next plugin in the chain + event.Skip(); // pass event to the next plugin in the chain } void cbPaneDrawPlugin::OnLButtonUp( cbLeftUpEvent& event ) { - if ( mResizeStarted ) - { - DrawDraggedHandle( event.mPos, *event.mpPane ); + if ( mResizeStarted ) + { + DrawDraggedHandle( event.mPos, *event.mpPane ); - mResizeStarted = FALSE; - mResizeCursorOn = FALSE; + mResizeStarted = FALSE; + mResizeCursorOn = FALSE; - mpLayout->ReleaseEventsFromPane( event.mpPane ); - mpLayout->ReleaseEventsFromPlugin( this ); + mpLayout->ReleaseEventsFromPane( event.mpPane ); + mpLayout->ReleaseEventsFromPlugin( this ); - mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); + mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); - if ( mRowHandleHitted ) - { - event.mpPane->ResizeRow( mpResizedRow, - mDraggedDelta, - mIsUpperHandle ); - } - else - { - event.mpPane->ResizeBar( mpDraggedBar, - mDraggedDelta, - mIsLeftHandle ); - } + if ( mRowHandleHitted ) + { + event.mpPane->ResizeRow( mpResizedRow, + mDraggedDelta, + mIsUpperHandle ); + } + else + { + event.mpPane->ResizeBar( mpDraggedBar, + mDraggedDelta, + mIsLeftHandle ); + } - mpDraggedBar = NULL; - mpResizedRow = NULL; + mpDraggedBar = NULL; + mpResizedRow = NULL; - // handled dragging action was finished by this mouse-up, - // thus event is "eaten" by this plugin + // handled dragging action was finished by this mouse-up, + // thus event is "eaten" by this plugin - return; - } + return; + } - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::OnRButtonUp( cbRightUpEvent& event ) { - wxPoint fpos = event.mPos; - event.mpPane->PaneToFrame( &fpos.x, &fpos.y ); + wxPoint fpos = event.mPos; + event.mpPane->PaneToFrame( &fpos.x, &fpos.y ); - cbBarInfo* pDraggedBar; + cbBarInfo* pDraggedBar; - // user clicks inside the bar contnet, fire bar-customization event + // user clicks inside the bar contnet, fire bar-customization event - if ( event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes - &mpResizedRow, - &pDraggedBar ) == CB_BAR_CONTENT_HITTED - ) - { - cbCustomizeBarEvent cbEvt( pDraggedBar, fpos, event.mpPane ); + if ( event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes + &mpResizedRow, + &pDraggedBar ) == CB_BAR_CONTENT_HITTED + ) + { + cbCustomizeBarEvent cbEvt( pDraggedBar, fpos, event.mpPane ); - mpLayout->FirePluginEvent( cbEvt ); + mpLayout->FirePluginEvent( cbEvt ); - return; // event is "eaten" by this plugin - } + return; // event is "eaten" by this plugin + } - // otherwise fire whole-layout customization event + // otherwise fire whole-layout customization event - cbCustomizeLayoutEvent csEvt( fpos ); + cbCustomizeLayoutEvent csEvt( fpos ); - mpLayout->FirePluginEvent( csEvt ); + mpLayout->FirePluginEvent( csEvt ); - // event is "eaten" by this plugin + // event is "eaten" by this plugin } void cbPaneDrawPlugin::OnSizeBarWindow( cbSizeBarWndEvent& event ) { - cbBarInfo& bar = *event.mpBar; - mpPane = event.mpPane; + cbBarInfo& bar = *event.mpBar; + mpPane = event.mpPane; - // it's possible that a bar does not have it's own window! - if ( !bar.mpBarWnd ) return; + // it's possible that a bar does not have it's own window! + if ( !bar.mpBarWnd ) return; - wxRect& bounds = event.mBoundsInParent; + wxRect& bounds = event.mBoundsInParent; - // check visibility - if ( bounds.height != 0 ) - { - // size smaller than bounds, to leave space for shade lines + // check visibility + if ( bounds.height != 0 ) + { + // size smaller than bounds, to leave space for shade lines - // FIXME:: +/- 1s + // FIXME:: +/- 1s - bar.mpBarWnd->wxWindow::SetSize( bounds.x + 1 + bar.mDimInfo.mHorizGap, - bounds.y + 1 + bar.mDimInfo.mVertGap, - bounds.width - 2 - bar.mDimInfo.mHorizGap*2, - bounds.height - 2 - bar.mDimInfo.mVertGap *2 , - 0 - ); + bar.mpBarWnd->wxWindow::SetSize( bounds.x + 1 + bar.mDimInfo.mHorizGap, + bounds.y + 1 + bar.mDimInfo.mVertGap, + bounds.width - 2 - bar.mDimInfo.mHorizGap*2, + bounds.height - 2 - bar.mDimInfo.mVertGap *2 , + 0 + ); - if ( !bar.mpBarWnd->IsShown() ) + if ( !bar.mpBarWnd->IsShown() ) - bar.mpBarWnd->Show( TRUE ); - } - else - // hide bar if not visible - bar.mpBarWnd->Show( FALSE ); + bar.mpBarWnd->Show( TRUE ); + } + else + // hide bar if not visible + bar.mpBarWnd->Show( FALSE ); - event.Skip(); // pass event to the next plugin in the chain + event.Skip(); // pass event to the next plugin in the chain } void cbPaneDrawPlugin::OnDrawRowDecorations( cbDrawRowDecorEvent& event ) { - DrawPaneShadeForRow( event.mpRow, *event.mpDc ); + DrawPaneShadeForRow( event.mpRow, *event.mpDc ); - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::DrawUpperRowHandle( cbRowInfo* pRow, wxDC& dc ) { - wxRect& bounds = pRow->mBoundsInParent; - - if ( mpPane->IsHorizontal() ) - { - if ( pRow->mHasUpperHandle ) - - mpPane->DrawHorizHandle( dc, bounds.x, - bounds.y-1, - pRow->mRowWidth ); - } - else - { - if ( pRow->mHasUpperHandle ) - - mpPane->DrawVertHandle( dc, bounds.x-1, - bounds.y, pRow->mRowWidth ); - } + wxRect& bounds = pRow->mBoundsInParent; + + if ( mpPane->IsHorizontal() ) + { + if ( pRow->mHasUpperHandle ) + + mpPane->DrawHorizHandle( dc, bounds.x, + bounds.y-1, + pRow->mRowWidth ); + } + else + { + if ( pRow->mHasUpperHandle ) + + mpPane->DrawVertHandle( dc, bounds.x-1, + bounds.y, pRow->mRowWidth ); + } } void cbPaneDrawPlugin::DrawLowerRowHandle( cbRowInfo* pRow, wxDC& dc ) { - wxRect& bounds = pRow->mBoundsInParent; - - // check if iter-row handles present - - if ( mpPane->IsHorizontal() ) - { - if ( pRow->mHasLowerHandle ) - - mpPane->DrawHorizHandle( dc, bounds.x, bounds.y + bounds.height - mpPane->mProps.mResizeHandleSize - 1, - pRow->mRowWidth ); - } - else - { - if ( pRow->mHasLowerHandle ) - - mpPane->DrawVertHandle( dc, bounds.x + bounds.width - mpPane->mProps.mResizeHandleSize - 1, - bounds.y, pRow->mRowWidth ); - } + wxRect& bounds = pRow->mBoundsInParent; + + // check if iter-row handles present + + if ( mpPane->IsHorizontal() ) + { + if ( pRow->mHasLowerHandle ) + + mpPane->DrawHorizHandle( dc, bounds.x, bounds.y + bounds.height - mpPane->mProps.mResizeHandleSize - 1, + pRow->mRowWidth ); + } + else + { + if ( pRow->mHasLowerHandle ) + + mpPane->DrawVertHandle( dc, bounds.x + bounds.width - mpPane->mProps.mResizeHandleSize - 1, + bounds.y, pRow->mRowWidth ); + } } void cbPaneDrawPlugin::OnDrawRowHandles( cbDrawRowHandlesEvent& event ) { - // short-cuts - cbRowInfo* pRow = event.mpRow; - wxDC& dc = *event.mpDc; - mpPane = event.mpPane; + // short-cuts + cbRowInfo* pRow = event.mpRow; + wxDC& dc = *event.mpDc; + mpPane = event.mpPane; - // draw handles of surrounding rows first + // draw handles of surrounding rows first - if ( pRow->mpPrev && pRow->mpPrev->mHasLowerHandle ) + if ( pRow->mpPrev && pRow->mpPrev->mHasLowerHandle ) - DrawLowerRowHandle( pRow->mpPrev, dc ); + DrawLowerRowHandle( pRow->mpPrev, dc ); - if ( pRow->mpNext && pRow->mpNext->mHasUpperHandle ) + if ( pRow->mpNext && pRow->mpNext->mHasUpperHandle ) - DrawUpperRowHandle( pRow->mpNext, dc ); + DrawUpperRowHandle( pRow->mpNext, dc ); - // draw handles of the given row + // draw handles of the given row - if ( pRow->mHasUpperHandle ) - - DrawUpperRowHandle( pRow, dc ); + if ( pRow->mHasUpperHandle ) + + DrawUpperRowHandle( pRow, dc ); - if ( pRow->mHasLowerHandle ) + if ( pRow->mHasLowerHandle ) - DrawLowerRowHandle( pRow, dc ); + DrawLowerRowHandle( pRow, dc ); - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::OnDrawPaneBackground ( cbDrawPaneBkGroundEvent& event ) { - wxDC& dc = *event.mpDc; - mpPane = event.mpPane; + wxDC& dc = *event.mpDc; + mpPane = event.mpPane; - // FOR NOW:: hard-coded - wxBrush bkBrush( mpLayout->mBorderPen.GetColour(), wxSOLID ); + // FOR NOW:: hard-coded + wxBrush bkBrush( mpLayout->mBorderPen.GetColour(), wxSOLID ); - dc.SetBrush( bkBrush ); - dc.SetPen( mpLayout->mNullPen ); + dc.SetBrush( bkBrush ); + dc.SetPen( mpLayout->mNullPen ); - wxRect& bounds = mpPane->mBoundsInParent; + wxRect& bounds = mpPane->mBoundsInParent; - if ( mpPane->mTopMargin >= 1 ) - - dc.DrawRectangle( bounds.x, bounds.y, - bounds.width+1, - mpPane->mTopMargin + 1); + if ( mpPane->mTopMargin >= 1 ) + + dc.DrawRectangle( bounds.x, bounds.y, + bounds.width+1, + mpPane->mTopMargin + 1); - if ( mpPane->mBottomMargin >= 1 ) - - dc.DrawRectangle( bounds.x, - bounds.y + bounds.height - mpPane->mBottomMargin, - bounds.width + 1, - mpPane->mBottomMargin + 1); + if ( mpPane->mBottomMargin >= 1 ) + + dc.DrawRectangle( bounds.x, + bounds.y + bounds.height - mpPane->mBottomMargin, + bounds.width + 1, + mpPane->mBottomMargin + 1); - if ( mpPane->mLeftMargin >= 1 ) - - dc.DrawRectangle( bounds.x, - bounds.y + mpPane->mTopMargin - 1, - mpPane->mLeftMargin + 1, - bounds.height - mpPane->mTopMargin - mpPane->mBottomMargin + 2); + if ( mpPane->mLeftMargin >= 1 ) + + dc.DrawRectangle( bounds.x, + bounds.y + mpPane->mTopMargin - 1, + mpPane->mLeftMargin + 1, + bounds.height - mpPane->mTopMargin - mpPane->mBottomMargin + 2); - if ( mpPane->mRightMargin >= 1 ) - - dc.DrawRectangle( bounds.x + bounds.width - mpPane->mRightMargin, - bounds.y + mpPane->mTopMargin - 1, - mpPane->mRightMargin + 1, - bounds.height - mpPane->mTopMargin - mpPane->mBottomMargin + 2); + if ( mpPane->mRightMargin >= 1 ) + + dc.DrawRectangle( bounds.x + bounds.width - mpPane->mRightMargin, + bounds.y + mpPane->mTopMargin - 1, + mpPane->mRightMargin + 1, + bounds.height - mpPane->mTopMargin - mpPane->mBottomMargin + 2); - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::OnDrawRowBackground ( cbDrawRowBkGroundEvent& event ) { - // short-cuts - cbRowInfo* pRow = event.mpRow; - wxDC& dc = *event.mpDc; - mpPane = event.mpPane; - - // get ready - wxRect rowBounds = pRow->mBoundsInParent; - bool isHorizontal = event.mpPane->IsHorizontal(); - -// int prevPos; - - if ( isHorizontal ) - { -// prevPos = rowBounds.x; - // include one line above and below the row - --rowBounds.y; - rowBounds.height += 2; - - --rowBounds.x; - rowBounds.width += 2; - } - else - { -// prevPos = rowBounds.y; - // include one line above and below the row - --rowBounds.x; - rowBounds.width += 2; - - --rowBounds.y; - rowBounds.height += 2; - } + // short-cuts + cbRowInfo* pRow = event.mpRow; + wxDC& dc = *event.mpDc; + mpPane = event.mpPane; + + // get ready + wxRect rowBounds = pRow->mBoundsInParent; + bool isHorizontal = event.mpPane->IsHorizontal(); + +// int prevPos; + + if ( isHorizontal ) + { +// prevPos = rowBounds.x; + // include one line above and below the row + --rowBounds.y; + rowBounds.height += 2; + + --rowBounds.x; + rowBounds.width += 2; + } + else + { +// prevPos = rowBounds.y; + // include one line above and below the row + --rowBounds.x; + rowBounds.width += 2; + + --rowBounds.y; + rowBounds.height += 2; + } //#define TEST_BK_ERASING #ifdef TEST_BK_ERASING - // DBG:: - wxBrush br0( wxColour(0,160,160), wxSOLID ); - dc.SetBrush(br0); - dc.SetPen ( mpLayout->mNullPen ); - dc.DrawRectangle( rowBounds.x, rowBounds.y, - rowBounds.width + 1, - rowBounds.height + 1 ); + // DBG:: + wxBrush br0( wxColour(0,160,160), wxSOLID ); + dc.SetBrush(br0); + dc.SetPen ( mpLayout->mNullPen ); + dc.DrawRectangle( rowBounds.x, rowBounds.y, + rowBounds.width + 1, + rowBounds.height + 1 ); #endif - wxBrush bkBrush( mpLayout->mGrayPen.GetColour(), wxSOLID ); + wxBrush bkBrush( mpLayout->mGrayPen.GetColour(), wxSOLID ); - dc.SetPen ( mpLayout->mNullPen ); - dc.SetBrush( bkBrush ); + dc.SetPen ( mpLayout->mNullPen ); + dc.SetBrush( bkBrush ); - // fill background-recatangle of entire row area - dc.DrawRectangle( rowBounds.x, rowBounds.y, - rowBounds.width + 1, - rowBounds.height + 1 ); + // fill background-recatangle of entire row area + dc.DrawRectangle( rowBounds.x, rowBounds.y, + rowBounds.width + 1, + rowBounds.height + 1 ); - dc.SetBrush( wxNullBrush ); + dc.SetBrush( wxNullBrush ); - // draw "shaded-side-bars" for each bar - for( size_t i = 0; i != pRow->mBars.Count(); ++i ) - { - wxRect& bounds = pRow->mBars[i]->mBoundsInParent; + // draw "shaded-side-bars" for each bar + for( size_t i = 0; i != pRow->mBars.Count(); ++i ) + { + wxRect& bounds = pRow->mBars[i]->mBoundsInParent; - if ( isHorizontal ) - { - DrawShade( 1, bounds, FL_ALIGN_LEFT, dc ); - DrawShade( 1, bounds, FL_ALIGN_RIGHT, dc ); - } - else - { - DrawShade( 1, bounds, FL_ALIGN_TOP, dc ); - DrawShade( 1, bounds, FL_ALIGN_BOTTOM, dc ); - } - } + if ( isHorizontal ) + { + DrawShade( 1, bounds, FL_ALIGN_LEFT, dc ); + DrawShade( 1, bounds, FL_ALIGN_RIGHT, dc ); + } + else + { + DrawShade( 1, bounds, FL_ALIGN_TOP, dc ); + DrawShade( 1, bounds, FL_ALIGN_BOTTOM, dc ); + } + } - // draw extra shades to simulate "glued-bricks" effect + // draw extra shades to simulate "glued-bricks" effect - // TBD:: reduce exessive drawing of shades, when the - // row handle is present, and shades will be overr-drawn anyway + // TBD:: reduce exessive drawing of shades, when the + // row handle is present, and shades will be overr-drawn anyway - DrawUpperRowShades( pRow, dc, 1 ); // outer shade + DrawUpperRowShades( pRow, dc, 1 ); // outer shade - if ( pRow->mpPrev ) - { - DrawLowerRowShades( pRow->mpPrev, dc, 1 ); // outter shade - DrawLowerRowShades( pRow->mpPrev, dc, 0 ); // inner shade - } + if ( pRow->mpPrev ) + { + DrawLowerRowShades( pRow->mpPrev, dc, 1 ); // outter shade + DrawLowerRowShades( pRow->mpPrev, dc, 0 ); // inner shade + } - DrawLowerRowShades( pRow, dc, 1 ); + DrawLowerRowShades( pRow, dc, 1 ); - if ( pRow->mpNext ) - { - DrawUpperRowShades( pRow->mpNext, dc, 1 ); - DrawUpperRowShades( pRow->mpNext, dc, 0 ); - } + if ( pRow->mpNext ) + { + DrawUpperRowShades( pRow->mpNext, dc, 1 ); + DrawUpperRowShades( pRow->mpNext, dc, 0 ); + } - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::DrawUpperRowShades( cbRowInfo* pRow, wxDC& dc, int level ) { - for( size_t i = 0; i != pRow->mBars.Count(); ++i ) - { - wxRect& bounds = pRow->mBars[i]->mBoundsInParent; - - if ( mpPane->IsHorizontal() ) - { - DrawShade( level, bounds, FL_ALIGN_TOP, dc ); - if ( level == 1 ) - { - dc.SetPen( mpLayout->mDarkPen ); - dc.DrawPoint( bounds.x - 1, bounds.y ); - dc.SetPen( mpLayout->mLightPen ); - dc.DrawPoint( bounds.x + bounds.width , bounds.y ); - } - } - else - { - DrawShade( level, bounds, FL_ALIGN_LEFT, dc ); - if ( level == 1 ) - { - dc.SetPen( mpLayout->mDarkPen ); - dc.DrawPoint( bounds.x, bounds.y -1 ); - dc.SetPen( mpLayout->mLightPen ); - dc.DrawPoint( bounds.x, bounds.y + bounds.height ); - } - } - } + for( size_t i = 0; i != pRow->mBars.Count(); ++i ) + { + wxRect& bounds = pRow->mBars[i]->mBoundsInParent; + + if ( mpPane->IsHorizontal() ) + { + DrawShade( level, bounds, FL_ALIGN_TOP, dc ); + if ( level == 1 ) + { + dc.SetPen( mpLayout->mDarkPen ); + dc.DrawPoint( bounds.x - 1, bounds.y ); + dc.SetPen( mpLayout->mLightPen ); + dc.DrawPoint( bounds.x + bounds.width , bounds.y ); + } + } + else + { + DrawShade( level, bounds, FL_ALIGN_LEFT, dc ); + if ( level == 1 ) + { + dc.SetPen( mpLayout->mDarkPen ); + dc.DrawPoint( bounds.x, bounds.y -1 ); + dc.SetPen( mpLayout->mLightPen ); + dc.DrawPoint( bounds.x, bounds.y + bounds.height ); + } + } + } } void cbPaneDrawPlugin::DrawLowerRowShades( cbRowInfo* pRow, wxDC& dc, int level ) { - for( size_t i = 0; i != pRow->mBars.Count(); ++i ) - { - wxRect& bounds = pRow->mBars[i]->mBoundsInParent; - - if ( mpPane->IsHorizontal() ) - { - DrawShade( level, bounds, FL_ALIGN_BOTTOM, dc ); - if ( level == 1 ) - { - dc.SetPen( mpLayout->mDarkPen ); - dc.DrawPoint( bounds.x - 1, bounds.y + bounds.height -1 ); - dc.SetPen( mpLayout->mLightPen ); - dc.DrawPoint( bounds.x + bounds.width , bounds.y + bounds.height -1 ); - } - } - else - { - DrawShade( level, bounds, FL_ALIGN_RIGHT, dc ); - if ( level == 1 ) - { - dc.SetPen( mpLayout->mDarkPen ); - dc.DrawPoint( bounds.x + bounds.width - 1, bounds.y -1 ); - dc.SetPen( mpLayout->mLightPen ); - dc.DrawPoint( bounds.x + bounds.width - 1, bounds.y + bounds.height ); - } - } - } + for( size_t i = 0; i != pRow->mBars.Count(); ++i ) + { + wxRect& bounds = pRow->mBars[i]->mBoundsInParent; + + if ( mpPane->IsHorizontal() ) + { + DrawShade( level, bounds, FL_ALIGN_BOTTOM, dc ); + if ( level == 1 ) + { + dc.SetPen( mpLayout->mDarkPen ); + dc.DrawPoint( bounds.x - 1, bounds.y + bounds.height -1 ); + dc.SetPen( mpLayout->mLightPen ); + dc.DrawPoint( bounds.x + bounds.width , bounds.y + bounds.height -1 ); + } + } + else + { + DrawShade( level, bounds, FL_ALIGN_RIGHT, dc ); + if ( level == 1 ) + { + dc.SetPen( mpLayout->mDarkPen ); + dc.DrawPoint( bounds.x + bounds.width - 1, bounds.y -1 ); + dc.SetPen( mpLayout->mLightPen ); + dc.DrawPoint( bounds.x + bounds.width - 1, bounds.y + bounds.height ); + } + } + } } void cbPaneDrawPlugin::DrawBarInnerShadeRect( cbBarInfo* pBar, wxDC& dc ) { - wxRect& bounds = pBar->mBoundsInParent; - - dc.SetPen( mpLayout->mDarkPen ); - - dc.DrawLine( bounds.x + bounds.width - 1, - bounds.y, - bounds.x + bounds.width - 1, - bounds.y + bounds.height ); - - dc.DrawLine( bounds.x, - bounds.y + bounds.height - 1, - bounds.x + bounds.width, - bounds.y + bounds.height -1 ); - - dc.SetPen( mpLayout->mLightPen ); - - dc.DrawLine( bounds.x, - bounds.y, - bounds.x + bounds.width - 1, - bounds.y ); - - dc.DrawLine( bounds.x, - bounds.y, - bounds.x, - bounds.y + bounds.height - 1 ); + wxRect& bounds = pBar->mBoundsInParent; + + dc.SetPen( mpLayout->mDarkPen ); + + dc.DrawLine( bounds.x + bounds.width - 1, + bounds.y, + bounds.x + bounds.width - 1, + bounds.y + bounds.height ); + + dc.DrawLine( bounds.x, + bounds.y + bounds.height - 1, + bounds.x + bounds.width, + bounds.y + bounds.height -1 ); + + dc.SetPen( mpLayout->mLightPen ); + + dc.DrawLine( bounds.x, + bounds.y, + bounds.x + bounds.width - 1, + bounds.y ); + + dc.DrawLine( bounds.x, + bounds.y, + bounds.x, + bounds.y + bounds.height - 1 ); } void cbPaneDrawPlugin::DrawShade( int level, wxRect& rect, int alignment, wxDC& dc ) { - // simulates "guled-bricks" appearence of control bars - - if ( ( alignment == FL_ALIGN_TOP && level == 1 ) || - ( alignment == FL_ALIGN_BOTTOM && level == 0 ) || - ( alignment == FL_ALIGN_LEFT && level == 1 ) || - ( alignment == FL_ALIGN_RIGHT && level == 0 ) - ) - - dc.SetPen( mpLayout->mDarkPen ); - else - dc.SetPen( mpLayout->mLightPen ); - - if ( alignment == FL_ALIGN_TOP ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x, - rect.y, - rect.x + rect.width - 1, - rect.y ); - else - dc.DrawLine( rect.x - 1, - rect.y - 1, - rect.x + rect.width + 0, - rect.y - 1 ); - } - else - if ( alignment == FL_ALIGN_BOTTOM ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x, - rect.y + rect.height - 1, - rect.x + rect.width, - rect.y + rect.height - 1 ); - else - dc.DrawLine( rect.x - 1, - rect.y + rect.height, - rect.x + rect.width + 1, - rect.y + rect.height ); - } - else - if ( alignment == FL_ALIGN_LEFT ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x, - rect.y, - rect.x, - rect.y + rect.height - 1 ); - else - dc.DrawLine( rect.x - 1, - rect.y - 1, - rect.x - 1, - rect.y + rect.height ); - } - else - if ( alignment == FL_ALIGN_RIGHT ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x + rect.width - 1, - rect.y, - rect.x + rect.width - 1, - rect.y + rect.height ); - else - { - dc.DrawLine( rect.x + rect.width, - rect.y - 1, - rect.x + rect.width, - rect.y + rect.height + 1 ); - } - } + // simulates "guled-bricks" appearence of control bars + + if ( ( alignment == FL_ALIGN_TOP && level == 1 ) || + ( alignment == FL_ALIGN_BOTTOM && level == 0 ) || + ( alignment == FL_ALIGN_LEFT && level == 1 ) || + ( alignment == FL_ALIGN_RIGHT && level == 0 ) + ) + + dc.SetPen( mpLayout->mDarkPen ); + else + dc.SetPen( mpLayout->mLightPen ); + + if ( alignment == FL_ALIGN_TOP ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x, + rect.y, + rect.x + rect.width - 1, + rect.y ); + else + dc.DrawLine( rect.x - 1, + rect.y - 1, + rect.x + rect.width + 0, + rect.y - 1 ); + } + else + if ( alignment == FL_ALIGN_BOTTOM ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x, + rect.y + rect.height - 1, + rect.x + rect.width, + rect.y + rect.height - 1 ); + else + dc.DrawLine( rect.x - 1, + rect.y + rect.height, + rect.x + rect.width + 1, + rect.y + rect.height ); + } + else + if ( alignment == FL_ALIGN_LEFT ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x, + rect.y, + rect.x, + rect.y + rect.height - 1 ); + else + dc.DrawLine( rect.x - 1, + rect.y - 1, + rect.x - 1, + rect.y + rect.height ); + } + else + if ( alignment == FL_ALIGN_RIGHT ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x + rect.width - 1, + rect.y, + rect.x + rect.width - 1, + rect.y + rect.height ); + else + { + dc.DrawLine( rect.x + rect.width, + rect.y - 1, + rect.x + rect.width, + rect.y + rect.height + 1 ); + } + } } void cbPaneDrawPlugin::DrawShade1( int level, wxRect& rect, int alignment, wxDC& dc ) { - // simulates "guled-bricks" appearence of control bars - - if ( ( alignment == FL_ALIGN_TOP && level == 1 ) || - ( alignment == FL_ALIGN_BOTTOM && level == 0 ) || - ( alignment == FL_ALIGN_LEFT && level == 1 ) || - ( alignment == FL_ALIGN_RIGHT && level == 0 ) - ) - - dc.SetPen( mpLayout->mDarkPen ); - else - dc.SetPen( mpLayout->mLightPen ); - - if ( alignment == FL_ALIGN_TOP ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x, - rect.y, - rect.x + rect.width, - rect.y ); - else - dc.DrawLine( rect.x, - rect.y - 1, - rect.x + rect.width, - rect.y - 1 ); - } - else - if ( alignment == FL_ALIGN_BOTTOM ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x, - rect.y + rect.height - 1, - rect.x + rect.width, - rect.y + rect.height - 1 ); - else - dc.DrawLine( rect.x, - rect.y + rect.height, - rect.x + rect.width, - rect.y + rect.height ); - } - else - if ( alignment == FL_ALIGN_LEFT ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x, - rect.y, - rect.x, - rect.y + rect.height ); - else - dc.DrawLine( rect.x - 1, - rect.y, - rect.x - 1, - rect.y + rect.height ); - } - else - if ( alignment == FL_ALIGN_RIGHT ) - { - if ( level == 0 ) - - dc.DrawLine( rect.x + rect.width - 1, - rect.y, - rect.x + rect.width - 1, - rect.y + rect.height ); - else - { - dc.DrawLine( rect.x + rect.width, - rect.y , - rect.x + rect.width, - rect.y + rect.height ); - } - } + // simulates "guled-bricks" appearence of control bars + + if ( ( alignment == FL_ALIGN_TOP && level == 1 ) || + ( alignment == FL_ALIGN_BOTTOM && level == 0 ) || + ( alignment == FL_ALIGN_LEFT && level == 1 ) || + ( alignment == FL_ALIGN_RIGHT && level == 0 ) + ) + + dc.SetPen( mpLayout->mDarkPen ); + else + dc.SetPen( mpLayout->mLightPen ); + + if ( alignment == FL_ALIGN_TOP ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x, + rect.y, + rect.x + rect.width, + rect.y ); + else + dc.DrawLine( rect.x, + rect.y - 1, + rect.x + rect.width, + rect.y - 1 ); + } + else + if ( alignment == FL_ALIGN_BOTTOM ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x, + rect.y + rect.height - 1, + rect.x + rect.width, + rect.y + rect.height - 1 ); + else + dc.DrawLine( rect.x, + rect.y + rect.height, + rect.x + rect.width, + rect.y + rect.height ); + } + else + if ( alignment == FL_ALIGN_LEFT ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x, + rect.y, + rect.x, + rect.y + rect.height ); + else + dc.DrawLine( rect.x - 1, + rect.y, + rect.x - 1, + rect.y + rect.height ); + } + else + if ( alignment == FL_ALIGN_RIGHT ) + { + if ( level == 0 ) + + dc.DrawLine( rect.x + rect.width - 1, + rect.y, + rect.x + rect.width - 1, + rect.y + rect.height ); + else + { + dc.DrawLine( rect.x + rect.width, + rect.y , + rect.x + rect.width, + rect.y + rect.height ); + } + } } void cbPaneDrawPlugin::DrawPaneShade( wxDC& dc, int alignment ) { - if ( !mpPane->mProps.mShow3DPaneBorderOn ) return; + if ( !mpPane->mProps.mShow3DPaneBorderOn ) return; - wxRect bounds = mpPane->mBoundsInParent; + wxRect bounds = mpPane->mBoundsInParent; - bounds.x += mpPane->mLeftMargin; - bounds.y += mpPane->mTopMargin; - bounds.width -= ( mpPane->mLeftMargin + mpPane->mRightMargin ); - bounds.height -= ( mpPane->mTopMargin + mpPane->mBottomMargin ); + bounds.x += mpPane->mLeftMargin; + bounds.y += mpPane->mTopMargin; + bounds.width -= ( mpPane->mLeftMargin + mpPane->mRightMargin ); + bounds.height -= ( mpPane->mTopMargin + mpPane->mBottomMargin ); - DrawShade( 0, bounds, alignment, dc ); - DrawShade( 1, bounds, alignment, dc ); + DrawShade( 0, bounds, alignment, dc ); + DrawShade( 1, bounds, alignment, dc ); } void cbPaneDrawPlugin::DrawPaneShadeForRow( cbRowInfo* pRow, wxDC& dc ) { - if ( !mpPane->mProps.mShow3DPaneBorderOn ) return; + if ( !mpPane->mProps.mShow3DPaneBorderOn ) return; - // do not draw decoration, if pane has "vainished" - if ( mpPane->mPaneWidth < 0 || - mpPane->mPaneHeight < 0 ) + // do not draw decoration, if pane has "vainished" + if ( mpPane->mPaneWidth < 0 || + mpPane->mPaneHeight < 0 ) - return; + return; - wxRect bounds = pRow->mBoundsInParent; + wxRect bounds = pRow->mBoundsInParent; - if ( mpPane->mAlignment == FL_ALIGN_TOP || - mpPane->mAlignment == FL_ALIGN_BOTTOM ) - { - --bounds.y; - bounds.height += 2; + if ( mpPane->mAlignment == FL_ALIGN_TOP || + mpPane->mAlignment == FL_ALIGN_BOTTOM ) + { + --bounds.y; + bounds.height += 2; - DrawShade1( 0, bounds, FL_ALIGN_LEFT, dc ); - DrawShade1( 1, bounds, FL_ALIGN_LEFT, dc ); - DrawShade1( 0, bounds, FL_ALIGN_RIGHT, dc ); - DrawShade1( 1, bounds, FL_ALIGN_RIGHT, dc ); + DrawShade1( 0, bounds, FL_ALIGN_LEFT, dc ); + DrawShade1( 1, bounds, FL_ALIGN_LEFT, dc ); + DrawShade1( 0, bounds, FL_ALIGN_RIGHT, dc ); + DrawShade1( 1, bounds, FL_ALIGN_RIGHT, dc ); - if ( !pRow->mpNext ) - DrawPaneShade( dc, FL_ALIGN_BOTTOM ); + if ( !pRow->mpNext ) + DrawPaneShade( dc, FL_ALIGN_BOTTOM ); - if ( !pRow->mpPrev ) - DrawPaneShade( dc, FL_ALIGN_TOP ); - } - else - { - --bounds.x; - bounds.width += 2; + if ( !pRow->mpPrev ) + DrawPaneShade( dc, FL_ALIGN_TOP ); + } + else + { + --bounds.x; + bounds.width += 2; - DrawShade1( 0, bounds, FL_ALIGN_TOP, dc ); - DrawShade1( 1, bounds, FL_ALIGN_TOP, dc ); - DrawShade1( 0, bounds, FL_ALIGN_BOTTOM, dc ); - DrawShade1( 1, bounds, FL_ALIGN_BOTTOM, dc ); + DrawShade1( 0, bounds, FL_ALIGN_TOP, dc ); + DrawShade1( 1, bounds, FL_ALIGN_TOP, dc ); + DrawShade1( 0, bounds, FL_ALIGN_BOTTOM, dc ); + DrawShade1( 1, bounds, FL_ALIGN_BOTTOM, dc ); - if ( !pRow->mpNext ) - DrawPaneShade( dc, FL_ALIGN_RIGHT ); + if ( !pRow->mpNext ) + DrawPaneShade( dc, FL_ALIGN_RIGHT ); - if ( !pRow->mpPrev ) - DrawPaneShade( dc, FL_ALIGN_LEFT ); - } + if ( !pRow->mpPrev ) + DrawPaneShade( dc, FL_ALIGN_LEFT ); + } } void cbPaneDrawPlugin::OnDrawPaneDecorations( cbDrawPaneDecorEvent& event ) { - wxDC& dc = *event.mpDc; + wxDC& dc = *event.mpDc; - cbDockPane* pPane = event.mpPane; + cbDockPane* pPane = event.mpPane; - RowArrayT& lst = pPane->GetRowList(); - - // FIXME:: this is a workaround for some glitches + RowArrayT& lst = pPane->GetRowList(); + + // FIXME:: this is a workaround for some glitches - if ( lst.Count() ) - { - cbRowInfo* pLastRow = lst[ lst.Count() - 1 ]; + if ( lst.Count() ) + { + cbRowInfo* pLastRow = lst[ lst.Count() - 1 ]; - pPane->PaintRowBackground( pLastRow, dc ); - pPane->PaintRowDecorations( pLastRow, dc ); - pPane->PaintRowHandles( pLastRow, dc ); - } + pPane->PaintRowBackground( pLastRow, dc ); + pPane->PaintRowDecorations( pLastRow, dc ); + pPane->PaintRowHandles( pLastRow, dc ); + } - if ( !pPane->mProps.mShow3DPaneBorderOn ) return; + if ( !pPane->mProps.mShow3DPaneBorderOn ) return; - // do not draw decoration, if pane is completely hidden - if ( event.mpPane->mPaneWidth < 0 || - event.mpPane->mPaneHeight < 0 ) + // do not draw decoration, if pane is completely hidden + if ( event.mpPane->mPaneWidth < 0 || + event.mpPane->mPaneHeight < 0 ) - return; + return; - DrawPaneShade( dc, FL_ALIGN_TOP ); - DrawPaneShade( dc, FL_ALIGN_BOTTOM ); - DrawPaneShade( dc, FL_ALIGN_LEFT ); - DrawPaneShade( dc, FL_ALIGN_RIGHT ); + DrawPaneShade( dc, FL_ALIGN_TOP ); + DrawPaneShade( dc, FL_ALIGN_BOTTOM ); + DrawPaneShade( dc, FL_ALIGN_LEFT ); + DrawPaneShade( dc, FL_ALIGN_RIGHT ); - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } // bar decoration/sizing handlers void cbPaneDrawPlugin::OnDrawBarDecorations( cbDrawBarDecorEvent& event ) { -// cbBarInfo* pBar = event.mpBar; - wxDC& dc = *event.mpDc; +// cbBarInfo* pBar = event.mpBar; + wxDC& dc = *event.mpDc; - // draw brick borders + // draw brick borders - wxRect& rect = event.mBoundsInParent; + wxRect& rect = event.mBoundsInParent; - dc.SetPen( mpLayout->mLightPen ); + dc.SetPen( mpLayout->mLightPen ); - // horiz - dc.DrawLine( rect.x, rect.y, - rect.x + rect.width-1, rect.y ); + // horiz + dc.DrawLine( rect.x, rect.y, + rect.x + rect.width-1, rect.y ); - // vert - dc.DrawLine( rect.x, rect.y, - rect.x, rect.y + rect.height-1 ); + // vert + dc.DrawLine( rect.x, rect.y, + rect.x, rect.y + rect.height-1 ); - dc.SetPen( mpLayout->mDarkPen ); + dc.SetPen( mpLayout->mDarkPen ); - // vert - dc.DrawLine( rect.x + rect.width-1, rect.y, - rect.x + rect.width-1, rect.y + rect.height-1 ); + // vert + dc.DrawLine( rect.x + rect.width-1, rect.y, + rect.x + rect.width-1, rect.y + rect.height-1 ); - // horiz - dc.DrawLine( rect.x, rect.y + rect.height-1, - rect.x + rect.width, rect.y + rect.height-1 ); + // horiz + dc.DrawLine( rect.x, rect.y + rect.height-1, + rect.x + rect.width, rect.y + rect.height-1 ); - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::OnDrawBarHandles( cbDrawBarHandlesEvent& event ) { - // short-cuts - cbBarInfo* pBar = event.mpBar; - wxDC& dc = *event.mpDc; - mpPane = event.mpPane; + // short-cuts + cbBarInfo* pBar = event.mpBar; + wxDC& dc = *event.mpDc; + mpPane = event.mpPane; - // draw handles around the bar if present + // draw handles around the bar if present - if ( pBar->mHasLeftHandle || - pBar->mHasRightHandle ) - { - wxRect& bounds = pBar->mBoundsInParent; + if ( pBar->mHasLeftHandle || + pBar->mHasRightHandle ) + { + wxRect& bounds = pBar->mBoundsInParent; - if ( mpPane->IsHorizontal() ) - { - if ( pBar->mHasLeftHandle ) + if ( mpPane->IsHorizontal() ) + { + if ( pBar->mHasLeftHandle ) - mpPane->DrawVertHandle( dc, bounds.x - mpPane->mProps.mResizeHandleSize -1, - bounds.y, bounds.height ); + mpPane->DrawVertHandle( dc, bounds.x - mpPane->mProps.mResizeHandleSize -1, + bounds.y, bounds.height ); - if ( pBar->mHasRightHandle ) + if ( pBar->mHasRightHandle ) - mpPane->DrawVertHandle( dc, - bounds.x + bounds.width -1, - bounds.y, bounds.height ); - } - else - { - if ( pBar->mHasLeftHandle ) + mpPane->DrawVertHandle( dc, + bounds.x + bounds.width -1, + bounds.y, bounds.height ); + } + else + { + if ( pBar->mHasLeftHandle ) - mpPane->DrawHorizHandle( dc, bounds.x, - bounds.y - mpPane->mProps.mResizeHandleSize - 1, - bounds.width ); + mpPane->DrawHorizHandle( dc, bounds.x, + bounds.y - mpPane->mProps.mResizeHandleSize - 1, + bounds.width ); - if ( pBar->mHasRightHandle ) + if ( pBar->mHasRightHandle ) - mpPane->DrawHorizHandle( dc, bounds.x, - bounds.y + bounds.height - 1, - bounds.width ); - } - } + mpPane->DrawHorizHandle( dc, bounds.x, + bounds.y + bounds.height - 1, + bounds.width ); + } + } - event.Skip(); // pass event to the next plugin + event.Skip(); // pass event to the next plugin } void cbPaneDrawPlugin::OnStartDrawInArea( cbStartDrawInAreaEvent& event ) { - // DBG:: - wxASSERT( mpClntDc == NULL ); + // DBG:: + wxASSERT( mpClntDc == NULL ); - // FOR NOW:: create/destroy client-dc upon each drawing - mpClntDc = new wxClientDC( &mpLayout->GetParentFrame() ); + // FOR NOW:: create/destroy client-dc upon each drawing + mpClntDc = new wxClientDC( &mpLayout->GetParentFrame() ); - (*event.mppDc) = mpClntDc; + (*event.mppDc) = mpClntDc; - mpClntDc->SetClippingRegion( event.mArea.x, event.mArea.y, - event.mArea.width, event.mArea.height ); + mpClntDc->SetClippingRegion( event.mArea.x, event.mArea.y, + event.mArea.width, event.mArea.height ); } void cbPaneDrawPlugin::OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ) { - // DBG:: - wxASSERT( mpClntDc ); + // DBG:: + wxASSERT( mpClntDc ); - delete mpClntDc; + delete mpClntDc; - mpClntDc = NULL; + mpClntDc = NULL; } diff --git a/contrib/src/fl/rowdragpl.cpp b/contrib/src/fl/rowdragpl.cpp index 3e095121a9..062e312bc5 100644 --- a/contrib/src/fl/rowdragpl.cpp +++ b/contrib/src/fl/rowdragpl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: rowdragpl.cpp +// Purpose: cbRowDragPlugin implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -49,69 +49,69 @@ IMPLEMENT_DYNAMIC_CLASS( cbRowDragPlugin, cbPluginBase ) BEGIN_EVENT_TABLE( cbRowDragPlugin, cbPluginBase ) - EVT_PL_LEFT_DOWN ( cbRowDragPlugin::OnLButtonDown ) - EVT_PL_LEFT_UP ( cbRowDragPlugin::OnLButtonUp ) - EVT_PL_MOTION ( cbRowDragPlugin::OnMouseMove ) + EVT_PL_LEFT_DOWN ( cbRowDragPlugin::OnLButtonDown ) + EVT_PL_LEFT_UP ( cbRowDragPlugin::OnLButtonUp ) + EVT_PL_MOTION ( cbRowDragPlugin::OnMouseMove ) - EVT_PL_DRAW_PANE_DECOR ( cbRowDragPlugin::OnDrawPaneBackground ) + EVT_PL_DRAW_PANE_DECOR ( cbRowDragPlugin::OnDrawPaneBackground ) END_EVENT_TABLE() -// FIXME:: how to eliminated these cut&pasted constructors? +// FIXME:: how to eliminated these cut and pasted constructors? cbRowDragPlugin::cbRowDragPlugin(void) - : mHightColor ( 192, 192, 255 ), - mLowColor ( 192, 192, 192 ), + : mHightColor ( 192, 192, 255 ), + mLowColor ( 192, 192, 192 ), mTrianInnerColor ( 0,0,255 ), - mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ), + mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ), mDragStarted ( FALSE ), - mDecisionMode ( FALSE ), - mCurDragOfs ( 0 ), - mCaptureIsOn ( FALSE ), + mDecisionMode ( FALSE ), + mCurDragOfs ( 0 ), + mCaptureIsOn ( FALSE ), mSvTopMargin ( -1 ), - mSvBottomMargin ( -1 ), - mSvLeftMargin ( -1 ), - mSvRightMargin ( -1 ), + mSvBottomMargin ( -1 ), + mSvLeftMargin ( -1 ), + mSvRightMargin ( -1 ), mpPaneImage ( NULL ), - mpRowImage ( NULL ), - mpCombinedImage ( NULL ), + mpRowImage ( NULL ), + mpCombinedImage ( NULL ), - mpRowInFocus ( NULL ), - mCollapsedIconInFocus( -1 ), - - mpPane ( NULL ) + mpRowInFocus ( NULL ), + mCollapsedIconInFocus( -1 ), + + mpPane ( NULL ) { } cbRowDragPlugin::cbRowDragPlugin( wxFrameLayout* pLayout, int paneMask ) - : cbPluginBase( pLayout, paneMask ), - - mHightColor ( 192, 192, 255 ), - mLowColor ( 192, 192, 192 ), + : cbPluginBase( pLayout, paneMask ), + + mHightColor ( 192, 192, 255 ), + mLowColor ( 192, 192, 192 ), mTrianInnerColor ( 0,0,255 ), - mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ), + mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ), mDragStarted ( FALSE ), - mDecisionMode ( FALSE ), - mCurDragOfs ( 0 ), - mCaptureIsOn ( FALSE ), - mSvTopMargin ( -1 ), - mSvBottomMargin ( -1 ), - mSvLeftMargin ( -1 ), - mSvRightMargin ( -1 ), + mDecisionMode ( FALSE ), + mCurDragOfs ( 0 ), + mCaptureIsOn ( FALSE ), + mSvTopMargin ( -1 ), + mSvBottomMargin ( -1 ), + mSvLeftMargin ( -1 ), + mSvRightMargin ( -1 ), mpPaneImage ( NULL ), mpRowImage ( NULL ), - mpCombinedImage ( NULL ), + mpCombinedImage ( NULL ), - mpRowInFocus ( NULL ), - mCollapsedIconInFocus( -1 ), - - mpPane ( NULL ) + mpRowInFocus ( NULL ), + mCollapsedIconInFocus( -1 ), + + mpPane ( NULL ) { } @@ -122,1344 +122,1344 @@ cbRowDragPlugin::~cbRowDragPlugin() // handlers for plugin events void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) { - // short-cuts - wxPoint pos = event.mPos; - mpPane = event.mpPane; - - mpPane->PaneToFrame( &pos.x, &pos.y ); - - if ( !mDragStarted ) - { - if ( mDecisionMode && mpRowInFocus ) - { - int ofs; - - if ( mpPane->IsHorizontal() ) - - ofs = pos.y - mDragOrigin.y; - else - ofs = pos.x - mDragOrigin.x; - - // check if the item was dragged sufficeintly - // far, enough to consider that user really intends - // to drag it - - if ( ofs >= MINIMAL_ROW_DRAG_OFS || - ofs <= -MINIMAL_ROW_DRAG_OFS ) - { - // DBG:: - //.wxPoint pos = event.mPos; - //wxPoint drg = mDragOrigin; - //int dif = event.mPos.x - mDragOrigin.x; - - mDragStarted = TRUE; - mDecisionMode = FALSE; - mDragOrigin = pos; - - PrepareForRowDrag(); - return; - } - - // this plugin "eats" all mouse input while item is dragged, - return; - } - - cbRowInfo* pRow = GetFirstRow(); - - bool focusFound = FALSE; - - while( pRow ) - { - if ( HitTestRowDragHint( pRow, pos ) ) - { - CheckPrevItemInFocus( pRow, -1 ); - SetMouseCapture( TRUE ); - - focusFound = TRUE; - - mpRowInFocus = pRow; - mCollapsedIconInFocus = -1; - break; - } - - pRow = pRow->mpNext; - } - - if ( !focusFound ) - { - int hrCnt = GetHRowsCountForPane( event.mpPane ); - - for( int i = 0; i != hrCnt; ++i ) - { - if ( HitTestCollapsedRowIcon( i, pos ) ) - { - CheckPrevItemInFocus( NULL, i ); - SetMouseCapture( TRUE ); - - focusFound = TRUE; - - mCollapsedIconInFocus = i; - mpRowInFocus = NULL; - break; - } - } - } - - if ( !focusFound && ItemIsInFocus() ) - { - // kill focus from item previously been in focus - UnhiglightItemInFocus(); - - mpRowInFocus = NULL; - mCollapsedIconInFocus = -1; - SetMouseCapture( FALSE ); - } - - if ( !ItemIsInFocus() ) - - // delegate it to other plugins - event.Skip(); - } - else - { - // otherwise mouse pointer moves, when dragging is started - - if ( mpPane->IsHorizontal() ) - { - // DBG:: - wxPoint p = event.mPos; - wxPoint d = mDragOrigin; -// int dif = event.mPos.x - mDragOrigin.x; - - // row is dragged up or down; - ShowDraggedRow( pos.y - mDragOrigin.y ); - } - else - { - // DBG:: - wxPoint p = event.mPos; - wxPoint d = mDragOrigin; -// int dif = event.mPos.x - mDragOrigin.x; - - // row is dragged left or right - ShowDraggedRow( pos.x - mDragOrigin.x ); - } - - // this plugin "eats" all mouse input while item is dragged, - } + // short-cuts + wxPoint pos = event.mPos; + mpPane = event.mpPane; + + mpPane->PaneToFrame( &pos.x, &pos.y ); + + if ( !mDragStarted ) + { + if ( mDecisionMode && mpRowInFocus ) + { + int ofs; + + if ( mpPane->IsHorizontal() ) + + ofs = pos.y - mDragOrigin.y; + else + ofs = pos.x - mDragOrigin.x; + + // check if the item was dragged sufficeintly + // far, enough to consider that user really intends + // to drag it + + if ( ofs >= MINIMAL_ROW_DRAG_OFS || + ofs <= -MINIMAL_ROW_DRAG_OFS ) + { + // DBG:: + //.wxPoint pos = event.mPos; + //wxPoint drg = mDragOrigin; + //int dif = event.mPos.x - mDragOrigin.x; + + mDragStarted = TRUE; + mDecisionMode = FALSE; + mDragOrigin = pos; + + PrepareForRowDrag(); + return; + } + + // this plugin "eats" all mouse input while item is dragged, + return; + } + + cbRowInfo* pRow = GetFirstRow(); + + bool focusFound = FALSE; + + while( pRow ) + { + if ( HitTestRowDragHint( pRow, pos ) ) + { + CheckPrevItemInFocus( pRow, -1 ); + SetMouseCapture( TRUE ); + + focusFound = TRUE; + + mpRowInFocus = pRow; + mCollapsedIconInFocus = -1; + break; + } + + pRow = pRow->mpNext; + } + + if ( !focusFound ) + { + int hrCnt = GetHRowsCountForPane( event.mpPane ); + + for( int i = 0; i != hrCnt; ++i ) + { + if ( HitTestCollapsedRowIcon( i, pos ) ) + { + CheckPrevItemInFocus( NULL, i ); + SetMouseCapture( TRUE ); + + focusFound = TRUE; + + mCollapsedIconInFocus = i; + mpRowInFocus = NULL; + break; + } + } + } + + if ( !focusFound && ItemIsInFocus() ) + { + // kill focus from item previously been in focus + UnhighlightItemInFocus(); + + mpRowInFocus = NULL; + mCollapsedIconInFocus = -1; + SetMouseCapture( FALSE ); + } + + if ( !ItemIsInFocus() ) + + // delegate it to other plugins + event.Skip(); + } + else + { + // otherwise mouse pointer moves, when dragging is started + + if ( mpPane->IsHorizontal() ) + { + // DBG:: + wxPoint p = event.mPos; + wxPoint d = mDragOrigin; +// int dif = event.mPos.x - mDragOrigin.x; + + // row is dragged up or down; + ShowDraggedRow( pos.y - mDragOrigin.y ); + } + else + { + // DBG:: + wxPoint p = event.mPos; + wxPoint d = mDragOrigin; +// int dif = event.mPos.x - mDragOrigin.x; + + // row is dragged left or right + ShowDraggedRow( pos.x - mDragOrigin.x ); + } + + // this plugin "eats" all mouse input while item is dragged, + } } void cbRowDragPlugin::OnLButtonDown( cbLeftDownEvent& event ) { - mpPane = event.mpPane; + mpPane = event.mpPane; - // DBG:: - wxASSERT( !mDragStarted && !mDecisionMode ); + // DBG:: + wxASSERT( !mDragStarted && !mDecisionMode ); - if ( ItemIsInFocus() ) - { - mDecisionMode = TRUE; + if ( ItemIsInFocus() ) + { + mDecisionMode = TRUE; - wxPoint pos = event.mPos; - mpPane->PaneToFrame( &pos.x, &pos.y ); + wxPoint pos = event.mPos; + mpPane->PaneToFrame( &pos.x, &pos.y ); - mDragOrigin = pos; + mDragOrigin = pos; - SetMouseCapture( TRUE ); - } - else - // propagate event to other plugins - event.Skip(); + SetMouseCapture( TRUE ); + } + else + // propagate event to other plugins + event.Skip(); } void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event ) { - if ( !mDragStarted && !mDecisionMode ) - { - event.Skip(); - return; - } + if ( !mDragStarted && !mDecisionMode ) + { + event.Skip(); + return; + } - mpPane = event.mpPane; + mpPane = event.mpPane; - if ( mDecisionMode ) - { - cbDockPane* pPane = mpPane; + if ( mDecisionMode ) + { + cbDockPane* pPane = mpPane; - SetMouseCapture( FALSE ); + SetMouseCapture( FALSE ); - mDecisionMode = FALSE; - mDragStarted = FALSE; + mDecisionMode = FALSE; + mDragStarted = FALSE; - wxPoint frmPos = event.mPos; - pPane->PaneToFrame( &frmPos.x, &frmPos.y ); + wxPoint frmPos = event.mPos; + pPane->PaneToFrame( &frmPos.x, &frmPos.y ); - if ( mpRowInFocus ) - { - CollapseRow( mpRowInFocus ); - mpRowInFocus = 0; - } - else - { - ExpandRow( mCollapsedIconInFocus ); - mCollapsedIconInFocus = -1; - } + if ( mpRowInFocus ) + { + CollapseRow( mpRowInFocus ); + mpRowInFocus = 0; + } + else + { + ExpandRow( mCollapsedIconInFocus ); + mCollapsedIconInFocus = -1; + } - mpRowInFocus = NULL; - mpPane = pPane; + mpRowInFocus = NULL; + mpPane = pPane; - pPane->FrameToPane( &frmPos.x, &frmPos.y ); + pPane->FrameToPane( &frmPos.x, &frmPos.y ); - // give it another try after relayouting bars + // give it another try after relayouting bars - cbMotionEvent moveEvt( frmPos, pPane ); - this->OnMouseMove( moveEvt ); + cbMotionEvent moveEvt( frmPos, pPane ); + this->OnMouseMove( moveEvt ); - // this plugin has "eaten" the mouse-up event + // this plugin has "eaten" the mouse-up event - return; - } - else - { - // otherwise, the dragged row was dropped, determine - // where to insert it + return; + } + else + { + // otherwise, the dragged row was dropped, determine + // where to insert it - // restore initial pane appearence - ShowPaneImage(); - FinishOnScreenDraw(); + // restore initial pane appearence + ShowPaneImage(); + FinishOnScreenDraw(); - cbRowInfo* pRow = GetFirstRow(); + cbRowInfo* pRow = GetFirstRow(); - mpLayout->GetUpdatesManager().OnStartChanges(); + mpLayout->GetUpdatesManager().OnStartChanges(); - pRow->mUMgrData.SetDirty(TRUE); + pRow->mUMgrData.SetDirty(TRUE); - cbBarInfo* pBar = mpRowInFocus->mBars[0]; + cbBarInfo* pBar = mpRowInFocus->mBars[0]; - while ( pBar ) - { - pBar->mUMgrData.SetDirty(TRUE); + while ( pBar ) + { + pBar->mUMgrData.SetDirty(TRUE); - if ( pBar->mpBarWnd ) - { - // do complete refresh - pBar->mpBarWnd->Show(FALSE); - pBar->mpBarWnd->Show(TRUE); - } + if ( pBar->mpBarWnd ) + { + // do complete refresh + pBar->mpBarWnd->Show(FALSE); + pBar->mpBarWnd->Show(TRUE); + } - pBar = pBar->mpNext; - } + pBar = pBar->mpNext; + } - while( pRow ) - { - if ( mCurDragOfs < pRow->mRowY ) - { - InsertDraggedRowBefore( pRow ); - break; - } + while( pRow ) + { + if ( mCurDragOfs < pRow->mRowY ) + { + InsertDraggedRowBefore( pRow ); + break; + } - pRow = pRow->mpNext; - } + pRow = pRow->mpNext; + } - if ( pRow == NULL ) InsertDraggedRowBefore( NULL ); + if ( pRow == NULL ) InsertDraggedRowBefore( NULL ); - mpRowInFocus = NULL; + mpRowInFocus = NULL; - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(FALSE); - // finish change "transaction" - mpLayout->GetUpdatesManager().OnFinishChanges(); - mpLayout->GetUpdatesManager().UpdateNow(); + // finish change "transaction" + mpLayout->GetUpdatesManager().OnFinishChanges(); + mpLayout->GetUpdatesManager().UpdateNow(); - // finish drag action - SetMouseCapture( FALSE ); - mDragStarted = FALSE; - } + // finish drag action + SetMouseCapture( FALSE ); + mDragStarted = FALSE; + } } void cbRowDragPlugin::OnDrawPaneBackground ( cbDrawPaneDecorEvent& event ) { - mpPane = event.mpPane; + mpPane = event.mpPane; - // FIXME:: this may harm operation of other plugins + // FIXME:: this may harm operation of other plugins - if ( GetNextHandler() && mpPane->GetRowList().GetCount() ) - { - // first, let other plugins add their decorations now - - GetNextHandler()->ProcessEvent( event ); - event.Skip(FALSE); - } + if ( GetNextHandler() && mpPane->GetRowList().GetCount() ) + { + // first, let other plugins add their decorations now + + GetNextHandler()->ProcessEvent( event ); + event.Skip(FALSE); + } - wxClientDC dc( &mpLayout->GetParentFrame() ); + wxClientDC dc( &mpLayout->GetParentFrame() ); - dc.SetClippingRegion( mpPane->mBoundsInParent.x, - mpPane->mBoundsInParent.y, - mpPane->mBoundsInParent.width, - mpPane->mBoundsInParent.height ); + dc.SetClippingRegion( mpPane->mBoundsInParent.x, + mpPane->mBoundsInParent.y, + mpPane->mBoundsInParent.width, + mpPane->mBoundsInParent.height ); - int cnt = GetHRowsCountForPane( event.mpPane ); + int cnt = GetHRowsCountForPane( event.mpPane ); - if ( cnt > 0 ) + if ( cnt > 0 ) - DrawCollapsedRowsBorder( dc ); + DrawCollapsedRowsBorder( dc ); - if ( mpPane->GetRowList().GetCount() ) - - DrawRowsDragHintsBorder( dc ); + if ( mpPane->GetRowList().GetCount() ) + + DrawRowsDragHintsBorder( dc ); - cbRowInfo* pRow = GetFirstRow(); + cbRowInfo* pRow = GetFirstRow(); - while( pRow ) - { - DrawRowDragHint( pRow, dc, FALSE ); - pRow = pRow->mpNext; - } + while( pRow ) + { + DrawRowDragHint( pRow, dc, FALSE ); + pRow = pRow->mpNext; + } - for( int i = 0; i != cnt; ++i ) + for( int i = 0; i != cnt; ++i ) - DrawCollapsedRowIcon(i, dc, FALSE ); + DrawCollapsedRowIcon(i, dc, FALSE ); } int cbRowDragPlugin::GetHRowsCountForPane( cbDockPane* pPane ) { - wxNode* pNode = mHiddenBars.First(); + wxNode* pNode = mHiddenBars.First(); - int maxIconNo = -1; + int maxIconNo = -1; - while( pNode ) - { - cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); + while( pNode ) + { + cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); - if ( pHBInfo->mAlignment == pPane->mAlignment ) + if ( pHBInfo->mAlignment == pPane->mAlignment ) - maxIconNo = wxMax( maxIconNo, pHBInfo->mIconNo ); + maxIconNo = wxMax( maxIconNo, pHBInfo->mIconNo ); - pNode = pNode->Next(); - } + pNode = pNode->Next(); + } - return ( maxIconNo + 1 ); + return ( maxIconNo + 1 ); } int cbRowDragPlugin::GetCollapsedRowIconHeight() { - return COLLAPSED_ICON_HEIGHT; + return COLLAPSED_ICON_HEIGHT; } int cbRowDragPlugin::GetRowDragHintWidth() { - return ROW_DRAG_HINT_WIDTH; + return ROW_DRAG_HINT_WIDTH; } void cbRowDragPlugin::SetPaneMargins() { - int hiddenRowsCnt = GetHRowsCountForPane( mpPane ); - - if ( mSvTopMargin == -1 ) - { - mSvTopMargin = mpPane->mTopMargin; - mSvBottomMargin = mpPane->mBottomMargin; - mSvLeftMargin = mpPane->mLeftMargin; - mSvRightMargin = mpPane->mRightMargin; - } - - if ( mpPane->IsHorizontal() ) - { - mpPane->mTopMargin = mSvTopMargin; - mpPane->mBottomMargin = ( hiddenRowsCnt == 0 ) - ? mSvBottomMargin - : mSvBottomMargin + GetCollapsedRowIconHeight(); - - mpPane->mLeftMargin = mSvLeftMargin + GetRowDragHintWidth(); - mpPane->mRightMargin = mSvRightMargin; - } - else - { - mpPane->mTopMargin = mSvTopMargin; - mpPane->mBottomMargin = mSvBottomMargin + GetRowDragHintWidth(); - - mpPane->mLeftMargin = mSvLeftMargin; - mpPane->mRightMargin = ( hiddenRowsCnt == 0 ) ? - mSvRightMargin : mSvRightMargin + GetCollapsedRowIconHeight(); - } + int hiddenRowsCnt = GetHRowsCountForPane( mpPane ); + + if ( mSvTopMargin == -1 ) + { + mSvTopMargin = mpPane->mTopMargin; + mSvBottomMargin = mpPane->mBottomMargin; + mSvLeftMargin = mpPane->mLeftMargin; + mSvRightMargin = mpPane->mRightMargin; + } + + if ( mpPane->IsHorizontal() ) + { + mpPane->mTopMargin = mSvTopMargin; + mpPane->mBottomMargin = ( hiddenRowsCnt == 0 ) + ? mSvBottomMargin + : mSvBottomMargin + GetCollapsedRowIconHeight(); + + mpPane->mLeftMargin = mSvLeftMargin + GetRowDragHintWidth(); + mpPane->mRightMargin = mSvRightMargin; + } + else + { + mpPane->mTopMargin = mSvTopMargin; + mpPane->mBottomMargin = mSvBottomMargin + GetRowDragHintWidth(); + + mpPane->mLeftMargin = mSvLeftMargin; + mpPane->mRightMargin = ( hiddenRowsCnt == 0 ) ? + mSvRightMargin : mSvRightMargin + GetCollapsedRowIconHeight(); + } } void cbRowDragPlugin::OnInitPlugin() { - cbDockPane** panes = mpLayout->GetPanesArray(); + cbDockPane** panes = mpLayout->GetPanesArray(); - for( int i = 0; i != MAX_PANES; ++i ) + for( int i = 0; i != MAX_PANES; ++i ) - if ( panes[i]->MatchesMask( mPaneMask ) ) - { - mpPane = panes[i]; + if ( panes[i]->MatchesMask( mPaneMask ) ) + { + mpPane = panes[i]; - SetPaneMargins(); - } + SetPaneMargins(); + } } /*** helpers for drag&drop ***/ void cbRowDragPlugin::SetMouseCapture( bool captureOn ) { - if ( mCaptureIsOn == captureOn ) return; - - if ( captureOn ) - { - mpLayout->CaptureEventsForPane( mpPane ); - mpLayout->CaptureEventsForPlugin( this ); - } - else - { - mpLayout->ReleaseEventsFromPane( mpPane ); - mpLayout->ReleaseEventsFromPlugin( this ); - } - - mCaptureIsOn = captureOn; + if ( mCaptureIsOn == captureOn ) return; + + if ( captureOn ) + { + mpLayout->CaptureEventsForPane( mpPane ); + mpLayout->CaptureEventsForPlugin( this ); + } + else + { + mpLayout->ReleaseEventsFromPane( mpPane ); + mpLayout->ReleaseEventsFromPlugin( this ); + } + + mCaptureIsOn = captureOn; } -void cbRowDragPlugin::UnhiglightItemInFocus() +void cbRowDragPlugin::UnhighlightItemInFocus() { - wxClientDC dc( &mpLayout->GetParentFrame() ); + wxClientDC dc( &mpLayout->GetParentFrame() ); - if ( mpRowInFocus ) + if ( mpRowInFocus ) - DrawRowDragHint( mpRowInFocus, dc, FALSE ); - else - if ( mCollapsedIconInFocus != - 1 ) + DrawRowDragHint( mpRowInFocus, dc, FALSE ); + else + if ( mCollapsedIconInFocus != - 1 ) - DrawCollapsedRowIcon( mCollapsedIconInFocus, dc, FALSE ); + DrawCollapsedRowIcon( mCollapsedIconInFocus, dc, FALSE ); } void cbRowDragPlugin::ShowDraggedRow( int offset ) { - // create combined image of pane and dragged - // row on it, in the mpCombinedImage bitmap + // create combined image of pane and dragged + // row on it, in the mpCombinedImage bitmap - if ( mpPane->IsHorizontal() ) - { - if ( mInitialRowOfs + offset + mRowImgDim.y > mCombRect.y + mCombRect.height ) + if ( mpPane->IsHorizontal() ) + { + if ( mInitialRowOfs + offset + mRowImgDim.y > mCombRect.y + mCombRect.height ) - offset = mCombRect.y + mCombRect.height - mRowImgDim.y - mInitialRowOfs; + offset = mCombRect.y + mCombRect.height - mRowImgDim.y - mInitialRowOfs; - if ( mInitialRowOfs + offset < mCombRect.y ) + if ( mInitialRowOfs + offset < mCombRect.y ) - offset = mCombRect.y - mInitialRowOfs; + offset = mCombRect.y - mInitialRowOfs; - int x, y = mInitialRowOfs + offset; - mpPane->FrameToPane( &x, &y ); - mCurDragOfs = y; - } - else - { - if ( mInitialRowOfs + offset + mRowImgDim.x > mCombRect.x + mCombRect.width ) + int x, y = mInitialRowOfs + offset; + mpPane->FrameToPane( &x, &y ); + mCurDragOfs = y; + } + else + { + if ( mInitialRowOfs + offset + mRowImgDim.x > mCombRect.x + mCombRect.width ) - offset = mCombRect.x + mCombRect.width - mRowImgDim.x - mInitialRowOfs; + offset = mCombRect.x + mCombRect.width - mRowImgDim.x - mInitialRowOfs; - if ( mInitialRowOfs + offset < mCombRect.x ) + if ( mInitialRowOfs + offset < mCombRect.x ) - offset = mCombRect.x - mInitialRowOfs; + offset = mCombRect.x - mInitialRowOfs; - int x = mInitialRowOfs + offset, y; - mpPane->FrameToPane( &x, &y ); - mCurDragOfs = x; - } + int x = mInitialRowOfs + offset, y; + mpPane->FrameToPane( &x, &y ); + mCurDragOfs = x; + } - wxMemoryDC rowImgDc; - rowImgDc.SelectObject ( *mpRowImage ); + wxMemoryDC rowImgDc; + rowImgDc.SelectObject ( *mpRowImage ); - wxMemoryDC paneImgDc; - paneImgDc.SelectObject( *mpPaneImage ); + wxMemoryDC paneImgDc; + paneImgDc.SelectObject( *mpPaneImage ); - wxMemoryDC combImgDc; - combImgDc.SelectObject( *mpCombinedImage ); + wxMemoryDC combImgDc; + combImgDc.SelectObject( *mpCombinedImage ); - combImgDc.Blit( 0,0, mCombRect.width, mCombRect.height, - &paneImgDc, 0,0, wxCOPY ); + combImgDc.Blit( 0,0, mCombRect.width, mCombRect.height, + &paneImgDc, 0,0, wxCOPY ); - if ( mpPane->IsHorizontal() ) - { - combImgDc.Blit( 0, mInitialRowOfs + offset - mCombRect.y, - mCombRect.width, mRowImgDim.y, - &rowImgDc, 0,0, wxCOPY ); - } - else - { - combImgDc.Blit( mInitialRowOfs + offset - mCombRect.x, - 0, - mRowImgDim.x, mCombRect.height, - &rowImgDc, 0,0, wxCOPY ); - } + if ( mpPane->IsHorizontal() ) + { + combImgDc.Blit( 0, mInitialRowOfs + offset - mCombRect.y, + mCombRect.width, mRowImgDim.y, + &rowImgDc, 0,0, wxCOPY ); + } + else + { + combImgDc.Blit( mInitialRowOfs + offset - mCombRect.x, + 0, + mRowImgDim.x, mCombRect.height, + &rowImgDc, 0,0, wxCOPY ); + } - int scrX = mCombRect.x, - scrY = mCombRect.y; + int scrX = mCombRect.x, + scrY = mCombRect.y; - mpLayout->GetParentFrame().ClientToScreen( &scrX, &scrY ); + mpLayout->GetParentFrame().ClientToScreen( &scrX, &scrY ); - mpScrDc->Blit( scrX, scrY, mCombRect.width, mCombRect.height, - &combImgDc, 0,0, wxCOPY ); + mpScrDc->Blit( scrX, scrY, mCombRect.width, mCombRect.height, + &combImgDc, 0,0, wxCOPY ); - rowImgDc .SelectObject( wxNullBitmap ); - paneImgDc.SelectObject( wxNullBitmap ); - combImgDc.SelectObject( wxNullBitmap ); + rowImgDc .SelectObject( wxNullBitmap ); + paneImgDc.SelectObject( wxNullBitmap ); + combImgDc.SelectObject( wxNullBitmap ); } wxBitmap* cbRowDragPlugin::CaptureDCArea( wxDC& dc, wxRect& area ) { - wxBitmap* pBmp = new wxBitmap( int(area.width), int(area.height) ); + wxBitmap* pBmp = new wxBitmap( int(area.width), int(area.height) ); - wxMemoryDC mdc; - mdc.SelectObject( *pBmp ); + wxMemoryDC mdc; + mdc.SelectObject( *pBmp ); - mdc.Blit( 0,0, area.width, area.height, &dc, area.x, area.y, wxCOPY ); - mdc.SelectObject( wxNullBitmap ); + mdc.Blit( 0,0, area.width, area.height, &dc, area.x, area.y, wxCOPY ); + mdc.SelectObject( wxNullBitmap ); - return pBmp; + return pBmp; } void cbRowDragPlugin::PrepareForRowDrag() { - wxRect rowBounds = mpRowInFocus->mBoundsInParent; + wxRect rowBounds = mpRowInFocus->mBoundsInParent; - if ( mpPane->IsHorizontal() ) - { - mCombRect = mpPane->mBoundsInParent; + if ( mpPane->IsHorizontal() ) + { + mCombRect = mpPane->mBoundsInParent; - mCombRect.x += mpPane->mLeftMargin - ROW_DRAG_HINT_WIDTH - 1; - mCombRect.y += mpPane->mTopMargin; + mCombRect.x += mpPane->mLeftMargin - ROW_DRAG_HINT_WIDTH - 1; + mCombRect.y += mpPane->mTopMargin; - mCombRect.width -= mpPane->mLeftMargin + mpPane->mRightMargin - ROW_DRAG_HINT_WIDTH - 1 - 1; - mCombRect.height -= mpPane->mTopMargin + mpPane->mBottomMargin; + mCombRect.width -= mpPane->mLeftMargin + mpPane->mRightMargin - ROW_DRAG_HINT_WIDTH - 1 - 1; + mCombRect.height -= mpPane->mTopMargin + mpPane->mBottomMargin; - mCombRect.height += 2*rowBounds.height; - mCombRect.y -= rowBounds.height; - mInitialRowOfs = rowBounds.y; + mCombRect.height += 2*rowBounds.height; + mCombRect.y -= rowBounds.height; + mInitialRowOfs = rowBounds.y; - rowBounds.y -= 1; - rowBounds.height += 2; - rowBounds.x = mCombRect.x; - rowBounds.width = mCombRect.width; + rowBounds.y -= 1; + rowBounds.height += 2; + rowBounds.x = mCombRect.x; + rowBounds.width = mCombRect.width; - mRowImgDim.y = rowBounds.height; - } - else - { - mCombRect = mpPane->mBoundsInParent; + mRowImgDim.y = rowBounds.height; + } + else + { + mCombRect = mpPane->mBoundsInParent; - mCombRect.y += mpPane->mTopMargin - 1; - mCombRect.x += mpPane->mLeftMargin - 1; - ; - mCombRect.height -= mpPane->mTopMargin + mpPane->mBottomMargin - ROW_DRAG_HINT_WIDTH - 1 - 1; - mCombRect.width -= mpPane->mLeftMargin + mpPane->mRightMargin; + mCombRect.y += mpPane->mTopMargin - 1; + mCombRect.x += mpPane->mLeftMargin - 1; + ; + mCombRect.height -= mpPane->mTopMargin + mpPane->mBottomMargin - ROW_DRAG_HINT_WIDTH - 1 - 1; + mCombRect.width -= mpPane->mLeftMargin + mpPane->mRightMargin; - mCombRect.width += 2*rowBounds.width; - mCombRect.x -= rowBounds.width; - mInitialRowOfs = rowBounds.x; + mCombRect.width += 2*rowBounds.width; + mCombRect.x -= rowBounds.width; + mInitialRowOfs = rowBounds.x; - rowBounds.x -= 1; - rowBounds.width += 2; - rowBounds.y = mCombRect.y; - rowBounds.height = mCombRect.height; + rowBounds.x -= 1; + rowBounds.width += 2; + rowBounds.y = mCombRect.y; + rowBounds.height = mCombRect.height; - mRowImgDim.x = rowBounds.width; - } - // output cobination results onto frame's client area - wxScreenDC::StartDrawingOnTop(&mpLayout->GetParentFrame()); - mpScrDc = new wxScreenDC(); + mRowImgDim.x = rowBounds.width; + } + // output cobination results onto frame's client area + wxScreenDC::StartDrawingOnTop(&mpLayout->GetParentFrame()); + mpScrDc = new wxScreenDC(); - int x = mCombRect.x, y = mCombRect.y; - mpLayout->GetParentFrame().ClientToScreen( &x, &y ); + int x = mCombRect.x, y = mCombRect.y; + mpLayout->GetParentFrame().ClientToScreen( &x, &y ); - wxRect scrRect = mCombRect; - scrRect.x = x; - scrRect.y = y; + wxRect scrRect = mCombRect; + scrRect.x = x; + scrRect.y = y; - mpPaneImage = CaptureDCArea( *mpScrDc, scrRect ); + mpPaneImage = CaptureDCArea( *mpScrDc, scrRect ); - wxMemoryDC mdc; - mdc.SelectObject( *mpPaneImage ); - mdc.SetDeviceOrigin( -mCombRect.x, -mCombRect.y ); + wxMemoryDC mdc; + mdc.SelectObject( *mpPaneImage ); + mdc.SetDeviceOrigin( -mCombRect.x, -mCombRect.y ); - DrawRectShade( rowBounds, mdc, -1, mpLayout->mGrayPen, mpLayout->mDarkPen ); - DrawRectShade( rowBounds, mdc, 0, mpLayout->mLightPen, mpLayout->mBlackPen ); + DrawRectShade( rowBounds, mdc, -1, mpLayout->mGrayPen, mpLayout->mDarkPen ); + DrawRectShade( rowBounds, mdc, 0, mpLayout->mLightPen, mpLayout->mBlackPen ); - mpRowImage = CaptureDCArea( mdc, rowBounds ); + mpRowImage = CaptureDCArea( mdc, rowBounds ); - // draw dark empty-row placeholder - DrawEmptyRow( mdc, rowBounds ); + // draw dark empty-row placeholder + DrawEmptyRow( mdc, rowBounds ); - //DrawRectShade( rowBounds, mdc, 0, mpLayout->mGrayPen, mpLayout->mDarkPen ); - DrawRectShade( rowBounds, mdc, -1, mpLayout->mGrayPen, mpLayout->mGrayPen ); + //DrawRectShade( rowBounds, mdc, 0, mpLayout->mGrayPen, mpLayout->mDarkPen ); + DrawRectShade( rowBounds, mdc, -1, mpLayout->mGrayPen, mpLayout->mGrayPen ); - mdc.SelectObject( wxNullBitmap ); + mdc.SelectObject( wxNullBitmap ); - mpCombinedImage = new wxBitmap( int(mCombRect.width), int(mCombRect.height) ); + mpCombinedImage = new wxBitmap( int(mCombRect.width), int(mCombRect.height) ); - // show it for the first time - ShowDraggedRow( 0 ); + // show it for the first time + ShowDraggedRow( 0 ); } void cbRowDragPlugin::DrawEmptyRow( wxDC& dc, wxRect& rowBounds ) { - wxBrush bkBrush( mpLayout->mDarkPen.GetColour(), wxSOLID ); + wxBrush bkBrush( mpLayout->mDarkPen.GetColour(), wxSOLID ); - // paint the "dark" empty-row placeholder + // paint the "dark" empty-row placeholder - dc.SetBrush( bkBrush ); - dc.SetPen ( mpLayout->mNullPen ); + dc.SetBrush( bkBrush ); + dc.SetPen ( mpLayout->mNullPen ); - dc.DrawRectangle( rowBounds.x, rowBounds.y, - rowBounds.width+1, rowBounds.height+1 ); + dc.DrawRectangle( rowBounds.x, rowBounds.y, + rowBounds.width+1, rowBounds.height+1 ); - dc.SetBrush( wxNullBrush ); + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::ShowPaneImage() { - int scrX = 0, scrY = 0; + int scrX = 0, scrY = 0; - mpLayout->GetParentFrame().ClientToScreen( &scrX, &scrY ); + mpLayout->GetParentFrame().ClientToScreen( &scrX, &scrY ); - wxMemoryDC mdc; - mdc.SelectObject( *mpPaneImage ); + wxMemoryDC mdc; + mdc.SelectObject( *mpPaneImage ); - mpScrDc->Blit( mCombRect.x + scrX, mCombRect.y + scrY, - mCombRect.width, mCombRect.height, - &mdc, 0,0, wxCOPY ); + mpScrDc->Blit( mCombRect.x + scrX, mCombRect.y + scrY, + mCombRect.width, mCombRect.height, + &mdc, 0,0, wxCOPY ); - mdc.SelectObject( wxNullBitmap ); + mdc.SelectObject( wxNullBitmap ); } void cbRowDragPlugin::FinishOnScreenDraw() { - wxScreenDC::EndDrawingOnTop(); + wxScreenDC::EndDrawingOnTop(); - delete mpScrDc; - delete mpCombinedImage; - delete mpPaneImage; - delete mpRowImage; + delete mpScrDc; + delete mpCombinedImage; + delete mpPaneImage; + delete mpRowImage; - mpScrDc = NULL; - - mpCombinedImage = mpPaneImage = mpRowImage = NULL; + mpScrDc = NULL; + + mpCombinedImage = mpPaneImage = mpRowImage = NULL; } void cbRowDragPlugin::CollapseRow( cbRowInfo* pRow ) { - int iconCnt = GetHRowsCountForPane( mpPane ); + int iconCnt = GetHRowsCountForPane( mpPane ); - mpLayout->GetUpdatesManager().OnStartChanges(); + mpLayout->GetUpdatesManager().OnStartChanges(); - cbBarInfo* pBar = pRow->mBars[0]; + cbBarInfo* pBar = pRow->mBars[0]; - int rowNo = 0; + int rowNo = 0; - cbRowInfo* pCur = pRow; - while( pCur->mpPrev ) { ++rowNo; pCur = pCur->mpPrev; } + cbRowInfo* pCur = pRow; + while( pCur->mpPrev ) { ++rowNo; pCur = pCur->mpPrev; } - while( pBar ) - { - cbHiddenBarInfo* pHBInfo = new cbHiddenBarInfo(); - - pHBInfo->mpBar = pBar; - pHBInfo->mRowNo = rowNo; - pHBInfo->mIconNo = iconCnt; - pHBInfo->mAlignment = mpPane->mAlignment; + while( pBar ) + { + cbHiddenBarInfo* pHBInfo = new cbHiddenBarInfo(); + + pHBInfo->mpBar = pBar; + pHBInfo->mRowNo = rowNo; + pHBInfo->mIconNo = iconCnt; + pHBInfo->mAlignment = mpPane->mAlignment; - mHiddenBars.Append( (wxObject*) pHBInfo ); + mHiddenBars.Append( (wxObject*) pHBInfo ); - // hide it - if ( pBar->mpBarWnd ) + // hide it + if ( pBar->mpBarWnd ) - pBar->mpBarWnd->Show( FALSE ); + pBar->mpBarWnd->Show( FALSE ); - pBar->mState = wxCBAR_HIDDEN; + pBar->mState = wxCBAR_HIDDEN; - cbBarInfo* pNext = pBar->mpNext; + cbBarInfo* pNext = pBar->mpNext; - pBar->mpRow = NULL; - pBar->mpNext = NULL; - pBar->mpPrev = NULL; + pBar->mpRow = NULL; + pBar->mpNext = NULL; + pBar->mpPrev = NULL; - pBar = pNext; - } + pBar = pNext; + } - mpPane->GetRowList().Remove( pRow ); - mpPane->InitLinksForRows(); + mpPane->GetRowList().Remove( pRow ); + mpPane->InitLinksForRows(); - delete pRow; + delete pRow; - SetPaneMargins(); + SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(FALSE); - mpRowInFocus = NULL; + mpRowInFocus = NULL; - mpLayout->GetUpdatesManager().OnFinishChanges(); - mpLayout->GetUpdatesManager().UpdateNow(); + mpLayout->GetUpdatesManager().OnFinishChanges(); + mpLayout->GetUpdatesManager().UpdateNow(); } void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) { - mpLayout->GetUpdatesManager().OnStartChanges(); + mpLayout->GetUpdatesManager().OnStartChanges(); - cbRowInfo* pNewRow = new cbRowInfo(); + cbRowInfo* pNewRow = new cbRowInfo(); - wxNode* pNode = mHiddenBars.First(); + wxNode* pNode = mHiddenBars.First(); - int rowNo = 0; + int rowNo = 0; - // move bars from internal list to the newly expanded row + // move bars from internal list to the newly expanded row - while( pNode ) - { - cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); + while( pNode ) + { + cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); - if ( pHBInfo->mAlignment == mpPane->mAlignment && - pHBInfo->mIconNo == collapsedIconIdx ) - { - rowNo = pHBInfo->mRowNo; + if ( pHBInfo->mAlignment == mpPane->mAlignment && + pHBInfo->mIconNo == collapsedIconIdx ) + { + rowNo = pHBInfo->mRowNo; - if ( pHBInfo->mpBar->mState == wxCBAR_HIDDEN ) - { - pNewRow->mBars.Add( pHBInfo->mpBar ); + if ( pHBInfo->mpBar->mState == wxCBAR_HIDDEN ) + { + pNewRow->mBars.Add( pHBInfo->mpBar ); - pHBInfo->mpBar->mState = ( mpPane->IsHorizontal() ) - ? wxCBAR_DOCKED_HORIZONTALLY - : wxCBAR_DOCKED_VERTICALLY; - } + pHBInfo->mpBar->mState = ( mpPane->IsHorizontal() ) + ? wxCBAR_DOCKED_HORIZONTALLY + : wxCBAR_DOCKED_VERTICALLY; + } - // remove bar info from internal list + // remove bar info from internal list - wxNode* pNext = pNode->Next(); + wxNode* pNext = pNode->Next(); - delete pHBInfo; - mHiddenBars.DeleteNode( pNode ); + delete pHBInfo; + mHiddenBars.DeleteNode( pNode ); - pNode = pNext; - } - else - { - // decrease incon numbers with higher indicies, since this - // row is now removed from the hidden-rows list + pNode = pNext; + } + else + { + // decrease incon numbers with higher indicies, since this + // row is now removed from the hidden-rows list - if ( pHBInfo->mIconNo > collapsedIconIdx && - pHBInfo->mAlignment == mpPane->mAlignment ) + if ( pHBInfo->mIconNo > collapsedIconIdx && + pHBInfo->mAlignment == mpPane->mAlignment ) - --pHBInfo->mIconNo; + --pHBInfo->mIconNo; - pNode = pNode->Next(); - } - } + pNode = pNode->Next(); + } + } - mpPane->InitLinksForRow( pNewRow ); + mpPane->InitLinksForRow( pNewRow ); - // insert row into pane at it's original position + // insert row into pane at it's original position - if ( pNewRow->mBars.GetCount() ) - { - cbRowInfo* beforeRowNode = mpPane->GetRow( rowNo ); + if ( pNewRow->mBars.GetCount() ) + { + cbRowInfo* beforeRowNode = mpPane->GetRow( rowNo ); - mpPane->InsertRow( pNewRow, beforeRowNode ); - } - else - delete pNewRow; + mpPane->InsertRow( pNewRow, beforeRowNode ); + } + else + delete pNewRow; - SetPaneMargins(); + SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(FALSE); - mCollapsedIconInFocus = -1; + mCollapsedIconInFocus = -1; - mpLayout->GetUpdatesManager().OnFinishChanges(); - mpLayout->GetUpdatesManager().UpdateNow(); + mpLayout->GetUpdatesManager().OnFinishChanges(); + mpLayout->GetUpdatesManager().UpdateNow(); - /* - wxNode* pRowNode = mHiddenRows.Nth( collapsedIconIdx ); + /* + wxNode* pRowNode = mHiddenRows.Nth( collapsedIconIdx ); - mpLayout->GetUpdatesManager().OnStartChanges(); + mpLayout->GetUpdatesManager().OnStartChanges(); - // insert at the end of rows list - mpPane->InsertRow( pRowNode, NULL ); + // insert at the end of rows list + mpPane->InsertRow( pRowNode, NULL ); - int success = mHiddenRows.DeleteNode( pRowNode ); - // DBG:: - wxASSERT( success ); + int success = mHiddenRows.DeleteNode( pRowNode ); + // DBG:: + wxASSERT( success ); - SetPaneMargins(); + SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(FALSE); - mCollapsedIconInFocus = -1; + mCollapsedIconInFocus = -1; - mpLayout->GetUpdatesManager().OnFinishChanges(); - mpLayout->GetUpdatesManager().UpdateNow(); - */ + mpLayout->GetUpdatesManager().OnFinishChanges(); + mpLayout->GetUpdatesManager().UpdateNow(); + */ } void cbRowDragPlugin::InsertDraggedRowBefore( cbRowInfo* pBeforeRow ) { - if ( mpRowInFocus != pBeforeRow && - mpRowInFocus->mpNext != pBeforeRow - ) - { - mpPane->GetRowList().Remove( mpRowInFocus ); - - mpPane->InsertRow( mpRowInFocus, pBeforeRow ); - } - else - { - // otherwise, nothing has happned (row positions do not change) - - //wxClientDC dc( &mpLayout->GetParentFrame() ); - - //mpPane->PaintRow( mpRowInFocus, dc ); - //DrawRowDragHint( mpRowInFocus, dc, FALSE ); - } + if ( mpRowInFocus != pBeforeRow && + mpRowInFocus->mpNext != pBeforeRow + ) + { + mpPane->GetRowList().Remove( mpRowInFocus ); + + mpPane->InsertRow( mpRowInFocus, pBeforeRow ); + } + else + { + // otherwise, nothing has happned (row positions do not change) + + //wxClientDC dc( &mpLayout->GetParentFrame() ); + + //mpPane->PaintRow( mpRowInFocus, dc ); + //DrawRowDragHint( mpRowInFocus, dc, FALSE ); + } } bool cbRowDragPlugin::ItemIsInFocus() { - return ( mpRowInFocus || mCollapsedIconInFocus != - 1 ); + return ( mpRowInFocus || mCollapsedIconInFocus != - 1 ); } void cbRowDragPlugin::CheckPrevItemInFocus( cbRowInfo* pRow, int iconIdx ) { - wxClientDC dc( &mpLayout->GetParentFrame() ); + wxClientDC dc( &mpLayout->GetParentFrame() ); - if ( pRow != NULL && mpRowInFocus == pRow ) return; - if ( iconIdx != -1 && mCollapsedIconInFocus == iconIdx ) return; + if ( pRow != NULL && mpRowInFocus == pRow ) return; + if ( iconIdx != -1 && mCollapsedIconInFocus == iconIdx ) return; - UnhiglightItemInFocus(); + UnhighlightItemInFocus(); - if ( iconIdx != - 1 ) - - DrawCollapsedRowIcon( iconIdx, dc, TRUE ); + if ( iconIdx != - 1 ) + + DrawCollapsedRowIcon( iconIdx, dc, TRUE ); - else - if ( pRow != NULL ) + else + if ( pRow != NULL ) - DrawRowDragHint( pRow, dc, TRUE ); + DrawRowDragHint( pRow, dc, TRUE ); } cbRowInfo* cbRowDragPlugin::GetFirstRow() { - return ( mpPane->GetRowList().GetCount() ) - ? mpPane->GetRowList()[0] - : NULL; + return ( mpPane->GetRowList().GetCount() ) + ? mpPane->GetRowList()[0] + : NULL; } /*** "hard-coded" metafile for NN-look ***/ void cbRowDragPlugin::DrawTrianUp( wxRect& inRect, wxDC& dc ) { - int xOfs = (inRect.width - ICON_TRIAN_WIDTH)/2; + int xOfs = (inRect.width - ICON_TRIAN_WIDTH)/2; - wxBrush br( mTrianInnerColor, wxSOLID ); + wxBrush br( mTrianInnerColor, wxSOLID ); - dc.SetBrush( br ); - dc.SetPen( mpLayout->mBlackPen ); + dc.SetBrush( br ); + dc.SetPen( mpLayout->mBlackPen ); - wxPoint points[3]; - points[0].x = inRect.x + xOfs; - points[0].y = inRect.y + inRect.height - 1; - points[1].x = inRect.x + xOfs + ICON_TRIAN_WIDTH/2 + 1; - points[1].y = inRect.y + inRect.height - 2 - ICON_TRIAN_HEIGHT; - points[2].x = inRect.x + xOfs + ICON_TRIAN_WIDTH+1; - points[2].y = inRect.y + inRect.height - 1; + wxPoint points[3]; + points[0].x = inRect.x + xOfs; + points[0].y = inRect.y + inRect.height - 1; + points[1].x = inRect.x + xOfs + ICON_TRIAN_WIDTH/2 + 1; + points[1].y = inRect.y + inRect.height - 2 - ICON_TRIAN_HEIGHT; + points[2].x = inRect.x + xOfs + ICON_TRIAN_WIDTH+1; + points[2].y = inRect.y + inRect.height - 1; - dc.DrawPolygon( 3, points ); + dc.DrawPolygon( 3, points ); - // higlight upper-right edge of triangle - dc.SetPen( mpLayout->mLightPen ); - dc.DrawLine( points[2].x, points[2].y, - points[0].x, points[0].y ); + // higlight upper-right edge of triangle + dc.SetPen( mpLayout->mLightPen ); + dc.DrawLine( points[2].x, points[2].y, + points[0].x, points[0].y ); - dc.SetBrush( wxNullBrush ); + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::DrawTrianDown( wxRect& inRect, wxDC& dc ) { - int xOfs = (inRect.width - ICON_TRIAN_WIDTH)/2; + int xOfs = (inRect.width - ICON_TRIAN_WIDTH)/2; - wxBrush br( mTrianInnerColor, wxSOLID ); + wxBrush br( mTrianInnerColor, wxSOLID ); - dc.SetBrush( br ); - dc.SetPen( mpLayout->mBlackPen ); + dc.SetBrush( br ); + dc.SetPen( mpLayout->mBlackPen ); - wxPoint points[3]; - points[0].x = inRect.x + xOfs; - points[0].y = inRect.y; - points[1].x = inRect.x + xOfs + ICON_TRIAN_WIDTH; - points[1].y = inRect.y; - points[2].x = inRect.x + xOfs + ICON_TRIAN_WIDTH/2; - points[2].y = inRect.y + ICON_TRIAN_HEIGHT; + wxPoint points[3]; + points[0].x = inRect.x + xOfs; + points[0].y = inRect.y; + points[1].x = inRect.x + xOfs + ICON_TRIAN_WIDTH; + points[1].y = inRect.y; + points[2].x = inRect.x + xOfs + ICON_TRIAN_WIDTH/2; + points[2].y = inRect.y + ICON_TRIAN_HEIGHT; - dc.DrawPolygon( 3, points ); + dc.DrawPolygon( 3, points ); - // higlight upper-right edge of triangle - dc.SetPen( mpLayout->mLightPen ); - dc.DrawLine( points[2].x, points[2].y, - points[1].x, points[1].y ); + // higlight upper-right edge of triangle + dc.SetPen( mpLayout->mLightPen ); + dc.DrawLine( points[2].x, points[2].y, + points[1].x, points[1].y ); - dc.SetBrush( wxNullBrush ); + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::DrawTrianRight( wxRect& inRect, wxDC& dc ) { - int yOfs = (inRect.height - ICON_TRIAN_WIDTH)/2; + int yOfs = (inRect.height - ICON_TRIAN_WIDTH)/2; - wxBrush br( mTrianInnerColor, wxSOLID ); + wxBrush br( mTrianInnerColor, wxSOLID ); - dc.SetBrush( br ); - dc.SetPen( mpLayout->mBlackPen ); + dc.SetBrush( br ); + dc.SetPen( mpLayout->mBlackPen ); - wxPoint points[3]; - points[0].x = inRect.x; - points[0].y = inRect.y + yOfs + ICON_TRIAN_WIDTH; - points[1].x = inRect.x; - points[1].y = inRect.y + yOfs; - points[2].x = inRect.x + ICON_TRIAN_HEIGHT; - points[2].y = inRect.y + yOfs + ICON_TRIAN_WIDTH/2; + wxPoint points[3]; + points[0].x = inRect.x; + points[0].y = inRect.y + yOfs + ICON_TRIAN_WIDTH; + points[1].x = inRect.x; + points[1].y = inRect.y + yOfs; + points[2].x = inRect.x + ICON_TRIAN_HEIGHT; + points[2].y = inRect.y + yOfs + ICON_TRIAN_WIDTH/2; - dc.DrawPolygon( 3, points ); + dc.DrawPolygon( 3, points ); - // higlight upper-right edge of triangle - dc.SetPen( mpLayout->mLightPen ); - dc.DrawLine( points[0].x, points[0].y, - points[2].x, points[2].y ); + // higlight upper-right edge of triangle + dc.SetPen( mpLayout->mLightPen ); + dc.DrawLine( points[0].x, points[0].y, + points[2].x, points[2].y ); - dc.SetBrush( wxNullBrush ); + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::Draw3DPattern( wxRect& inRect, wxDC& dc ) { - for( int y = inRect.y; y < inRect.y + inRect.height; y+=3 ) - - for( int x = inRect.x; x < inRect.x + inRect.width; x+=3 ) - { - dc.SetPen( mpLayout->mLightPen ); - dc.DrawPoint( x,y ); - dc.SetPen( mpLayout->mBlackPen ); - dc.DrawPoint( x+1, y+1 ); - } + for( int y = inRect.y; y < inRect.y + inRect.height; y+=3 ) + + for( int x = inRect.x; x < inRect.x + inRect.width; x+=3 ) + { + dc.SetPen( mpLayout->mLightPen ); + dc.DrawPoint( x,y ); + dc.SetPen( mpLayout->mBlackPen ); + dc.DrawPoint( x+1, y+1 ); + } } void cbRowDragPlugin::DrawRombShades( wxPoint& p1, wxPoint& p2, - wxPoint& p3, wxPoint& p4, - wxDC& dc ) + wxPoint& p3, wxPoint& p4, + wxDC& dc ) { - dc.SetPen( mpLayout->mLightPen ); - dc.DrawLine( p1.x, p1.y, p2.x, p2.y ); - dc.DrawLine( p2.x, p2.y, p3.x, p3.y ); - dc.SetPen( mpLayout->mDarkPen ); - dc.DrawLine( p3.x, p3.y, p4.x, p4.y ); - dc.DrawLine( p4.x, p4.y, p1.x, p1.y ); + dc.SetPen( mpLayout->mLightPen ); + dc.DrawLine( p1.x, p1.y, p2.x, p2.y ); + dc.DrawLine( p2.x, p2.y, p3.x, p3.y ); + dc.SetPen( mpLayout->mDarkPen ); + dc.DrawLine( p3.x, p3.y, p4.x, p4.y ); + dc.DrawLine( p4.x, p4.y, p1.x, p1.y ); } void cbRowDragPlugin::DrawOrtoRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ) { - dc.SetBrush( bkBrush ); - dc.SetPen( mpLayout->mBlackPen ); - - wxPoint points[4]; - - if ( inRect.width > inRect.height ) - { - // horizontal orienation - points[0].x = inRect.x; - points[0].y = inRect.y + inRect.height; - points[1].x = inRect.x; - points[1].y = inRect.y; - points[2].x = inRect.x + inRect.width; - points[2].y = inRect.y; - points[3].x = inRect.x + inRect.width - COLLAPSED_ICON_HEIGHT; - points[3].y = inRect.y + inRect.height; - - dc.DrawPolygon( 4, points ); - - // squeeze romb's bounds to create an inner-shade shape - ++points[0].x; - --points[0].y; - ++points[1].x; - ++points[1].y; - --points[2].x; --points[2].x; - ++points[2].y; - --points[3].y; - - DrawRombShades( points[0], points[1], points[2], points[3], dc ); - } - else - { - // vertical orientation - points[0].x = inRect.x + inRect.width; - points[0].y = inRect.y + inRect.height; - points[1].x = inRect.x; - points[1].y = inRect.y + inRect.height; - points[2].x = inRect.x; - points[2].y = inRect.y; - points[3].x = inRect.x + inRect.width; - points[3].y = inRect.y + COLLAPSED_ICON_HEIGHT; - - dc.DrawPolygon( 4, points ); - - // squeeze romb's bounds to create an inner-shade shape - --points[0].y ; - --points[0].x; - ++points[1].x; - --points[1].y; - ++points[2].y; ++points[2].y; - ++points[2].x; - --points[3].x; - - DrawRombShades( points[1], points[2], points[3], points[0], dc ); - } - - dc.SetBrush( wxNullBrush ); + dc.SetBrush( bkBrush ); + dc.SetPen( mpLayout->mBlackPen ); + + wxPoint points[4]; + + if ( inRect.width > inRect.height ) + { + // horizontal orienation + points[0].x = inRect.x; + points[0].y = inRect.y + inRect.height; + points[1].x = inRect.x; + points[1].y = inRect.y; + points[2].x = inRect.x + inRect.width; + points[2].y = inRect.y; + points[3].x = inRect.x + inRect.width - COLLAPSED_ICON_HEIGHT; + points[3].y = inRect.y + inRect.height; + + dc.DrawPolygon( 4, points ); + + // squeeze romb's bounds to create an inner-shade shape + ++points[0].x; + --points[0].y; + ++points[1].x; + ++points[1].y; + --points[2].x; --points[2].x; + ++points[2].y; + --points[3].y; + + DrawRombShades( points[0], points[1], points[2], points[3], dc ); + } + else + { + // vertical orientation + points[0].x = inRect.x + inRect.width; + points[0].y = inRect.y + inRect.height; + points[1].x = inRect.x; + points[1].y = inRect.y + inRect.height; + points[2].x = inRect.x; + points[2].y = inRect.y; + points[3].x = inRect.x + inRect.width; + points[3].y = inRect.y + COLLAPSED_ICON_HEIGHT; + + dc.DrawPolygon( 4, points ); + + // squeeze romb's bounds to create an inner-shade shape + --points[0].y ; + --points[0].x; + ++points[1].x; + --points[1].y; + ++points[2].y; ++points[2].y; + ++points[2].x; + --points[3].x; + + DrawRombShades( points[1], points[2], points[3], points[0], dc ); + } + + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::DrawRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ) { - wxPoint points[4]; - - dc.SetBrush( bkBrush ); - dc.SetPen( mpLayout->mBlackPen ); - - if ( inRect.width > inRect.height ) - { - // horizontal orientation - points[0].x = inRect.x; - points[0].y = inRect.y + inRect.height; - points[1].x = inRect.x + COLLAPSED_ICON_HEIGHT; - points[1].y = inRect.y; - points[2].x = inRect.x + inRect.width; - points[2].y = inRect.y; - points[3].x = inRect.x + inRect.width - COLLAPSED_ICON_HEIGHT; - points[3].y = inRect.y + inRect.height; - - dc.DrawPolygon( 4, points ); - - // squeeze romb's bounds to create an inner-shade shape - ++points[0].x ;++points[0].x ; - --points[0].y; - ++points[1].y; - --points[2].x; --points[2].x; - ++points[2].y; - //--points[3].x ; - --points[3].y; - - DrawRombShades( points[0], points[1], points[2], points[3], dc ); - - } - else - { - // vertical orientation - points[0].x = inRect.x + inRect.width; - points[0].y = inRect.y + inRect.height; - points[1].x = inRect.x; - points[1].y = inRect.y + inRect.height - COLLAPSED_ICON_HEIGHT; - points[2].x = inRect.x; - points[2].y = inRect.y; - points[3].x = inRect.x + inRect.width; - points[3].y = inRect.y + COLLAPSED_ICON_HEIGHT; - - dc.DrawPolygon( 4, points ); - - // squeeze romb's bounds to create an inner-shade shape - --points[0].y ;--points[0].y ; - --points[0].x; - ++points[1].x; - ++points[2].y; ++points[2].y; - ++points[2].x; - --points[3].x; - - DrawRombShades( points[1], points[2], points[3], points[0], dc ); - } - - dc.SetBrush( wxNullBrush ); + wxPoint points[4]; + + dc.SetBrush( bkBrush ); + dc.SetPen( mpLayout->mBlackPen ); + + if ( inRect.width > inRect.height ) + { + // horizontal orientation + points[0].x = inRect.x; + points[0].y = inRect.y + inRect.height; + points[1].x = inRect.x + COLLAPSED_ICON_HEIGHT; + points[1].y = inRect.y; + points[2].x = inRect.x + inRect.width; + points[2].y = inRect.y; + points[3].x = inRect.x + inRect.width - COLLAPSED_ICON_HEIGHT; + points[3].y = inRect.y + inRect.height; + + dc.DrawPolygon( 4, points ); + + // squeeze romb's bounds to create an inner-shade shape + ++points[0].x ;++points[0].x ; + --points[0].y; + ++points[1].y; + --points[2].x; --points[2].x; + ++points[2].y; + //--points[3].x ; + --points[3].y; + + DrawRombShades( points[0], points[1], points[2], points[3], dc ); + + } + else + { + // vertical orientation + points[0].x = inRect.x + inRect.width; + points[0].y = inRect.y + inRect.height; + points[1].x = inRect.x; + points[1].y = inRect.y + inRect.height - COLLAPSED_ICON_HEIGHT; + points[2].x = inRect.x; + points[2].y = inRect.y; + points[3].x = inRect.x + inRect.width; + points[3].y = inRect.y + COLLAPSED_ICON_HEIGHT; + + dc.DrawPolygon( 4, points ); + + // squeeze romb's bounds to create an inner-shade shape + --points[0].y ;--points[0].y ; + --points[0].x; + ++points[1].x; + ++points[2].y; ++points[2].y; + ++points[2].x; + --points[3].x; + + DrawRombShades( points[1], points[2], points[3], points[0], dc ); + } + + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::DrawRectShade( wxRect& inRect, wxDC& dc, - int level, wxPen& upperPen, wxPen& lowerPen ) + int level, wxPen& upperPen, wxPen& lowerPen ) { - // upper shade - dc.SetPen( upperPen ); - dc.DrawLine( inRect.x - level, - inRect.y - level, - inRect.x + inRect.width - 1 + level, - inRect.y - level); - dc.DrawLine( inRect.x - level, inRect.y - level, - inRect.x - level, inRect.y + inRect.height - 1 + level ); - - // lower shade - dc.SetPen( lowerPen ); - dc.DrawLine( inRect.x - level, - inRect.y + inRect.height - 1 + level, - inRect.x + inRect.width + level, - inRect.y + inRect.height - 1 + level); - dc.DrawLine( inRect.x + inRect.width - 1 + level, - inRect.y - level, - inRect.x + inRect.width - 1 + level, - inRect.y + inRect.height + level); - - dc.SetBrush( wxNullBrush ); + // upper shade + dc.SetPen( upperPen ); + dc.DrawLine( inRect.x - level, + inRect.y - level, + inRect.x + inRect.width - 1 + level, + inRect.y - level); + dc.DrawLine( inRect.x - level, inRect.y - level, + inRect.x - level, inRect.y + inRect.height - 1 + level ); + + // lower shade + dc.SetPen( lowerPen ); + dc.DrawLine( inRect.x - level, + inRect.y + inRect.height - 1 + level, + inRect.x + inRect.width + level, + inRect.y + inRect.height - 1 + level); + dc.DrawLine( inRect.x + inRect.width - 1 + level, + inRect.y - level, + inRect.x + inRect.width - 1 + level, + inRect.y + inRect.height + level); + + dc.SetBrush( wxNullBrush ); } void cbRowDragPlugin::Draw3DRect( wxRect& inRect, wxDC& dc, wxBrush& bkBrush ) { - dc.SetPen( mpLayout->mNullPen ); - dc.SetBrush( bkBrush ); + dc.SetPen( mpLayout->mNullPen ); + dc.SetBrush( bkBrush ); - dc.DrawRectangle( inRect.x, inRect.y, - inRect.width, inRect.height ); + dc.DrawRectangle( inRect.x, inRect.y, + inRect.width, inRect.height ); - DrawRectShade( inRect, dc, 0, mpLayout->mLightPen, mpLayout->mDarkPen ); + DrawRectShade( inRect, dc, 0, mpLayout->mLightPen, mpLayout->mDarkPen ); } int cbRowDragPlugin::GetCollapsedIconsPos() { - RowArrayT& rows = mpPane->GetRowList(); + RowArrayT& rows = mpPane->GetRowList(); - if ( rows.GetCount() == 0 ) - { - if ( mpPane->IsHorizontal() ) - - return mpPane->mBoundsInParent.y + mpPane->mTopMargin; - else - return mpPane->mBoundsInParent.x + mpPane->mLeftMargin; - } + if ( rows.GetCount() == 0 ) + { + if ( mpPane->IsHorizontal() ) + + return mpPane->mBoundsInParent.y + mpPane->mTopMargin; + else + return mpPane->mBoundsInParent.x + mpPane->mLeftMargin; + } - wxRect& bounds = rows[ rows.GetCount() - 1 ]->mBoundsInParent; + wxRect& bounds = rows[ rows.GetCount() - 1 ]->mBoundsInParent; - if ( mpPane->IsHorizontal() ) + if ( mpPane->IsHorizontal() ) - return bounds.y + bounds.height + 1; - else - return bounds.x + bounds.width + 1; + return bounds.y + bounds.height + 1; + else + return bounds.x + bounds.width + 1; } void cbRowDragPlugin::GetRowHintRect( cbRowInfo* pRow, wxRect& rect ) { - wxRect& bounds = pRow->mBoundsInParent; - - if ( mpPane->IsHorizontal() ) - { - rect.x = bounds.x - ROW_DRAG_HINT_WIDTH - 1; - rect.y = bounds.y; - rect.width = ROW_DRAG_HINT_WIDTH; - rect.height = bounds.height; - } - else - { - rect.x = bounds.x; - rect.y = bounds.y + bounds.height + 1; - rect.width = bounds.width; - rect.height = ROW_DRAG_HINT_WIDTH; - } + wxRect& bounds = pRow->mBoundsInParent; + + if ( mpPane->IsHorizontal() ) + { + rect.x = bounds.x - ROW_DRAG_HINT_WIDTH - 1; + rect.y = bounds.y; + rect.width = ROW_DRAG_HINT_WIDTH; + rect.height = bounds.height; + } + else + { + rect.x = bounds.x; + rect.y = bounds.y + bounds.height + 1; + rect.width = bounds.width; + rect.height = ROW_DRAG_HINT_WIDTH; + } } void cbRowDragPlugin::GetCollapsedInconRect( int iconIdx, wxRect& rect ) { - int upper = GetCollapsedIconsPos(); - - int right = (iconIdx == 0 ) - ? 0 : iconIdx * (COLLAPSED_ICON_WIDTH - COLLAPSED_ICON_HEIGHT); - - if ( mpPane->IsHorizontal() ) - { - rect.x = mpPane->mBoundsInParent.x + mpPane->mLeftMargin - ROW_DRAG_HINT_WIDTH - 1 - + right; - - rect.y = upper; - rect.width = COLLAPSED_ICON_WIDTH; - rect.height = COLLAPSED_ICON_HEIGHT; - } - else - { - rect.x = upper; - rect.y = mpPane->mBoundsInParent.y + mpPane->mBoundsInParent.height - - mpPane->mBottomMargin + ROW_DRAG_HINT_WIDTH + 1 - - right - COLLAPSED_ICON_WIDTH; - - rect.height = COLLAPSED_ICON_WIDTH; - rect.width = COLLAPSED_ICON_HEIGHT; - } + int upper = GetCollapsedIconsPos(); + + int right = (iconIdx == 0 ) + ? 0 : iconIdx * (COLLAPSED_ICON_WIDTH - COLLAPSED_ICON_HEIGHT); + + if ( mpPane->IsHorizontal() ) + { + rect.x = mpPane->mBoundsInParent.x + mpPane->mLeftMargin - ROW_DRAG_HINT_WIDTH - 1 + + right; + + rect.y = upper; + rect.width = COLLAPSED_ICON_WIDTH; + rect.height = COLLAPSED_ICON_HEIGHT; + } + else + { + rect.x = upper; + rect.y = mpPane->mBoundsInParent.y + mpPane->mBoundsInParent.height + - mpPane->mBottomMargin + ROW_DRAG_HINT_WIDTH + 1 + - right - COLLAPSED_ICON_WIDTH; + + rect.height = COLLAPSED_ICON_WIDTH; + rect.width = COLLAPSED_ICON_HEIGHT; + } } /*** overridables ***/ void cbRowDragPlugin::DrawCollapsedRowIcon( int index, wxDC& dc, bool isHighlighted ) { - wxRect rect; - GetCollapsedInconRect( index, rect ); + wxRect rect; + GetCollapsedInconRect( index, rect ); - wxBrush hiBrush ( mHightColor, wxSOLID ); - wxBrush lowBrush( mLowColor, wxSOLID ); - wxBrush& curBrush = ( isHighlighted ) ? hiBrush : lowBrush; + wxBrush hiBrush ( mHightColor, wxSOLID ); + wxBrush lowBrush( mLowColor, wxSOLID ); + wxBrush& curBrush = ( isHighlighted ) ? hiBrush : lowBrush; - if ( mpPane->IsHorizontal() ) - { - if ( index == 0 ) + if ( mpPane->IsHorizontal() ) + { + if ( index == 0 ) - DrawOrtoRomb( rect, dc, curBrush ); - else - DrawRomb( rect, dc, curBrush ); + DrawOrtoRomb( rect, dc, curBrush ); + else + DrawRomb( rect, dc, curBrush ); - int triOfs = (index == 0) ? TRIANGLE_OFFSET : TRIANGLE_OFFSET + COLLAPSED_ICON_HEIGHT; + int triOfs = (index == 0) ? TRIANGLE_OFFSET : TRIANGLE_OFFSET + COLLAPSED_ICON_HEIGHT; - wxRect triRect; - triRect.x = triOfs + rect.x; + wxRect triRect; + triRect.x = triOfs + rect.x; - triRect.width = ICON_TRIAN_HEIGHT; - triRect.y = rect.y; - triRect.height = rect.height; + triRect.width = ICON_TRIAN_HEIGHT; + triRect.y = rect.y; + triRect.height = rect.height; - DrawTrianRight( triRect, dc ); + DrawTrianRight( triRect, dc ); - wxRect patRect; - patRect.x = triOfs + ICON_TRIAN_HEIGHT + TRIANGLE_TO_PAT_GAP + rect.x; - patRect.y = rect.y + PAT_OFFSET; - patRect.width = rect.width - (patRect.x - rect.x) - COLLAPSED_ICON_HEIGHT - PAT_OFFSET; - patRect.height = rect.height - PAT_OFFSET*2; + wxRect patRect; + patRect.x = triOfs + ICON_TRIAN_HEIGHT + TRIANGLE_TO_PAT_GAP + rect.x; + patRect.y = rect.y + PAT_OFFSET; + patRect.width = rect.width - (patRect.x - rect.x) - COLLAPSED_ICON_HEIGHT - PAT_OFFSET; + patRect.height = rect.height - PAT_OFFSET*2; - Draw3DPattern( patRect, dc ); - } - else - { - if ( index == 0 ) + Draw3DPattern( patRect, dc ); + } + else + { + if ( index == 0 ) - DrawOrtoRomb( rect, dc, curBrush ); - else - DrawRomb( rect, dc, curBrush ); + DrawOrtoRomb( rect, dc, curBrush ); + else + DrawRomb( rect, dc, curBrush ); - int triOfs = (index == 0) - ? TRIANGLE_OFFSET + ICON_TRIAN_HEIGHT - : TRIANGLE_OFFSET + COLLAPSED_ICON_HEIGHT + ICON_TRIAN_HEIGHT; + int triOfs = (index == 0) + ? TRIANGLE_OFFSET + ICON_TRIAN_HEIGHT + : TRIANGLE_OFFSET + COLLAPSED_ICON_HEIGHT + ICON_TRIAN_HEIGHT; - wxRect triRect; - triRect.y = rect.y + rect.height - triOfs; - triRect.x = rect.x; - triRect.width = rect.width; - triRect.height = ICON_TRIAN_HEIGHT; + wxRect triRect; + triRect.y = rect.y + rect.height - triOfs; + triRect.x = rect.x; + triRect.width = rect.width; + triRect.height = ICON_TRIAN_HEIGHT; - DrawTrianUp( triRect, dc ); + DrawTrianUp( triRect, dc ); - wxRect patRect; - patRect.y = rect.y + COLLAPSED_ICON_HEIGHT + PAT_OFFSET; - patRect.x = rect.x + PAT_OFFSET; - patRect.width = rect.width - 2*PAT_OFFSET ; - patRect.height = rect.height - triOfs - 2*PAT_OFFSET - COLLAPSED_ICON_HEIGHT; + wxRect patRect; + patRect.y = rect.y + COLLAPSED_ICON_HEIGHT + PAT_OFFSET; + patRect.x = rect.x + PAT_OFFSET; + patRect.width = rect.width - 2*PAT_OFFSET ; + patRect.height = rect.height - triOfs - 2*PAT_OFFSET - COLLAPSED_ICON_HEIGHT; - Draw3DPattern( patRect, dc ); - } + Draw3DPattern( patRect, dc ); + } } void cbRowDragPlugin::DrawRowDragHint( cbRowInfo* pRow , wxDC& dc, bool isHighlighted ) { - wxRect rect; - GetRowHintRect( pRow, rect ); - - wxBrush hiBrush ( mHightColor, wxSOLID ); - wxBrush lowBrush( mLowColor, wxSOLID ); - wxBrush& curBrush = ( isHighlighted ) ? hiBrush : lowBrush; - - Draw3DRect( rect, dc, curBrush ); - - if ( mpPane->IsHorizontal() ) - { - wxRect triRect; - triRect.y = rect.y + TRIANGLE_OFFSET; - triRect.x = rect.x; - triRect.width = rect.width; - triRect.height = ICON_TRIAN_HEIGHT; - - DrawTrianDown( triRect, dc ); - - wxRect patRect; - patRect.x = rect.x + PAT_OFFSET; - patRect.y = rect.y + TRIANGLE_OFFSET + ICON_TRIAN_HEIGHT + TRIANGLE_TO_PAT_GAP; - patRect.width = rect.width - 2*PAT_OFFSET; - patRect.height = rect.height - ( patRect.y - rect.y ) - PAT_OFFSET; - Draw3DPattern( patRect, dc ); - - dc.SetPen( mpLayout->mLightPen ); - dc.DrawLine( rect.x, rect.y + rect.height, rect.x + rect.width, rect.y + rect.height ); - } - else - { - wxRect triRect; - triRect.x = rect.x + TRIANGLE_OFFSET; - triRect.y = rect.y; - triRect.height = rect.height; - triRect.width = ICON_TRIAN_HEIGHT; - - DrawTrianRight( triRect, dc ); - - wxRect patRect; - patRect.y = rect.y + PAT_OFFSET; - patRect.x = rect.x + TRIANGLE_OFFSET + ICON_TRIAN_HEIGHT + TRIANGLE_TO_PAT_GAP; - patRect.height = rect.height - 2*PAT_OFFSET; - patRect.width = rect.width - ( patRect.x - rect.x ) - PAT_OFFSET; - Draw3DPattern( patRect, dc ); - - dc.SetPen( mpLayout->mLightPen ); - dc.DrawLine( rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + rect.height ); - } + wxRect rect; + GetRowHintRect( pRow, rect ); + + wxBrush hiBrush ( mHightColor, wxSOLID ); + wxBrush lowBrush( mLowColor, wxSOLID ); + wxBrush& curBrush = ( isHighlighted ) ? hiBrush : lowBrush; + + Draw3DRect( rect, dc, curBrush ); + + if ( mpPane->IsHorizontal() ) + { + wxRect triRect; + triRect.y = rect.y + TRIANGLE_OFFSET; + triRect.x = rect.x; + triRect.width = rect.width; + triRect.height = ICON_TRIAN_HEIGHT; + + DrawTrianDown( triRect, dc ); + + wxRect patRect; + patRect.x = rect.x + PAT_OFFSET; + patRect.y = rect.y + TRIANGLE_OFFSET + ICON_TRIAN_HEIGHT + TRIANGLE_TO_PAT_GAP; + patRect.width = rect.width - 2*PAT_OFFSET; + patRect.height = rect.height - ( patRect.y - rect.y ) - PAT_OFFSET; + Draw3DPattern( patRect, dc ); + + dc.SetPen( mpLayout->mLightPen ); + dc.DrawLine( rect.x, rect.y + rect.height, rect.x + rect.width, rect.y + rect.height ); + } + else + { + wxRect triRect; + triRect.x = rect.x + TRIANGLE_OFFSET; + triRect.y = rect.y; + triRect.height = rect.height; + triRect.width = ICON_TRIAN_HEIGHT; + + DrawTrianRight( triRect, dc ); + + wxRect patRect; + patRect.y = rect.y + PAT_OFFSET; + patRect.x = rect.x + TRIANGLE_OFFSET + ICON_TRIAN_HEIGHT + TRIANGLE_TO_PAT_GAP; + patRect.height = rect.height - 2*PAT_OFFSET; + patRect.width = rect.width - ( patRect.x - rect.x ) - PAT_OFFSET; + Draw3DPattern( patRect, dc ); + + dc.SetPen( mpLayout->mLightPen ); + dc.DrawLine( rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + rect.height ); + } } void cbRowDragPlugin::DrawRowsDragHintsBorder( wxDC& dc ) { - // FIXME:: what was that? + // FIXME:: what was that? } void cbRowDragPlugin::DrawCollapsedRowsBorder( wxDC& dc ) { - int colRowOfs = GetCollapsedIconsPos(); - wxRect& bounds = mpPane->mBoundsInParent; - - wxBrush bkBrush( mpLayout->mGrayPen.GetColour(), wxSOLID ); - dc.SetBrush( bkBrush ); - dc.SetPen( mpLayout->mDarkPen ); - - if ( mpPane->IsHorizontal() ) - - dc.DrawRectangle( bounds.x + mpPane->mLeftMargin - ROW_DRAG_HINT_WIDTH - 1, - colRowOfs, - bounds.width - mpPane->mLeftMargin - mpPane->mRightMargin + 2 + ROW_DRAG_HINT_WIDTH, - COLLAPSED_ICON_HEIGHT + 1); - else - dc.DrawRectangle( colRowOfs, - bounds.y + mpPane->mTopMargin - 1, - COLLAPSED_ICON_HEIGHT + 1, - bounds.height - mpPane->mTopMargin - mpPane->mBottomMargin - - ROW_DRAG_HINT_WIDTH - 2 ); - - dc.SetBrush( wxNullBrush ); + int colRowOfs = GetCollapsedIconsPos(); + wxRect& bounds = mpPane->mBoundsInParent; + + wxBrush bkBrush( mpLayout->mGrayPen.GetColour(), wxSOLID ); + dc.SetBrush( bkBrush ); + dc.SetPen( mpLayout->mDarkPen ); + + if ( mpPane->IsHorizontal() ) + + dc.DrawRectangle( bounds.x + mpPane->mLeftMargin - ROW_DRAG_HINT_WIDTH - 1, + colRowOfs, + bounds.width - mpPane->mLeftMargin - mpPane->mRightMargin + 2 + ROW_DRAG_HINT_WIDTH, + COLLAPSED_ICON_HEIGHT + 1); + else + dc.DrawRectangle( colRowOfs, + bounds.y + mpPane->mTopMargin - 1, + COLLAPSED_ICON_HEIGHT + 1, + bounds.height - mpPane->mTopMargin - mpPane->mBottomMargin + - ROW_DRAG_HINT_WIDTH - 2 ); + + dc.SetBrush( wxNullBrush ); } static inline bool rect_contains_point( const wxRect& rect, int x, int y ) { - return ( x >= rect.x && - y >= rect.y && - x < rect.x + rect.width && - y < rect.y + rect.height ); + return ( x >= rect.x && + y >= rect.y && + x < rect.x + rect.width && + y < rect.y + rect.height ); } bool cbRowDragPlugin::HitTestCollapsedRowIcon( int iconIdx, const wxPoint& pos ) { - wxRect bounds; - GetCollapsedInconRect( iconIdx, bounds ); + wxRect bounds; + GetCollapsedInconRect( iconIdx, bounds ); - return rect_contains_point( bounds, pos.x, pos.y ); + return rect_contains_point( bounds, pos.x, pos.y ); } bool cbRowDragPlugin::HitTestRowDragHint( cbRowInfo* pRow, const wxPoint& pos ) { - wxRect bounds; - GetRowHintRect( pRow, bounds ); + wxRect bounds; + GetRowHintRect( pRow, bounds ); - return rect_contains_point( bounds, pos.x, pos.y ); + return rect_contains_point( bounds, pos.x, pos.y ); } diff --git a/contrib/src/fl/rowlayoutpl.cpp b/contrib/src/fl/rowlayoutpl.cpp index 064a35a67d..034284c6c4 100644 --- a/contrib/src/fl/rowlayoutpl.cpp +++ b/contrib/src/fl/rowlayoutpl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: rowlayoutpl.cpp +// Purpose: cbRowLayoutPlugin implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 09/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ diff --git a/contrib/src/fl/toolwnd.cpp b/contrib/src/fl/toolwnd.cpp index 4a97f944ca..1a8c7b617f 100644 --- a/contrib/src/fl/toolwnd.cpp +++ b/contrib/src/fl/toolwnd.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: toolwnd.cpp +// Purpose: wxToolWindow implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ diff --git a/contrib/src/fl/updatesmgr.cpp b/contrib/src/fl/updatesmgr.cpp index 426144840b..c126fbfb03 100644 --- a/contrib/src/fl/updatesmgr.cpp +++ b/contrib/src/fl/updatesmgr.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: updatesmgr.cpp +// Purpose: cbSimpleUpdatesMgr implementation. // Author: Aleksandras Gluchovas // Modified by: // Created: 19/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -30,15 +30,15 @@ static inline bool rect_hits_rect( const wxRect& r1, const wxRect& r2 ) { - if ( ( r2.x >= r1.x && r2.x <= r1.x + r1.width ) || - ( r1.x >= r2.x && r1.x <= r2.x + r2.width ) ) + if ( ( r2.x >= r1.x && r2.x <= r1.x + r1.width ) || + ( r1.x >= r2.x && r1.x <= r2.x + r2.width ) ) - if ( ( r2.y >= r1.y && r2.y <= r1.y + r1.height ) || - ( r1.y >= r2.y && r1.y <= r2.y + r2.height ) ) - - return 1; + if ( ( r2.y >= r1.y && r2.y <= r1.y + r1.height ) || + ( r1.y >= r2.y && r1.y <= r2.y + r2.height ) ) + + return 1; - return 0; + return 0; } /***** Implementation for class cbSimpleUpdatesMgr *****/ @@ -46,247 +46,247 @@ static inline bool rect_hits_rect( const wxRect& r1, const wxRect& r2 ) IMPLEMENT_DYNAMIC_CLASS( cbSimpleUpdatesMgr, cbUpdatesManagerBase ) cbSimpleUpdatesMgr::cbSimpleUpdatesMgr( wxFrameLayout* pPanel ) - : cbUpdatesManagerBase( pPanel ) + : cbUpdatesManagerBase( pPanel ) {} bool cbSimpleUpdatesMgr::WasChanged( cbUpdateMgrData& data, wxRect& currentBounds ) { - return ( data.IsDirty() || + return ( data.IsDirty() || - ( data.mPrevBounds.x != currentBounds.x || - data.mPrevBounds.y != currentBounds.y || - data.mPrevBounds.width != currentBounds.width || - data.mPrevBounds.height != currentBounds.height ) - ); + ( data.mPrevBounds.x != currentBounds.x || + data.mPrevBounds.y != currentBounds.y || + data.mPrevBounds.width != currentBounds.width || + data.mPrevBounds.height != currentBounds.height ) + ); } void cbSimpleUpdatesMgr::OnStartChanges() { - // memorize states of ALL items in the layout - - // this is quite excessive, but OK for the simple - // implementation of updates manager - - mpLayout->GetPrevClientRect() = mpLayout->GetClientRect(); - - cbDockPane** panes = mpLayout->GetPanesArray(); - - for( int n = 0; n != MAX_PANES; ++n ) - { - cbDockPane& pane = *panes[n]; - // store pane state - pane.mUMgrData.StoreItemState( pane.mBoundsInParent ); - pane.mUMgrData.SetDirty( FALSE ); - - for( size_t i = 0; i != pane.GetRowList().Count(); ++i ) - { - cbRowInfo& row = *pane.GetRowList()[ i ]; - - // store row state - row.mUMgrData.StoreItemState( row.mBoundsInParent ); - row.mUMgrData.SetDirty( FALSE ); - - for( size_t k = 0; k != row.mBars.Count(); ++k ) - { - cbBarInfo& bar = *row.mBars[ k ]; - - // store bar state - bar.mUMgrData.StoreItemState( bar.mBoundsInParent ); - bar.mUMgrData.SetDirty( FALSE ); - } - } - } + // memorize states of ALL items in the layout - + // this is quite excessive, but OK for the simple + // implementation of updates manager + + mpLayout->GetPrevClientRect() = mpLayout->GetClientRect(); + + cbDockPane** panes = mpLayout->GetPanesArray(); + + for( int n = 0; n != MAX_PANES; ++n ) + { + cbDockPane& pane = *panes[n]; + // store pane state + pane.mUMgrData.StoreItemState( pane.mBoundsInParent ); + pane.mUMgrData.SetDirty( FALSE ); + + for( size_t i = 0; i != pane.GetRowList().Count(); ++i ) + { + cbRowInfo& row = *pane.GetRowList()[ i ]; + + // store row state + row.mUMgrData.StoreItemState( row.mBoundsInParent ); + row.mUMgrData.SetDirty( FALSE ); + + for( size_t k = 0; k != row.mBars.Count(); ++k ) + { + cbBarInfo& bar = *row.mBars[ k ]; + + // store bar state + bar.mUMgrData.StoreItemState( bar.mBoundsInParent ); + bar.mUMgrData.SetDirty( FALSE ); + } + } + } } void cbSimpleUpdatesMgr::OnFinishChanges() { - // nothing here, could be overriden by more sophisticated updates-managers + // nothing here, could be overriden by more sophisticated updates-managers } void cbSimpleUpdatesMgr::OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ) { - // -/- + // -/- } void cbSimpleUpdatesMgr::OnBarWillChange( cbBarInfo* pBar, - cbRowInfo* pInRow, cbDockPane* pInPane ) + cbRowInfo* pInRow, cbDockPane* pInPane ) { - // -/- + // -/- } void cbSimpleUpdatesMgr::OnPaneMarginsWillChange( cbDockPane* pPane ) { - // -/- + // -/- } void cbSimpleUpdatesMgr::OnPaneWillChange( cbDockPane* pPane ) { - // -/- + // -/- } void cbSimpleUpdatesMgr::UpdateNow() { - cbDockPane** panes = mpLayout->GetPanesArray(); + cbDockPane** panes = mpLayout->GetPanesArray(); - wxRect& r1 = mpLayout->GetClientRect(); - wxRect& r2 = mpLayout->GetPrevClientRect(); + wxRect& r1 = mpLayout->GetClientRect(); + wxRect& r2 = mpLayout->GetPrevClientRect(); - // detect changes in client window's area + // detect changes in client window's area - bool clientWindowChanged = ( r1.x != r2.x || - r1.y != r2.y || - r1.width != r2.width || - r1.height != r2.height ); - - // step #1 - detect changes in each row of each pane, - // and repaint decorations around changed windows + bool clientWindowChanged = ( r1.x != r2.x || + r1.y != r2.y || + r1.width != r2.width || + r1.height != r2.height ); + + // step #1 - detect changes in each row of each pane, + // and repaint decorations around changed windows - wxList mBarsToRefresh; - wxList mPanesList; + wxList mBarsToRefresh; + wxList mPanesList; - for( int n = 0; n != MAX_PANES; ++n ) - { - cbDockPane& pane = *(panes[n]); + for( int n = 0; n != MAX_PANES; ++n ) + { + cbDockPane& pane = *(panes[n]); - bool paneChanged = WasChanged( pane.mUMgrData, pane.mBoundsInParent ); + bool paneChanged = WasChanged( pane.mUMgrData, pane.mBoundsInParent ); - if ( paneChanged ) - { - wxClientDC dc( &mpLayout->GetParentFrame() ); - pane.PaintPaneBackground( dc ); - } + if ( paneChanged ) + { + wxClientDC dc( &mpLayout->GetParentFrame() ); + pane.PaintPaneBackground( dc ); + } - wxRect realBounds; + wxRect realBounds; - for( size_t i = 0; i != pane.GetRowList().Count(); ++i ) - { - cbRowInfo& row = *pane.GetRowList()[ i ]; + for( size_t i = 0; i != pane.GetRowList().Count(); ++i ) + { + cbRowInfo& row = *pane.GetRowList()[ i ]; - wxDC* pDc = NULL; + wxDC* pDc = NULL; - bool rowChanged = FALSE; + bool rowChanged = FALSE; - // FIXME:: the below should not be fixed - cbBarInfo* barsToRepaint[256]; + // FIXME:: the below should not be fixed + cbBarInfo* barsToRepaint[256]; - // number of bars, that were changed in the current row - int nBars = 0; + // number of bars, that were changed in the current row + int nBars = 0; - if ( WasChanged( row.mUMgrData, row.mBoundsInParent ) ) - - rowChanged = TRUE; - else - for( size_t k = 0; k != row.mBars.Count(); ++k ) + if ( WasChanged( row.mUMgrData, row.mBoundsInParent ) ) + + rowChanged = TRUE; + else + for( size_t k = 0; k != row.mBars.Count(); ++k ) - if ( WasChanged( row.mBars[k]->mUMgrData, - row.mBars[k]->mBoundsInParent ) - ) - - barsToRepaint[nBars++] = row.mBars[k]; + if ( WasChanged( row.mBars[k]->mUMgrData, + row.mBars[k]->mBoundsInParent ) + ) + + barsToRepaint[nBars++] = row.mBars[k]; - if ( nBars || rowChanged ) - { - realBounds = row.mBoundsInParent; + if ( nBars || rowChanged ) + { + realBounds = row.mBoundsInParent; - // include 1-pixel thick shades around the row - realBounds.x -= 1; - realBounds.y -= 1; - realBounds.width += 2; - realBounds.height += 2; + // include 1-pixel thick shades around the row + realBounds.x -= 1; + realBounds.y -= 1; + realBounds.width += 2; + realBounds.height += 2; - pDc = pane.StartDrawInArea( realBounds ); - } + pDc = pane.StartDrawInArea( realBounds ); + } - if ( rowChanged ) - { - // postphone the resizing and refreshing the changed - // bar windows + if ( rowChanged ) + { + // postphone the resizing and refreshing the changed + // bar windows - for( size_t k = 0; k != row.mBars.Count(); ++k ) - { - mBarsToRefresh.Append( (wxObject*)row.mBars[k] ); - mPanesList.Append( &pane ); - } + for( size_t k = 0; k != row.mBars.Count(); ++k ) + { + mBarsToRefresh.Append( (wxObject*)row.mBars[k] ); + mPanesList.Append( &pane ); + } - // draw only their decorations now + // draw only their decorations now - pane.PaintRow( &row, *pDc ); - } - else - if ( nBars != 0 ) - { - for( int i = 0; i != nBars; ++i ) - { - // postphone the resizement and refreshing the changed - // bar windows + pane.PaintRow( &row, *pDc ); + } + else + if ( nBars != 0 ) + { + for( int i = 0; i != nBars; ++i ) + { + // postphone the resizement and refreshing the changed + // bar windows - mBarsToRefresh.Append( (wxObject*)barsToRepaint[i] ); - mPanesList.Append( &pane ); - } + mBarsToRefresh.Append( (wxObject*)barsToRepaint[i] ); + mPanesList.Append( &pane ); + } - // redraw decorations of entire row, regardless of how much - // of the bars were changed - pane.PaintRow( &row, *pDc ); - } + // redraw decorations of entire row, regardless of how much + // of the bars were changed + pane.PaintRow( &row, *pDc ); + } - if ( pDc ) - - pane.FinishDrawInArea( realBounds ); - } // end of while + if ( pDc ) + + pane.FinishDrawInArea( realBounds ); + } // end of while - if ( paneChanged ) - { - wxClientDC dc( &mpLayout->GetParentFrame() ); - pane.PaintPaneDecorations( dc ); - } + if ( paneChanged ) + { + wxClientDC dc( &mpLayout->GetParentFrame() ); + pane.PaintPaneDecorations( dc ); + } - } // end of for + } // end of for - if ( clientWindowChanged ) - { - mpLayout->PositionClientWindow(); - // ptr to client-window object is "marked" as 0 - } + if ( clientWindowChanged ) + { + mpLayout->PositionClientWindow(); + // ptr to client-window object is "marked" as 0 + } - // step #2 - do ordered refreshing and resizing of bar window objects now + // step #2 - do ordered refreshing and resizing of bar window objects now - wxNode* pNode = mBarsToRefresh.First(); - wxNode* pPaneNode = mPanesList.First(); - - while( pNode ) - { - cbBarInfo* pBar = (cbBarInfo*) pNode->Data(); - cbDockPane* pPane = (cbDockPane*)pPaneNode->Data(); + wxNode* pNode = mBarsToRefresh.First(); + wxNode* pPaneNode = mPanesList.First(); + + while( pNode ) + { + cbBarInfo* pBar = (cbBarInfo*) pNode->Data(); + cbDockPane* pPane = (cbDockPane*)pPaneNode->Data(); - pPane->SizeBar( pBar ); - - pNode = pNode->Next(); - pPaneNode = pPaneNode->Next(); - } - - pNode = mBarsToRefresh.First(); - - while( pNode ) - { - cbBarInfo* pBar = (cbBarInfo*)pNode->Data(); - - if ( pBar->mpBarWnd ) - { - pBar->mpBarWnd->Refresh(); - - // FIXME:: - //info.mpBarWnd->Show(FALSE); - //info.mpBarWnd->Show(TRUE); - } - - pNode = pNode->Next(); - } - - if ( clientWindowChanged ) - { - // FIXME:: excessive? - - mpLayout->GetFrameClient()->Refresh(); - } + pPane->SizeBar( pBar ); + + pNode = pNode->Next(); + pPaneNode = pPaneNode->Next(); + } + + pNode = mBarsToRefresh.First(); + + while( pNode ) + { + cbBarInfo* pBar = (cbBarInfo*)pNode->Data(); + + if ( pBar->mpBarWnd ) + { + pBar->mpBarWnd->Refresh(); + + // FIXME:: + //info.mpBarWnd->Show(FALSE); + //info.mpBarWnd->Show(TRUE); + } + + pNode = pNode->Next(); + } + + if ( clientWindowChanged ) + { + // FIXME:: excessive? + + mpLayout->GetFrameClient()->Refresh(); + } } -- 2.45.2