• R/O
  • SSH
  • HTTPS

akdf: Commit


Commit MetaInfo

Revision585 (tree)
Time2022-07-09 11:10:19
Authorderekwildstar

Log Message

Ajustes na formatação do texto de algumas units
Registrado o componente TKRKTaskDialog, bem como dois editores de propriedades para ele
Adequação para o Delphi 2006 realizada
Nova unita adicionada (KRK.Vcl.Dialogs.Editors.pas) para agrupar os editores de propriedades e componentes contidos em KRK.Vcl.Dialogs.pas
Remoção de comentários inúteis
Testador alterado com componentes de teste (posteriormente isso precisa ser removido e mantido apenas os componentes do KRK)

Change Summary

Incremental Difference

--- trunk/dtp/AdditionalControls/src/KRK.AdditionalControls.pas (revision 584)
+++ trunk/dtp/AdditionalControls/src/KRK.AdditionalControls.pas (revision 585)
@@ -2,16 +2,13 @@
22
33 interface
44
5-uses
6- Classes, DesignIntf;
7-
85 procedure Register;
96
107 implementation
118
129 uses
13- Controls, KRK.Vcl.Controls, KRK.Rtl.Win.CommCtrl, KRK.Vcl.ExtCtrls,
14- KRK.Vcl.ExtCtrls.Editors, KRK.Vcl.Utilities;
10+ Classes, DesignIntf, Controls, KRK.Vcl.Controls, KRK.Rtl.Win.CommCtrl,
11+ KRK.Vcl.ExtCtrls, KRK.Vcl.ExtCtrls.Editors, KRK.Vcl.Utilities;
1512
1613 const
1714 PageName = 'Anak Krakatoa Additional Controls';
--- trunk/dtp/StandardControls/src/KRK.StandardControls.pas (revision 584)
+++ trunk/dtp/StandardControls/src/KRK.StandardControls.pas (revision 585)
@@ -6,12 +6,20 @@
66
77 implementation
88
9-uses Classes
10- , KRK.Vcl.StdCtrls;
9+uses
10+ Classes, DesignIntf, KRK.Vcl.StdCtrls, KRK.Vcl.Dialogs,
11+ KRK.Vcl.Dialogs.Editors;
1112
13+const
14+ KRKSTANDARDCONTROLS = 'Anak Krakatoa Standard Controls';
15+ KRKDIALOGS = 'Anak Krakatoa Dialogs';
16+
1217 procedure Register;
1318 begin
14- RegisterComponents('Anak Krakatoa Standard Controls', [TKRKPanel,TKRKGroupBox]);
19+ RegisterComponents(KRKSTANDARDCONTROLS, [TKRKPanel,TKRKGroupBox]);
20+ RegisterComponents(KRKDIALOGS, [TKRKTaskDialog]);
21+ RegisterPropertyEditor(TypeInfo(TKRKTaskDialogIcon), TKRKTaskDialog, 'MainIcon', TKRKTaskDialogIconProperty);
22+ RegisterPropertyEditor(TypeInfo(TKRKTaskDialogIcon), TKRKTaskDialog, 'FooterIcon', TKRKTaskDialogIconProperty);
1523 end;
1624
1725 end.
--- trunk/rtp/prj/Delphi 10 (Delphi 2006)/KRKLib.dpk (revision 584)
+++ trunk/rtp/prj/Delphi 10 (Delphi 2006)/KRKLib.dpk (revision 585)
@@ -40,7 +40,10 @@
4040 vclie,
4141 webdsnap,
4242 vcl,
43- rtl;
43+ rtl,
44+ xmlrtl,
45+ vclactnband,
46+ vclx;
4447
4548 contains
4649 crtl,
@@ -164,6 +167,7 @@
164167 KRK.Network.WS2TcpIp in '..\..\src\Network\KRK.Network.WS2TcpIp.pas',
165168 KRK.Rtl.Win.CommCtrl in '..\..\src\Rtl\Win\KRK.Rtl.Win.CommCtrl.pas',
166169 KRK.Vcl.Dialogs in '..\..\src\Vcl\KRK.Vcl.Dialogs.pas',
167- KRK.Vcl.Consts in '..\..\src\Vcl\KRK.Vcl.Consts.pas';
170+ KRK.Vcl.Consts in '..\..\src\Vcl\KRK.Vcl.Consts.pas',
171+ KRK.Vcl.Dialogs.Editors in '..\..\src\Vcl\KRK.Vcl.Dialogs.Editors.pas';
168172
169173 end.
--- trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dpk (revision 584)
+++ trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dpk (revision 585)
@@ -163,7 +163,8 @@
163163 KRK.Network.WS2TcpIp in '..\..\src\Network\KRK.Network.WS2TcpIp.pas',
164164 KRK.Rtl.Win.CommCtrl in '..\..\src\Rtl\Win\KRK.Rtl.Win.CommCtrl.pas',
165165 KRK.Vcl.Dialogs in '..\..\src\Vcl\KRK.Vcl.Dialogs.pas',
166- KRK.Vcl.Consts in '..\..\src\Vcl\KRK.Vcl.Consts.pas';
166+ KRK.Vcl.Consts in '..\..\src\Vcl\KRK.Vcl.Consts.pas',
167+ KRK.Vcl.Dialogs.Editors in '..\..\src\Vcl\KRK.Vcl.Dialogs.Editors.pas';
167168
168169 end.
169170
--- trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dproj (revision 584)
+++ trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dproj (revision 585)
@@ -188,6 +188,7 @@
188188 <DCCReference Include="..\..\src\Rtl\Win\KRK.Rtl.Win.CommCtrl.pas"/>
189189 <DCCReference Include="..\..\src\Vcl\KRK.Vcl.Dialogs.pas"/>
190190 <DCCReference Include="..\..\src\Vcl\KRK.Vcl.Consts.pas"/>
191+ <DCCReference Include="..\..\src\Vcl\KRK.Vcl.Dialogs.Editors.pas"/>
191192 <BuildConfiguration Include="Base">
192193 <Key>Base</Key>
193194 </BuildConfiguration>
--- trunk/rtp/src/Vcl/KRK.Vcl.Dialogs.Editors.pas (nonexistent)
+++ trunk/rtp/src/Vcl/KRK.Vcl.Dialogs.Editors.pas (revision 585)
@@ -0,0 +1,89 @@
1+unit KRK.Vcl.Dialogs.Editors;
2+{$IF CompilerVersion >= 25}{$LEGACYIFEND ON}{$IFEND} { Delphi XE4 }
3+interface
4+
5+uses
6+ DesignEditors, DesignIntf, Classes;
7+
8+type
9+ TKRKTaskDialogIconProperty = class(TIntegerProperty)
10+ public
11+ function GetAttributes: TPropertyAttributes; override;
12+ function GetValue: string; override;
13+ procedure GetValues(AProc: TGetStrProc); override;
14+ procedure SetValue(const AValue: string); override;
15+ end;
16+
17+implementation
18+
19+uses
20+ KRK.Vcl.Dialogs, SysUtils;
21+
22+{ TKRKTaskDialogIconProperty }
23+
24+const
25+ // Array de valores nomeados que variam na prática de 0 a 9
26+ KRKTaskDialogIcons: array[ktdiNone..ktdiShieldHeadGreen] of string = (
27+ 'ktdiNone', 'ktdiWarning', 'ktdiError', 'ktdiInformation', 'ktdiShield',
28+ 'ktdiShieldHeadBlue', 'ktdiShieldHeadWarning', 'ktdiShieldHeadError',
29+ 'ktdiShieldHeadOk', 'ktdiShieldHeadGreen');
30+
31+function TKRKTaskDialogIconProperty.GetAttributes: TPropertyAttributes;
32+begin
33+ Result := [paMultiSelect, paValueList, paRevertable];
34+end;
35+
36+// Obtém o valor para exibição no OI. Caso seja um dos valores nomeados, mostra
37+// seu nome, do contrário, mostra o valor real (integer)
38+function TKRKTaskDialogIconProperty.GetValue: string;
39+var
40+ CurValue: Longint;
41+begin
42+ CurValue := GetOrdValue;
43+
44+ if CurValue in [Low(KRKTaskDialogIcons)..High(KRKTaskDialogIcons)] then
45+ Result := KRKTaskDialogIcons[CurValue]
46+ else
47+ Result := IntToStr(CurValue);
48+end;
49+
50+// Popula a lista suspensa com os valores nomeados contidos no array
51+// KRKTaskDialogIcons
52+procedure TKRKTaskDialogIconProperty.GetValues(AProc: TGetStrProc);
53+var
54+ i: Integer;
55+begin
56+ for i := Low(KRKTaskDialogIcons) to High(KRKTaskDialogIcons) do
57+ AProc(KRKTaskDialogIcons[i]);
58+end;
59+
60+// Este método é chamado ao se atribuir um valor a propriedade. Caso se tente
61+// atribuir uma string vazia, o padrão é que se atribua zero e não faz mais
62+// nada. Caso não seja uma string vazia, verifica se o que foi digitado é um
63+// valor nomeado, se for, atribui o valor correspondente ao valor nomeado, que
64+// no caso é simplesmente o índice do array KRKTaskDialogIcons onde o valor
65+// nomeado está e não faz mais nada. Caso aquilo que for digitado não seja um
66+// valor nomeado, considera que se digitou um número e salva ele imediatmante.
67+// Evidentemente que se for digitada uma string que não seja um valor nomeado,
68+// haverá um erro de conversão, e isso é natural.
69+procedure TKRKTaskDialogIconProperty.SetValue(const AValue: string);
70+var
71+ i: Integer;
72+begin
73+ if AValue = '' then
74+ begin
75+ SetOrdValue(0);
76+ Exit;
77+ end;
78+
79+ for i := Low(KRKTaskDialogIcons) to High(KRKTaskDialogIcons) do
80+ if CompareText(KRKTaskDialogIcons[i], AValue) = 0 then
81+ begin
82+ SetOrdValue(i);
83+ Exit;
84+ end;
85+
86+ inherited SetValue(AValue);
87+end;
88+
89+end.
--- trunk/rtp/src/Vcl/KRK.Vcl.Dialogs.pas (revision 584)
+++ trunk/rtp/src/Vcl/KRK.Vcl.Dialogs.pas (revision 585)
@@ -20,23 +20,17 @@
2020 funcionar em versões anteriores do Delphi. Houve, pois, um grande trabalho de
2121 refatoração e ajustes }
2222
23-// Constantes criadas desta forma podem ser usadas em propriedades do tipo
24-// integer, pois o Delphi sabe que elas representam números. Isso não é
25-// novidade, visto que já era possível usar MaxInt, e outras constantes
26-// similares em propriedades integer. Acredito que isso valha também para
27-// constantes de outros tipos, em propriedades de tipos correspondentes, por
28-// exemplo, Single e Double, mas não tenho certeza
2923 const
30- tdiNone = 0;
31- tdiWarning = 1;
32- tdiError = 2;
33- tdiInformation = 3;
34- tdiShield = 4;
35- tdiShieldHeadBlue = 5;
36- tdiShieldHeadWarning = 6;
37- tdiShieldHeadError = 7;
38- tdiShieldHeadOk = 8;
39- tdiShieldHeadGreen = 9;
24+ ktdiNone = 0;
25+ ktdiWarning = 1;
26+ ktdiError = 2;
27+ ktdiInformation = 3;
28+ ktdiShield = 4;
29+ ktdiShieldHeadBlue = 5;
30+ ktdiShieldHeadWarning = 6;
31+ ktdiShieldHeadError = 7;
32+ ktdiShieldHeadOk = 8;
33+ ktdiShieldHeadGreen = 9;
4034
4135 type
4236 {$IF CompilerVersion = 18}
@@ -284,11 +278,11 @@
284278 property Expanded: Boolean read FExpanded;
285279 property ExpandedInformation: string read FExpandedInformation write SetExpandedInformation;
286280 property Flags: TKRKTaskDialogFlags read FFlags write SetFlags default [tfAllowDialogCancellation];
287- property FooterIcon: TKRKTaskDialogIcon read FFooterIcon write SetFooterIcon default tdiNone;
281+ property FooterIcon: TKRKTaskDialogIcon read FFooterIcon write SetFooterIcon default ktdiNone;
288282 property Footer: string read FFooter write SetFooter;
289283 property Handle: HWND read FHandle;
290284 property HelpContext: Integer read FHelpContext write FHelpContext default 0;
291- property MainIcon: TKRKTaskDialogIcon read FMainIcon write SetMainIcon default tdiInformation;
285+ property MainIcon: TKRKTaskDialogIcon read FMainIcon write SetMainIcon default ktdiInformation;
292286 property ModalResult: TModalResult read FModalResult write FModalResult;
293287 property ProgressBar: TKRKTaskDialogProgressBar read FProgressBar write FProgressBar;
294288 property RadioButton: TKRKTaskDialogRadioButtonItem read FRadioButton;
@@ -505,9 +499,9 @@
505499 FCustomMainIcon := TIcon.Create;
506500 FDefaultButton := tcbOk;
507501 FFlags := [tfAllowDialogCancellation];
508- FFooterIcon := tdiNone;
502+ FFooterIcon := ktdiNone;
509503 FHandle := 0;
510- FMainIcon := tdiInformation;
504+ FMainIcon := ktdiInformation;
511505 FProgressBar := TKRKTaskDialogProgressBar.Create(Self);
512506 FRadioButtons := TKRKTaskDialogButtons.Create(Self, TKRKTaskDialogRadioButtonItem);
513507 end;
@@ -531,7 +525,7 @@
531525 TTaskDlgIconMapType = PWideChar;
532526
533527 const
534- CTaskDlgIcons: array[tdiNone..tdiShieldHeadGreen] of TTaskDlgIconMapType = (nil,
528+ CTaskDlgIcons: array[ktdiNone..ktdiShieldHeadGreen] of TTaskDlgIconMapType = (nil,
535529 TD_WARNING_ICON, TD_ERROR_ICON, TD_INFORMATION_ICON, TD_SHIELD_ICON,
536530 TD_SHIELD_ICON_HEAD_BLUE, TD_SHIELD_ICON_HEAD_WARNING,
537531 TD_SHIELD_ICON_HEAD_ERROR, TD_SHIELD_ICON_HEAD_OK,
@@ -603,7 +597,7 @@
603597 hMainIcon := FCustomMainIcon.Handle
604598 else
605599 begin
606- if FMainIcon in [tdiNone..tdiShieldHeadGreen] then
600+ if FMainIcon in [ktdiNone..ktdiShieldHeadGreen] then
607601 pszMainIcon := LPCWSTR(CTaskDlgIcons[FMainIcon])
608602 else
609603 pszMainIcon := LPCWSTR(MAKEINTRESOURCEW(Word(FMainIcon)));
@@ -649,7 +643,7 @@
649643 hFooterIcon := FCustomFooterIcon.Handle
650644 else
651645 begin
652- if FFooterIcon in [tdiNone..tdiShield] then
646+ if FFooterIcon in [ktdiNone..ktdiShield] then
653647 pszFooterIcon := LPCWSTR(CTaskDlgIcons[FFooterIcon])
654648 else
655649 pszFooterIcon := LPCWSTR(MakeIntResourceW(Word(FFooterIcon)));
--- trunk/rtp/src/Vcl/KRK.Vcl.ExtCtrls.Editors.pas (revision 584)
+++ trunk/rtp/src/Vcl/KRK.Vcl.ExtCtrls.Editors.pas (revision 585)
@@ -2,8 +2,8 @@
22
33 interface
44
5-uses DesignEditors
6- , DesignIntf;
5+uses
6+ DesignEditors, DesignIntf;
77
88 type
99 TKRKRTFLabelCaptionProperty = class(TStringProperty)
@@ -16,7 +16,8 @@
1616
1717 implementation
1818
19-uses KRK.ToolsApi.Editors.RTFLabel.CaptionEditor;
19+uses
20+ KRK.ToolsApi.Editors.RTFLabel.CaptionEditor;
2021
2122 { TKRKRTFLabelCaptionProperty }
2223
--- trunk/utl/TESTADOR/src/UDAMOPrincipal.pas (revision 584)
+++ trunk/utl/TESTADOR/src/UDAMOPrincipal.pas (revision 585)
@@ -4,8 +4,8 @@
44
55 uses
66 SysUtils, Classes, Menus, ActnPopup, XPStyleActnCtrls,
7- Dialogs, System.ImageList, Vcl.ImgList, Vcl.Controls, System.Actions,
8- Vcl.ActnList, Vcl.StdActns, Vcl.ExtActns, KRK.Vcl.ExtActns,
7+ Dialogs, KRK.Vcl.Dialogs, System.ImageList, Vcl.ImgList, Vcl.Controls,
8+ System.Actions, Vcl.ActnList, Vcl.StdActns, Vcl.ExtActns, KRK.Vcl.ExtActns,
99 KRK.Rtl.Win.CommCtrl, Winapi.Messages;
1010
1111 type
@@ -33,6 +33,8 @@
3333 OPDICarregarArquivoAAssinar: TOpenDialog;
3434 OPDICarregarArquivoPFX: TOpenDialog;
3535 KRTT: TKRKToolTip;
36+ KRKTaskDialog1: TKRKTaskDialog;
37+ TaskDialog1: TTaskDialog;
3638 procedure MNUIJSONvazio1Click(Sender: TObject);
3739 procedure MNUISICASE1Click(Sender: TObject);
3840 procedure MNUItextxml1Click(Sender: TObject);
Show on old repository browser