summaryrefslogtreecommitdiff
path: root/support/dktools/ScreenSizeFrame.wxc
blob: 72ec946f7a13874d266b06a32e22144242d594bb (plain)
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
%%	options

copyright owner	=	Dirk Krause
copyright year	=	2017
license			=	bsd



%%	wx-gui

type		= 	frame
contents	=	mainSizer
icon		=	wxdkscrsz_icon
status bar	=	1 sTexts[8]
menu bar	=	mbMain

[wxMenuBar mbMain]
contents	=	menuFile
contents	=	menuHelp

[wxMenu menuFile]
text		=	sTexts[0]
contents	=	miFileExit

[wxMenuItem miFileExit]
id			=	ScreenSizeFrame_Quit
text		=	sTexts[1]
tip			=	sTexts[2]

[wxMenu menuHelp]
text		=	sTexts[3]
contents	=	miHelpAbout
contents	=	miHelpContents

[wxMenuItem miHelpAbout]
id			=	ScreenSizeFrame_Help_About
text		=	sTexts[4]
tip			=	sTexts[5]

[wxMenuItem miHelpContents]
id			=	ScreenSizeFrame_Help_Contents
text		=	sTexts[6]
tip			=	sTexts[7]

[wxBoxSizer mainSizer]
direction	=	horizontal
contents	=	$space(10)
contents	=	verticalSizer
contents	=	$space(10)

[wxBoxSizer verticalSizer]
direction	=	vertical
grow		=	yes
proportion	=	1
contents	=	$space(10)
contents	=	contentsSizer
contents	=	$space(10)

[wxGridBagSizer contentsSizer]
grid		=	5 5
contents	=	lOldSize	 0	 0	 1	 2	centered-x
contents	=	lOldWidth	+1	 0	 1	 1	right
contents	=	vOldWidth	 .	 1	 1	 1	left
contents	=	lOldHeight	+1	 0	 1	 1	right
contents	=	vOldHeight	 .	 1	 1	 1	left
contents	=	$space(1,5)	+1	 0	 1	 1	left
contents	=	lNewSize	+1	 0	 1	 2	centered-x
contents	=	lNewWidth	+1	 0	 1	 1	right
contents	=	vNewWidth	 .	 1	 1	 1	left
contents	=	lNewHeight	+1	 0	 1	 1	right
contents	=	vNewHeight	 .	 1	 1	 1	left
contents	=	$space(1,5)	+1	 0	 1	 1	left
contents	=	lResult		+1	 0	 1	 2	centered-x
contents	=	lSsc		+1   0   1   1	right
contents	=	lSsr		 .	 1	 1	 1	left

[wxStaticText lOldSize]
text		=	sTexts[25]
text style	=	centered

[wxStaticText lOldWidth]
text		=	sTexts[26]
text style	=	right

[wxStaticText vOldWidth]
text		=	sTexts[28]
text style	=	left

[wxStaticText lOldHeight]
text		=	sTexts[27]
text style	=	right

[wxStaticText vOldHeight]
text		=	sTexts[28]
text style	=	left

[wxStaticText lNewSize]
text		=	sTexts[29]
text style	=	centered

[wxStaticText lNewWidth]
text		=	sTexts[26]
text style	=	right

[wxStaticText vNewWidth]
text		=	sTexts[28]
text style	=	left

[wxStaticText lNewHeight]
text		=	sTexts[27]
text style	=	right

[wxStaticText vNewHeight]
text		=	sTexts[28]
text style	=	left

[wxStaticText lResult]
text		=	sTexts[30]
text style	=	centered

[wxStaticText lSsc]
text		=	sTexts[13]
text style	=	right

[wxStaticText lSsr]
text		=	sTexts[14]
text style	=	left


%%	header start


#include <Dk4WxAutostartController.h>


enum {
								/**	Set new screen size.
								*/
	ACTION_SET_SCREEN_SIZE		= 0 ,

								/**	Toggle between normal and alternative size.
								*/
	ACTION_TOGGLE_SCREEN_SIZE ,

	ACTION_REPORT_NO_ARGS_NO_SETTINGS
};

%%	class start
class ScreenSizeFrame : public Dk4WxFrame
{
	private:

		/**	Event table for frame.
		*/
		DECLARE_EVENT_TABLE()

	protected:

		/**	Controller to start activity at first idle event.
		*/
		Dk4WxAutostartController	oAsc;

