File: richtextsizepage.h

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (301 lines) | stat: -rw-r--r-- 10,652 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/richtext/richtextsizepage.h
// Purpose:
// Author:      Julian Smart
// Modified by:
// Created:     20/10/2010 10:23:24
// RCS-ID:
// Copyright:   (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////

#ifndef _RICHTEXTSIZEPAGE_H_
#define _RICHTEXTSIZEPAGE_H_

/*!
 * Includes
 */

#include "wx/richtext/richtextdialogpage.h"
#include "wx/sizer.h"

////@begin includes
#include "wx/statline.h"
#include "wx/valgen.h"
////@end includes
#include "wx/stattext.h"

/*!
 * Forward declarations
 */


/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_WXRICHTEXTSIZEPAGE_STYLE wxTAB_TRAVERSAL
#define SYMBOL_WXRICHTEXTSIZEPAGE_TITLE wxEmptyString
#define SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME ID_WXRICHTEXTSIZEPAGE
#define SYMBOL_WXRICHTEXTSIZEPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTSIZEPAGE_POSITION wxDefaultPosition
////@end control identifiers


/*!
 * wxRichTextSizePage class declaration
 */

class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage: public wxRichTextDialogPage
{
    DECLARE_DYNAMIC_CLASS( wxRichTextSizePage )
    DECLARE_EVENT_TABLE()
    DECLARE_HELP_PROVISION()

public:
    /// Constructors
    wxRichTextSizePage();
    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 );

    /// Creation
    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 );

    /// Destructor
    ~wxRichTextSizePage();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

    /// Gets the attributes from the formatting dialog
    wxRichTextAttr* GetAttributes();

    /// Data transfer
    virtual bool TransferDataToWindow();
    virtual bool TransferDataFromWindow();

    /// Show/hide position controls
    static void ShowPositionControls(bool show) { sm_showPositionControls = show; }

    /// Show/hide minimum and maximum size controls
    static void ShowMinMaxSizeControls(bool show) { sm_showMinMaxSizeControls = show; }

    /// Show/hide position mode controls
    static void ShowPositionModeControls(bool show) { sm_showPositionModeControls = show; }

    /// Show/hide right/bottom position controls
    static void ShowRightBottomPositionControls(bool show) { sm_showRightBottomPositionControls = show; }

    /// Show/hide floating and alignment controls
    static void ShowFloatingAndAlignmentControls(bool show) { sm_showFloatingAndAlignmentControls = show; }

    /// Show/hide floating controls
    static void ShowFloatingControls(bool show) { sm_showFloatingControls = show; }

    /// Show/hide alignment controls
    static void ShowAlignmentControls(bool show) { sm_showAlignmentControls = show; }

    /// Enable the position and size units
    static void EnablePositionAndSizeUnits(bool enable) { sm_enablePositionAndSizeUnits = enable; }

    /// Enable the checkboxes for position and size
    static void EnablePositionAndSizeCheckboxes(bool enable) { sm_enablePositionAndSizeCheckboxes = enable; }

////@begin wxRichTextSizePage event handler declarations

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
    void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
    void OnRichtextWidthUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_W
    void OnRichtextWidthUnitsUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
    void OnRichtextHeightUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_H
    void OnRichtextHeightUnitsUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
    void OnRichtextMinWidthUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
    void OnRichtextMinHeightUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
    void OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
    void OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
    void OnRichtextLeftUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
    void OnRichtextLeftUnitsUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP
    void OnRichtextTopUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS
    void OnRichtextTopUnitsUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
    void OnRichtextRightUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS
    void OnRichtextRightUnitsUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
    void OnRichtextBottomUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS
    void OnRichtextBottomUnitsUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
    void OnRichtextParaUpClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
    void OnRichtextParaDownClick( wxCommandEvent& event );

////@end wxRichTextSizePage event handler declarations

