1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextmarginspage.h
4 // Author: Julian Smart
6 // Created: 20/10/2010 10:27:34
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _RICHTEXTMARGINSPAGE_H_
13 #define _RICHTEXTMARGINSPAGE_H_
20 #include "wx/richtext/richtextdialogpage.h"
23 #include "wx/statline.h"
27 * Forward declarations
30 ////@begin forward declarations
31 ////@end forward declarations
37 ////@begin control identifiers
38 #define SYMBOL_WXRICHTEXTMARGINSPAGE_STYLE wxTAB_TRAVERSAL
39 #define SYMBOL_WXRICHTEXTMARGINSPAGE_TITLE wxEmptyString
40 #define SYMBOL_WXRICHTEXTMARGINSPAGE_IDNAME ID_WXRICHTEXTMARGINSPAGE
41 #define SYMBOL_WXRICHTEXTMARGINSPAGE_SIZE wxSize(400, 300)
42 #define SYMBOL_WXRICHTEXTMARGINSPAGE_POSITION wxDefaultPosition
43 ////@end control identifiers
47 * wxRichTextMarginsPage class declaration
50 class WXDLLIMPEXP_RICHTEXT wxRichTextMarginsPage
: public wxRichTextDialogPage
52 DECLARE_DYNAMIC_CLASS( wxRichTextMarginsPage
)
54 DECLARE_HELP_PROVISION()
58 wxRichTextMarginsPage();
59 wxRichTextMarginsPage( wxWindow
* parent
, wxWindowID id
= SYMBOL_WXRICHTEXTMARGINSPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTMARGINSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTMARGINSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTMARGINSPAGE_STYLE
);
62 bool Create( wxWindow
* parent
, wxWindowID id
= SYMBOL_WXRICHTEXTMARGINSPAGE_IDNAME
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTMARGINSPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTMARGINSPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTMARGINSPAGE_STYLE
);
65 ~wxRichTextMarginsPage();
67 /// Initialises member variables
70 /// Creates the controls and sizers
71 void CreateControls();
73 /// Gets the attributes from the formatting dialog
74 wxRichTextAttr
* GetAttributes();
77 virtual bool TransferDataToWindow();
78 virtual bool TransferDataFromWindow();
80 ////@begin wxRichTextMarginsPage event handler declarations
82 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_MARGIN
83 void OnRichtextLeftMarginUpdate( wxUpdateUIEvent
& event
);
85 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_MARGIN
86 void OnRichtextRightMarginUpdate( wxUpdateUIEvent
& event
);
88 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_MARGIN
89 void OnRichtextTopMarginUpdate( wxUpdateUIEvent
& event
);
91 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_MARGIN
92 void OnRichtextBottomMarginUpdate( wxUpdateUIEvent
& event
);
94 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_PADDING
95 void OnRichtextLeftPaddingUpdate( wxUpdateUIEvent
& event
);
97 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_PADDING
98 void OnRichtextRightPaddingUpdate( wxUpdateUIEvent
& event
);
100 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_PADDING
101 void OnRichtextTopPaddingUpdate( wxUpdateUIEvent
& event
);
103 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_PADDING
104 void OnRichtextBottomPaddingUpdate( wxUpdateUIEvent
& event
);
106 ////@end wxRichTextMarginsPage event handler declarations
108 ////@begin wxRichTextMarginsPage member function declarations
110 /// Retrieves bitmap resources
111 wxBitmap
GetBitmapResource( const wxString
& name
);
113 /// Retrieves icon resources
114 wxIcon
GetIconResource( const wxString
& name
);
115 ////@end wxRichTextMarginsPage member function declarations
117 /// Should we show tooltips?
118 static bool ShowToolTips();
120 ////@begin wxRichTextMarginsPage member variables
121 wxCheckBox
* m_leftMarginCheckbox
;
122 wxTextCtrl
* m_marginLeft
;
123 wxComboBox
* m_unitsMarginLeft
;
124 wxCheckBox
* m_rightMarginCheckbox
;
125 wxTextCtrl
* m_marginRight
;
126 wxComboBox
* m_unitsMarginRight
;
127 wxCheckBox
* m_topMarginCheckbox
;
128 wxTextCtrl
* m_marginTop
;
129 wxComboBox
* m_unitsMarginTop
;
130 wxCheckBox
* m_bottomMarginCheckbox
;
131 wxTextCtrl
* m_marginBottom
;
132 wxComboBox
* m_unitsMarginBottom
;
133 wxCheckBox
* m_leftPaddingCheckbox
;
134 wxTextCtrl
* m_paddingLeft
;
135 wxComboBox
* m_unitsPaddingLeft
;
136 wxCheckBox
* m_rightPaddingCheckbox
;
137 wxTextCtrl
* m_paddingRight
;
138 wxComboBox
* m_unitsPaddingRight
;
139 wxCheckBox
* m_topPaddingCheckbox
;
140 wxTextCtrl
* m_paddingTop
;
141 wxComboBox
* m_unitsPaddingTop
;
142 wxCheckBox
* m_bottomPaddingCheckbox
;
143 wxTextCtrl
* m_paddingBottom
;
144 wxComboBox
* m_unitsPaddingBottom
;
145 /// Control identifiers
147 ID_WXRICHTEXTMARGINSPAGE
= 10750,
148 ID_RICHTEXT_LEFT_MARGIN_CHECKBOX
= 10751,
149 ID_RICHTEXT_LEFT_MARGIN
= 10752,
150 ID_RICHTEXT_LEFT_MARGIN_UNITS
= 10753,
151 ID_RICHTEXT_RIGHT_MARGIN_CHECKBOX
= 10754,
152 ID_RICHTEXT_RIGHT_MARGIN
= 10755,
153 ID_RICHTEXT_RIGHT_MARGIN_UNITS
= 10756,
154 ID_RICHTEXT_TOP_MARGIN_CHECKBOX
= 10757,
155 ID_RICHTEXT_TOP_MARGIN
= 10758,
156 ID_RICHTEXT_TOP_MARGIN_UNITS
= 10759,
157 ID_RICHTEXT_BOTTOM_MARGIN_CHECKBOX
= 10760,
158 ID_RICHTEXT_BOTTOM_MARGIN
= 10761,
159 ID_RICHTEXT_BOTTOM_MARGIN_UNITS
= 10762,
160 ID_RICHTEXT_LEFT_PADDING_CHECKBOX
= 10763,
161 ID_RICHTEXT_LEFT_PADDING
= 10764,
162 ID_RICHTEXT_LEFT_PADDING_UNITS
= 10765,
163 ID_RICHTEXT_RIGHT_PADDING_CHECKBOX
= 10766,
164 ID_RICHTEXT_RIGHT_PADDING
= 10767,
165 ID_RICHTEXT_RIGHT_PADDING_UNITS
= 10768,
166 ID_RICHTEXT_TOP_PADDING_CHECKBOX
= 10769,
167 ID_RICHTEXT_TOP_PADDING
= 10770,
168 ID_RICHTEXT_TOP_PADDING_UNITS
= 10771,
169 ID_RICHTEXT_BOTTOM_PADDING_CHECKBOX
= 10772,
170 ID_RICHTEXT_BOTTOM_PADDING
= 10773,
171 ID_RICHTEXT_BOTTOM_PADDING_UNITS
= 10774
173 ////@end wxRichTextMarginsPage member variables
175 bool m_ignoreUpdates
;
179 // _RICHTEXTMARGINSPAGE_H_