00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef _TOOLBARCUSTDLG_H_
00013 #define _TOOLBARCUSTDLG_H_
00014
00019 #include "wx/htmllbox.h"
00020 #include "toolbarcust.h"
00021
00026
00027 class wxToolCheckListBox;
00029
00034
00035 #define ID_WXTOOLBARCUSTOMISATIONDIALOG 10011
00036 #define ID_TOOLBAR_CUST_TOOLBARS 10012
00037 #define ID_ShowToolBarCtrl 10000
00038 #define ID_ShowLabelsCtrl 10001
00039 #define ID_TOOLBAR_CUST_TOOLS 10013
00040 #define SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
00041 #define SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_TITLE _("Customise Toolbars")
00042 #define SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_IDNAME ID_WXTOOLBARCUSTOMISATIONDIALOG
00043 #define SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_SIZE wxSize(400, 300)
00044 #define SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_POSITION wxDefaultPosition
00046
00047
00051 class wxToolBarCustomisationDialog: public wxDialog
00052 {
00053 DECLARE_DYNAMIC_CLASS( wxToolBarCustomisationDialog )
00054 DECLARE_EVENT_TABLE()
00055
00056 public:
00058 wxToolBarCustomisationDialog( );
00059 wxToolBarCustomisationDialog( wxToolBarCustomisationManager* manager, wxWindow* parent, wxWindowID id = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_IDNAME, const wxString& caption = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_POSITION, const wxSize& size = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_SIZE, long style = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_STYLE );
00060
00062 bool Create( wxToolBarCustomisationManager* manager, wxWindow* parent, wxWindowID id = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_IDNAME, const wxString& caption = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_POSITION, const wxSize& size = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_SIZE, long style = SYMBOL_WXTOOLBARCUSTOMISATIONDIALOG_STYLE );
00063
00065 void Init();
00066
00068 void CreateControls();
00069
00071 void ShowToolbar(const wxString& name);
00072
00074 void OnCheckListBoxToggled(wxCommandEvent& event);
00075
00077 const wxArrayString GetChanged() const { return m_changed; }
00078
00080 const wxArrayString GetVisibilityChanged() const { return m_visibilityChanged; }
00081
00083 const wxArrayString GetToolsChanged() const { return m_toolsChanged; }
00084
00086 bool ToolBarChanged(const wxString& name) const { return m_changed.Index(name) != wxNOT_FOUND; }
00087
00089 bool ToolBarVisibilityChanged(const wxString& name) const { return m_visibilityChanged.Index(name) != wxNOT_FOUND; }
00090
00092 bool ToolBarLabelsChanged(const wxString& name) const { return m_labelsChanged.Index(name) != wxNOT_FOUND; }
00093
00095 bool ToolsChanged(const wxString& name) const { return m_toolsChanged.Index(name) != wxNOT_FOUND; }
00096
00098 void SetShowToolTips(bool show) { m_showToolTips = show; }
00099
00100 const wxString& GetInitialToolBar() const { return m_initialToolBar; }
00101 void SetInitialToolBar(const wxString& name) { m_initialToolBar = name; }
00102
00104
00106 void OnToolbarCustToolbarsSelected( wxCommandEvent& event );
00107
00109 void OnShowToolBarCtrlClick( wxCommandEvent& event );
00110
00112 void OnShowLabelsCtrlClick( wxCommandEvent& event );
00113
00115 void OnShowLabelsCtrlUpdate( wxUpdateUIEvent& event );
00116
00118
00120
00122 wxBitmap GetBitmapResource( const wxString& name );
00123
00125 wxIcon GetIconResource( const wxString& name );
00127
00129 bool ShowToolTips();
00130
00132 wxChoice* m_toolbarsCtrl;
00133 wxCheckBox* m_showToolBarCtrl;
00134 wxCheckBox* m_showLabelsCtrl;
00135 wxToolCheckListBox* m_toolListCtrl;
00137
00138 wxToolBarCustomisationManager* m_manager;
00139 wxArrayString m_changed;
00140 wxArrayString m_visibilityChanged;
00141 wxArrayString m_labelsChanged;
00142 wxArrayString m_toolsChanged;
00143 bool m_showToolTips;
00144 wxString m_initialToolBar;
00145 };
00146
00151 class wxToolCheckListBox: public wxHtmlListBox
00152 {
00153 DECLARE_CLASS(wxToolCheckListBox)
00154 DECLARE_EVENT_TABLE()
00155
00156 public:
00157 wxToolCheckListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
00158 const wxSize& size = wxDefaultSize, long style = 0);
00159 ~wxToolCheckListBox();
00160
00161 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
00162 const wxSize& size = wxDefaultSize, long style = 0);
00163
00165 virtual wxString OnGetItem(size_t n) const;
00166
00168 void SetCustomisation(wxToolBarCustomisationInfo* info) { m_info = info; }
00169 wxToolBarCustomisationInfo* GetCustomisation() const { return m_info; }
00170
00172 void UseCustomisation(wxToolBarCustomisationInfo* info);
00173
00174
00175
00176
00178 void UpdateList();
00179
00181
00182
00183
00185
00186
00188
00189
00191 void OnLeftDown(wxMouseEvent& event);
00192
00193 virtual wxColour GetSelectedTextColour(const wxColour& colFg) const;
00194 virtual wxColour GetSelectedTextBgColour(const wxColour& colBg) const;
00195
00197 void ClearMemoryBitmaps();
00198
00200 void AddMemoryBitmaps();
00201
00202 private:
00203
00204 wxToolBarCustomisationInfo* m_info;
00205
00206 wxArrayString m_memoryBitmaps;
00207 wxSize m_maxBitmapSize;
00208 };
00209
00210 #endif
00211