1 /*
2 Copyright (C) 2019-2021, Dirk Krause
3 SPDX-License-Identifier: BSD-3-Clause
4 */
5 
6 /*
7 	WARNING: This file was generated by the dkct program (see
8 	http://dktools.sourceforge.net/ for details).
9 	Changes you make here will be lost if dkct is run again!
10 	You should modify the original source and run dkct on it.
11 	Original source: WxdkdrawDlgArrowSize.wxc
12 */
13 
14 /**	@file WxdkdrawDlgArrowSize.h Header file for the WxdkdrawDlgArrowSize module.
15 */
16 
17 #ifndef WXDKDRAWDLGARROWSIZE_H_INCLUDED
18 /** Avoid multiple inclusions. */
19 #define WXDKDRAWDLGARROWSIZE_H_INCLUDED 1
20 
21 
22 #ifndef	WXDKDRAW_H_INCLUDED
23 #include <wxdkdraw/wxdkdraw.h>
24 #endif
25 
26 #ifndef	WXDKDRAWFRAME_H_INCLUDED
27 #include <wxdkdraw/WxdkdrawFrame.h>
28 #endif
29 
30 
31 
32 /**	The arrow size dialog asks the user to set arrow length and
33 	width in multiples of the line width.
34 */
35 class WxdkdrawDlgArrowSize : public wxDialog
36 {
37 
38 	private:
39 
40 		/**	Events to handle.
41 		*/
42 #if	wxCHECK_VERSION(3,0,0)
43 		wxDECLARE_EVENT_TABLE();
44 #else
45 		DECLARE_EVENT_TABLE()
46 #endif
47 
48 	protected:
49 
50 		/**	Parent frame (the programs main window).
51 		*/
52 		WxdkdrawFrame	*m_pParent;
53 
54 		/**	Graphics object the arrowhead is attached to.
55 		*/
56 		Wxd_object_t	*m_pObject;
57 
58 		/**	Arrow length.
59 		*/
60 		uint8_t			 m_uLengthOriginal;
61 
62 		/**	Arrow width.
63 		*/
64 		uint8_t			 m_uWidthOriginal;
65 
66 		/**	Arrow length.
67 		*/
68 		uint8_t			 m_uLengthCurrent;
69 
70 		/**	Arrow width.
71 		*/
72 		uint8_t			 m_uWidthCurrent;
73 
74 		/**	Flag: Changing a real drawing element.
75 		*/
76 		bool			 m_bDrwElem;
77 
78 		/**	Flag: Changing backward arrow (false for forward arrow).
79 		*/
80 		bool			 m_bBackward;
81 
82 	public:
83 
84 		/**	Window IDs.
85 		*/
86 		enum {
87 			WXD_ID_AS_LENGTH = (wxID_HIGHEST + 1),	/**< Length spin ctrl. */
88 			WXD_ID_AS_WIDTH							/**< Width spin ctrl. */
89 		};
90 
91 
92 		/**	Constructor.
93 			@param	pParent		Applications main frame.
94 			@param	pObject		Object to modify.
95 			@param	pTexts		Localized text fragments.
96 			@param	bDrwElem	Flag: Changing real drawing element.
97 			@param	bBackward	Flag: Changing backward arrow.
98 		*/
99 		WxdkdrawDlgArrowSize(
100 			WxdkdrawFrame			*pParent,
101 			Wxd_object_t			*pObject,
102 			wxChar const * const	*pTexts,
103 			bool					 bDrwElem,
104 			bool					 bBackward
105 		);
106 
107 		/**	OK button handler.
108 			@param	event	Event to process.
109 		*/
110 		void
111 		OnOK(wxCommandEvent & event);
112 
113 		/**	Cancel button handler.
114 			@param	event	Event to process.
115 		*/
116 		void
117 		OnCancel(wxCommandEvent & event);
118 
119 		/**	Length spin control handler.
120 			@param	event	Event to process.
121 		*/
122 		void
123 		OnLength(wxSpinEvent & event);
124 
125 		/**	Width spin control handler.
126 			@param	event	Event to process.
127 		*/
128 		void
129 		OnWidth(wxSpinEvent & event);
130 
131 #if	0
132 		/**	Retrieve arrow length.
133 			@return	Arrow length.
134 		*/
135 		uint8_t
136 		GetArrowLength(void) const;
137 
138 		/**	Retrieve arrow width.
139 			@return	Arrow width.
140 		*/
141 		uint8_t
142 		GetArrowWidth(void) const;
143 #endif
144 
145 	protected:
146 
147 		void
148 		TransferLength(void);
149 
150 		void
151 		TransferWidth(void);
152 
153     /**	Flag: GUI ok.
154     */
155     bool dkctGUILayoutOK;
156 
157     /**	GUI element sizerHorizontal.
158     */
159     wxBoxSizer *sizerHorizontal;
160 
161     /**	GUI element sizerVertical.
162     */
163     wxBoxSizer *sizerVertical;
164 
165     /**	GUI element sizerContents.
166     */
167     wxGridBagSizer *sizerContents;
168 
169     /**	GUI element sizerButtons.
170     */
171     wxStdDialogButtonSizer *sizerButtons;
172 
173     /**	GUI element labelLength.
174     */
175     wxStaticText *labelLength;
176 
177     /**	GUI element spinLength.
178     */
179     wxSpinCtrl *spinLength;
180 
181     /**	GUI element labelWidth.
182     */
183     wxStaticText *labelWidth;
184 
185     /**	GUI element spinWidth.
186     */
187     wxSpinCtrl *spinWidth;
188 
189     /**	GUI element buttonOK.
190     */
191     wxButton *buttonOK;
192 
193     /**	GUI element buttonCancel.
194     */
195     wxButton *buttonCancel;
196 
197 };
198 
199 
200 
201 
202 #endif
203