wxWidgets/utils/framelayout/src/rowlayoutpl.h
Harco de Hilster bd9396d52d Added Aleksandras' framelayout code, with more or less working Linux Makefiles
General makefiles to be added later.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-03-07 23:34:37 +00:00

82 lines
2.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: No names yet.
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by:
// Created: 02/10/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __ROWLAYOUTPL_G__
#define __ROWLAYOUTPL_G__
#include "controlbar.h"
/*
* Simple implementaiton of plugin, which handles row-layouting
* requests sent from Frame Layout
*/
class cbRowLayoutPlugin : public cbPluginBase
{
DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin )
protected:
cbDockPane* mpPane; // is set up temorarely, while handling event
protected:
// not-fixed-bars layouting related helpers
void FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow );
void RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInfo* pRow );
void MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve );
int GetRowFreeSpace( cbRowInfo* pRow );
void RecalcLenghtRatios( cbRowInfo* pRow );
void ApplyLenghtRatios( cbRowInfo* pRow );
void ExpandNotFixedBars( cbRowInfo* pRow );
void AdjustLenghtOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar );
void DetectBarHandles( cbRowInfo* pRow );
void CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& rowInfo );
// row-layouting helpers (simulate "bar-friction")
int CalcRowHeight( cbRowInfo& row );
void LayoutItemsVertically( cbRowInfo& row );
void StickRightSideBars( cbBarInfo* pToBar );
void SlideLeftSideBars ( cbBarInfo* pTheBar );
void SlideRightSideBars( cbBarInfo* pTheBar );
void ShiftLeftTrashold ( cbBarInfo* pTheBar, cbRowInfo& row );
void ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row );
void InsertBefore( cbBarInfo* pBeforeBar,
cbBarInfo* pTheBar,
cbRowInfo& row
);
void DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row );
public:
cbRowLayoutPlugin(void);
cbRowLayoutPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES );
// event handlers
void OnResizeRow ( cbResizeRowEvent& event );
void OnInsertBar ( cbInsertBarEvent& event );
void OnRemoveBar ( cbRemoveBarEvent& event );
void OnLayoutRow ( cbLayoutRowEvent& event );
void OnLayoutRows( cbLayoutRowsEvent& event );
DECLARE_EVENT_TABLE()
};
#endif