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: WximgszFrame.wxc 12 */ 13 14 /** @file WximgszFrame.h Header file for the WximgszFrame module. 15 */ 16 17 #ifndef WXIMGSZFRAME_H_INCLUDED 18 /** Avoid multiple inclusions. */ 19 #define WXIMGSZFRAME_H_INCLUDED 1 20 21 22 23 24 class WximgszFrame : public Dk4WxFrame 25 { 26 private: 27 28 /** Event table for frame. 29 */ 30 DECLARE_EVENT_TABLE() 31 32 protected: 33 34 /** Auto start controller. 35 */ 36 Dk4WxAutostartController cas; 37 38 /** Dark red text colour for group labels. 39 */ 40 wxColour cLabelRed; 41 42 /** Light red background for table cells. 43 */ 44 wxColour cRed; 45 46 /** Light green background for table cells. 47 */ 48 wxColour cGreen; 49 50 /** Yellow background for table cells. 51 */ 52 wxColour cYellow; 53 54 /** Text colour for table cells. 55 */ 56 wxColour cBlack; 57 58 /** Image file name to process on autostart. 59 */ 60 wxString sImageFileName; 61 62 /** Directory previous image file was read from. 63 */ 64 wxString sDirectory; 65 66 /** Localized texts. 67 */ 68 wxChar const * const *sTexts; 69 70 /** Non-localized texts. 71 */ 72 wxChar const * const *sNlWx; 73 74 /** Non-localized texts. 75 */ 76 dkChar const * const *sNlDk; 77 78 /* __CHANGE__ 011: Add further member variables. 79 */ 80 81 /** Maximum number of items in grid. 82 */ 83 int maxpass; 84 85 /** Have image file name. 86 */ 87 bool bImageFileName; 88 89 /** Flag: Application should still respond to onidle. 90 */ 91 bool bActive; 92 93 /** Process the file name which was specified on command line. 94 */ 95 void 96 ProcessSpecifiedFileName(void); 97 98 /** Flag: GUI ok. 99 */ 100 bool dkctGUILayoutOK; 101 102 /** Contents panel. 103 */ 104 wxPanel *dkctGUIContentsPanel; 105 106 /** GUI element mainSizer. 107 */ 108 wxBoxSizer *mainSizer; 109 110 /** GUI element mbMain. 111 */ 112 wxMenuBar *mbMain; 113 114 /** GUI element menuFile. 115 */ 116 wxMenu *menuFile; 117 118 /** GUI element menuHelp. 119 */ 120 wxMenu *menuHelp; 121 122 /** GUI element miFileOpen. 123 */ 124 wxMenuItem *miFileOpen; 125 126 /** GUI element miFileExit. 127 */ 128 wxMenuItem *miFileExit; 129 130 /** GUI element miHelpAbout. 131 */ 132 wxMenuItem *miHelpAbout; 133 134 /** GUI element miHelpContents. 135 */ 136 wxMenuItem *miHelpContents; 137 138 /** GUI element verticalSizer. 139 */ 140 wxBoxSizer *verticalSizer; 141 142 /** GUI element contentsSizer. 143 */ 144 wxBoxSizer *contentsSizer; 145 146 /** GUI element inputSizer. 147 */ 148 wxGridBagSizer *inputSizer; 149 150 /** GUI element runButtonSizer. 151 */ 152 wxBoxSizer *runButtonSizer; 153 154 /** GUI element resultSizer. 155 */ 156 wxBoxSizer *resultSizer; 157 158 /** GUI element lInput. 159 */ 160 wxStaticText *lInput; 161 162 /** GUI element lInputWidth. 163 */ 164 wxStaticText *lInputWidth; 165 166 /** GUI element spInputWidth. 167 */ 168 wxSpinCtrl *spInputWidth; 169 170 /** GUI element lInputHeight. 171 */ 172 wxStaticText *lInputHeight; 173 174 /** GUI element spInputHeight. 175 */ 176 wxSpinCtrl *spInputHeight; 177 178 /** GUI element lChange. 179 */ 180 wxStaticText *lChange; 181 182 /** GUI element lOperation. 183 */ 184 wxStaticText *lOperation; 185 186 /** GUI element cbOperation. 187 */ 188 wxChoice *cbOperation; 189 190 /** GUI element lOperationMin. 191 */ 192 wxStaticText *lOperationMin; 193 194 /** GUI element spOperationMin. 195 */ 196 wxSpinCtrl *spOperationMin; 197 198 /** GUI element lOperationMax. 199 */ 200 wxStaticText *lOperationMax; 201 202 /** GUI element spOperationMax. 203 */ 204 wxSpinCtrl *spOperationMax; 205 206 /** GUI element bRun. 207 */ 208 wxBitmapButton *bRun; 209 210 /** GUI element lResults. 211 */ 212 wxStaticText *lResults; 213 214 /** GUI element tResult. 215 */ 216 wxGrid *tResult; 217 218 219 public: 220 221 /** Window IDs used in main window (frame). 222 */ 223 enum { 224 ID_FRAME = (wxID_HIGHEST + 1), /**< Frame. */ 225 ID_HELP_ABOUT , /**< Open information dialog box. */ 226 ID_HELP_TOC , /**< Open help table of contents. */ 227 ID_BUTTON_RUN , /**< Button to run calculation. */ 228 ID_CHOICE_OP , /**< Choice box for operation. */ 229 }; 230 231 /** Maximum number of passes. 232 */ 233 enum { 234 MAXPASS = 2000 235 }; 236 237 /** Maximum image dimension adjustable in spin control. 238 */ 239 enum { 240 /** Maximum image dimension adjustable in spin control. 241 */ 242 MAXIMGDIM = 65535 243 }; 244 245 /** Constructor. 246 @param wxid Window ID. 247 @param applicationHelper Application helper object. 248 @param hc Help controller for online help. 249 @param argc Number of command line arguments. 250 @param argv Command line arguments array. 251 @param localizedTexts Localized wxChar texts. 252 @param nlWx Non-localized wxChar texts. 253 @param nlDk Non-localized dkChar texts. 254 */ 255 WximgszFrame( 256 int wxid, 257 Dk4WxApplicationHelper *applicationHelper, 258 Dk4WxHelpController *hc, 259 int argc, 260 wxChar **argv, 261 wxChar const * const *localizedTexts, 262 wxChar const * const *nlWx, 263 dkChar const * const *nlDk 264 ); 265 266 /** Destructor. 267 */ 268 ~WximgszFrame(); 269 270 /** Check whether we can close the window. 271 @param isLast Flag: Last main window to close. 272 */ 273 bool 274 CanClose(bool isFinal); 275 276 /** Handler for File/Open. 277 @param event Event to process. 278 */ 279 void 280 OnFileOpen(wxCommandEvent & event); 281 282 /** Handler for File/Exit. 283 @param event Event to process. 284 */ 285 void 286 OnQuit(wxCommandEvent & event); 287 288 /** Handler for Help/About. 289 @param event Event to process. 290 */ 291 void 292 OnAbout(wxCommandEvent & event); 293 294 /** Handler for Help/Contents. 295 @param event Event to process. 296 */ 297 void 298 OnHelpContents(wxCommandEvent & event); 299 300 /** Do the calculations and update table. 301 */ 302 void 303 Calculations(void); 304 305 /** Handler for Run button. 306 @param event Event to process. 307 */ 308 void 309 OnButtonRun(wxCommandEvent & event); 310 311 /** Handler for operations choice box. 312 @param event Event to process. 313 */ 314 void 315 OnChoiceOperation(wxCommandEvent & event); 316 317 /* __CHANGE__ 008: Remove OnIdle if no idle processing required. 318 */ 319 /** Handler for idle events. 320 */ 321 void 322 OnIdle(wxIdleEvent & event); 323 324 /* __CHANGE__ 017: Event handlers for further events. 325 */ 326 327 /* __CHANGE__ 014: Add further methods. 328 */ 329 330 /** Activate or deactivate idle processing. 331 @param fl Flag to activate/deactivate. 332 */ 333 void 334 ActivateIdleProcessing(bool fl = true); 335 336 }; 337 338 339 340 /* vim: set ai sw=4 ts=4 : */ 341 342 #endif 343