		/**	Color to indicate success.
		*/
		wxColour				 cGreen;

		/**	Color to indicate failure.
		*/
		wxColour				 cRed;

		/**	Localized texts.
		*/
		wxChar const * const	*sTexts;

		/**	Non-localized texts.
		*/
		wxChar const * const	*sNlWx;

		/**	Non-localized texts.
		*/
		dkChar const * const	*sNlDk;

		/**	Private copy of the argv arguments.
		*/
		wxChar					**ppArgv;

		/*	__CHANGE__ 011:	Add further member variables.
		*/


		/**	Private copy of the argc arguments.
		*/
		int						 iArgc;

		/**	Flag: Process idle events.
		*/
		bool					 bActive;

%%	class end

	private:

		void
		ShowUnusableText(const wxChar *str);

	protected:

		/**	Do the real work in the screen size change.
			@param	ulp		Address of array containing screen sizes.
			@param	action	Action to perform (set or toggle).
			@return	True on success, false on error.
		*/
		bool
		ModifyScreenSize(const unsigned long *ulp, int action);

	public:

		/**	Constructor.
			@param	wxid				Window ID.
			@param	applicationHelper	Application helper object.
			@param	hc					Help controller for online help.
			@param	argc				Number of command line arguments.
			@param	argv				Command line arguments array.
			@param	localizedTexts		Localized wxChar texts.
			@param	nlWx				Non-localized wxChar texts.
			@param	nlDk				Non-localized dkChar texts.
		*/
		ScreenSizeFrame(
			int						  wxid,
			Dk4WxApplicationHelper	 *applicationHelper,
			Dk4WxHelpController		 *hc,
			int						  argc,
			wxChar					**argv,
			wxChar const * const	 *localizedTexts,
			wxChar const * const	 *nlWx,
			dkChar const * const	 *nlDk
		);

		/**	Destructor.
		*/
		~ScreenSizeFrame();

		/**	Check whether we can close the window.
			@param	isLast	Flag: Last main window to close.
		*/
		bool
		CanClose(bool isFinal);

		/**	Handler for File/Exit.
			@param	event	Event to process.
		*/
		void
		OnQuit(wxCommandEvent & event);

		/**	Handler for Help/About.
			@param	event	Event to process.
		*/
		void
		OnAbout(wxCommandEvent & event);

		/**	Handler for Help/Contents.
			@param	event	Event to process.
		*/
		void
		OnHelpContents(wxCommandEvent & event);

		/*	__CHANGE__ 008:	Remove OnIdle if no idle processing required.
		*/
		/**	Handler for idle events.
		*/
		void
		OnIdle(wxIdleEvent & event);

		/*	__CHANGE__ 017:	Event handlers for further events.
		*/

		/*	__CHANGE__ 014:	Add further methods.
		*/


		/**	Change the screen size.
			@return	True on success, false on error.
		*/
		bool
		ChangeScreenSize(void);

};

%%	header end

/* vim: set ai sw=4 ts=4 : */

%%	module start

#define	AUTO_EXIT_ONLY_ON_SUCCESS	1


#include "dk4mem.h"
#include "wxdkscrsz.h"
#include <dk4maixdul.h>
#include "dk4maoxd.h"

#if !defined(__WXMSW__)
#include "wxdkscrsz.xpm"
#endif



$!trace-include



static const wxChar * const	settingsNames[] = {
$!string-table	macro=wxT
screen.size.normal.width
screen.size.normal.height
screen.size.alternative.width
screen.size.alternative.height
$!end
};


/*	__CHANGE__ 017: Add further events. */
/*	__CHANGE__ 008: Remove OnIdle if no idle processing required. */
BEGIN_EVENT_TABLE(ScreenSizeFrame, wxFrame)
	EVT_MENU(ScreenSizeFrame_Quit, ScreenSizeFrame::OnQuit)
	EVT_MENU(ScreenSizeFrame_Help_About, ScreenSizeFrame::OnAbout)
	EVT_MENU(ScreenSizeFrame_Help_Contents, ScreenSizeFrame::OnHelpContents)
	EVT_IDLE(ScreenSizeFrame::OnIdle)
END_EVENT_TABLE()



