forked from Pulover/PuloversMacroCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MacroCreator.ahk
12877 lines (12323 loc) · 345 KB
/
MacroCreator.ahk
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
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; *****************************
; :: PULOVER'S MACRO CREATOR ::
; *****************************
; "The Complete Automation Tool"
; Author: Pulover [Rodolfo U. Batista]
; Home: http://www.macrocreator.com
; Forum: http://www.autohotkey.com/board/topic/79763-macro-creator
; Version: 4.0.0
; Release Date: September, 2013
; AutoHotkey Version: 1.1.13.00
; Copyright © 2012-2013 Rodolfo U. Batista
; GNU General Public License 3.0 or higher
; <http://www.gnu.org/licenses/gpl-3.0.txt>
/*
Thanks to:
tic (Tariq Porter) for his GDI+ Library.
http://www.autohotkey.com/board/topic/29449-gdi-standard-library
tkoi & majkinetor for the Graphic Buttons function.
http://www.autohotkey.com/board/topic/37147-ilbutton-image-buttons
just me for LV_Colors Class, GuiCtrlAddTab and for updating ILButton to 64bit.
http://www.autohotkey.com/board/topic/88699-class-lv-colors
diebagger and Obi-Wahn for the function to move rows (no longer used).
http://www.autohotkey.com/board/topic/56396-techdemo-move-rows-in-a-listview
Micahs for the base code of the Drag-Rows function.
http://www.autohotkey.com/board/topic/30486-listview-tooltip-on-mouse-hover/?p=280843
Kdoske & trueski for the CSV functions (no longer used).
http://www.autohotkey.com/board/topic/51681-csv-library-lib
http://www.autohotkey.com/board/topic/39392-fairly-elaborate-csv-functions
jaco0646 for the function to make hotkey controls detect other keys.
http://www.autohotkey.com/board/topic/47439-user-defined-dynamic-hotkeys
Laszlo for the Monster function to solve expressions.
http://www.autohotkey.com/board/topic/15675-monster
Jethrow for the IEGet Function.
http://www.autohotkey.com/board/topic/47052-basic-webpage-controls
RaptorX for the Scintilla Wrapper for AHK
http://www.autohotkey.com/board/topic/85928-wrapper-scintilla-wrapper
majkinetor for the Dlg_Color function.
http://www.autohotkey.com/board/topic/49214-ahk-ahk-l-forms-framework-08/
rbrtryn for the ChooseColor function.
http://www.autohotkey.com/board/topic/91229-windows-color-picker-plus/
PhiLho and skwire for the function to Get/Set the order of columns.
http://www.autohotkey.com/board/topic/11926-can-you-move-a-listview-column-programmatically/#entry237340
fincs for GenDocs and SciLexer.dll custom builds.
http://www.autohotkey.com/board/topic/71751-gendocs-v30-alpha002
http://www.autohotkey.com/board/topic/54431-scite4autohotkey-v3004-updated-aug-14-2013/page-58#entry566139
T800 for Html Help utils.
http://www.autohotkey.com/board/topic/17984-html-help-utils
Thiago Talma for some improvements to the code, debugging and many suggestions.
Translation revisions: Snow Flake (Swedish), huyaowen (Chinese Simplified), Jörg Schmalenberger (German).
*/
; Compiler Settings
;@Ahk2Exe-SetName Pulover's Macro Creator
;@Ahk2Exe-SetDescription Pulover's Macro Creator
;@Ahk2Exe-SetVersion 4.0.0
;@Ahk2Exe-SetCopyright Copyright © 2012-2013 Rodolfo U. Batista
;@Ahk2Exe-SetOrigFilename MacroCreator.exe
If A_OSVersion in WIN_NT4,WIN_95,WIN_98,WIN_ME
{
MsgBox This program requires Windows 2000/XP or later.
ExitApp
}
#NoEnv
ListLines Off
#InstallKeybdHook
#MaxThreadsBuffer On
#MaxHotkeysPerInterval 999999999
#HotkeyInterval 9999999999
SetWorkingDir %A_ScriptDir%
SendMode Input
#WinActivateForce
SetTitleMatchMode, 2
SetControlDelay, 1
SetWinDelay, 0
SetKeyDelay, -1
SetMouseDelay, -1
SetBatchLines, -1
FileEncoding, UTF-8
Process, Priority,, High
#NoTrayIcon
Menu, Tray, Tip, Pulovers's Macro Creator
DefaultIcon := (A_IsCompiled) ? A_ScriptFullPath
: (FileExist(A_ScriptDir "\Resources\PMC4_Mult.ico") ? A_ScriptDir "\Resources\PMC4_Mult.ico" : A_AhkPath)
Menu, Tray, Icon, %DefaultIcon%, 1, 1
SciDllPath := (A_IsCompiled) ? (A_ScriptDir "\SciLexer.dll")
: (A_ScriptDir ((A_PtrSize = 8) ? "\SciLexer-x64.dll" : "\SciLexer-x86.dll"))
DllCall("LoadLibrary", "Str", SciDllPath)
IfNotExist, %SciDllPath%
{
MsgBox A required DLL is missing. Please reinstall the application.
ExitApp
}
ResDllPath := A_ScriptDir "\Resources.dll", hIL_Icons := IL_Create(10, 10)
IfNotExist, %ResDllPath%
{
MsgBox A required DLL is missing. Please reinstall the application.
ExitApp
}
ReshInst := DllCall("LoadLibrary", "Str", ResDllPath)
Loop
{
If (!IL_Add(hIL_Icons, ResDllPath, A_Index) && (A_Index > 1))
break
}
CurrentVersion := "4.0.0", ReleaseDate := "September, 2013"
;##### Ini File Read #####
If (!FileExist(A_ScriptDir "\MacroCreator.ini") && !InStr(FileExist(A_AppData "\MacroCreator"), "D"))
FileCreateDir, %A_AppData%\MacroCreator
SettingsFolder := FileExist(A_ScriptDir "\MacroCreator.ini") ? A_ScriptDir : A_AppData "\MacroCreator"
, IniFilePath := SettingsFolder "\MacroCreator.ini", UserVarsPath := SettingsFolder "\UserGlobalVars.ini"
IniRead, Version, %IniFilePath%, Application, Version
IniRead, Lang, %IniFilePath%, Language, Lang
IniRead, AutoKey, %IniFilePath%, HotKeys, AutoKey, F3|F4|F5|F6|F7
IniRead, ManKey, %IniFilePath%, HotKeys, ManKey, |
IniRead, AbortKey, %IniFilePath%, HotKeys, AbortKey, F8
IniRead, PauseKey, %IniFilePath%, HotKeys, PauseKey, F12
IniRead, RecKey, %IniFilePath%, HotKeys, RecKey, F9
IniRead, RecNewKey, %IniFilePath%, HotKeys, RecNewKey, F10
IniRead, RelKey, %IniFilePath%, HotKeys, RelKey, CapsLock
IniRead, FastKey, %IniFilePath%, HotKeys, FastKey, Insert
IniRead, SlowKey, %IniFilePath%, HotKeys, SlowKey, Pause
IniRead, ClearNewList, %IniFilePath%, Options, ClearNewList, 0
IniRead, DelayG, %IniFilePath%, Options, DelayG, 0
IniRead, OnScCtrl, %IniFilePath%, Options, OnScCtrl, 1
IniRead, ShowStep, %IniFilePath%, Options, ShowStep, 1
IniRead, HideMainWin, %IniFilePath%, Options, HideMainWin, 1
IniRead, DontShowPb, %IniFilePath%, Options, DontShowPb, 0
IniRead, DontShowRec, %IniFilePath%, Options, DontShowRec, 0
IniRead, DontShowAdm, %IniFilePath%, Options, DontShowAdm, 0
IniRead, ConfirmDelete, %IniFilePath%, Options, ConfirmDelete, 1
IniRead, ShowTips, %IniFilePath%, Options, ShowTips, 1
IniRead, NextTip, %IniFilePath%, Options, NextTip, 1
IniRead, IfDirectContext, %IniFilePath%, Options, IfDirectContext, None
IniRead, IfDirectWindow, %IniFilePath%, Options, IfDirectWindow, %A_Space%
IniRead, KeepHkOn, %IniFilePath%, Options, KeepHkOn, 0
IniRead, Mouse, %IniFilePath%, Options, Mouse, 1
IniRead, Moves, %IniFilePath%, Options, Moves, 1
IniRead, TimedI, %IniFilePath%, Options, TimedI, 1
IniRead, Strokes, %IniFilePath%, Options, Strokes, 1
IniRead, CaptKDn, %IniFilePath%, Options, CaptKDn, 0
IniRead, MScroll, %IniFilePath%, Options, MScroll, 1
IniRead, WClass, %IniFilePath%, Options, WClass, 1
IniRead, WTitle, %IniFilePath%, Options, WTitle, 1
IniRead, MDelay, %IniFilePath%, Options, MDelay, 0
IniRead, DelayM, %IniFilePath%, Options, DelayM, 10
IniRead, DelayW, %IniFilePath%, Options, DelayW, 333
IniRead, MaxHistory, %IniFilePath%, Options, MaxHistory, 100
IniRead, TDelay, %IniFilePath%, Options, TDelay, 10
IniRead, ToggleC, %IniFilePath%, Options, ToggleC, 0
IniRead, RecKeybdCtrl, %IniFilePath%, Options, RecKeybdCtrl, 0
IniRead, RecMouseCtrl, %IniFilePath%, Options, RecMouseCtrl, 0
IniRead, CoordMouse, %IniFilePath%, Options, CoordMouse, Window
IniRead, SpeedUp, %IniFilePath%, Options, SpeedUp, 2
IniRead, SpeedDn, %IniFilePath%, Options, SpeedDn, 2
IniRead, MouseReturn, %IniFilePath%, Options, MouseReturn, 0
IniRead, ShowProgBar, %IniFilePath%, Options, ShowProgBar, 1
IniRead, ShowBarOnStart, %IniFilePath%, Options, ShowBarOnStart, 0
IniRead, AutoHideBar, %IniFilePath%, Options, AutoHideBar, 0
IniRead, RandomSleeps, %IniFilePath%, Options, RandomSleeps, 0
IniRead, RandPercent, %IniFilePath%, Options, RandPercent, 50
IniRead, DrawButton, %IniFilePath%, Options, DrawButton, RButton
IniRead, OnRelease, %IniFilePath%, Options, OnRelease, 1
IniRead, OnEnter, %IniFilePath%, Options, OnEnter, 0
IniRead, LineW, %IniFilePath%, Options, LineW, 2
IniRead, ScreenDir, %IniFilePath%, Options, ScreenDir, %SettingsFolder%\Screenshots
IniRead, DefaultEditor, %IniFilePath%, Options, DefaultEditor, notepad.exe
IniRead, DefaultMacro, %IniFilePath%, Options, DefaultMacro, %A_Space%
IniRead, StdLibFile, %IniFilePath%, Options, StdLibFile, %A_Space%
IniRead, KeepDefKeys, %IniFilePath%, Options, KeepDefKeys, 0
IniRead, TbNoTheme, %IniFilePath%, Options, TbNoTheme, 0
IniRead, AutoBackup, %IniFilePath%, Options, AutoBackup, 1
IniRead, MultInst, %IniFilePath%, Options, MultInst, 0
IniRead, EvalDefault, %IniFilePath%, Options, EvalDefault, 0
IniRead, CloseAction, %IniFilePath%, Options, CloseAction, %A_Space%
IniRead, ShowLoopIfMark, %IniFilePath%, Options, ShowLoopIfMark, 1
IniRead, ShowActIdent, %IniFilePath%, Options, ShowActIdent, 1
IniRead, LoopLVColor, %IniFilePath%, Options, LoopLVColor, 0xFFFF80
IniRead, IfLVColor, %IniFilePath%, Options, IfLVColor, 0x0080FF
IniRead, VirtualKeys, %IniFilePath%, Options, VirtualKeys, % "
(Join
{LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}
{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{1}{2}{3}{4}{5}{6}{7}{8}{9}{0}
{'}{-}{=}{[}{]}{;}{/}{,}{.}{\}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}
{Del}{Ins}{BS}{Esc}{PrintScreen}{Pause}{Enter}{Tab}{Space}
{Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}
{NumpadDot}{NumpadDiv}{NumpadMult}{NumpadAdd}{NumpadSub}{NumpadIns}{NumpadEnd}{NumpadDown}
{NumpadPgDn}{NumpadLeft}{NumpadClear}{NumpadRight}{NumpadHome}{NumpadUp}{NumpadPgUp}{NumpadDel}
{NumpadEnter}{Browser_Back}{Browser_Forward}{Browser_Refresh}{Browser_Stop}{Browser_Search}
{Browser_Favorites}{Browser_Home}{Volume_Mute}{Volume_Down}{Volume_Up}{Media_Next}{Media_Prev}
{Media_Stop}{Media_Play_Pause}{Launch_Mail}{Launch_Media}{Launch_App1}{Launch_App2}
)"
IniRead, AutoUpdate, %IniFilePath%, Options, AutoUpdate, 1
IniRead, Ex_AbortKey, %IniFilePath%, ExportOptions, Ex_AbortKey, 0
IniRead, Ex_PauseKey, %IniFilePath%, ExportOptions, Ex_PauseKey, 0
IniRead, Ex_SM, %IniFilePath%, ExportOptions, Ex_SM, 1
IniRead, SM, %IniFilePath%, ExportOptions, SM, Input
IniRead, Ex_SI, %IniFilePath%, ExportOptions, Ex_SI, 1
IniRead, SI, %IniFilePath%, ExportOptions, SI, Force
IniRead, Ex_ST, %IniFilePath%, ExportOptions, Ex_ST, 1
IniRead, ST, %IniFilePath%, ExportOptions, ST, 2
IniRead, Ex_DH, %IniFilePath%, ExportOptions, Ex_DH, 1
IniRead, Ex_AF, %IniFilePath%, ExportOptions, Ex_AF, 1
IniRead, Ex_HK, %IniFilePath%, ExportOptions, Ex_HK, 0
IniRead, Ex_PT, %IniFilePath%, ExportOptions, Ex_PT, 0
IniRead, Ex_NT, %IniFilePath%, ExportOptions, Ex_NT, 0
IniRead, Ex_SC, %IniFilePath%, ExportOptions, Ex_SC, 1
IniRead, SC, %IniFilePath%, ExportOptions, SC, 1
IniRead, Ex_SW, %IniFilePath%, ExportOptions, Ex_SW, 1
IniRead, SW, %IniFilePath%, ExportOptions, SW, 0
IniRead, Ex_SK, %IniFilePath%, ExportOptions, Ex_SK, 1
IniRead, SK, %IniFilePath%, ExportOptions, SK, -1
IniRead, Ex_MD, %IniFilePath%, ExportOptions, Ex_MD, 1
IniRead, MD, %IniFilePath%, ExportOptions, MD, -1
IniRead, Ex_SB, %IniFilePath%, ExportOptions, Ex_SB, 1
IniRead, SB, %IniFilePath%, ExportOptions, SB, -1
IniRead, Ex_MT, %IniFilePath%, ExportOptions, Ex_MT, 0
IniRead, MT, %IniFilePath%, ExportOptions, MT, 2
IniRead, Ex_IN, %IniFilePath%, ExportOptions, Ex_IN, 1
IniRead, Ex_UV, %IniFilePath%, ExportOptions, Ex_UV, 1
IniRead, Ex_Speed, %IniFilePath%, ExportOptions, Ex_Speed, 0
IniRead, ComCr, %IniFilePath%, ExportOptions, ComCr, 1
IniRead, ComAc, %IniFilePath%, ExportOptions, ComAc, 0
IniRead, Send_Loop, %IniFilePath%, ExportOptions, Send_Loop, 0
IniRead, TabIndent, %IniFilePath%, ExportOptions, TabIndent, 1
IniRead, IncPmc, %IniFilePath%, ExportOptions, IncPmc, 0
IniRead, Exe_Exp, %IniFilePath%, ExportOptions, Exe_Exp, 0
IniRead, ShowExpOpt, %IniFilePath%, ExportOptions, ShowExpOpt, 0
IniRead, MainWinSize, %IniFilePath%, WindowOptions, MainWinSize, W930 H630
IniRead, MainWinPos, %IniFilePath%, WindowOptions, MainWinPos, Center
IniRead, WinState, %IniFilePath%, WindowOptions, WinState, 1
IniRead, ColSizes, %IniFilePath%, WindowOptions, ColSizes, 70,185,335,60,60,100,150,225,85,50
IniRead, ColOrder, %IniFilePath%, WindowOptions, ColOrder, 1,2,3,4,5,6,7,8,9,10
IniRead, PrevWinSize, %IniFilePath%, WindowOptions, PrevWinSize, W450 H500
IniRead, ShowPrev, %IniFilePath%, WindowOptions, ShowPrev, 0
IniRead, TextWrap, %IniFilePath%, WindowOptions, TextWrap, 0
IniRead, CustomColors, %IniFilePath%, WindowOptions, CustomColors, 0
IniRead, OSCPos, %IniFilePath%, WindowOptions, OSCPos, X0 Y0
IniRead, OSTrans, %IniFilePath%, WindowOptions, OSTrans, 255
IniRead, OSCaption, %IniFilePath%, WindowOptions, OSCaption, 0
IniRead, UserLayout, %IniFilePath%, ToolbarOptions, UserLayout
IniRead, MainLayout, %IniFilePath%, ToolbarOptions, MainLayout
IniRead, MacroLayout, %IniFilePath%, ToolbarOptions, MacroLayout
IniRead, FileLayout, %IniFilePath%, ToolbarOptions, FileLayout
IniRead, RecPlayLayout, %IniFilePath%, ToolbarOptions, RecPlayLayout
IniRead, SettingsLayout, %IniFilePath%, ToolbarOptions, SettingsLayout
IniRead, CommandLayout, %IniFilePath%, ToolbarOptions, CommandLayout
IniRead, EditLayout, %IniFilePath%, ToolbarOptions, EditLayout
IniRead, ShowBands, %IniFilePath%, ToolbarOptions, ShowBands, 1,1,1,1,1,1,1,1,1
If (Version < 4)
ShowTips := 1, NextTip := 1
User_Vars := new ObjIni(UserVarsPath)
User_Vars.Read()
LangCodes := { Id: ["0421"]
, Ms: ["043e","083e"]
, Ca: ["0403"]
, Da: ["0406"]
, De: ["0407","0807","0c07","1007","1407"]
, Es: ["040a","080a","0c0a","100a","140a","180a","1c0a","200a","240a","280a","2c0a","300a","340a","380a","3c0a","400a","440a","480a","4c0a","500a"]
, Fr: ["040c","080c","0c0c","100c","140c","180c"]
, Hr: ["041a"]
, It: ["0410","0810"]
, Hu: ["040e"]
, Nl: ["0413","0813"]
, No: ["0414","0814"]
, Pl: ["0415"]
, Pt: ["0416","0816"]
, Sl: ["0424"]
, Sk: ["041b"]
, Fi: ["040b"]
, Sv: ["041d","081d"]
, Vi: ["042a"]
, Tr: ["041f"]
, Cs: ["0405"]
, El: ["0408"]
, Bg: ["0402"]
, Ru: ["0419"]
, Sr: ["1c1a","0c1a"]
, Uk: ["0422"]
, Zh: ["0804","0c04","1004","1404","0004","7c04"]
, Zt: ["0404"]
, Ja: ["0411"]
, Ko: ["0412"]}
If (Lang = "ERROR")
{
For La, Array in LangCodes
{
For L, Code in Array
{
If (A_Language = Code)
{
Lang := La
break
}
}
}
If (Lang = "ERROR")
Lang := "En"
}
GoSub, WriteSettings
CurrentLang := Lang
, Lang_Id := "Bahasa Indonesia`t(Indonesian)"
, Lang_Ms := "Bahasa Malaysia`t(Malay)"
, Lang_Ca := "Català`t(Catalan)"
, Lang_Da := "Dansk`t(Danish)"
, Lang_De := "Deutsch`t(German)"
, Lang_En := "English"
, Lang_Es := "Español`t(Spanish)"
, Lang_Fr := "Français`t(French)"
, Lang_Hr := "Hrvatski`t(Croatian)"
, Lang_It := "Italiano`t(Italian)"
, Lang_Hu := "Magyar`t(Hungarian)"
, Lang_Nl := "Nederlands`t(Dutch)"
, Lang_No := "Norsk`t(Norwegian)"
, Lang_Pl := "Polski`t(Polish)"
, Lang_Pt := "Português`t(Portuguese)"
, Lang_Sl := "Slovenski`t(Slovenian)"
, Lang_Sk := "Slovenčina`t(Slovak)"
, Lang_Fi := "Suomi`t(Finnish)"
, Lang_Sv := "Svenska`t(Swedish)"
, Lang_Vi := "Tiếng Việt`t(Vietnamese)"
, Lang_Tr := "Türkçe`t(Turkish)"
, Lang_Cs := "Čeština`t(Czech)"
, Lang_El := "ελληνικά`t(Greek)"
, Lang_Bg := "Български`t(Bulgarian)"
, Lang_Ru := "Русский`t(Russian)"
, Lang_Sr := "Српски`t(Serbian)"
, Lang_Uk := "Україньска`t(Ukrainian)"
, Lang_Zh := "中文(简体)`t(Chinese Simplified)"
, Lang_Zt := "中文(繁體)`t(Chinese Traditional)"
, Lang_Ja := "日本語`t(Japanese)"
, Lang_Ko := "한국어`t(Korean)"
, Lang_All := "
(Join|
Bahasa Indonesia`t(Indonesian)=Id
Bahasa Malaysia`t(Malay)=Ms
Català`t(Catalan)=Ca
Dansk`t(Danish)=Da
Deutsch`t(German)=De
English=En
Español`t(Spanish)=Es
Français`t(French)=Fr
Hrvatski`t(Croatian)=Hr
Italiano`t(Italian)=It
Magyar`t(Hungarian)=Hu
Nederlands`t(Dutch)=Nl
Norsk`t(Norwegian)=No
Polski`t(Polish)=Pl
Português`t(Portuguese)=Pt
Slovenski`t(Slovenian)=Sl
Slovenčina`t(Slovak)=Sk
Suomi`t(Finnish)=Fi
Svenska`t(Swedish)=Sv
Tiếng Việt`t(Vietnamese)=Vi
Türkçe`t(Turkish)=Tr
Čeština`t(Czech)=Cs
ελληνικά`t(Greek)=El
Български`t(Bulgarian)=Bg
Русский`t(Russian)=Ru
Српски`t(Serbian)=Sr
Україньска`t(Ukrainian)=Uk
中文(简体)`t(Chinese Simplified)=Zh
中文(繁體)`t(Chinese Traditional)=Zt
日本語`t(Japanese)=Ja
한국어`t(Korean)=Ko
)"
AppName := "Pulover's Macro Creator"
, HeadLine := "; This script was created using Pulover's Macro Creator"
, PmcHead := "/*"
. "`nPMC File Version " CurrentVersion
. "`n---[Do not edit anything in this section]---`n`n"
If (KeepDefKeys = 1)
DefAutoKey := AutoKey, DefManKey := ManKey
GoSub, LoadLang
#Include <Definitions>
#Include <WordList>
GoSub, ObjCreate
ToggleMode := ToggleC ? "T" : "P"
If (ColSizes = "0,0,0,0,0,0,0,0,0,0")
ColSizes := "70,185,335,60,60,100,150,225,85,50"
Loop, Parse, ColSizes, `,
Col_%A_Index% := A_LoopField
Loop, Parse, ShowBands, `,
ShowBand%A_Index% := A_LoopField
RegRead, DClickSpd, HKEY_CURRENT_USER, Control Panel\Mouse, DoubleClickSpeed
DClickSpd := Round(DClickSpd * 0.001, 1)
;##### Menus: #####
Gui, 1:+LastFound
Gui, 1:Default
Menu, Tray, NoStandard
GoSub, CreateMenuBar
Menu, MouseB, Add, Click, HelpB
Menu, MouseB, Add, ControlClick, HelpB
Menu, MouseB, Add, MouseClickDrag, HelpB
Menu, MouseB, Add
Menu, MouseB, Add, Built-in Variables, HelpB
Menu, MouseB, Icon, Click, %ResDllPath%, 24
Menu, TextB, Add, Send / SendRaw, HelpB
Menu, TextB, Add, ControlSend, HelpB
Menu, TextB, Add, ControlSetText, HelpB
Menu, TextB, Add, Clipboard, HelpB
Menu, TextB, Add
Menu, TextB, Add, Built-in Variables, HelpB
Menu, TextB, Icon, Send / SendRaw, %ResDllPath%, 24
Menu, ControlB, Add, Control, HelpB
Menu, ControlB, Add, ControlFocus, HelpB
Menu, ControlB, Add, ControlGet, HelpB
Menu, ControlB, Add, ControlGetFocus, HelpB
Menu, ControlB, Add, ControlGetPos, HelpB
Menu, ControlB, Add, ControlGetText, HelpB
Menu, ControlB, Add, ControlMove, HelpB
Menu, ControlB, Add, ControlSetText, HelpB
Menu, ControlB, Add
Menu, ControlB, Add, Built-in Variables, HelpB
Menu, ControlB, Icon, Control, %ResDllPath%, 24
Menu, SpecialB, Add, List of Keys, SpecialB
Menu, SpecialB, Icon, List of Keys, %ResDllPath%, 24
Menu, PauseB, Add, Sleep, HelpB
Menu, PauseB, Add
Menu, PauseB, Add, Built-in Variables, HelpB
Menu, PauseB, Icon, Sleep, %ResDllPath%, 24
Menu, MsgboxB, Add, MsgBox, HelpB
Menu, MsgboxB, Add
Menu, MsgboxB, Add, Built-in Variables, HelpB
Menu, MsgboxB, Icon, MsgBox, %ResDllPath%, 24
Menu, KeyWaitB, Add, KeyWait, HelpB
Menu, KeyWaitB, Add
Menu, KeyWaitB, Add, Built-in Variables, HelpB
Menu, KeyWaitB, Icon, KeyWait, %ResDllPath%, 24
Menu, WindowB, Add, WinActivate, HelpB
Menu, WindowB, Add, WinActivateBottom, HelpB
Menu, WindowB, Add, WinClose, HelpB
Menu, WindowB, Add, WinGet, HelpB
Menu, WindowB, Add, WinGetClass, HelpB
Menu, WindowB, Add, WinGetText, HelpB
Menu, WindowB, Add, WinGetTitle, HelpB
Menu, WindowB, Add, WinGetPos, HelpB
Menu, WindowB, Add, WinHide, HelpB
Menu, WindowB, Add, WinKill, HelpB
Menu, WindowB, Add, WinMaximize, HelpB
Menu, WindowB, Add, WinMinimize, HelpB
Menu, WindowB, Add, WinMinimizeAll / WinMinimizeAllUndo, HelpB
Menu, WindowB, Add, WinMove, HelpB
Menu, WindowB, Add, WinRestore, HelpB
Menu, WindowB, Add, WinSet, HelpB
Menu, WindowB, Add, WinShow, HelpB
Menu, WindowB, Add, WinWait, HelpB
Menu, WindowB, Add, WinWaitActive / WinWaitNotActive, HelpB
Menu, WindowB, Add, WinWaitClose, HelpB
Menu, WindowB, Add
Menu, WindowB, Add, Built-in Variables, HelpB
Menu, WindowB, Icon, WinActivate, %ResDllPath%, 24
Menu, ImageB, Add, ImageSearch, HelpB
Menu, ImageB, Add, PixelSearch, HelpB
Menu, ImageB, Add
Menu, ImageB, Add, Built-in Variables, HelpB
Menu, ImageB, Icon, ImageSearch, %ResDllPath%, 24
Loop, Parse, FileCmdList, |
{
If (A_LoopField = "")
continue
If (InStr(A_LoopField, "File")=1 || InStr(A_LoopField, "Drive")=1)
Menu, m_File, Add, %A_LoopField%, HelpB
Else If (InStr(A_LoopField, "Sort")=1 || InStr(A_LoopField, "String")=1
|| InStr(A_LoopField, "Split")=1)
{
If (InStr(A_LoopField, "Left") || InStr(A_LoopField, "Lower"))
{
LastCmd := A_LoopField " / "
continue
}
Else
{
Menu, m_String, Add, %LastCmd%%A_LoopField%, HelpB
LastCmd := ""
}
}
Else If (!InStr(A_LoopField, "Run") && (InStr(A_LoopField, "Wait")
|| (A_LoopField = "Input")))
Menu, m_Wait, Add, %A_LoopField%, HelpB
Else If A_LoopField contains Box,Tip,Progress,Splash
Menu, m_Dialogs, Add, %A_LoopField%, HelpB
Else If (InStr(A_LoopField, "Reg") || InStr(A_LoopField, "Ini")=1)
Menu, m_Registry, Add, %A_LoopField%, HelpB
Else If InStr(A_LoopField, "Sound")=1
Menu, m_Sound, Add, %A_LoopField%, HelpB
Else If InStr(A_LoopField, "Group")=1
Menu, m_Group, Add, %A_LoopField%, HelpB
Else If InStr(A_LoopField, "Env")=1
Menu, m_Vars, Add, %A_LoopField%, HelpB
Else If InStr(A_LoopField, "Get")
Menu, m_Get, Add, %A_LoopField%, HelpB
Else If A_LoopField not contains Run,Process,Shutdown
Menu, m_Misc, Add, %A_LoopField%, HelpB
}
Menu, RunB, Add, Run / RunWait, HelpB
Menu, RunB, Add, RunAs, HelpB
Menu, RunB, Add, Process, HelpB
Menu, RunB, Add, Shutdown, HelpB
Menu, RunB, Add, File, :m_File
Menu, RunB, Add, String, :m_String
Menu, RunB, Add, Get Info, :m_Get
Menu, RunB, Add, Wait, :m_Wait
Menu, RunB, Add, Window Groups, :m_Group
Menu, RunB, Add, Dialogs, :m_Dialogs
Menu, RunB, Add, Reg && Ini, :m_Registry
Menu, RunB, Add, Sound, :m_Sound
Menu, RunB, Add, Variables, :m_Vars
Menu, RunB, Add, Misc., :m_Misc
Menu, RunB, Add
Menu, RunB, Add, Built-in Variables, HelpB
Menu, RunB, Icon, Run / RunWait, %ResDllPath%, 24
Menu, ComLoopB, Add, Loop, LoopB
Menu, ComLoopB, Add, Loop`, FilePattern, LoopB
Menu, ComLoopB, Add, Loop`, Parse, LoopB
Menu, ComLoopB, Add, Loop`, Read File, LoopB
Menu, ComLoopB, Add, Loop`, Registry, LoopB
Menu, ComLoopB, Add, Break, HelpB
Menu, ComLoopB, Add, Continue, HelpB
Menu, ComLoopB, Add
Menu, ComLoopB, Add, Built-in Variables, HelpB
Menu, ComLoopB, Icon, Loop, %ResDllPath%, 24
Menu, ComGotoB, Add, Goto, HelpB
Menu, ComGotoB, Add, Gosub, HelpB
Menu, ComGotoB, Add
Menu, ComGotoB, Add, Built-in Variables, HelpB
Menu, ComGotoB, Icon, Goto, %ResDllPath%, 24
Menu, AddLabelB, Add, Labels, HelpB
Menu, AddLabelB, Add
Menu, AddLabelB, Add, Built-in Variables, HelpB
Menu, AddLabelB, Icon, Labels, %ResDllPath%, 24
Menu, IfStB, Add, IfWinActive / IfWinNotActive, HelpB
Menu, IfStB, Add, IfWinExist / IfWinNotExist, HelpB
Menu, IfStB, Add, IfExist / IfNotExist, HelpB
Menu, IfStB, Add, IfInString / IfNotInString, HelpB
Menu, IfStB, Add, IfMsgBox, HelpB
Menu, IfStB, Add, If Statements, HelpB
Menu, IfStB, Add
Menu, IfStB, Add, Built-in Variables, HelpB
Menu, IfStB, Icon, IfWinActive / IfWinNotActive, %ResDllPath%, 24
Menu, AsVarB, Add, Variables, HelpB
Menu, AsVarB, Add
Menu, AsVarB, Add, Built-in Variables, HelpB
Menu, AsVarB, Icon, Variables, %ResDllPath%, 24
Menu, AsFuncB, Add, Functions, HelpB
Menu, AsFuncB, Add
Menu, AsFuncB, Add, Built-in Variables, HelpB
Menu, AsFuncB, Icon, Functions, %ResDllPath%, 24
Menu, IEComB, Add, COM, IEComB
Menu, IEComB, Add, Basic Webpage COM Tutorial, IEComB
Menu, IEComB, Add, IWebBrowser2 Interface (MSDN), IEComB
Menu, IEComB, Add
Menu, IEComB, Add, Built-in Variables, HelpB
Menu, IEComB, Icon, COM, %ResDllPath%, 24
Menu, SendMsgB, Add, PostMessage / SendMessage, HelpB
Menu, SendMsgB, Add, Message List, SendMsgB
Menu, SendMsgB, Add, Microsoft MSDN, SendMsgB
Menu, SendMsgB, Add
Menu, SendMsgB, Add, Built-in Variables, HelpB
Menu, SendMsgB, Icon, PostMessage / SendMessage, %ResDllPath%, 24
Menu, IfDirB, Add, #IfWinActive / #IfWinExist, HelpB
Menu, IfDirB, Icon, #IfWinActive / #IfWinExist, %ResDllPath%, 24
Menu, ExportG, Add, Hotkeys, ExportG
Menu, ExportG, Add, Hotstrings, ExportG
Menu, ExportG, Add, List of Keys, ExportG
Menu, ExportG, Add, ComObjCreate, ExportG
Menu, ExportG, Add, ComObjActive, ExportG
Menu, ExportG, Add, Auto-execute Section, ExportG
Menu, ExportG, Add, #IfWinActive / #IfWinExist, HelpB
Menu, ExportG, Icon, Hotkeys, %ResDllPath%, 24
Menu, LangMenu, Check, % Lang_%Lang%
;##### Main Window: #####
Gui, +Resize +MinSize310x175 +HwndPMCWinID
Gui, Add, Custom, ClassToolbarWindow32 hwndhTbFile gTbFile 0x0800 0x0100 0x0040 0x0008 0x0004
Gui, Add, Custom, ClassToolbarWindow32 hwndhTbRecPlay gTbRecPlay 0x0800 0x0100 0x0040 0x0008 0x0004
Gui, Add, Custom, ClassToolbarWindow32 hwndhTbCommand gTbCommand 0x0800 0x0100 0x0040 0x0008 0x0004
Gui, Add, Custom, ClassToolbarWindow32 hwndhTbSettings gTbSettings 0x0800 0x0100 0x0040 0x0008 0x0004
Gui, Add, Custom, ClassToolbarWindow32 hwndhTbEdit gTbEdit 0x0800 0x0100 0x0040 0x0008 0x0004
If (TbNoTheme)
Gui, -Theme
Gui, Add, Custom, ClassReBarWindow32 hwndhRbMain vcRbMain gRB_Notify 0x0400 0x0040 0x8000
Gui, +Theme
Gui, Add, Custom, ClassReBarWindow32 hwndhRbMacro vcRbMacro gRB_Notify xm-10 ym+76 -Theme 0x0800 0x0040 0x8000 0x0008 ; 0x0004
Gui, Add, Hotkey, hwndhAutoKey vAutoKey gSaveData, % o_AutoKey[1]
Gui, Add, ListBox, hwndhJoyKey vJoyKey r1 ReadOnly Hidden
; SendMessage, 0x01A0, 0, 22,, ahk_id %hJoyKey%
Gui, Add, Hotkey, hwndhManKey vManKey gWaitKeys Limit190, % o_ManKey[1]
Gui, Add, Hotkey, hwndhAbortKey vAbortKey, %AbortKey%
Gui, Add, Hotkey, hwndhPauseKey vPauseKey, %PauseKey%
Gui, Add, Text, Section -Wrap y+320 xm W85 R1 Right vRepeat, %w_Lang015%:
Gui, Add, Edit, ys-3 x+10 W75 R1 vRept
Gui, Add, UpDown, vTimesM 0x80 Range0-999999999, 1
Gui, Add, Button, -Wrap ys-4 x+0 W25 H23 hwndApplyT vApplyT gApplyT
ILButton(ApplyT, ResDllPath ":" 1)
Gui, Add, Text, W2 H25 ys-3 x+5 0x11 vSeparator1
Gui, Add, Text, -Wrap x+5 ys W85 R1 Right vDelayT, %w_Lang016%:
Gui, Add, Edit, ys-3 x+10 W75 R1 vDelay
Gui, Add, UpDown, vDelayG 0x80 Range0-999999999, %DelayG%
Gui, Add, Button, -Wrap ys-4 x+0 W25 H23 hwndApplyI vApplyI gApplyI
ILButton(ApplyI, ResDllPath ":" 1)
Gui, Add, Text, W2 H25 ys-3 x+5 0x11 vSeparator2
Gui, Add, Hotkey, ys-3 x+5 W150 vsInput
Gui, Add, Button, -Wrap ys-4 x+0 W25 H23 hwndApplyL vApplyL gApplyL
ILButton(ApplyL, ResDllPath ":" 31)
Gui, Add, Button, -Wrap ys-4 x+5 W25 H23 hwndInsertKey vInsertKey gInsertKey
ILButton(InsertKey, ResDllPath ":" 91)
Gui, Add, Text, W2 H25 ys-3 x+5 0x11 vSeparator3
Gui, Add, Text, -Wrap ys x+5 W85 R1 vContextTip gSetWin cBlue, #IfWin: %IfDirectContext%
Gui, Add, Text, W2 H25 ys-3 x+5 0x11 vSeparator4
Gui, Add, Text, -Wrap ys x+5 W105 R1 vCoordTip gOptions, CoordMode: %CoordMouse%
GuiControl,, WinKey, % (InStr(o_AutoKey[1], "#")) ? 1 : 0
Gui, Submit
If (MainWinSize = "W H")
MainWinSize := "W930 H630"
If (MainWinPos = "X Y")
MainWinPos := "Center"
Else If (MainWinPos <> "Center")
{
mGuiX := RegExReplace(MainWinPos, "X(\d+).*", "$1"), mGuiY := RegExReplace(MainWinPos, ".*Y(\d+)", "$1")
If (mGuiX < 0)
mGuiX := 0
If (mGuiY < 0)
mGuiY := 0
If (mGuiX >= A_ScreenWidth) || (mGuiY >= A_ScreenHeight)
MainWinPos := "Center"
Else
MainWinPos := "X" mGuiX " Y" mGuiY
}
Gui, Show, %MainWinSize% %MainWinPos% Hide
GoSub, b_Start
GoSub, DefineControls
GoSub, DefineToolbars
OnMessage(WM_COMMAND, "TB_Messages")
, OnMessage(WM_MOUSEMOVE, "ShowTooltip")
, OnMessage(WM_RBUTTONDOWN, "ShowContextHelp")
, OnMessage(WM_LBUTTONDOWN, "DragToolbar")
, OnMessage(WM_MBUTTONDOWN, "CloseTab")
, OnMessage(WM_ACTIVATE, "WinCheck")
, OnMessage(WM_COPYDATA, "Receive_Params")
, OnMessage(WM_HELP, "CmdHelp")
, OnMessage(0x404, "AHK_NOTIFYICON")
If KeepHkOn
Menu, Tray, Check, %w_Lang014%
If %0%
{
WinGetActiveTitle, LastFoundWin
Loop, %0%
{
Param .= %A_Index% "`n"
If !(t_Macro) && (RegExMatch(%A_Index%, "i)^-s(\d+)*$", t_Macro))
{
AutoPlay := "Macro" t_Macro1
, HideWin := 1, CloseAfterPlay := 1
break
}
If !(t_Macro) && (RegExMatch(%A_Index%, "i)^-a(\d+)*$", t_Macro))
AutoPlay := "Macro" t_Macro1
If (%A_Index% = "-p")
PlayHK := 1
If (%A_Index% = "-h")
HideWin := 1
If !(t_Timer) && (RegExMatch(%A_Index%, "i)^-t(\d*)(!)?$", _t))
TimerPlay := 1, TimerDelayX := (_t1) ? _t1 : 250, TimedRun := RunFirst := (_t2) ? 1 : 0
If (%A_Index% = "-c")
CloseAfterPlay := 1
If (%A_Index% = "-b")
ShowCtrlBar := 1
}
Files := RTrim(Param, "`n")
If !MultInst && (TargetID := WinExist("ahk_exe " A_ScriptFullPath))
{
Send_Params(Files, TargetID)
ExitApp
}
GoSub, OpenFile
}
Else If !MultInst && (TargetID := WinExist("ahk_exe " A_ScriptFullPath))
{
WinActivate, ahk_id %TargetID%
ExitApp
}
Else IfExist, %DefaultMacro%
{
PMC.Import(DefaultMacro)
CurrentFileName := LoadedFileName
GoSub, FileRead
}
Else
{
HistoryMacro1 := new LV_Rows()
HistoryMacro1.Add()
}
Menu, Tray, Icon
Gui, 1:Show, % ((WinState) ? "Maximize" : MainWinSize " " MainWinPos) ((HideWin) ? "Hide" : ""), % (CurrentFileName ? CurrentFileName " - " : "") AppName " v" CurrentVersion
GoSub, LoadData
TB_Edit(tbFile, "Preview", ShowPrev)
, TB_Edit(TbSettings, "HideMainWin", HideMainWin), TB_Edit(TbSettings, "OnScCtrl", OnScCtrl)
, TB_Edit(TbSettings, "CheckHkOn", KeepHkOn), TB_Edit(TbSettings, "SetWin", (IfDirectContext = "None") ? 0 : 1)
Gui, 1:Default
GoSub, RowCheck
If (HideWin)
{
Menu, Tray, Rename, %y_Lang001%, %y_Lang002%
WinActivate, %LastFoundWin%
}
If (ShowCtrlBar)
GoSub, OnScControls
If (PlayHK)
GoSub, PlayStart
If ((AutoPlay) || (TimerPlay))
{
GuiControl, chMacro:Choose, A_List, %t_Macro1%
GoSub, TabSel
If (TimerPlay)
GoSub, TimerOK
Else
GoSub, TestRun
}
Else
{
If (!DontShowAdm && !A_IsAdmin)
{
Gui, 1:+Disabled
Gui, 35:-SysMenu +HwndTipScrID +owner1
Gui, 35:Color, FFFFFF
Gui, 35:Add, Pic, y+20 Icon78 W48 H48, %ResDllPath%
Gui, 35:Add, Text, yp x+10, %d_Lang058%`n
Gui, 35:Add, Checkbox, -Wrap W300 vDontShowAdm R1, %d_Lang053%
Gui, 35:Add, Button, -Wrap Default y+10 W90 H23 gTipClose2, %c_Lang020%
Gui, 35:Show,, %AppName%
WinWaitClose, ahk_id %TipScrID%
Gui, 1:-Disabled
}
If (ShowBarOnStart)
GoSub, ShowControls
If (UserLayout = "Error")
GoSub, Welcome
Else If (ShowTips)
GoSub, ShowTips
If (AutoUpdate)
SetTimer, CheckUpdates, -1
IfExist, %SettingsFolder%\~ActiveProject.pmc
{
Gui, 1:+OwnDialogs
MsgBox, 36, %AppName%, %d_Lang083%
IfMsgBox, Yes
{
Files := SettingsFolder "\~ActiveProject.pmc"
GoSub, OpenFile
CurrentFileName := "", SavePrompt := True
Gui, 1:Show,, %AppName% v%CurrentVersion%
}
}
}
HideWin := "", PlayHK := "", AutoPlay := "", TimerPlay := ""
FreeMemory()
SetTimer, FinishIcon, -1
return
;##### Toolbars #####
DefineToolbars:
TB_Define(TbFile, hTbFile, hIL_Icons, DefaultBar.File, DefaultBar.FileOpt)
, TB_Define(TbRecPlay, hTbRecPlay, hIL_Icons, DefaultBar.RecPlay, DefaultBar.RecPlayOpt)
, TB_Define(TbCommand, hTbCommand, hIL_Icons, DefaultBar.Command, DefaultBar.CommandOpt)
, TB_Define(TbEdit, hTbEdit, hIL_Icons, DefaultBar.Edit, DefaultBar.EditOpt)
, TB_Define(TbSettings, hTbSettings, hIL_Icons, DefaultBar.Settings, DefaultBar.SetOpt)
, TB_Define(TbOSC, hTbOSC, hIL_Icons, FixedBar.OSC, FixedBar.OSCOpt)
, TB_Edit(TbOSC, "ProgBarToggle", ShowProgBar)
, RbMain := New Rebar(hRbMain)
, TB_Rebar(RbMain, TbFile_ID, TbFile), TB_Rebar(RbMain, TbRecPlay_ID, TbRecPlay), TB_Rebar(RbMain, TbCommand_ID, TbCommand)
, RbMain.InsertBand(hTimesCh, 0, "FixedSize NoGripper", 10, w_Lang011 " (" t_Lang004 ")", 75 * (A_ScreenDPI/96), 0, "", 22, 75 * (A_ScreenDPI/96))
, TB_Rebar(RbMain, TbEdit_ID, TbEdit, "Break"), TB_Rebar(RbMain, TbSettings_ID, TbSettings)
, RbMain.InsertBand(hAutoKey, 0, "", 6, w_Lang005, 50, 0, "", 22, 50)
, RbMain.InsertBand(hManKey, 0, "", 7, w_Lang007, 50, 0, "", 22, 50)
, RbMain.InsertBand(hAbortKey, 0, "", 8, w_Lang008, 60, 0, "", 22, 50)
, RbMain.InsertBand(hPauseKey, 0, "", 9, c_Lang003, 60, 0, "", 22, 50)
, RbMain.SetMaxRows(3)
, TBHwndAll := [TbFile, TbRecPlay, TbCommand, TbEdit, TbSettings, tbPrev, tbPrevF, TbOSC]
, RBIndexTB := [1, 2, 3, 4, 5], RBIndexHK := [6, 7, 8, 9]
, Default_Layout := RbMain.GetLayout()
Loop, Parse, Default_Layout, |
l_Band%A_Index% := A_LoopField
If (MainLayout = "ERROR")
{
If (UserLayout = "ERROR")
GoSub, BasicLayout
return
}
Loop, 3
RbMain.SetLayout(MainLayout)
RbMain.ShowBand(RbMain.IDToIndex(1), ShowBand1), RbMain.ShowBand(RbMain.IDToIndex(2), ShowBand2)
, RbMain.ShowBand(RbMain.IDToIndex(3), ShowBand3), RbMain.ShowBand(RbMain.IDToIndex(4), ShowBand4)
, RbMain.ShowBand(RbMain.IDToIndex(5), ShowBand5), RbMain.ShowBand(RbMain.IDToIndex(6), ShowBand6)
, RbMain.ShowBand(RbMain.IDToIndex(7), ShowBand7), RbMain.ShowBand(RbMain.IDToIndex(8), ShowBand8)
, RbMain.ShowBand(RbMain.IDToIndex(9), ShowBand9)
, BtnsArray := []
If (FileLayout <> "ERROR")
TB_Layout(TbFile, FileLayout, TbFile_ID)
If (RecPlayLayout <> "ERROR")
TB_Layout(TbRecPlay, RecPlayLayout, TbRecPlay_ID)
If (CommandLayout <> "ERROR")
TB_Layout(TbCommand, CommandLayout, TbCommand_ID)
If (EditLayout <> "ERROR")
TB_Layout(TbEdit, EditLayout, TbEdit_ID)
If (SettingsLayout <> "ERROR")
TB_Layout(TbSettings, SettingsLayout, TbSettings_ID)
return
TbFile:
TbRecPlay:
TbCommand:
TbSettings:
TbEdit:
TbText:
TbOSC:
tbPrev:
tbPrevF:
If (A_GuiEvent = "N")
{
TbPtr := %A_ThisLabel%
, ErrorLevel := TbPtr.OnNotify(A_EventInfo, MX, MY, bLabel, ID)
If (bLabel)
ShowMenu(bLabel, MX, MY)
If (ErrorLevel = 2) ; TBN_RESET
{
TB_Edit(TbFile, "Preview", ShowPrev), TB_Edit(TbSettings, "HideMainWin", HideMainWin)
, TB_Edit(TbSettings, "OnScCtrl", OnScCtrl), TB_Edit(TbSettings, "CheckHkOn", KeepHkOn)
, TB_Edit(TbSettings, "SetWin", (IfDirectContext = "None") ? 0 : 1)
, TB_Edit(TbSettings, "SetJoyButton", JoyHK), TB_Edit(TbOSC, "ProgBarToggle", ShowProgBar)
, TB_Edit(TbSettings, "OnFinish",(OnFinishCode = 1) ? 0 : 1,,, (OnFinishCode = 1) ? 20 : 62)
}
Else If (ErrorLevel = 1)
TB_IdealSize(TbPtr, %A_ThisLabel%_ID)
}
return
RB_Notify:
If (A_GuiEvent = "N")
{
rbEventCode := NumGet(A_EventInfo + (A_PtrSize * 2), 0, "Int")
If (RbMain.OnNotify(A_EventInfo, tbMX, tbMY, BandID))
ShowChevronMenu(RbMain, BandID, tbMX, tbMY)
Else If (RbMacro.OnNotify(A_EventInfo, tbMX, tbMY, BandID))
ShowChevronMenu(RbMacro, BandID, tbMX)
If (rbEventCode = -831) ; RBN_HEIGHTCHANGE
{
RowsCount := RbMain.GetRowCount()
MacroOffset := (RowsCount = 2) ? 88 : ((RowsCount = 1) ? 63 : 118)
GuiControl, 1:Move, cRbMacro, % (RowsCount = 2) ? "y55" : (RowsCount = 1 ? "y30" : "y85")
GoSub, GuiSize
}
If (rbEventCode = -835) ; RBN_BEGINDRAG
OnMessage(WM_NOTIFY, ""), LV_Colors.Detach(ListID%A_List%)
If (rbEventCode = -836) ; RBN_ENDDRAG
{
GoSub, RowCheck
GoSub, chMacroGuiSize
}
}
return
;##### Other controls #####
DefineControls:
GoSub, BuildMacroWin
GoSub, BuildPrevWin
GoSub, BuildMixedControls
GoSub, BuildOSCWin
RbMacro := New Rebar(hRbMacro)
, RbMacro.InsertBand(hMacroCh, 0, "NoGripper", 30, "", A_ScreenWidth/2, 0, "", "", 10, 10)
, RbMacro.InsertBand(hPrevCh, 0, "", 31, "", A_ScreenWidth/2, 0, "", "", 0)
, (MacroLayout = "ERROR") ? "" : RbMacro.SetLayout(MacroLayout)
, !ShowPrev ? RbMacro.ModifyBand(2, "Style", "Hidden")
return
BuildMacroWin:
Gui, chMacro:+LastFound
Gui, chMacro:+hwndhMacroCh -Caption +Parent1
Gui, chMacro:Add, Tab2, Section Buttons 0x0008 -Wrap AltSubmit y+0 H22 hwndTabSel vA_List gTabSel, Macro1
Gui, chMacro:Add, ListView, AltSubmit Checked x+0 y+0 hwndListID1 vInputList1 gInputList NoSort LV0x10000, %w_Lang030%|%w_Lang031%|%w_Lang032%|%w_Lang033%|%w_Lang034%|%w_Lang035%|%w_Lang036%|%w_Lang037%|%w_Lang038%|%w_Lang039%
Gui, chMacro:Default
LV_SetImageList(hIL_Icons)
Loop, 10
LV_ModifyCol(A_Index, Col_%A_Index%)
LVOrder_Set(10, ColOrder, ListID1)
Gui, chMacro:Submit
GuiControl, chMacro:Focus, InputList%A_List%
Gui, 1:Default
return
BuildMixedControls:
Gui, chTimes:+LastFound
Gui, chTimes:+hwndhTimesCh -Caption +Parent1
Gui, chTimes:Add, Edit, x0 y0 W75 H22 Number vReptC
Gui, chTimes:Add, UpDown, vTimesG 0x80 Range0-999999999, 1
return
Preview:
If (FloatPrev)
GoSub, PrevClose
Else
{
TB_Edit(TbFile, "Preview", ShowPrev := !ShowPrev)
, RbMacro.ModifyBand(2, "Style", "Hidden", False)
, RbMacro.ModifyBand(2, "MinWidth", 0)
GoSub, PrevRefresh
}
If (ShowPrev)
Menu, ViewMenu, Check, %v_lang005%`t%_s%Ctrl+P
Else
Menu, ViewMenu, UnCheck, %v_lang005%`t%_s%Ctrl+P
return
PrevDock:
Input
FloatPrev := !FloatPrev
If (FloatPrev)
{
RbMacro.ModifyBand(2, "Style", "Hidden")
If InStr(PrevWinSize, "H0")
PrevWinSize := "W450 H500"
Gui, 2:Show, %PrevWinSize%, %c_Lang072% - %AppName%
}
Else
{
Gui, 2:Hide
GuiGetSize(pGuiWidth, pGuiHeight, 2), PrevWinSize := "W" pGuiWidth " H" pGuiHeight
RbMacro.ModifyBand(2, "Style", "Hidden", False)
}
lastCalcMargin := ""
GoSub, PrevRefresh
return
BuildPrevWin:
Gui, chPrev:+LastFound
Gui, chPrev:+hwndhPrevCh -Resize -Caption +Parent1
Gui, chPrev:Add, Custom, ClassToolbarWindow32 y+0 hwndhtbPrev gtbPrev 0x0800 0x0100 0x0040 0x0008
Gui, chPrev:Add, Custom, ClassScintilla x0 y25 hwndhSciPrev vLVPrev
Gui, chPrev:Show, W450 H600 Hide
TB_Define(tbPrev, htbPrev, hIL_Icons, FixedBar.Preview, FixedBar.PrevOpt)
, tbPrev.ModifyButton(8, "Hide")
, sciPrev := new scintilla(hSciPrev)
, sciPrev.SetMarginWidthN(0x0, 0xA)
, sciPrev.SetMarginWidthN(0x1, 0x5)
, sciPrev.SetMarginTypeN(0x1, 0x2)
, sciPrev.SetWrapMode(TextWrap ? 0x1 : 0x0)