-
Notifications
You must be signed in to change notification settings - Fork 0
/
xCursor_PAS.pas
690 lines (623 loc) · 18.4 KB
/
xCursor_PAS.pas
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
unit xCursor_PAS;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, Nyx, Menus, ShellAPI, StdCtrls, ComCtrls;
type
TformX = class(TForm)
BG: TImage;
Menu: TMainMenu;
MenuFile: TMenuItem;
SubChange: TMenuItem;
OpenCursor: TOpenDialog;
Popup: TPopupMenu;
PopTheme: TMenuItem;
ThemeOrange: TMenuItem;
ThemeRainbow: TMenuItem;
ThemeCool: TMenuItem;
ThemeMarbles: TMenuItem;
ThemeBlue: TMenuItem;
SubPlanet: TMenuItem;
ThemeRay: TMenuItem;
ThemeRainbowish: TMenuItem;
ThemePlanets: TMenuItem;
ThemeBlueRed: TMenuItem;
ThemeHigh: TMenuItem;
ThemeWhirl: TMenuItem;
ThemeMachine: TMenuItem;
SubOpen: TMenuItem;
SubExit: TMenuItem;
SubApply: TMenuItem;
ImgDrop: TImage;
MenuConfig: TMenuItem;
SubDrop: TMenuItem;
SubDropPre: TMenuItem;
SubDropApply: TMenuItem;
LabelAbove: TLabel;
SubLanguage: TMenuItem;
SubEnglish: TMenuItem;
SubSrpski: TMenuItem;
MenuSearch: TMenuItem;
SubGoogle: TMenuItem;
SubTFC: TMenuItem;
SubMySpace: TMenuItem;
Sub4U: TMenuItem;
SubRestart: TMenuItem;
MenuExtras: TMenuItem;
SubSonar: TMenuItem;
SubMSOn: TMenuItem;
SubReverse: TMenuItem;
SubRMBOn: TMenuItem;
SubRMBOff: TMenuItem;
SubMSOff: TMenuItem;
Status: TStatusBar;
Timer: TTimer;
SubClickLock: TMenuItem;
SubMCLOn: TMenuItem;
SubMCLOff: TMenuItem;
SubxCur: TMenuItem;
MenuAbout: TMenuItem;
SubAuthor: TMenuItem;
SubHelp: TMenuItem;
SubWeb: TMenuItem;
SubRestore: TMenuItem;
SubRestoreAll: TMenuItem;
SubRestoreSingle: TMenuItem;
SubArrow: TMenuItem;
SubBG: TMenuItem;
SubPreSelect: TMenuItem;
SubHelpCur: TMenuItem;
SubTextSel: TMenuItem;
SubUn: TMenuItem;
SubHandwriting: TMenuItem;
SubMove: TMenuItem;
SubDiag1: TMenuItem;
SubDiag2: TMenuItem;
SubVert: TMenuItem;
SubHorz: TMenuItem;
SubAltSel: TMenuItem;
SubWait: TMenuItem;
SubHand: TMenuItem;
SubGenerate: TMenuItem;
SubGenSingle: TMenuItem;
SubGenMulti: TMenuItem;
Line1: TMenuItem;
Line3: TMenuItem;
Line2: TMenuItem;
Line4: TMenuItem;
Line5: TMenuItem;
Save: TSaveDialog;
SubSAC: TMenuItem;
SubSACOn: TMenuItem;
SubSACOff: TMenuItem;
SubConMenu: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure SubChangeClick(Sender: TObject);
procedure applyTheme(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure SubOpenClick(Sender: TObject);
procedure SubExitClick(Sender: TObject);
procedure SubApplyClick(Sender: TObject);
procedure ImgDropMouseLeave(Sender: TObject);
procedure SubDropPreClick(Sender: TObject);
procedure SubDropApplyClick(Sender: TObject);
procedure SubEnglishClick(Sender: TObject);
procedure SubSrpskiClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure SubGoogleClick(Sender: TObject);
procedure SubTFCClick(Sender: TObject);
procedure SubMySpaceClick(Sender: TObject);
procedure Sub4UClick(Sender: TObject);
procedure MenuFileClick(Sender: TObject);
procedure SubRestartClick(Sender: TObject);
procedure MenuExtrasClick(Sender: TObject);
procedure SubMSOnClick(Sender: TObject);
procedure SubRMBOnClick(Sender: TObject);
procedure SubRMBOffClick(Sender: TObject);
procedure SubMSOffClick(Sender: TObject);
procedure SubSonarClick(Sender: TObject);
procedure SubReverseClick(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure SubMCLOnClick(Sender: TObject);
procedure SubMCLOffClick(Sender: TObject);
procedure SubClickLockClick(Sender: TObject);
procedure SubxCurClick(Sender: TObject);
procedure SubWebClick(Sender: TObject);
procedure SubAuthorClick(Sender: TObject);
procedure SubRestoreAllClick(Sender: TObject);
procedure SubGenSingleClick(Sender: TObject);
procedure SubGenMultiClick(Sender: TObject);
procedure SubSACClick(Sender: TObject);
procedure SubSACOnClick(Sender: TObject);
procedure SubSACOffClick(Sender: TObject);
procedure SubConMenuClick(Sender: TObject);
private
procedure checkAll(Sender: TObject);
procedure DropFile(Var Msg: TWMDropFiles); message WM_DROPFILES;
procedure Translate(Lang: UnicodeString);
procedure restoreCursor(Sender: TObject);
public
{ Public declarations }
end;
var
formX: TformX;
AppPath, ActiveLanguage: UnicodeString;
LanguagePack: TStringList;
sParam: Boolean;
implementation
{$R *.dfm}
{$LOCALSYMBOLS OFF}
{$IFOPT D-}{$WEAKLINKRTTI ON}{$ENDIF}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
{$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED}
procedure TformX.DropFile(var Msg: TWMDropFiles);
const CursorPreview=1;
Var FileName: Array[0..260] Of Char;
begin
DragQueryFile(Msg.Drop, 0, FileName, 255);
If (LowerCase(GetExt(FileName))='cur') Or (LowerCase(GetExt(FileName))='ani') Or (LowerCase(GetExt(FileName))='xcur') Then
begin
If LowerCase(GetExt(FileName))='xcur' Then
ImgDrop.Picture.Graphic:=loadResImg('DropOver', 'png')
Else
ImgDrop.Picture.Graphic:=loadResImg('DropYes', 'png');
If IniRead(AppPath+'config.db', 'Config', 'Action')='preview' Then
begin
Screen.Cursors[CursorPreview]:=LoadCursorFromFile(FileName);
Self.Cursor:=CursorPreview;
SubApply.Enabled:=True;
end
Else
SetCursor(FileName);
DragFinish(Msg.Drop);
end
Else
ImgDrop.Picture.Graphic:=loadResImg('DropNot', 'png');
end;
procedure TformX.TimerTimer(Sender: TObject);
begin
Status.SimpleText:='';
Timer.Enabled:=False;
end;
procedure TformX.Translate(Lang: UnicodeString);
begin
If Assigned(LanguagePack) Then
begin
If Lang='sr' Then
begin
LanguagePack.LoadFromStream(loadFromRes('srb'), TEncoding.UTF8);
IniWrite(AppPath+'config.db', 'Config', 'Lang', '0x0032');
SubSrpski.Checked:=True;
SubEnglish.Checked:=False;
end
Else
begin
LanguagePack.LoadFromStream(loadFromRes('eng'));
IniWrite(AppPath+'config.db', 'Config', 'Lang', '0x0064');
SubEnglish.Checked:=True;
SubSrpski.Checked:=False;
end;
{ * The Translation Part. This Is A Tough One! :) * }
MenuFile.Caption:=LanguagePack.Strings[0];
MenuConfig.Caption:=LanguagePack.Strings[1];
MenuSearch.Caption:=LanguagePack.Strings[2];
SubOpen.Caption:=LanguagePack.Strings[3];
SubChange.Caption:=LanguagePack.Strings[4];
SubApply.Caption:=LanguagePack.Strings[5];
SubExit.Caption:=LanguagePack.Strings[6];
SubLanguage.Caption:=LanguagePack.Strings[7];
SubDrop.Caption:=LanguagePack.Strings[8];
SubDropPre.Caption:=LanguagePack.Strings[9];
SubDropApply.Caption:=LanguagePack.Strings[10];
LabelAbove.Caption:=LanguagePack.Strings[11];
OpenCursor.Filter:=LanguagePack.Strings[12];
OpenCursor.Title:=LanguagePack.Strings[13];
SubRestart.Caption:=LanguagePack.Strings[14];
MenuExtras.Caption:=LanguagePack.Strings[15];
SubSonar.Caption:=LanguagePack.Strings[16];
SubReverse.Caption:=LanguagePack.Strings[17];
SubClickLock.Caption:=LanguagePack.Strings[18];
SubMSOn.Caption:=LanguagePack.Strings[19];
SubRMBOn.Caption:=LanguagePack.Strings[19];
SubMCLOn.Caption:=LanguagePack.Strings[19];
SubMSOff.Caption:=LanguagePack.Strings[20];
SubRMBOff.Caption:=LanguagePack.Strings[20];
SubMSOff.Caption:=LanguagePack.Strings[20];
SubMCLOff.Caption:=LanguagePack.Strings[20];
SubSonar.Hint:=LanguagePack.Strings[21];
SubReverse.Hint:=LanguagePack.Strings[17];
SubClickLock.Hint:=LanguagePack.Strings[22];
SubxCur.Caption:=LanguagePack.Strings[23];
MenuAbout.Caption:=LanguagePack.Strings[24];
SubHelp.Caption:=LanguagePack.Strings[25];
SubAuthor.Caption:=LanguagePack.Strings[26];
SubWeb.Caption:=LanguagePack.Strings[27];
SubRestore.Caption:=LanguagePack.Strings[31];
SubRestoreAll.Caption:=LanguagePack.Strings[32];
SubRestoreSingle.Caption:=LanguagePack.Strings[33];
SubArrow.Caption:=LanguagePack.Strings[34];
SubBG.Caption:=LanguagePack.Strings[35];
SubPreSelect.Caption:=LanguagePack.Strings[36];
SubHelpCur.Caption:=LanguagePack.Strings[37];
SubTextSel.Caption:=LanguagePack.Strings[38];
SubUn.Caption:=LanguagePack.Strings[39];
SubHandwriting.Caption:=LanguagePack.Strings[40];
SubMove.Caption:=LanguagePack.Strings[41];
SubDiag2.Caption:=LanguagePack.Strings[42];
SubVert.Caption:=LanguagePack.Strings[43];
SubDiag1.Caption:=LanguagePack.Strings[44];
SubHorz.Caption:=LanguagePack.Strings[45];
SubAltSel.Caption:=LanguagePack.Strings[46];
SubWait.Caption:=LanguagePack.Strings[47];
SubHand.Caption:=LanguagePack.Strings[48];
SubGenerate.Caption:=LanguagePack.Strings[49];
SubGenSingle.Caption:=LanguagePack.Strings[50];
SubGenMulti.Caption:=LanguagePack.Strings[51];
Save.Filter:='xCursor '+LanguagePack.Strings[0]+' (*.xcur)|*.xcur';
SubSAC.Caption:=LanguagePack.Strings[52];
SubSACOn.Caption:=LanguagePack.Strings[19];
SubSACOff.Caption:=LanguagePack.Strings[20];
SubSAC.Hint:=LanguagePack.Strings[53];
SubConMenu.Caption:=LanguagePack.Strings[55];
end;
end;
procedure ParseXCUR(FileName: UnicodeString);
Var I: Byte;
begin
If IniRead(FileName, 'xCursor', 'Cursor', '@MULTI')='@MULTI' Then
begin
For I:=0 To 14 Do
begin
If IniRead(FileName, 'xCursor', 'Cursor'+IntToStr(I), '')<>'' Then
begin
If FileExists(IniRead(FileName, 'xCursor', 'Cursor'+IntToStr(I), '')) Then
SetCursor(IniRead(FileName, 'xCursor', 'Cursor'+IntToStr(I), ''), I);
end;
end;
end
Else
begin
If FileExists(IniRead(FileName, 'xCursor', 'Cursor', '')) Then
SetCursor(IniRead(FileName, 'xCursor', 'Cursor', ''));
end;
end;
procedure TformX.Sub4UClick(Sender: TObject);
begin
openURL('http://www.cursors-4u.com/');
end;
procedure TformX.restoreCursor(Sender: TObject);
begin
SetCursor('0x000011', SubRestoreSingle.IndexOf((Sender As TMenuItem)));
end;
procedure TformX.SubApplyClick(Sender: TObject);
begin
If IniRead(AppPath+'config.db', 'Config', 'xSAC')='65536' Then
begin
CopyFile(PWideChar(OpenCursor.FileName), PWideChar(GetPath('cursors')+'\'+ExtractFileName(OpenCursor.FileName)), True);
OpenCursor.FileName:=GetPath('cursors')+'\'+ExtractFileName(OpenCursor.FileName);
end;
SetCursor(OpenCursor.FileName);
Self.Cursor:=crArrow;
SubApply.Enabled:=False;
end;
procedure TformX.SubAuthorClick(Sender: TObject);
begin
MessageDlg(LanguagePack.Strings[28]+' Igor Dimitrijević - SkyFlyer'+#13#10+LanguagePack.Strings[29], mtInformation, [mbOK], 0);
end;
procedure TformX.SubChangeClick(Sender: TObject);
begin
If OpenCursor.Execute Then
begin
If IniRead(AppPath+'config.db', 'Config', 'xSAC')='65536' Then
begin
CopyFile(PWideChar(OpenCursor.FileName), PWideChar(GetPath('cursors')+'\'+ExtractFileName(OpenCursor.FileName)), True);
OpenCursor.FileName:=GetPath('cursors')+'\'+ExtractFileName(OpenCursor.FileName);
end;
SetCursor(OpenCursor.FileName);
SubApply.Enabled:=False;
Self.Cursor:=crArrow;
end;
end;
procedure TformX.SubClickLockClick(Sender: TObject);
begin
Status.SimpleText:='';
Status.SimpleText:=SubClickLock.Hint;
Timer.Enabled:=True;
end;
procedure TformX.SubConMenuClick(Sender: TObject);
begin
ContextMenu('.xcur', LanguagePack.Strings[54], Application.ExeName);
end;
procedure TformX.SubDropApplyClick(Sender: TObject);
begin
IniWrite(AppPath+'config.db', 'Config', 'Action', 'apply');
end;
procedure TformX.SubDropPreClick(Sender: TObject);
begin
IniWrite(AppPath+'config.db', 'Config', 'Action', 'preview');
end;
procedure TformX.SubEnglishClick(Sender: TObject);
begin
Translate('en');
end;
procedure TformX.SubExitClick(Sender: TObject);
begin
Close;
end;
procedure TformX.SubGenMultiClick(Sender: TObject);
Var I: Byte;
begin
If Save.Execute Then
begin
For I:=0 To 14 Do
begin
If OpenCursor.Execute Then
IniWrite(Save.FileName+'.xcur', 'xCursor', 'Cursor'+IntToStr(I), OpenCursor.FileName)
Else
IniWrite(Save.FileName+'.xcur', 'xCursor', 'Cursor'+IntToStr(I), '');
end;
end;
end;
procedure TformX.SubGenSingleClick(Sender: TObject);
begin
If Save.Execute Then
begin
If OpenCursor.Execute Then
IniWrite(Save.FileName+'.xcur', 'xCursor', 'Cursor', OpenCursor.FileName);
end;
end;
procedure TformX.SubGoogleClick(Sender: TObject);
begin
openURL('https://google.com');
end;
procedure TformX.SubMCLOffClick(Sender: TObject);
begin
SystemParametersInfo(SPI_SETMOUSECLICKLOCK, 0, Nil, 0);
SubMCLOn.Checked:=False;
end;
procedure TformX.SubMCLOnClick(Sender: TObject);
begin
sParam:=True;
SystemParametersInfo(SPI_SETMOUSECLICKLOCK, 0, @sParam, 0);
SubMCLOff.Checked:=False;
end;
procedure TformX.SubMSOffClick(Sender: TObject);
begin
SystemParametersInfo(SPI_SETMOUSESONAR, 0, Nil, 0);
SubMSOn.Checked:=False;
end;
procedure TformX.SubMSOnClick(Sender: TObject);
begin
sParam:=True;
SystemParametersInfo(SPI_SETMOUSESONAR, 0, @sParam, 0);
SubMSOn.Checked:=False;
end;
procedure TformX.SubMySpaceClick(Sender: TObject);
begin
openURL('http://www.myspacecursor.net/');
end;
procedure TformX.FormCreate(Sender: TObject);
Var Results: TSearchRec;
begin
formX.Icon:=Application.Icon;
AppPath:=ExtractFileDir(ParamStr(0))+'\';
DragAcceptFiles(Handle, True);
LanguagePack:=TStringList.Create;
If IniRead(AppPath+'config.db', 'Config', 'Lang', '0x0064')='0x0032' Then
Translate('sr');
If IniRead(AppPath+'config.db', 'Config', 'Lang')='0x0032' Then
begin
SubSrpski.Checked:=True;
SubEnglish.Checked:=False;
end
Else
begin
SubSrpski.Checked:=False;
SubEnglish.Checked:=True;
end;
If IniRead(AppPath+'config.db', 'Config', 'Action')='preview' Then
begin
SubDropPre.Checked:=True;
SubDropApply.Checked:=False;
end
Else
begin
SubDropPre.Checked:=False;
SubDropApply.Checked:=True;
end;
If IniRead(AppPath+'config.db', 'Config', 'xSAC')='65536' Then
begin
SubSACOn.Checked:=True;
SubSACOff.Checked:=False;
end
Else
begin
SubSACOn.Checked:=False;
SubSACOff.Checked:=True;
end;
If Not(DirectoryExists(AppPath+'Cursors')) Then
begin
CreateDir(AppPath+'Cursors');
If FindFirst(AppPath+'Cursors\*.cur', faAnyFile, Results)<>0 Then
begin
ExtractRes('Cursor_1', AppPath+'Cursors\Space.cur');
ExtractRes('Cursor_2', AppPath+'Cursors\Blue Fire.ani');
ExtractRes('Cursor_3', AppPath+'Cursors\Electricity.ani');
ExtractRes('Cursor_4', AppPath+'Cursors\Blue.cur');
ExtractRes('Cursor_5', AppPath+'Cursors\Bullseye.ani');
ExtractRes('Cursor_6', AppPath+'Cursors\Cool.ani');
ExtractRes('Cursor_7', AppPath+'Cursors\Game.ani');
ExtractRes('Cursor_8', AppPath+'Cursors\Cool Game.ani');
end
Else
FindClose(Results);
end;
If LowerCase(GetExt(ParamStr(1)))='xcur' Then
ParseXCur(ParamStr(1));
end;
procedure TformX.FormDestroy(Sender: TObject);
begin
LanguagePack.Free;
end;
procedure TformX.FormShow(Sender: TObject);
Var I: Integer;
begin
For I:=0 To SubRestoreSingle.Count-1 Do
SubRestoreSingle.Items[I].OnClick:=restoreCursor;
IniWrite(AppPath+'config.db', 'Config', 'Created', 'true');
If IniRead(AppPath+'config.db', 'Config', 'Image')<>'' Then
begin
BG.Picture.Graphic:=loadResImg('JpgImage_'+IniRead(AppPath+'config.db', 'Config', 'Image'));
end;
For I:=0 To Popup.Items[0].Count-1 Do
begin
Popup.Items[0][I].OnClick:=applyTheme;
Popup.Items[0][I].ShortCut:=ShortCut(65+I, [ssAlt]);
end;
ImgDrop.Picture.Graphic:=loadResImg('Drop', 'png');
end;
procedure TformX.ImgDropMouseLeave(Sender: TObject);
begin
ImgDrop.Picture.Graphic:=loadResImg('Drop', 'png');
end;
procedure TformX.MenuExtrasClick(Sender: TObject);
Var TestState: Boolean;
begin
SystemParametersInfo(SPI_GETMOUSESONAR, 0, @TestState, 0);
If TestState Then
begin
SubMSOn.Checked:=True;
SubMSOff.Checked:=False;
end
Else
begin
SubMSOn.Checked:=False;
SubMSOff.Checked:=True;
end;
If GetSystemMetrics(SM_SWAPBUTTON)<>0 Then
begin
SubRMBOn.Checked:=True;
SubRMBOff.Checked:=False;
end
Else
begin
SubRMBOn.Checked:=False;
SubRMBOff.Checked:=True;
end;
SystemParametersInfo(SPI_GETMOUSECLICKLOCK, 0, @TestState, 0);
If TestState Then
begin
SubMCLOn.Checked:=True;
SubMCLOff.Checked:=False;
end
Else
begin
SubMCLOn.Checked:=False;
SubMCLOff.Checked:=True;
end
end;
procedure TformX.MenuFileClick(Sender: TObject);
begin
If DirectoryExists(AppPath+'Cursors') Then
begin
OpenCursor.InitialDir:=AppPath+'Cursors';
OpenCursor.FilterIndex:=3;
end;
end;
procedure TformX.SubOpenClick(Sender: TObject);
const CursorPreview=1;
begin
If OpenCursor.Execute Then
begin
Screen.Cursors[CursorPreview]:=LoadCursorFromFile(PWideChar(OpenCursor.FileName));
Self.Cursor:=CursorPreview;
SubApply.Enabled:=True;
end;
end;
procedure TformX.SubRestartClick(Sender: TObject);
begin
ShellExecute(Handle, 'open', PWideChar(Application.ExeName), Nil, Nil, SW_SHOWNORMAL);
Close;
end;
procedure TformX.SubRestoreAllClick(Sender: TObject);
Var I: Byte;
begin
For I:=0 To 14 Do
SetCursor('0x000011', I);
end;
procedure TformX.SubReverseClick(Sender: TObject);
begin
Status.SimpleText:='';
Status.SimpleText:=SubReverse.Hint;
Timer.Enabled:=True;
end;
procedure TformX.SubRMBOffClick(Sender: TObject);
begin
sParam:=False;
SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, 0, Nil, 0);
SubRMBOn.Checked:=False;
end;
procedure TformX.SubRMBOnClick(Sender: TObject);
begin
sParam:=True;
SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, 1, @sParam, 0);
SubRMBOff.Checked:=False;
end;
procedure TformX.SubSACClick(Sender: TObject);
begin
Status.SimpleText:='';
Status.SimpleText:=SubSAC.Hint;
Timer.Enabled:=True;
end;
procedure TformX.SubSACOffClick(Sender: TObject);
begin
IniWrite(AppPath+'config.db', 'Config', 'xSAC', '262144');
SubSACOn.Checked:=False;
SubSACOff.Checked:=true;
end;
procedure TformX.SubSACOnClick(Sender: TObject);
begin
IniWrite(AppPath+'config.db', 'Config', 'xSAC', '65536');
SubSACOn.Checked:=True;
SubSACOff.Checked:=False;
end;
procedure TformX.SubSonarClick(Sender: TObject);
begin
Status.SimpleText:='';
Status.SimpleText:=SubSonar.Hint;
Timer.Enabled:=True;
end;
procedure TformX.SubSrpskiClick(Sender: TObject);
begin
Translate('sr');
end;
procedure TformX.SubTFCClick(Sender: TObject);
begin
end;
procedure TformX.SubWebClick(Sender: TObject);
begin
end;
procedure TformX.SubxCurClick(Sender: TObject);
begin
Associate('xcur', Application.ExeName, Application.ExeName, 'xCursor '+LanguagePack.Strings[0], '"%1"', False, 0);
Status.SimpleText:=LanguagePack.Strings[30];
Timer.Enabled:=True;
end;
procedure TformX.applyTheme(Sender: TObject);
begin
BG.Picture.Graphic:=loadResImg('JpgImage_'+IntToStr(Popup.Items[0].IndexOf((Sender As TMenuItem))+1));
IniWrite(AppPath+'config.db', 'Config', 'Image', IntToStr(Popup.Items[0].IndexOf((Sender As TMenuItem))+1));
checkAll(Sender);
end;
procedure TformX.checkAll(Sender: TObject);
Var I: Byte;
begin
For I:=0 To Popup.Items[0].Count-1 Do
begin
If Popup.Items[0].IndexOf((Sender As TMenuItem))<>I Then
Popup.Items[0][I].Checked:=False
Else
Popup.Items[0][I].Checked:=True;
end;
end;
end.