1
/** \file wxsimagelisteditordlg.h
3
* This file is part of wxSmith plugin for Code::Blocks Studio
4
* Copyright (C) 2010 Gary Harris
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.
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.
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/>.
19
* This code was taken from the wxSmithImage plug-in, copyright Ron Collins
20
* and released under the GPL.
24
#ifndef WXSIMAGELISTEDITORDLG_H
25
#define WXSIMAGELISTEDITORDLG_H
28
//(*Headers(wxsImageListEditorDlg)
29
#include <wx/bmpbuttn.h>
30
#include <wx/checkbox.h>
32
#include <wx/colordlg.h>
33
#include <wx/button.h>
34
#include <wx/filedlg.h>
36
#include "scrollingdialog.h"
37
#include <wx/stattext.h>
40
#include "wxsimagelistproperty.h"
41
#include <wx/bitmap.h>
43
#include <wx/imaglist.h>
44
#include "wxsbitmapiconeditordlg.h"
48
/*! \brief Class for wxsImageListEditorDlg. */
49
class wxsImageListEditorDlg: public wxScrollingDialog
53
wxsImageListEditorDlg(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
54
virtual ~wxsImageListEditorDlg();
55
bool Execute(wxString &inName, wxArrayString &aImageData);
56
static void ImageToArray(wxImage &inImage, wxArrayString &outArray);
57
static void ArrayToImage(wxArrayString &inArray, wxImage &outImage);
58
static void BitmapToArray(wxBitmap &inBitmap, wxArrayString &outArray);
59
static void ArrayToBitmap(wxArrayString &inArray, wxBitmap &outBitmap);
60
static void ImageListToArray(wxImageList &inList, wxArrayString &outArray);
61
static void ArrayToImageList(wxArrayString &inArray, wxImageList &outList);
62
static void CopyImageList(wxImageList &inList, wxImageList &outList);
63
static wxsItem *FindTool(wxsItem *inItem, wxString inName);
64
static int CalcArraySize(wxArrayString &inArray);
65
static bool SaveXPM(wxImage * image, wxOutputStream& stream);
67
//(*Declarations(wxsImageListEditorDlg)
68
wxStaticText* StaticText24;
69
wxStaticText* StaticText22;
70
wxBitmapButton* bSaveList;
75
wxStaticText* StaticText21;
76
wxStaticText* StaticText13;
77
wxStaticText* StaticText14;
79
wxStaticText* StaticText15;
80
wxStaticText* StaticText17;
81
wxStaticText* StaticText28;
86
wxColourDialog* ColourDialog1;
87
wxStaticText* StaticText20;
88
wxStaticText* StaticText18;
89
wxStaticText* StaticText1;
90
wxStaticText* StaticText10;
92
wxStaticText* StaticText16;
93
wxBitmapButton* bLeft;
95
wxStaticText* StaticText3;
97
wxStaticText* StaticText23;
100
wxStaticText* StaticText8;
101
wxStaticText* StaticText12;
102
wxFileDialog* FileDialog1;
103
wxBitmapButton* bRight;
106
wxBitmapButton* bSave;
107
wxStaticText* StaticText7;
108
wxBitmapButton* bClear;
109
wxBitmapButton* bRead;
110
wxCheckBox* cxTransparent;
111
wxStaticText* StaticText4;
112
wxStaticText* StaticText5;
113
wxStaticText* StaticText2;
114
wxStaticText* StaticText27;
115
wxStaticText* StaticText26;
116
wxStaticText* StaticText6;
118
wxStaticText* StaticText19;
119
wxStaticText* StaticText29;
120
wxStaticText* StaticText9;
121
wxStaticText* StaticText11;
122
wxStaticText* StaticText25;
127
//(*Identifiers(wxsImageListEditorDlg)
128
static const long ID_STATICTEXT1;
129
static const long ID_STATICTEXT15;
130
static const long ID_STATICTEXT16;
131
static const long ID_STATICTEXT17;
132
static const long ID_STATICTEXT18;
133
static const long ID_STATICTEXT26;
134
static const long ID_STATICTEXT19;
135
static const long ID_STATICTEXT27;
136
static const long ID_BITMAPBUTTON1;
137
static const long ID_PANEL2;
138
static const long ID_STATICTEXT2;
139
static const long ID_PANEL3;
140
static const long ID_STATICTEXT3;
141
static const long ID_PANEL4;
142
static const long ID_STATICTEXT4;
143
static const long ID_PANEL5;
144
static const long ID_STATICTEXT5;
145
static const long ID_PANEL8;
146
static const long ID_STATICTEXT6;
147
static const long ID_PANEL6;
148
static const long ID_STATICTEXT7;
149
static const long ID_PANEL7;
150
static const long ID_STATICTEXT8;
151
static const long ID_PANEL9;
152
static const long ID_STATICTEXT9;
153
static const long ID_PANEL10;
154
static const long ID_STATICTEXT10;
155
static const long ID_PANEL11;
156
static const long ID_STATICTEXT12;
157
static const long ID_BITMAPBUTTON2;
158
static const long ID_STATICTEXT11;
159
static const long ID_PANEL1;
160
static const long ID_STATICTEXT23;
161
static const long ID_BITMAPBUTTON5;
162
static const long ID_STATICTEXT20;
163
static const long ID_CHECKBOX1;
164
static const long ID_BUTTON2;
165
static const long ID_STATICTEXT21;
166
static const long ID_BITMAPBUTTON3;
167
static const long ID_STATICTEXT13;
168
static const long ID_STATICTEXT22;
169
static const long ID_PANEL12;
170
static const long ID_STATICTEXT28;
171
static const long ID_BITMAPBUTTON4;
172
static const long ID_STATICTEXT14;
173
static const long ID_BITMAPBUTTON6;
174
static const long ID_STATICTEXT24;
175
static const long ID_BITMAPBUTTON7;
176
static const long ID_STATICTEXT25;
177
static const long ID_BITMAPBUTTON8;
178
static const long ID_STATICTEXT29;
179
static const long ID_BUTTON1;
180
static const long ID_BUTTON4;
185
//(*Handlers(wxsImageListEditorDlg)
186
void OnbAddClick(wxCommandEvent& event);
187
void OnbReadClick(wxCommandEvent& event);
188
void OnPanel1Paint(wxPaintEvent& event);
189
void OnbColorClick(wxCommandEvent& event);
190
void OnPanel1LeftUp(wxMouseEvent& event);
191
void OncxTransparentClick(wxCommandEvent& event);
192
void OnbOKClick(wxCommandEvent& event);
193
void OnbCancelClick(wxCommandEvent& event);
194
void OnbLeftClick(wxCommandEvent& event);
195
void OnbRightClick(wxCommandEvent& event);
196
void OnPanel2LeftUp(wxMouseEvent& event);
197
void OnPanel3LeftUp(wxMouseEvent& event);
198
void OnPanel4LeftUp(wxMouseEvent& event);
199
void OnPanel5LeftUp(wxMouseEvent& event);
200
void OnPanel8LeftUp(wxMouseEvent& event);
201
void OnPanel6LeftUp(wxMouseEvent& event);
202
void OnPanel7LeftUp(wxMouseEvent& event);
203
void OnPanel9LeftUp(wxMouseEvent& event);
204
void OnPanel10LeftUp(wxMouseEvent& event);
205
void OnPanel11LeftUp(wxMouseEvent& event);
206
void OnPanel12Paint(wxPaintEvent& event);
207
void OnbDelClick(wxCommandEvent& event);
208
void OnbClearClick(wxCommandEvent& event);
209
void OnbSaveClick(wxCommandEvent& event);
210
void OnbSaveListClick(wxCommandEvent& event);
211
void PaintPreviewPanel(wxPaintEvent& event);
214
void PreviewImport(void);
215
void PreviewList(void);
216
void PreviewSelected(void);
217
void UpdateEnabled(void);
218
void SelectPreviewPanel(int aIndex);
219
void PaintPanel(wxPaintDC &aDC, wxPanel *aPanel, wxBitmap &aBitmap, bool aHot = false);
221
wxImageList m_ImageList; //!< Working copy of image list.
222
wxImage m_ImportImage; //!< The thing that gets displayed.
223
wxColour m_ImportMask; //!< Mask color.
224
wxsBitmapIconEditorDlg *m_ImageDialog; //!< Dialog to import external images.
225
wxsBitmapIconData m_ImageData; //!< Image data for the dialog.
226
int m_FirstImage; //!< Left-most image displayed in preview.
227
wxPanel *m_PreviewPanel[10]; //!< The list of preview images.
228
wxStaticText *m_PreviewLabel[10]; //!< The preview list label.
229
int m_PreviewSelect; //!< The selected preview image.
231
DECLARE_EVENT_TABLE()