%%	constructor start
ScreenSizeFrame::ScreenSizeFrame(
	int						  wxid,
	Dk4WxApplicationHelper	 *applicationHelper,
	Dk4WxHelpController		 *hc,
	int						  argc,
	wxChar					**argv,
	wxChar const * const	 *localizedTexts,
	wxChar const * const	 *nlWx,
	dkChar const * const	 *nlDk
) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
	cGreen(0, 127, 0),
	cRed(127, 0, 0)
{
	/*	__CHANGE__ 012:	Add further local variables.
	*/

	/*	__CHANGE__ 012: Initialize further local variables.
	*/

	sTexts = localizedTexts;
	sNlWx  = nlWx;
	sNlDk  = nlDk;
#if defined(__WXMSW__)
	wxIcon	wxdkscrsz_icon(sNlWx[4]);
#else
	wxIcon	wxdkscrsz_icon(xpm_wxdkscrsz);
#endif
	
	/*	__CHANGE__ 011:	Initialize further class members.
	*/
	bActive = true;
	iArgc = argc;
	ppArgv = argv;

%%	constructor end
	if(dkctGUILayoutOK) {
		SetTitle(nlWx[0]);
#if 0
		RestorePosition();
#endif
		oAsc.SetAutoStart(true);
		oAsc.SetAutoExit(true);
	}

	/*	__CHANGE__ 012:	Release resources allocated by local variables.
	*/
}

%%	module end



ScreenSizeFrame::~ScreenSizeFrame()
{

	/*	__CHANGE__ 011:	Release resources allocated by further class members.
	*/
}



bool
ScreenSizeFrame::CanClose(bool isLast)
{
	bool		back	= true;

	/*	__CHANGE__ 013: Check for unsaved data.
	*/

	return back;
}


void
ScreenSizeFrame::OnQuit(wxCommandEvent & event)
{
	Close();
}



void
ScreenSizeFrame::OnAbout(wxCommandEvent & event)
{
	wxString	text(wxT(""));
	wxString	title(wxT(""));

	/* Construct message text. */
	text.Append(sNlWx[0]);
	text.Append(sNlWx[7]);
	text.Append(sNlWx[1]);
	text.Append(sNlWx[8]);
	text.Append(sTexts[9]);
	text.Append(sNlWx[2]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[8]);
	text.Append(sTexts[11]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[9]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[8]);
	text.Append(sTexts[12]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[10]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[11]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[12]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[13]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[14]);
	text.Append(sNlWx[8]);
	text.Append(sNlWx[15]);
	text.Append(sNlWx[8]);
	
	/* Construct dialog box title. */
	title.Append(sTexts[10]);
	title.Append(sNlWx[0]);

	/* Show dialog box. */
	wxMessageBox(text, title);

	/*	__CHANGE__ 019:	Create better about box.
	*/
}



void
ScreenSizeFrame::OnHelpContents(wxCommandEvent & event)
{
	DisplayContents();
}

/*	__CHANGE__ 017:	Event handlers for further events.
*/

/*	__CHANGE__ 014:	Implementation of further methods.
*/

#if	DK4_ON_WINDOWS
/**	Current device mode.
*/
static	DEVMODE		 devmode;
/**	New device mode.
*/
static	DEVMODE		 newmode;
#endif

