X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e08b761b0c5ecb6df295785b78f1f3637331887..9838b284443a889c6c629568011c8ce76cfbacd4:/contrib/include/wx/fl/bardragpl.h diff --git a/contrib/include/wx/fl/bardragpl.h b/contrib/include/wx/fl/bardragpl.h index a9df99acf8..84761c9eb9 100644 --- a/contrib/include/wx/fl/bardragpl.h +++ b/contrib/include/wx/fl/bardragpl.h @@ -1,121 +1,172 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: bardragpl.h +// Purpose: cbBarDragPlugin class // Author: Aleksandras Gluchovas // Modified by: // Created: 23/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __BARDRAGPL_G__ #define __BARDRAGPL_G__ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "bardragpl.h" #endif #include "wx/fl/controlbar.h" #include "wx/fl/toolwnd.h" -class cbBarDragPlugin : public cbPluginBase +/* +Plugin class implementing bar dragging. +*/ + +class WXDLLIMPEXP_FL 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; - // rectnagle 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 ClipRectInFrame( wxRect& rect ); + + // 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 point. + cbDockPane* HitTestPanes( wxPoint& pos ); - void AdjustHintRect( wxPoint& mousePos ); + // Internal implementation function. + bool HitsPane( cbDockPane* pPane, wxRect& rect ); - void ClipRectInFrame( wxRect& rect ); - void ClipPosInFrame( wxPoint& pos ); + // Internal implementation function. + void CalcOnScreenDims( wxRect& rect ); - cbDockPane* HitTestPanes( wxRect& rect ); - cbDockPane* HitTestPanes( wxPoint& pos ); - bool HitsPane( cbDockPane* pPane, wxRect& rect ); + // Internal implementation function. + int GetDistanceToPane( cbDockPane* pPane, wxPoint& mousePos ); - void CalcOnScreenDims( wxRect& rect ); + // Internal implementation function. + bool IsInOtherPane ( wxPoint& mousePos ); - int GetDistanceToPane( cbDockPane* pPane, wxPoint& mousePos ); + // Internal implementation function. + bool IsInClientArea( wxPoint& mousePos ); - bool IsInOtherPane ( wxPoint& mousePos ); - bool IsInClientArea( wxPoint& mousePos ); - bool IsInClientArea( wxRect& rect ); + // Internal implementation function. + bool IsInClientArea( wxRect& rect ); - void StickToPane( cbDockPane* pPane, wxPoint& mousePos ); - void UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos ); + // Internal implementation function. + void StickToPane( cbDockPane* pPane, wxPoint& mousePos ); - int GetBarWidthInPane( cbDockPane* pPane ); - int GetBarHeightInPane( cbDockPane* pPane ); + // Internal implementation function. + void UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos ); - // on-screen hint-tracking related methods + // Internal implementation function. + int GetBarWidthInPane( cbDockPane* pPane ); - void StartTracking(); + // Internal implementation function. + int GetBarHeightInPane( cbDockPane* pPane ); - void DrawHintRect ( wxRect& rect, bool isInClientRect); - void EraseHintRect( wxRect& rect, bool isInClientRect); + // on-screen hint-tracking related methods - void FinishTracking(); + // Internal implementation function. + // Start showing a visual hint while dragging. + void StartTracking(); - void DoDrawHintRect( wxRect& rect, bool isInClientRect); + // Internal implementation function. + // Draw the visual hint while dragging. + void DrawHintRect ( wxRect& rect, bool isInClientRect); - void RectToScr( wxRect& frameRect, wxRect& scrRect ); + // Internal implementation function. + // Erase the visual hint while dragging. + void EraseHintRect( wxRect& rect, bool isInClientRect); - void ShowHint( bool prevWasInClient ); + // 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. + // 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 ); public: - cbBarDragPlugin(void); + // Default constructor. + cbBarDragPlugin(void); + + // Constructor taking a parent frame, and flag. See cbPluginBase. + cbBarDragPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + + // Destructor. + virtual ~cbBarDragPlugin(); - cbBarDragPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Handler for plugin event. + void OnMouseMove( cbMotionEvent& event ); - virtual ~cbBarDragPlugin(); + // Handler for plugin event. + void OnLButtonUp( cbLeftUpEvent& event ); - // handlers for plugin events + // Handler for plugin event. + void OnLButtonDown( cbLeftDownEvent& event ); - void OnMouseMove( cbMotionEvent& event ); - void OnLButtonUp( cbLeftUpEvent& event ); - void OnLButtonDown( cbLeftDownEvent& event ); - void OnLDblClick( cbLeftDClickEvent& event ); + // Handler for plugin event. + void OnLDblClick( cbLeftDClickEvent& event ); - // handles event, which oriniates from itself - void OnDrawHintRect( cbDrawHintRectEvent& event ); + // Handles event, which originates from itself. + void OnDrawHintRect( cbDrawHintRectEvent& event ); - void OnStartBarDragging( cbStartBarDraggingEvent& event ); + // Handler for plugin event. + void OnStartBarDragging( cbStartBarDraggingEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __BARDRAGPL_G__ */