BIN_TARGET=fl_demo
# define library sources
-BIN_CPP_SRC=\
- fl_demo.cpp\
+BIN_CPP_SRC= \
+ fl_demo.cpp \
+ settingsdlg.cpp \
+ wxinfo.cpp
#define library objects
BIN_OBJ=\
new cbDynToolBarDimHandler()
);
- cbDimInfo sizes4( 430,35, // when docked horizontally
+ cbDimInfo sizes4( 450,35, // when docked horizontally
44,375, // when docked vertically
80,100, // when floated
TRUE, // the bar is fixed-size
pTBar2->AddTool( 4, wxBitmap("nextmark_icon") );
pTBar2->AddTool( 5, wxBitmap("prevmark_icon") );
-
-
wxDynamicToolBar* pTBar3 = new wxDynamicToolBar( mpInternalFrm, -1 );
pTBar3->AddTool( 1, wxBitmap("open_icon"), " Open " );
pTBar2->AddTool( 4, nextmark_xpm );
pTBar2->AddTool( 5, prevmark_xpm );
-
wxDynamicToolBar* pTBar3 = new wxDynamicToolBar( mpInternalFrm, -1 );
pTBar3->AddTool( 1, wxBitmap(open_xpm), " Open " );
pTBar3->AddTool( 5, wxBitmap(copy_xpm), " Copy " );
pTBar3->AddTool( 6, wxBitmap(paste_xpm), " Paste " );
+ pTBar3->EnableTool( 2, FALSE );
+
wxDynamicToolBar* pTBar4 = new wxDynamicToolBar( mpInternalFrm, -1 );
pTBar4->AddTool( 1, wxBitmap(bookmarks_xpm), "Bookmarks ", TRUE );
pTBar4->AddTool( 3, wxBitmap(prevmark_xpm), "Prev bookmark ", TRUE );
//pTBar4->AddSeparator();
pTBar4->AddTool( 4, wxBitmap(search_xpm),"Search ", TRUE );
+
+ pTBar4->EnableTool( 4, FALSE );
#endif
layout.AddBar( pTBar2,
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: settingsdlg.cpp
+// Purpose: Settings dialog for Frame Layout
+// Author: Aleksandras Gluchovas
+// Modified by:
+// Created: 05/11/98
+// RCS-ID: $Id$
+// Copyright: (c) Aleksandras Gluchovas
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "settingsdlg.cpp"
+#pragma interface "settingsdlg.cpp"
+#endif
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include <stdlib.h>
+#include "settingsdlg.h"
+
+/***** Implementation for class SettingsDlg *****/
+
+#define ID_NOTES ( wxEVT_FIRST + 1000 )
+#define ID_HINTANIM_CHECK ( ID_NOTES + 1 )
+#define ID_RTUPDATES_CHECK ( ID_NOTES + 2 )
+
+BEGIN_EVENT_TABLE( SettingsDlg, wxDialog )
+
+ EVT_BUTTON( wxID_APPLY, SettingsDlg::OnApply )
+ EVT_BUTTON( ID_NOTES, SettingsDlg::OnNotes )
+
+ EVT_CHECKBOX( ID_HINTANIM_CHECK, SettingsDlg::OnHintAnimCheck )
+ EVT_CHECKBOX( ID_RTUPDATES_CHECK, SettingsDlg::OnRTUpdatesCheck )
+
+END_EVENT_TABLE()
+
+SettingsDlg::SettingsDlg( wxWindow* pParent )
+
+ : wxDialog( pParent, -1, "Active Layout Settings...",
+ wxDefaultPosition,
+ wxSize( 325,585),
+ wxDIALOG_MODAL | wxCAPTION )
+{
+ int curY = 10;
+ int lMargin = 50;
+ int lBoxMargin = lMargin - 20;
+ int checkHeight = 20;
+ int labelHeight = 20;
+ int boxWidth = 260;
+ int interBoxGap = 10;
+ int lastItemGap = 10;
+
+ int topY = curY;
+
+ curY += labelHeight;
+
+ mpRTU_Check = new wxCheckBox( this, ID_RTUPDATES_CHECK,
+ "&Real-time updates",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpOPD_Check = new wxCheckBox( this, -1, "&Out of Pane drag",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpEDP_Check = new wxCheckBox( this, -1, "&Exact docking prediction",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpNDF_Check = new wxCheckBox( this, -1, "Non-destructive bar &friction",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpSPB_Check = new wxCheckBox( this, -1, "&Shaded pane borders",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight + lastItemGap;
+
+ wxStaticBox* pDNDBox = new wxStaticBox( this, -1, "Drag && Drop settings",
+ wxPoint( lBoxMargin, topY ),
+ wxSize( boxWidth, curY - topY ) );
+
+ curY += interBoxGap;
+
+ ////////////////////////////////////////////////////////////////////
+
+ topY = curY;
+
+ curY += labelHeight;
+
+ mpHAP_Check = new wxCheckBox( this, ID_HINTANIM_CHECK,
+ "&Hint-Rect animation plugin",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpGCU_Check = new wxCheckBox( this, -1, "\"Garbage collecting\" &Updates-Mgr.",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpAFP_Check = new wxCheckBox( this, -1, "&Antiflicker plugin",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight;
+
+ mpCSP_Check = new wxCheckBox( this, -1, "C&ustomization plugin",
+ wxPoint( lMargin, curY ) );
+
+ curY += checkHeight + lastItemGap;
+
+ wxStaticBox* pPBox = new wxStaticBox( this, -1, "Plugins",
+ wxPoint( lBoxMargin, topY ),
+ wxSize( boxWidth, curY - topY ) );
+
+ curY += interBoxGap;
+
+ ////////////////////////////////////////////////////////////////////
+
+ wxSize fieldSz( 30,20 );
+ int fieldHeight = 20;
+ int fieldCapMargin = lMargin + fieldSz.x + 5;
+ int fieldCapOfs = 4;
+
+ topY = curY;
+
+ curY += labelHeight;
+
+ mpRWInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpRWLabel = new wxStaticText ( this, -1, "Resizing sash width(height)",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+
+ curY += fieldHeight;
+
+ mpPTMInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpPTMLabel = new wxStaticText( this, -1, "Pene's top margin",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+
+ curY += fieldHeight;
+
+
+ mpPBMInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpPBMLabel = new wxStaticText( this, -1, "Pene's bottom margin",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+
+ curY += fieldHeight;
+
+
+ mpPLMInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpPLMLabel = new wxStaticText( this, -1, "Pane's left margin",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+
+ curY += fieldHeight;
+
+
+ mpPRMInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpPRMLabel = new wxStaticText( this, -1, "Pane's right margin",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+ curY += fieldHeight + lastItemGap;
+
+ wxStaticBox* pCPPBox = new wxStaticBox( this, -1, "Common Pane properties",
+ wxPoint( lBoxMargin, topY ),
+ wxSize( boxWidth, curY - topY ) );
+
+ curY += interBoxGap;
+
+ ////////////////////////////////////////////////////////////////////
+
+ topY = curY;
+
+ curY += labelHeight;
+
+ fieldSz.x = 65;
+ fieldCapMargin = lMargin + fieldSz.x + 10;
+
+ mpDCInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpDCLabel = new wxStaticText ( this, -1, "Dark Color (hex-RGB)",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+ curY += fieldHeight;
+
+ mpLCInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpLCLabel = new wxStaticText ( this, -1, "Light Color (hex-RGB)",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+ curY += fieldHeight;
+
+ mpGCInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpGCLabel = new wxStaticText ( this, -1, "Gray Color (hex-RGB)",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+ curY += fieldHeight;
+
+ mpBCInput = new wxTextCtrl ( this, -1, "",
+ wxPoint( lMargin, curY ),
+ fieldSz );
+
+ mpBCLabel = new wxStaticText ( this, -1, "Pane border Color (hex-RGB)",
+ wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
+
+ curY += fieldHeight + lastItemGap;
+
+ wxStaticBox* pCSPBox = new wxStaticBox( this, -1, "Coluor sheme properties",
+ wxPoint( lBoxMargin, topY ),
+ wxSize( boxWidth, curY - topY ) );
+
+ curY += interBoxGap; /*button ofs*/;
+
+ ////////////////////////////////////////////////////////////////////////////////
+
+ int lBtnMargin = 35;
+ int btnGap = 20;
+ int btnHeight = 22;
+ int btnWidth = 70;
+
+ wxButton* mpApplyBtn = new wxButton( this, wxID_APPLY, "A&pply",
+ wxPoint( lBtnMargin, curY ),
+ wxSize( btnWidth, btnHeight ) );
+
+ wxButton* mpCancelBtn = new wxButton( this, wxID_CANCEL, "&Cancel",
+ wxPoint( lBtnMargin + btnWidth + btnGap, curY ),
+ wxSize( btnWidth, btnHeight ) );
+
+ wxButton* mpNotesBtn = new wxButton( this, ID_NOTES, "&Notes...",
+ wxPoint( lBtnMargin + 2*btnWidth + 2*btnGap, curY ),
+ wxSize( btnWidth, btnHeight ) );
+
+ mpApplyBtn->SetDefault();
+ mpApplyBtn->SetFocus();
+
+ Center( wxBOTH );
+}
+
+void SettingsDlg::ExchangeFields( bool toDialog )
+{
+ mToDlg = toDialog;
+
+ ExchgCheck( mpRTU_Check, mRealTimeUpdatesOn );
+ ExchgCheck( mpOPD_Check, mOutOfPaneDragOn );
+ ExchgCheck( mpEDP_Check, mExactDockingPredictionOn );
+ ExchgCheck( mpNDF_Check, mNonDestructFrictionOn );
+ ExchgCheck( mpSPB_Check, m3DShadesOn );
+
+ ExchgCheck( mpHAP_Check, mHintRectAnimationOn );
+ ExchgCheck( mpGCU_Check, mGCUpdatesMgrOn );
+ ExchgCheck( mpAFP_Check, mAntiflickerPluginOn );
+ ExchgCheck( mpCSP_Check, mCustomizationPluginOn );
+
+ ExchgIntField( mpRWInput, mSashWidth );
+ ExchgIntField( mpPTMInput, mTopMargin );
+ ExchgIntField( mpPBMInput, mBottomMargin );
+ ExchgIntField( mpPLMInput, mLeftMargin );
+ ExchgIntField( mpPRMInput, mRightMargin );
+
+ ExchgColourField( mpDCInput, mDarkCol );
+ ExchgColourField( mpLCInput, mLightCol );
+ ExchgColourField( mpGCInput, mGrayCol );
+ ExchgColourField( mpBCInput, mBorderCol );
+}
+
+void SettingsDlg::OnApply( wxCommandEvent& event )
+{
+ ExchangeFields( FALSE );
+ EndModal( wxID_APPLY );
+}
+
+void SettingsDlg::OnNotes( wxCommandEvent& event )
+{
+ wxMessageBox("Notes go here...(TBD)");
+}
+
+void SettingsDlg::OnRTUpdatesCheck( wxCommandEvent& event )
+{
+ if ( mpRTU_Check->GetValue() == TRUE )
+ {
+ // user probably wants to see how the real-time drag & drop
+ // works -- so we "let 'im know" that animation is N/A when
+ // real-time option is on
+
+ mpHAP_Check->SetValue(FALSE);
+ mpHAP_Check->Refresh();
+ }
+}
+
+void SettingsDlg::OnHintAnimCheck( wxCommandEvent& event )
+{
+ if ( mpHAP_Check->GetValue() == TRUE )
+ {
+ // user probably wants to see some animation effects,
+ // but he/she forgot to turn off "real-time updates"
+ // setting -- so we do it for you :-)
+
+ mpRTU_Check->SetValue(FALSE);
+ mpRTU_Check->Refresh();
+ }
+}
+
+void SettingsDlg::ExchgCheck( wxCheckBox* pChk, bool& value )
+{
+ if ( mToDlg ) pChk->SetValue( value );
+
+ else value = pChk->GetValue();
+}
+
+void SettingsDlg::ExchgIntField( wxTextCtrl* pFld, int& value )
+{
+ if ( mToDlg )
+ {
+ char buf[32];
+
+ sprintf( buf, "%d", value );
+ pFld->SetValue( buf );
+ }
+ else
+ {
+ wxString txt = pFld->GetLineText( 0 );
+ value = atoi( txt );
+ }
+}
+
+void SettingsDlg::ExchgColourField( wxTextCtrl* pFld, wxColour& value )
+{
+ int rgbVal;
+
+ if ( mToDlg )
+ {
+ rgbVal = ( value.Red() & 0x0000FF ) |
+ ( (value.Green() << 8 ) & 0x00FF00 ) |
+ ( (value.Blue() << 16 ) & 0xFF0000 );
+
+ char buf[32];
+
+ sprintf( buf, "0x%06X", rgbVal );
+
+ pFld->SetValue( buf );
+ }
+ else
+ {
+ wxString txt = pFld->GetLineText( 0 );
+
+ sscanf( txt, "0x%06X", &rgbVal );
+
+ value.Set( rgbVal & 0xFF,
+ ( rgbVal >> 8 ) & 0xFF,
+ ( rgbVal >> 16 ) & 0xFF );
+ }
+}
+
+bool SettingsDlg::TransferDataToWindow()
+{
+ ExchangeFields( TRUE );
+
+ return TRUE;
+}
+
+bool SettingsDlg::TransferDataFromWindow()
+{
+ ExchangeFields( FALSE );
+
+ return TRUE;
+}
+
+#include "controlbar.h"
+#include "rowlayoutpl.h"
+#include "antiflickpl.h"
+#include "bardragpl.h"
+#include "cbcustom.h"
+
+#include "gcupdatesmgr.h"
+#include "hintanimpl.h"
+
+void SettingsDlg::ReadLayoutSettings( wxFrameLayout& fl )
+{
+ cbDockPane& pane = *fl.GetPane( wxTOP );
+ cbCommonPaneProperties& props = pane.mProps;
+
+ mRealTimeUpdatesOn = props.mRealTimeUpdatesOn;
+ mOutOfPaneDragOn = props.mOutOfPaneDragOn;
+ mExactDockingPredictionOn = props.mExactDockPredictionOn;
+ mNonDestructFrictionOn = props.mNonDestructFirctionOn;
+ m3DShadesOn = props.mShow3DPaneBorderOn;
+
+ mHintRectAnimationOn = fl.FindPlugin( CLASSINFO( cbHintAnimationPlugin ) ) != NULL;
+ mAntiflickerPluginOn = fl.FindPlugin( CLASSINFO( cbAntiflickerPlugin ) ) != NULL;
+ mCustomizationPluginOn = fl.FindPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) ) != NULL;
+ mGCUpdatesMgrOn = fl.GetUpdatesManager().GetClassInfo()
+ == CLASSINFO( cbGCUpdatesMgr );
+
+ mSashWidth = props.mResizeHandleSize;
+
+ mTopMargin = pane.mTopMargin;
+ mBottomMargin = pane.mBottomMargin;
+ mLeftMargin = pane.mLeftMargin;
+ mRightMargin = pane.mRightMargin;
+
+ mDarkCol = fl.mDarkPen.GetColour();
+ mLightCol = fl.mLightPen.GetColour();
+ mGrayCol = fl.mGrayPen.GetColour();
+ mBorderCol = fl.mBorderPen.GetColour();
+}
+
+void SettingsDlg::ApplyLayoutSettings( wxFrameLayout& fl )
+{
+ cbCommonPaneProperties props;
+
+ props.mRealTimeUpdatesOn = mRealTimeUpdatesOn;
+ props.mOutOfPaneDragOn = mOutOfPaneDragOn;
+ props.mExactDockPredictionOn = mExactDockingPredictionOn;
+ props.mNonDestructFirctionOn = mNonDestructFrictionOn;
+ props.mShow3DPaneBorderOn = m3DShadesOn;
+
+ props.mResizeHandleSize = mSashWidth;
+
+ fl.SetPaneProperties( props, wxALL_PANES );
+
+ if ( mHintRectAnimationOn ) fl.AddPlugin ( CLASSINFO( cbHintAnimationPlugin ) );
+ else fl.RemovePlugin( CLASSINFO( cbHintAnimationPlugin ) );
+
+ if ( mAntiflickerPluginOn ) fl.AddPlugin ( CLASSINFO( cbAntiflickerPlugin ) );
+ else fl.RemovePlugin( CLASSINFO( cbAntiflickerPlugin ) );
+
+ if ( mCustomizationPluginOn ) fl.AddPlugin ( CLASSINFO( cbSimpleCustomizationPlugin ) );
+ else fl.RemovePlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
+
+ // FOR NOW:: unfortunatelly, currently pane marin-information is currently
+ // placed into cbDockPane, instead of cbCommonPaneProperties
+
+ fl.SetMargins( mTopMargin, mBottomMargin,
+ mLeftMargin, mRightMargin, wxALL_PANES );
+
+ fl.mDarkPen.SetColour( mDarkCol );
+ fl.mLightPen.SetColour( mLightCol );
+ fl.mGrayPen.SetColour( mGrayCol );
+ fl.mBorderPen.SetColour( mBorderCol );
+
+ fl.RecalcLayout( TRUE );
+
+ // NOTE:: currently it's bit tricky changing updates-manager
+ // in future, updates-manager will become a normal plugin
+ // and more convenient methods (Add/FindPlugin) will be used
+
+ if ( mGCUpdatesMgrOn &&
+ fl.GetUpdatesManager().GetClassInfo() != CLASSINFO( cbGCUpdatesMgr )
+ )
+
+ fl.SetUpdatesManager( new cbGCUpdatesMgr( &fl ) );
+ else
+ if ( !mGCUpdatesMgrOn &&
+ fl.GetUpdatesManager().GetClassInfo() == CLASSINFO( cbGCUpdatesMgr )
+ )
+
+ fl.SetUpdatesManager( new cbSimpleUpdatesMgr( &fl ) );
+}
--- /dev/null
+#ifndef __SETTINGSDLG_G__
+#define __SETTINGSDLG_G__
+
+#include "wx/dialog.h"
+
+class wxFrameLayout;
+
+class SettingsDlg : public wxDialog
+{
+protected:
+
+ // "nice thing" about wxWindows:
+
+ wxCheckBox* mpRTU_Check;
+ wxCheckBox* mpOPD_Check;
+ wxCheckBox* mpEDP_Check;
+ wxCheckBox* mpNDF_Check;
+ wxCheckBox* mpSPB_Check;
+
+ wxCheckBox* mpHAP_Check;
+ wxCheckBox* mpGCU_Check;
+ wxCheckBox* mpAFP_Check;
+ wxCheckBox* mpCSP_Check;
+
+ wxTextCtrl* mpRWInput;
+ wxStaticText* mpRWLabel;
+ wxTextCtrl* mpPTMInput;
+ wxStaticText* mpPTMLabel;
+ wxTextCtrl* mpPBMInput;
+ wxStaticText* mpPBMLabel;
+ wxTextCtrl* mpPLMInput;
+ wxStaticText* mpPLMLabel;
+ wxTextCtrl* mpPRMInput;
+ wxStaticText* mpPRMLabel;
+
+ wxTextCtrl* mpDCInput;
+ wxStaticText* mpDCLabel;
+ wxTextCtrl* mpLCInput;
+ wxStaticText* mpLCLabel;
+ wxTextCtrl* mpGCInput;
+ wxStaticText* mpGCLabel;
+ wxTextCtrl* mpBCInput;
+ wxStaticText* mpBCLabel;
+
+ // fields/properties
+
+ bool mRealTimeUpdatesOn;
+ bool mOutOfPaneDragOn;
+ bool mExactDockingPredictionOn;
+ bool mNonDestructFrictionOn;
+ bool m3DShadesOn;
+ bool mHintRectAnimationOn;
+ bool mGCUpdatesMgrOn;
+ bool mAntiflickerPluginOn;
+ bool mCustomizationPluginOn;
+
+ int mSashWidth;
+ int mTopMargin;
+ int mBottomMargin;
+ int mLeftMargin;
+ int mRightMargin;
+
+ wxColour mDarkCol;
+ wxColour mLightCol;
+ wxColour mGrayCol;
+ wxColour mBorderCol;
+
+protected:
+
+ bool mToDlg;
+
+ // helpers
+
+ void ExchgCheck( wxCheckBox* pChk, bool& value );
+ void ExchgIntField( wxTextCtrl* pFld, int& value );
+ void ExchgColourField( wxTextCtrl* pFld, wxColour& value );
+
+ virtual bool TransferDataToWindow();
+ virtual bool TransferDataFromWindow();
+
+public:
+
+ SettingsDlg( wxWindow* pParent );
+
+ void ReadLayoutSettings( wxFrameLayout& fl );
+ void ApplyLayoutSettings( wxFrameLayout& fl );
+
+ void ExchangeFields( bool toDialog );
+
+ void OnApply( wxCommandEvent& event );
+ void OnNotes( wxCommandEvent& event );
+
+ void OnHintAnimCheck( wxCommandEvent& event );
+ void OnRTUpdatesCheck( wxCommandEvent& event );
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: No names yet.
+// Purpose: Contrib. demo
+// Author: Aleksandras Gluchovas
+// Modified by:
+// Created: 23/11/98
+// RCS-ID: $Id$
+// Copyright: 1998 (c) Aleksandras Gluchovas
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "wxinifo.cpp"
+#pragma interface "wxinifo.cpp"
+#endif
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include "wx/hash.h"
+#include "wxinfo.h"
+
+inline static void expand_item( wxTreeCtrl* pTree, wxTreeItemId& itemId )
+{
+ pTree->Expand( itemId );
+}
+
+void wxCreateClassInfoTree( wxTreeCtrl* pTree,
+ wxTreeItemId parentBranchId,
+ long classImageNo
+ )
+{
+ expand_item( pTree, parentBranchId );
+
+ wxHashTable hash;
+
+ wxList lst;
+
+ // collect all classes into list
+
+ {
+ wxClassInfo* pCur = wxClassInfo::GetFirst();
+
+ wxClassInfo::InitializeClasses();
+
+ while( pCur )
+ {
+ lst.Append( (wxObject*)pCur );
+
+ pCur = pCur->GetNext();
+ }
+ }
+
+ wxClassInfo::InitializeClasses();
+
+ // reflect class-hierarchy into the tree nodes
+
+ int nHanged;
+
+ do
+ {
+ nHanged = 0;
+
+ wxNode* pCur = lst.First();
+
+ // repeat passes through class list, untill all of
+ // the class items are "hanged" onto their parent-items in the tree
+
+ while( pCur )
+ {
+ wxClassInfo& info = *((wxClassInfo*)pCur->Data());
+
+ if ( info.GetBaseClass1() == NULL )
+ {
+ // parentless classes are put into the root branch
+
+ wxTreeItemId* pId = new wxTreeItemId();
+ *pId = pTree->AppendItem( parentBranchId, info.GetClassName(), classImageNo );
+
+ expand_item( pTree, *pId );
+
+ // "remember" it
+ hash.Put( long(&info), (wxObject*)pId );
+
+ // class is "hanged", remove it from the list
+ wxNode* pTmp = pCur;
+
+ pCur = pCur->Next();
+
+ delete pTmp;
+
+ ++nHanged;
+ }
+ else
+ {
+ wxTreeItemId* pParentId = (wxTreeItemId*)hash.Get( (long)info.GetBaseClass1() );
+
+ if ( pParentId != NULL )
+ {
+ wxTreeItemId* pId = new wxTreeItemId();
+
+ *pId = pTree->AppendItem( *pParentId, info.GetClassName(), classImageNo );
+
+ expand_item( pTree, *pId );
+
+ hash.Put( long(&info), (wxObject*)pId );
+
+ wxNode* pTmp = pCur;
+
+ pCur = pCur->Next();
+
+ // class is "hanged", remove it from the list
+ delete pTmp;
+
+ ++nHanged;
+ }
+ else
+ {
+ // otherwise there's a parent, but it's not in the tree yet...
+ // hope to "hang" it in the subsequent passes
+
+ pCur = pCur->Next();
+ }
+ }
+ }
+
+ } while( nHanged != 0 );
+}
+
+void wxCreateSerializerInfoTree( wxTreeCtrl* pTree,
+ wxTreeItemId parentBranchId,
+ long classImageNo
+ )
+{
+ expand_item( pTree, parentBranchId );
+
+ wxSerializerInfo::InitializeSerializers();
+
+ // FOR NOW:: no hierarchy - one branch
+
+ wxSerializerInfo* pCur = wxSerializerInfo::first;
+
+ while( pCur )
+ {
+ wxString fullName = pCur->className + wxString( "Serializer" );
+
+ pTree->AppendItem( parentBranchId, fullName, classImageNo );
+
+ pCur = pCur->next;
+ }
+}
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: No names yet.
+// Purpose: Contrib. demo
+// Author: Aleksandras Gluchovas
+// Modified by:
+// Created: 23/11/98
+// RCS-ID: $Id$
+// Copyright: 1998 (c) Aleksandras Gluchovas
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __WXINFO_G__
+#define __WXINFO_G__
+
+#include "wx/object.h"
+#include "wx/treectrl.h"
+
+#include "objstore.h"
+
+/*
+ * creates tree with hierarchically cauptured
+ * information about wxWindows dynamic classes (at "current run-time")
+ */
+
+void wxCreateClassInfoTree( wxTreeCtrl* pTree,
+ wxTreeItemId parentBranchId,
+ long classImageNo = -1
+ );
+
+/*
+ * creates tree with information about
+ * serializer-classes (at current run-time)
+ * NOTE:: "objstore.cpp" should be compiled in
+ */
+
+void wxCreateSerializerInfoTree( wxTreeCtrl* pTree, // existing tree control
+ wxTreeItemId parentBranchId,
+ long classImageNo = -1 // (-1) - text only
+ );
+
+#endif
newbmpbtn.cpp \
objstore.cpp \
panedrawpl.cpp \
-pf_sample.cpp \
rowdragpl.cpp \
rowlayoutpl.cpp \
-settingsdlg.cpp \
toolwnd.cpp \
-updatesmgr.cpp \
-wxinfo.cpp
+updatesmgr.cpp
#define library objects
LIB_OBJ= \
include ../../../../template.mak
install::
- @echo "Installing library files and headers for libwx_gl_gtk.."
+ @echo "Installing library files and headers for libwx_fl_gtk.."
@echo " Creating directory.."
@$(WXBASEDIR)/mkinstalldirs /usr/local/include/wx_fl
@echo " Copying headers from framelayout/src"
static void gray_out_pixmap( int* src, int* dest, int width, int height )
{
// assuming the pixels along the edges are of the background color
- int bgCol = GET_ELEM(src,0,0);
int x = 0;
int y = 1;
{
int cur = GET_ELEM(src,x,y);
- int r = GET_RED(cur);
- int g = GET_GREEN(cur);
- int b = GET_BLUE(cur);
if ( IS_IN_ARRAY(x-1,y-1) )
{
wxColour col;
dc.GetPixel( x,y, &col );
- int r = col.Red(),
- g = col.Green(),
- b = col.Blue();
-
- int o = MAKE_INT_COLOR( r,g,b );
GET_ELEM(src,x,y) = MAKE_INT_COLOR( col.Red(), col.Green(), col.Blue() );
}
int marginY,
int textToLabelGap,
bool isSticky)
- : mpDepressedImg( NULL ),
- mpPressedImg ( NULL ),
- mpDisabledImg ( NULL ),
- mpFocusedImg ( NULL ),
-
+ : mTextToLabelGap ( textToLabelGap ),
mMarginX( marginX ),
mMarginY( marginY ),
mTextAlignment( alignText ),
+ mIsSticky( isSticky ),
mIsFlat( isFlat ),
+ mLabelText( labelText ),
+ mImageFileType( -1 ),
+ mDepressedBmp( labelBitmap ),
+
+ mpDepressedImg( NULL ),
+ mpPressedImg ( NULL ),
+ mpDisabledImg ( NULL ),
+ mpFocusedImg ( NULL ),
+
- mIsPressed ( FALSE ),
mDragStarted ( FALSE ),
+ mIsPressed ( FALSE ),
+ mIsInFocus( FALSE ),
mPrevPressedState( FALSE ),
- mTextToLabelGap ( textToLabelGap ),
+ mPrevInFocusState( FALSE ),
+ mHasFocusedBmp( FALSE ),
+ mFiredEventType( firedEventType ),
mBlackPen( wxColour( 0, 0, 0), 1, wxSOLID ),
mDarkPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID ),
mGrayPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ),
mLightPen( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHIGHLIGHT), 1, wxSOLID ),
- mFiredEventType( firedEventType ),
- mIsSticky( isSticky ),
mIsCreated( FALSE ),
- mSizeIsSet( FALSE ),
+ mSizeIsSet( FALSE )
- mHasFocusedBmp( FALSE ),
- mIsInFocus( FALSE ),
-
- mDepressedBmp( labelBitmap ),
- mLabelText( labelText ),
- mImageFileType( -1 )
{
}
int textToLabelGap,
bool isSticky)
- : mpDepressedImg( NULL ),
- mpPressedImg ( NULL ),
- mpDisabledImg ( NULL ),
- mpFocusedImg ( NULL ),
-
+ : mTextToLabelGap ( 2 ),
mMarginX( 2 ),
mMarginY( 2 ),
mTextAlignment( alignText ),
+ mIsSticky( FALSE ),
mIsFlat( isFlat ),
+ mLabelText( labelText ),
+ mImageFileName( bitmapFileName ),
+ mImageFileType( bitmapFileType ),
+
+ mpDepressedImg( NULL ),
+ mpPressedImg ( NULL ),
+ mpDisabledImg ( NULL ),
+ mpFocusedImg ( NULL ),
- mIsPressed ( FALSE ),
mDragStarted ( FALSE ),
+ mIsPressed ( FALSE ),
+ mIsInFocus ( FALSE ),
mPrevPressedState( FALSE ),
- mTextToLabelGap ( 2 ),
+ mPrevInFocusState( FALSE ),
+ mHasFocusedBmp( FALSE ),
+ mFiredEventType( wxEVT_COMMAND_MENU_SELECTED ),
mBlackPen( wxColour( 0, 0, 0), 1, wxSOLID ),
mDarkPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID ),
mGrayPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ),
mLightPen( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHIGHLIGHT), 1, wxSOLID ),
- mFiredEventType( wxEVT_COMMAND_MENU_SELECTED ),
- mIsSticky( FALSE ),
mIsCreated( FALSE ),
- mSizeIsSet( FALSE ),
-
- mHasFocusedBmp( FALSE ),
- mIsInFocus( FALSE ),
+ mSizeIsSet( FALSE )
- mLabelText( labelText ),
- mImageFileName( bitmapFileName ),
- mImageFileType( bitmapFileType )
{
- //mDepressedBmp.LoadFile( bitmapFileName, bitmapFileType );
}
wxNewBitmapButton::~wxNewBitmapButton(void)
return mpDisabledImg;
}
+static const unsigned char _gDisableImage[] = { 0x55,0xAA,0x55,0xAA,
+ 0x55,0xAA,0x55,0xAA,
+ 0x55,0xAA,0x55,0xAA,
+ 0x55,0xAA,0x55,0xAA
+ };
void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
bool isEnabled, bool isPressed )
{
if ( hasImage )
{
+
destDc.Blit( imgPos.x, imgPos.y,
- srcBmp->GetWidth()+1,
- srcBmp->GetHeight()+1,
- &srcDc, 0,0, wxCOPY,TRUE );
+ srcBmp->GetWidth()+1,
+ srcBmp->GetHeight()+1,
+ &srcDc, 0,0, wxCOPY,TRUE );
}
if ( hasText )
destDc.SetFont( wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT) );
- // Should be wxSYS_COLOUR_BTNTEXT, but gtk gives white?
- destDc.SetTextForeground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNTEXT) );
+ if( isEnabled ){
+ destDc.SetTextForeground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNTEXT) );
+ }else{
+ destDc.SetTextForeground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW) );
+ }
destDc.SetTextBackground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE) );
destDc.DrawText( mLabelText, txtPos.x, txtPos.y );
}
- if ( !isEnabled )
+
+ destDc.SetBrush( grayBrush );
+ destDc.SetPen( nullPen );
+
+ destDc.DrawRectangle( 0,0, destDim.x+1, destDim.y+1 );
+
+ if ( isPressed )
+ {
+ ++imgPos.x; ++imgPos.y;
+ ++txtPos.x; ++txtPos.y;
+ }
+
+ if ( hasImage )
+ {
+
+ destDc.Blit( imgPos.x, imgPos.y,
+ srcBmp->GetWidth()+1,
+ srcBmp->GetHeight()+1,
+ &srcDc, 0,0, wxCOPY,TRUE );
+ }
+
+ if ( hasText )
+ {
+ wxWindow* pTopWnd = this;
+
+ do
+ {
+ wxWindow* pParent = pTopWnd->GetParent();
+
+ if ( pParent == 0 ) break;
+
+ pTopWnd = pParent;
+ } while(1);
+
+ destDc.SetFont( wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT) );
+
+ if( isEnabled ){
+ destDc.SetTextForeground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNTEXT) );
+ }else{
+ destDc.SetTextForeground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW) );
+ }
+ destDc.SetTextBackground( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE) );
+
+ destDc.DrawText( mLabelText, txtPos.x, txtPos.y );
+ }
+
+ if ( !isEnabled ){
+#ifdef __WXMSW // This is currently MSW specific
greay_out_image_on_dc( destDc, destDim.x, destDim.y );
-
+#else
+ wxBrush checkerBrush( wxBitmap( (const char*)_gDisableImage,8,8) );
+ checkerBrush.SetColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ) );
+ destDc.SetBrush( checkerBrush );
+ destDc.DrawRectangle( imgPos.x, imgPos.y, srcBmp->GetWidth()+1, srcBmp->GetHeight()+1);
+#endif
+ }
// adjust button size to fit the new dimensions of the label
if ( !mSizeIsSet && 0 )
{
);
}
}
+void wxNewBitmapButton::RenderAllLabelImages()
+{
+ if( !mIsCreated ) return;
+ RenderLabelImage( mpDisabledImg, &mDepressedBmp, FALSE );
+ RenderLabelImage( mpPressedImg, &mDepressedBmp, TRUE, TRUE );
+ RenderLabelImage( mpDepressedImg, &mDepressedBmp, TRUE, FALSE );
+ if ( mHasFocusedBmp ){
+ RenderLabelImage( mpFocusedImg, &mFocusedBmp, TRUE, FALSE );
+ }
+}
+
void wxNewBitmapButton::RenderLabelImages()
{
mLabelText = labelText;
mDepressedBmp = labelBitmap;
- RenderLabelImages();
+ //RenderLabelImages();
+ RenderAllLabelImages();
}
void wxNewBitmapButton::SetAlignments( int alignText,
mTextAlignment = alignText;
mTextToLabelGap = textToLabelGap;
- RenderLabelImages();
+ //RenderLabelImages();
+ RenderAllLabelImages();
}
// event handlers
void wxNewBitmapButton::OnMouseMove( wxMouseEvent& event )
{
+ mPrevPressedState=mIsPressed;
+ mPrevInFocusState=mIsInFocus;
if ( !mIsInFocus && IsInWindow( event.m_x, event.m_y ) )
{
if ( !mDragStarted )
mIsPressed = TRUE;
else
mIsPressed = FALSE;
-
- if ( mIsPressed != mPrevPressedState )
-
- Refresh();
-
- mPrevPressedState = mIsPressed;
}
- // FOR NOW::
- Refresh();
+ if((mIsPressed != mPrevPressedState)||(mIsInFocus!=mPrevInFocusState)){
+ Refresh();
+ }
}
void wxNewBitmapButton::OnSize( wxSizeEvent& event )
void wxNewBitmapButton::Reshape( )
{
+
bool wasCreated = mIsCreated;
mIsCreated = TRUE;
//wxMessageBox("Image Loaded!!!");
}
- RenderLabelImages();
+ //RenderLabelImages();
+ RenderAllLabelImages();
wxBitmap* pCurImg = GetStateLabel();
wxSizeEvent evt;
OnSize( evt ); // fake it up!
- RenderLabelImages();
+ //RenderLabelImages();
pCurBmp = GetStateLabel();
}
wxPaintDC dc(this);
// first, make sure images for current state are prepared
- RenderLabelImages();
+ //RenderLabelImages();
DrawLabel( dc );
int mMarginY;
int mTextAlignment;
bool mIsSticky;
+ bool mIsFlat;
wxString mLabelText;
wxString mImageFileName;
int mImageFileType;
- bool mIsFlat;
wxBitmap mDepressedBmp; // source image for rendering
// labels for particular state
bool mIsPressed;
bool mIsInFocus;
bool mPrevPressedState;
+ bool mPrevInFocusState;
bool mHasFocusedBmp;
bool isPressed = FALSE);
virtual void RenderLabelImages();
+ virtual void RenderAllLabelImages();
// event handlers
void OnLButtonDown( wxMouseEvent& event );
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: settingsdlg.cpp
-// Purpose: Settings dialog for Frame Layout
-// Author: Aleksandras Gluchovas
-// Modified by:
-// Created: 05/11/98
-// RCS-ID: $Id$
-// Copyright: (c) Aleksandras Gluchovas
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "settingsdlg.cpp"
-#pragma interface "settingsdlg.cpp"
-#endif
-
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include <stdlib.h>
-#include "settingsdlg.h"
-
-/***** Implementation for class SettingsDlg *****/
-
-#define ID_NOTES ( wxEVT_FIRST + 1000 )
-#define ID_HINTANIM_CHECK ( ID_NOTES + 1 )
-#define ID_RTUPDATES_CHECK ( ID_NOTES + 2 )
-
-BEGIN_EVENT_TABLE( SettingsDlg, wxDialog )
-
- EVT_BUTTON( wxID_APPLY, SettingsDlg::OnApply )
- EVT_BUTTON( ID_NOTES, SettingsDlg::OnNotes )
-
- EVT_CHECKBOX( ID_HINTANIM_CHECK, SettingsDlg::OnHintAnimCheck )
- EVT_CHECKBOX( ID_RTUPDATES_CHECK, SettingsDlg::OnRTUpdatesCheck )
-
-END_EVENT_TABLE()
-
-SettingsDlg::SettingsDlg( wxWindow* pParent )
-
- : wxDialog( pParent, -1, "Active Layout Settings...",
- wxDefaultPosition,
- wxSize( 325,585),
- wxDIALOG_MODAL | wxCAPTION )
-{
- int curY = 10;
- int lMargin = 50;
- int lBoxMargin = lMargin - 20;
- int checkHeight = 20;
- int labelHeight = 20;
- int boxWidth = 260;
- int interBoxGap = 10;
- int lastItemGap = 10;
-
- int topY = curY;
-
- curY += labelHeight;
-
- mpRTU_Check = new wxCheckBox( this, ID_RTUPDATES_CHECK,
- "&Real-time updates",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpOPD_Check = new wxCheckBox( this, -1, "&Out of Pane drag",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpEDP_Check = new wxCheckBox( this, -1, "&Exact docking prediction",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpNDF_Check = new wxCheckBox( this, -1, "Non-destructive bar &friction",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpSPB_Check = new wxCheckBox( this, -1, "&Shaded pane borders",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight + lastItemGap;
-
- wxStaticBox* pDNDBox = new wxStaticBox( this, -1, "Drag && Drop settings",
- wxPoint( lBoxMargin, topY ),
- wxSize( boxWidth, curY - topY ) );
-
- curY += interBoxGap;
-
- ////////////////////////////////////////////////////////////////////
-
- topY = curY;
-
- curY += labelHeight;
-
- mpHAP_Check = new wxCheckBox( this, ID_HINTANIM_CHECK,
- "&Hint-Rect animation plugin",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpGCU_Check = new wxCheckBox( this, -1, "\"Garbage collecting\" &Updates-Mgr.",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpAFP_Check = new wxCheckBox( this, -1, "&Antiflicker plugin",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight;
-
- mpCSP_Check = new wxCheckBox( this, -1, "C&ustomization plugin",
- wxPoint( lMargin, curY ) );
-
- curY += checkHeight + lastItemGap;
-
- wxStaticBox* pPBox = new wxStaticBox( this, -1, "Plugins",
- wxPoint( lBoxMargin, topY ),
- wxSize( boxWidth, curY - topY ) );
-
- curY += interBoxGap;
-
- ////////////////////////////////////////////////////////////////////
-
- wxSize fieldSz( 30,20 );
- int fieldHeight = 20;
- int fieldCapMargin = lMargin + fieldSz.x + 5;
- int fieldCapOfs = 4;
-
- topY = curY;
-
- curY += labelHeight;
-
- mpRWInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpRWLabel = new wxStaticText ( this, -1, "Resizing sash width(height)",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
-
- curY += fieldHeight;
-
- mpPTMInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpPTMLabel = new wxStaticText( this, -1, "Pene's top margin",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
-
- curY += fieldHeight;
-
-
- mpPBMInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpPBMLabel = new wxStaticText( this, -1, "Pene's bottom margin",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
-
- curY += fieldHeight;
-
-
- mpPLMInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpPLMLabel = new wxStaticText( this, -1, "Pane's left margin",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
-
- curY += fieldHeight;
-
-
- mpPRMInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpPRMLabel = new wxStaticText( this, -1, "Pane's right margin",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
- curY += fieldHeight + lastItemGap;
-
- wxStaticBox* pCPPBox = new wxStaticBox( this, -1, "Common Pane properties",
- wxPoint( lBoxMargin, topY ),
- wxSize( boxWidth, curY - topY ) );
-
- curY += interBoxGap;
-
- ////////////////////////////////////////////////////////////////////
-
- topY = curY;
-
- curY += labelHeight;
-
- fieldSz.x = 65;
- fieldCapMargin = lMargin + fieldSz.x + 10;
-
- mpDCInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpDCLabel = new wxStaticText ( this, -1, "Dark Color (hex-RGB)",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
- curY += fieldHeight;
-
- mpLCInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpLCLabel = new wxStaticText ( this, -1, "Light Color (hex-RGB)",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
- curY += fieldHeight;
-
- mpGCInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpGCLabel = new wxStaticText ( this, -1, "Gray Color (hex-RGB)",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
- curY += fieldHeight;
-
- mpBCInput = new wxTextCtrl ( this, -1, "",
- wxPoint( lMargin, curY ),
- fieldSz );
-
- mpBCLabel = new wxStaticText ( this, -1, "Pane border Color (hex-RGB)",
- wxPoint( fieldCapMargin, curY + fieldCapOfs ) );
-
- curY += fieldHeight + lastItemGap;
-
- wxStaticBox* pCSPBox = new wxStaticBox( this, -1, "Coluor sheme properties",
- wxPoint( lBoxMargin, topY ),
- wxSize( boxWidth, curY - topY ) );
-
- curY += interBoxGap; /*button ofs*/;
-
- ////////////////////////////////////////////////////////////////////////////////
-
- int lBtnMargin = 35;
- int btnGap = 20;
- int btnHeight = 22;
- int btnWidth = 70;
-
- wxButton* mpApplyBtn = new wxButton( this, wxID_APPLY, "A&pply",
- wxPoint( lBtnMargin, curY ),
- wxSize( btnWidth, btnHeight ) );
-
- wxButton* mpCancelBtn = new wxButton( this, wxID_CANCEL, "&Cancel",
- wxPoint( lBtnMargin + btnWidth + btnGap, curY ),
- wxSize( btnWidth, btnHeight ) );
-
- wxButton* mpNotesBtn = new wxButton( this, ID_NOTES, "&Notes...",
- wxPoint( lBtnMargin + 2*btnWidth + 2*btnGap, curY ),
- wxSize( btnWidth, btnHeight ) );
-
- mpApplyBtn->SetDefault();
- mpApplyBtn->SetFocus();
-
- Center( wxBOTH );
-}
-
-void SettingsDlg::ExchangeFields( bool toDialog )
-{
- mToDlg = toDialog;
-
- ExchgCheck( mpRTU_Check, mRealTimeUpdatesOn );
- ExchgCheck( mpOPD_Check, mOutOfPaneDragOn );
- ExchgCheck( mpEDP_Check, mExactDockingPredictionOn );
- ExchgCheck( mpNDF_Check, mNonDestructFrictionOn );
- ExchgCheck( mpSPB_Check, m3DShadesOn );
-
- ExchgCheck( mpHAP_Check, mHintRectAnimationOn );
- ExchgCheck( mpGCU_Check, mGCUpdatesMgrOn );
- ExchgCheck( mpAFP_Check, mAntiflickerPluginOn );
- ExchgCheck( mpCSP_Check, mCustomizationPluginOn );
-
- ExchgIntField( mpRWInput, mSashWidth );
- ExchgIntField( mpPTMInput, mTopMargin );
- ExchgIntField( mpPBMInput, mBottomMargin );
- ExchgIntField( mpPLMInput, mLeftMargin );
- ExchgIntField( mpPRMInput, mRightMargin );
-
- ExchgColourField( mpDCInput, mDarkCol );
- ExchgColourField( mpLCInput, mLightCol );
- ExchgColourField( mpGCInput, mGrayCol );
- ExchgColourField( mpBCInput, mBorderCol );
-}
-
-void SettingsDlg::OnApply( wxCommandEvent& event )
-{
- ExchangeFields( FALSE );
- EndModal( wxID_APPLY );
-}
-
-void SettingsDlg::OnNotes( wxCommandEvent& event )
-{
- wxMessageBox("Notes go here...(TBD)");
-}
-
-void SettingsDlg::OnRTUpdatesCheck( wxCommandEvent& event )
-{
- if ( mpRTU_Check->GetValue() == TRUE )
- {
- // user probably wants to see how the real-time drag & drop
- // works -- so we "let 'im know" that animation is N/A when
- // real-time option is on
-
- mpHAP_Check->SetValue(FALSE);
- mpHAP_Check->Refresh();
- }
-}
-
-void SettingsDlg::OnHintAnimCheck( wxCommandEvent& event )
-{
- if ( mpHAP_Check->GetValue() == TRUE )
- {
- // user probably wants to see some animation effects,
- // but he/she forgot to turn off "real-time updates"
- // setting -- so we do it for you :-)
-
- mpRTU_Check->SetValue(FALSE);
- mpRTU_Check->Refresh();
- }
-}
-
-void SettingsDlg::ExchgCheck( wxCheckBox* pChk, bool& value )
-{
- if ( mToDlg ) pChk->SetValue( value );
-
- else value = pChk->GetValue();
-}
-
-void SettingsDlg::ExchgIntField( wxTextCtrl* pFld, int& value )
-{
- if ( mToDlg )
- {
- char buf[32];
-
- sprintf( buf, "%d", value );
- pFld->SetValue( buf );
- }
- else
- {
- wxString txt = pFld->GetLineText( 0 );
- value = atoi( txt );
- }
-}
-
-void SettingsDlg::ExchgColourField( wxTextCtrl* pFld, wxColour& value )
-{
- int rgbVal;
-
- if ( mToDlg )
- {
- rgbVal = ( value.Red() & 0x0000FF ) |
- ( (value.Green() << 8 ) & 0x00FF00 ) |
- ( (value.Blue() << 16 ) & 0xFF0000 );
-
- char buf[32];
-
- sprintf( buf, "0x%06X", rgbVal );
-
- pFld->SetValue( buf );
- }
- else
- {
- wxString txt = pFld->GetLineText( 0 );
-
- sscanf( txt, "0x%06X", &rgbVal );
-
- value.Set( rgbVal & 0xFF,
- ( rgbVal >> 8 ) & 0xFF,
- ( rgbVal >> 16 ) & 0xFF );
- }
-}
-
-bool SettingsDlg::TransferDataToWindow()
-{
- ExchangeFields( TRUE );
-
- return TRUE;
-}
-
-bool SettingsDlg::TransferDataFromWindow()
-{
- ExchangeFields( FALSE );
-
- return TRUE;
-}
-
-#include "controlbar.h"
-#include "rowlayoutpl.h"
-#include "antiflickpl.h"
-#include "bardragpl.h"
-#include "cbcustom.h"
-
-#include "gcupdatesmgr.h"
-#include "hintanimpl.h"
-
-void SettingsDlg::ReadLayoutSettings( wxFrameLayout& fl )
-{
- cbDockPane& pane = *fl.GetPane( wxTOP );
- cbCommonPaneProperties& props = pane.mProps;
-
- mRealTimeUpdatesOn = props.mRealTimeUpdatesOn;
- mOutOfPaneDragOn = props.mOutOfPaneDragOn;
- mExactDockingPredictionOn = props.mExactDockPredictionOn;
- mNonDestructFrictionOn = props.mNonDestructFirctionOn;
- m3DShadesOn = props.mShow3DPaneBorderOn;
-
- mHintRectAnimationOn = fl.FindPlugin( CLASSINFO( cbHintAnimationPlugin ) ) != NULL;
- mAntiflickerPluginOn = fl.FindPlugin( CLASSINFO( cbAntiflickerPlugin ) ) != NULL;
- mCustomizationPluginOn = fl.FindPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) ) != NULL;
- mGCUpdatesMgrOn = fl.GetUpdatesManager().GetClassInfo()
- == CLASSINFO( cbGCUpdatesMgr );
-
- mSashWidth = props.mResizeHandleSize;
-
- mTopMargin = pane.mTopMargin;
- mBottomMargin = pane.mBottomMargin;
- mLeftMargin = pane.mLeftMargin;
- mRightMargin = pane.mRightMargin;
-
- mDarkCol = fl.mDarkPen.GetColour();
- mLightCol = fl.mLightPen.GetColour();
- mGrayCol = fl.mGrayPen.GetColour();
- mBorderCol = fl.mBorderPen.GetColour();
-}
-
-void SettingsDlg::ApplyLayoutSettings( wxFrameLayout& fl )
-{
- cbCommonPaneProperties props;
-
- props.mRealTimeUpdatesOn = mRealTimeUpdatesOn;
- props.mOutOfPaneDragOn = mOutOfPaneDragOn;
- props.mExactDockPredictionOn = mExactDockingPredictionOn;
- props.mNonDestructFirctionOn = mNonDestructFrictionOn;
- props.mShow3DPaneBorderOn = m3DShadesOn;
-
- props.mResizeHandleSize = mSashWidth;
-
- fl.SetPaneProperties( props, wxALL_PANES );
-
- if ( mHintRectAnimationOn ) fl.AddPlugin ( CLASSINFO( cbHintAnimationPlugin ) );
- else fl.RemovePlugin( CLASSINFO( cbHintAnimationPlugin ) );
-
- if ( mAntiflickerPluginOn ) fl.AddPlugin ( CLASSINFO( cbAntiflickerPlugin ) );
- else fl.RemovePlugin( CLASSINFO( cbAntiflickerPlugin ) );
-
- if ( mCustomizationPluginOn ) fl.AddPlugin ( CLASSINFO( cbSimpleCustomizationPlugin ) );
- else fl.RemovePlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
-
- // FOR NOW:: unfortunatelly, currently pane marin-information is currently
- // placed into cbDockPane, instead of cbCommonPaneProperties
-
- fl.SetMargins( mTopMargin, mBottomMargin,
- mLeftMargin, mRightMargin, wxALL_PANES );
-
- fl.mDarkPen.SetColour( mDarkCol );
- fl.mLightPen.SetColour( mLightCol );
- fl.mGrayPen.SetColour( mGrayCol );
- fl.mBorderPen.SetColour( mBorderCol );
-
- fl.RecalcLayout( TRUE );
-
- // NOTE:: currently it's bit tricky changing updates-manager
- // in future, updates-manager will become a normal plugin
- // and more convenient methods (Add/FindPlugin) will be used
-
- if ( mGCUpdatesMgrOn &&
- fl.GetUpdatesManager().GetClassInfo() != CLASSINFO( cbGCUpdatesMgr )
- )
-
- fl.SetUpdatesManager( new cbGCUpdatesMgr( &fl ) );
- else
- if ( !mGCUpdatesMgrOn &&
- fl.GetUpdatesManager().GetClassInfo() == CLASSINFO( cbGCUpdatesMgr )
- )
-
- fl.SetUpdatesManager( new cbSimpleUpdatesMgr( &fl ) );
-}
+++ /dev/null
-#ifndef __SETTINGSDLG_G__
-#define __SETTINGSDLG_G__
-
-#include "wx/dialog.h"
-
-class wxFrameLayout;
-
-class SettingsDlg : public wxDialog
-{
-protected:
-
- // "nice thing" about wxWindows:
-
- wxCheckBox* mpRTU_Check;
- wxCheckBox* mpOPD_Check;
- wxCheckBox* mpEDP_Check;
- wxCheckBox* mpNDF_Check;
- wxCheckBox* mpSPB_Check;
-
- wxCheckBox* mpHAP_Check;
- wxCheckBox* mpGCU_Check;
- wxCheckBox* mpAFP_Check;
- wxCheckBox* mpCSP_Check;
-
- wxTextCtrl* mpRWInput;
- wxStaticText* mpRWLabel;
- wxTextCtrl* mpPTMInput;
- wxStaticText* mpPTMLabel;
- wxTextCtrl* mpPBMInput;
- wxStaticText* mpPBMLabel;
- wxTextCtrl* mpPLMInput;
- wxStaticText* mpPLMLabel;
- wxTextCtrl* mpPRMInput;
- wxStaticText* mpPRMLabel;
-
- wxTextCtrl* mpDCInput;
- wxStaticText* mpDCLabel;
- wxTextCtrl* mpLCInput;
- wxStaticText* mpLCLabel;
- wxTextCtrl* mpGCInput;
- wxStaticText* mpGCLabel;
- wxTextCtrl* mpBCInput;
- wxStaticText* mpBCLabel;
-
- // fields/properties
-
- bool mRealTimeUpdatesOn;
- bool mOutOfPaneDragOn;
- bool mExactDockingPredictionOn;
- bool mNonDestructFrictionOn;
- bool m3DShadesOn;
- bool mHintRectAnimationOn;
- bool mGCUpdatesMgrOn;
- bool mAntiflickerPluginOn;
- bool mCustomizationPluginOn;
-
- int mSashWidth;
- int mTopMargin;
- int mBottomMargin;
- int mLeftMargin;
- int mRightMargin;
-
- wxColour mDarkCol;
- wxColour mLightCol;
- wxColour mGrayCol;
- wxColour mBorderCol;
-
-protected:
-
- bool mToDlg;
-
- // helpers
-
- void ExchgCheck( wxCheckBox* pChk, bool& value );
- void ExchgIntField( wxTextCtrl* pFld, int& value );
- void ExchgColourField( wxTextCtrl* pFld, wxColour& value );
-
- virtual bool TransferDataToWindow();
- virtual bool TransferDataFromWindow();
-
-public:
-
- SettingsDlg( wxWindow* pParent );
-
- void ReadLayoutSettings( wxFrameLayout& fl );
- void ApplyLayoutSettings( wxFrameLayout& fl );
-
- void ExchangeFields( bool toDialog );
-
- void OnApply( wxCommandEvent& event );
- void OnNotes( wxCommandEvent& event );
-
- void OnHintAnimCheck( wxCommandEvent& event );
- void OnRTUpdatesCheck( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-};
-
-#endif
\ No newline at end of file
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: No names yet.
-// Purpose: Contrib. demo
-// Author: Aleksandras Gluchovas
-// Modified by:
-// Created: 23/11/98
-// RCS-ID: $Id$
-// Copyright: 1998 (c) Aleksandras Gluchovas
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "wxinifo.cpp"
-#pragma interface "wxinifo.cpp"
-#endif
-
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include "wx/hash.h"
-#include "wxinfo.h"
-
-inline static void expand_item( wxTreeCtrl* pTree, wxTreeItemId& itemId )
-{
- pTree->Expand( itemId );
-}
-
-void wxCreateClassInfoTree( wxTreeCtrl* pTree,
- wxTreeItemId parentBranchId,
- long classImageNo
- )
-{
- expand_item( pTree, parentBranchId );
-
- wxHashTable hash;
-
- wxList lst;
-
- // collect all classes into list
-
- {
- wxClassInfo* pCur = wxClassInfo::GetFirst();
-
- wxClassInfo::InitializeClasses();
-
- while( pCur )
- {
- lst.Append( (wxObject*)pCur );
-
- pCur = pCur->GetNext();
- }
- }
-
- wxClassInfo::InitializeClasses();
-
- // reflect class-hierarchy into the tree nodes
-
- int nHanged;
-
- do
- {
- nHanged = 0;
-
- wxNode* pCur = lst.First();
-
- // repeat passes through class list, untill all of
- // the class items are "hanged" onto their parent-items in the tree
-
- while( pCur )
- {
- wxClassInfo& info = *((wxClassInfo*)pCur->Data());
-
- if ( info.GetBaseClass1() == NULL )
- {
- // parentless classes are put into the root branch
-
- wxTreeItemId* pId = new wxTreeItemId();
- *pId = pTree->AppendItem( parentBranchId, info.GetClassName(), classImageNo );
-
- expand_item( pTree, *pId );
-
- // "remember" it
- hash.Put( long(&info), (wxObject*)pId );
-
- // class is "hanged", remove it from the list
- wxNode* pTmp = pCur;
-
- pCur = pCur->Next();
-
- delete pTmp;
-
- ++nHanged;
- }
- else
- {
- wxTreeItemId* pParentId = (wxTreeItemId*)hash.Get( (long)info.GetBaseClass1() );
-
- if ( pParentId != NULL )
- {
- wxTreeItemId* pId = new wxTreeItemId();
-
- *pId = pTree->AppendItem( *pParentId, info.GetClassName(), classImageNo );
-
- expand_item( pTree, *pId );
-
- hash.Put( long(&info), (wxObject*)pId );
-
- wxNode* pTmp = pCur;
-
- pCur = pCur->Next();
-
- // class is "hanged", remove it from the list
- delete pTmp;
-
- ++nHanged;
- }
- else
- {
- // otherwise there's a parent, but it's not in the tree yet...
- // hope to "hang" it in the subsequent passes
-
- pCur = pCur->Next();
- }
- }
- }
-
- } while( nHanged != 0 );
-}
-
-void wxCreateSerializerInfoTree( wxTreeCtrl* pTree,
- wxTreeItemId parentBranchId,
- long classImageNo
- )
-{
- expand_item( pTree, parentBranchId );
-
- wxSerializerInfo::InitializeSerializers();
-
- // FOR NOW:: no hierarchy - one branch
-
- wxSerializerInfo* pCur = wxSerializerInfo::first;
-
- while( pCur )
- {
- wxString fullName = pCur->className + wxString( "Serializer" );
-
- pTree->AppendItem( parentBranchId, fullName, classImageNo );
-
- pCur = pCur->next;
- }
-}
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: No names yet.
-// Purpose: Contrib. demo
-// Author: Aleksandras Gluchovas
-// Modified by:
-// Created: 23/11/98
-// RCS-ID: $Id$
-// Copyright: 1998 (c) Aleksandras Gluchovas
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __WXINFO_G__
-#define __WXINFO_G__
-
-#include "wx/object.h"
-#include "wx/treectrl.h"
-
-#include "objstore.h"
-
-/*
- * creates tree with hierarchically cauptured
- * information about wxWindows dynamic classes (at "current run-time")
- */
-
-void wxCreateClassInfoTree( wxTreeCtrl* pTree,
- wxTreeItemId parentBranchId,
- long classImageNo = -1
- );
-
-/*
- * creates tree with information about
- * serializer-classes (at current run-time)
- * NOTE:: "objstore.cpp" should be compiled in
- */
-
-void wxCreateSerializerInfoTree( wxTreeCtrl* pTree, // existing tree control
- wxTreeItemId parentBranchId,
- long classImageNo = -1 // (-1) - text only
- );
-
-#endif