bool
ScreenSizeFrame::ModifyScreenSize(const unsigned long *ulp, int action)
{
	wxChar		 b1[64];
	wxChar		 b2[64];
	wxChar		 b3[64];
	wxChar		 b4[64];
#if	DK4_ON_WINDOWS
	DWORD		 dmfm	= (DM_PELSWIDTH | DM_PELSHEIGHT);
	DWORD		 dwfl	= 0;
	LONG		 res	= 0L;
#endif
	bool		 back	= false;

	dk4ma_write_wx_decimal_unsigned(
		b1, DK4_SIZEOF(b1,wxChar), (dk4_um_t)(ulp[0]), 0, NULL
	);
	dk4ma_write_wx_decimal_unsigned(
		b2, DK4_SIZEOF(b2,wxChar), (dk4_um_t)(ulp[1]), 0, NULL
	);
	dk4ma_write_wx_decimal_unsigned(
		b3, DK4_SIZEOF(b3,wxChar), (dk4_um_t)(ulp[2]), 0, NULL
	);
	dk4ma_write_wx_decimal_unsigned(
		b4, DK4_SIZEOF(b4,wxChar), (dk4_um_t)(ulp[3]), 0, NULL
	);
	switch (action) {
		case ACTION_TOGGLE_SCREEN_SIZE : {
			vOldWidth->SetLabel(b3);
			vOldHeight->SetLabel(b4);
			vNewWidth->SetLabel(b1);
			vNewHeight->SetLabel(b2);
		} break;
		default : {
			vNewWidth->SetLabel(b1);
			vNewHeight->SetLabel(b2);
		} break;
	}
	Refresh();
	Update();
#if DK4_ON_WINDOWS
	SecureZeroMemory(&devmode, sizeof(DEVMODE));
	SecureZeroMemory(&newmode, sizeof(DEVMODE));
	if (EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode)) {
		if (dmfm == (dmfm & (devmode.dmFields))) {
			DK4_MEMCPY(&newmode, &devmode, sizeof(DEVMODE));

			dk4ma_write_wx_decimal_unsigned(
				b1, DK4_SIZEOF(b1,wxChar),
				(dk4_um_t)(devmode.dmPelsWidth), 0, NULL
			);
			dk4ma_write_wx_decimal_unsigned(
				b2, DK4_SIZEOF(b2,wxChar),
				(dk4_um_t)(devmode.dmPelsHeight), 0, NULL
			);
			vOldWidth->SetLabel(b1);
			vOldHeight->SetLabel(b2);
			Refresh();
			Update();
			switch (action) {
				case ACTION_TOGGLE_SCREEN_SIZE : {
					if (ulp[0] == devmode.dmPelsWidth) {
						if (ulp[1] == devmode.dmPelsHeight) {
							newmode.dmPelsWidth = ulp[2];
							newmode.dmPelsHeight = ulp[3];
							vOldWidth->SetLabel(b1);
							vOldHeight->SetLabel(b2);
							vNewWidth->SetLabel(b3);
							vNewHeight->SetLabel(b4);
							Refresh();
							Update();
						}
						else {
							newmode.dmPelsWidth = ulp[0];
							newmode.dmPelsHeight = ulp[1];
						}
					}
					else {
						newmode.dmPelsWidth = ulp[0];
						newmode.dmPelsHeight = ulp[1];
					}
				} break;
				default : {
					newmode.dmPelsWidth = ulp[0];
					newmode.dmPelsHeight = ulp[1];
				} break;
			}
			newmode.dmFields |= dmfm;
			res = ChangeDisplaySettingsEx(NULL, &newmode, NULL, dwfl, NULL);
			if (DISP_CHANGE_SUCCESSFUL == res) {
				back = true;
			}
			else {
				/* ERROR: Failed to change screen size */
				wxMessageBox(
					sTexts[20], sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR)
				);
			}
		}
		else {
			/* ERROR: Failed to retrieve current settings */
			wxMessageBox(
				sTexts[19], sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR)
			);
		}
	}
	else {
		/* ERROR: Failed to retrieve current settings */
		wxMessageBox(
			sTexts[19], sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR)
		);
	}
#else
	wxMessageBox(
		sTexts[21], sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR)
	);
	back = false;
#endif
	return back;
}


void
ScreenSizeFrame::ShowUnusableText(const wxChar *str)
{
	wxString	s(sTexts[22]);
	s.Append(str);
	s.Append(sTexts[23]);
	wxMessageBox(s, sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR));
}



