12 #ifndef __WDR_styledialg_H__
13 #define __WDR_styledialg_H__
21 #include <wx/statline.h>
22 #include <wx/spinbutt.h>
23 #include <wx/spinctrl.h>
24 #include <wx/listctrl.h>
25 #include <wx/odcombo.h>
27 #include <wx/colordlg.h>
35 #define ID_STYLENAME 10000
37 #define ID_SLIDER_RED 10007
38 #define ID_SLIDER_GREEN 10008
39 #define ID_SLIDER_BLUE 10009
41 #define ID_GREEN 10005
42 #define ID_FILLCOLOR 10006
43 #define ID_STROKECOLOR 10019
45 #define ID_PIXELWIDTH 10011
46 #define ID_PIXELSTROKE 10012
47 #define ID_STIPPLEBITMAP 10013
48 #define ID_FILLSTYLE 10015
49 #define ID_STROKESTYLE 10016
50 #define ID_COLOURS 10017
51 #define ID_MODEL_BUTTON_OK 10018
66 a2dStyleDialog(
a2dHabitat* habitat, wxWindow* parent,
long style = wxDEFAULT_DIALOG_STYLE,
bool modal =
false,
bool setCentralStyle =
true );
70 void SetColor( wxSpinEvent& spinevent );
72 void ColorSelect( wxCommandEvent& event );
74 void OnSpinCtrlText( wxCommandEvent& event );
76 void OnSliderUpdate( wxScrollEvent& event );
78 void OnColourBitmap( wxCommandEvent& event );
80 void OnStippleBitmap( wxCommandEvent& event );
82 void OnFillStyle( wxCommandEvent& event );
84 void OnStrokeStyle( wxCommandEvent& event );
86 void OnPixelWidth( wxCommandEvent& event );
88 void OnPixelWidthSpin( wxSpinEvent& event );
90 void OnPixelStroke( wxCommandEvent& event );
93 void OnCloseWindow( wxCloseEvent& event );
95 void OnIdle( wxIdleEvent& idleEvent );
97 void SentStyle(
bool fill =
true,
bool stroke =
true );
99 a2dFill& GetFill() {
return m_fill; }
100 void SetFill(
const a2dFill& fill );
102 a2dStroke& GetStroke() {
return m_stroke; }
103 void SetStroke(
const a2dStroke& stroke );
111 void OnSize( wxSizeEvent& WXUNUSED( event ) );
115 void CmOk( wxCommandEvent& event );
129 wxColour m_colorFill1;
131 wxColour m_colorFill2;
133 wxColour m_colorStroke;
138 wxBitmap m_fillstippleb;
140 wxBitmapButton* m_colourfillshow;
141 wxBitmapButton* m_colourstrokeshow;
142 wxBitmapButton* m_fillstipple;
144 wxSlider* m_sliderred;
146 wxSlider* m_slidergreen;
148 wxSlider* m_sliderblue;
150 wxSpinCtrl* m_spinred;
152 wxSpinCtrl* m_spingreen;
154 wxSpinCtrl* m_spinblue;
165 wxBitmap m_fillpatternmono;
167 wxChoice* m_fillstyles;
169 wxSpinCtrl* m_pixelwidth;
171 wxCheckBox* m_pixelstroke;
173 wxChoice* m_strokestyles;
175 bool m_skipspinevent;
182 bool m_setCentralStyle;
187 bool m_strokeCommand;
204 void Set(
const wxColourData &colData);
205 void Get(wxColourData *pColData)
const;
207 void Set(
int i,
const wxColour &color);
208 wxColour Get(
int i)
const;
214 wxColour m_Color[wxColourData::NUM_CUSTOM];
224 static const wxArrayString TChoices(
bool bAllowTransparent);
230 void SetColor(
const wxColour &color);
231 bool IsColorSelected()
const {
return (GetSelection() > -1) ?
true :
false; }
232 wxColour GetColor()
const {
return m_Color; }
234 virtual void OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
int flags)
const;
235 virtual wxCoord OnMeasureItem(
size_t item)
const;
243 void OnSelected(wxCommandEvent& event);
245 DECLARE_EVENT_TABLE()
248 bool m_bAllowTransparent;
260 static const wxArrayString TChoices(
bool bAllowLayerStyle);
262 a2dStrokeStyleComboBox(wxWindow *parent, wxWindowID
id,
bool bAllowLayerStyle =
false,
const wxSize &size = wxDefaultSize);
266 bool IsStyleSelected()
const {
return (GetSelection() > -1) ?
true :
false; }
269 virtual void OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
int flags)
const;
270 virtual wxCoord OnMeasureItem(
size_t item)
const;
276 void OnSelected(wxCommandEvent& event);
278 DECLARE_EVENT_TABLE()
281 bool m_bAllowLayerStyle;
292 static const wxArrayString TChoices(
bool bAllowLayerStyle);
295 a2dFillComboBox(wxWindow *parent, wxWindowID
id,
bool bAllowLayerStyle =
false,
a2dCustomColors *pCustCol = 0,
const wxSize &size = wxDefaultSize);
298 void SetFill(
const a2dFill &fill);
299 bool IsFillSelected()
const {
return (GetSelection() > -1) ?
true :
false; }
300 a2dFill GetFill()
const {
return m_Fill; }
302 virtual void OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
int flags)
const;
303 virtual wxCoord OnMeasureItem(
size_t item)
const;
311 void OnSelected(wxCommandEvent& event);
313 DECLARE_EVENT_TABLE()
316 bool m_bAllowLayerStyle;
325 class wxBitmapToggleButton;
337 a2dDialogStyle(wxWindow *parent,
bool bGlobal,
bool bFill,
bool bAllowLayerStyle =
false);
340 void SetUnitsScale(
double scale) { m_UnitsScale = scale; }
342 void SetCustomColors(
const a2dCustomColors& colors) { m_CustomColors = colors; }
343 const a2dCustomColors& GetCustomColors()
const {
return m_CustomColors; }
345 const a2dExtStroke& GetExtStroke()
const {
return m_ExtStroke; }
346 void SetExtStroke(
const a2dExtStroke& extStroke) { m_ExtStroke = extStroke; }
348 const a2dExtFill& GetExtFill()
const {
return m_ExtFill; }
349 void SetExtFill(
const a2dExtFill& extFill) { m_ExtFill = extFill; }
352 void CreateControls(
bool bAllowLayerStyle);
353 void UpdateStrokeData(
bool bGetFromDlg);
354 void SetJoin(wxPenJoin join);
355 void SetCap(wxPenCap cap);
360 void OnInitDialog(wxInitDialogEvent& event);
361 void OnStrokeStyle(wxCommandEvent& event);
362 void OnJoin(wxCommandEvent& event);
363 void OnCap(wxCommandEvent& event);
364 void OnOk(wxCommandEvent& event);
366 DECLARE_EVENT_TABLE()
376 wxBitmapToggleButton *m_pJoinMiterBt;
377 wxBitmapToggleButton *m_pJoinBevelBt;
378 wxBitmapToggleButton *m_pJoinRoundBt;
380 wxBitmapToggleButton *m_pCapButtBt;
381 wxBitmapToggleButton *m_pCapProjectingBt;
382 wxBitmapToggleButton *m_pCapRoundBt;
383 wxSpinCtrlDouble *m_pStrokeWidthCtrl;
Base class for all types of strokes, understood by a2dDrawer2D classes.
Stroke and fill base classes.
bool m_doSentCommand
When canvas event, this is set to prevent sending commands.
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
general style dialog to edit a2dCanvasObject style
wxColourDialog * m_cd
color dialog for color bitmap button sample
layer settings for a a2dCanvasDocument Holds layers settings classes
static const a2dCanvasObjectFlagsMask SELECTED
defines common settinsg for a habitat for a set of a2dCameleons.
for choosing a a2dCanvasObject from a list.
wxColourData * m_cdata
colour data for colour dialog
wxColour * m_color
the color that is under modification
Event sent to a2dCommandProcessor.
a2dColorComboBox(wxWindow *parent, wxWindowID id, bool bAllowTransparent=true, a2dCustomColors *pCustCol=0, const wxSize &size=wxDefaultSize)
pCustCol is an optional pointer to custom colors, which will be modified directly! ...
a2dStrokeStyle
stroke styles for a2dStroke