2001-07-24 11:27:12 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-01-21 17:34:42 -05:00
|
|
|
// Name: rowlayoutpl.h
|
|
|
|
// Purpose: cbRowLayoutPlugin header.
|
2001-07-24 11:27:12 -04:00
|
|
|
// Author: Aleksandras Gluchovas
|
|
|
|
// Modified by:
|
|
|
|
// Created: 02/10/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Aleksandras Gluchovas
|
2002-01-21 17:34:42 -05:00
|
|
|
// Licence: wxWindows licence
|
2001-07-24 11:27:12 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __ROWLAYOUTPL_G__
|
|
|
|
#define __ROWLAYOUTPL_G__
|
|
|
|
|
2002-09-07 08:28:46 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2001-07-24 11:27:12 -04:00
|
|
|
#pragma interface "rowlayoutpl.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/fl/controlbar.h"
|
|
|
|
|
|
|
|
/*
|
2002-01-21 17:34:42 -05:00
|
|
|
Simple implementation of a plugin which handles row layout
|
|
|
|
requests sent from a frame layout.
|
|
|
|
*/
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
class cbRowLayoutPlugin : public cbPluginBase
|
|
|
|
{
|
2002-01-21 17:34:42 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin )
|
2001-07-24 11:27:12 -04:00
|
|
|
protected:
|
2002-01-21 17:34:42 -05:00
|
|
|
cbDockPane* mpPane; // is set up temporarily, while handling event
|
2001-07-24 11:27:12 -04:00
|
|
|
protected:
|
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInfo* pRow );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
int GetRowFreeSpace( cbRowInfo* pRow );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void RecalcLengthRatios( cbRowInfo* pRow );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void ApplyLengthRatios( cbRowInfo* pRow );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void ExpandNotFixedBars( cbRowInfo* pRow );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void DetectBarHandles( cbRowInfo* pRow );
|
|
|
|
|
|
|
|
// Internal helper relating to not-fixed-bars layout.
|
|
|
|
void CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& rowInfo );
|
|
|
|
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
int CalcRowHeight( cbRowInfo& row );
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
void LayoutItemsVertically( cbRowInfo& row );
|
|
|
|
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
void StickRightSideBars( cbBarInfo* pToBar );
|
|
|
|
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
void SlideLeftSideBars ( cbBarInfo* pTheBar );
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
void SlideRightSideBars( cbBarInfo* pTheBar );
|
|
|
|
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
void ShiftLeftTrashold ( cbBarInfo* pTheBar, cbRowInfo& row );
|
|
|
|
|
|
|
|
// Row layout helper simulating bar 'friction'.
|
|
|
|
void ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row );
|
|
|
|
|
|
|
|
|
|
|
|
// Insert the bar before the given row.
|
|
|
|
void InsertBefore( cbBarInfo* pBeforeBar,
|
|
|
|
cbBarInfo* pTheBar,
|
|
|
|
cbRowInfo& row
|
|
|
|
);
|
|
|
|
|
|
|
|
// Insert the bar before the given row.
|
|
|
|
void DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
public:
|
2002-01-21 17:34:42 -05:00
|
|
|
// Default constructor.
|
|
|
|
cbRowLayoutPlugin(void);
|
|
|
|
|
|
|
|
// Constructor taking frame layout pane and pane mask.
|
|
|
|
cbRowLayoutPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES );
|
|
|
|
|
|
|
|
// Responds to row resize event.
|
|
|
|
void OnResizeRow ( cbResizeRowEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Responds to bar insertion event.
|
|
|
|
void OnInsertBar ( cbInsertBarEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Responds to bar removal event.
|
|
|
|
void OnRemoveBar ( cbRemoveBarEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Responds to row layout event.
|
|
|
|
void OnLayoutRow ( cbLayoutRowEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Responds to rows layout event.
|
|
|
|
void OnLayoutRows( cbLayoutRowsEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2001-07-24 11:27:12 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ROWLAYOUTPL_G__ */
|
|
|
|
|