// Created: 06/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
cbPaneDrawPlugin::cbPaneDrawPlugin(void)
- : mResizeStarted ( FALSE ),
+ : mResizeStarted ( false ),
- mResizeCursorOn ( FALSE ),
+ mResizeCursorOn ( false ),
mpDraggedBar ( NULL ),
mpResizedRow ( NULL ),
- mRowHandleHitted ( FALSE ),
- mIsUpperHandle ( FALSE ),
- mBarHandleHitted ( FALSE ),
- mIsLeftHandle ( FALSE ),
- mBarContentHitted ( FALSE ),
+ mRowHandleHitted ( false ),
+ mIsUpperHandle ( false ),
+ mBarHandleHitted ( false ),
+ mIsLeftHandle ( false ),
+ mBarContentHitted ( false ),
mpClntDc ( NULL ),
mpPane ( NULL )
// bar-row resizing state varaibles
- mResizeStarted ( FALSE ),
+ mResizeStarted ( false ),
- mResizeCursorOn ( FALSE ),
+ mResizeCursorOn ( false ),
mpDraggedBar ( NULL ),
mpResizedRow ( NULL ),
- mRowHandleHitted ( FALSE ),
- mIsUpperHandle ( FALSE ),
- mBarHandleHitted ( FALSE ),
- mIsLeftHandle ( FALSE ),
- mBarContentHitted ( FALSE ),
+ mRowHandleHitted ( false ),
+ mIsUpperHandle ( false ),
+ mBarHandleHitted ( false ),
+ mIsLeftHandle ( false ),
+ mBarContentHitted ( false ),
mpClntDc ( NULL ),
mpPane ( NULL )
bool prevWasRowHandle = mRowHandleHitted;
- mBarContentHitted = FALSE;
- mBarHandleHitted = FALSE;
- mRowHandleHitted = FALSE;
+ mBarContentHitted = false;
+ mBarHandleHitted = false;
+ mRowHandleHitted = false;
int testResult =
event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes
mpLayout->ReleaseEventsFromPane( event.mpPane );
mpLayout->ReleaseEventsFromPlugin( this );
- mResizeCursorOn = FALSE;
+ mResizeCursorOn = false;
- mBarContentHitted = TRUE;
+ mBarContentHitted = true;
// In Windows, at least, the frame needs to have a null cursor
// else child windows (such as text windows) inherit the cursor
return;
}
- wxCursor* pCurs = NULL;
+ wxCursor* pCurs;
if ( testResult == CB_UPPER_ROW_HANDLE_HITTED ||
testResult == CB_LOWER_ROW_HANDLE_HITTED)
else
pCurs = mpLayout->mpHorizCursor;
- mRowHandleHitted = TRUE;
+ mRowHandleHitted = true;
mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED );
}
else
else
pCurs = mpLayout->mpVertCursor;
- mBarHandleHitted = TRUE;
+ mBarHandleHitted = true;
mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED );
}
mpLayout->GetParentFrame().SetCursor( *pCurs );
}
- mResizeCursorOn = TRUE;
+ mResizeCursorOn = true;
// handled is being dragged now, thus event is "eaten" by this plugin
mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor );
#endif
- mResizeCursorOn = FALSE;
+ mResizeCursorOn = false;
}
event.Skip(); // pass event to the next plugin
if ( mResizeCursorOn )
{
- mResizeStarted = TRUE;
+ mResizeStarted = true;
mDragOrigin = event.mPos;
// setup constraints for the dragging handle
int from, till;
mHandleOfs = 0;
- mHandleIsVertical = FALSE;
+ mHandleIsVertical = false;
if ( mRowHandleHitted )
if ( mRowHandleHitted )
{
- mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? FALSE : TRUE;
+ mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? false : true;
mHandleDragArea.x = 0;
mHandleDragArea.width = event.mpPane->mPaneWidth;
// cbRowInfo& rowInfo = *mpDraggedBar->mpRow;
wxRect& bounds = mpDraggedBar->mBounds;
- mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? TRUE : FALSE;
+ mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? true : false;
mHandleDragArea.x = from;
mHandleDragArea.width = till - from;
{
DrawDraggedHandle( event.mPos, *event.mpPane );
- mResizeStarted = FALSE;
- mResizeCursorOn = FALSE;
+ mResizeStarted = false;
+ mResizeCursorOn = false;
mpLayout->ReleaseEventsFromPane( event.mpPane );
mpLayout->ReleaseEventsFromPlugin( this );
// FIXME:: +/- 1s
+ int nNewHeight = bounds.height - 2 - bar.mDimInfo.mVertGap *2;
+ if(nNewHeight < 0)
+ nNewHeight = 0;
+
bar.mpBarWnd->wxWindow::SetSize( bounds.x + 1 + bar.mDimInfo.mHorizGap,
bounds.y + 1 + bar.mDimInfo.mVertGap,
bounds.width - 2 - bar.mDimInfo.mHorizGap*2,
- bounds.height - 2 - bar.mDimInfo.mVertGap *2 ,
+ nNewHeight,
0
);
if ( !bar.mpBarWnd->IsShown() )
- bar.mpBarWnd->Show( TRUE );
+ bar.mpBarWnd->Show( true );
}
else
// 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.mArea.width, event.mArea.height );
}
-void cbPaneDrawPlugin::OnFinishDrawInArea( cbFinishDrawInAreaEvent& event )
+void cbPaneDrawPlugin::OnFinishDrawInArea( cbFinishDrawInAreaEvent& WXUNUSED(event) )
{
// DBG::
wxASSERT( mpClntDc );