summaryrefslogtreecommitdiff
path: root/UOverwrite.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UOverwrite.pas')
-rw-r--r--UOverwrite.pas55
1 files changed, 30 insertions, 25 deletions
diff --git a/UOverwrite.pas b/UOverwrite.pas
index e2d7b43..cf4854a 100644
--- a/UOverwrite.pas
+++ b/UOverwrite.pas
@@ -22,7 +22,7 @@ unit UOverwrite;
interface
uses
- gtk2, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls;
const OVERWRITE_CANCEL = 0;
OVERWRITE_OVERWRITE = 1;
@@ -36,7 +36,7 @@ const OVERWRITE_CANCEL = 0;
type
TFOverwrite = class(TGTKDialog)
FromLabel, FromInfoLabel, ToLabel, ToInfoLabel: TGTKLabel;
- ButtonTable: TGTKTable;
+ ButtonGrid: TGTKGrid;
FromVBox, ToVBox: TGTKVBox;
OverwriteButton, OverwriteAllButton, SkipButton, CancelButton, OverwriteAllOlderButton, SkipAllButton, RenameButton, AppendButton : TGTKButton;
procedure FormCreate(Sender: TObject); override;
@@ -54,20 +54,28 @@ var
implementation
-uses gdk2, ULocale, UCopyMove, UCoreUtils;
+uses ULocale, UCopyMove, UCoreUtils;
procedure TFOverwrite.FormCreate(Sender: TObject);
begin
Caption := LANGOverwriteQuestion;
FromLabel := TGTKLabel.Create(Self);
- FromLabel.XAlign := 0; FromLabel.XPadding := 10;
+ FromLabel.XAlign := 0;
+ FromLabel.MarginStart := 10;
+ FromLabel.MarginEnd := 10;
FromInfoLabel := TGTKLabel.Create(Self);
- FromInfoLabel.XAlign := 0; FromInfoLabel.XPadding := 40;
+ FromInfoLabel.XAlign := 0;
+ FromInfoLabel.MarginStart := 40;
+ FromInfoLabel.MarginEnd := 40;
ToLabel := TGTKLabel.Create(Self);
- ToLabel.XAlign := 0; ToLabel.XPadding := 10;
+ ToLabel.XAlign := 0;
+ ToLabel.MarginStart := 10;
+ ToLabel.MarginEnd := 10;
ToInfoLabel := TGTKLabel.Create(Self);
- ToInfoLabel.XAlign := 0; ToInfoLabel.XPadding := 40;
+ ToInfoLabel.XAlign := 0;
+ ToInfoLabel.MarginStart := 40;
+ ToInfoLabel.MarginEnd := 40;
OverwriteButton := TGTKButton.Create(Self);
OverwriteButton.Caption := LANGOverwriteButton_Caption;
OverwriteButton.OnClick := @ButtonClick;
@@ -92,12 +100,11 @@ begin
AppendButton := TGTKButton.Create(Self);
AppendButton.Caption := LANGAppendButton_Caption;
AppendButton.OnClick := @ButtonClick;
- ButtonTable := TGTKTable.Create(Self);
- ButtonTable.RowCount := 3;
- ButtonTable.ColCount := 3;
- ButtonTable.RowSpacing := 3;
- ButtonTable.ColSpacing := 3;
- ButtonTable.Homogeneous := True;
+ ButtonGrid := TGTKGrid.Create(Self);
+ ButtonGrid.RowSpacing := 3;
+ ButtonGrid.ColSpacing := 3;
+ ButtonGrid.RowHomogeneous := True;
+ ButtonGrid.ColHomogeneous := True;
FromVBox := TGTKVBox.Create(Self);
FromVBox.AddControlEx(FromLabel, True, True, 0);
FromVBox.AddControlEx(FromInfoLabel, True, True, 0);
@@ -106,7 +113,7 @@ begin
ToVBox.AddControlEx(ToInfoLabel, True, True, 0);
ClientArea.AddControlEx(FromVBox, True, True, 5);
ClientArea.AddControlEx(ToVBox, True, True, 5);
- ActionArea.AddControlEx(ButtonTable, True, True, 0);
+ ActionArea.AddControlEx(ButtonGrid, True, True, 0);
OnKeyDown := @FormKeyDown;
end;
@@ -120,20 +127,20 @@ begin
if (Key = gdk_keyval_to_lower(gdk_keyval_from_name(PChar(ExtractAccelerator(LANGSkipAllButton_Caption))))) then ModalResult := TMessageButton(OVERWRITE_SKIP_ALL) else
if (Key = gdk_keyval_to_lower(gdk_keyval_from_name(PChar(ExtractAccelerator(LANGRenameButton_Caption))))) then DoRename else
if (Key = gdk_keyval_to_lower(gdk_keyval_from_name(PChar(ExtractAccelerator(LANGAppendButton_Caption))))) then DoAppend else
- if (Key = GDK_ESCAPE) then ModalResult := TMessageButton(OVERWRITE_CANCEL);
+ if (Key = GDK_KEY_Escape) then ModalResult := TMessageButton(OVERWRITE_CANCEL);
end;
procedure TFOverwrite.AddButtons(ShowAppend: boolean);
begin
- ButtonTable.AddControl(0, 0, 1, 1, OverwriteButton, 0, 0);
- ButtonTable.AddControl(1, 0, 1, 1, OverwriteAllButton, 0, 0);
- ButtonTable.AddControl(2, 0, 1, 1, SkipButton, 0, 0);
- ButtonTable.AddControl(0, 1, 1, 1, CancelButton, 0, 0);
- ButtonTable.AddControl(1, 1, 1, 1, OverwriteAllOlderButton, 0, 0);
- ButtonTable.AddControl(2, 1, 1, 1, SkipAllButton, 0, 0);
- ButtonTable.AddControl(0, 2, 1, 1, RenameButton, 0, 0);
+ ButtonGrid.AddControl(0, 0, 1, 1, OverwriteButton);
+ ButtonGrid.AddControl(1, 0, 1, 1, OverwriteAllButton);
+ ButtonGrid.AddControl(2, 0, 1, 1, SkipButton);
+ ButtonGrid.AddControl(0, 1, 1, 1, CancelButton);
+ ButtonGrid.AddControl(1, 1, 1, 1, OverwriteAllOlderButton);
+ ButtonGrid.AddControl(2, 1, 1, 1, SkipAllButton);
+ ButtonGrid.AddControl(0, 2, 1, 1, RenameButton);
if ShowAppend then
- ButtonTable.AddControl(1, 2, 1, 1, AppendButton, 0, 0);
+ ButtonGrid.AddControl(1, 2, 1, 1, AppendButton);
end;
procedure TFOverwrite.ButtonClick(Sender: TObject);
@@ -173,8 +180,6 @@ begin
end;
-
-
end.