1 /** \file wxsimagetreeeditordlg.h 2 * 3 * This file is part of wxSmith plugin for Code::Blocks Studio 4 * Copyright (C) 2010 Gary Harris 5 * 6 * wxSmith is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * wxSmith is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with wxSmith. If not, see <http://www.gnu.org/licenses/>. 18 * 19 * This code was taken from the wxSmithImage plug-in, copyright Ron Collins 20 * and released under the GPL. 21 * 22 */ 23 24 #ifndef WXIMAGETREEEDITORDLG_H 25 #define WXIMAGETREEEDITORDLG_H 26 27 //(*Headers(wxTreeDialog) 28 #include <wx/treectrl.h> 29 #include <wx/stattext.h> 30 #include <wx/checkbox.h> 31 #include <wx/statbox.h> 32 #include <wx/panel.h> 33 #include <wx/bmpcbox.h> 34 #include <wx/bmpbuttn.h> 35 #include <wx/imaglist.h> 36 #include <wx/button.h> 37 #include <scrollingdialog.h> 38 //*) 39 40 #include <wx/imaglist.h> 41 #include <wx/colordlg.h> 42 43 #include "../defitems/wxsimagelist.h" 44 45 class wxsImageTreeEditorDlg: public wxScrollingDialog 46 { 47 public: 48 49 wxsImageTreeEditorDlg(wxWindow* parent); 50 virtual ~wxsImageTreeEditorDlg(); 51 52 bool Execute(wxArrayString &aItems); 53 static void ParseTreeItem(wxString aSource, int &outLevel, wxColour &outColour, bool &outBold, int &outImage1, int &outImage2, int &outImage3, int &outImage4, wxString &outText); 54 55 56 57 //(*Declarations(wxsImageTreeEditorDlg) 58 wxStaticText* StaticText10; 59 wxStaticBoxSizer* StaticBoxSizer2; 60 wxStaticText* StaticText9; 61 wxButton* bOK; 62 wxBitmapComboBox* cbSelected; 63 wxBitmapComboBox* cbExpanded; 64 wxBitmapButton *bAddSubItem; 65 wxButton* bCancel; 66 wxStaticText* StaticText13; 67 wxStaticText* StaticText2; 68 wxStaticText* StaticText6; 69 wxTreeCtrl* Tree1; 70 wxStaticText* StaticText8; 71 wxStaticText* StaticText11; 72 wxImageList* ImageList1; 73 wxBitmapButton *bEditItem; 74 wxColourDialog* ColourDialog1; 75 wxStaticText* StaticText1; 76 wxStaticText* StaticText3; 77 wxBitmapButton *bDelAllItems; 78 wxBitmapButton *bDelItem; 79 wxCheckBox* cxItemBold; 80 wxStaticText* StaticText5; 81 wxStaticText* StaticText7; 82 wxStaticText* StaticText12; 83 wxStaticBoxSizer* StaticBoxSizer1; 84 wxBitmapComboBox* cbSelExpanded; 85 wxStaticText* StaticText4; 86 wxButton* bItemColor; 87 wxBitmapButton *bAddItem; 88 wxBitmapComboBox* cbNormal; 89 //*) 90 91 92 93 protected: 94 95 //(*Identifiers(wxsImageTreeEditorDlg) 96 static const long ID_STATICTEXT1; 97 static const long ID_TREECTRL1; 98 static const long ID_IMAGEBUTTON1; 99 static const long ID_IMAGEBUTTON2; 100 static const long ID_STATICTEXT3; 101 static const long ID_IMAGEBUTTON3; 102 static const long ID_STATICTEXT4; 103 static const long ID_IMAGEBUTTON4; 104 static const long ID_STATICTEXT5; 105 static const long ID_BUTTON3; 106 static const long ID_STATICTEXT6; 107 static const long ID_CHECKBOX1; 108 static const long ID_IMAGEBUTTON5; 109 static const long ID_STATICTEXT11; 110 static const long ID_STATICTEXT12; 111 static const long ID_STATICTEXT13; 112 static const long ID_COMBOBOX1; 113 static const long ID_STATICTEXT7; 114 static const long ID_COMBOBOX2; 115 static const long ID_STATICTEXT8; 116 static const long ID_COMBOBOX3; 117 static const long ID_STATICTEXT9; 118 static const long ID_COMBOBOX4; 119 static const long ID_STATICTEXT10; 120 static const long ID_BUTTON1; 121 static const long ID_BUTTON2; 122 //*) 123 124 private: 125 126 //(*Handlers(wxsImageTreeEditorDlg) 127 void OnbAddItemClick(wxCommandEvent& event); 128 void OnbAddSubItemClick(wxCommandEvent& event); 129 void OnbDelItemClick(wxCommandEvent& event); 130 void OnbDelAllItemsClick(wxCommandEvent& event); 131 void OnbItemColorClick(wxCommandEvent& event); 132 void OncxItemBoldClick(wxCommandEvent& event); 133 void OnbEditItemClick(wxCommandEvent& event); 134 void OncbNormalSelect(wxCommandEvent& event); 135 void OncbSelectedSelect(wxCommandEvent& event); 136 void OncbExpandedSelect(wxCommandEvent& event); 137 void OncbSelExpandedSelect(wxCommandEvent& event); 138 void OnTreeCtrl1SelectionChanged(wxTreeEvent& event); 139 void OnbOKClick(wxCommandEvent& event); 140 void OnbCancelClick(wxCommandEvent& event); 141 //*) 142 143 void SetImageList(wxImageList &inImageList); 144 void AddItem(wxTreeItemId &inParent); 145 void EncodeTreeItems(wxTreeItemId inParent, int inLevel, wxArrayString &outList); 146 147 148 149 wxString m_sTreeName; //!< The tree name. 150 wxString m_sImageName; //!< The image list's name. 151 wxImageList m_imageList; //!< The image list used to provide state images. 152 153 154 DECLARE_EVENT_TABLE() 155 }; 156 157 #endif 158