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"
27 * Forward declarations
35 ////@begin control identifiers
36 #define SYMBOL_WXRICHTEXTSIZEPAGE_STYLE wxTAB_TRAVERSAL
37 #define SYMBOL_WXRICHTEXTSIZEPAGE_TITLE wxEmptyString
38 #define SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME ID_WXRICHTEXTSIZEPAGE
39 #define SYMBOL_WXRICHTEXTSIZEPAGE_SIZE wxSize(400, 300)
40 #define SYMBOL_WXRICHTEXTSIZEPAGE_POSITION wxDefaultPosition
41 ////@end control identifiers
45 * wxRichTextSizePage class declaration
48 class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage
: public wxRichTextDialogPage
50 DECLARE_DYNAMIC_CLASS( wxRichTextSizePage
)
52 DECLARE_HELP_PROVISION()
57 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
);
60 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
);
63 ~wxRichTextSizePage();
65 /// Initialises member variables
68 /// Creates the controls and sizers
69 void CreateControls();
71 /// Gets the attributes from the formatting dialog
72 wxRichTextAttr
* GetAttributes();
75 virtual bool TransferDataToWindow();
76 virtual bool TransferDataFromWindow();
78 /// Show/hide position controls
79 void ShowPositionControls(bool show
);
81 /// Show/hide floating controls
82 void ShowFloatingControls(bool show
);
84 ////@begin wxRichTextSizePage event handler declarations
86 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
87 void OnRichtextWidthUpdate( wxUpdateUIEvent
& event
);
89 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
90 void OnRichtextHeightUpdate( wxUpdateUIEvent
& event
);
92 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
93 void OnRichtextMinWidthUpdate( wxUpdateUIEvent
& event
);
95 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
96 void OnRichtextMinHeightUpdate( wxUpdateUIEvent
& event
);
98 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
99 void OnRichtextMaxWidthUpdate( wxUpdateUIEvent
& event
);
101 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
102 void OnRichtextMaxHeightUpdate( wxUpdateUIEvent
& event
);
104 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
105 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent
& event
);
107 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OFFSET
108 void OnRichtextOffsetUpdate( wxUpdateUIEvent
& event
);
110 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
111 void OnRichtextParaUpClick( wxCommandEvent
& event
);
113 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
114 void OnRichtextParaDownClick( wxCommandEvent
& event
);
116 ////@end wxRichTextSizePage event handler declarations
118 ////@begin wxRichTextSizePage member function declarations
120 /// Retrieves bitmap resources
121 wxBitmap
GetBitmapResource( const wxString
& name
);
123 /// Retrieves icon resources
124 wxIcon
GetIconResource( const wxString
& name
);
125 ////@end wxRichTextSizePage member function declarations
127 /// Should we show tooltips?
128 static bool ShowToolTips();
130 ////@begin wxRichTextSizePage member variables
131 wxBoxSizer
* m_parentSizer
;
132 wxBoxSizer
* m_floatingControls
;
134 wxCheckBox
* m_widthCheckbox
;
136 wxComboBox
* m_unitsW
;
137 wxCheckBox
* m_heightCheckbox
;
138 wxTextCtrl
* m_height
;
139 wxComboBox
* m_unitsH
;
140 wxCheckBox
* m_minWidthCheckbox
;
141 wxTextCtrl
* m_minWidth
;
142 wxComboBox
* m_unitsMinW
;
143 wxCheckBox
* m_minHeightCheckbox
;
144 wxTextCtrl
* m_minHeight
;
145 wxComboBox
* m_unitsMinH
;
146 wxCheckBox
* m_maxWidthCheckbox
;
147 wxTextCtrl
* m_maxWidth
;
148 wxComboBox
* m_unitsMaxW
;
149 wxCheckBox
* m_maxHeightCheckbox
;
150 wxTextCtrl
* m_maxHeight
;
151 wxComboBox
* m_unitsMaxH
;
152 wxBoxSizer
* m_alignmentControls
;
153 wxCheckBox
* m_verticalAlignmentCheckbox
;
154 wxComboBox
* m_verticalAlignmentComboBox
;
155 wxBoxSizer
* m_positionControls
;
156 wxBoxSizer
* m_moveObjectParentSizer
;
157 wxCheckBox
* m_offsetYCheckbox
;
158 wxTextCtrl
* m_offset
;
159 wxComboBox
* m_unitsOffset
;
160 wxBoxSizer
* m_moveObjectSizer
;
161 /// Control identifiers
163 ID_WXRICHTEXTSIZEPAGE
= 10700,
164 ID_RICHTEXT_FLOATING_MODE
= 10701,
165 ID_RICHTEXT_WIDTH_CHECKBOX
= 10702,
166 ID_RICHTEXT_WIDTH
= 10703,
167 ID_RICHTEXT_UNITS_W
= 10704,
168 ID_RICHTEXT_HEIGHT_CHECKBOX
= 10705,
169 ID_RICHTEXT_HEIGHT
= 10706,
170 ID_RICHTEXT_UNITS_H
= 10707,
171 ID_RICHTEXT_MIN_WIDTH_CHECKBOX
= 10715,
172 ID_RICHTEXT_MIN_WIDTH
= 10716,
173 ID_RICHTEXT_UNITS_MIN_W
= 10717,
174 ID_RICHTEXT_MIN_HEIGHT_CHECKBOX
= 10718,
175 ID_RICHTEXT_MIN_HEIGHT
= 10719,
176 ID_RICHTEXT_UNITS_MIN_H
= 10720,
177 ID_RICHTEXT_MAX_WIDTH_CHECKBOX
= 10721,
178 ID_RICHTEXT_MAX_WIDTH
= 10722,
179 ID_RICHTEXT_UNITS_MAX_W
= 10723,
180 ID_RICHTEXT_MAX_HEIGHT_CHECKBOX
= 10724,
181 ID_RICHTEXT_MAX_HEIGHT
= 10725,
182 ID_RICHTEXT_UNITS_MAX_H
= 10726,
183 ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX
= 10708,
184 ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
= 10709,
185 ID_RICHTEXT_OFFSET_CHECKBOX
= 10710,
186 ID_RICHTEXT_OFFSET
= 10711,
187 ID_RICHTEXT_OFFSET_UNITS
= 10712,
188 ID_RICHTEXT_PARA_UP
= 10713,
189 ID_RICHTEXT_PARA_DOWN
= 10714
191 ////@end wxRichTextSizePage member variables
195 // _RICHTEXTSIZEPAGE_H_