1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextsizepage.h
4 // Author: Julian Smart
6 // Created: 20/10/2010 10:23:24
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _RICHTEXTSIZEPAGE_H_
13 #define _RICHTEXTSIZEPAGE_H_
19 #include "wx/richtext/richtextdialogpage.h"
23 #include "wx/statline.h"
24 #include "wx/valgen.h"
28 * Forward declarations
36 ////@begin control identifiers
37 #define SYMBOL_WXRICHTEXTSIZEPAGE_STYLE wxTAB_TRAVERSAL
38 #define SYMBOL_WXRICHTEXTSIZEPAGE_TITLE wxEmptyString
39 #define SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME ID_WXRICHTEXTSIZEPAGE
40 #define SYMBOL_WXRICHTEXTSIZEPAGE_SIZE wxSize(400, 300)
41 #define SYMBOL_WXRICHTEXTSIZEPAGE_POSITION wxDefaultPosition
42 ////@end control identifiers
46 * wxRichTextSizePage class declaration
49 class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage
: public wxRichTextDialogPage
51 DECLARE_DYNAMIC_CLASS( wxRichTextSizePage
)
53 DECLARE_HELP_PROVISION()
58 wxRichTextSizePage( wxWindow
* parent
, wxWindowID id
= SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTSIZEPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTSIZEPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTSIZEPAGE_STYLE
);
61 bool Create( wxWindow
* parent
, wxWindowID id
= SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTSIZEPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTSIZEPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTSIZEPAGE_STYLE
);
64 ~wxRichTextSizePage();
66 /// Initialises member variables
69 /// Creates the controls and sizers
70 void CreateControls();
72 /// Gets the attributes from the formatting dialog
73 wxRichTextAttr
* GetAttributes();
76 virtual bool TransferDataToWindow();
77 virtual bool TransferDataFromWindow();
79 /// Show/hide position controls
80 void ShowPositionControls(bool show
);
82 /// Show/hide floating controls
83 void ShowFloatingControls(bool show
);
85 ////@begin wxRichTextSizePage event handler declarations
87 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
88 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent
& event
);
90 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
91 void OnRichtextWidthUpdate( wxUpdateUIEvent
& event
);
93 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
94 void OnRichtextHeightUpdate( wxUpdateUIEvent
& event
);
96 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
97 void OnRichtextMinWidthUpdate( wxUpdateUIEvent
& event
);
99 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
100 void OnRichtextMinHeightUpdate( wxUpdateUIEvent
& event
);
102 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
103 void OnRichtextMaxWidthUpdate( wxUpdateUIEvent
& event
);
105 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
106 void OnRichtextMaxHeightUpdate( wxUpdateUIEvent
& event
);
108 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
109 void OnRichtextLeftUpdate( wxUpdateUIEvent
& event
);
111 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
112 void OnRichtextTopUpdate( wxUpdateUIEvent
& event
);
114 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
115 void OnRichtextRightUpdate( wxUpdateUIEvent
& event
);
117 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
118 void OnRichtextBottomUpdate( wxUpdateUIEvent
& event
);
120 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
121 void OnRichtextParaUpClick( wxCommandEvent
& event
);
123 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
124 void OnRichtextParaDownClick( wxCommandEvent
& event
);
126 ////@end wxRichTextSizePage event handler declarations
128 ////@begin wxRichTextSizePage member function declarations
130 int GetPositionMode() const { return m_positionMode
; }
131 void SetPositionMode(int value
) { m_positionMode
= value
; }
133 /// Retrieves bitmap resources
134 wxBitmap
GetBitmapResource( const wxString
& name
);
136 /// Retrieves icon resources
137 wxIcon
GetIconResource( const wxString
& name
);
138 ////@end wxRichTextSizePage member function declarations
140 /// Should we show tooltips?
141 static bool ShowToolTips();
143 ////@begin wxRichTextSizePage member variables
144 wxBoxSizer
* m_parentSizer
;
145 wxBoxSizer
* m_floatingControls
;
147 wxBoxSizer
* m_alignmentControls
;
148 wxCheckBox
* m_verticalAlignmentCheckbox
;
149 wxComboBox
* m_verticalAlignmentComboBox
;
150 wxCheckBox
* m_widthCheckbox
;
152 wxComboBox
* m_unitsW
;
153 wxCheckBox
* m_heightCheckbox
;
154 wxTextCtrl
* m_height
;
155 wxComboBox
* m_unitsH
;
156 wxCheckBox
* m_minWidthCheckbox
;
157 wxTextCtrl
* m_minWidth
;
158 wxComboBox
* m_unitsMinW
;
159 wxCheckBox
* m_minHeightCheckbox
;
160 wxTextCtrl
* m_minHeight
;
161 wxComboBox
* m_unitsMinH
;
162 wxCheckBox
* m_maxWidthCheckbox
;
163 wxTextCtrl
* m_maxWidth
;
164 wxComboBox
* m_unitsMaxW
;
165 wxCheckBox
* m_maxHeightCheckbox
;
166 wxTextCtrl
* m_maxHeight
;
167 wxComboBox
* m_unitsMaxH
;
168 wxBoxSizer
* m_positionControls
;
169 wxBoxSizer
* m_moveObjectParentSizer
;
170 wxComboBox
* m_positionModeCtrl
;
171 wxCheckBox
* m_positionLeftCheckbox
;
173 wxComboBox
* m_unitsLeft
;
174 wxCheckBox
* m_positionTopCheckbox
;
176 wxComboBox
* m_unitsTop
;
177 wxCheckBox
* m_positionRightCheckbox
;
179 wxComboBox
* m_unitsRight
;
180 wxCheckBox
* m_positionBottomCheckbox
;
181 wxTextCtrl
* m_bottom
;
182 wxComboBox
* m_unitsBottom
;
183 wxBoxSizer
* m_moveObjectSizer
;
185 /// Control identifiers
187 ID_WXRICHTEXTSIZEPAGE
= 10700,
188 ID_RICHTEXT_FLOATING_MODE
= 10701,
189 ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX
= 10708,
190 ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
= 10709,
191 ID_RICHTEXT_WIDTH_CHECKBOX
= 10702,
192 ID_RICHTEXT_WIDTH
= 10703,
193 ID_RICHTEXT_UNITS_W
= 10704,
194 ID_RICHTEXT_HEIGHT_CHECKBOX
= 10705,
195 ID_RICHTEXT_HEIGHT
= 10706,
196 ID_RICHTEXT_UNITS_H
= 10707,
197 ID_RICHTEXT_MIN_WIDTH_CHECKBOX
= 10715,
198 ID_RICHTEXT_MIN_WIDTH
= 10716,
199 ID_RICHTEXT_UNITS_MIN_W
= 10717,
200 ID_RICHTEXT_MIN_HEIGHT_CHECKBOX
= 10718,
201 ID_RICHTEXT_MIN_HEIGHT
= 10719,
202 ID_RICHTEXT_UNITS_MIN_H
= 10720,
203 ID_RICHTEXT_MAX_WIDTH_CHECKBOX
= 10721,
204 ID_RICHTEXT_MAX_WIDTH
= 10722,
205 ID_RICHTEXT_UNITS_MAX_W
= 10723,
206 ID_RICHTEXT_MAX_HEIGHT_CHECKBOX
= 10724,
207 ID_RICHTEXT_MAX_HEIGHT
= 10725,
208 ID_RICHTEXT_UNITS_MAX_H
= 10726,
209 ID_RICHTEXT_POSITION_MODE
= 10735,
210 ID_RICHTEXT_LEFT_CHECKBOX
= 10710,
211 ID_RICHTEXT_LEFT
= 10711,
212 ID_RICHTEXT_LEFT_UNITS
= 10712,
213 ID_RICHTEXT_TOP_CHECKBOX
= 10710,
214 ID_RICHTEXT_TOP
= 10728,
215 ID_RICHTEXT_TOP_UNITS
= 10729,
216 ID_RICHTEXT_RIGHT_CHECKBOX
= 10727,
217 ID_RICHTEXT_RIGHT
= 10730,
218 ID_RICHTEXT_RIGHT_UNITS
= 10731,
219 ID_RICHTEXT_BOTTOM_CHECKBOX
= 10732,
220 ID_RICHTEXT_BOTTOM
= 10733,
221 ID_RICHTEXT_BOTTOM_UNITS
= 10734,
222 ID_RICHTEXT_PARA_UP
= 10713,
223 ID_RICHTEXT_PARA_DOWN
= 10714
225 ////@end wxRichTextSizePage member variables
229 // _RICHTEXTSIZEPAGE_H_