////@begin wxRichTextSizePage member function declarations

    int GetPositionMode() const { return m_positionMode ; }
    void SetPositionMode(int value) { m_positionMode = value ; }

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end wxRichTextSizePage member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin wxRichTextSizePage member variables
    wxBoxSizer* m_parentSizer;
    wxBoxSizer* m_floatingAlignmentSizer;
    wxBoxSizer* m_floatingSizer;
    wxChoice* m_float;
    wxBoxSizer* m_alignmentSizer;
    wxCheckBox* m_verticalAlignmentCheckbox;
    wxChoice* m_verticalAlignmentComboBox;
    wxFlexGridSizer* m_sizeSizer;
    wxBoxSizer* m_widthSizer;
    wxCheckBox* m_widthCheckbox;
    wxStaticText* m_widthLabel;
    wxTextCtrl* m_width;
    wxComboBox* m_unitsW;
    wxBoxSizer* m_heightSizer;
    wxCheckBox* m_heightCheckbox;
    wxStaticText* m_heightLabel;
    wxTextCtrl* m_height;
    wxComboBox* m_unitsH;
    wxCheckBox* m_minWidthCheckbox;
    wxBoxSizer* m_minWidthSizer;
    wxTextCtrl* m_minWidth;
    wxComboBox* m_unitsMinW;
    wxCheckBox* m_minHeightCheckbox;
    wxBoxSizer* m_minHeightSizer;
    wxTextCtrl* m_minHeight;
    wxComboBox* m_unitsMinH;
    wxCheckBox* m_maxWidthCheckbox;
    wxBoxSizer* m_maxWidthSizer;
    wxTextCtrl* m_maxWidth;
    wxComboBox* m_unitsMaxW;
    wxCheckBox* m_maxHeightCheckbox;
    wxBoxSizer* m_maxHeightSizer;
    wxTextCtrl* m_maxHeight;
    wxComboBox* m_unitsMaxH;
    wxBoxSizer* m_positionControls;
    wxBoxSizer* m_moveObjectParentSizer;
    wxBoxSizer* m_positionModeSizer;
    wxChoice* m_positionModeCtrl;
    wxFlexGridSizer* m_positionGridSizer;
    wxBoxSizer* m_leftSizer;
    wxCheckBox* m_positionLeftCheckbox;
    wxStaticText* m_leftLabel;
    wxTextCtrl* m_left;
    wxComboBox* m_unitsLeft;
    wxBoxSizer* m_topSizer;
    wxCheckBox* m_positionTopCheckbox;
    wxStaticText* m_topLabel;
    wxTextCtrl* m_top;
    wxComboBox* m_unitsTop;
    wxBoxSizer* m_rightSizer;
    wxCheckBox* m_positionRightCheckbox;
    wxStaticText* m_rightLabel;
    wxBoxSizer* m_rightPositionSizer;
    wxTextCtrl* m_right;
    wxComboBox* m_unitsRight;
    wxBoxSizer* m_bottomSizer;
    wxCheckBox* m_positionBottomCheckbox;
    wxStaticText* m_bottomLabel;
    wxBoxSizer* m_bottomPositionSizer;
    wxTextCtrl* m_bottom;
    wxComboBox* m_unitsBottom;
    wxBoxSizer* m_moveObjectSizer;
    int m_positionMode;
    /// Control identifiers
    enum {
        ID_WXRICHTEXTSIZEPAGE = 10700,
        ID_RICHTEXT_FLOATING_MODE = 10701,
        ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX = 10708,
        ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX = 10709,
        ID_RICHTEXT_WIDTH_CHECKBOX = 10702,
        ID_RICHTEXT_WIDTH = 10703,
        ID_RICHTEXT_UNITS_W = 10704,
        ID_RICHTEXT_HEIGHT_CHECKBOX = 10705,
        ID_RICHTEXT_HEIGHT = 10706,
        ID_RICHTEXT_UNITS_H = 10707,
        ID_RICHTEXT_MIN_WIDTH_CHECKBOX = 10715,
        ID_RICHTEXT_MIN_WIDTH = 10716,
        ID_RICHTEXT_UNITS_MIN_W = 10717,
        ID_RICHTEXT_MIN_HEIGHT_CHECKBOX = 10718,
        ID_RICHTEXT_MIN_HEIGHT = 10719,
        ID_RICHTEXT_UNITS_MIN_H = 10720,
        ID_RICHTEXT_MAX_WIDTH_CHECKBOX = 10721,
        ID_RICHTEXT_MAX_WIDTH = 10722,
        ID_RICHTEXT_UNITS_MAX_W = 10723,
        ID_RICHTEXT_MAX_HEIGHT_CHECKBOX = 10724,
        ID_RICHTEXT_MAX_HEIGHT = 10725,
        ID_RICHTEXT_UNITS_MAX_H = 10726,
        ID_RICHTEXT_POSITION_MODE = 10735,
        ID_RICHTEXT_LEFT_CHECKBOX = 10710,
        ID_RICHTEXT_LEFT = 10711,
        ID_RICHTEXT_LEFT_UNITS = 10712,
        ID_RICHTEXT_TOP_CHECKBOX = 10710,
        ID_RICHTEXT_TOP = 10728,
        ID_RICHTEXT_TOP_UNITS = 10729,
        ID_RICHTEXT_RIGHT_CHECKBOX = 10727,
        ID_RICHTEXT_RIGHT = 10730,
        ID_RICHTEXT_RIGHT_UNITS = 10731,
        ID_RICHTEXT_BOTTOM_CHECKBOX = 10732,
        ID_RICHTEXT_BOTTOM = 10733,
        ID_RICHTEXT_BOTTOM_UNITS = 10734,
        ID_RICHTEXT_PARA_UP = 10713,
        ID_RICHTEXT_PARA_DOWN = 10714
    };
////@end wxRichTextSizePage member variables

    static bool sm_showFloatingControls;
    static bool sm_showPositionControls;
    static bool sm_showMinMaxSizeControls;
    static bool sm_showPositionModeControls;
    static bool sm_showRightBottomPositionControls;
    static bool sm_showAlignmentControls;
    static bool sm_showFloatingAndAlignmentControls;
    static bool sm_enablePositionAndSizeUnits;
    static bool sm_enablePositionAndSizeCheckboxes;
};

#endif
    // _RICHTEXTSIZEPAGE_H_