Skip to content

Commit

Permalink
Updated SysControls Demo (high DPI)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickard67 committed Aug 5, 2020
1 parent 0c93273 commit 0d3b840
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 9 deletions.
34 changes: 25 additions & 9 deletions Demos/Vcl Styles Utils SysControls High DPI (Demo App)/uMain.dfm
Expand Up @@ -2,7 +2,7 @@ object Form1: TForm1
Left = 498
Top = 321
Caption = 'Main'
ClientHeight = 229
ClientHeight = 263
ClientWidth = 423
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Expand Down Expand Up @@ -103,6 +103,22 @@ object Form1: TForm1
Caption = 'PrintDialog'
OnClick = BtnPrintDialogClick
end
object BtnTaskDialog: TSpeedButton
Left = 8
Top = 170
Width = 97
Height = 22
Caption = 'TaskDialog'
OnClick = BtnTaskDialogClick
end
object BtnTaskDialogCmd: TSpeedButton
Left = 115
Top = 170
Width = 98
Height = 22
Caption = 'TaskDialogCmd'
OnClick = BtnTaskDialogCmdClick
end
object ComboBoxStyles: TComboBox
Left = 53
Top = 8
Expand All @@ -123,7 +139,7 @@ object Form1: TForm1
end
object StaticText1: TStaticText
Left = 8
Top = 181
Top = 208
Width = 187
Height = 17
Caption = 'Right Click to Show Break Popup Menu'
Expand All @@ -143,7 +159,7 @@ object Form1: TForm1
end
object StaticText2: TStaticText
Left = 8
Top = 204
Top = 231
Width = 219
Height = 17
Caption = 'Right Click to Show Right To Left PopupMenu'
Expand Down Expand Up @@ -180,12 +196,12 @@ object Form1: TForm1
OnClick = CheckBoxHookDialogIconsClick
end
object OpenDialog1: TOpenDialog
Left = 160
Top = 166
Left = 368
Top = 214
end
object ColorDialog1: TColorDialog
Left = 104
Top = 158
Left = 384
Top = 62
end
object FontDialog1: TFontDialog
Font.Charset = DEFAULT_CHARSET
Expand Down Expand Up @@ -764,8 +780,8 @@ object Form1: TForm1
end
object PopupMenu1: TPopupMenu
Images = ImageList1
Left = 128
Top = 142
Left = 296
Top = 222
object I1: TMenuItem
Caption = 'Item 1'
ImageIndex = 2
Expand Down
46 changes: 46 additions & 0 deletions Demos/Vcl Styles Utils SysControls High DPI (Demo App)/uMain.pas
Expand Up @@ -94,6 +94,8 @@ TForm1 = class(TForm)
C1: TMenuItem;
CheckBoxModernDialogs: TCheckBox;
CheckBoxHookDialogIcons: TCheckBox;
BtnTaskDialog: TSpeedButton;
BtnTaskDialogCmd: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure ComboBoxStylesSelect(Sender: TObject);
procedure BtnOpenDialogClick(Sender: TObject);
Expand All @@ -110,6 +112,8 @@ TForm1 = class(TForm)
procedure BtnRaiseExceptionClick(Sender: TObject);
procedure BtnSelectFolderClick(Sender: TObject);
procedure BtnPrintDialogClick(Sender: TObject);
procedure BtnTaskDialogClick(Sender: TObject);
procedure BtnTaskDialogCmdClick(Sender: TObject);
procedure CheckBoxModernDialogsClick(Sender: TObject);
procedure CheckBoxHookDialogIconsClick(Sender: TObject);
private
Expand Down Expand Up @@ -236,4 +240,46 @@ procedure TForm1.BtnOpenDialogClick(Sender: TObject);
ShowMessage(Format('%s', [OpenDialog1.FileName]));
end;

procedure TForm1.BtnTaskDialogClick(Sender: TObject);
begin
with TTaskDialog.Create(Self) do
try
Caption := 'My Application';
Title := 'Hello World!';
Text := 'I am a TTaskDialog, that is, a wrapper for the Task Dialog introduced ' +
'in the Microsoft Windows Vista operating system. Am I not adorable?';
CommonButtons := [tcbClose];
Execute;
finally
Free;
end;
end;

procedure TForm1.BtnTaskDialogCmdClick(Sender: TObject);
begin
with TTaskDialog.Create(self) do
try
Title := 'Confirm Removal';
Caption := 'VCL style utils BookBase';
Text := 'Are you sure that you want to remove the book file named VCL Styles Utils for beginners!';
with TTaskDialogButtonItem(Buttons.Add) do
begin
Caption := 'Remove';
CommandLinkHint := 'Remove the book from the catalogue.';
ModalResult := mrYes;
end;
with TTaskDialogButtonItem(Buttons.Add) do
begin
Caption := 'Keep';
CommandLinkHint := 'Keep the book in the catalogue.';
ModalResult := mrNo;
end;
Flags := Flags + [tfUseCommandLinks];
CommonButtons := [];
Execute;
finally
Free;
end
end;

end.

0 comments on commit 0d3b840

Please sign in to comment.