bool
ScreenSizeFrame::ChangeScreenSize(void)
{
	const wxChar	*ep		= NULL;
	long		 	 lv[]	= { 0L, 0L, 0L, 0L };
	unsigned long	 ulv[]	= { 0UL, 0UL, 0UL, 0UL };
	int				 action	= ACTION_SET_SCREEN_SIZE;
	int				 res	= 0;
	bool			 back	= false;
	bool			 found	= false;
	$? "+ ScreenSizeFrame::ChangeScreenSize"
	switch (iArgc) {
		case 5 : {
			back = true;
			ep = NULL;
			res = dk4ma_input_wx_dec_ulong(&(ulv[0]), ppArgv[1], &ep, 1, NULL);
			if (0 == res) {
				back = false;
				ShowUnusableText(ppArgv[1]);
			}
			if (back) {
				ep = NULL;
				res = dk4ma_input_wx_dec_ulong(&(ulv[1]),ppArgv[2],&ep,1,NULL);
				if (0 == res) {
					ShowUnusableText(ppArgv[2]);
					back = false;
				}
			}
			if (back) {
				ep = NULL;
				res = dk4ma_input_wx_dec_ulong(&(ulv[2]),ppArgv[3],&ep,1,NULL);
				if (0 == res) {
					ShowUnusableText(ppArgv[3]);
					back = false;
				}
			}
			if (back) {
				ep = NULL;
				res = dk4ma_input_wx_dec_ulong(&(ulv[3]),ppArgv[4],&ep,1,NULL);
				if (0 == res) {
					ShowUnusableText(ppArgv[4]);
					back = false;
				}
			}
			if (back) {
				back = ModifyScreenSize(ulv, ACTION_TOGGLE_SCREEN_SIZE);
			}
		} break;
		case 3 : {
			back = true;
			ep = NULL;
			res = dk4ma_input_wx_dec_ulong(&(ulv[0]), ppArgv[1], &ep, 1, NULL);
			if (0 == res) {
				ShowUnusableText(ppArgv[1]);
				back = false;
			}
			if (back) {
				ep = NULL;
				res = dk4ma_input_wx_dec_ulong(&(ulv[1]),ppArgv[2],&ep,1,NULL);
				if (0 == res) {
					ShowUnusableText(ppArgv[2]);
					back = false;
				}
			}
			if (back) {
				back = ModifyScreenSize(ulv, ACTION_SET_SCREEN_SIZE);
			}
		} break;
		case 1 : {
			action = ACTION_REPORT_NO_ARGS_NO_SETTINGS;
			if (pAppHelp->GetMultiple(settingsNames, lv, 4)) {
				if (0L < lv[0]) {
					if (0L < lv[1]) {
						if (0L < lv[2]) {
							if (0L < lv[3]) {
								ulv[0] = (unsigned long)(lv[0]);
								ulv[1] = (unsigned long)(lv[1]);
								ulv[2] = (unsigned long)(lv[2]);
								ulv[3] = (unsigned long)(lv[3]);
								found  = true;
								back = ModifyScreenSize(
									ulv, ACTION_TOGGLE_SCREEN_SIZE
								);
							}
						}
						else {
							ulv[0] = (unsigned long)(lv[0]);
							ulv[1] = (unsigned long)(lv[1]);
							found  = true;
							back = ModifyScreenSize(
								ulv, ACTION_SET_SCREEN_SIZE
							);
						}
					}
				}
			}
			else {
			}
			if (!(found)) {
				wxMessageBox(
					sTexts[24], sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR)
				);
			}
		} break;
		default : {
			wxMessageBox(
				sTexts[24], sTexts[18], (wxOK | wxCENTRE | wxICON_ERROR)
			);
		} break;
	}

	finished:
	if (back) {
		lSsr->SetLabel(sTexts[16]);
		lSsr->SetForegroundColour(cGreen);
	}
	else {
		lSsr->SetLabel(sTexts[17]);
		lSsr->SetForegroundColour(cRed);
	}
	Refresh();
	Update();
	$? "- ScreenSizeFrame::ChangeScreenSize %d", (back ? 1 : 0)
	return back;
}


/*	__CHANGE__ 008:	Remove OnIdle if no idle processing required.
*/

void
ScreenSizeFrame::OnIdle(wxIdleEvent & event)
{
#if	AUTO_EXIT_ONLY_ON_SUCCESS
	bool	bSuccess;
#endif
	$? "+ ScreenSizeFrame::OnIdle"
	/* __CHANGE__
	*/
	if (bActive) {
		switch (oAsc.GetReaction()) {
#if 0
			case DK4WX_AUTOSTART_REACTION_IGNORE : {
			} break;
#endif
			case DK4WX_AUTOSTART_REACTION_START : {
				oAsc.StartProcessing();
#if AUTO_EXIT_ONLY_ON_SUCCESS
				bSuccess = ChangeScreenSize();
				oAsc.EndProcessing(bSuccess);
#else
				(void)ChangeScreenSize();
				oAsc.EndProcessing(true);
#endif
			} break;
			case DK4WX_AUTOSTART_REACTION_MORE : {
			} break;
			case DK4WX_AUTOSTART_REACTION_EXIT : {
				bActive = false;
				Close();
			} break;
		}
		event.RequestMore();
	}
	$? "- ScreenSizeFrame::OnIdle"
	event.Skip();
}


/* vim: set ai sw=4 ts=4 : */