-1->wxID_ANY, TRUE->true, FALSE->false and tabs replacements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -142,7 +142,7 @@ public:
|
|||||||
|
|
||||||
wxFrameLayout( wxWindow* pParentFrame,
|
wxFrameLayout( wxWindow* pParentFrame,
|
||||||
wxWindow* pFrameClient = NULL,
|
wxWindow* pFrameClient = NULL,
|
||||||
bool activateNow = TRUE );
|
bool activateNow = true );
|
||||||
|
|
||||||
// Destructor. It does not destroy the bar windows.
|
// Destructor. It does not destroy the bar windows.
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
|
|
||||||
// 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,
|
// Activate can be called after some other layout has been deactivated,
|
||||||
// and this one must take over the current contents of the frame window.
|
// and this one must take over the current contents of the frame window.
|
||||||
@@ -223,10 +223,10 @@ public:
|
|||||||
|
|
||||||
// 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
|
// 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
|
// to forward unhandled mouse clicks to the frame layout, for example to enable
|
||||||
// easy draggablity of toolbars just by clicking on their interior regions.
|
// easy draggablity of toolbars just by clicking on their interior regions.
|
||||||
// For widgets like text/tree control this value should be FALSE,
|
// 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.
|
// since there's no certain way to detect whether the event was actually handled.
|
||||||
|
|
||||||
// state is the initial state, such as wxCBAR_DOCKED_HORIZONTALLY,
|
// state is the initial state, such as wxCBAR_DOCKED_HORIZONTALLY,
|
||||||
@@ -240,7 +240,7 @@ public:
|
|||||||
int rowNo = 0,
|
int rowNo = 0,
|
||||||
int columnPos = 0,
|
int columnPos = 0,
|
||||||
const wxString& name = wxT("bar"),
|
const wxString& name = wxT("bar"),
|
||||||
bool spyEvents = FALSE,
|
bool spyEvents = false,
|
||||||
int state = wxCBAR_DOCKED_HORIZONTALLY
|
int state = wxCBAR_DOCKED_HORIZONTALLY
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ public:
|
|||||||
// To dock a bar which is floating, use the wxFrameLayout::DockBar method.
|
// To dock a bar which is floating, use the wxFrameLayout::DockBar method.
|
||||||
|
|
||||||
virtual bool RedockBar( cbBarInfo* pBar, const wxRect& shapeInParent,
|
virtual bool RedockBar( cbBarInfo* pBar, const wxRect& shapeInParent,
|
||||||
cbDockPane* pToPane = NULL, bool updateNow = TRUE );
|
cbDockPane* pToPane = NULL, bool updateNow = true );
|
||||||
|
|
||||||
// Finds the bar in the framelayout, by name.
|
// Finds the bar in the framelayout, by name.
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ public:
|
|||||||
|
|
||||||
// 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.
|
||||||
|
|
||||||
@@ -331,7 +331,7 @@ public:
|
|||||||
|
|
||||||
// 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.
|
||||||
|
|
||||||
@@ -565,7 +565,7 @@ public: /* protected really (accessed only by plugins) */
|
|||||||
cbDockPane** ppPane );
|
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 );
|
||||||
|
|
||||||
@@ -600,7 +600,7 @@ public: /* protected really (accessed only by plugins) */
|
|||||||
|
|
||||||
void HookUpToFrame();
|
void HookUpToFrame();
|
||||||
|
|
||||||
// Returns TRUE if the platform allows reparenting. This may not return TRUE
|
// Returns true if the platform allows reparenting. This may not return true
|
||||||
// for all platforms. Reparenting allows control bars to be floated.
|
// for all platforms. Reparenting allows control bars to be floated.
|
||||||
|
|
||||||
bool CanReparent();
|
bool CanReparent();
|
||||||
@@ -659,7 +659,7 @@ public:
|
|||||||
|
|
||||||
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();
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ public:
|
|||||||
|
|
||||||
// Set the dirty flag.
|
// Set the dirty flag.
|
||||||
|
|
||||||
void SetDirty( bool isDirty = TRUE );
|
void SetDirty( bool isDirty = true );
|
||||||
|
|
||||||
// Set custom data.
|
// Set custom data.
|
||||||
|
|
||||||
@@ -751,8 +751,8 @@ public:
|
|||||||
|
|
||||||
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/horizontal dimensions cannot be mannualy adjusted
|
// true, if vertical/horizontal dimensions cannot be mannualy adjusted
|
||||||
// by user using resizing handles. If FALSE, the frame-layout
|
// by user using resizing handles. If false, the frame-layout
|
||||||
// *automatically* places resizing handles among not-fixed bars
|
// *automatically* places resizing handles among not-fixed bars
|
||||||
|
|
||||||
bool mIsFixed;
|
bool mIsFixed;
|
||||||
@@ -766,8 +766,8 @@ public:
|
|||||||
cbDimInfo(void);
|
cbDimInfo(void);
|
||||||
|
|
||||||
// Constructor.
|
// Constructor.
|
||||||
// isFixed is TRUE if vertical/horizontal dimensions cannot be manually adjusted
|
// isFixed is true if vertical/horizontal dimensions cannot be manually adjusted
|
||||||
// by the user using resizing handles. If FALSE, the frame-layout
|
// by the user using resizing handles. If false, the frame-layout
|
||||||
// automatically places resizing handles among bars that do are not fixed.
|
// automatically places resizing handles among bars that do are not fixed.
|
||||||
|
|
||||||
cbDimInfo( cbBarDimHandlerBase* pDimHandler,
|
cbDimInfo( cbBarDimHandlerBase* pDimHandler,
|
||||||
@@ -796,7 +796,7 @@ public:
|
|||||||
int dv_x, int dv_y,
|
int dv_x, int dv_y,
|
||||||
int f_x, int f_y,
|
int f_x, int f_y,
|
||||||
|
|
||||||
bool isFixed = TRUE,
|
bool isFixed = true,
|
||||||
int horizGap = 6,
|
int horizGap = 6,
|
||||||
int vertGap = 6,
|
int vertGap = 6,
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ public:
|
|||||||
// Constructor.
|
// Constructor.
|
||||||
|
|
||||||
cbDimInfo( int x, int y,
|
cbDimInfo( int x, int y,
|
||||||
bool isFixed = TRUE,
|
bool isFixed = true,
|
||||||
int gap = 6,
|
int gap = 6,
|
||||||
cbBarDimHandlerBase* pDimHandler = NULL
|
cbBarDimHandlerBase* pDimHandler = NULL
|
||||||
);
|
);
|
||||||
@@ -943,11 +943,11 @@ public:
|
|||||||
|
|
||||||
~cbBarInfo();
|
~cbBarInfo();
|
||||||
|
|
||||||
// Returns TRUE if this bar is fixed.
|
// Returns true if this bar is fixed.
|
||||||
|
|
||||||
inline bool IsFixed() const { return mDimInfo.mIsFixed; }
|
inline bool IsFixed() const { return mDimInfo.mIsFixed; }
|
||||||
|
|
||||||
// Returns TRUE if this bar is expanded.
|
// Returns true if this bar is expanded.
|
||||||
|
|
||||||
inline bool IsExpanded() const { return this == mpRow->mpExpandedBar; }
|
inline bool IsExpanded() const { return this == mpRow->mpExpandedBar; }
|
||||||
};
|
};
|
||||||
@@ -983,7 +983,7 @@ public:
|
|||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
// Advances the iterator and returns TRUE if a bar is available.
|
// Advances the iterator and returns true if a bar is available.
|
||||||
|
|
||||||
bool Next();
|
bool Next();
|
||||||
|
|
||||||
@@ -1118,7 +1118,7 @@ public: /* protected really (accessed only by plugins) */
|
|||||||
|
|
||||||
void SyncRowFlags( cbRowInfo* pRow );
|
void SyncRowFlags( cbRowInfo* pRow );
|
||||||
|
|
||||||
// Returns TRUE if the bar's dimension information indicates a fixed size.
|
// Returns true if the bar's dimension information indicates a fixed size.
|
||||||
// Internal function called by plugins.
|
// Internal function called by plugins.
|
||||||
|
|
||||||
bool IsFixedSize( cbBarInfo* pInfo );
|
bool IsFixedSize( cbBarInfo* pInfo );
|
||||||
@@ -1133,22 +1133,22 @@ public: /* protected really (accessed only by plugins) */
|
|||||||
|
|
||||||
int GetRowY( cbRowInfo* pRow );
|
int GetRowY( cbRowInfo* pRow );
|
||||||
|
|
||||||
// Returns TRUE if there are any variable-sized rows above this one.
|
// Returns true if there are any variable-sized rows above this one.
|
||||||
// Internal function called by plugins.
|
// Internal function called by plugins.
|
||||||
|
|
||||||
bool HasNotFixedRowsAbove( cbRowInfo* pRow );
|
bool HasNotFixedRowsAbove( cbRowInfo* pRow );
|
||||||
|
|
||||||
// Returns TRUE if there are any variable-sized rows below this one.
|
// Returns true if there are any variable-sized rows below this one.
|
||||||
// Internal function called by plugins.
|
// Internal function called by plugins.
|
||||||
|
|
||||||
bool HasNotFixedRowsBelow( cbRowInfo* pRow );
|
bool HasNotFixedRowsBelow( cbRowInfo* pRow );
|
||||||
|
|
||||||
// Returns TRUE if there are any variable-sized rows to the left of this one.
|
// Returns true if there are any variable-sized rows to the left of this one.
|
||||||
// Internal function called by plugins.
|
// Internal function called by plugins.
|
||||||
|
|
||||||
bool HasNotFixedBarsLeft ( cbBarInfo* pBar );
|
bool HasNotFixedBarsLeft ( cbBarInfo* pBar );
|
||||||
|
|
||||||
// Returns TRUE if there are any variable-sized rows to the right of this one.
|
// Returns true if there are any variable-sized rows to the right of this one.
|
||||||
// Internal function called by plugins.
|
// Internal function called by plugins.
|
||||||
|
|
||||||
bool HasNotFixedBarsRight( cbBarInfo* pBar );
|
bool HasNotFixedBarsRight( cbBarInfo* pBar );
|
||||||
@@ -1203,7 +1203,7 @@ public: /* protected really (accessed only by plugins) */
|
|||||||
|
|
||||||
void PaneToFrame( wxRect* pRect );
|
void PaneToFrame( wxRect* pRect );
|
||||||
|
|
||||||
// Returns TRUE if pos is within the given rectangle.
|
// Returns true if pos is within the given rectangle.
|
||||||
// Internal function called by plugins.
|
// Internal function called by plugins.
|
||||||
|
|
||||||
inline bool HasPoint( const wxPoint& pos, int x, int y, int width, int height );
|
inline bool HasPoint( const wxPoint& pos, int x, int y, int width, int height );
|
||||||
@@ -1368,7 +1368,7 @@ public: /* public members */
|
|||||||
|
|
||||||
{ return mRows.GetCount() ? mRows[0] : NULL; }
|
{ return mRows.GetCount() ? mRows[0] : NULL; }
|
||||||
|
|
||||||
// Returns TRUE if the given bar is present in this pane.
|
// Returns true if the given bar is present in this pane.
|
||||||
|
|
||||||
bool BarPresent( cbBarInfo* pBar );
|
bool BarPresent( cbBarInfo* pBar );
|
||||||
|
|
||||||
@@ -1381,11 +1381,11 @@ public: /* public members */
|
|||||||
|
|
||||||
int GetAlignment();
|
int GetAlignment();
|
||||||
|
|
||||||
// Returns TRUE if the given mask matches the pane's mask.
|
// Returns true if the given mask matches the pane's mask.
|
||||||
|
|
||||||
bool MatchesMask( int paneMask );
|
bool MatchesMask( int paneMask );
|
||||||
|
|
||||||
// Returns TRUE if the pane is aligned to the top or bottom.
|
// Returns true if the pane is aligned to the top or bottom.
|
||||||
|
|
||||||
inline bool IsHorizontal()
|
inline bool IsHorizontal()
|
||||||
{
|
{
|
||||||
@@ -1713,7 +1713,7 @@ public:
|
|||||||
|
|
||||||
int mPaneMask;
|
int mPaneMask;
|
||||||
|
|
||||||
// Is TRUE when plugin is ready to handle events.
|
// Is true when plugin is ready to handle events.
|
||||||
|
|
||||||
bool mIsReady;
|
bool mIsReady;
|
||||||
|
|
||||||
@@ -1724,7 +1724,7 @@ public:
|
|||||||
|
|
||||||
: mpLayout ( 0 ),
|
: mpLayout ( 0 ),
|
||||||
mPaneMask( wxALL_PANES ),
|
mPaneMask( wxALL_PANES ),
|
||||||
mIsReady ( FALSE )
|
mIsReady ( false )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Constructor taking layout panel and a mask.
|
// Constructor taking layout panel and a mask.
|
||||||
@@ -1733,7 +1733,7 @@ public:
|
|||||||
|
|
||||||
: mpLayout ( pPanel ),
|
: mpLayout ( pPanel ),
|
||||||
mPaneMask( paneMask ),
|
mPaneMask( paneMask ),
|
||||||
mIsReady ( FALSE )
|
mIsReady ( false )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Returns the pane mask.
|
// Returns the pane mask.
|
||||||
@@ -1748,9 +1748,9 @@ public:
|
|||||||
// At this point plugin is already attached to the frame layout,
|
// At this point plugin is already attached to the frame layout,
|
||||||
// and pane masks are set.
|
// and pane masks are set.
|
||||||
|
|
||||||
virtual void OnInitPlugin() { mIsReady = TRUE; }
|
virtual void OnInitPlugin() { mIsReady = true; }
|
||||||
|
|
||||||
// Returns TRUE if the plugin is ready to receive events.
|
// Returns true if the plugin is ready to receive events.
|
||||||
|
|
||||||
bool IsReady() { return mIsReady; }
|
bool IsReady() { return mIsReady; }
|
||||||
|
|
||||||
|
@@ -148,13 +148,13 @@ public:
|
|||||||
virtual void AddTool( int toolIndex,
|
virtual void AddTool( int toolIndex,
|
||||||
const wxString& imageFileName,
|
const wxString& imageFileName,
|
||||||
wxBitmapType imageFileType = wxBITMAP_TYPE_BMP,
|
wxBitmapType imageFileType = wxBITMAP_TYPE_BMP,
|
||||||
const wxString& labelText = wxT(""), bool alignTextRight = FALSE,
|
const wxString& labelText = wxT(""), bool alignTextRight = false,
|
||||||
bool isFlat = TRUE );
|
bool isFlat = true );
|
||||||
// Adds a tool. See the documentation for wxToolBar for details.
|
// Adds a tool. See the documentation for wxToolBar for details.
|
||||||
|
|
||||||
virtual void AddTool( int toolIndex, wxBitmap labelBmp,
|
virtual void AddTool( int toolIndex, wxBitmap labelBmp,
|
||||||
const wxString& labelText = wxT(""), bool alignTextRight = FALSE,
|
const wxString& labelText = wxT(""), bool alignTextRight = false,
|
||||||
bool isFlat = TRUE );
|
bool isFlat = true );
|
||||||
|
|
||||||
// Unhide method from parent.
|
// Unhide method from parent.
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
// See the documentation for wxToolBar for details.
|
// 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 bool toggle = false, const long xPos = wxDefaultPosition.x, const long yPos = wxDefaultPosition.y, wxObject *clientData = NULL,
|
||||||
const wxString& helpString1 = wxT(""), const wxString& helpString2 = wxT(""));
|
const wxString& helpString1 = wxT(""), const wxString& helpString2 = wxT(""));
|
||||||
|
|
||||||
// Adds a separator. See the documentation for wxToolBar for details.
|
// Adds a separator. See the documentation for wxToolBar for details.
|
||||||
@@ -209,7 +209,7 @@ public:
|
|||||||
|
|
||||||
// Enables or disables the given tool.
|
// Enables or disables the given tool.
|
||||||
|
|
||||||
virtual void EnableTool(int toolIndex, bool enable = TRUE);
|
virtual void EnableTool(int toolIndex, bool enable = true);
|
||||||
|
|
||||||
// Responds to size events, calling Layout.
|
// Responds to size events, calling Layout.
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ public:
|
|||||||
void CreateLayout();
|
void CreateLayout();
|
||||||
wxFrameLayout* GetLayout();
|
wxFrameLayout* GetLayout();
|
||||||
void SetLayout( wxFrameLayout* pLayout );
|
void SetLayout( wxFrameLayout* pLayout );
|
||||||
void SetToolUpdates( bool doToolUpdates = TRUE );
|
void SetToolUpdates( bool doToolUpdates = true );
|
||||||
|
|
||||||
|
|
||||||
// hooks for specific frame-views
|
// hooks for specific frame-views
|
||||||
|
@@ -55,8 +55,8 @@ public:
|
|||||||
|
|
||||||
int mInClientHintBorder; // default: 4 pixels
|
int mInClientHintBorder; // default: 4 pixels
|
||||||
|
|
||||||
bool mAccelerationOn; // TRUE, if morph accelerates, otherwise morph
|
bool mAccelerationOn; // true, if morph accelerates, otherwise morph
|
||||||
// speed is constant. Default: TRUE
|
// speed is constant. Default: true
|
||||||
|
|
||||||
// TBD:: get/set methods for above members
|
// TBD:: get/set methods for above members
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ protected:
|
|||||||
// labels for particular state
|
// labels for particular state
|
||||||
|
|
||||||
wxBitmap mFocusedBmp; // may not be always present -
|
wxBitmap mFocusedBmp; // may not be always present -
|
||||||
// only if mHasFocusedBmp is TRUE
|
// only if mHasFocusedBmp is true
|
||||||
|
|
||||||
wxBitmap* mpDepressedImg;
|
wxBitmap* mpDepressedImg;
|
||||||
wxBitmap* mpPressedImg;
|
wxBitmap* mpPressedImg;
|
||||||
@@ -104,7 +104,7 @@ protected:
|
|||||||
wxPen& upperLeftSidePen,
|
wxPen& upperLeftSidePen,
|
||||||
wxPen& lowerRightSidePen );
|
wxPen& lowerRightSidePen );
|
||||||
|
|
||||||
// Returns TRUE if the given point is in the window.
|
// Returns true if the given point is in the window.
|
||||||
bool IsInWindow( int x, int y );
|
bool IsInWindow( int x, int y );
|
||||||
|
|
||||||
virtual void OnIdle(wxIdleEvent& event);
|
virtual void OnIdle(wxIdleEvent& event);
|
||||||
@@ -117,13 +117,13 @@ public:
|
|||||||
wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap,
|
wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap,
|
||||||
const wxString& labelText = wxT(""),
|
const wxString& labelText = wxT(""),
|
||||||
int alignText = NB_ALIGN_TEXT_BOTTOM,
|
int alignText = NB_ALIGN_TEXT_BOTTOM,
|
||||||
bool isFlat = TRUE,
|
bool isFlat = true,
|
||||||
// this is the default type of fired events
|
// this is the default type of fired events
|
||||||
int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
|
int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
|
||||||
int marginX = NB_DEFAULT_MARGIN,
|
int marginX = NB_DEFAULT_MARGIN,
|
||||||
int marginY = NB_DEFAULT_MARGIN,
|
int marginY = NB_DEFAULT_MARGIN,
|
||||||
int textToLabelGap = 2,
|
int textToLabelGap = 2,
|
||||||
bool isSticky = FALSE
|
bool isSticky = false
|
||||||
);
|
);
|
||||||
|
|
||||||
// Use this constructor if buttons have to be persistant
|
// Use this constructor if buttons have to be persistant
|
||||||
@@ -131,13 +131,13 @@ public:
|
|||||||
const wxBitmapType bitmapFileType = wxBITMAP_TYPE_BMP,
|
const wxBitmapType bitmapFileType = wxBITMAP_TYPE_BMP,
|
||||||
const wxString& labelText = wxT(""),
|
const wxString& labelText = wxT(""),
|
||||||
int alignText = NB_ALIGN_TEXT_BOTTOM,
|
int alignText = NB_ALIGN_TEXT_BOTTOM,
|
||||||
bool isFlat = TRUE,
|
bool isFlat = true,
|
||||||
// this is the default type of fired events
|
// this is the default type of fired events
|
||||||
int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
|
int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
|
||||||
int marginX = NB_DEFAULT_MARGIN,
|
int marginX = NB_DEFAULT_MARGIN,
|
||||||
int marginY = NB_DEFAULT_MARGIN,
|
int marginY = NB_DEFAULT_MARGIN,
|
||||||
int textToLabelGap = 2,
|
int textToLabelGap = 2,
|
||||||
bool isSticky = FALSE
|
bool isSticky = false
|
||||||
);
|
);
|
||||||
|
|
||||||
// Destructor.
|
// Destructor.
|
||||||
@@ -169,8 +169,8 @@ public:
|
|||||||
|
|
||||||
// Renders the label image.
|
// Renders the label image.
|
||||||
virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
|
virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
|
||||||
bool isEnabled = TRUE,
|
bool isEnabled = true,
|
||||||
bool isPressed = FALSE);
|
bool isPressed = false);
|
||||||
|
|
||||||
// Renders label images.
|
// Renders label images.
|
||||||
virtual void RenderLabelImages();
|
virtual void RenderLabelImages();
|
||||||
|
@@ -186,7 +186,7 @@ public:
|
|||||||
// Set the position of the button.
|
// Set the position of the button.
|
||||||
void SetPos( const wxPoint& pos );
|
void SetPos( const wxPoint& pos );
|
||||||
|
|
||||||
// Returns TRUE if the given position was over the button.
|
// Returns true if the given position was over the button.
|
||||||
bool HitTest( const wxPoint& pos );
|
bool HitTest( const wxPoint& pos );
|
||||||
|
|
||||||
// Responds to a left down event.
|
// Responds to a left down event.
|
||||||
@@ -205,7 +205,7 @@ public:
|
|||||||
// the desired appearance.
|
// the desired appearance.
|
||||||
virtual void Draw( wxDC& dc );
|
virtual void Draw( wxDC& dc );
|
||||||
|
|
||||||
// Returns TRUE if the button was clicked.
|
// Returns true if the button was clicked.
|
||||||
bool WasClicked();
|
bool WasClicked();
|
||||||
|
|
||||||
// Reset the button.
|
// Reset the button.
|
||||||
@@ -214,7 +214,7 @@ public:
|
|||||||
// Enable or disable the button.
|
// Enable or disable the button.
|
||||||
void Enable( bool enable ) { mEnabled = enable; }
|
void Enable( bool enable ) { mEnabled = enable; }
|
||||||
|
|
||||||
// Returns TRUE if this button is pressed.
|
// Returns true if this button is pressed.
|
||||||
bool IsPressed() { return mPressed; }
|
bool IsPressed() { return mPressed; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ bool MyApp::OnInit(void)
|
|||||||
|
|
||||||
frame->CreateStatusBar(3);
|
frame->CreateStatusBar(3);
|
||||||
|
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
frame->mpClientWnd->Refresh();
|
frame->mpClientWnd->Refresh();
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ The ONLY purpose is to demonstrate self-layouting toolbars,\nflat-bitmapped-butt
|
|||||||
(cbRowDragPlugin & cbBarHintsPlugin)\n\n\
|
(cbRowDragPlugin & cbBarHintsPlugin)\n\n\
|
||||||
BTW, disabled images and label-text are rendered at run-time") );
|
BTW, disabled images and label-text are rendered at run-time") );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Implementation for class MyFrame *****/
|
/***** Implementation for class MyFrame *****/
|
||||||
@@ -115,7 +115,7 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
|||||||
{
|
{
|
||||||
wxTextCtrl* pCtrl =
|
wxTextCtrl* pCtrl =
|
||||||
|
|
||||||
new wxTextCtrl( this, -1, value,
|
new wxTextCtrl( this, wxID_ANY, value,
|
||||||
wxDefaultPosition, wxSize(0,0), wxTE_MULTILINE );
|
wxDefaultPosition, wxSize(0,0), wxTE_MULTILINE );
|
||||||
|
|
||||||
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
||||||
@@ -124,7 +124,7 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
|||||||
}
|
}
|
||||||
|
|
||||||
MyFrame::MyFrame(wxFrame *frame)
|
MyFrame::MyFrame(wxFrame *frame)
|
||||||
: wxFrame( frame, -1, _("wxWidgets 2.0 wxFrameLayout Test Application"), wxDefaultPosition,
|
: wxFrame( frame, wxID_ANY, _("wxWidgets 2.0 wxFrameLayout Test Application"), wxDefaultPosition,
|
||||||
wxSize( 700, 500 ),
|
wxSize( 700, 500 ),
|
||||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||||
@@ -138,7 +138,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
cbCommonPaneProperties props;
|
cbCommonPaneProperties props;
|
||||||
mpLayout->GetPaneProperties( props );
|
mpLayout->GetPaneProperties( props );
|
||||||
|
|
||||||
props.mRealTimeUpdatesOn = FALSE; // real-time OFF!!!
|
props.mRealTimeUpdatesOn = false; // real-time OFF!!!
|
||||||
|
|
||||||
mpLayout->SetPaneProperties( props, wxALL_PANES );
|
mpLayout->SetPaneProperties( props, wxALL_PANES );
|
||||||
#endif
|
#endif
|
||||||
@@ -161,7 +161,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
cbDimInfo sizes0( 200,45, // when docked horizontally
|
cbDimInfo sizes0( 200,45, // when docked horizontally
|
||||||
200,85, // when docked vertically
|
200,85, // when docked vertically
|
||||||
175,35, // when floated
|
175,35, // when floated
|
||||||
FALSE, // the bar is not fixed-size
|
false, // the bar is not fixed-size
|
||||||
4, // vertical gap (bar border)
|
4, // vertical gap (bar border)
|
||||||
4 // horizontal gap (bar border)
|
4 // horizontal gap (bar border)
|
||||||
);
|
);
|
||||||
@@ -169,7 +169,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
cbDimInfo sizes1( 150,35, // when docked horizontally
|
cbDimInfo sizes1( 150,35, // when docked horizontally
|
||||||
150,85, // when docked vertically
|
150,85, // when docked vertically
|
||||||
175,35, // when floated
|
175,35, // when floated
|
||||||
TRUE, // the bar is not fixed-size
|
true, // the bar is not fixed-size
|
||||||
4, // vertical gap (bar border)
|
4, // vertical gap (bar border)
|
||||||
4 // horizontal gap (bar border)
|
4 // horizontal gap (bar border)
|
||||||
);
|
);
|
||||||
@@ -177,7 +177,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
cbDimInfo sizes2( 195,35, // when docked horizontally
|
cbDimInfo sizes2( 195,35, // when docked horizontally
|
||||||
185,37, // when docked vertically
|
185,37, // when docked vertically
|
||||||
195,35, // when floated
|
195,35, // when floated
|
||||||
TRUE, // the bar is not fixed-size
|
true, // the bar is not fixed-size
|
||||||
4, // vertical gap (bar border)
|
4, // vertical gap (bar border)
|
||||||
4, // horizontal gap (bar border)
|
4, // horizontal gap (bar border)
|
||||||
new cbDynToolBarDimHandler()
|
new cbDynToolBarDimHandler()
|
||||||
@@ -188,7 +188,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
_("InfoViewer1"), // name to refer in customization pop-ups
|
_("InfoViewer1"), // name to refer in customization pop-ups
|
||||||
TRUE
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
mpLayout->AddBar( CreateTextCtrl(_("Bye")), // bar window
|
mpLayout->AddBar( CreateTextCtrl(_("Bye")), // bar window
|
||||||
@@ -196,7 +196,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
1, // insert into 0th row (vert. position)
|
1, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
_("InfoViewer2"), // name to refer in customization pop-ups
|
_("InfoViewer2"), // name to refer in customization pop-ups
|
||||||
TRUE
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
mpLayout->AddBar( CreateTextCtrl(_("Fixed0")), // bar window
|
mpLayout->AddBar( CreateTextCtrl(_("Fixed0")), // bar window
|
||||||
@@ -204,12 +204,12 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
_("ToolBar1"), // name to refer in customization pop-ups
|
_("ToolBar1"), // name to refer in customization pop-ups
|
||||||
TRUE
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
|
wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
|
||||||
|
|
||||||
pToolBar->Create( this, -1 );
|
pToolBar->Create( this, wxID_ANY );
|
||||||
|
|
||||||
// 1001-1006 ids of command events fired by added tool-buttons
|
// 1001-1006 ids of command events fired by added tool-buttons
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
pToolBar->AddSeparator();
|
pToolBar->AddSeparator();
|
||||||
pToolBar->AddTool( 1002, wxString(wxT(BMP_DIR)) + wxT("open.bmp") );
|
pToolBar->AddTool( 1002, wxString(wxT(BMP_DIR)) + wxT("open.bmp") );
|
||||||
pToolBar->AddTool( 1003, wxString(wxT(BMP_DIR)) + wxT("save.bmp") );
|
pToolBar->AddTool( 1003, wxString(wxT(BMP_DIR)) + wxT("save.bmp") );
|
||||||
pToolBar->AddSeparator(new wxMySeparatorLine(pToolBar, -1));
|
pToolBar->AddSeparator(new wxMySeparatorLine(pToolBar, wxID_ANY));
|
||||||
pToolBar->AddTool( 1004, wxString(wxT(BMP_DIR)) + wxT("cut.bmp") );
|
pToolBar->AddTool( 1004, wxString(wxT(BMP_DIR)) + wxT("cut.bmp") );
|
||||||
pToolBar->AddTool( 1005, wxString(wxT(BMP_DIR)) + wxT("copy.bmp") );
|
pToolBar->AddTool( 1005, wxString(wxT(BMP_DIR)) + wxT("copy.bmp") );
|
||||||
pToolBar->AddTool( 1006, wxString(wxT(BMP_DIR)) + wxT("paste.bmp") );
|
pToolBar->AddTool( 1006, wxString(wxT(BMP_DIR)) + wxT("paste.bmp") );
|
||||||
@@ -228,10 +228,10 @@ MyFrame::MyFrame(wxFrame *frame)
|
|||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
wxT("ToolBar2"), // name to refer in customization pop-ups
|
wxT("ToolBar2"), // name to refer in customization pop-ups
|
||||||
FALSE
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
mpLayout->EnableFloating( TRUE ); // off, thinking about wxGtk...
|
mpLayout->EnableFloating( true ); // off, thinking about wxGtk...
|
||||||
}
|
}
|
||||||
|
|
||||||
MyFrame::~MyFrame()
|
MyFrame::~MyFrame()
|
||||||
|
@@ -43,7 +43,7 @@ public:
|
|||||||
MyFrame(wxFrame *frame);
|
MyFrame(wxFrame *frame);
|
||||||
virtual ~MyFrame();
|
virtual ~MyFrame();
|
||||||
|
|
||||||
bool OnClose(void) { Show(FALSE); return TRUE; }
|
bool OnClose(void) { Show(false); return true; }
|
||||||
|
|
||||||
void OnLoad( wxCommandEvent& event );
|
void OnLoad( wxCommandEvent& event );
|
||||||
void OnSave( wxCommandEvent& event );
|
void OnSave( wxCommandEvent& event );
|
||||||
|
@@ -144,10 +144,10 @@ class StartButton95 : public wxPanel
|
|||||||
wxBitmap m_DBmp;
|
wxBitmap m_DBmp;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StartButton95(void) : m_bPressed(FALSE) {}
|
StartButton95(void) : m_bPressed(false) {}
|
||||||
|
|
||||||
StartButton95(wxWindow* parent)
|
StartButton95(wxWindow* parent)
|
||||||
: m_bPressed(FALSE) { wxPanel::Create(parent,-1); }
|
: m_bPressed(false) { wxPanel::Create(parent,wxID_ANY); }
|
||||||
|
|
||||||
void OnMouseDown( wxMouseEvent& event );
|
void OnMouseDown( wxMouseEvent& event );
|
||||||
void OnMouseUp( wxMouseEvent& event );
|
void OnMouseUp( wxMouseEvent& event );
|
||||||
|
@@ -56,7 +56,7 @@ public:
|
|||||||
void OnStore( wxCommandEvent& event );
|
void OnStore( wxCommandEvent& event );
|
||||||
void OnQuit( wxCommandEvent& event );
|
void OnQuit( wxCommandEvent& event );
|
||||||
|
|
||||||
bool OnClose(void) { return TRUE; }
|
bool OnClose(void) { return true; }
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -86,11 +86,11 @@ bool MyApp::OnInit(void)
|
|||||||
frame->CreateStatusBar(3);
|
frame->CreateStatusBar(3);
|
||||||
frame->SetMenuBar(menu_bar);
|
frame->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Immlementation for class MyFrame *****/
|
/***** Immlementation for class MyFrame *****/
|
||||||
@@ -102,7 +102,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||||
: wxFrame( parent, -1, title, wxDefaultPosition,
|
: wxFrame( parent, wxID_ANY, title, wxDefaultPosition,
|
||||||
wxSize( 700, 500 ),
|
wxSize( 700, 500 ),
|
||||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||||
@@ -122,7 +122,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
cbCommonPaneProperties props;
|
cbCommonPaneProperties props;
|
||||||
mpLayout->GetPaneProperties( props );
|
mpLayout->GetPaneProperties( props );
|
||||||
|
|
||||||
props.mRealTimeUpdatesOn = FALSE; // off
|
props.mRealTimeUpdatesOn = false; // off
|
||||||
|
|
||||||
mpLayout->SetPaneProperties( props, wxALL_PANES );
|
mpLayout->SetPaneProperties( props, wxALL_PANES );
|
||||||
#endif
|
#endif
|
||||||
@@ -134,7 +134,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
cbDimInfo sizes( 80,65, // when docked horizontally
|
cbDimInfo sizes( 80,65, // when docked horizontally
|
||||||
80,65, // when docked vertically
|
80,65, // when docked vertically
|
||||||
80,30, // when floated
|
80,30, // when floated
|
||||||
TRUE, // the bar is fixed-size
|
true, // the bar is fixed-size
|
||||||
5, // vertical gap (bar border)
|
5, // vertical gap (bar border)
|
||||||
5 // horizontal gap (bar border)
|
5 // horizontal gap (bar border)
|
||||||
);
|
);
|
||||||
@@ -169,7 +169,7 @@ MyFrame::~MyFrame()
|
|||||||
|
|
||||||
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||||
{
|
{
|
||||||
wxTextCtrl* pCtrl = new wxTextCtrl( mpInternalFrm, -1, value,
|
wxTextCtrl* pCtrl = new wxTextCtrl( mpInternalFrm, wxID_ANY, value,
|
||||||
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
||||||
|
|
||||||
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
||||||
@@ -189,8 +189,8 @@ void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
|
Show( false ); // TRICK:: hide it, to avoid flickered destruction
|
||||||
|
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ public:
|
|||||||
void OnStore( wxCommandEvent& event );
|
void OnStore( wxCommandEvent& event );
|
||||||
void OnQuit( wxCommandEvent& event );
|
void OnQuit( wxCommandEvent& event );
|
||||||
|
|
||||||
bool OnClose(void) { return TRUE; }
|
bool OnClose(void) { return true; }
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -87,11 +87,11 @@ bool MyApp::OnInit(void)
|
|||||||
frame->CreateStatusBar(3);
|
frame->CreateStatusBar(3);
|
||||||
frame->SetMenuBar(menu_bar);
|
frame->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
frame->populateMyFrame();
|
frame->populateMyFrame();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Immlementation for class MyFrame *****/
|
/***** Immlementation for class MyFrame *****/
|
||||||
@@ -103,7 +103,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||||
: wxFrame( parent, -1, title, wxDefaultPosition,
|
: wxFrame( parent, wxID_ANY, title, wxDefaultPosition,
|
||||||
wxSize( 700, 500 ),
|
wxSize( 700, 500 ),
|
||||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||||
@@ -124,7 +124,7 @@ void MyFrame::populateMyFrame()
|
|||||||
cbDimInfo sizes( 80,65, // when docked horizontally
|
cbDimInfo sizes( 80,65, // when docked horizontally
|
||||||
80,165, // when docked vertically
|
80,165, // when docked vertically
|
||||||
180,30, // when floated
|
180,30, // when floated
|
||||||
TRUE, // the bar is fixed-size
|
true, // the bar is fixed-size
|
||||||
5, // vertical gap (bar border)
|
5, // vertical gap (bar border)
|
||||||
5 // horizontal gap (bar border)
|
5 // horizontal gap (bar border)
|
||||||
);
|
);
|
||||||
@@ -144,7 +144,7 @@ void MyFrame::populateMyFrame()
|
|||||||
|
|
||||||
if ( !sizes.mIsFixed ) name += wxT(" (flexible)");
|
if ( !sizes.mIsFixed ) name += wxT(" (flexible)");
|
||||||
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
|
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
|
||||||
mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window
|
mpLayout->AddBar( new wxTextCtrl(this, wxID_ANY, name),// bar window
|
||||||
sizes, i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
sizes, i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
@@ -167,7 +167,7 @@ MyFrame::~MyFrame()
|
|||||||
|
|
||||||
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||||
{
|
{
|
||||||
wxTextCtrl* pCtrl = new wxTextCtrl( this, -1, value,
|
wxTextCtrl* pCtrl = new wxTextCtrl( this, wxID_ANY, value,
|
||||||
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
||||||
|
|
||||||
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
||||||
@@ -187,8 +187,8 @@ void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
|
Show( false ); // TRICK:: hide it, to avoid flickered destruction
|
||||||
|
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
void OnButt( wxCommandEvent& event );
|
void OnButt( wxCommandEvent& event );
|
||||||
void OnButt2( wxCommandEvent& event );
|
void OnButt2( wxCommandEvent& event );
|
||||||
bool OnClose(void) { return TRUE; }
|
bool OnClose(void) { return true; }
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -91,10 +91,10 @@ bool MyApp::OnInit(void)
|
|||||||
frame->CreateStatusBar(3);
|
frame->CreateStatusBar(3);
|
||||||
frame->SetMenuBar(menu_bar);
|
frame->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Immlementation for class MyFrame *****/
|
/***** Immlementation for class MyFrame *****/
|
||||||
@@ -108,14 +108,14 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||||
: wxFrame( parent, -1, title, wxDefaultPosition,
|
: wxFrame( parent, wxID_ANY, title, wxDefaultPosition,
|
||||||
wxSize( 700, 500 ),
|
wxSize( 700, 500 ),
|
||||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||||
wxT("freimas") )
|
wxT("freimas") )
|
||||||
{
|
{
|
||||||
|
|
||||||
mpClientWnd = new wxWindow(this, -1);
|
mpClientWnd = new wxWindow(this, wxID_ANY);
|
||||||
mpLayout = new wxFrameLayout( this, mpClientWnd );
|
mpLayout = new wxFrameLayout( this, mpClientWnd );
|
||||||
|
|
||||||
/// mpLayout->PushDefaultPlugins();
|
/// mpLayout->PushDefaultPlugins();
|
||||||
@@ -125,7 +125,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
cbDimInfo sizes( 80,65, // when docked horizontally
|
cbDimInfo sizes( 80,65, // when docked horizontally
|
||||||
80,165, // when docked vertically
|
80,165, // when docked vertically
|
||||||
180,30, // when floated
|
180,30, // when floated
|
||||||
TRUE, // the bar is fixed-size
|
true, // the bar is fixed-size
|
||||||
5, // vertical gap (bar border)
|
5, // vertical gap (bar border)
|
||||||
5 // horizontal gap (bar border)
|
5 // horizontal gap (bar border)
|
||||||
);
|
);
|
||||||
@@ -145,7 +145,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
if ( !sizes.mIsFixed ) name += wxT(" (flexible)");
|
if ( !sizes.mIsFixed ) name += wxT(" (flexible)");
|
||||||
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
|
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
|
||||||
if(i != 4 && i!= 5 && i!=11) {
|
if(i != 4 && i!= 5 && i!=11) {
|
||||||
mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window
|
mpLayout->AddBar( new wxTextCtrl(this, wxID_ANY, name),// bar window
|
||||||
sizes,
|
sizes,
|
||||||
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
@@ -153,8 +153,8 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
name // name to refere in customization pop-ups
|
name // name to refere in customization pop-ups
|
||||||
);
|
);
|
||||||
} else if(i==4){
|
} else if(i==4){
|
||||||
mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window
|
mpLayout->AddBar( new wxTextCtrl(this, wxID_ANY, name),// bar window
|
||||||
cbDimInfo( 100,100, 100,100, 100,100, TRUE, 5, 5),
|
cbDimInfo( 100,100, 100,100, 100,100, true, 5, 5),
|
||||||
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
@@ -163,7 +163,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
} else if(i==5) {
|
} else if(i==5) {
|
||||||
my_butt = new wxButton(this, ID_BUTT, name);
|
my_butt = new wxButton(this, ID_BUTT, name);
|
||||||
mpLayout->AddBar( my_butt,// bar window
|
mpLayout->AddBar( my_butt,// bar window
|
||||||
cbDimInfo( 100,100, 200,200, 400,400, TRUE, 5, 5),
|
cbDimInfo( 100,100, 200,200, 400,400, true, 5, 5),
|
||||||
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
@@ -171,7 +171,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
|||||||
);
|
);
|
||||||
} else if(i==11) {
|
} else if(i==11) {
|
||||||
mpLayout->AddBar( new wxButton(this, ID_BUTT2, name+wxT("_2")),
|
mpLayout->AddBar( new wxButton(this, ID_BUTT2, name+wxT("_2")),
|
||||||
cbDimInfo( 100,100, 200,200, 400,400, TRUE, 5, 5),
|
cbDimInfo( 100,100, 200,200, 400,400, true, 5, 5),
|
||||||
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
||||||
0, // insert into 0th row (vert. position)
|
0, // insert into 0th row (vert. position)
|
||||||
0, // offset from the start of row (in pixels)
|
0, // offset from the start of row (in pixels)
|
||||||
@@ -194,7 +194,7 @@ MyFrame::~MyFrame()
|
|||||||
|
|
||||||
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||||
{
|
{
|
||||||
wxTextCtrl* pCtrl = new wxTextCtrl( this, -1, value,
|
wxTextCtrl* pCtrl = new wxTextCtrl( this, wxID_ANY, value,
|
||||||
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
||||||
|
|
||||||
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
||||||
@@ -214,9 +214,9 @@ void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
|
Show( false ); // TRICK:: hide it, to avoid flickered destruction
|
||||||
|
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnButt( wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnButt( wxCommandEvent& WXUNUSED(event) )
|
||||||
@@ -242,13 +242,13 @@ void MyFrame::OnButt( wxCommandEvent& WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
if(i % 4 == 1)
|
if(i % 4 == 1)
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE);
|
mpLayout->SetBarState(x, wxCBAR_FLOATING, true);
|
||||||
//mpLayout->RecalcLayout(true);
|
//mpLayout->RecalcLayout(true);
|
||||||
mpLayout->RepositionFloatedBar(x);
|
mpLayout->RepositionFloatedBar(x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState(x, 0, TRUE);
|
mpLayout->SetBarState(x, 0, true);
|
||||||
//mpLayout->RecalcLayout(true);
|
//mpLayout->RecalcLayout(true);
|
||||||
//mpLayout->RepositionFloatedBar(x);
|
//mpLayout->RepositionFloatedBar(x);
|
||||||
}
|
}
|
||||||
@@ -284,10 +284,10 @@ void MyFrame::OnButt2( wxCommandEvent& WXUNUSED(event) )
|
|||||||
x->mDimInfo.mSizes[a].y = 200;
|
x->mDimInfo.mSizes[a].y = 200;
|
||||||
}
|
}
|
||||||
x->mpBarWnd->SetSize(200,200);
|
x->mpBarWnd->SetSize(200,200);
|
||||||
mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE); // HACK !!!
|
mpLayout->SetBarState(x, wxCBAR_FLOATING, true); // HACK !!!
|
||||||
mpLayout->SetBarState(x, 0, TRUE); // HACK !!!
|
mpLayout->SetBarState(x, 0, true); // HACK !!!
|
||||||
wxYield(); // HACK !!! needed to resize BEFORE redraw
|
wxYield(); // HACK !!! needed to resize BEFORE redraw
|
||||||
mpLayout->RefreshNow( TRUE ); // HACK !!! needed to trigger redraw
|
mpLayout->RefreshNow( true ); // HACK !!! needed to trigger redraw
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -309,19 +309,19 @@ void MyFrame::OnButt2( wxCommandEvent& WXUNUSED(event) )
|
|||||||
x->mDimInfo.mSizes[a].y = 10 + 2 + 2*x->mDimInfo.mVertGap;
|
x->mDimInfo.mSizes[a].y = 10 + 2 + 2*x->mDimInfo.mVertGap;
|
||||||
}
|
}
|
||||||
x->mpBarWnd->SetSize(10,10);
|
x->mpBarWnd->SetSize(10,10);
|
||||||
mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE); // HACK !!!
|
mpLayout->SetBarState(x, wxCBAR_FLOATING, true); // HACK !!!
|
||||||
mpLayout->SetBarState(x, 0, TRUE); // HACK !!!
|
mpLayout->SetBarState(x, 0, true); // HACK !!!
|
||||||
wxYield(); // HACK !!! needed to resize BEFORE redraw
|
wxYield(); // HACK !!! needed to resize BEFORE redraw
|
||||||
mpLayout->RefreshNow( TRUE ); // HACK !!! needed to trigger redraw
|
mpLayout->RefreshNow( true ); // HACK !!! needed to trigger redraw
|
||||||
|
|
||||||
// // mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE);
|
// // mpLayout->SetBarState(x, wxCBAR_FLOATING, true);
|
||||||
// // mpLayout->RecalcLayout(true);
|
|
||||||
// // // mpLayout->RepositionFloatedBar(x);
|
|
||||||
// // mpLayout->RecalcLayout(true);
|
// // mpLayout->RecalcLayout(true);
|
||||||
// // mpLayout->RepositionFloatedBar(x);
|
// // mpLayout->RepositionFloatedBar(x);
|
||||||
// // mpLayout->SetBarState(x, 0, TRUE);
|
// // mpLayout->RecalcLayout(true);
|
||||||
|
// // mpLayout->RepositionFloatedBar(x);
|
||||||
|
// // mpLayout->SetBarState(x, 0, true);
|
||||||
// // wxYield();
|
// // wxYield();
|
||||||
// // mpLayout->RefreshNow( TRUE );
|
// // mpLayout->RefreshNow( true );
|
||||||
// // mpLayout->RecalcLayout(true);
|
// // mpLayout->RecalcLayout(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -94,7 +94,6 @@ wxDC* cbAntiflickerPlugin::FindSuitableBuffer( const wxRect& forArea )
|
|||||||
{
|
{
|
||||||
if ( mpVertBuf->GetHeight() >= forArea.height &&
|
if ( mpVertBuf->GetHeight() >= forArea.height &&
|
||||||
mpVertBuf->GetWidth() >= forArea.width )
|
mpVertBuf->GetWidth() >= forArea.width )
|
||||||
|
|
||||||
return mpVertBufDc;
|
return mpVertBufDc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -102,7 +101,6 @@ wxDC* cbAntiflickerPlugin::FindSuitableBuffer( const wxRect& forArea )
|
|||||||
{
|
{
|
||||||
if ( mpHorizBuf->GetHeight() >= forArea.height &&
|
if ( mpHorizBuf->GetHeight() >= forArea.height &&
|
||||||
mpHorizBuf->GetWidth() >= forArea.width )
|
mpHorizBuf->GetWidth() >= forArea.width )
|
||||||
|
|
||||||
return mpHorizBufDc;
|
return mpHorizBufDc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +183,6 @@ void cbAntiflickerPlugin::OnStartDrawInArea( cbStartDrawInAreaEvent& event )
|
|||||||
wxDC* pBufDc = FindSuitableBuffer( area );
|
wxDC* pBufDc = FindSuitableBuffer( area );
|
||||||
|
|
||||||
if ( !pBufDc )
|
if ( !pBufDc )
|
||||||
|
|
||||||
pBufDc = AllocNewBuffer( area );
|
pBufDc = AllocNewBuffer( area );
|
||||||
|
|
||||||
pBufDc->SetDeviceOrigin( -area.x, -area.y );
|
pBufDc->SetDeviceOrigin( -area.x, -area.y );
|
||||||
|
@@ -34,13 +34,10 @@ static inline bool rect_hits_rect( const wxRect& r1, const wxRect& r2 )
|
|||||||
{
|
{
|
||||||
if ( ( r2.x >= r1.x && r2.x <= r1.x + r1.width ) ||
|
if ( ( r2.x >= r1.x && r2.x <= r1.x + r1.width ) ||
|
||||||
( r1.x >= r2.x && r1.x <= r2.x + r2.width ) )
|
( r1.x >= r2.x && r1.x <= r2.x + r2.width ) )
|
||||||
|
|
||||||
if ( ( r2.y >= r1.y && r2.y <= r1.y + r1.height ) ||
|
if ( ( r2.y >= r1.y && r2.y <= r1.y + r1.height ) ||
|
||||||
( r1.y >= r2.y && r1.y <= r2.y + r2.height ) )
|
( r1.y >= r2.y && r1.y <= r2.y + r2.height ) )
|
||||||
|
return true;
|
||||||
return TRUE;
|
return false;
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool rect_contains_point( const wxRect& rect, int x, int y )
|
static inline bool rect_contains_point( const wxRect& rect, int x, int y )
|
||||||
@@ -68,8 +65,8 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
cbBarDragPlugin::cbBarDragPlugin(void)
|
cbBarDragPlugin::cbBarDragPlugin(void)
|
||||||
|
|
||||||
: mBarDragStarted ( FALSE ),
|
: mBarDragStarted ( false ),
|
||||||
mCanStick ( TRUE ),
|
mCanStick ( true ),
|
||||||
mpScrDc ( NULL ),
|
mpScrDc ( NULL ),
|
||||||
mpCurCursor ( NULL ),
|
mpCurCursor ( NULL ),
|
||||||
mpDraggedBar ( NULL ),
|
mpDraggedBar ( NULL ),
|
||||||
@@ -80,8 +77,8 @@ cbBarDragPlugin::cbBarDragPlugin( wxFrameLayout* pPanel, int paneMask )
|
|||||||
|
|
||||||
: cbPluginBase( pPanel, paneMask ),
|
: cbPluginBase( pPanel, paneMask ),
|
||||||
|
|
||||||
mBarDragStarted ( FALSE ),
|
mBarDragStarted ( false ),
|
||||||
mCanStick ( TRUE ),
|
mCanStick ( true ),
|
||||||
mpScrDc ( NULL ),
|
mpScrDc ( NULL ),
|
||||||
mpCurCursor ( NULL ),
|
mpCurCursor ( NULL ),
|
||||||
mpDraggedBar ( NULL ),
|
mpDraggedBar ( NULL ),
|
||||||
@@ -114,7 +111,6 @@ void do_clip_edges( int len, int& rectPos, int& rectLen )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( rectPos + rectLen - 1 > len )
|
if ( rectPos + rectLen - 1 > len )
|
||||||
|
|
||||||
rectLen -= (rectPos + rectLen) - len + 1;
|
rectLen -= (rectPos + rectLen) - len + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,9 +153,7 @@ cbDockPane* cbBarDragPlugin::HitTestPanes( wxRect& rect )
|
|||||||
cbDockPane** pPanes = mpLayout->GetPanesArray();
|
cbDockPane** pPanes = mpLayout->GetPanesArray();
|
||||||
|
|
||||||
for( int i = 0; i != MAX_PANES; ++i )
|
for( int i = 0; i != MAX_PANES; ++i )
|
||||||
|
|
||||||
if ( rect_hits_rect( pPanes[i]->mBoundsInParent, rect ) )
|
if ( rect_hits_rect( pPanes[i]->mBoundsInParent, rect ) )
|
||||||
|
|
||||||
return pPanes[i];
|
return pPanes[i];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -174,9 +168,7 @@ cbDockPane* cbBarDragPlugin::HitTestPanes( wxPoint& pos )
|
|||||||
cbDockPane** pPanes = mpLayout->GetPanesArray();
|
cbDockPane** pPanes = mpLayout->GetPanesArray();
|
||||||
|
|
||||||
for( int i = 0; i != MAX_PANES; ++i )
|
for( int i = 0; i != MAX_PANES; ++i )
|
||||||
|
|
||||||
if ( rect_contains_point( pPanes[i]->mBoundsInParent, clipped.x, clipped.y ) )
|
if ( rect_contains_point( pPanes[i]->mBoundsInParent, clipped.x, clipped.y ) )
|
||||||
|
|
||||||
return pPanes[i];
|
return pPanes[i];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -194,13 +186,9 @@ int cbBarDragPlugin::GetDistanceToPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
switch( pPane->mAlignment )
|
switch( pPane->mAlignment )
|
||||||
{
|
{
|
||||||
case FL_ALIGN_TOP : return mousePos.y - ( bounds.y + bounds.height );
|
case FL_ALIGN_TOP : return mousePos.y - ( bounds.y + bounds.height );
|
||||||
|
|
||||||
case FL_ALIGN_BOTTOM : return bounds.y - mousePos.y;
|
case FL_ALIGN_BOTTOM : return bounds.y - mousePos.y;
|
||||||
|
|
||||||
case FL_ALIGN_LEFT : return mousePos.x - ( bounds.x + bounds.width );
|
case FL_ALIGN_LEFT : return mousePos.x - ( bounds.x + bounds.width );
|
||||||
|
|
||||||
case FL_ALIGN_RIGHT : return bounds.x - mousePos.x;
|
case FL_ALIGN_RIGHT : return bounds.x - mousePos.x;
|
||||||
|
|
||||||
default : return 0; // never reached
|
default : return 0; // never reached
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,8 +199,8 @@ bool cbBarDragPlugin::IsInOtherPane( wxPoint& mousePos )
|
|||||||
{
|
{
|
||||||
cbDockPane* pPane = HitTestPanes( mousePos );
|
cbDockPane* pPane = HitTestPanes( mousePos );
|
||||||
|
|
||||||
if ( pPane && pPane != mpCurPane ) return TRUE;
|
if ( pPane && pPane != mpCurPane ) return true;
|
||||||
else return FALSE;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cbBarDragPlugin::IsInClientArea( wxPoint& mousePos )
|
bool cbBarDragPlugin::IsInClientArea( wxPoint& mousePos )
|
||||||
@@ -253,14 +241,12 @@ void cbBarDragPlugin::CalcOnScreenDims( wxRect& rect )
|
|||||||
static inline void check_upper_overrun( int& pos, int width, int mousePos )
|
static inline void check_upper_overrun( int& pos, int width, int mousePos )
|
||||||
{
|
{
|
||||||
if ( mousePos >= pos + width )
|
if ( mousePos >= pos + width )
|
||||||
|
|
||||||
pos = mousePos - width/2;
|
pos = mousePos - width/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void check_lower_overrun( int& pos, int width, int mousePos )
|
static inline void check_lower_overrun( int& pos, int width, int mousePos )
|
||||||
{
|
{
|
||||||
if ( mousePos <= pos )
|
if ( mousePos <= pos )
|
||||||
|
|
||||||
pos = mousePos - width/2;
|
pos = mousePos - width/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +272,7 @@ void cbBarDragPlugin::StickToPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
|
|
||||||
wxRect& bounds = pPane->mBoundsInParent;
|
wxRect& bounds = pPane->mBoundsInParent;
|
||||||
|
|
||||||
// TRUE, if hint enters the pane through it's lower edge
|
// true, if hint enters the pane through it's lower edge
|
||||||
|
|
||||||
bool fromLowerEdge = ( pPane->IsHorizontal() )
|
bool fromLowerEdge = ( pPane->IsHorizontal() )
|
||||||
? mousePos.y > bounds.y
|
? mousePos.y > bounds.y
|
||||||
@@ -360,7 +346,7 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
|
|
||||||
wxRect& bounds = pPane->mBoundsInParent;
|
wxRect& bounds = pPane->mBoundsInParent;
|
||||||
|
|
||||||
// TRUE, if hint leaves the pane through it's lower edge
|
// true, if hint leaves the pane through it's lower edge
|
||||||
|
|
||||||
bool fromLowerEdge = ( pPane->IsHorizontal() )
|
bool fromLowerEdge = ( pPane->IsHorizontal() )
|
||||||
? mousePos.y > bounds.y
|
? mousePos.y > bounds.y
|
||||||
@@ -379,7 +365,6 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
// this is how MFC's hint behaves:
|
// this is how MFC's hint behaves:
|
||||||
|
|
||||||
if ( mMouseInRectX > newWidth )
|
if ( mMouseInRectX > newWidth )
|
||||||
|
|
||||||
mHintRect.x = mousePos.x - ( newWidth / 2 );
|
mHintRect.x = mousePos.x - ( newWidth / 2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -390,7 +375,6 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
// -/-
|
// -/-
|
||||||
|
|
||||||
if ( mMouseInRectX > newWidth )
|
if ( mMouseInRectX > newWidth )
|
||||||
|
|
||||||
mHintRect.x = mousePos.x - ( newWidth / 2 );
|
mHintRect.x = mousePos.x - ( newWidth / 2 );
|
||||||
|
|
||||||
check_lower_overrun( mHintRect.y, newHeight, mousePos.y );
|
check_lower_overrun( mHintRect.y, newHeight, mousePos.y );
|
||||||
@@ -403,7 +387,6 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
// -/-
|
// -/-
|
||||||
|
|
||||||
if ( mMouseInRectY > newHeight )
|
if ( mMouseInRectY > newHeight )
|
||||||
|
|
||||||
mHintRect.y = mousePos.y - ( newHeight / 2 );
|
mHintRect.y = mousePos.y - ( newHeight / 2 );
|
||||||
|
|
||||||
check_upper_overrun( mHintRect.x, newWidth, mousePos.x );
|
check_upper_overrun( mHintRect.x, newWidth, mousePos.x );
|
||||||
@@ -416,7 +399,6 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
// -/-
|
// -/-
|
||||||
|
|
||||||
if ( mMouseInRectY > newHeight )
|
if ( mMouseInRectY > newHeight )
|
||||||
|
|
||||||
mHintRect.y = mousePos.y - ( newHeight / 2 );
|
mHintRect.y = mousePos.y - ( newHeight / 2 );
|
||||||
|
|
||||||
check_lower_overrun( mHintRect.x, newWidth, mousePos.x );
|
check_lower_overrun( mHintRect.x, newWidth, mousePos.x );
|
||||||
@@ -431,13 +413,11 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
|||||||
int cbBarDragPlugin::GetBarWidthInPane( cbDockPane* pPane )
|
int cbBarDragPlugin::GetBarWidthInPane( cbDockPane* pPane )
|
||||||
{
|
{
|
||||||
if ( pPane == mpSrcPane )
|
if ( pPane == mpSrcPane )
|
||||||
|
|
||||||
return mBarWidthInSrcPane;
|
return mBarWidthInSrcPane;
|
||||||
|
|
||||||
// this is how MFC's bars behave:
|
// this is how MFC's bars behave:
|
||||||
|
|
||||||
if ( pPane->IsHorizontal() )
|
if ( pPane->IsHorizontal() )
|
||||||
|
|
||||||
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_HORIZONTALLY].x;
|
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_HORIZONTALLY].x;
|
||||||
else
|
else
|
||||||
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_VERTICALLY ].x;
|
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_VERTICALLY ].x;
|
||||||
@@ -446,7 +426,6 @@ int cbBarDragPlugin::GetBarWidthInPane( cbDockPane* pPane )
|
|||||||
int cbBarDragPlugin::GetBarHeightInPane( cbDockPane* pPane )
|
int cbBarDragPlugin::GetBarHeightInPane( cbDockPane* pPane )
|
||||||
{
|
{
|
||||||
if ( pPane->IsHorizontal() )
|
if ( pPane->IsHorizontal() )
|
||||||
|
|
||||||
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_HORIZONTALLY].y;
|
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_HORIZONTALLY].y;
|
||||||
else
|
else
|
||||||
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_VERTICALLY ].y;
|
return mpDraggedBar->mDimInfo.mSizes[wxCBAR_DOCKED_VERTICALLY ].y;
|
||||||
@@ -454,10 +433,9 @@ int cbBarDragPlugin::GetBarHeightInPane( cbDockPane* pPane )
|
|||||||
|
|
||||||
void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
||||||
{
|
{
|
||||||
bool wasDocked = FALSE;
|
bool wasDocked = false;
|
||||||
|
|
||||||
|
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == false )
|
||||||
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == FALSE )
|
|
||||||
{
|
{
|
||||||
// do heavy calculations first
|
// do heavy calculations first
|
||||||
|
|
||||||
@@ -468,7 +446,7 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
|||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
bool success =
|
bool success =
|
||||||
#endif
|
#endif
|
||||||
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, false );
|
||||||
|
|
||||||
wxASSERT( success ); // DBG::
|
wxASSERT( success ); // DBG::
|
||||||
|
|
||||||
@@ -485,14 +463,14 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
|||||||
{
|
{
|
||||||
// erase previous rectangle
|
// erase previous rectangle
|
||||||
|
|
||||||
cbDrawHintRectEvent evt( mPrevHintRect, prevWasInClient, TRUE, FALSE );
|
cbDrawHintRectEvent evt( mPrevHintRect, prevWasInClient, true, false );
|
||||||
|
|
||||||
mpLayout->FirePluginEvent( evt );
|
mpLayout->FirePluginEvent( evt );
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw new hint
|
// draw new hint
|
||||||
|
|
||||||
cbDrawHintRectEvent evt( actualRect, mpCurPane == NULL, FALSE, FALSE );
|
cbDrawHintRectEvent evt( actualRect, mpCurPane == NULL, false, false );
|
||||||
|
|
||||||
mpLayout->FirePluginEvent( evt );
|
mpLayout->FirePluginEvent( evt );
|
||||||
|
|
||||||
@@ -504,14 +482,14 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
|||||||
|
|
||||||
if ( mpDraggedBar->mState != wxCBAR_FLOATING && !mpCurPane )
|
if ( mpDraggedBar->mState != wxCBAR_FLOATING && !mpCurPane )
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState( mpDraggedBar, wxCBAR_FLOATING, TRUE );
|
mpLayout->SetBarState( mpDraggedBar, wxCBAR_FLOATING, true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( mpDraggedBar->mState == wxCBAR_FLOATING && mpCurPane )
|
if ( mpDraggedBar->mState == wxCBAR_FLOATING && mpCurPane )
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, FALSE );
|
mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, false );
|
||||||
|
|
||||||
wasDocked = TRUE;
|
wasDocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mpCurPane )
|
if ( mpCurPane )
|
||||||
@@ -520,12 +498,12 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
|||||||
|
|
||||||
if ( wasDocked )
|
if ( wasDocked )
|
||||||
|
|
||||||
mpDraggedBar->mUMgrData.SetDirty( TRUE );
|
mpDraggedBar->mUMgrData.SetDirty( true );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
bool success =
|
bool success =
|
||||||
#endif
|
#endif
|
||||||
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, false );
|
||||||
|
|
||||||
wxASSERT( success ); // DBG ::
|
wxASSERT( success ); // DBG ::
|
||||||
|
|
||||||
@@ -572,14 +550,12 @@ void cbBarDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
{
|
{
|
||||||
cbDockPane* pPane = HitTestPanes( mHintRect );
|
cbDockPane* pPane = HitTestPanes( mHintRect );
|
||||||
|
|
||||||
if ( !pPane )
|
|
||||||
|
|
||||||
// enable sticking again, if we've left the pane completely
|
// enable sticking again, if we've left the pane completely
|
||||||
mCanStick = TRUE;
|
if ( !pPane )
|
||||||
|
mCanStick = true;
|
||||||
|
|
||||||
if ( mCanStick && pPane &&
|
if ( mCanStick && pPane &&
|
||||||
GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
|
GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
|
||||||
|
|
||||||
StickToPane( pPane, mousePos );
|
StickToPane( pPane, mousePos );
|
||||||
else
|
else
|
||||||
if ( pPane && HitTestPanes( mousePos ) == pPane && 0 ) // FOR NOW:: disabled
|
if ( pPane && HitTestPanes( mousePos ) == pPane && 0 ) // FOR NOW:: disabled
|
||||||
@@ -591,7 +567,7 @@ void cbBarDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
// otherwise, when rect is now sticked to some of the panes
|
// otherwise, when rect is now sticked to some of the panes
|
||||||
// check if it should still remain in this pane
|
// check if it should still remain in this pane
|
||||||
|
|
||||||
mCanStick = TRUE;
|
mCanStick = true;
|
||||||
|
|
||||||
bool mouseInOther = IsInOtherPane( mousePos );
|
bool mouseInOther = IsInOtherPane( mousePos );
|
||||||
|
|
||||||
@@ -610,7 +586,6 @@ void cbBarDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
if ( pPane &&
|
if ( pPane &&
|
||||||
pPane != mpCurPane &&
|
pPane != mpCurPane &&
|
||||||
GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
|
GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
|
||||||
|
|
||||||
StickToPane( pPane, mousePos );
|
StickToPane( pPane, mousePos );
|
||||||
else
|
else
|
||||||
if ( !pPane )
|
if ( !pPane )
|
||||||
@@ -618,7 +593,7 @@ void cbBarDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
UnstickFromPane( mpCurPane, mousePos );
|
UnstickFromPane( mpCurPane, mousePos );
|
||||||
|
|
||||||
// FOR NOW:: disabled, would cause some mess
|
// FOR NOW:: disabled, would cause some mess
|
||||||
//mCanStick = FALSE; // prevents from sticking to this
|
// mCanStick = false; // prevents from sticking to this
|
||||||
// pane again, flag is reset when hint-rect
|
// pane again, flag is reset when hint-rect
|
||||||
// leaves the pane completely
|
// leaves the pane completely
|
||||||
}
|
}
|
||||||
@@ -630,16 +605,13 @@ void cbBarDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
UnstickFromPane( mpCurPane, mousePos );
|
UnstickFromPane( mpCurPane, mousePos );
|
||||||
|
|
||||||
// FOR NOW:: disabled, would cause some mess
|
// FOR NOW:: disabled, would cause some mess
|
||||||
//mCanStick = FALSE; // prevents from sticking to this
|
// mCanStick = false; // prevents from sticking to this
|
||||||
// pane again, flag is reset when hint-rect
|
// pane again, flag is reset when hint-rect
|
||||||
// leaves the pane completely
|
// leaves the pane completely
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,11 +657,11 @@ void cbBarDragPlugin::OnLButtonUp( cbLeftUpEvent& event )
|
|||||||
{
|
{
|
||||||
if ( mBarDragStarted )
|
if ( mBarDragStarted )
|
||||||
{
|
{
|
||||||
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == FALSE )
|
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == false )
|
||||||
{
|
{
|
||||||
// erase current rectangle, and finsih on-screen drawing session
|
// erase current rectangle, and finsih on-screen drawing session
|
||||||
|
|
||||||
cbDrawHintRectEvent evt( mPrevHintRect, mpCurPane == NULL, TRUE, TRUE );
|
cbDrawHintRectEvent evt( mPrevHintRect, mpCurPane == NULL, true, true );
|
||||||
|
|
||||||
mpLayout->FirePluginEvent( evt );
|
mpLayout->FirePluginEvent( evt );
|
||||||
|
|
||||||
@@ -697,7 +669,7 @@ void cbBarDragPlugin::OnLButtonUp( cbLeftUpEvent& event )
|
|||||||
{
|
{
|
||||||
if ( mpSrcPane->mProps.mExactDockPredictionOn )
|
if ( mpSrcPane->mProps.mExactDockPredictionOn )
|
||||||
{
|
{
|
||||||
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, false );
|
||||||
|
|
||||||
mpLayout->GetUpdatesManager().OnFinishChanges();
|
mpLayout->GetUpdatesManager().OnFinishChanges();
|
||||||
mpLayout->GetUpdatesManager().UpdateNow();
|
mpLayout->GetUpdatesManager().UpdateNow();
|
||||||
@@ -706,7 +678,7 @@ void cbBarDragPlugin::OnLButtonUp( cbLeftUpEvent& event )
|
|||||||
{
|
{
|
||||||
if (mpDraggedBar->mState == wxCBAR_FLOATING)
|
if (mpDraggedBar->mState == wxCBAR_FLOATING)
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, TRUE);
|
mpLayout->SetBarState( mpDraggedBar, wxCBAR_DOCKED_HORIZONTALLY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane );
|
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane );
|
||||||
@@ -737,7 +709,7 @@ void cbBarDragPlugin::OnLButtonUp( cbLeftUpEvent& event )
|
|||||||
mpLayout->ReleaseEventsFromPane( event.mpPane );
|
mpLayout->ReleaseEventsFromPane( event.mpPane );
|
||||||
mpLayout->ReleaseEventsFromPlugin( this );
|
mpLayout->ReleaseEventsFromPlugin( this );
|
||||||
|
|
||||||
mBarDragStarted = FALSE;
|
mBarDragStarted = false;
|
||||||
|
|
||||||
if ( mBarWasFloating && mpDraggedBar->mState != wxCBAR_FLOATING )
|
if ( mBarWasFloating && mpDraggedBar->mState != wxCBAR_FLOATING )
|
||||||
{
|
{
|
||||||
@@ -763,14 +735,14 @@ void cbBarDragPlugin::OnLDblClick( cbLeftDClickEvent& event )
|
|||||||
&pHittedBar ) == CB_BAR_CONTENT_HITTED
|
&pHittedBar ) == CB_BAR_CONTENT_HITTED
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState( pHittedBar, wxCBAR_FLOATING, TRUE );
|
mpLayout->SetBarState( pHittedBar, wxCBAR_FLOATING, true );
|
||||||
|
|
||||||
mpLayout->RepositionFloatedBar( pHittedBar );
|
mpLayout->RepositionFloatedBar( pHittedBar );
|
||||||
|
|
||||||
return; // event is "eaten" by this plugin
|
return; // event is "eaten" by this plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
mBarDragStarted = FALSE;
|
mBarDragStarted = false;
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
@@ -788,7 +760,7 @@ void cbBarDragPlugin::OnStartBarDragging( cbStartBarDraggingEvent& event )
|
|||||||
|
|
||||||
mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
|
mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
|
||||||
|
|
||||||
mBarDragStarted = TRUE;
|
mBarDragStarted = true;
|
||||||
|
|
||||||
wxRect inParent = mpDraggedBar->mBounds;
|
wxRect inParent = mpDraggedBar->mBounds;
|
||||||
|
|
||||||
@@ -820,14 +792,13 @@ void cbBarDragPlugin::OnStartBarDragging( cbStartBarDraggingEvent& event )
|
|||||||
|
|
||||||
mPrevHintRect.x = POS_UNDEFINED;
|
mPrevHintRect.x = POS_UNDEFINED;
|
||||||
|
|
||||||
mCanStick = FALSE; // we're not stuck into any pane now -
|
mCanStick = false; // we're not stuck into any pane now -
|
||||||
// there's nowhere to "stick-twice"
|
// there's nowhere to "stick-twice"
|
||||||
|
|
||||||
mBarWidthInSrcPane = mpDraggedBar->mDimInfo.mSizes[ mpDraggedBar->mState ].x;
|
mBarWidthInSrcPane = mpDraggedBar->mDimInfo.mSizes[ mpDraggedBar->mState ].x;
|
||||||
|
|
||||||
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == FALSE &&
|
if ( mpSrcPane->mProps.mRealTimeUpdatesOn == false &&
|
||||||
mpSrcPane->mProps.mExactDockPredictionOn )
|
mpSrcPane->mProps.mExactDockPredictionOn )
|
||||||
|
|
||||||
mpLayout->GetUpdatesManager().OnStartChanges(); // capture initial state of layout
|
mpLayout->GetUpdatesManager().OnStartChanges(); // capture initial state of layout
|
||||||
|
|
||||||
// simulate the first mouse movement
|
// simulate the first mouse movement
|
||||||
@@ -853,7 +824,6 @@ void cbBarDragPlugin::OnDrawHintRect( cbDrawHintRectEvent& event )
|
|||||||
DoDrawHintRect( event.mRect, event.mIsInClient );
|
DoDrawHintRect( event.mRect, event.mIsInClient );
|
||||||
|
|
||||||
if ( event.mLastTime )
|
if ( event.mLastTime )
|
||||||
|
|
||||||
FinishTracking();
|
FinishTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -61,9 +61,9 @@ END_EVENT_TABLE()
|
|||||||
cbBarHintsPlugin::cbBarHintsPlugin(void)
|
cbBarHintsPlugin::cbBarHintsPlugin(void)
|
||||||
|
|
||||||
: mpPane( 0 ),
|
: mpPane( 0 ),
|
||||||
mBtnPressed ( FALSE ),
|
mBtnPressed ( false ),
|
||||||
mCloseBoxOn ( TRUE ),
|
mCloseBoxOn ( true ),
|
||||||
mCollapseBoxOn( TRUE ),
|
mCollapseBoxOn( true ),
|
||||||
mGrooveCount ( 2 ),
|
mGrooveCount ( 2 ),
|
||||||
mHintGap ( 4 ),
|
mHintGap ( 4 ),
|
||||||
mXWeight ( 2 )
|
mXWeight ( 2 )
|
||||||
@@ -76,9 +76,9 @@ cbBarHintsPlugin::cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask )
|
|||||||
|
|
||||||
: cbPluginBase( pLayout, paneMask ),
|
: cbPluginBase( pLayout, paneMask ),
|
||||||
mpPane( 0 ),
|
mpPane( 0 ),
|
||||||
mBtnPressed ( FALSE ),
|
mBtnPressed ( false ),
|
||||||
mCloseBoxOn ( TRUE ),
|
mCloseBoxOn ( true ),
|
||||||
mCollapseBoxOn( TRUE ),
|
mCollapseBoxOn( true ),
|
||||||
mGrooveCount ( 2 ),
|
mGrooveCount ( 2 ),
|
||||||
mHintGap ( 5 ),
|
mHintGap ( 5 ),
|
||||||
mXWeight ( 2 )
|
mXWeight ( 2 )
|
||||||
@@ -280,7 +280,7 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info,
|
|||||||
|
|
||||||
if ( info.IsExpanded() )
|
if ( info.IsExpanded() )
|
||||||
{
|
{
|
||||||
isAtLeft = FALSE;
|
isAtLeft = false;
|
||||||
|
|
||||||
cbBarInfo* pCur = info.mpPrev;
|
cbBarInfo* pCur = info.mpPrev;
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info,
|
|||||||
{
|
{
|
||||||
if ( !pCur->IsFixed() )
|
if ( !pCur->IsFixed() )
|
||||||
{
|
{
|
||||||
isAtLeft = TRUE; break;
|
isAtLeft = true; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCur = pCur->mpPrev;
|
pCur = pCur->mpPrev;
|
||||||
@@ -363,7 +363,7 @@ int cbBarHintsPlugin::HitTestHints( cbBarInfo& info, const wxPoint& pos )
|
|||||||
|
|
||||||
wxRect& rect = info.mBoundsInParent;
|
wxRect& rect = info.mBoundsInParent;
|
||||||
|
|
||||||
if ( info.IsFixed() ) return FALSE;
|
if ( info.IsFixed() ) return false;
|
||||||
|
|
||||||
int boxOfs, grooveOfs, coord;
|
int boxOfs, grooveOfs, coord;
|
||||||
|
|
||||||
@@ -413,7 +413,7 @@ int cbBarHintsPlugin::HitTestHints( cbBarInfo& info, const wxPoint& pos )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handlers for plugin-events
|
// handlers for plugin-events
|
||||||
@@ -468,8 +468,8 @@ void cbBarHintsPlugin::OnLeftDown( cbLeftDownEvent& event )
|
|||||||
int i;
|
int i;
|
||||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||||
{
|
{
|
||||||
mBoxes[i]->mPressed = FALSE;
|
mBoxes[i]->mPressed = false;
|
||||||
mBoxes[i]->mWasClicked = FALSE;
|
mBoxes[i]->mWasClicked = false;
|
||||||
}
|
}
|
||||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||||
{
|
{
|
||||||
@@ -477,7 +477,7 @@ void cbBarHintsPlugin::OnLeftDown( cbLeftDownEvent& event )
|
|||||||
|
|
||||||
if ( mBoxes[i]->mPressed )
|
if ( mBoxes[i]->mPressed )
|
||||||
{
|
{
|
||||||
mBtnPressed = TRUE;
|
mBtnPressed = true;
|
||||||
mpClickedBar = &bar;
|
mpClickedBar = &bar;
|
||||||
|
|
||||||
return; // event handled
|
return; // event handled
|
||||||
@@ -511,7 +511,7 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event )
|
|||||||
{
|
{
|
||||||
if ( i == 0 )
|
if ( i == 0 )
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState( mpClickedBar, wxCBAR_HIDDEN, TRUE );
|
mpLayout->SetBarState( mpClickedBar, wxCBAR_HIDDEN, true );
|
||||||
// Notify bar child window of close event:
|
// Notify bar child window of close event:
|
||||||
if(mpClickedBar->mpBarWnd!=NULL)
|
if(mpClickedBar->mpBarWnd!=NULL)
|
||||||
mpClickedBar->mpBarWnd->Close();
|
mpClickedBar->mpBarWnd->Close();
|
||||||
@@ -526,7 +526,7 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mBtnPressed = FALSE;
|
mBtnPressed = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -114,9 +114,9 @@ void cbSimpleCustomizationPlugin::OnCustomizeLayout( cbCustomizeLayoutEvent& eve
|
|||||||
|
|
||||||
wxString* pHelpStr = ( isHidden ) ? &helpStr1 : &helpStr2;
|
wxString* pHelpStr = ( isHidden ) ? &helpStr1 : &helpStr2;
|
||||||
|
|
||||||
pMenu->Append( id, bar.mName, *pHelpStr, TRUE );
|
pMenu->Append( id, bar.mName, *pHelpStr, true );
|
||||||
|
|
||||||
pMenu->Check( id, (isHidden == FALSE) );
|
pMenu->Check( id, (isHidden == false) );
|
||||||
|
|
||||||
++id;
|
++id;
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ void cbSimpleCustomizationPlugin::OnCustomizeLayout( cbCustomizeLayoutEvent& eve
|
|||||||
// Customization dialog not implemented, so don't show the menu item
|
// Customization dialog not implemented, so don't show the menu item
|
||||||
#if 0
|
#if 0
|
||||||
pMenu->AppendSeparator();
|
pMenu->AppendSeparator();
|
||||||
pMenu->Append( id, "Customize...", "Show layout customization dialog", FALSE );
|
pMenu->Append( id, "Customize...", "Show layout customization dialog", false );
|
||||||
#endif
|
#endif
|
||||||
mCustMenuItemId = id;
|
mCustMenuItemId = id;
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ void cbSimpleCustomizationPlugin::OnCustomizeLayout( cbCustomizeLayoutEvent& eve
|
|||||||
|
|
||||||
// FOR NOW FOR NOW:: to work-around wxFrame's (MSW) nasty event-handling bugs!!!
|
// FOR NOW FOR NOW:: to work-around wxFrame's (MSW) nasty event-handling bugs!!!
|
||||||
|
|
||||||
wxWindow* pTmpWnd = new wxWindow( pFrm, -1, event.mClickPos, wxSize(0,0) );
|
wxWindow* pTmpWnd = new wxWindow( pFrm, wxID_ANY, event.mClickPos, wxSize(0,0) );
|
||||||
|
|
||||||
pMenu->SetEventHandler( pHandler );
|
pMenu->SetEventHandler( pHandler );
|
||||||
|
|
||||||
@@ -159,9 +159,7 @@ void cbSimpleCustomizationPlugin::OnMenuItemSelected( wxCommandEvent& event )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cbBarInfo* pBar = mpLayout->GetBars()[ event.GetId() -
|
cbBarInfo* pBar = mpLayout->GetBars()[ event.GetId() - CB_CUSTOMIZE_MENU_FIRST_ITEM_ID ];
|
||||||
CB_CUSTOMIZE_MENU_FIRST_ITEM_ID
|
|
||||||
];
|
|
||||||
|
|
||||||
wxASSERT( pBar ); // DBG::
|
wxASSERT( pBar ); // DBG::
|
||||||
|
|
||||||
@@ -193,10 +191,9 @@ void cbSimpleCustomizationPlugin::OnMenuItemSelected( wxCommandEvent& event )
|
|||||||
pBar->mAlignment = -1;
|
pBar->mAlignment = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mpLayout->SetBarState( pBar, newState, TRUE );
|
mpLayout->SetBarState( pBar, newState, true );
|
||||||
|
|
||||||
if ( newState == wxCBAR_FLOATING )
|
if ( newState == wxCBAR_FLOATING )
|
||||||
|
|
||||||
mpLayout->RepositionFloatedBar( pBar );
|
mpLayout->RepositionFloatedBar( pBar );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -235,7 +235,7 @@ bool cbBarSpy::ProcessEvent(wxEvent& event)
|
|||||||
else
|
else
|
||||||
mpLayout->OnLDblClick( mevent );
|
mpLayout->OnLDblClick( mevent );
|
||||||
|
|
||||||
//event.Skip(FALSE);
|
//event.Skip(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
@@ -289,9 +289,9 @@ wxFrameLayout::wxFrameLayout(void)
|
|||||||
mpTopPlugin ( NULL ),
|
mpTopPlugin ( NULL ),
|
||||||
mpCaputesInput( NULL ),
|
mpCaputesInput( NULL ),
|
||||||
|
|
||||||
mClientWndRefreshPending( FALSE ),
|
mClientWndRefreshPending( false ),
|
||||||
mRecalcPending( TRUE ),
|
mRecalcPending( true ),
|
||||||
mCheckFocusWhenIdle( FALSE )
|
mCheckFocusWhenIdle( false )
|
||||||
{
|
{
|
||||||
CreateCursors();
|
CreateCursors();
|
||||||
|
|
||||||
@@ -318,14 +318,14 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo
|
|||||||
mpPaneInFocus( NULL ),
|
mpPaneInFocus( NULL ),
|
||||||
mpLRUPane ( NULL ),
|
mpLRUPane ( NULL ),
|
||||||
|
|
||||||
mFloatingOn ( TRUE ),
|
mFloatingOn ( true ),
|
||||||
|
|
||||||
mpTopPlugin ( NULL ),
|
mpTopPlugin ( NULL ),
|
||||||
mpCaputesInput( NULL ),
|
mpCaputesInput( NULL ),
|
||||||
|
|
||||||
mClientWndRefreshPending( FALSE ),
|
mClientWndRefreshPending( false ),
|
||||||
mRecalcPending( TRUE ),
|
mRecalcPending( true ),
|
||||||
mCheckFocusWhenIdle( FALSE ),
|
mCheckFocusWhenIdle( false ),
|
||||||
|
|
||||||
mpUpdatesMgr( NULL )
|
mpUpdatesMgr( NULL )
|
||||||
{
|
{
|
||||||
@@ -354,13 +354,13 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo
|
|||||||
bool wxFrameLayout::CanReparent()
|
bool wxFrameLayout::CanReparent()
|
||||||
{
|
{
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
return TRUE;
|
return true;
|
||||||
#elif defined (__WXGTK__)
|
#elif defined (__WXGTK__)
|
||||||
//return TRUE;
|
//return true;
|
||||||
return FALSE;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
return FALSE; // reparenting is not yet supported by Motif and others
|
return false; // reparenting is not yet supported by Motif and others
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,14 +524,14 @@ void wxFrameLayout::Activate()
|
|||||||
{
|
{
|
||||||
HookUpToFrame();
|
HookUpToFrame();
|
||||||
|
|
||||||
RefreshNow( TRUE );
|
RefreshNow( true );
|
||||||
|
|
||||||
ShowFloatedWindows( TRUE );
|
ShowFloatedWindows( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameLayout::Deactivate()
|
void wxFrameLayout::Deactivate()
|
||||||
{
|
{
|
||||||
ShowFloatedWindows( FALSE );
|
ShowFloatedWindows( false );
|
||||||
|
|
||||||
UnhookFromFrame();
|
UnhookFromFrame();
|
||||||
|
|
||||||
@@ -619,7 +619,7 @@ bool wxFrameLayout::RedockBar( cbBarInfo* pBar,
|
|||||||
|
|
||||||
if ( !pToPane )
|
if ( !pToPane )
|
||||||
|
|
||||||
return FALSE; // bar's shape does not hit any pane
|
return false; // bar's shape does not hit any pane
|
||||||
// - redocking is NOT possible
|
// - redocking is NOT possible
|
||||||
|
|
||||||
cbDockPane* pBarPane = GetBarPane( pBar );
|
cbDockPane* pBarPane = GetBarPane( pBar );
|
||||||
@@ -635,11 +635,11 @@ bool wxFrameLayout::RedockBar( cbBarInfo* pBar,
|
|||||||
// but first the "pane-postion-changed" problem
|
// but first the "pane-postion-changed" problem
|
||||||
// has to be fixed
|
// has to be fixed
|
||||||
|
|
||||||
RecalcLayout( FALSE );
|
RecalcLayout( false );
|
||||||
|
|
||||||
pToPane->InsertBar( pBar, shapeInParent );
|
pToPane->InsertBar( pBar, shapeInParent );
|
||||||
|
|
||||||
RecalcLayout( FALSE );
|
RecalcLayout( false );
|
||||||
|
|
||||||
// finish update "transaction"
|
// finish update "transaction"
|
||||||
|
|
||||||
@@ -649,7 +649,7 @@ bool wxFrameLayout::RedockBar( cbBarInfo* pBar,
|
|||||||
GetUpdatesManager().UpdateNow();
|
GetUpdatesManager().UpdateNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cbBarInfo* wxFrameLayout::FindBarByName( const wxString& name )
|
cbBarInfo* wxFrameLayout::FindBarByName( const wxString& name )
|
||||||
@@ -687,7 +687,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
|||||||
|
|
||||||
GetUpdatesManager().OnStartChanges();
|
GetUpdatesManager().OnStartChanges();
|
||||||
|
|
||||||
pBar->mUMgrData.SetDirty(TRUE);
|
pBar->mUMgrData.SetDirty(true);
|
||||||
|
|
||||||
// check bar's previous state
|
// check bar's previous state
|
||||||
|
|
||||||
@@ -721,7 +721,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
|||||||
|
|
||||||
if ( pBar->mpBarWnd )
|
if ( pBar->mpBarWnd )
|
||||||
{
|
{
|
||||||
pBar->mpBarWnd->Show(FALSE); // to avoid flicker upon reparenting
|
pBar->mpBarWnd->Show(false); // to avoid flicker upon reparenting
|
||||||
|
|
||||||
wxNode* pNode = mFloatedFrames.GetFirst();
|
wxNode* pNode = mFloatedFrames.GetFirst();
|
||||||
|
|
||||||
@@ -731,7 +731,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
|||||||
|
|
||||||
if ( pFFrm->GetBar() == pBar )
|
if ( pFFrm->GetBar() == pBar )
|
||||||
{
|
{
|
||||||
pFFrm->Show( FALSE ); // reduces flicker sligthly
|
pFFrm->Show( false ); // reduces flicker sligthly
|
||||||
|
|
||||||
ReparentWindow( pBar->mpBarWnd, &GetParentFrame() );
|
ReparentWindow( pBar->mpBarWnd, &GetParentFrame() );
|
||||||
|
|
||||||
@@ -743,7 +743,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
|||||||
|
|
||||||
mFloatedFrames.DeleteNode( pNode );
|
mFloatedFrames.DeleteNode( pNode );
|
||||||
|
|
||||||
pFFrm->Show( FALSE );
|
pFFrm->Show( false );
|
||||||
pFFrm->Destroy(); break;
|
pFFrm->Destroy(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -753,7 +753,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
|||||||
// FOR NOW:: excessive!
|
// FOR NOW:: excessive!
|
||||||
//if ( mpFrameClient ) mpFrameClient->Refresh();
|
//if ( mpFrameClient ) mpFrameClient->Refresh();
|
||||||
if ( mpFrameClient )
|
if ( mpFrameClient )
|
||||||
mClientWndRefreshPending = TRUE;
|
mClientWndRefreshPending = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,7 +768,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
|||||||
|
|
||||||
if ( updateNow )
|
if ( updateNow )
|
||||||
{
|
{
|
||||||
RecalcLayout(FALSE);
|
RecalcLayout(false);
|
||||||
|
|
||||||
GetUpdatesManager().OnFinishChanges();
|
GetUpdatesManager().OnFinishChanges();
|
||||||
GetUpdatesManager().UpdateNow();
|
GetUpdatesManager().UpdateNow();
|
||||||
@@ -807,7 +807,7 @@ void wxFrameLayout::InverseVisibility( cbBarInfo* pBar )
|
|||||||
pBar->mAlignment = -1;
|
pBar->mAlignment = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->SetBarState( pBar, newState, TRUE );
|
this->SetBarState( pBar, newState, true );
|
||||||
|
|
||||||
if ( newState == wxCBAR_FLOATING )
|
if ( newState == wxCBAR_FLOATING )
|
||||||
|
|
||||||
@@ -875,7 +875,7 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
|
|||||||
|
|
||||||
if ( pBar->mpBarWnd )
|
if ( pBar->mpBarWnd )
|
||||||
|
|
||||||
pBar->mpBarWnd->Show( FALSE );
|
pBar->mpBarWnd->Show( false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -890,7 +890,7 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
|
|||||||
|
|
||||||
if ( pBar->mpBarWnd )
|
if ( pBar->mpBarWnd )
|
||||||
|
|
||||||
pBar->mpBarWnd->Show( FALSE );
|
pBar->mpBarWnd->Show( false );
|
||||||
|
|
||||||
pBar->mState = wxCBAR_HIDDEN;
|
pBar->mState = wxCBAR_HIDDEN;
|
||||||
|
|
||||||
@@ -902,7 +902,7 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
|
|||||||
pMiniFrm->SetBar( pBar );
|
pMiniFrm->SetBar( pBar );
|
||||||
pMiniFrm->SetLayout( this );
|
pMiniFrm->SetLayout( this );
|
||||||
|
|
||||||
pMiniFrm->Create( &GetParentFrame(), -1, pBar->mName,
|
pMiniFrm->Create( &GetParentFrame(), wxID_ANY, pBar->mName,
|
||||||
wxPoint( 50,50 ),
|
wxPoint( 50,50 ),
|
||||||
wxSize ( 0, 0 ),
|
wxSize ( 0, 0 ),
|
||||||
wxFRAME_FLOAT_ON_PARENT |
|
wxFRAME_FLOAT_ON_PARENT |
|
||||||
@@ -944,10 +944,10 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
|
|||||||
mNextFloatedWndPos.y += mFloatingPosStep.y;
|
mNextFloatedWndPos.y += mFloatingPosStep.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
pMiniFrm->Show( TRUE );
|
pMiniFrm->Show( true );
|
||||||
|
|
||||||
// FIXME:: this is excessive
|
// FIXME:: this is excessive
|
||||||
pBar->mpBarWnd->Show(TRUE);
|
pBar->mpBarWnd->Show(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -978,7 +978,7 @@ void wxFrameLayout::RemoveBar( cbBarInfo* pBarInfo )
|
|||||||
#endif
|
#endif
|
||||||
if ( pBarInfo->mpBarWnd ) // hides it's window
|
if ( pBarInfo->mpBarWnd ) // hides it's window
|
||||||
|
|
||||||
pBarInfo->mpBarWnd->Show( FALSE );
|
pBarInfo->mpBarWnd->Show( false );
|
||||||
|
|
||||||
delete pBarInfo;
|
delete pBarInfo;
|
||||||
|
|
||||||
@@ -1007,16 +1007,16 @@ bool wxFrameLayout::LocateBar( cbBarInfo* pBarInfo,
|
|||||||
(*ppPane) = mPanes[n];
|
(*ppPane) = mPanes[n];
|
||||||
(*ppRow ) = &i.RowInfo();
|
(*ppRow ) = &i.RowInfo();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
|
void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
|
||||||
{
|
{
|
||||||
mRecalcPending = FALSE;
|
mRecalcPending = false;
|
||||||
|
|
||||||
int frmWidth, frmHeight;
|
int frmWidth, frmHeight;
|
||||||
mpFrame->GetClientSize( &frmWidth, &frmHeight );
|
mpFrame->GetClientSize( &frmWidth, &frmHeight );
|
||||||
@@ -1142,10 +1142,10 @@ void wxFrameLayout::PositionClientWindow()
|
|||||||
|
|
||||||
if ( !mpFrameClient->IsShown() )
|
if ( !mpFrameClient->IsShown() )
|
||||||
|
|
||||||
mpFrameClient->Show( TRUE );
|
mpFrameClient->Show( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mpFrameClient->Show( FALSE );
|
mpFrameClient->Show( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1164,12 +1164,12 @@ void wxFrameLayout::PositionPanes()
|
|||||||
void wxFrameLayout::OnSize( wxSizeEvent& event )
|
void wxFrameLayout::OnSize( wxSizeEvent& event )
|
||||||
{
|
{
|
||||||
mpFrame->ProcessEvent( event );
|
mpFrame->ProcessEvent( event );
|
||||||
event.Skip( FALSE ); // stop its progpagation
|
event.Skip( false ); // stop its progpagation
|
||||||
|
|
||||||
if ( event.GetEventObject() == (wxObject*) mpFrame )
|
if ( event.GetEventObject() == (wxObject*) mpFrame )
|
||||||
{
|
{
|
||||||
GetUpdatesManager().OnStartChanges();
|
GetUpdatesManager().OnStartChanges();
|
||||||
RecalcLayout(TRUE);
|
RecalcLayout(true);
|
||||||
GetUpdatesManager().OnFinishChanges();
|
GetUpdatesManager().OnFinishChanges();
|
||||||
GetUpdatesManager().UpdateNow();
|
GetUpdatesManager().UpdateNow();
|
||||||
}
|
}
|
||||||
@@ -1183,15 +1183,15 @@ void wxFrameLayout::HideBarWindows()
|
|||||||
size_t i;
|
size_t i;
|
||||||
for ( i = 0; i != mAllBars.Count(); ++i )
|
for ( i = 0; i != mAllBars.Count(); ++i )
|
||||||
if ( mAllBars[i]->mpBarWnd && mAllBars[i]->mState != wxCBAR_FLOATING )
|
if ( mAllBars[i]->mpBarWnd && mAllBars[i]->mState != wxCBAR_FLOATING )
|
||||||
mAllBars[i]->mpBarWnd->Show( FALSE );
|
mAllBars[i]->mpBarWnd->Show( false );
|
||||||
|
|
||||||
// then floated frames
|
// then floated frames
|
||||||
|
|
||||||
ShowFloatedWindows( FALSE );
|
ShowFloatedWindows( false );
|
||||||
|
|
||||||
if ( mpFrameClient )
|
if ( mpFrameClient )
|
||||||
|
|
||||||
mpFrameClient->Show( FALSE );
|
mpFrameClient->Show( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameLayout::UnhookFromFrame()
|
void wxFrameLayout::UnhookFromFrame()
|
||||||
@@ -1456,7 +1456,7 @@ void wxFrameLayout::OnMouseMove( wxMouseEvent& event )
|
|||||||
void wxFrameLayout::OnPaint( wxPaintEvent& event )
|
void wxFrameLayout::OnPaint( wxPaintEvent& event )
|
||||||
{
|
{
|
||||||
if ( mRecalcPending )
|
if ( mRecalcPending )
|
||||||
RecalcLayout( TRUE );
|
RecalcLayout( true );
|
||||||
|
|
||||||
wxPaintDC dc(mpFrame);
|
wxPaintDC dc(mpFrame);
|
||||||
|
|
||||||
@@ -1488,11 +1488,11 @@ void wxFrameLayout::OnIdle( wxIdleEvent& event )
|
|||||||
{
|
{
|
||||||
wxMessageBox(wxT("Hi, no more focus in this app!"));
|
wxMessageBox(wxT("Hi, no more focus in this app!"));
|
||||||
|
|
||||||
mCheckFocusWhenIdle = FALSE;
|
mCheckFocusWhenIdle = false;
|
||||||
//ShowFloatedWindows( FALSE );
|
//ShowFloatedWindows( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
mCheckFocusWhenIdle = FALSE;
|
mCheckFocusWhenIdle = false;
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
@@ -1501,24 +1501,24 @@ void wxFrameLayout::OnIdle( wxIdleEvent& event )
|
|||||||
void wxFrameLayout::OnKillFocus( wxFocusEvent& WXUNUSED(event) )
|
void wxFrameLayout::OnKillFocus( wxFocusEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
//wxMessageBox( "wxFrameLayoutGot Kill Focus!" );
|
//wxMessageBox( "wxFrameLayoutGot Kill Focus!" );
|
||||||
//ShowFloatedWindows( FALSE );
|
//ShowFloatedWindows( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameLayout::OnSetFocus( wxFocusEvent& WXUNUSED(event) )
|
void wxFrameLayout::OnSetFocus( wxFocusEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
//ShowFloatedWindows( TRUE );
|
//ShowFloatedWindows( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameLayout::OnActivate( wxActivateEvent& WXUNUSED(event) )
|
void wxFrameLayout::OnActivate( wxActivateEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if ( event.GetActive() == FALSE )
|
if ( event.GetActive() == false )
|
||||||
{
|
{
|
||||||
wxWindow* focus = wxWindow::FindFocus();
|
wxWindow* focus = wxWindow::FindFocus();
|
||||||
|
|
||||||
if ( !focus || focus == &GetParentFrame() )
|
if ( !focus || focus == &GetParentFrame() )
|
||||||
{
|
{
|
||||||
mCheckFocusWhenIdle = TRUE;
|
mCheckFocusWhenIdle = true;
|
||||||
|
|
||||||
if ( !focus )
|
if ( !focus )
|
||||||
|
|
||||||
@@ -1570,7 +1570,7 @@ void wxFrameLayout::SetPaneBackground( const wxColour& colour )
|
|||||||
void wxFrameLayout::RefreshNow( bool recalcLayout )
|
void wxFrameLayout::RefreshNow( bool recalcLayout )
|
||||||
{
|
{
|
||||||
if ( recalcLayout )
|
if ( recalcLayout )
|
||||||
RecalcLayout( TRUE );
|
RecalcLayout( true );
|
||||||
|
|
||||||
if ( mpFrame )
|
if ( mpFrame )
|
||||||
mpFrame->Refresh();
|
mpFrame->Refresh();
|
||||||
@@ -1584,14 +1584,14 @@ void wxFrameLayout::FirePluginEvent( cbPluginEvent& event )
|
|||||||
|
|
||||||
if ( mpCaputesInput )
|
if ( mpCaputesInput )
|
||||||
{
|
{
|
||||||
bool isInputEvt = TRUE;
|
bool isInputEvt = true;
|
||||||
#if wxCHECK_VERSION(2,3,0)
|
#if wxCHECK_VERSION(2,3,0)
|
||||||
if ( event.m_eventType != cbEVT_PL_LEFT_DOWN &&
|
if ( event.m_eventType != cbEVT_PL_LEFT_DOWN &&
|
||||||
event.m_eventType != cbEVT_PL_LEFT_UP &&
|
event.m_eventType != cbEVT_PL_LEFT_UP &&
|
||||||
event.m_eventType != cbEVT_PL_RIGHT_DOWN &&
|
event.m_eventType != cbEVT_PL_RIGHT_DOWN &&
|
||||||
event.m_eventType != cbEVT_PL_RIGHT_UP &&
|
event.m_eventType != cbEVT_PL_RIGHT_UP &&
|
||||||
event.m_eventType != cbEVT_PL_MOTION )
|
event.m_eventType != cbEVT_PL_MOTION )
|
||||||
isInputEvt = FALSE;
|
isInputEvt = false;
|
||||||
#else
|
#else
|
||||||
switch ( event.m_eventType )
|
switch ( event.m_eventType )
|
||||||
{
|
{
|
||||||
@@ -1601,7 +1601,7 @@ void wxFrameLayout::FirePluginEvent( cbPluginEvent& event )
|
|||||||
case cbEVT_PL_RIGHT_UP : break;
|
case cbEVT_PL_RIGHT_UP : break;
|
||||||
case cbEVT_PL_MOTION : break;
|
case cbEVT_PL_MOTION : break;
|
||||||
|
|
||||||
default : isInputEvt = FALSE; break;
|
default : isInputEvt = false; break;
|
||||||
}
|
}
|
||||||
#endif // #if wxCHECK_VERSION(2,3,0)
|
#endif // #if wxCHECK_VERSION(2,3,0)
|
||||||
|
|
||||||
@@ -1814,7 +1814,7 @@ IMPLEMENT_DYNAMIC_CLASS( cbUpdateMgrData, wxObject )
|
|||||||
cbUpdateMgrData::cbUpdateMgrData()
|
cbUpdateMgrData::cbUpdateMgrData()
|
||||||
|
|
||||||
: mPrevBounds( -1,-1,0,0 ),
|
: mPrevBounds( -1,-1,0,0 ),
|
||||||
mIsDirty( TRUE ) // inidicate initial change
|
mIsDirty( true ) // inidicate initial change
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void cbUpdateMgrData::StoreItemState( const wxRect& boundsInParent )
|
void cbUpdateMgrData::StoreItemState( const wxRect& boundsInParent )
|
||||||
@@ -1859,7 +1859,7 @@ bool wxBarIterator::Next()
|
|||||||
{
|
{
|
||||||
if ( mpRow->mBars.GetCount() == 0 )
|
if ( mpRow->mBars.GetCount() == 0 )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mpBar = mpRow->mBars[0];
|
mpBar = mpRow->mBars[0];
|
||||||
@@ -1875,13 +1875,13 @@ bool wxBarIterator::Next()
|
|||||||
|
|
||||||
mpBar = mpRow->mBars[0];
|
mpBar = mpRow->mBars[0];
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cbBarInfo& wxBarIterator::BarInfo()
|
cbBarInfo& wxBarIterator::BarInfo()
|
||||||
@@ -1921,7 +1921,7 @@ cbDimInfo::cbDimInfo()
|
|||||||
: mVertGap ( 0 ),
|
: mVertGap ( 0 ),
|
||||||
mHorizGap( 0 ),
|
mHorizGap( 0 ),
|
||||||
|
|
||||||
mIsFixed(TRUE),
|
mIsFixed(true),
|
||||||
mpHandler( NULL )
|
mpHandler( NULL )
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@@ -2053,16 +2053,16 @@ IMPLEMENT_DYNAMIC_CLASS( cbCommonPaneProperties, wxObject )
|
|||||||
|
|
||||||
cbCommonPaneProperties::cbCommonPaneProperties(void)
|
cbCommonPaneProperties::cbCommonPaneProperties(void)
|
||||||
|
|
||||||
: mRealTimeUpdatesOn ( TRUE ),
|
: mRealTimeUpdatesOn ( true ),
|
||||||
mOutOfPaneDragOn ( TRUE ),
|
mOutOfPaneDragOn ( true ),
|
||||||
mExactDockPredictionOn( FALSE ),
|
mExactDockPredictionOn( false ),
|
||||||
mNonDestructFrictionOn( FALSE ),
|
mNonDestructFrictionOn( false ),
|
||||||
mShow3DPaneBorderOn ( TRUE ),
|
mShow3DPaneBorderOn ( true ),
|
||||||
mBarFloatingOn ( FALSE ),
|
mBarFloatingOn ( false ),
|
||||||
mRowProportionsOn ( FALSE ),
|
mRowProportionsOn ( false ),
|
||||||
mColProportionsOn ( TRUE ),
|
mColProportionsOn ( true ),
|
||||||
mBarCollapseIconsOn ( FALSE ),
|
mBarCollapseIconsOn ( false ),
|
||||||
mBarDragHintsOn ( FALSE ),
|
mBarDragHintsOn ( false ),
|
||||||
|
|
||||||
mMinCBarDim( 16, 16 ),
|
mMinCBarDim( 16, 16 ),
|
||||||
mResizeHandleSize( 4 )
|
mResizeHandleSize( 4 )
|
||||||
@@ -2111,7 +2111,7 @@ IMPLEMENT_DYNAMIC_CLASS( cbRowInfo, wxObject )
|
|||||||
|
|
||||||
cbRowInfo::cbRowInfo(void)
|
cbRowInfo::cbRowInfo(void)
|
||||||
|
|
||||||
: mNotFixedBarsCnt( FALSE ),
|
: mNotFixedBarsCnt( false ),
|
||||||
mpNext ( NULL ),
|
mpNext ( NULL ),
|
||||||
mpPrev ( NULL ),
|
mpPrev ( NULL ),
|
||||||
mpExpandedBar ( NULL )
|
mpExpandedBar ( NULL )
|
||||||
@@ -2130,7 +2130,7 @@ IMPLEMENT_DYNAMIC_CLASS( cbBarInfo, wxObject )
|
|||||||
cbBarInfo::cbBarInfo(void)
|
cbBarInfo::cbBarInfo(void)
|
||||||
|
|
||||||
: mpRow( NULL ),
|
: mpRow( NULL ),
|
||||||
mFloatingOn( TRUE ),
|
mFloatingOn( true ),
|
||||||
mpNext( NULL ),
|
mpNext( NULL ),
|
||||||
mpPrev( NULL )
|
mpPrev( NULL )
|
||||||
{}
|
{}
|
||||||
@@ -2181,7 +2181,7 @@ cbDockPane::~cbDockPane()
|
|||||||
for ( i = 0; i != mRows.Count(); ++i )
|
for ( i = 0; i != mRows.Count(); ++i )
|
||||||
delete mRows[i];
|
delete mRows[i];
|
||||||
|
|
||||||
mRowShapeData.DeleteContents( TRUE );
|
mRowShapeData.DeleteContents( true );
|
||||||
|
|
||||||
// NOTE:: control bar infromation structures are cleaned-up
|
// NOTE:: control bar infromation structures are cleaned-up
|
||||||
// in wxFrameLayout's destructor, using global control-bar list
|
// in wxFrameLayout's destructor, using global control-bar list
|
||||||
@@ -2371,7 +2371,7 @@ void cbDockPane::RemoveBar( cbBarInfo* pBar )
|
|||||||
void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
|
void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
|
||||||
{
|
{
|
||||||
// setup mHasOnlyFixedBars flag for the row information
|
// setup mHasOnlyFixedBars flag for the row information
|
||||||
pRow->mHasOnlyFixedBars = TRUE;
|
pRow->mHasOnlyFixedBars = true;
|
||||||
|
|
||||||
pRow->mNotFixedBarsCnt = 0;
|
pRow->mNotFixedBarsCnt = 0;
|
||||||
|
|
||||||
@@ -2384,7 +2384,7 @@ void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
|
|||||||
|
|
||||||
if ( !bar.IsFixed() )
|
if ( !bar.IsFixed() )
|
||||||
{
|
{
|
||||||
pRow->mHasOnlyFixedBars = FALSE;
|
pRow->mHasOnlyFixedBars = false;
|
||||||
++pRow->mNotFixedBarsCnt;
|
++pRow->mNotFixedBarsCnt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2577,10 +2577,10 @@ bool cbDockPane::HasNotFixedRowsAbove( cbRowInfo* pRow )
|
|||||||
|
|
||||||
if ( pRow->mHasOnlyFixedBars )
|
if ( pRow->mHasOnlyFixedBars )
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cbDockPane::HasNotFixedRowsBelow( cbRowInfo* pRow )
|
bool cbDockPane::HasNotFixedRowsBelow( cbRowInfo* pRow )
|
||||||
@@ -2591,10 +2591,10 @@ bool cbDockPane::HasNotFixedRowsBelow( cbRowInfo* pRow )
|
|||||||
|
|
||||||
if ( pRow->mHasOnlyFixedBars )
|
if ( pRow->mHasOnlyFixedBars )
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cbDockPane::HasNotFixedBarsLeft( cbBarInfo* pBar )
|
bool cbDockPane::HasNotFixedBarsLeft( cbBarInfo* pBar )
|
||||||
@@ -2605,10 +2605,10 @@ bool cbDockPane::HasNotFixedBarsLeft( cbBarInfo* pBar )
|
|||||||
|
|
||||||
if ( pBar->IsFixed() )
|
if ( pBar->IsFixed() )
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
|
bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
|
||||||
@@ -2619,10 +2619,10 @@ bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
|
|||||||
|
|
||||||
if ( pBar->IsFixed() )
|
if ( pBar->IsFixed() )
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
|
void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
|
||||||
@@ -2700,7 +2700,7 @@ void cbDockPane::ExpandBar( cbBarInfo* pBar )
|
|||||||
|
|
||||||
pBar->mpRow->mpExpandedBar = pBar;
|
pBar->mpRow->mpExpandedBar = pBar;
|
||||||
|
|
||||||
mpLayout->RecalcLayout( FALSE );
|
mpLayout->RecalcLayout( false );
|
||||||
|
|
||||||
mpLayout->GetUpdatesManager().OnFinishChanges();
|
mpLayout->GetUpdatesManager().OnFinishChanges();
|
||||||
mpLayout->GetUpdatesManager().UpdateNow();
|
mpLayout->GetUpdatesManager().UpdateNow();
|
||||||
@@ -2737,7 +2737,7 @@ void cbDockPane::ContractBar( cbBarInfo* pBar )
|
|||||||
|
|
||||||
pBar->mpRow->mpExpandedBar = NULL;
|
pBar->mpRow->mpExpandedBar = NULL;
|
||||||
|
|
||||||
mpLayout->RecalcLayout( FALSE );
|
mpLayout->RecalcLayout( false );
|
||||||
|
|
||||||
mpLayout->GetUpdatesManager().OnFinishChanges();
|
mpLayout->GetUpdatesManager().OnFinishChanges();
|
||||||
mpLayout->GetUpdatesManager().UpdateNow();
|
mpLayout->GetUpdatesManager().UpdateNow();
|
||||||
@@ -2801,7 +2801,7 @@ void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo )
|
|||||||
{
|
{
|
||||||
pRow = mRows[rowNo];
|
pRow = mRows[rowNo];
|
||||||
|
|
||||||
if ( mProps.mNonDestructFrictionOn == TRUE )
|
if ( mProps.mNonDestructFrictionOn == true )
|
||||||
{
|
{
|
||||||
// store original shape of the row (before the bar is inserted)
|
// store original shape of the row (before the bar is inserted)
|
||||||
|
|
||||||
@@ -2850,8 +2850,8 @@ void cbDockPane::InsertBar( cbBarInfo* pBarInfo )
|
|||||||
// set transient properties
|
// set transient properties
|
||||||
|
|
||||||
pBarInfo->mpRow = NULL;
|
pBarInfo->mpRow = NULL;
|
||||||
pBarInfo->mHasLeftHandle = FALSE;
|
pBarInfo->mHasLeftHandle = false;
|
||||||
pBarInfo->mHasRightHandle = FALSE;
|
pBarInfo->mHasRightHandle = false;
|
||||||
pBarInfo->mLenRatio = 0.0;
|
pBarInfo->mLenRatio = 0.0;
|
||||||
|
|
||||||
// set preferred bar dimensions, according to the state in which
|
// set preferred bar dimensions, according to the state in which
|
||||||
@@ -2870,12 +2870,12 @@ void cbDockPane::RemoveRow( cbRowInfo* pRow )
|
|||||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||||
{
|
{
|
||||||
if ( pRow->mBars[i]->mpBarWnd )
|
if ( pRow->mBars[i]->mpBarWnd )
|
||||||
pRow->mBars[i]->mpBarWnd->Show( FALSE );
|
pRow->mBars[i]->mpBarWnd->Show( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
mRows.Remove( pRow );
|
mRows.Remove( pRow );
|
||||||
|
|
||||||
pRow->mUMgrData.SetDirty(TRUE);
|
pRow->mUMgrData.SetDirty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
|
void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
|
||||||
@@ -2888,11 +2888,11 @@ void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
|
|||||||
|
|
||||||
InitLinksForRows();
|
InitLinksForRows();
|
||||||
|
|
||||||
pRow->mUMgrData.SetDirty(TRUE);
|
pRow->mUMgrData.SetDirty(true);
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||||
pRow->mBars[i]->mUMgrData.SetDirty( TRUE );
|
pRow->mBars[i]->mUMgrData.SetDirty( true );
|
||||||
|
|
||||||
SyncRowFlags( pRow );
|
SyncRowFlags( pRow );
|
||||||
}
|
}
|
||||||
@@ -2997,9 +2997,9 @@ bool cbDockPane::BarPresent( cbBarInfo* pBar )
|
|||||||
|
|
||||||
while( iter.Next() )
|
while( iter.Next() )
|
||||||
|
|
||||||
if ( &iter.BarInfo() == pBar ) return TRUE;
|
if ( &iter.BarInfo() == pBar ) return true;
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cbRowInfo* cbDockPane::GetRow( int row )
|
cbRowInfo* cbDockPane::GetRow( int row )
|
||||||
@@ -3401,7 +3401,7 @@ void cbDockPane::ResizeBar( cbBarInfo* pBar, int ofs,
|
|||||||
|
|
||||||
InsertBar( pBar, pToRow );
|
InsertBar( pBar, pToRow );
|
||||||
|
|
||||||
mpLayout->RecalcLayout(FALSE);
|
mpLayout->RecalcLayout(false);
|
||||||
|
|
||||||
mpLayout->GetUpdatesManager().OnFinishChanges();
|
mpLayout->GetUpdatesManager().OnFinishChanges();
|
||||||
mpLayout->GetUpdatesManager().UpdateNow();
|
mpLayout->GetUpdatesManager().UpdateNow();
|
||||||
@@ -3472,7 +3472,7 @@ cbBarInfo* cbDockPane::GetBarInfoByWindow( wxWindow* pBarWnd )
|
|||||||
|
|
||||||
void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
|
void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
|
||||||
{
|
{
|
||||||
pLst->DeleteContents( TRUE );
|
pLst->DeleteContents( true );
|
||||||
pLst->Clear();
|
pLst->Clear();
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
@@ -3560,8 +3560,8 @@ bool cbPluginBase::ProcessEvent(wxEvent& event)
|
|||||||
|
|
||||||
if ( GetNextHandler() && GetNextHandler()->ProcessEvent( event ) )
|
if ( GetNextHandler() && GetNextHandler()->ProcessEvent( event ) )
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,17 +82,17 @@ bool wxDynamicToolBar::Create(wxWindow *parent, const wxWindowID id,
|
|||||||
// cut&pasted from wxtbatsmpl.h
|
// cut&pasted from wxtbatsmpl.h
|
||||||
|
|
||||||
if ( ! wxWindow::Create(parent, id, pos, size, style, name) )
|
if ( ! wxWindow::Create(parent, id, pos, size, style, name) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ));
|
SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDynamicToolBar::Realize(void)
|
bool wxDynamicToolBar::Realize(void)
|
||||||
{
|
{
|
||||||
// FOR NOW:: nothing
|
// FOR NOW:: nothing
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDynamicToolBar::~wxDynamicToolBar(void)
|
wxDynamicToolBar::~wxDynamicToolBar(void)
|
||||||
@@ -116,7 +116,7 @@ void wxDynamicToolBar::AddTool( int toolIndex,
|
|||||||
|
|
||||||
pInfo->mpToolWnd = pToolWindow;
|
pInfo->mpToolWnd = pToolWindow;
|
||||||
pInfo->mIndex = toolIndex;
|
pInfo->mIndex = toolIndex;
|
||||||
pInfo->mIsSeparator = FALSE;
|
pInfo->mIsSeparator = false;
|
||||||
|
|
||||||
int x,y;
|
int x,y;
|
||||||
pToolWindow->GetSize( &x, &y );
|
pToolWindow->GetSize( &x, &y );
|
||||||
@@ -238,7 +238,7 @@ void wxDynamicToolBar::AddSeparator( wxWindow* pSepartorWnd )
|
|||||||
|
|
||||||
pInfo->mpToolWnd = pSepartorWnd;
|
pInfo->mpToolWnd = pSepartorWnd;
|
||||||
pInfo->mIndex = -1;
|
pInfo->mIndex = -1;
|
||||||
pInfo->mIsSeparator = TRUE;
|
pInfo->mIsSeparator = true;
|
||||||
|
|
||||||
// Do we draw a separator or is a other object?
|
// Do we draw a separator or is a other object?
|
||||||
if ( pSepartorWnd )
|
if ( pSepartorWnd )
|
||||||
@@ -333,8 +333,8 @@ void wxDynamicToolBar::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void wxDynamicToolBar::SizeToolWindows()
|
void wxDynamicToolBar::SizeToolWindows()
|
||||||
{
|
{
|
||||||
bool bStateCheckDone = FALSE;
|
bool bStateCheckDone = false;
|
||||||
bool bHorzSeparator = FALSE;
|
bool bHorzSeparator = false;
|
||||||
int maxWidth = 0;
|
int maxWidth = 0;
|
||||||
int maxHeight = 0;
|
int maxHeight = 0;
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ void wxDynamicToolBar::SizeToolWindows()
|
|||||||
// separators and we do it only once (all to do with performance...)
|
// separators and we do it only once (all to do with performance...)
|
||||||
if (!bStateCheckDone)
|
if (!bStateCheckDone)
|
||||||
{
|
{
|
||||||
bStateCheckDone = TRUE;
|
bStateCheckDone = true;
|
||||||
|
|
||||||
size_t j;
|
size_t j;
|
||||||
wxDynToolInfo *pInfo;
|
wxDynToolInfo *pInfo;
|
||||||
@@ -464,7 +464,7 @@ bool wxDynamicToolBar::Layout()
|
|||||||
GetPreferredDim( wndDim, result );
|
GetPreferredDim( wndDim, result );
|
||||||
|
|
||||||
SizeToolWindows();
|
SizeToolWindows();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDynamicToolBar::GetPreferredDim( const wxSize& givenDim, wxSize& prefDim )
|
void wxDynamicToolBar::GetPreferredDim( const wxSize& givenDim, wxSize& prefDim )
|
||||||
@@ -576,12 +576,12 @@ wxToolBarToolBase* wxDynamicToolBar::FindToolForPosition( wxCoord WXUNUSED(x), w
|
|||||||
|
|
||||||
bool wxDynamicToolBar::DoInsertTool( size_t WXUNUSED(pos), wxToolBarToolBase* WXUNUSED(tool) )
|
bool wxDynamicToolBar::DoInsertTool( size_t WXUNUSED(pos), wxToolBarToolBase* WXUNUSED(tool) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDynamicToolBar::DoDeleteTool( size_t WXUNUSED(pos), wxToolBarToolBase* WXUNUSED(tool) )
|
bool wxDynamicToolBar::DoDeleteTool( size_t WXUNUSED(pos), wxToolBarToolBase* WXUNUSED(tool) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDynamicToolBar::DoEnableTool( wxToolBarToolBase* WXUNUSED(tool), bool WXUNUSED(enable) )
|
void wxDynamicToolBar::DoEnableTool( wxToolBarToolBase* WXUNUSED(tool), bool WXUNUSED(enable) )
|
||||||
|
@@ -80,7 +80,7 @@ void wxFrameView::Deactivate()
|
|||||||
|
|
||||||
void wxFrameView::CreateLayout()
|
void wxFrameView::CreateLayout()
|
||||||
{
|
{
|
||||||
mpLayout = new wxFrameLayout( GetParentFrame(), mpFrameMgr->GetClientWindow(), FALSE );
|
mpLayout = new wxFrameLayout( GetParentFrame(), mpFrameMgr->GetClientWindow(), false );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFrameLayout* wxFrameView::GetLayout()
|
wxFrameLayout* wxFrameView::GetLayout()
|
||||||
@@ -232,12 +232,12 @@ void wxFrameManager::SyncAllMenus()
|
|||||||
{
|
{
|
||||||
if ( i != mActiveViewNo )
|
if ( i != mActiveViewNo )
|
||||||
|
|
||||||
EnableMenusForView( (wxFrameView*)pNode->GetData(), FALSE );
|
EnableMenusForView( (wxFrameView*)pNode->GetData(), false );
|
||||||
|
|
||||||
pNode = pNode->GetNext();
|
pNode = pNode->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
EnableMenusForView( GetView( mActiveViewNo ), TRUE );
|
EnableMenusForView( GetView( mActiveViewNo ), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** public methods ***/
|
/*** public methods ***/
|
||||||
@@ -368,7 +368,7 @@ void wxFrameManager::ActivateView( wxFrameView* pFrmView )
|
|||||||
|
|
||||||
GetParentFrame()->PushEventHandler( pFrmView );
|
GetParentFrame()->PushEventHandler( pFrmView );
|
||||||
|
|
||||||
EnableMenusForView( pFrmView, TRUE );
|
EnableMenusForView( pFrmView, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameManager::SetClinetWindow( wxWindow* pFrameClient )
|
void wxFrameManager::SetClinetWindow( wxWindow* pFrameClient )
|
||||||
@@ -402,7 +402,7 @@ void wxFrameManager::DeactivateCurrentView()
|
|||||||
if ( pView->mpLayout )
|
if ( pView->mpLayout )
|
||||||
pView->mpLayout->Deactivate();
|
pView->mpLayout->Deactivate();
|
||||||
|
|
||||||
EnableMenusForView( pView, FALSE );
|
EnableMenusForView( pView, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameManager::SaveViewsNow()
|
void wxFrameManager::SaveViewsNow()
|
||||||
@@ -420,12 +420,12 @@ void wxFrameManager::SaveViewsNow()
|
|||||||
|
|
||||||
bool wxFrameManager::ReloadViews()
|
bool wxFrameManager::ReloadViews()
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// TBD: ????
|
// TBD: ????
|
||||||
#if 0
|
#if 0
|
||||||
if ( mSettingsFile == "" || !wxFileExists( mSettingsFile ) )
|
if ( mSettingsFile == "" || !wxFileExists( mSettingsFile ) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
DestroyViews();
|
DestroyViews();
|
||||||
|
|
||||||
@@ -435,7 +435,7 @@ bool wxFrameManager::ReloadViews()
|
|||||||
mStore.SetDataStream( stm );
|
mStore.SetDataStream( stm );
|
||||||
DoSerialize( mStore );
|
DoSerialize( mStore );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,7 +96,7 @@ void cbGCUpdatesMgr::OnStartChanges()
|
|||||||
|
|
||||||
// store pane state
|
// store pane state
|
||||||
pane.mUMgrData.StoreItemState( pane.mBoundsInParent );
|
pane.mUMgrData.StoreItemState( pane.mBoundsInParent );
|
||||||
pane.mUMgrData.SetDirty( FALSE );
|
pane.mUMgrData.SetDirty( false );
|
||||||
|
|
||||||
cbRowInfo* pRow = pane.GetFirstRow();
|
cbRowInfo* pRow = pane.GetFirstRow();
|
||||||
|
|
||||||
@@ -106,13 +106,13 @@ void cbGCUpdatesMgr::OnStartChanges()
|
|||||||
|
|
||||||
// store row state
|
// store row state
|
||||||
pRow->mUMgrData.StoreItemState( pRow->mBoundsInParent );
|
pRow->mUMgrData.StoreItemState( pRow->mBoundsInParent );
|
||||||
pRow->mUMgrData.SetDirty( FALSE );
|
pRow->mUMgrData.SetDirty( false );
|
||||||
|
|
||||||
while( pBar )
|
while( pBar )
|
||||||
{
|
{
|
||||||
// store bar state
|
// store bar state
|
||||||
pBar->mUMgrData.StoreItemState( pBar->mBoundsInParent );
|
pBar->mUMgrData.StoreItemState( pBar->mBoundsInParent );
|
||||||
pBar->mUMgrData.SetDirty( FALSE );
|
pBar->mUMgrData.SetDirty( false );
|
||||||
|
|
||||||
pBar = pBar->mpNext;
|
pBar = pBar->mpNext;
|
||||||
}
|
}
|
||||||
@@ -164,8 +164,8 @@ void cbGCUpdatesMgr::UpdateNow()
|
|||||||
|
|
||||||
cbBarInfo* pBar = pRow->GetFirstBar();
|
cbBarInfo* pBar = pRow->GetFirstBar();
|
||||||
|
|
||||||
bool rowChanged = FALSE;
|
bool rowChanged = false;
|
||||||
// bool rowBkPainted = FALSE;
|
// bool rowBkPainted = false;
|
||||||
|
|
||||||
// FIXME:: the below should not be fixed
|
// FIXME:: the below should not be fixed
|
||||||
cbBarInfo* barsToRepaint[128];
|
cbBarInfo* barsToRepaint[128];
|
||||||
@@ -177,7 +177,7 @@ void cbGCUpdatesMgr::UpdateNow()
|
|||||||
|
|
||||||
if ( WasChanged( pRow->mUMgrData, pRow->mBoundsInParent ) )
|
if ( WasChanged( pRow->mUMgrData, pRow->mBoundsInParent ) )
|
||||||
|
|
||||||
rowChanged = TRUE;
|
rowChanged = true;
|
||||||
else
|
else
|
||||||
while( pBar )
|
while( pBar )
|
||||||
{
|
{
|
||||||
@@ -349,8 +349,8 @@ void cbGCUpdatesMgr::DoRepositionItems( wxList& items )
|
|||||||
|
|
||||||
// FIXME FIXME:: excessive!
|
// FIXME FIXME:: excessive!
|
||||||
|
|
||||||
pClntWnd->Show( FALSE );
|
pClntWnd->Show( false );
|
||||||
pClntWnd->Show( TRUE );
|
pClntWnd->Show( true );
|
||||||
|
|
||||||
// OLD STUFF:: mpLayout->PositionClientWindow();
|
// OLD STUFF:: mpLayout->PositionClientWindow();
|
||||||
}
|
}
|
||||||
@@ -374,8 +374,8 @@ void cbGCUpdatesMgr::DoRepositionItems( wxList& items )
|
|||||||
// FIXME FIXME:: there's no other way to repaint non-client area of the wxWindow!!
|
// FIXME FIXME:: there's no other way to repaint non-client area of the wxWindow!!
|
||||||
// so we do *excessive* "hide 'n show"
|
// so we do *excessive* "hide 'n show"
|
||||||
|
|
||||||
pWnd->Show(FALSE);
|
pWnd->Show(false);
|
||||||
pWnd->Show(TRUE);
|
pWnd->Show(true);
|
||||||
|
|
||||||
pWnd->Refresh();
|
pWnd->Refresh();
|
||||||
}
|
}
|
||||||
|
@@ -45,12 +45,12 @@ cbHintAnimationPlugin::cbHintAnimationPlugin(void)
|
|||||||
|
|
||||||
: mpScrDc( NULL ),
|
: mpScrDc( NULL ),
|
||||||
mpAnimTimer( 0 ),
|
mpAnimTimer( 0 ),
|
||||||
mAnimStarted( FALSE ),
|
mAnimStarted( false ),
|
||||||
|
|
||||||
mMorphDelay ( 5 ),
|
mMorphDelay ( 5 ),
|
||||||
mMaxFrames ( 20 ),
|
mMaxFrames ( 20 ),
|
||||||
mInClientHintBorder( 4 ),
|
mInClientHintBorder( 4 ),
|
||||||
mAccelerationOn( TRUE )
|
mAccelerationOn( true )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
cbHintAnimationPlugin::cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask )
|
cbHintAnimationPlugin::cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask )
|
||||||
@@ -58,12 +58,12 @@ cbHintAnimationPlugin::cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMas
|
|||||||
: cbPluginBase( pPanel, paneMask ),
|
: cbPluginBase( pPanel, paneMask ),
|
||||||
mpScrDc( NULL ),
|
mpScrDc( NULL ),
|
||||||
mpAnimTimer( 0 ),
|
mpAnimTimer( 0 ),
|
||||||
mAnimStarted( FALSE ),
|
mAnimStarted( false ),
|
||||||
|
|
||||||
mMorphDelay ( 5 ),
|
mMorphDelay ( 5 ),
|
||||||
mMaxFrames ( 20 ),
|
mMaxFrames ( 20 ),
|
||||||
mInClientHintBorder( 4 ),
|
mInClientHintBorder( 4 ),
|
||||||
mAccelerationOn( TRUE )
|
mAccelerationOn( true )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
cbHintAnimationPlugin::~cbHintAnimationPlugin()
|
cbHintAnimationPlugin::~cbHintAnimationPlugin()
|
||||||
@@ -83,7 +83,7 @@ void cbHintAnimationPlugin::OnDrawHintRect( cbDrawHintRectEvent& event )
|
|||||||
|
|
||||||
mPrevRect = event.mRect;
|
mPrevRect = event.mRect;
|
||||||
|
|
||||||
mStopPending = FALSE;
|
mStopPending = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !event.mEraseRect )
|
if ( !event.mEraseRect )
|
||||||
@@ -113,7 +113,7 @@ void cbHintAnimationPlugin::OnDrawHintRect( cbDrawHintRectEvent& event )
|
|||||||
|
|
||||||
mpAnimTimer->Init( this, mAnimStarted );
|
mpAnimTimer->Init( this, mAnimStarted );
|
||||||
|
|
||||||
mAnimStarted = TRUE;
|
mAnimStarted = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( !mAnimStarted )
|
if ( !mAnimStarted )
|
||||||
@@ -132,7 +132,7 @@ void cbHintAnimationPlugin::OnDrawHintRect( cbDrawHintRectEvent& event )
|
|||||||
|
|
||||||
if ( event.mLastTime && mpAnimTimer )
|
if ( event.mLastTime && mpAnimTimer )
|
||||||
{
|
{
|
||||||
mStopPending = TRUE;
|
mStopPending = true;
|
||||||
|
|
||||||
if ( mpAnimTimer->mPrevMorphed.x != POS_UNDEFINED )
|
if ( mpAnimTimer->mPrevMorphed.x != POS_UNDEFINED )
|
||||||
|
|
||||||
@@ -298,9 +298,9 @@ void cbHintAnimTimer::Notify(void)
|
|||||||
|
|
||||||
mpPl->FinishTracking();
|
mpPl->FinishTracking();
|
||||||
|
|
||||||
mpPl->mStopPending = FALSE;
|
mpPl->mStopPending = false;
|
||||||
mpPl->mpAnimTimer = NULL;
|
mpPl->mpAnimTimer = NULL;
|
||||||
mpPl->mAnimStarted = FALSE;
|
mpPl->mAnimStarted = false;
|
||||||
|
|
||||||
mPrevMorphed.x = POS_UNDEFINED;
|
mPrevMorphed.x = POS_UNDEFINED;
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ void cbHintAnimTimer::Notify(void)
|
|||||||
|
|
||||||
mpPl->FinishTracking();
|
mpPl->FinishTracking();
|
||||||
mpPl->mpAnimTimer = NULL;
|
mpPl->mpAnimTimer = NULL;
|
||||||
mpPl->mAnimStarted = FALSE;
|
mpPl->mAnimStarted = false;
|
||||||
|
|
||||||
mPrevMorphed.x = POS_UNDEFINED;
|
mPrevMorphed.x = POS_UNDEFINED;
|
||||||
|
|
||||||
@@ -392,6 +392,6 @@ bool cbHintAnimTimer::Init( cbHintAnimationPlugin* pAnimPl, bool reinit )
|
|||||||
|
|
||||||
Start( mpPl->mMorphDelay );
|
Start( mpPl->mMorphDelay );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -251,11 +251,11 @@ wxNewBitmapButton::wxNewBitmapButton( const wxBitmap& labelBitmap,
|
|||||||
mpFocusedImg ( NULL ),
|
mpFocusedImg ( NULL ),
|
||||||
|
|
||||||
|
|
||||||
mDragStarted ( FALSE ),
|
mDragStarted ( false ),
|
||||||
mIsPressed ( FALSE ),
|
mIsPressed ( false ),
|
||||||
mIsInFocus ( FALSE ),
|
mIsInFocus ( false ),
|
||||||
mIsToggled ( FALSE ),
|
mIsToggled ( false ),
|
||||||
mHasFocusedBmp( FALSE ),
|
mHasFocusedBmp( false ),
|
||||||
mFiredEventType( firedEventType ),
|
mFiredEventType( firedEventType ),
|
||||||
|
|
||||||
mBlackPen( wxColour( 0, 0, 0), 1, wxSOLID ),
|
mBlackPen( wxColour( 0, 0, 0), 1, wxSOLID ),
|
||||||
@@ -263,8 +263,8 @@ wxNewBitmapButton::wxNewBitmapButton( const wxBitmap& labelBitmap,
|
|||||||
mGrayPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ),
|
mGrayPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ),
|
||||||
mLightPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT), 1, wxSOLID ),
|
mLightPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT), 1, wxSOLID ),
|
||||||
|
|
||||||
mIsCreated( FALSE ),
|
mIsCreated( false ),
|
||||||
mSizeIsSet( FALSE )
|
mSizeIsSet( false )
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ wxNewBitmapButton::wxNewBitmapButton( const wxString& bitmapFileName,
|
|||||||
mMarginX( 2 ),
|
mMarginX( 2 ),
|
||||||
mMarginY( 2 ),
|
mMarginY( 2 ),
|
||||||
mTextAlignment( alignText ),
|
mTextAlignment( alignText ),
|
||||||
mIsSticky( FALSE ),
|
mIsSticky( false ),
|
||||||
mIsFlat( isFlat ),
|
mIsFlat( isFlat ),
|
||||||
mLabelText( labelText ),
|
mLabelText( labelText ),
|
||||||
mImageFileName( bitmapFileName ),
|
mImageFileName( bitmapFileName ),
|
||||||
@@ -295,11 +295,11 @@ wxNewBitmapButton::wxNewBitmapButton( const wxString& bitmapFileName,
|
|||||||
mpDisabledImg ( NULL ),
|
mpDisabledImg ( NULL ),
|
||||||
mpFocusedImg ( NULL ),
|
mpFocusedImg ( NULL ),
|
||||||
|
|
||||||
mDragStarted ( FALSE ),
|
mDragStarted ( false ),
|
||||||
mIsPressed ( FALSE ),
|
mIsPressed ( false ),
|
||||||
mIsInFocus ( FALSE ),
|
mIsInFocus ( false ),
|
||||||
mIsToggled ( FALSE ),
|
mIsToggled ( false ),
|
||||||
mHasFocusedBmp( FALSE ),
|
mHasFocusedBmp( false ),
|
||||||
mFiredEventType( wxEVT_COMMAND_MENU_SELECTED ),
|
mFiredEventType( wxEVT_COMMAND_MENU_SELECTED ),
|
||||||
|
|
||||||
mBlackPen( wxColour( 0, 0, 0), 1, wxSOLID ),
|
mBlackPen( wxColour( 0, 0, 0), 1, wxSOLID ),
|
||||||
@@ -307,8 +307,8 @@ wxNewBitmapButton::wxNewBitmapButton( const wxString& bitmapFileName,
|
|||||||
mGrayPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ),
|
mGrayPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ),
|
||||||
mLightPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT), 1, wxSOLID ),
|
mLightPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT), 1, wxSOLID ),
|
||||||
|
|
||||||
mIsCreated( FALSE ),
|
mIsCreated( false ),
|
||||||
mSizeIsSet( FALSE )
|
mSizeIsSet( false )
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -473,7 +473,7 @@ void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
|
|||||||
destDc.Blit( imgPos.x, imgPos.y,
|
destDc.Blit( imgPos.x, imgPos.y,
|
||||||
srcBmp->GetWidth()+1,
|
srcBmp->GetWidth()+1,
|
||||||
srcBmp->GetHeight()+1,
|
srcBmp->GetHeight()+1,
|
||||||
&srcDc, 0,0, wxCOPY,TRUE );
|
&srcDc, 0,0, wxCOPY,true );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( hasText )
|
if ( hasText )
|
||||||
@@ -519,8 +519,8 @@ void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
|
|||||||
// adjust button size to fit the new dimensions of the label
|
// adjust button size to fit the new dimensions of the label
|
||||||
if ( !mSizeIsSet && 0 )
|
if ( !mSizeIsSet && 0 )
|
||||||
{
|
{
|
||||||
mSizeIsSet = TRUE;
|
mSizeIsSet = true;
|
||||||
SetSize( -1,-1,
|
SetSize( wxDefaultPosition.x,wxDefaultPosition.y,
|
||||||
destBmp->GetWidth() + mMarginX*2,
|
destBmp->GetWidth() + mMarginX*2,
|
||||||
destBmp->GetHeight() + mMarginY*2, 0
|
destBmp->GetHeight() + mMarginY*2, 0
|
||||||
);
|
);
|
||||||
@@ -537,12 +537,12 @@ void wxNewBitmapButton::RenderAllLabelImages()
|
|||||||
{
|
{
|
||||||
if ( !mIsCreated )
|
if ( !mIsCreated )
|
||||||
return;
|
return;
|
||||||
RenderLabelImage( mpDisabledImg, &mDepressedBmp, FALSE );
|
RenderLabelImage( mpDisabledImg, &mDepressedBmp, false );
|
||||||
RenderLabelImage( mpPressedImg, &mDepressedBmp, TRUE, TRUE );
|
RenderLabelImage( mpPressedImg, &mDepressedBmp, true, true );
|
||||||
RenderLabelImage( mpDepressedImg, &mDepressedBmp, TRUE, FALSE );
|
RenderLabelImage( mpDepressedImg, &mDepressedBmp, true, false );
|
||||||
if ( mHasFocusedBmp )
|
if ( mHasFocusedBmp )
|
||||||
{
|
{
|
||||||
RenderLabelImage( mpFocusedImg, &mFocusedBmp, TRUE, FALSE );
|
RenderLabelImage( mpFocusedImg, &mFocusedBmp, true, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -554,24 +554,24 @@ void wxNewBitmapButton::RenderLabelImages()
|
|||||||
|
|
||||||
if ( !IsEnabled() )
|
if ( !IsEnabled() )
|
||||||
{
|
{
|
||||||
RenderLabelImage( mpDisabledImg, &mDepressedBmp, FALSE );
|
RenderLabelImage( mpDisabledImg, &mDepressedBmp, false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
||||||
if ( mIsPressed )
|
if ( mIsPressed )
|
||||||
|
|
||||||
RenderLabelImage( mpPressedImg, &mDepressedBmp, TRUE, TRUE );
|
RenderLabelImage( mpPressedImg, &mDepressedBmp, true, true );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( mIsInFocus )
|
if ( mIsInFocus )
|
||||||
{
|
{
|
||||||
if ( mHasFocusedBmp )
|
if ( mHasFocusedBmp )
|
||||||
RenderLabelImage( mpFocusedImg, &mFocusedBmp, TRUE, FALSE );
|
RenderLabelImage( mpFocusedImg, &mFocusedBmp, true, false );
|
||||||
else
|
else
|
||||||
RenderLabelImage( mpDepressedImg, &mDepressedBmp, TRUE, FALSE );
|
RenderLabelImage( mpDepressedImg, &mDepressedBmp, true, false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RenderLabelImage( mpDepressedImg, &mDepressedBmp, TRUE, FALSE );
|
RenderLabelImage( mpDepressedImg, &mDepressedBmp, true, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,13 +579,13 @@ bool wxNewBitmapButton::Toggle(bool enable)
|
|||||||
{
|
{
|
||||||
if ( mIsToggled == enable )
|
if ( mIsToggled == enable )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mIsToggled = enable;
|
mIsToggled = enable;
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNewBitmapButton::Enable(bool enable)
|
bool wxNewBitmapButton::Enable(bool enable)
|
||||||
@@ -594,12 +594,12 @@ bool wxNewBitmapButton::Enable(bool enable)
|
|||||||
{
|
{
|
||||||
if ( mIsInFocus )
|
if ( mIsInFocus )
|
||||||
{
|
{
|
||||||
mIsInFocus = FALSE;
|
mIsInFocus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mIsPressed )
|
if ( mIsPressed )
|
||||||
{
|
{
|
||||||
mIsPressed = FALSE;
|
mIsPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
@@ -674,8 +674,8 @@ void wxNewBitmapButton::SetAlignments( int alignText,
|
|||||||
|
|
||||||
void wxNewBitmapButton::OnLButtonDown( wxMouseEvent& WXUNUSED(event) )
|
void wxNewBitmapButton::OnLButtonDown( wxMouseEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
mDragStarted = TRUE;
|
mDragStarted = true;
|
||||||
mIsPressed = TRUE;
|
mIsPressed = true;
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,8 +684,8 @@ void wxNewBitmapButton::OnLButtonUp( wxMouseEvent& event )
|
|||||||
if ( !mDragStarted )
|
if ( !mDragStarted )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mDragStarted = FALSE;
|
mDragStarted = false;
|
||||||
mIsPressed = FALSE;
|
mIsPressed = false;
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|
||||||
if ( IsInWindow( event.m_x, event.m_y ) )
|
if ( IsInWindow( event.m_x, event.m_y ) )
|
||||||
@@ -713,7 +713,7 @@ void wxNewBitmapButton::OnMouseEnter( wxMouseEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
if ( !mIsInFocus )
|
if ( !mIsInFocus )
|
||||||
{
|
{
|
||||||
mIsInFocus = TRUE;
|
mIsInFocus = true;
|
||||||
}
|
}
|
||||||
if ( prevIsInFocus != mIsInFocus )
|
if ( prevIsInFocus != mIsInFocus )
|
||||||
{
|
{
|
||||||
@@ -727,8 +727,8 @@ void wxNewBitmapButton::OnMouseLeave( wxMouseEvent& WXUNUSED(event) )
|
|||||||
bool prevIsPressed = mIsPressed;
|
bool prevIsPressed = mIsPressed;
|
||||||
if ( mIsInFocus )
|
if ( mIsInFocus )
|
||||||
{
|
{
|
||||||
mIsInFocus = FALSE;
|
mIsInFocus = false;
|
||||||
mIsPressed = FALSE;
|
mIsPressed = false;
|
||||||
}
|
}
|
||||||
if ( prevIsInFocus != mIsInFocus || prevIsPressed != mIsPressed )
|
if ( prevIsInFocus != mIsInFocus || prevIsPressed != mIsPressed )
|
||||||
{
|
{
|
||||||
@@ -744,7 +744,7 @@ void wxNewBitmapButton::OnSize( wxSizeEvent& WXUNUSED(event) )
|
|||||||
void wxNewBitmapButton::Reshape( )
|
void wxNewBitmapButton::Reshape( )
|
||||||
{
|
{
|
||||||
bool wasCreated = mIsCreated;
|
bool wasCreated = mIsCreated;
|
||||||
mIsCreated = TRUE;
|
mIsCreated = true;
|
||||||
|
|
||||||
if ( !wasCreated )
|
if ( !wasCreated )
|
||||||
{
|
{
|
||||||
|
@@ -103,17 +103,17 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
cbPaneDrawPlugin::cbPaneDrawPlugin(void)
|
cbPaneDrawPlugin::cbPaneDrawPlugin(void)
|
||||||
|
|
||||||
: mResizeStarted ( FALSE ),
|
: mResizeStarted ( false ),
|
||||||
|
|
||||||
mResizeCursorOn ( FALSE ),
|
mResizeCursorOn ( false ),
|
||||||
mpDraggedBar ( NULL ),
|
mpDraggedBar ( NULL ),
|
||||||
mpResizedRow ( NULL ),
|
mpResizedRow ( NULL ),
|
||||||
|
|
||||||
mRowHandleHitted ( FALSE ),
|
mRowHandleHitted ( false ),
|
||||||
mIsUpperHandle ( FALSE ),
|
mIsUpperHandle ( false ),
|
||||||
mBarHandleHitted ( FALSE ),
|
mBarHandleHitted ( false ),
|
||||||
mIsLeftHandle ( FALSE ),
|
mIsLeftHandle ( false ),
|
||||||
mBarContentHitted ( FALSE ),
|
mBarContentHitted ( false ),
|
||||||
|
|
||||||
mpClntDc ( NULL ),
|
mpClntDc ( NULL ),
|
||||||
mpPane ( NULL )
|
mpPane ( NULL )
|
||||||
@@ -125,17 +125,17 @@ cbPaneDrawPlugin::cbPaneDrawPlugin( wxFrameLayout* pPanel, int paneMask )
|
|||||||
|
|
||||||
// bar-row resizing state varaibles
|
// bar-row resizing state varaibles
|
||||||
|
|
||||||
mResizeStarted ( FALSE ),
|
mResizeStarted ( false ),
|
||||||
|
|
||||||
mResizeCursorOn ( FALSE ),
|
mResizeCursorOn ( false ),
|
||||||
mpDraggedBar ( NULL ),
|
mpDraggedBar ( NULL ),
|
||||||
mpResizedRow ( NULL ),
|
mpResizedRow ( NULL ),
|
||||||
|
|
||||||
mRowHandleHitted ( FALSE ),
|
mRowHandleHitted ( false ),
|
||||||
mIsUpperHandle ( FALSE ),
|
mIsUpperHandle ( false ),
|
||||||
mBarHandleHitted ( FALSE ),
|
mBarHandleHitted ( false ),
|
||||||
mIsLeftHandle ( FALSE ),
|
mIsLeftHandle ( false ),
|
||||||
mBarContentHitted ( FALSE ),
|
mBarContentHitted ( false ),
|
||||||
|
|
||||||
mpClntDc ( NULL ),
|
mpClntDc ( NULL ),
|
||||||
mpPane ( NULL )
|
mpPane ( NULL )
|
||||||
@@ -254,9 +254,9 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
|
|
||||||
bool prevWasRowHandle = mRowHandleHitted;
|
bool prevWasRowHandle = mRowHandleHitted;
|
||||||
|
|
||||||
mBarContentHitted = FALSE;
|
mBarContentHitted = false;
|
||||||
mBarHandleHitted = FALSE;
|
mBarHandleHitted = false;
|
||||||
mRowHandleHitted = FALSE;
|
mRowHandleHitted = false;
|
||||||
|
|
||||||
int testResult =
|
int testResult =
|
||||||
event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes
|
event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes
|
||||||
@@ -275,9 +275,9 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
mpLayout->ReleaseEventsFromPane( event.mpPane );
|
mpLayout->ReleaseEventsFromPane( event.mpPane );
|
||||||
mpLayout->ReleaseEventsFromPlugin( this );
|
mpLayout->ReleaseEventsFromPlugin( this );
|
||||||
|
|
||||||
mResizeCursorOn = FALSE;
|
mResizeCursorOn = false;
|
||||||
|
|
||||||
mBarContentHitted = TRUE;
|
mBarContentHitted = true;
|
||||||
|
|
||||||
// In Windows, at least, the frame needs to have a null cursor
|
// In Windows, at least, the frame needs to have a null cursor
|
||||||
// else child windows (such as text windows) inherit the cursor
|
// else child windows (such as text windows) inherit the cursor
|
||||||
@@ -305,7 +305,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
else
|
else
|
||||||
pCurs = mpLayout->mpHorizCursor;
|
pCurs = mpLayout->mpHorizCursor;
|
||||||
|
|
||||||
mRowHandleHitted = TRUE;
|
mRowHandleHitted = true;
|
||||||
mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED );
|
mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -318,7 +318,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
else
|
else
|
||||||
pCurs = mpLayout->mpVertCursor;
|
pCurs = mpLayout->mpVertCursor;
|
||||||
|
|
||||||
mBarHandleHitted = TRUE;
|
mBarHandleHitted = true;
|
||||||
mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED );
|
mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
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
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
|
mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mResizeCursorOn = FALSE;
|
mResizeCursorOn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.Skip(); // pass event to the next plugin
|
event.Skip(); // pass event to the next plugin
|
||||||
@@ -406,14 +406,14 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event )
|
|||||||
|
|
||||||
if ( mResizeCursorOn )
|
if ( mResizeCursorOn )
|
||||||
{
|
{
|
||||||
mResizeStarted = TRUE;
|
mResizeStarted = true;
|
||||||
mDragOrigin = event.mPos;
|
mDragOrigin = event.mPos;
|
||||||
|
|
||||||
// setup constraints for the dragging handle
|
// setup constraints for the dragging handle
|
||||||
|
|
||||||
int from, till;
|
int from, till;
|
||||||
mHandleOfs = 0;
|
mHandleOfs = 0;
|
||||||
mHandleIsVertical = FALSE;
|
mHandleIsVertical = false;
|
||||||
|
|
||||||
if ( mRowHandleHitted )
|
if ( mRowHandleHitted )
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event )
|
|||||||
|
|
||||||
if ( mRowHandleHitted )
|
if ( mRowHandleHitted )
|
||||||
{
|
{
|
||||||
mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? FALSE : TRUE;
|
mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? false : true;
|
||||||
|
|
||||||
mHandleDragArea.x = 0;
|
mHandleDragArea.x = 0;
|
||||||
mHandleDragArea.width = event.mpPane->mPaneWidth;
|
mHandleDragArea.width = event.mpPane->mPaneWidth;
|
||||||
@@ -447,7 +447,7 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event )
|
|||||||
// cbRowInfo& rowInfo = *mpDraggedBar->mpRow;
|
// cbRowInfo& rowInfo = *mpDraggedBar->mpRow;
|
||||||
wxRect& bounds = mpDraggedBar->mBounds;
|
wxRect& bounds = mpDraggedBar->mBounds;
|
||||||
|
|
||||||
mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? TRUE : FALSE;
|
mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? true : false;
|
||||||
|
|
||||||
mHandleDragArea.x = from;
|
mHandleDragArea.x = from;
|
||||||
mHandleDragArea.width = till - from;
|
mHandleDragArea.width = till - from;
|
||||||
@@ -505,8 +505,8 @@ void cbPaneDrawPlugin::OnLButtonUp( cbLeftUpEvent& event )
|
|||||||
{
|
{
|
||||||
DrawDraggedHandle( event.mPos, *event.mpPane );
|
DrawDraggedHandle( event.mPos, *event.mpPane );
|
||||||
|
|
||||||
mResizeStarted = FALSE;
|
mResizeStarted = false;
|
||||||
mResizeCursorOn = FALSE;
|
mResizeCursorOn = false;
|
||||||
|
|
||||||
mpLayout->ReleaseEventsFromPane( event.mpPane );
|
mpLayout->ReleaseEventsFromPane( event.mpPane );
|
||||||
mpLayout->ReleaseEventsFromPlugin( this );
|
mpLayout->ReleaseEventsFromPlugin( this );
|
||||||
@@ -604,11 +604,11 @@ void cbPaneDrawPlugin::OnSizeBarWindow( cbSizeBarWndEvent& event )
|
|||||||
|
|
||||||
if ( !bar.mpBarWnd->IsShown() )
|
if ( !bar.mpBarWnd->IsShown() )
|
||||||
|
|
||||||
bar.mpBarWnd->Show( TRUE );
|
bar.mpBarWnd->Show( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// hide bar if not visible
|
// hide bar if not visible
|
||||||
bar.mpBarWnd->Show( FALSE );
|
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
|
||||||
}
|
}
|
||||||
|
@@ -66,10 +66,10 @@ cbRowDragPlugin::cbRowDragPlugin(void)
|
|||||||
mTrianInnerColor ( 0,0,255 ),
|
mTrianInnerColor ( 0,0,255 ),
|
||||||
mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ),
|
mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ),
|
||||||
|
|
||||||
mDragStarted ( FALSE ),
|
mDragStarted ( false ),
|
||||||
mDecisionMode ( FALSE ),
|
mDecisionMode ( false ),
|
||||||
mCurDragOfs ( 0 ),
|
mCurDragOfs ( 0 ),
|
||||||
mCaptureIsOn ( FALSE ),
|
mCaptureIsOn ( false ),
|
||||||
mSvTopMargin ( -1 ),
|
mSvTopMargin ( -1 ),
|
||||||
mSvBottomMargin ( -1 ),
|
mSvBottomMargin ( -1 ),
|
||||||
mSvLeftMargin ( -1 ),
|
mSvLeftMargin ( -1 ),
|
||||||
@@ -95,10 +95,10 @@ cbRowDragPlugin::cbRowDragPlugin( wxFrameLayout* pLayout, int paneMask )
|
|||||||
mTrianInnerColor ( 0,0,255 ),
|
mTrianInnerColor ( 0,0,255 ),
|
||||||
mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ),
|
mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ),
|
||||||
|
|
||||||
mDragStarted ( FALSE ),
|
mDragStarted ( false ),
|
||||||
mDecisionMode ( FALSE ),
|
mDecisionMode ( false ),
|
||||||
mCurDragOfs ( 0 ),
|
mCurDragOfs ( 0 ),
|
||||||
mCaptureIsOn ( FALSE ),
|
mCaptureIsOn ( false ),
|
||||||
mSvTopMargin ( -1 ),
|
mSvTopMargin ( -1 ),
|
||||||
mSvBottomMargin ( -1 ),
|
mSvBottomMargin ( -1 ),
|
||||||
mSvLeftMargin ( -1 ),
|
mSvLeftMargin ( -1 ),
|
||||||
@@ -152,8 +152,8 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
//wxPoint drg = mDragOrigin;
|
//wxPoint drg = mDragOrigin;
|
||||||
//int dif = event.mPos.x - mDragOrigin.x;
|
//int dif = event.mPos.x - mDragOrigin.x;
|
||||||
|
|
||||||
mDragStarted = TRUE;
|
mDragStarted = true;
|
||||||
mDecisionMode = FALSE;
|
mDecisionMode = false;
|
||||||
mDragOrigin = pos;
|
mDragOrigin = pos;
|
||||||
|
|
||||||
PrepareForRowDrag();
|
PrepareForRowDrag();
|
||||||
@@ -166,16 +166,16 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
|
|
||||||
cbRowInfo* pRow = GetFirstRow();
|
cbRowInfo* pRow = GetFirstRow();
|
||||||
|
|
||||||
bool focusFound = FALSE;
|
bool focusFound = false;
|
||||||
|
|
||||||
while( pRow )
|
while( pRow )
|
||||||
{
|
{
|
||||||
if ( HitTestRowDragHint( pRow, pos ) )
|
if ( HitTestRowDragHint( pRow, pos ) )
|
||||||
{
|
{
|
||||||
CheckPrevItemInFocus( pRow, -1 );
|
CheckPrevItemInFocus( pRow, -1 );
|
||||||
SetMouseCapture( TRUE );
|
SetMouseCapture( true );
|
||||||
|
|
||||||
focusFound = TRUE;
|
focusFound = true;
|
||||||
|
|
||||||
mpRowInFocus = pRow;
|
mpRowInFocus = pRow;
|
||||||
mCollapsedIconInFocus = -1;
|
mCollapsedIconInFocus = -1;
|
||||||
@@ -194,9 +194,9 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
if ( HitTestCollapsedRowIcon( i, pos ) )
|
if ( HitTestCollapsedRowIcon( i, pos ) )
|
||||||
{
|
{
|
||||||
CheckPrevItemInFocus( NULL, i );
|
CheckPrevItemInFocus( NULL, i );
|
||||||
SetMouseCapture( TRUE );
|
SetMouseCapture( true );
|
||||||
|
|
||||||
focusFound = TRUE;
|
focusFound = true;
|
||||||
|
|
||||||
mCollapsedIconInFocus = i;
|
mCollapsedIconInFocus = i;
|
||||||
mpRowInFocus = NULL;
|
mpRowInFocus = NULL;
|
||||||
@@ -212,7 +212,7 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
|||||||
|
|
||||||
mpRowInFocus = NULL;
|
mpRowInFocus = NULL;
|
||||||
mCollapsedIconInFocus = -1;
|
mCollapsedIconInFocus = -1;
|
||||||
SetMouseCapture( FALSE );
|
SetMouseCapture( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !ItemIsInFocus() )
|
if ( !ItemIsInFocus() )
|
||||||
@@ -248,14 +248,14 @@ void cbRowDragPlugin::OnLButtonDown( cbLeftDownEvent& event )
|
|||||||
|
|
||||||
if ( ItemIsInFocus() )
|
if ( ItemIsInFocus() )
|
||||||
{
|
{
|
||||||
mDecisionMode = TRUE;
|
mDecisionMode = true;
|
||||||
|
|
||||||
wxPoint pos = event.mPos;
|
wxPoint pos = event.mPos;
|
||||||
mpPane->PaneToFrame( &pos.x, &pos.y );
|
mpPane->PaneToFrame( &pos.x, &pos.y );
|
||||||
|
|
||||||
mDragOrigin = pos;
|
mDragOrigin = pos;
|
||||||
|
|
||||||
SetMouseCapture( TRUE );
|
SetMouseCapture( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// propagate event to other plugins
|
// propagate event to other plugins
|
||||||
@@ -276,10 +276,10 @@ void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event )
|
|||||||
{
|
{
|
||||||
cbDockPane* pPane = mpPane;
|
cbDockPane* pPane = mpPane;
|
||||||
|
|
||||||
SetMouseCapture( FALSE );
|
SetMouseCapture( false );
|
||||||
|
|
||||||
mDecisionMode = FALSE;
|
mDecisionMode = false;
|
||||||
mDragStarted = FALSE;
|
mDragStarted = false;
|
||||||
|
|
||||||
wxPoint frmPos = event.mPos;
|
wxPoint frmPos = event.mPos;
|
||||||
pPane->PaneToFrame( &frmPos.x, &frmPos.y );
|
pPane->PaneToFrame( &frmPos.x, &frmPos.y );
|
||||||
@@ -322,19 +322,19 @@ void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event )
|
|||||||
|
|
||||||
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 )
|
while ( pBar )
|
||||||
{
|
{
|
||||||
pBar->mUMgrData.SetDirty(TRUE);
|
pBar->mUMgrData.SetDirty(true);
|
||||||
|
|
||||||
if ( pBar->mpBarWnd )
|
if ( pBar->mpBarWnd )
|
||||||
{
|
{
|
||||||
// do complete refresh
|
// do complete refresh
|
||||||
pBar->mpBarWnd->Show(FALSE);
|
pBar->mpBarWnd->Show(false);
|
||||||
pBar->mpBarWnd->Show(TRUE);
|
pBar->mpBarWnd->Show(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
pBar = pBar->mpNext;
|
pBar = pBar->mpNext;
|
||||||
@@ -355,15 +355,15 @@ void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event )
|
|||||||
|
|
||||||
mpRowInFocus = NULL;
|
mpRowInFocus = NULL;
|
||||||
|
|
||||||
mpLayout->RecalcLayout(FALSE);
|
mpLayout->RecalcLayout(false);
|
||||||
|
|
||||||
// finish change "transaction"
|
// finish change "transaction"
|
||||||
mpLayout->GetUpdatesManager().OnFinishChanges();
|
mpLayout->GetUpdatesManager().OnFinishChanges();
|
||||||
mpLayout->GetUpdatesManager().UpdateNow();
|
mpLayout->GetUpdatesManager().UpdateNow();
|
||||||
|
|
||||||
// finish drag action
|
// finish drag action
|
||||||
SetMouseCapture( FALSE );
|
SetMouseCapture( false );
|
||||||
mDragStarted = FALSE;
|
mDragStarted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ void cbRowDragPlugin::OnDrawPaneBackground ( cbDrawPaneDecorEvent& event )
|
|||||||
// first, let other plugins add their decorations now
|
// first, let other plugins add their decorations now
|
||||||
|
|
||||||
GetNextHandler()->ProcessEvent( event );
|
GetNextHandler()->ProcessEvent( event );
|
||||||
event.Skip(FALSE);
|
event.Skip(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxClientDC dc( &mpLayout->GetParentFrame() );
|
wxClientDC dc( &mpLayout->GetParentFrame() );
|
||||||
@@ -402,13 +402,13 @@ void cbRowDragPlugin::OnDrawPaneBackground ( cbDrawPaneDecorEvent& event )
|
|||||||
|
|
||||||
while( pRow )
|
while( pRow )
|
||||||
{
|
{
|
||||||
DrawRowDragHint( pRow, dc, FALSE );
|
DrawRowDragHint( pRow, dc, false );
|
||||||
pRow = pRow->mpNext;
|
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 )
|
int cbRowDragPlugin::GetHRowsCountForPane( cbDockPane* pPane )
|
||||||
@@ -514,11 +514,11 @@ void cbRowDragPlugin::UnhighlightItemInFocus()
|
|||||||
|
|
||||||
if ( mpRowInFocus )
|
if ( mpRowInFocus )
|
||||||
|
|
||||||
DrawRowDragHint( mpRowInFocus, dc, FALSE );
|
DrawRowDragHint( mpRowInFocus, dc, false );
|
||||||
else
|
else
|
||||||
if ( mCollapsedIconInFocus != - 1 )
|
if ( mCollapsedIconInFocus != - 1 )
|
||||||
|
|
||||||
DrawCollapsedRowIcon( mCollapsedIconInFocus, dc, FALSE );
|
DrawCollapsedRowIcon( mCollapsedIconInFocus, dc, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbRowDragPlugin::ShowDraggedRow( int offset )
|
void cbRowDragPlugin::ShowDraggedRow( int offset )
|
||||||
@@ -761,7 +761,7 @@ void cbRowDragPlugin::CollapseRow( cbRowInfo* pRow )
|
|||||||
// hide it
|
// hide it
|
||||||
if ( pBar->mpBarWnd )
|
if ( pBar->mpBarWnd )
|
||||||
|
|
||||||
pBar->mpBarWnd->Show( FALSE );
|
pBar->mpBarWnd->Show( false );
|
||||||
|
|
||||||
pBar->mState = wxCBAR_HIDDEN;
|
pBar->mState = wxCBAR_HIDDEN;
|
||||||
|
|
||||||
@@ -781,7 +781,7 @@ void cbRowDragPlugin::CollapseRow( cbRowInfo* pRow )
|
|||||||
|
|
||||||
SetPaneMargins();
|
SetPaneMargins();
|
||||||
|
|
||||||
mpLayout->RecalcLayout(FALSE);
|
mpLayout->RecalcLayout(false);
|
||||||
|
|
||||||
mpRowInFocus = NULL;
|
mpRowInFocus = NULL;
|
||||||
|
|
||||||
@@ -857,7 +857,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx )
|
|||||||
|
|
||||||
SetPaneMargins();
|
SetPaneMargins();
|
||||||
|
|
||||||
mpLayout->RecalcLayout(FALSE);
|
mpLayout->RecalcLayout(false);
|
||||||
|
|
||||||
mCollapsedIconInFocus = -1;
|
mCollapsedIconInFocus = -1;
|
||||||
|
|
||||||
@@ -879,7 +879,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx )
|
|||||||
|
|
||||||
SetPaneMargins();
|
SetPaneMargins();
|
||||||
|
|
||||||
mpLayout->RecalcLayout(FALSE);
|
mpLayout->RecalcLayout(false);
|
||||||
|
|
||||||
mCollapsedIconInFocus = -1;
|
mCollapsedIconInFocus = -1;
|
||||||
|
|
||||||
@@ -905,7 +905,7 @@ void cbRowDragPlugin::InsertDraggedRowBefore( cbRowInfo* pBeforeRow )
|
|||||||
//wxClientDC dc( &mpLayout->GetParentFrame() );
|
//wxClientDC dc( &mpLayout->GetParentFrame() );
|
||||||
|
|
||||||
//mpPane->PaintRow( mpRowInFocus, dc );
|
//mpPane->PaintRow( mpRowInFocus, dc );
|
||||||
//DrawRowDragHint( mpRowInFocus, dc, FALSE );
|
//DrawRowDragHint( mpRowInFocus, dc, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -925,12 +925,12 @@ void cbRowDragPlugin::CheckPrevItemInFocus( cbRowInfo* pRow, int iconIdx )
|
|||||||
|
|
||||||
if ( iconIdx != - 1 )
|
if ( iconIdx != - 1 )
|
||||||
|
|
||||||
DrawCollapsedRowIcon( iconIdx, dc, TRUE );
|
DrawCollapsedRowIcon( iconIdx, dc, true );
|
||||||
|
|
||||||
else
|
else
|
||||||
if ( pRow != NULL )
|
if ( pRow != NULL )
|
||||||
|
|
||||||
DrawRowDragHint( pRow, dc, TRUE );
|
DrawRowDragHint( pRow, dc, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
cbRowInfo* cbRowDragPlugin::GetFirstRow()
|
cbRowInfo* cbRowDragPlugin::GetFirstRow()
|
||||||
|
@@ -270,7 +270,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
|||||||
|
|
||||||
pBar = pFromBar;
|
pBar = pFromBar;
|
||||||
int prevX = from;
|
int prevX = from;
|
||||||
bool hasNotFixedBars = FALSE;
|
bool hasNotFixedBars = false;
|
||||||
|
|
||||||
while ( pBar != pTillBar )
|
while ( pBar != pTillBar )
|
||||||
{
|
{
|
||||||
@@ -278,7 +278,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
|||||||
|
|
||||||
if ( !pBar->IsFixed() )
|
if ( !pBar->IsFixed() )
|
||||||
{
|
{
|
||||||
hasNotFixedBars = TRUE;
|
hasNotFixedBars = true;
|
||||||
|
|
||||||
freeSpc -= bounds.width;
|
freeSpc -= bounds.width;
|
||||||
}
|
}
|
||||||
@@ -449,7 +449,7 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
|||||||
|
|
||||||
double unit = freeSpc / pcntSum;
|
double unit = freeSpc / pcntSum;
|
||||||
|
|
||||||
bool haveSquished = FALSE;
|
bool haveSquished = false;
|
||||||
|
|
||||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||||
{
|
{
|
||||||
@@ -459,7 +459,7 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
|||||||
|
|
||||||
if ( int( unit * bar.mLenRatio ) < mpPane->mProps.mMinCBarDim.x )
|
if ( int( unit * bar.mLenRatio ) < mpPane->mProps.mMinCBarDim.x )
|
||||||
{
|
{
|
||||||
haveSquished = TRUE;
|
haveSquished = true;
|
||||||
|
|
||||||
bar.mBounds.width = -1; // mark as "squished"
|
bar.mBounds.width = -1; // mark as "squished"
|
||||||
|
|
||||||
@@ -507,14 +507,14 @@ void cbRowLayoutPlugin::DetectBarHandles( cbRowInfo* pRow )
|
|||||||
{
|
{
|
||||||
// first pass from left to right (detect left-side handles)
|
// first pass from left to right (detect left-side handles)
|
||||||
|
|
||||||
bool foundNotFixed = FALSE;
|
bool foundNotFixed = false;
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||||
{
|
{
|
||||||
cbBarInfo& bar = *pRow->mBars[i];
|
cbBarInfo& bar = *pRow->mBars[i];
|
||||||
|
|
||||||
bar.mHasLeftHandle = FALSE;
|
bar.mHasLeftHandle = false;
|
||||||
|
|
||||||
if ( !bar.IsFixed() )
|
if ( !bar.IsFixed() )
|
||||||
{
|
{
|
||||||
@@ -523,21 +523,21 @@ void cbRowLayoutPlugin::DetectBarHandles( cbRowInfo* pRow )
|
|||||||
if ( bar.mpPrev &&
|
if ( bar.mpPrev &&
|
||||||
bar.mpPrev->IsFixed() )
|
bar.mpPrev->IsFixed() )
|
||||||
|
|
||||||
bar.mHasLeftHandle = TRUE;
|
bar.mHasLeftHandle = true;
|
||||||
|
|
||||||
foundNotFixed = TRUE;
|
foundNotFixed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// pass from right to left (detect right-side handles)
|
// pass from right to left (detect right-side handles)
|
||||||
|
|
||||||
foundNotFixed = FALSE;
|
foundNotFixed = false;
|
||||||
|
|
||||||
cbBarInfo* pBar = pRow->mBars[ pRow->mBars.Count() - 1 ];
|
cbBarInfo* pBar = pRow->mBars[ pRow->mBars.Count() - 1 ];
|
||||||
|
|
||||||
while( pBar )
|
while( pBar )
|
||||||
{
|
{
|
||||||
pBar->mHasRightHandle = FALSE;
|
pBar->mHasRightHandle = false;
|
||||||
|
|
||||||
if ( !pBar->IsFixed() )
|
if ( !pBar->IsFixed() )
|
||||||
{
|
{
|
||||||
@@ -545,9 +545,9 @@ void cbRowLayoutPlugin::DetectBarHandles( cbRowInfo* pRow )
|
|||||||
|
|
||||||
if ( pBar->mpNext )
|
if ( pBar->mpNext )
|
||||||
|
|
||||||
pBar->mHasRightHandle = TRUE;
|
pBar->mHasRightHandle = true;
|
||||||
|
|
||||||
foundNotFixed = TRUE;
|
foundNotFixed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pBar = pBar->mpPrev;
|
pBar = pBar->mpPrev;
|
||||||
@@ -962,8 +962,8 @@ void cbRowLayoutPlugin::OnRemoveBar ( cbRemoveBarEvent& event )
|
|||||||
|
|
||||||
// rest bar information after removing it from the row
|
// rest bar information after removing it from the row
|
||||||
pBar->mpRow = NULL;
|
pBar->mpRow = NULL;
|
||||||
pBar->mHasLeftHandle = FALSE;
|
pBar->mHasLeftHandle = false;
|
||||||
pBar->mHasRightHandle = FALSE;
|
pBar->mHasRightHandle = false;
|
||||||
|
|
||||||
mpPane->InitLinksForRow( pRow ); // relink "mpNext/mpPrev"s
|
mpPane->InitLinksForRow( pRow ); // relink "mpNext/mpPrev"s
|
||||||
|
|
||||||
@@ -982,7 +982,7 @@ void cbRowLayoutPlugin::OnRemoveBar ( cbRemoveBarEvent& event )
|
|||||||
// force repainting of bars, in the row, from which the bar was removed
|
// force repainting of bars, in the row, from which the bar was removed
|
||||||
|
|
||||||
// FIXME:: really needed?
|
// FIXME:: really needed?
|
||||||
pRow->mBars[0]->mUMgrData.SetDirty(TRUE);
|
pRow->mBars[0]->mUMgrData.SetDirty(true);
|
||||||
|
|
||||||
// re-setup mHasOnlyFixedBars flag for the row information
|
// re-setup mHasOnlyFixedBars flag for the row information
|
||||||
event.mpPane->SyncRowFlags( pRow );
|
event.mpPane->SyncRowFlags( pRow );
|
||||||
@@ -1059,22 +1059,22 @@ void cbRowLayoutPlugin::OnLayoutRows( cbLayoutRowsEvent& event )
|
|||||||
if ( mpPane->mAlignment == FL_ALIGN_TOP ||
|
if ( mpPane->mAlignment == FL_ALIGN_TOP ||
|
||||||
mpPane->mAlignment == FL_ALIGN_LEFT )
|
mpPane->mAlignment == FL_ALIGN_LEFT )
|
||||||
{
|
{
|
||||||
row.mHasLowerHandle = TRUE;
|
row.mHasLowerHandle = true;
|
||||||
|
|
||||||
row.mHasUpperHandle = FALSE;
|
row.mHasUpperHandle = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
row.mHasUpperHandle = TRUE;
|
row.mHasUpperHandle = true;
|
||||||
|
|
||||||
row.mHasLowerHandle = FALSE;
|
row.mHasLowerHandle = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// otherwise, rows with fixed-bars only, have no height-resizing handles
|
// otherwise, rows with fixed-bars only, have no height-resizing handles
|
||||||
row.mHasUpperHandle = FALSE;
|
row.mHasUpperHandle = false;
|
||||||
row.mHasLowerHandle = FALSE;
|
row.mHasLowerHandle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup vertical positions for items in the row
|
// setup vertical positions for items in the row
|
||||||
@@ -1216,7 +1216,7 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
|
|||||||
else
|
else
|
||||||
event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight + ofs );
|
event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight + ofs );
|
||||||
|
|
||||||
mpLayout->RecalcLayout(FALSE);
|
mpLayout->RecalcLayout(false);
|
||||||
|
|
||||||
mpLayout->GetUpdatesManager().OnFinishChanges();
|
mpLayout->GetUpdatesManager().OnFinishChanges();
|
||||||
mpLayout->GetUpdatesManager().UpdateNow();
|
mpLayout->GetUpdatesManager().UpdateNow();
|
||||||
|
@@ -81,7 +81,7 @@ wxToolWindow::wxToolWindow()
|
|||||||
mTitleFont( 8, wxSWISS, wxNORMAL, wxNORMAL ),
|
mTitleFont( 8, wxSWISS, wxNORMAL, wxNORMAL ),
|
||||||
#else
|
#else
|
||||||
// just to simulate MS-Dev style
|
// just to simulate MS-Dev style
|
||||||
mTitleFont( 8, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT("MS Sans Serif") ),
|
mTitleFont( 8, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("MS Sans Serif") ),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mTitleHeight ( 16 ),
|
mTitleHeight ( 16 ),
|
||||||
@@ -94,13 +94,13 @@ wxToolWindow::wxToolWindow()
|
|||||||
mInTitleMargin( 4 ),
|
mInTitleMargin( 4 ),
|
||||||
mHintBorder ( 4 ),
|
mHintBorder ( 4 ),
|
||||||
|
|
||||||
mResizeStarted( FALSE ),
|
mResizeStarted( false ),
|
||||||
mRealTimeUpdatesOn( TRUE ),
|
mRealTimeUpdatesOn( true ),
|
||||||
|
|
||||||
mMTolerance ( 5 ), // mouse-resizing tollerance
|
mMTolerance ( 5 ), // mouse-resizing tollerance
|
||||||
|
|
||||||
mCursorType( HITS_WND_NOTHING ),
|
mCursorType( HITS_WND_NOTHING ),
|
||||||
mMouseCaptured( FALSE ),
|
mMouseCaptured( false ),
|
||||||
|
|
||||||
mpScrDc( NULL )
|
mpScrDc( NULL )
|
||||||
|
|
||||||
@@ -112,7 +112,6 @@ wxToolWindow::~wxToolWindow()
|
|||||||
if ( mpScrDc ) delete mpScrDc;
|
if ( mpScrDc ) delete mpScrDc;
|
||||||
|
|
||||||
for( size_t i = 0; i != mButtons.Count(); ++i )
|
for( size_t i = 0; i != mButtons.Count(); ++i )
|
||||||
|
|
||||||
delete mButtons[i];
|
delete mButtons[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,6 +170,7 @@ void wxToolWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
|||||||
dc.SetPen( *wxTRANSPARENT_PEN );
|
dc.SetPen( *wxTRANSPARENT_PEN );
|
||||||
|
|
||||||
int y = mWndVertGap + mTitleHeight + mClntVertGap;
|
int y = mWndVertGap + mTitleHeight + mClntVertGap;
|
||||||
|
|
||||||
dc.DrawRectangle( 0,0, w, y ); // Top grey part.
|
dc.DrawRectangle( 0,0, w, y ); // Top grey part.
|
||||||
dc.DrawRectangle( 0,y-1, mWndHorizGap + mClntHorizGap, h - y ); // Left grey part.
|
dc.DrawRectangle( 0,y-1, mWndHorizGap + mClntHorizGap, h - y ); // Left grey part.
|
||||||
dc.DrawRectangle( w - ( mWndHorizGap + mClntHorizGap ), y-1,
|
dc.DrawRectangle( w - ( mWndHorizGap + mClntHorizGap ), y-1,
|
||||||
@@ -207,7 +207,6 @@ void wxToolWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
|||||||
dc.SetFont( mTitleFont );
|
dc.SetFont( mTitleFont );
|
||||||
|
|
||||||
for( size_t i = 0; i != mButtons.Count(); ++i )
|
for( size_t i = 0; i != mButtons.Count(); ++i )
|
||||||
|
|
||||||
mButtons[i]->Draw( dc );
|
mButtons[i]->Draw( dc );
|
||||||
|
|
||||||
int x1 = mWndHorizGap + mClntHorizGap;
|
int x1 = mWndHorizGap + mClntHorizGap;
|
||||||
@@ -259,45 +258,48 @@ int wxToolWindow::HitTestWindow( wxMouseEvent& event )
|
|||||||
if ( pos.y <= r.y + k )
|
if ( pos.y <= r.y + k )
|
||||||
{
|
{
|
||||||
if ( pos.x < r.x + k*2 )
|
if ( pos.x < r.x + k*2 )
|
||||||
|
|
||||||
return HITS_WND_TOP_LEFT_CORNER;
|
return HITS_WND_TOP_LEFT_CORNER;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if ( pos.x >= r.x + r.width - k*2 )
|
if ( pos.x >= r.x + r.width - k*2 )
|
||||||
|
|
||||||
return HITS_WND_TOP_RIGHT_CORNER;
|
return HITS_WND_TOP_RIGHT_CORNER;
|
||||||
else
|
else
|
||||||
return HITS_WND_TOP_EDGE;
|
return HITS_WND_TOP_EDGE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if ( pos.y >= r.y + r.height - k )
|
if ( pos.y >= r.y + r.height - k )
|
||||||
{
|
{
|
||||||
if ( pos.x < r.x + k*2 )
|
if ( pos.x < r.x + k*2 )
|
||||||
|
|
||||||
return HITS_WND_BOTTOM_LEFT_CORNER;
|
return HITS_WND_BOTTOM_LEFT_CORNER;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if ( pos.x > r.x + r.width - k*2 )
|
if ( pos.x > r.x + r.width - k*2 )
|
||||||
|
|
||||||
return HITS_WND_BOTTOM_RIGHT_CORNER;
|
return HITS_WND_BOTTOM_RIGHT_CORNER;
|
||||||
else
|
else
|
||||||
return HITS_WND_BOTTOM_EDGE;
|
return HITS_WND_BOTTOM_EDGE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if ( pos.x <= r.x + k )
|
if ( pos.x <= r.x + k )
|
||||||
|
|
||||||
return HITS_WND_LEFT_EDGE;
|
return HITS_WND_LEFT_EDGE;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if ( pos.x >= r.x + r.width - k )
|
if ( pos.x >= r.x + r.width - k )
|
||||||
|
|
||||||
return HITS_WND_RIGHT_EDGE;
|
return HITS_WND_RIGHT_EDGE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( pos.y <= r.y + mWndVertGap + mTitleHeight + mClntVertGap )
|
if ( pos.y <= r.y + mWndVertGap + mTitleHeight + mClntVertGap )
|
||||||
|
|
||||||
return HITS_WND_TITLE;
|
return HITS_WND_TITLE;
|
||||||
else
|
else
|
||||||
return HITS_WND_CLIENT;
|
return HITS_WND_CLIENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxToolWindow::DrawHintRect( const wxRect& r )
|
void wxToolWindow::DrawHintRect( const wxRect& r )
|
||||||
{
|
{
|
||||||
@@ -348,7 +350,7 @@ void wxToolWindow::SetHintCursor( int type )
|
|||||||
if ( mMouseCaptured )
|
if ( mMouseCaptured )
|
||||||
{
|
{
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
mMouseCaptured = FALSE;
|
mMouseCaptured = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCursor( wxCURSOR_ARROW );
|
SetCursor( wxCURSOR_ARROW );
|
||||||
@@ -360,7 +362,7 @@ void wxToolWindow::SetHintCursor( int type )
|
|||||||
|
|
||||||
if ( !mMouseCaptured )
|
if ( !mMouseCaptured )
|
||||||
{
|
{
|
||||||
mMouseCaptured = TRUE;
|
mMouseCaptured = true;
|
||||||
CaptureMouse();
|
CaptureMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -517,7 +519,6 @@ void wxToolWindow::OnMotion( wxMouseEvent& event )
|
|||||||
if ( !mResizeStarted )
|
if ( !mResizeStarted )
|
||||||
{
|
{
|
||||||
for( size_t i = 0; i != mButtons.Count(); ++i )
|
for( size_t i = 0; i != mButtons.Count(); ++i )
|
||||||
|
|
||||||
mButtons[i]->OnMotion( wxPoint( event.m_x, event.m_y ) );
|
mButtons[i]->OnMotion( wxPoint( event.m_x, event.m_y ) );
|
||||||
|
|
||||||
SetHintCursor( HitTestWindow( event ) );
|
SetHintCursor( HitTestWindow( event ) );
|
||||||
@@ -588,7 +589,6 @@ void wxToolWindow::OnLeftDown( wxMouseEvent& event )
|
|||||||
mButtons[i]->OnLeftDown( wxPoint( event.m_x, event.m_y ) );
|
mButtons[i]->OnLeftDown( wxPoint( event.m_x, event.m_y ) );
|
||||||
|
|
||||||
if ( mButtons[i]->IsPressed() )
|
if ( mButtons[i]->IsPressed() )
|
||||||
|
|
||||||
return; // button hitted,
|
return; // button hitted,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -600,18 +600,14 @@ void wxToolWindow::OnLeftDown( wxMouseEvent& event )
|
|||||||
if ( mMouseCaptured `)
|
if ( mMouseCaptured `)
|
||||||
{
|
{
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
mMouseCaptured = FALSE;
|
mMouseCaptured = false;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if ( result == HITS_WND_TITLE &&
|
if ( result == HITS_WND_TITLE &&
|
||||||
HandleTitleClick( event )
|
HandleTitleClick( event ) )
|
||||||
)
|
|
||||||
{
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
mResizeStarted = TRUE;
|
mResizeStarted = true;
|
||||||
|
|
||||||
int x,y;
|
int x,y;
|
||||||
GetPosition( &x, &y );
|
GetPosition( &x, &y );
|
||||||
@@ -651,7 +647,7 @@ void wxToolWindow::OnLeftUp( wxMouseEvent& event )
|
|||||||
|
|
||||||
if ( mResizeStarted )
|
if ( mResizeStarted )
|
||||||
{
|
{
|
||||||
mResizeStarted = FALSE;
|
mResizeStarted = false;
|
||||||
|
|
||||||
if ( mCursorType != HITS_WND_TITLE )
|
if ( mCursorType != HITS_WND_TITLE )
|
||||||
{
|
{
|
||||||
@@ -706,17 +702,17 @@ void wxToolWindow::OnEraseBackground( wxEraseEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
cbMiniButton::cbMiniButton()
|
cbMiniButton::cbMiniButton()
|
||||||
|
|
||||||
: mVisible( TRUE ),
|
: mVisible( true ),
|
||||||
mEnabled( TRUE ),
|
mEnabled( true ),
|
||||||
|
|
||||||
mpLayout( NULL ),
|
mpLayout( NULL ),
|
||||||
mpPane ( NULL ),
|
mpPane ( NULL ),
|
||||||
mpPlugin( NULL ),
|
mpPlugin( NULL ),
|
||||||
mpWnd ( NULL ),
|
mpWnd ( NULL ),
|
||||||
|
|
||||||
mWasClicked( FALSE ),
|
mWasClicked( false ),
|
||||||
mDragStarted( FALSE ),
|
mDragStarted( false ),
|
||||||
mPressed( FALSE )
|
mPressed( false )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void cbMiniButton::SetPos( const wxPoint& pos )
|
void cbMiniButton::SetPos( const wxPoint& pos )
|
||||||
@@ -726,7 +722,7 @@ void cbMiniButton::SetPos( const wxPoint& pos )
|
|||||||
|
|
||||||
bool cbMiniButton::HitTest( const wxPoint& pos )
|
bool cbMiniButton::HitTest( const wxPoint& pos )
|
||||||
{
|
{
|
||||||
if ( !mVisible ) return FALSE;
|
if ( !mVisible ) return false;
|
||||||
|
|
||||||
return ( pos.x >= mPos.x && pos.y >= mPos.y &&
|
return ( pos.x >= mPos.x && pos.y >= mPos.y &&
|
||||||
pos.x < mPos.x + BTN_BOX_WIDTH &&
|
pos.x < mPos.x + BTN_BOX_WIDTH &&
|
||||||
@@ -747,9 +743,9 @@ void cbMiniButton::OnLeftDown( const wxPoint& pos )
|
|||||||
else
|
else
|
||||||
mpWnd->CaptureMouse();
|
mpWnd->CaptureMouse();
|
||||||
|
|
||||||
mDragStarted = TRUE;
|
mDragStarted = true;
|
||||||
mPressed = TRUE;
|
mPressed = true;
|
||||||
mWasClicked = FALSE;
|
mWasClicked = false;
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
@@ -768,9 +764,9 @@ void cbMiniButton::OnLeftUp( const wxPoint& WXUNUSED(pos) )
|
|||||||
mpWnd->ReleaseMouse();
|
mpWnd->ReleaseMouse();
|
||||||
|
|
||||||
mWasClicked = mPressed;
|
mWasClicked = mPressed;
|
||||||
mDragStarted = FALSE;
|
mDragStarted = false;
|
||||||
|
|
||||||
mPressed = FALSE;
|
mPressed = false;
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,7 +811,6 @@ void cbMiniButton::Draw( wxDC& dc )
|
|||||||
// "hard-code" metafile
|
// "hard-code" metafile
|
||||||
|
|
||||||
if ( !mPressed )
|
if ( !mPressed )
|
||||||
|
|
||||||
dc.SetPen( *wxWHITE_PEN );
|
dc.SetPen( *wxWHITE_PEN );
|
||||||
else
|
else
|
||||||
dc.SetPen( *wxBLACK_PEN );
|
dc.SetPen( *wxBLACK_PEN );
|
||||||
@@ -843,7 +838,6 @@ void cbMiniButton::Draw( wxDC& dc )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !mPressed )
|
if ( !mPressed )
|
||||||
|
|
||||||
dc.SetPen( *wxBLACK_PEN );
|
dc.SetPen( *wxBLACK_PEN );
|
||||||
else
|
else
|
||||||
dc.SetPen( *wxWHITE_PEN );
|
dc.SetPen( *wxWHITE_PEN );
|
||||||
@@ -862,7 +856,7 @@ bool cbMiniButton::WasClicked()
|
|||||||
|
|
||||||
void cbMiniButton::Reset()
|
void cbMiniButton::Reset()
|
||||||
{
|
{
|
||||||
mWasClicked = FALSE;
|
mWasClicked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Implementation fro class cbCloseBox *****/
|
/***** Implementation fro class cbCloseBox *****/
|
||||||
@@ -1059,7 +1053,6 @@ wxSize cbFloatedBarWindow::GetPreferredSize( const wxSize& given )
|
|||||||
{
|
{
|
||||||
if ( mpBar->mDimInfo.GetDimHandler() )
|
if ( mpBar->mDimInfo.GetDimHandler() )
|
||||||
{
|
{
|
||||||
|
|
||||||
cbBarDimHandlerBase* pHandler = mpBar->mDimInfo.GetDimHandler();
|
cbBarDimHandlerBase* pHandler = mpBar->mDimInfo.GetDimHandler();
|
||||||
|
|
||||||
wxSize prefDim;
|
wxSize prefDim;
|
||||||
@@ -1073,7 +1066,6 @@ wxSize cbFloatedBarWindow::GetPreferredSize( const wxSize& given )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( mpBar->IsFixed() )
|
if ( mpBar->IsFixed() )
|
||||||
|
|
||||||
return mpBar->mDimInfo.mSizes[ wxCBAR_FLOATING ];
|
return mpBar->mDimInfo.mSizes[ wxCBAR_FLOATING ];
|
||||||
else
|
else
|
||||||
return given; // not-fixed bars are resized exactly the way user wants
|
return given; // not-fixed bars are resized exactly the way user wants
|
||||||
@@ -1088,16 +1080,16 @@ void cbFloatedBarWindow::OnMiniButtonClicked( int btnIdx )
|
|||||||
if ( btnIdx == 0 )
|
if ( btnIdx == 0 )
|
||||||
{
|
{
|
||||||
mpBar->mAlignment = -1; // sepcial "marking" for hidden bars out of floated state
|
mpBar->mAlignment = -1; // sepcial "marking" for hidden bars out of floated state
|
||||||
mpLayout->SetBarState( mpBar, wxCBAR_HIDDEN, TRUE );
|
mpLayout->SetBarState( mpBar, wxCBAR_HIDDEN, true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mpLayout->SetBarState( mpBar, wxCBAR_DOCKED_HORIZONTALLY, TRUE );
|
mpLayout->SetBarState( mpBar, wxCBAR_DOCKED_HORIZONTALLY, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cbFloatedBarWindow::HandleTitleClick( wxMouseEvent& event )
|
bool cbFloatedBarWindow::HandleTitleClick( wxMouseEvent& event )
|
||||||
{
|
{
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
mMouseCaptured = FALSE;
|
mMouseCaptured = false;
|
||||||
|
|
||||||
wxPoint scrPos;
|
wxPoint scrPos;
|
||||||
GetScrMousePos( event, scrPos );
|
GetScrMousePos( event, scrPos );
|
||||||
@@ -1134,12 +1126,12 @@ bool cbFloatedBarWindow::HandleTitleClick( wxMouseEvent& event )
|
|||||||
|
|
||||||
mpLayout->FirePluginEvent( dragEvt );
|
mpLayout->FirePluginEvent( dragEvt );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbFloatedBarWindow::OnDblClick( wxMouseEvent& WXUNUSED(event) )
|
void cbFloatedBarWindow::OnDblClick( wxMouseEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
mpLayout->SetBarState( mpBar, wxCBAR_DOCKED_HORIZONTALLY, TRUE );
|
mpLayout->SetBarState( mpBar, wxCBAR_DOCKED_HORIZONTALLY, true );
|
||||||
|
|
||||||
//wxMessageBox("toolWnd - dblClick!");
|
//wxMessageBox("toolWnd - dblClick!");
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ void cbSimpleUpdatesMgr::OnStartChanges()
|
|||||||
cbDockPane& pane = *panes[n];
|
cbDockPane& pane = *panes[n];
|
||||||
// store pane state
|
// store pane state
|
||||||
pane.mUMgrData.StoreItemState( pane.mBoundsInParent );
|
pane.mUMgrData.StoreItemState( pane.mBoundsInParent );
|
||||||
pane.mUMgrData.SetDirty( FALSE );
|
pane.mUMgrData.SetDirty( false );
|
||||||
|
|
||||||
for( size_t i = 0; i != pane.GetRowList().Count(); ++i )
|
for( size_t i = 0; i != pane.GetRowList().Count(); ++i )
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ void cbSimpleUpdatesMgr::OnStartChanges()
|
|||||||
|
|
||||||
// store row state
|
// store row state
|
||||||
row.mUMgrData.StoreItemState( row.mBoundsInParent );
|
row.mUMgrData.StoreItemState( row.mBoundsInParent );
|
||||||
row.mUMgrData.SetDirty( FALSE );
|
row.mUMgrData.SetDirty( false );
|
||||||
|
|
||||||
for( size_t k = 0; k != row.mBars.Count(); ++k )
|
for( size_t k = 0; k != row.mBars.Count(); ++k )
|
||||||
{
|
{
|
||||||
@@ -91,7 +91,7 @@ void cbSimpleUpdatesMgr::OnStartChanges()
|
|||||||
|
|
||||||
// store bar state
|
// store bar state
|
||||||
bar.mUMgrData.StoreItemState( bar.mBoundsInParent );
|
bar.mUMgrData.StoreItemState( bar.mBoundsInParent );
|
||||||
bar.mUMgrData.SetDirty( FALSE );
|
bar.mUMgrData.SetDirty( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ void cbSimpleUpdatesMgr::UpdateNow()
|
|||||||
|
|
||||||
wxDC* pDc = NULL;
|
wxDC* pDc = NULL;
|
||||||
|
|
||||||
bool rowChanged = FALSE;
|
bool rowChanged = false;
|
||||||
|
|
||||||
// FIXME:: the below should not be fixed
|
// FIXME:: the below should not be fixed
|
||||||
cbBarInfo* barsToRepaint[256];
|
cbBarInfo* barsToRepaint[256];
|
||||||
@@ -173,7 +173,7 @@ void cbSimpleUpdatesMgr::UpdateNow()
|
|||||||
|
|
||||||
if ( WasChanged( row.mUMgrData, row.mBoundsInParent ) )
|
if ( WasChanged( row.mUMgrData, row.mBoundsInParent ) )
|
||||||
|
|
||||||
rowChanged = TRUE;
|
rowChanged = true;
|
||||||
else
|
else
|
||||||
for( size_t k = 0; k != row.mBars.Count(); ++k )
|
for( size_t k = 0; k != row.mBars.Count(); ++k )
|
||||||
|
|
||||||
@@ -274,8 +274,8 @@ void cbSimpleUpdatesMgr::UpdateNow()
|
|||||||
pBar->mpBarWnd->Refresh();
|
pBar->mpBarWnd->Refresh();
|
||||||
|
|
||||||
// FIXME::
|
// FIXME::
|
||||||
//info.mpBarWnd->Show(FALSE);
|
//info.mpBarWnd->Show(false);
|
||||||
//info.mpBarWnd->Show(TRUE);
|
//info.mpBarWnd->Show(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
pNode = pNode->GetNext();
|
pNode = pNode->GetNext();
|
||||||
|
Reference in New Issue
Block a user