-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIMG2ANS.BAS
850 lines (739 loc) · 24.4 KB
/
IMG2ANS.BAS
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
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
': This program uses
': InForm GUI engine for QB64-PE - v1.5.3
': Fellippe Heitor, (2016 - 2022) - @FellippeHeitor
': Samuel Gomes, (2023 - 2024) - @a740g
': https://github.com/a740g/InForm-PE
'-----------------------------------------------------------
_ALLOWFULLSCREEN _OFF
': Controls' IDs: ------------------------------------------------------------------
'WINDOW
DIM SHARED IMG2ANS AS LONG
'H:HEADER
DIM SHARED H_IMG2ANSLB AS LONG
DIM SHARED H_VersionLB AS LONG
DIM SHARED H_CodeIdeaLB AS LONG
DIM SHARED H_CodeIdeaAuthorLB AS LONG
DIM SHARED H_LinksLB AS LONG
'SI:SOURCE IMAGE
DIM SHARED SI_SourceImgLB AS LONG
DIM SHARED SI_SourceImgBrowseButtonBT AS LONG
DIM SHARED SI_SourceImgClearButtonBT AS LONG
DIM SHARED SI_SourceImgPB AS LONG
DIM SHARED SI_SourceImgBrightnessLB AS LONG
DIM SHARED SI_SourceImgBrightnessSlider AS LONG
DIM SHARED SI_SourceImgBrightnessTB AS LONG
DIM SHARED SI_SourceImgContrastLB AS LONG
DIM SHARED SI_SourceImgContrastSlider AS LONG
DIM SHARED SI_SourceImgContrastTB AS LONG
DIM SHARED SI_SourceImgPosterizeLB AS LONG
DIM SHARED SI_SourceImgPosterizeSlider AS LONG
DIM SHARED SI_SourceImgPosterizeTB AS LONG
'DP:DESTINATION PALETTE
DIM SHARED DP_DestPalCB AS LONG
DIM SHARED DP_DestPalPB AS LONG
DIM SHARED DP_DestPalPalleteDL AS LONG
DIM SHARED DP_DestPalPalleteBrowseBT AS LONG
DIM SHARED DP_DestPalPaletteColorsPB AS LONG
'RC:RESIZE / CROP
DIM SHARED RC_ResizeCropCB AS LONG
DIM SHARED RC_ResizeCropPB AS LONG
DIM SHARED RC_ResizeCropXLB AS LONG
DIM SHARED RC_ResizeCropXTB AS LONG
DIM SHARED RC_ResizeCrop80x25BT AS LONG
DIM SHARED RC_ResizeCrop80x50BT AS LONG
DIM SHARED RC_ResizeCrop132x100BT AS LONG
DIM SHARED RC_ResizeCropYLB AS LONG
DIM SHARED RC_ResizeCropYTB AS LONG
DIM SHARED RC_ResizeCropWLB AS LONG
DIM SHARED RC_ResizeCropWTB AS LONG
DIM SHARED RC_ResizeCropHLB AS LONG
DIM SHARED RC_ResizeCropHTB AS LONG
DIM SHARED RC_ResizeCropZoomLB AS LONG
DIM SHARED RC_ResizeCropZoomSlider AS LONG
'P:PREVIEW
DIM SHARED P_PreviewLB AS LONG
DIM SHARED P_PreviewPB AS LONG
'S:SAUCE
DIM SHARED S_SauceFrame AS LONG
DIM SHARED S_ColorsFrame AS LONG
DIM SHARED S_SauceTitleLB AS LONG
DIM SHARED S_SauceTitleTB AS LONG
DIM SHARED S_SauceAuthorLB AS LONG
DIM SHARED S_SauceAuthorTB AS LONG
DIM SHARED S_SauceGroupLB AS LONG
DIM SHARED S_SauceGroupTB AS LONG
DIM SHARED S_SauceCommentLB AS LONG
DIM SHARED S_SauceCommentTB AS LONG
DIM SHARED S_SauceFontSize8pxRB AS LONG
DIM SHARED S_SauceFontSize16pxRB AS LONG
DIM SHARED S_Sauce9pxWidthCB AS LONG
DIM SHARED S_SauceiCEColorsRB AS LONG
DIM SHARED S_SauceRGBColorsRB AS LONG
'E:EXPORT
DIM SHARED E_ExportToImgSrcDirRB AS LONG
DIM SHARED E_ExportToDirRB AS LONG
DIM SHARED E_ExportToDirTB AS LONG
DIM SHARED E_ExportToDirBrowseButtonBT AS LONG
DIM SHARED E_ExportAsFileLB AS LONG
DIM SHARED E_ExportAsFileTB AS LONG
DIM SHARED E_ExportBT AS LONG
'ST:STATUS
DIM SHARED ST_StatusFrame AS LONG
DIM SHARED ST_StatusLB AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'IMG2ANS.BI'
'$INCLUDE:'include/InForm-PE/InForm/InForm.bi'
'$INCLUDE:'include/InForm-PE/InForm/xp.uitheme'
'$INCLUDE:'IMG2ANS.FRM'
': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit
END SUB
SUB __UI_OnLoad
__UI_DefaultButtonID = SI_SourceImgBrowseButtonBT
END SUB
SUB __UI_BeforeUpdateDisplay
'This event occurs at approximately 60 frames per second.
'You can change the update frequency by calling SetFrameRate DesiredRate%
' An integer 2D vector
TYPE Vector2LType
x AS LONG
y AS LONG
END TYPE
' A 2D rectangle
TYPE RectangleLType
a AS Vector2LType ' left-top
b AS Vector2LType ' right-bottom
END TYPE
' This keeps all related stuff neatly considated
TYPE MouseManagerType
position AS Vector2LType ' mouse position
leftButton AS _BYTE ' raw mouse left button
rightButton AS _BYTE ' raw mouse right button
leftButtonDown AS _BYTE ' mouse left button held down?
rightButtonDown AS _BYTE ' mouse right button held down?
leftClicked AS _BYTE ' If this is true mouseLeftButtonClickedRectangle is the rectangle where the click happened
rightClicked AS _BYTE ' If this is true mouseRightButtonClickedRectangle is the rectangle where the click happened
leftButtonClickedRectangle AS RectangleLType ' the rectangle where the mouse left button was clicked
rightButtonClickedRectangle AS RectangleLType ' the rectangle where the mouse left button was clicked
wheel AS LONG
END TYPE
' These are a rectangle region the represent click event
STATIC MouseManager AS MouseManagerType
' Mouse input loop
IF __UI_HasInput THEN
' Mouse input handling (thanks @a740g!)
IMOUSE_update
' Capture raw mouse position
MouseManager.position.x = __UI_MouseLeft
MouseManager.position.y = __UI_MouseTop
' Capture raw mouse button state
MouseManager.leftButton = __UI_MouseButton1
MouseManager.rightButton = __UI_MouseButton2
' Capure raw wheel info
MouseManager.wheel = __UI_MouseWheel
' Check if the left button were previously held down and update the up position if released
IF NOT MouseManager.leftButton AND MouseManager.leftButtonDown THEN
MouseManager.leftButtonDown = FALSE
MouseManager.leftButtonClickedRectangle.b = MouseManager.position
MouseManager.leftClicked = TRUE
END IF
' Check if the button were previously held down and update the up position if released
IF NOT MouseManager.rightButton AND MouseManager.rightButtonDown THEN
MouseManager.rightButtonDown = FALSE
MouseManager.rightButtonClickedRectangle.b = MouseManager.position
MouseManager.rightClicked = TRUE
END IF
' Check if the mouse button was pressed and update the down position
IF MouseManager.leftButton AND NOT MouseManager.leftButtonDown THEN
MouseManager.leftButtonDown = TRUE
MouseManager.leftButtonClickedRectangle.a = MouseManager.position
MouseManager.leftClicked = FALSE
END IF
' Check if the mouse button was pressed and update the down position
IF MouseManager.rightButton AND NOT MouseManager.rightButtonDown THEN
MouseManager.rightButtonDown = TRUE
MouseManager.rightButtonClickedRectangle.a = MouseManager.position
MouseManager.rightClicked = FALSE
END IF
' Log the mouse action
IF MouseManager.leftButtonDown THEN
console.box "DRAGGING", 10
END IF
IF MouseManager.leftClicked THEN
console.box "DROPPING", 12
console.box "Rect = (" + _TRIM$(STR$(MouseManager.LeftButtonClickedRectangle.a.x)) + "," + _
_TRIM$(STR$(MouseManager.LeftButtonClickedRectangle.a.y)) + ") - (" + _
_TRIM$(STR$(MouseManager.LeftButtonClickedRectangle.b.x)) + "," + _
_TRIM$(STR$(MouseManager.LeftButtonClickedRectangle.a.y)) + ")", 12
MouseManager.leftClicked = FALSE ' consume the click event!
END IF
IF MouseManager.wheel <> 0 THEN
console.box "MOUSEWHEEL=" + _TRIM$(STR$(MouseManager.wheel)), 3
END IF
END IF
END SUB
SUB __UI_BeforeUnload
'If you set __UI_UnloadSignal = False here you can
'cancel the user's request to close.
END SUB
SUB __UI_Click (id AS LONG)
SELECT CASE id
'H:HEADER
CASE H_IMG2ANSLB
open_url_in_browser "https://github.com/grymmjack/img2ans"
CASE H_VersionLB
CASE H_CodeIdeaLB
CASE H_CodeIdeaAuthorLB
CASE H_LinksLB
open_url_in_browser "https://www.youtube.com/grymmjack"
'SI:SOURCE IMAGE
CASE SI_SourceImgLB
CASE SI_SourceImgBrowseButtonBT
CALL LoadImageIntoPB( _
SourceIMG, _
SI_SourceImgPB, _
_STARTDIR$ + "/resources/images/tests-external/" _
)
CASE SI_SourceImgClearButtonBT
ClearPBs
CASE SI_SourceImgPB
SetImgFocus SI_SourceImgPB
CASE SI_SourceImgBrightnessLB
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastLB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeLB
CASE SI_SourceImgPosterizeSlider
CASE SI_SourceImgPosterizeTB
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPB
SetImgFocus DP_DestPalPB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
LoadGPLFile BrowseForGPLFile$(_STARTDIR$ + "/resources/palettes/")
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropPB
SetImgFocus RC_ResizeCropPB
CASE RC_ResizeCropXLB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYLB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWLB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHLB
CASE RC_ResizeCropHTB
CASE RC_ResizeCrop80x25BT
SetCropSize 80, 25
CASE RC_ResizeCrop80x50BT
SetCropSize 80, 50
CASE RC_ResizeCrop132x100BT
SetCropSize 132, 100
'P:PREVIEW
CASE P_PreviewLB
CASE P_PreviewPB
SetImgFocus P_PreviewPB
'S:SAUCE
CASE S_SauceFrame
CASE S_ColorsFrame
CASE S_SauceTitleLB
CASE S_SauceTitleTB
CASE S_SauceAuthorLB
CASE S_SauceAuthorTB
CASE S_SauceGroupLB
CASE S_SauceGroupTB
CASE S_SauceCommentLB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileLB
CASE E_ExportAsFileTB
CASE E_ExportBT
'ST:STATUS
CASE ST_StatusFrame
CASE ST_StatusLB
END SELECT
END SUB
SUB __UI_MouseEnter (id AS LONG)
SELECT CASE id
'H:HEADER
CASE H_IMG2ANSLB
CASE H_VersionLB
CASE H_CodeIdeaLB
CASE H_CodeIdeaAuthorLB
CASE H_LinksLB
'SI:SOURCE IMAGE
CASE SI_SourceImgLB
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgPB
CALL console.log("Entering SourceImg")
SourceIMG.has_mouse%% = TRUE
CASE SI_SourceImgBrightnessLB
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastLB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeLB
CASE SI_SourceImgPosterizeSlider
CASE SI_SourceImgPosterizeTB
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropPB
CASE RC_ResizeCropXLB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYLB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWLB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHLB
CASE RC_ResizeCropHTB
'P:PREVIEW
CASE P_PreviewLB
CASE P_PreviewPB
'S:SAUCE
CASE S_SauceFrame
CASE S_ColorsFrame
CASE S_SauceTitleLB
CASE S_SauceTitleTB
CASE S_SauceAuthorLB
CASE S_SauceAuthorTB
CASE S_SauceGroupLB
CASE S_SauceGroupTB
CASE S_SauceCommentLB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileLB
CASE E_ExportAsFileTB
CASE E_ExportBT
'ST:STATUS
CASE ST_StatusFrame
CASE ST_StatusLB
END SELECT
END SUB
SUB __UI_MouseLeave (id AS LONG)
SELECT CASE id
'H:HEADER
CASE H_IMG2ANSLB
CASE H_VersionLB
CASE H_CodeIdeaLB
CASE H_CodeIdeaAuthorLB
CASE H_LinksLB
'SI:SOURCE IMAGE
CASE SI_SourceImgLB
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgPB
CALL console.log("Leaving SourceImg")
SourceIMG.has_mouse%% = FALSE
CASE SI_SourceImgBrightnessLB
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastLB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeLB
CASE SI_SourceImgPosterizeSlider
CASE SI_SourceImgPosterizeTB
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropPB
CASE RC_ResizeCropXLB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYLB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWLB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHLB
CASE RC_ResizeCropHTB
'P:PREVIEW
CASE P_PreviewLB
CASE P_PreviewPB
'S:SAUCE
CASE S_SauceFrame
CASE S_ColorsFrame
CASE S_SauceTitleLB
CASE S_SauceTitleTB
CASE S_SauceAuthorLB
CASE S_SauceAuthorTB
CASE S_SauceGroupLB
CASE S_SauceGroupTB
CASE S_SauceCommentLB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileLB
CASE E_ExportAsFileTB
CASE E_ExportBT
'ST:STATUS
CASE ST_StatusFrame
CASE ST_StatusLB
END SELECT
END SUB
SUB __UI_FocusIn (id AS LONG)
SELECT CASE id
'SI:SOURCE IMAGE
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeSlider
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHTB
'S:SAUCE
CASE S_SauceTitleTB
CASE S_SauceAuthorTB
CASE S_SauceGroupTB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileTB
CASE E_ExportBT
END SELECT
END SUB
SUB __UI_FocusOut (id AS LONG)
'This event occurs right before a control loses focus.
'To prevent a control from losing focus, set __UI_KeepFocus = True below.
SELECT CASE id
'SI:SOURCE IMAGE
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
Control(SI_SourceImgBrightnessSlider).Value = clamp_int(INT(VAL(Text(id))), 0, 100)
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
Control(SI_SourceImgContrastSlider).Value = clamp_int(INT(VAL(Text(id))), 0, 100)
CASE SI_SourceImgPosterizeSlider
CASE SI_SourceImgPosterizeTB
Control(SI_SourceImgPosterizeSlider).Value = clamp_int(INT(VAL(Text(id))), 0, 100)
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHTB
'S:SAUCE
CASE S_SauceTitleTB
CASE S_SauceAuthorTB
CASE S_SauceGroupTB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileTB
CASE E_ExportBT
END SELECT
END SUB
SUB __UI_MouseDown (id AS LONG)
SELECT CASE id
'H:HEADER
CASE H_IMG2ANSLB
CASE H_VersionLB
CASE H_CodeIdeaLB
CASE H_CodeIdeaAuthorLB
CASE H_LinksLB
'SI:SOURCE IMAGE
CASE SI_SourceImgLB
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgPB
CALL console.log("MOUSEDOWN on SourceImg")
CASE SI_SourceImgBrightnessLB
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastLB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeLB
CASE SI_SourceImgPosterizeSlider
CASE SI_SourceImgPosterizeTB
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropPB
CASE RC_ResizeCropXLB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYLB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWLB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHLB
CASE RC_ResizeCropHTB
'P:PREVIEW
CASE P_PreviewLB
CASE P_PreviewPB
'S:SAUCE
CASE S_SauceFrame
CASE S_ColorsFrame
CASE S_SauceTitleLB
CASE S_SauceTitleTB
CASE S_SauceAuthorLB
CASE S_SauceAuthorTB
CASE S_SauceGroupLB
CASE S_SauceGroupTB
CASE S_SauceCommentLB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileLB
CASE E_ExportAsFileTB
CASE E_ExportBT
'ST:STATUS
CASE ST_StatusFrame
CASE ST_StatusLB
END SELECT
END SUB
SUB __UI_MouseUp (id AS LONG)
SELECT CASE id
'H:HEADER
CASE H_IMG2ANSLB
CASE H_VersionLB
CASE H_CodeIdeaLB
CASE H_CodeIdeaAuthorLB
CASE H_LinksLB
'SI:SOURCE IMAGE
CASE SI_SourceImgLB
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgPB
CALL console.log("MOUSEUP on SourceImg")
CASE SI_SourceImgBrightnessLB
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastLB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeLB
CASE SI_SourceImgPosterizeSlider
CASE SI_SourceImgPosterizeTB
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropPB
CASE RC_ResizeCropXLB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYLB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWLB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHLB
CASE RC_ResizeCropHTB
'P:PREVIEW
CASE P_PreviewLB
CASE P_PreviewPB
'S:SAUCE
CASE S_SauceFrame
CASE S_ColorsFrame
CASE S_SauceTitleLB
CASE S_SauceTitleTB
CASE S_SauceAuthorLB
CASE S_SauceAuthorTB
CASE S_SauceGroupLB
CASE S_SauceGroupTB
CASE S_SauceCommentLB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportToDirBrowseButtonBT
CASE E_ExportAsFileLB
CASE E_ExportAsFileTB
CASE E_ExportBT
'ST:STATUS
CASE ST_StatusFrame
CASE ST_StatusLB
END SELECT
END SUB
SUB __UI_KeyPress (id AS LONG)
console.box CHR$(__UI_KeyHit), 14
'When this event is fired, __UI_KeyHit will contain the code of the key hit.
'You can change it and even cancel it by making it = 0
SELECT CASE id
'SI:SOURCE IMAGE
CASE SI_SourceImgBrowseButtonBT
CASE SI_SourceImgClearButtonBT
CASE SI_SourceImgBrightnessSlider
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastSlider
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeSlider
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
CASE DP_DestPalPalleteDL
CASE DP_DestPalPalleteBrowseBT
CASE DP_DestPalPaletteColorsPB
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHTB
'S:SAUCE
CASE S_SauceTitleTB
CASE S_SauceAuthorTB
CASE S_SauceGroupTB
CASE S_SauceCommentTB
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
CASE E_ExportToDirTB
CASE E_ExportAsFileTB
END SELECT
END SUB
SUB __UI_TextChanged (id AS LONG)
SELECT CASE id
'SI:SOURCE IMAGE
CASE SI_SourceImgBrightnessTB
CASE SI_SourceImgContrastTB
CASE SI_SourceImgPosterizeTB
'RC:RESIZE / CROP
CASE RC_ResizeCropXTB
CASE RC_ResizeCropYTB
CASE RC_ResizeCropWTB
CASE RC_ResizeCropHTB
'S:SAUCE
CASE S_SauceTitleTB
CASE S_SauceAuthorTB
CASE S_SauceGroupTB
CASE S_SauceCommentTB
'E:EXPORT
CASE E_ExportToDirTB
CASE E_ExportAsFileTB
END SELECT
END SUB
SUB __UI_ValueChanged (id AS LONG)
SELECT CASE id
'SI:SOURCE IMAGE
CASE SI_SourceImgBrightnessSlider
Text(SI_SourceImgBrightnessTB) = _TRIM$(STR$(Control(id).Value))
CASE SI_SourceImgContrastSlider
Text(SI_SourceImgContrastTB) = _TRIM$(STR$(Control(id).Value))
CASE SI_SourceImgPosterizeSlider
Text(SI_SourceImgPosterizeTB) = _TRIM$(STR$(Control(id).Value))
'DP:DESTINATION PALETTE
CASE DP_DestPalCB
ChangeDestPal
CASE DP_DestPalPalleteDL
ChangeDestPal
'RC:RESIZE / CROP
CASE RC_ResizeCropCB
'S:SAUCE
CASE S_SauceFontSize8pxRB
CASE S_SauceFontSize16pxRB
CASE S_Sauce9pxWidthCB
CASE S_SauceiCEColorsRB
CASE S_SauceRGBColorsRB
'E:EXPORT
CASE E_ExportToImgSrcDirRB
CASE E_ExportToDirRB
'ST:STATUS
CASE ST_StatusLB
END SELECT
END SUB
SUB __UI_FormResized
END SUB
'$INCLUDE:'include/InForm-PE/InForm/InForm.ui'
'$INCLUDE:'IMG2ANS.BM'