summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UChecksum.pas8
-rw-r--r--UChecksumDruid.pas95
-rw-r--r--UChmod.pas44
-rw-r--r--UChown.pas16
-rw-r--r--UColumns.pas63
-rw-r--r--UConfig.pas4
-rw-r--r--UConnectionManager.pas124
-rw-r--r--UConnectionProperties.pas228
-rw-r--r--UCopyMove.pas7
-rw-r--r--UCore.pas3
-rw-r--r--UCoreClasses.pas167
-rw-r--r--UCoreUtils.pas35
-rw-r--r--UCoreWorkers.pas2
-rw-r--r--UDirDelete.pas4
-rw-r--r--UEngines.pas2
-rw-r--r--UError.pas8
-rw-r--r--UFileAssoc.pas63
-rw-r--r--UFileTypeSettings.pas122
-rw-r--r--UGnome.pas494
-rw-r--r--UMain.pas549
-rw-r--r--UMounterPrefs.pas240
-rw-r--r--UNewDir.pas7
-rw-r--r--UOverwrite.pas55
-rw-r--r--UPreferences.pas1126
-rw-r--r--UProgress.pas13
-rw-r--r--UQuickConnect.pas117
-rw-r--r--URemoteWait.pas8
-rw-r--r--URunFromVFS.pas190
-rw-r--r--USearch.pas418
-rw-r--r--USelect.pas68
-rw-r--r--USplitFile.pas18
-rw-r--r--USymlink.pas8
-rw-r--r--UTestPlugin.pas127
-rw-r--r--UToolTips.pas65
-rw-r--r--UViewer.pas141
-rw-r--r--libgtk_kylix/GTKClasses.pas40
-rw-r--r--libgtk_kylix/GTKConsts.pas215
-rw-r--r--libgtk_kylix/GTKControls.pas388
-rw-r--r--libgtk_kylix/GTKDialogs.pas171
-rw-r--r--libgtk_kylix/GTKExtCtrls.pas238
-rw-r--r--libgtk_kylix/GTKForms.pas50
-rw-r--r--libgtk_kylix/GTKMenus.pas127
-rw-r--r--libgtk_kylix/GTKPixbuf.pas47
-rw-r--r--libgtk_kylix/GTKStdCtrls.pas262
-rw-r--r--libgtk_kylix/GTKText.pas5
-rw-r--r--libgtk_kylix/GTKUtils.pas41
-rw-r--r--libgtk_kylix/GTKView.pas53
-rw-r--r--vfs/UVFSCore.pas14
48 files changed, 3014 insertions, 3276 deletions
diff --git a/UChecksum.pas b/UChecksum.pas
index 2dcb3df..515ae8f 100644
--- a/UChecksum.pas
+++ b/UChecksum.pas
@@ -22,7 +22,7 @@ unit UChecksum;
interface
uses
- lazglib2, lazgobject2, gtk2, pango, SysUtils, Classes, Variants, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView, GTKText,
+ SysUtils, Classes, lazglib2, lazgobject2, lazgtk3, lazpango1, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView, GTKText,
UEngines;
type
@@ -155,7 +155,7 @@ begin
CommentTextView := TGTKTextView.Create(Self);
CommentTextView.ReadOnly := True;
CommentTextView.CursorVisible := True;
- gtk_widget_modify_font(CommentTextView.FWidget, pango_font_description_from_string('Monospace'))
+// TODO gtk_widget_modify_font(CommentTextView.FWidget, pango_font_description_from_string('Monospace'))
end;
procedure TFChecksum.FormDestroy(Sender: TObject);
@@ -190,8 +190,8 @@ end;
procedure TFChecksum.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
{ case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end; }
end;
diff --git a/UChecksumDruid.pas b/UChecksumDruid.pas
index 90df615..fc62347 100644
--- a/UChecksumDruid.pas
+++ b/UChecksumDruid.pas
@@ -22,8 +22,8 @@ unit UChecksumDruid;
interface
uses
- lazglib2, gdk2, gtk2, SysUtils, Classes, Variants, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts,
- GTKUtils, UEngines;
+ SysUtils, Classes, lazglib2, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls,
+ UEngines;
type
TFChecksumDruid = class(TGTKDialog)
@@ -49,7 +49,7 @@ type
procedure SeparateFileCheckBoxToggled(Sender: TObject);
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
private
- ColorFG, ColorBG, ColorGray: PGdkColor;
+// ColorFG, ColorBG, ColorGray: PGdkColor;
CurrentPage: integer;
Processing, Stop, StopBreak: boolean;
Buffer: Pointer;
@@ -91,17 +91,19 @@ begin
OnDestroy := @FormDestroy;
OnResponse := @FormResponse;
FileNames := TStringList.Create;
- ShowSeparator := False;
Buttons := [];
ActionArea.SetSizeRequest(0, 0);
DruidArea := TGTKVBox.Create(Self);
DruidArea.BorderWidth := 2;
ClientArea.AddControlEx(DruidArea, True, True, 0);
- CancelButton := TGTKButton.CreateFromStock(Self, 'gtk-cancel');
+ CancelButton := TGTKButton.CreateFromIconName(Self, 'gtk-cancel');
+ CancelButton.Caption := 'Cancel';
CancelButton.OnClick := @CancelButtonClick;
- BackButton := TGTKButton.CreateFromStock(Self, 'gtk-go-back');
+ BackButton := TGTKButton.CreateFromIconName(Self, 'gtk-go-back');
+ BackButton.Caption := 'Back';
BackButton.OnClick := @BackButtonClick;
- ForwardButton := TGTKButton.CreateFromStock(Self, 'gtk-go-forward');
+ ForwardButton := TGTKButton.CreateFromIconName(Self, 'gtk-go-forward');
+ ForwardButton.Caption := 'Forward';
ForwardButton.OnClick := @ForwardButtonClick;
ButtonBox := TGTKHButtonBox.Create(Self);
ButtonBox.Layout := blEnd;
@@ -111,20 +113,24 @@ begin
ButtonBox.AddControlEx(BackButton, False, False, 0);
ButtonBox.AddControlEx(ForwardButton, False, False, 0);
ClientArea.AddControlEndEx(ButtonBox, False, False, 0);
- ColorFG := GetDefaultForegroundColor(3);
- ColorBG := GetDefaultBackgroundColor(3);
- ColorGray := GetDefaultBackgroundColor(2);
+// ColorFG := GetDefaultForegroundColor(3);
+// ColorBG := GetDefaultBackgroundColor(3);
+// ColorGray := GetDefaultBackgroundColor(2);
TitleLabel := TGTKLabel.Create(Self);
TitleLabelBox := TGTKEventBox.Create(Self);
TitleLabelBox.AddControl(TitleLabel);
TitleLabelBox.BorderWidth := 0;
- TitleLabel.SetAlignment(0, 0.5);
- TitleLabel.SetPadding(5, 5);
- TitleLabel.SetForegroundColor(ColorFG);
- TitleLabelBox.SetBackgroundColor(ColorBG);
+ TitleLabel.XAlign := 0;
+ TitleLabel.XAlign := 0.5;
+ TitleLabel.MarginStart := 5;
+ TitleLabel.MarginEnd := 5;
+ TitleLabel.MarginTop := 5;
+ TitleLabel.MarginBottom := 5;
+// TitleLabel.SetForegroundColor(ColorFG);
+// TitleLabelBox.SetBackgroundColor(ColorBG);
DruidArea.AddControlEx(TitleLabelBox, False, False, 0);
PageAreaColor := TGTKEventBox.Create(Self);
- PageAreaColor.SetBackgroundColor(ColorGray);
+// PageAreaColor.SetBackgroundColor(ColorGray);
PageArea := TGTKVBox.Create(Self);
PageAreaColor.AddControl(PageArea);
DruidArea.AddControlEx(PageAreaColor, True, True, 0);
@@ -147,8 +153,8 @@ end;
procedure TFChecksumDruid.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
-// if Key = GDK_ESCAPE then ModalResult := mbCancel;
- if (Key = GDK_RETURN) or (Key = GDK_KP_ENTER) then ForwardButtonClick(Sender);
+// if Key = GDK_KEY_Escape then ModalResult := mbCancel;
+ if (Key = GDK_KEY_Return) or (Key = GDK_KEY_KP_Enter) then ForwardButtonClick(Sender);
end;
procedure TFChecksumDruid.CreatePages;
@@ -156,20 +162,21 @@ begin
Page1 := TGTKHBox.Create(Self);
Page1.Homogeneous := False;
LeftSpacer := TGTKEventBox.Create(Self);
- LeftSpacer.SetBackgroundColor(ColorBG);
+// LeftSpacer.SetBackgroundColor(ColorBG);
LeftSpacer.SetSizeRequest(100, -1);
Page1Label := TGTKLabel.Create(Self);
Page1Label.LineWrap := True;
- Page1Label.SetAlignment(0.5, 0.5);
+ Page1Label.XAlign := 0.5;
+ Page1Label.YAlign := 0.5;
Page1Label.Caption := LANGCCHKSUMPage1Text;
Page1.AddControlEx(LeftSpacer, False, False, 0);
Page1.AddControlEx(Page1Label, True, True, 0);
Page2 := TGTKEventBox.Create(Self);
- Page2.SetBackgroundColor(0, 0, 0);
+// Page2.SetBackgroundColor(0, 0, 0);
Page2Color := TGTKEventBox.Create(Self);
Page2Color.BorderWidth := 1;
- Page2Color.SetBackgroundColor(ColorGray);
+// Page2Color.SetBackgroundColor(ColorGray);
Page2.AddControl(Page2Color);
Page2ClientArea := TGTKVBox.Create(Self);
Page2Color.AddControl(Page2ClientArea);
@@ -184,10 +191,10 @@ begin
Page2ClientArea.BorderWidth := 30;
Page3 := TGTKEventBox.Create(Self);
- Page3.SetBackgroundColor(0, 0, 0);
+// Page3.SetBackgroundColor(0, 0, 0);
Page3Color := TGTKEventBox.Create(Self);
Page3Color.BorderWidth := 1;
- Page3Color.SetBackgroundColor(ColorGray);
+// Page3Color.SetBackgroundColor(ColorGray);
Page3.AddControl(Page3Color);
Page3ClientArea := TGTKVBox.Create(Self);
Page3Color.AddControl(Page3ClientArea);
@@ -214,30 +221,33 @@ begin
Page3ClientArea.AddControlEx(SeparateFileCheckHBox, False, False, 5);
Page4 := TGTKEventBox.Create(Self);
- Page4.SetBackgroundColor(0, 0, 0);
+// Page4.SetBackgroundColor(0, 0, 0);
Page4Color := TGTKEventBox.Create(Self);
Page4Color.BorderWidth := 1;
- Page4Color.SetBackgroundColor(ColorGray);
+// Page4Color.SetBackgroundColor(ColorGray);
Page4.AddControl(Page4Color);
Page4Label := TGTKLabel.Create(Self);
Page4Label.LineWrap := True;
- Page4Label.SetAlignment(0.5, 0.5);
+ Page4Label.XAlign := 0.5;
+ Page4Label.YAlign := 0.5;
Page4Label.Caption := LANGCCHKSUMPage4Text;
Page4Color.AddControl(Page4Label);
Page5 := TGTKEventBox.Create(Self);
- Page5.SetBackgroundColor(0, 0, 0);
+// Page5.SetBackgroundColor(0, 0, 0);
Page5Color := TGTKEventBox.Create(Self);
Page5Color.BorderWidth := 1;
- Page5Color.SetBackgroundColor(ColorGray);
+// Page5Color.SetBackgroundColor(ColorGray);
Page5.AddControl(Page5Color);
Page5ClientArea := TGTKVBox.Create(Self);
Page5Color.AddControl(Page5ClientArea);
ProcessingLabel := TGTKLabel.Create(Self);
ProcessingLabel.Caption := Format(LANGCCHKSUMNowProcessingFileS, ['---']);
- ProcessingLabel.XPadding := 20;
+ ProcessingLabel.MarginStart := 20;
+ ProcessingLabel.MarginEnd := 20;
+ ProcessingLabel.MarginTop := 10;
+ ProcessingLabel.MarginBottom := 10;
ProcessingLabel.XAlign := 0;
- ProcessingLabel.YPadding := 10;
ProcessingLabel.SetSizeRequest(10, -1);
Page5ClientArea.AddControlEx(ProcessingLabel, False, False, 10);
ProgressHBox := TGTKHBox.Create(Self);
@@ -247,14 +257,14 @@ begin
Page5ClientArea.AddControlEx(TGTKLabel.Create(Self), True, True, 0);
Page6 := TGTKEventBox.Create(Self);
- Page6.SetBackgroundColor(0, 0, 0);
+// Page6.SetBackgroundColor(0, 0, 0);
Page6Color := TGTKEventBox.Create(Self);
Page6Color.BorderWidth := 1;
- Page6Color.SetBackgroundColor(ColorGray);
+// Page6Color.SetBackgroundColor(ColorGray);
Page6.AddControl(Page6Color);
Page6Label := TGTKLabel.Create(Self);
Page6Label.LineWrap := True;
- Page6Label.SetAlignment(0.5, 0.4);
+// Page6Label.SetAlignment(0.5, 0.4);
Page6Label.Caption := LANGCCHKSUMPage6Text;
Page6Label.UseMarkup := True;
Page6Label.XAlign := 0.05;
@@ -267,8 +277,12 @@ begin
Page6Color.AddControl(Page6ClientArea);
ErrorLabel := TGTKLabel.Create(Self);
ErrorLabel.Selectable := True;
- ErrorLabel.SetAlignment(0, 0);
- ErrorLabel.SetPadding(2, 2);
+ ErrorLabel.XAlign := 0;
+ ErrorLabel.YAlign := 0;
+ ErrorLabel.MarginStart := 2;
+ ErrorLabel.MarginEnd := 2;
+ ErrorLabel.MarginTop := 2;
+ ErrorLabel.MarginBottom := 2;
ErrorLabel.Alignment := taLeftJustify;
ErrorLabelScrolledWindow := TGTKScrolledWindow.Create(Self);
ErrorLabelScrolledWindow.HorizScrollBarPolicy := sbAutomatic;
@@ -281,11 +295,12 @@ begin
Page7 := TGTKHBox.Create(Self);
Page7.Homogeneous := False;
LeftSpacer7 := TGTKEventBox.Create(Self);
- LeftSpacer7.SetBackgroundColor(ColorBG);
+// LeftSpacer7.SetBackgroundColor(ColorBG);
LeftSpacer7.SetSizeRequest(100, -1);
Page7Label := TGTKLabel.Create(Self);
Page7Label.LineWrap := True;
- Page1Label.SetAlignment(0.5, 0.5);
+ Page7Label.XAlign := 0.5;
+ Page7Label.YAlign := 0.5;
Page7Label.Caption := LANGCCHKSUMPage7Text;
Page7.AddControlEx(LeftSpacer7, False, False, 0);
Page7.AddControlEx(Page7Label, True, True, 0);
@@ -348,10 +363,10 @@ begin
BackButton.Enabled := CurrentPage > 1;
ForwardButton.Enabled := CurrentPage < NumPages;
if CurrentPage < NumPages then begin
- if not ForwardButton.UseStock then ForwardButton.Caption := 'gtk-go-forward';
- ForwardButton.UseStock := True;
+ // FIXME: show the icon, if hidden
+ ForwardButton.Caption := 'Forward';
end else begin
- ForwardButton.UseStock := False;
+ // FIXME: hide the icon
ForwardButton.Caption := LANGCCHKSUMFinishCaption;
end;
// after page changed
diff --git a/UChmod.pas b/UChmod.pas
index d4d43ba..b1c6b23 100644
--- a/UChmod.pas
+++ b/UChmod.pas
@@ -22,7 +22,7 @@ unit UChmod;
interface
uses
- SysUtils, Classes, Variants, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKMenus;
+ SysUtils, Classes, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls;
type
TFChmod = class(TGTKDialog)
@@ -31,8 +31,7 @@ type
PermissionFrame, FileFrame: TGTKFrame;
RecursiveCheckButton, cbSUID, cbSGID, cbSticky, cbUSRRead, cbUSRWrite, cbUSRExec, cbGRPRead, cbGRPWrite, cbGRPExec,
cbALLRead, cbALLWrite, cbALLExec: TGTKCheckButton;
- RecursiveOptionMenu: TGTKOptionMenu;
- miAllFiles, miDirectories, miFiles: TGTKMenuItem;
+ RecursiveComboBox: TGTKComboBoxText;
FileLabel, OctalLabel, TextLabel: TGTKLabel;
OctalEntry: TGTKEntry;
procedure FormCreate(Sender: TObject); override;
@@ -70,25 +69,20 @@ begin
FileFrame := TGTKFrame.Create(Self);
FileFrame.Caption := LANGFChmod_FileFrame;
HBox.AddControlEx(PermissionFrame, True, True, 5);
- HBox.AddControlEx(FileFrame, True, True, 5);
+ HBox.AddControlEx(FileFrame, False, False, 5);
HBox2 := TGTKHBox.Create(Self);
HBox2.Homogeneous := False;
HBox2.BorderWidth := 5;
RecursiveCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGFChmod_ApplyRecursivelyFor);
RecursiveCheckButton.OnToggled := @RecursiveCheckButtonToggled;
- RecursiveOptionMenu := TGTKOptionMenu.Create(Self);
- miAllFiles := TGTKMenuItem.Create(Self);
- miAllFiles.Caption := LANGFChmod_miAllFiles;
- RecursiveOptionMenu.Items.Add(miAllFiles);
- miDirectories := TGTKMenuItem.Create(Self);
- miDirectories.Caption := LANGFChmod_miDirectories;
- RecursiveOptionMenu.Items.Add(miDirectories);
- miFiles := TGTKMenuItem.Create(Self);
- miFiles.Caption := LANGmiFiles_Caption;
- RecursiveOptionMenu.Items.Add(miFiles);
+ RecursiveComboBox := TGTKComboBoxText.Create(Self);
+ RecursiveComboBox.AppendItem(LANGFChmod_miAllFiles);
+ RecursiveComboBox.AppendItem(LANGFChmod_miDirectories);
+ RecursiveComboBox.AppendItem(LANGmiFiles_Caption);
+ RecursiveComboBox.ItemIndex := 0;
HBox2.AddControlEx(TGTKLabel.Create(Self), False, False, 10);
HBox2.AddControlEx(RecursiveCheckButton, False, False, 5);
- HBox2.AddControlEx(RecursiveOptionMenu, False, False, 5);
+ HBox2.AddControlEx(RecursiveComboBox, False, False, 5);
HBox3 := TGTKHBox.Create(Self);
HBox3.Homogeneous := False;
@@ -116,12 +110,16 @@ begin
ClientArea.AddControlEx(HBox2, False, False, 0);
FileLabel := TGTKLabel.Create(Self);
- FileLabel.SetAlignment(0, 0);
- FileLabel.SetPadding(10, 5);
- FileLabel.Caption := '<span weight="ultrabold">File:</span> .adobe'#10'<span weight="ultrabold">Text:</span> rw-rw-rw'#10 +
- '<span weight="ultrabold">Octal:</span> 666'#10'<span weight="ultrabold">Owner:</span> root'#10 +
- '<span weight="ultrabold">Group:</span> root';
+ FileLabel.XAlign := 0;
+ FileLabel.YAlign := 0;
+ FileLabel.MarginStart := 10;
+ FileLabel.MarginEnd := 10;
+ FileLabel.MarginTop := 5;
+ FileLabel.MarginBottom := 5;
FileLabel.UseMarkup := True;
+ // TODO
+ gtk_widget_set_hexpand(FileLabel.FWidget, False);
+ gtk_widget_set_size_request(FileLabel.FWidget, 200, -1);
FileFrame.AddControl(FileLabel);
VBox := TGTKVBox.Create(Self);
@@ -164,14 +162,14 @@ end;
procedure TFChmod.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
procedure TFChmod.RecursiveCheckButtonToggled(Sender: TObject);
begin
- RecursiveOptionMenu.Enabled := RecursiveCheckButton.Checked;
+ RecursiveComboBox.Enabled := RecursiveCheckButton.Checked;
end;
procedure TFChmod.PermissionsCheckBoxToggle(Sender: TObject);
diff --git a/UChown.pas b/UChown.pas
index 0e95c44..7f9a389 100644
--- a/UChown.pas
+++ b/UChown.pas
@@ -22,7 +22,7 @@ unit UChown;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKView;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView;
type
TFChown = class(TGTKDialog)
@@ -81,11 +81,15 @@ begin
ClientArea.AddControlEx(HBox2, False, False, 3);
FileLabel := TGTKLabel.Create(Self);
- FileLabel.SetAlignment(0, 0);
- FileLabel.SetPadding(10, 5);
+ FileLabel.XAlign := 0;
+ FileLabel.YAlign := 0;
+ FileLabel.MarginStart := 10;
+ FileLabel.MarginEnd := 10;
+ FileLabel.MarginTop := 5;
+ FileLabel.MarginBottom := 5;
FileLabel.Caption := '<span weight="ultrabold">File:</span> .adobe'#10'<span weight="ultrabold">Text:</span> rw-rw-rw'#10 +
'<span weight="ultrabold">Octal:</span> 666'#10'<span weight="ultrabold">Owner:</span> root'#10 +
- '<span weight="ultrabold">Group:</span> root';
+ '<span weight="ultrabold">Group:</span> root';
FileLabel.UseMarkup := True;
FileFrame.AddControl(FileLabel);
@@ -122,8 +126,8 @@ end;
procedure TFChown.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
diff --git a/UColumns.pas b/UColumns.pas
index 773b399..aad8066 100644
--- a/UColumns.pas
+++ b/UColumns.pas
@@ -22,8 +22,7 @@ unit UColumns;
interface
uses
- gdk2, gtk2, SysUtils, Classes, Variants, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView, GTKPixbuf,
- UCoreClasses;
+ SysUtils, Classes, lazglib2, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView, GTKPixbuf;
type
TFColumns = class(TGTKDialog)
@@ -34,8 +33,8 @@ type
TitleHBox: TGTKHBox;
ListView: TGTKListView;
ListViewScrolledWindow: TGTKScrolledWindow;
- ListViewTable: TGTKTable;
- MoveUpButton, MoveDownButton: TGTKImageButton;
+ ListViewGrid: TGTKGrid;
+ MoveUpButton, MoveDownButton: TGTKButton;
procedure FormCreate(Sender: TObject); override;
procedure ListViewSelectionChanged(Sender: TObject);
procedure MoveUpDownButtonButtonClick(Sender: TObject);
@@ -57,27 +56,29 @@ uses ULocale, UConfig;
procedure TFColumns.FormCreate(Sender: TObject);
var Column: TGTKTreeViewColumn;
row_targets: TGtkTargetEntry;
+ VBox: TGTKVBox;
begin
row_targets.target := PChar('GTK_TREE_MODEL_ROW');
- row_targets.flags := GTK_TARGET_SAME_WIDGET;
+ row_targets.flags := guint(GTK_TARGET_SAME_WIDGET);
row_targets.info := 1;
SetDefaultSize(250, 350);
Caption := LANGColumns_Caption;
Buttons := [mbOK, mbCancel];
- ShowSeparator := False;
TitleEventBox := TGTKEventBox.Create(Self);
TitleLabel := TGTKLabel.Create(Self);
TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [LANGColumns_Title]);
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-justify-center', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-justify-center', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
@@ -87,16 +88,16 @@ begin
TitleFrame.AddControl(TitleEventBox);
ClientArea.AddControlEx(TitleFrame, False, True, 0);
- ListViewTable := TGTKTable.Create(Self);
- ListViewTable.BorderWidth := 7;
- ClientArea.AddControlEx(ListViewTable, True, True, 0);
+ ListViewGrid := TGTKGrid.Create(Self);
+ ListViewGrid.BorderWidth := 7;
+ ClientArea.AddControlEx(ListViewGrid, True, True, 0);
ListView := TGTKListView.CreateTyped(Self, False, [lcBoolean, lcText, lcNumber]);
{ ListView.Reorderable := True;
g_object_set(ListView.FWidget, 'reorderable', integer(True), nil); }
- gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(ListView.FWidget), GDK_BUTTON1_MASK, @row_targets, 1, GDK_ACTION_MOVE);
- gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(ListView.FWidget), @row_targets, 1, GDK_ACTION_MOVE);
+ gtk_tree_view_enable_model_drag_source(PGtkTreeView(ListView.FWidget), [GDK_BUTTON1_MASK], @row_targets, 1, [GDK_ACTION_MOVE]);
+ gtk_tree_view_enable_model_drag_dest(PGtkTreeView(ListView.FWidget), @row_targets, 1, [GDK_ACTION_MOVE]);
ListView.RulesHint := True;
ListView.ShowHeaders := False;
@@ -115,21 +116,35 @@ begin
ListViewScrolledWindow.HorizScrollBarPolicy := sbAutomatic;
ListViewScrolledWindow.VertScrollBarPolicy := sbAutomatic;
ListViewScrolledWindow.ShadowType := stShadowIn;
+ ListViewScrolledWindow.MarginTop := 5;
+ ListViewScrolledWindow.MarginBottom := 5;
- MoveUpButton := TGTKImageButton.CreateWithoutLabel(Self);
- MoveUpButton.SetFromStock('gtk-go-up', isSmallToolbar);
+ MoveUpButton := TGTKButton.CreateFromIconName(Self, 'gtk-go-up');
MoveUpButton.Tooltip := LANGColumns_MoveUpButtonTooltip;
MoveUpButton.CanFocus := False;
- MoveDownButton := TGTKImageButton.CreateWithoutLabel(Self);
- MoveDownButton.SetFromStock('gtk-go-down', isSmallToolbar);
+ MoveUpButton.MarginStart := 5;
+ MoveUpButton.MarginEnd := 5;
+ MoveUpButton.MarginTop := 5;
+ MoveUpButton.MarginBottom := 5;
+ MoveDownButton := TGTKButton.CreateFromIconName(Self, 'gtk-go-down');
MoveDownButton.Tooltip := LANGColumns_MoveDownButtonTooltip;
MoveDownButton.CanFocus := False;
-
- ListViewTable.AddControlEx(0, 1, 3, 4, ListViewScrolledWindow, [taoExpand, taoFill], [taoExpand, taoFill], 0, 5);
- ListViewTable.AddControlEx(3, 2, 1, 1, MoveUpButton, [taoShrink, taoFill], [taoShrink], 5, 5);
- ListViewTable.AddControlEx(3, 3, 1, 1, MoveDownButton, [taoShrink, taoFill], [taoShrink], 5, 5);
- ListViewTable.AddControlEx(3, 1, 1, 1, TGTKLabel.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 0, 2);
- ListViewTable.AddControlEx(3, 4, 1, 1, TGTKLabel.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 0, 2);
+ MoveDownButton.MarginStart := 5;
+ MoveDownButton.MarginEnd := 5;
+ MoveDownButton.MarginTop := 5;
+ MoveDownButton.MarginBottom := 5;
+
+ ListViewGrid.AddControl(0, 1, 3, 4, ListViewScrolledWindow);
+ ListViewGrid.AddControl(3, 2, 1, 1, MoveUpButton);
+ ListViewGrid.AddControl(3, 3, 1, 1, MoveDownButton);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ ListViewGrid.AddControl(3, 1, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ ListViewGrid.AddControl(3, 4, 1, 1, VBox);
AddColumnItems;
diff --git a/UConfig.pas b/UConfig.pas
index ed62068..f6bd6d8 100644
--- a/UConfig.pas
+++ b/UConfig.pas
@@ -143,7 +143,7 @@ function CheckConfFilesMod(var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, C
implementation
-uses ULibc, glib2, SysUtils, UCoreUtils, UCore, UFileAssoc, UCoreClasses, UGnome, UVFSCore;
+uses ULibc, lazglib2, SysUtils, UCoreUtils, UCore, UFileAssoc, UCoreClasses, UGnome, UVFSCore;
var InternalQuickExit, InternalDeleteHistory: boolean;
InternalMainGUIConfmtime, InternalBookmarksConfmtime, InternalFAssocConfmtime, InternalMounterConfmtime,
@@ -1070,7 +1070,7 @@ begin
if ConnectionMgrList.Count > 0 then
for i := 0 to ConnectionMgrList.Count - 1 do
with TConnMgrItem(ConnectionMgrList[i]) do begin
- SectionTitle := Format('%d_%d_%d', [g_str_hash(PChar(ConnectionName)), i, g_str_hash(PChar(GetURI(False)))]);
+ SectionTitle := Format('%d_%d_%d', [g_str_hash(gpointer(PChar(ConnectionName))), i, g_str_hash(gpointer(PChar(GetURI(False))))]);
IniFile.EraseSection(SectionTitle);
IniFile.WriteString(SectionTitle, 'ConnectionName', ConnectionName);
IniFile.WriteString(SectionTitle, 'ServiceType', ServiceType);
diff --git a/UConnectionManager.pas b/UConnectionManager.pas
index bf9e67f..0be9305 100644
--- a/UConnectionManager.pas
+++ b/UConnectionManager.pas
@@ -22,7 +22,7 @@ unit UConnectionManager;
interface
uses
- lazglib2, gtk2, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKView,
+ SysUtils, Classes, lazglib2, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView,
GTKPixbuf, GTKMenus,
UCore, UCoreWorkers, UCoreClasses, UVFSCore, UEngines;
@@ -35,9 +35,9 @@ type
TitleHBox: TGTKHBox;
ListView: TGTKListView;
ListViewScrolledWindow: TGTKScrolledWindow;
- ListViewTable: TGTKTable;
- AddConnectionButton, EditButton, RemoveButton, DuplicateButton: TGTKImageButton;
- QuickConnectButton: TGTKImageButton;
+ ListViewGrid: TGTKGrid;
+ AddConnectionButton, EditButton, RemoveButton, DuplicateButton: TGTKButton;
+ QuickConnectButton: TGTKButton;
ButtonBox: TGTKVButtonBox;
ActionButtonBox: TGTKHButtonBox;
ConnectButton, StopButton, CloseButton: TGTKButton;
@@ -78,21 +78,23 @@ uses ULocale, UCoreUtils, UConfig, UConnectionProperties, UGnome, UQuickConnect,
procedure TFConnectionManager.FormCreate(Sender: TObject);
-const row_targets: TGtkTargetEntry = (target: 'GTK_TREE_MODEL_ROW'; flags: GTK_TARGET_SAME_WIDGET; info: 1;);
+const row_targets: TGtkTargetEntry = (target: 'GTK_TREE_MODEL_ROW'; flags: guint(GTK_TARGET_SAME_WIDGET); info: 1;);
var Column: TGTKTreeViewColumn;
+ VBox: TGTKVBox;
begin
Thread := nil;
ConnectedEngine := nil;
SetDefaultSize(650, 500);
Caption := LANGConnMgr_Caption;
Buttons := [];
- ShowSeparator := False;
ConnectButton := TGTKButton.Create(Self);
ConnectButton.Caption := LANGConnMgr_ConnectButton;
// ConnectButton.Default := True;
- CloseButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_CLOSE);
- StopButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_STOP);
+ CloseButton := TGTKButton.CreateFromIconName(Self, GTK_STOCK_CLOSE);
+ CloseButton.Caption := 'Close';
+ StopButton := TGTKButton.CreateFromIconName(Self, GTK_STOCK_STOP);
+ StopButton.Caption := 'Stop';
StopButton.Visible := False;
StopButton.Enabled := False;
// Default := ConnectButton;
@@ -111,13 +113,15 @@ begin
TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [LANGConnMgr_OpenConnection]);
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-connect', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-connect', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
@@ -127,9 +131,9 @@ begin
TitleFrame.AddControl(TitleEventBox);
ClientArea.AddControlEx(TitleFrame, False, True, 0);
- ListViewTable := TGTKTable.Create(Self);
- ListViewTable.BorderWidth := 7;
- ClientArea.AddControlEx(ListViewTable, True, True, 0);
+ ListViewGrid := TGTKGrid.Create(Self);
+ ListViewGrid.BorderWidth := 7;
+ ClientArea.AddControlEx(ListViewGrid, True, True, 0);
ListView := TGTKListView.CreateTyped(Self, True, [lcPointer, lcText, lcText]);
ListView.SelectionMode := smSingle;
@@ -164,28 +168,27 @@ begin
ListViewScrolledWindow.HorizScrollBarPolicy := sbAutomatic;
ListViewScrolledWindow.VertScrollBarPolicy := sbAutomatic;
ListViewScrolledWindow.ShadowType := stShadowIn;
+ ListViewScrolledWindow.MarginTop := 5;
+ ListViewScrolledWindow.MarginBottom := 5;
- AddConnectionButton := TGTKImageButton.Create(Self);
- AddConnectionButton.SetFromStock('gtk-add', isSmallToolbar);
+ AddConnectionButton := TGTKButton.CreateFromIconName(Self, 'gtk-add');
AddConnectionButton.Caption := LANGConnMgr_AddConnectionButtonCaption;
AddConnectionButton.UseUnderline := True;
AddConnectionButton.Tooltip := LANGConnMgr_AddConnectionButtonTooltip;
- EditButton := TGTKImageButton.Create(Self);
+ EditButton := TGTKButton.Create(Self);
EditButton.Caption := LANGConnMgr_EditButtonCaption;
EditButton.UseUnderline := True;
EditButton.Tooltip := LANGConnMgr_EditButtonTooltip;
- RemoveButton := TGTKImageButton.Create(Self);
- RemoveButton.SetFromStock('gtk-remove', isSmallToolbar);
+ RemoveButton := TGTKButton.CreateFromIconName(Self, 'gtk-remove');
RemoveButton.Caption := LANGConnMgr_RemoveButtonCaption;
RemoveButton.UseUnderline := True;
RemoveButton.Tooltip := LANGConnMgr_RemoveButtonTooltip;
- DuplicateButton := TGTKImageButton.Create(Self);
+ DuplicateButton := TGTKButton.Create(Self);
DuplicateButton.Caption := LANGFConnectionManager_DuplicateButton_Caption;
DuplicateButton.UseUnderline := True;
DuplicateButton.Tooltip := LANGFConnectionManager_DuplicateButton_Tooltip;
- QuickConnectButton := TGTKImageButton.Create(Self);
- QuickConnectButton.SetFromStock('gtk-connect', isSmallToolbar);
+ QuickConnectButton := TGTKButton.CreateFromIconName(Self, 'gtk-connect');
QuickConnectButton.Caption := LANGmiQuickConnectCaption;
QuickConnectButton.UseUnderline := True;
@@ -198,34 +201,47 @@ begin
ButtonBox.AddControl(EditButton);
ButtonBox.AddControl(DuplicateButton);
ButtonBox.AddControl(RemoveButton);
+ ButtonBox.MarginStart := 5;
+ ButtonBox.MarginEnd := 5;
+ ButtonBox.MarginTop := 5;
+ ButtonBox.MarginBottom := 5;
DoNotSavePasswordsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGFConnectionManager_DoNotSavePasswordsCheckBox_Label);
DoNotSavePasswordsCheckBox.Tooltip := LANGFConnectionManager_DoNotSavePasswordsCheckBox_Tooltip;
+ DoNotSavePasswordsCheckBox.MarginStart := 10;
+ DoNotSavePasswordsCheckBox.MarginEnd := 10;
DoNotSynchronizeKeyringCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGFConnectionManager_DoNotSynchronizeKeyringCheckBox_Label);
DoNotSynchronizeKeyringCheckBox.Tooltip := LANGFConnectionManager_DoNotSynchronizeKeyringCheckBox_Tooltip;
+ DoNotSynchronizeKeyringCheckBox.MarginStart := 10;
+ DoNotSynchronizeKeyringCheckBox.MarginEnd := 10;
+ DoNotSynchronizeKeyringCheckBox.MarginTop := 2;
+ DoNotSynchronizeKeyringCheckBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
- ListViewTable.AddControlEx(0, 1, 3, 5, ListViewScrolledWindow, [taoExpand, taoFill], [taoExpand, taoFill], 0, 5);
- ListViewTable.AddControlEx(0, 6, 3, 1, DoNotSavePasswordsCheckBox, [taoExpand, taoFill], [taoShrink], 10, 0);
- ListViewTable.AddControlEx(0, 7, 3, 1, DoNotSynchronizeKeyringCheckBox, [taoExpand, taoFill], [taoShrink], 10, 2);
- ListViewTable.AddControlEx(3, 2, 1, 3, ButtonBox, [taoShrink, taoFill], [taoShrink], 5, 5);
- ListViewTable.AddControlEx(3, 5, 1, 1, TGTKLabel.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 0, 2);
+ ListViewGrid.AddControl(0, 1, 3, 5, ListViewScrolledWindow);
+ ListViewGrid.AddControl(0, 6, 3, 1, DoNotSavePasswordsCheckBox);
+ ListViewGrid.AddControl(0, 7, 3, 1, DoNotSynchronizeKeyringCheckBox);
+ ListViewGrid.AddControl(3, 2, 1, 3, ButtonBox);
+ ListViewGrid.AddControl(3, 5, 1, 1, VBox);
ItemsPopupMenu := TGTKMenuItem.Create(Self);
ConnectMenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
ConnectMenuItem.Caption := LANGConnMgr_ConnectButton;
- ConnectMenuItem.StockIcon := 'gtk-connect';
+ ConnectMenuItem.IconName := 'gtk-connect';
ConnectMenuItem.OnClick := @ConnectButtonClick;
AddConnectionMenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
AddConnectionMenuItem.Caption := LANGConnMgr_AddConnectionButtonCaption;
- AddConnectionMenuItem.StockIcon := 'gtk-add';
+ AddConnectionMenuItem.IconName := 'gtk-add';
AddConnectionMenuItem.OnClick := @AddConnectionButtonClick;
EditMenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
EditMenuItem.Caption := LANGConnMgr_EditButtonCaption;
EditMenuItem.OnClick := @EditButtonClick;
RemoveMenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
RemoveMenuItem.Caption := LANGConnMgr_RemoveButtonCaption;
- RemoveMenuItem.StockIcon := 'gtk-remove';
+ RemoveMenuItem.IconName := 'gtk-remove';
RemoveMenuItem.OnClick := @RemoveButtonClick;
DuplicateMenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
DuplicateMenuItem.Caption := LANGFConnectionManager_DuplicateMenuItem_Caption;
@@ -277,13 +293,13 @@ end;
procedure TFConnectionManager.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: if StopButton.Visible then StopButtonClick(Sender) else
- if Assigned(ListView.Selected) then DoConnect;
- GDK_ESCAPE: begin
- Accept := False;
- if StopButton.Visible then StopButtonClick(Sender)
- else ModalResult := mbCancel;
- end;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: if StopButton.Visible then StopButtonClick(Sender) else
+ if Assigned(ListView.Selected) then DoConnect;
+ GDK_KEY_Escape: begin
+ Accept := False;
+ if StopButton.Visible then StopButtonClick(Sender)
+ else ModalResult := mbCancel;
+ end;
end;
end;
@@ -296,7 +312,7 @@ end;
procedure TFConnectionManager.ListViewKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_Delete_Key: RemoveButtonClick(Sender);
+ GDK_KEY_Delete: RemoveButtonClick(Sender);
end;
end;
@@ -334,9 +350,7 @@ begin
ConnMgrItem.Username := UserNameEntry.Text;
ConnMgrItem.Password := PasswordEntry.Text;
ConnMgrItem.TargetDir := TargetDirEntry.Text;
- ConnMgrItem.PluginID := '';
- if (PluginOptionMenu.ItemIndex <> 0) and (PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data <> nil) then
- ConnMgrItem.PluginID := TVFSPlugin(PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data).ModuleID;
+ ConnMgrItem.PluginID := PluginComboBox.ItemID;
end;
ConnectionMgrList.Add(ConnMgrItem);
Item := ListView.Items.Add;
@@ -365,13 +379,9 @@ begin
FConnectionProperties := TFConnectionProperties.Create(Self);
FConnectionProperties.NameEntry.Text := ConnMgrItem.ConnectionName;
FConnectionProperties.URIEntry.Text := ConstructURI(True, False, ConnMgrItem.ServiceType, ConnMgrItem.Server, ConnMgrItem.Username, ConnMgrItem.Password, ConnMgrItem.TargetDir);
- FConnectionProperties.ServiceTypeOptionMenuChanged(Sender);
+ FConnectionProperties.ServiceTypeComboBoxChanged(Sender);
// Find the plugin by PluginID
- for i := 0 to FConnectionProperties.PluginOptionMenu.Items.Count - 1 do
- if (FConnectionProperties.PluginOptionMenu.Items[i].Data <> nil) and (TVFSPlugin(FConnectionProperties.PluginOptionMenu.Items[i].Data).ModuleID = ConnMgrItem.PluginID) then begin
- FConnectionProperties.PluginOptionMenu.ItemIndex := i;
- Break;
- end;
+ FConnectionProperties.PluginComboBox.ItemID := ConnMgrItem.PluginID;
if FConnectionProperties.Run = mbOK then begin
with FConnectionProperties do begin
@@ -381,9 +391,7 @@ begin
ConnMgrItem.Username := UserNameEntry.Text;
ConnMgrItem.Password := PasswordEntry.Text;
ConnMgrItem.TargetDir := TargetDirEntry.Text;
- ConnMgrItem.PluginID := '';
- if (PluginOptionMenu.ItemIndex <> 0) and (PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data <> nil) then
- ConnMgrItem.PluginID := TVFSPlugin(PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data).ModuleID;
+ ConnMgrItem.PluginID := PluginComboBox.ItemID;
end;
Item.SetValue(1, ConnMgrItem.ConnectionName);
Item.SetValue(2, FConnectionProperties.MakeURI(True));
@@ -407,13 +415,9 @@ begin
FConnectionProperties := TFConnectionProperties.Create(Self);
FConnectionProperties.NameEntry.Text := '';
FConnectionProperties.URIEntry.Text := ConstructURI(True, False, ConnMgrItem.ServiceType, ConnMgrItem.Server, ConnMgrItem.Username, ConnMgrItem.Password, ConnMgrItem.TargetDir);
- FConnectionProperties.ServiceTypeOptionMenuChanged(Sender);
+ FConnectionProperties.ServiceTypeComboBoxChanged(Sender);
// Find the plugin by PluginID
- for i := 0 to FConnectionProperties.PluginOptionMenu.Items.Count - 1 do
- if (FConnectionProperties.PluginOptionMenu.Items[i].Data <> nil) and (TVFSPlugin(FConnectionProperties.PluginOptionMenu.Items[i].Data).ModuleID = ConnMgrItem.PluginID) then begin
- FConnectionProperties.PluginOptionMenu.ItemIndex := i;
- Break;
- end;
+ FConnectionProperties.PluginComboBox.ItemID := ConnMgrItem.PluginID;
if FConnectionProperties.Run = mbOK then begin
ConnMgrItem := TConnMgrItem.Create;
@@ -424,9 +428,7 @@ begin
ConnMgrItem.Username := UserNameEntry.Text;
ConnMgrItem.Password := PasswordEntry.Text;
ConnMgrItem.TargetDir := TargetDirEntry.Text;
- ConnMgrItem.PluginID := '';
- if (PluginOptionMenu.ItemIndex <> 0) and (PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data <> nil) then
- ConnMgrItem.PluginID := TVFSPlugin(PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data).ModuleID;
+ ConnMgrItem.PluginID := PluginComboBox.ItemID;
end;
ConnectionMgrList.Add(ConnMgrItem);
Item := ListView.Items.Add;
@@ -581,7 +583,7 @@ begin
if res <> mbYes then Exit;
end;
- ListViewTable.Enabled := False;
+ ListViewGrid.Enabled := False;
CloseButton.Enabled := False;
ConnectButton.Enabled := False;
ConnectButton.Visible := False;
@@ -604,7 +606,7 @@ begin
if not DoConnectInternal(UTF8ToStr(FActiveConnInfo.GetURI(False)), Engine, Self, False, @Error) then begin
if not FSilenceError then
ShowError(Self, 'Couldn''t open the URI specified', Error);
- ListViewTable.Enabled := True;
+ ListViewGrid.Enabled := True;
CloseButton.Enabled := True;
ConnectButton.Enabled := True;
ConnectButton.Visible := True;
diff --git a/UConnectionProperties.pas b/UConnectionProperties.pas
index a7dd921..689af4d 100644
--- a/UConnectionProperties.pas
+++ b/UConnectionProperties.pas
@@ -22,21 +22,21 @@ unit UConnectionProperties;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKMenus;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls;
type
TFConnectionProperties = class(TGTKDialog)
Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9: TGTKLabel;
Box: TGTKVBox;
- Table1, Table2: TGTKTable;
- PluginOptionMenu, ServiceTypeOptionMenu: TGTKOptionMenu;
+ Grid1, Grid2: TGTKGrid;
+ PluginComboBox, ServiceTypeComboBox: TGtkComboBoxText;
URIEntry, NameEntry, ServerEntry, UserNameEntry, PasswordEntry, TargetDirEntry: TGTKEntry;
MaskPasswordCheckButton: TGTKCheckButton;
procedure FormCreate(Sender: TObject); override;
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
procedure NameEntryChanged(Sender: TObject);
procedure URIEntryChanged(Sender: TObject);
- procedure ServiceTypeOptionMenuChanged(Sender: TObject);
+ procedure ServiceTypeComboBoxChanged(Sender: TObject);
procedure MaskPasswordCheckButtonToggled(Sender: TObject);
private
CurrentURI: string;
@@ -63,7 +63,7 @@ var ServiceTypeTable: array[1..ServiceTypeTable_Count, 0..1] of string;
procedure TFConnectionProperties.FormCreate(Sender: TObject);
var i: integer;
- MenuItem: TGTKMenuItem;
+ VBox: TGTKVBox;
begin
// Set the constants
ServiceTypeTable[1, 0] := LANGConnProp_FTP; ServiceTypeTable[1, 1] := 'ftp';
@@ -81,143 +81,199 @@ begin
Box.BorderWidth := 8;
ClientArea.AddControlEx(Box, True, True, 0);
Label1 := TGTKLabel.Create(Self);
- Label1.XAlign := 0;
- Label1.XPadding := 0;
Label1.Caption := LANGConnProp_VFSModule;
- PluginOptionMenu := TGTKOptionMenu.Create(Self);
- Label1.FocusControl := PluginOptionMenu;
+ PluginComboBox := TGtkComboBoxText.Create(Self);
+ PluginComboBox.MarginStart := 5;
+ PluginComboBox.MarginEnd := 5;
+ PluginComboBox.MarginTop := 2;
+ PluginComboBox.MarginBottom := 2;
+ Label1.FocusControl := PluginComboBox;
Label1.UseMarkup := True;
Label1.UseUnderline := True;
+ Label1.XAlign := 0;
+ Label1.MarginStart := 5;
+ Label1.MarginEnd := 5;
+ Label1.MarginTop := 2;
+ Label1.MarginBottom := 2;
Label2 := TGTKLabel.Create(Self);
- Label2.XAlign := 0;
- Label2.XPadding := 0;
Label2.Caption := Format('<span weight="ultrabold">%s</span>', [LANGConnProp_URI]);
URIEntry := TGTKEntry.Create(Self);
URIEntry.Tooltip := LANGConnProp_URIEntryTooltip;
+ URIEntry.MarginStart := 5;
+ URIEntry.MarginEnd := 5;
+ URIEntry.MarginTop := 2;
+ URIEntry.MarginBottom := 2;
Label2.FocusControl := URIEntry;
Label2.UseMarkup := True;
Label2.UseUnderline := True;
+ Label2.XAlign := 0;
+ Label2.MarginStart := 5;
+ Label2.MarginEnd := 5;
+ Label2.MarginTop := 2;
+ Label2.MarginBottom := 2;
Label3 := TGTKLabel.Create(Self);
- Label3.XAlign := 0;
- Label3.XPadding := 0;
Label3.Caption := Format('<span weight="ultrabold">%s</span>', [LANGConnProp_DetailedInformations]);
Label3.UseMarkup := True;
+ Label3.XAlign := 0;
+ Label3.MarginStart := 5;
+ Label3.MarginEnd := 5;
Label4 := TGTKLabel.Create(Self);
- Label4.XAlign := 0;
- Label4.XPadding := 0;
Label4.Caption := Format('<span weight="ultrabold">%s</span>', [LANGConnProp_Name]);
NameEntry := TGTKEntry.Create(Self);
+ NameEntry.MarginStart := 5;
+ NameEntry.MarginEnd := 5;
+ NameEntry.MarginTop := 2;
+ NameEntry.MarginBottom := 2;
Label4.FocusControl := NameEntry;
Label4.UseMarkup := True;
Label4.UseUnderline := True;
-
+ Label4.XAlign := 0;
+ Label4.MarginStart := 5;
+ Label4.MarginEnd := 5;
+ Label4.MarginTop := 2;
+ Label4.MarginBottom := 2;
Label5 := TGTKLabel.Create(Self);
- Label5.XAlign := 0;
- Label5.XPadding := 0;
Label5.Caption := LANGConnProp_Server;
ServerEntry := TGTKEntry.Create(Self);
+ ServerEntry.MarginStart := 5;
+ ServerEntry.MarginEnd := 5;
+ ServerEntry.MarginTop := 2;
+ ServerEntry.MarginBottom := 2;
Label5.FocusControl := ServerEntry;
Label5.UseMarkup := True;
Label5.UseUnderline := True;
+ Label5.XAlign := 0;
+ Label5.MarginStart := 5;
+ Label5.MarginEnd := 5;
+ Label5.MarginTop := 2;
+ Label5.MarginBottom := 2;
Label6 := TGTKLabel.Create(Self);
- Label6.XAlign := 0;
- Label6.XPadding := 0;
Label6.Caption := LANGConnProp_Username;
UserNameEntry := TGTKEntry.Create(Self);
UserNameEntry.Tooltip := LANGConnProp_UserNameEntryTooltip;
+ UserNameEntry.MarginStart := 5;
+ UserNameEntry.MarginEnd := 5;
+ UserNameEntry.MarginTop := 2;
+ UserNameEntry.MarginBottom := 2;
Label6.FocusControl := UserNameEntry;
Label6.UseMarkup := True;
Label6.UseUnderline := True;
+ Label6.XAlign := 0;
+ Label6.MarginStart := 5;
+ Label6.MarginEnd := 5;
+ Label6.MarginTop := 2;
+ Label6.MarginBottom := 2;
Label7 := TGTKLabel.Create(Self);
- Label7.XAlign := 0;
- Label7.XPadding := 0;
Label7.Caption := LANGConnProp_Password;
PasswordEntry := TGTKEntry.Create(Self);
PasswordEntry.Visibility := False;
+ PasswordEntry.MarginStart := 5;
+ PasswordEntry.MarginEnd := 5;
+ PasswordEntry.MarginTop := 2;
+ PasswordEntry.MarginBottom := 2;
Label7.FocusControl := PasswordEntry;
Label7.UseMarkup := True;
Label7.UseUnderline := True;
+ Label7.XAlign := 0;
+ Label7.MarginStart := 5;
+ Label7.MarginEnd := 5;
+ Label7.MarginTop := 2;
+ Label7.MarginBottom := 2;
Label8 := TGTKLabel.Create(Self);
- Label8.XAlign := 0;
- Label8.XPadding := 0;
Label8.Caption := LANGConnProp_TargetDirectory;
TargetDirEntry := TGTKEntry.Create(Self);
+ TargetDirEntry.MarginStart := 5;
+ TargetDirEntry.MarginEnd := 5;
+ TargetDirEntry.MarginTop := 2;
+ TargetDirEntry.MarginBottom := 2;
Label8.FocusControl := TargetDirEntry;
Label8.UseMarkup := True;
Label8.UseUnderline := True;
+ Label8.XAlign := 0;
+ Label8.MarginStart := 5;
+ Label8.MarginEnd := 5;
+ Label8.MarginTop := 2;
+ Label8.MarginBottom := 2;
Label9 := TGTKLabel.Create(Self);
- Label9.XAlign := 0;
- Label9.XPadding := 0;
Label9.Caption := LANGConnProp_ServiceType;
- ServiceTypeOptionMenu := TGTKOptionMenu.Create(Self);
- Label9.FocusControl := PluginOptionMenu;
+ Label9.XAlign := 0;
+ Label9.MarginStart := 5;
+ Label9.MarginEnd := 5;
+ Label9.MarginTop := 2;
+ Label9.MarginBottom := 2;
+ ServiceTypeComboBox := TGtkComboBoxText.Create(Self);
+ ServiceTypeComboBox.MarginStart := 5;
+ ServiceTypeComboBox.MarginEnd := 5;
+ ServiceTypeComboBox.MarginTop := 2;
+ ServiceTypeComboBox.MarginBottom := 2;
+ Label9.FocusControl := PluginComboBox;
Label9.UseMarkup := True;
Label9.UseUnderline := True;
MaskPasswordCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGConnProp_MaskPassword);
MaskPasswordCheckButton.Checked := True;
-
- Table1 := TGTKTable.Create(Self);
- Box.AddControlEx(Table1, True, True, 5);
- Table1.AddControlEx(0, 0, 1, 1, Label4, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table1.AddControlEx(1, 0, 1, 1, NameEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table1.AddControlEx(0, 1, 1, 1, Label2, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table1.AddControlEx(1, 1, 1, 1, URIEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table1.AddControlEx(0, 2, 1, 1, Label1, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table1.AddControlEx(1, 2, 1, 1, PluginOptionMenu, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table1.AddControlEx(0, 3, 2, 1, TGTKVBox.Create(Self), [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 10);
- Table1.AddControlEx(0, 4, 2, 1, Label3, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 0);
-
-
- Table2 := TGTKTable.Create(Self);
- Box.AddControlEx(Table2, True, True, 5);
- Table2.AddControlEx(0, 0, 1, 1, TGTKHBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table2.AddControlEx(1, 0, 1, 1, Label9, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 0, 1, 1, ServiceTypeOptionMenu, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(1, 1, 1, 1, Label5, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 1, 1, 1, ServerEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(1, 2, 1, 1, Label6, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 2, 1, 1, UserNameEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(1, 3, 1, 1, Label7, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 3, 1, 1, PasswordEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 4, 1, 1, MaskPasswordCheckButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 0);
- Table2.AddControlEx(1, 5, 1, 1, Label8, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 5, 1, 1, TargetDirEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
-
+ MaskPasswordCheckButton.MarginStart := 5;
+ MaskPasswordCheckButton.MarginEnd := 5;
+
+ Grid1 := TGTKGrid.Create(Self);
+ Box.AddControlEx(Grid1, True, True, 5);
+ Grid1.AddControl(0, 0, 1, 1, Label4);
+ Grid1.AddControl(1, 0, 1, 1, NameEntry);
+ Grid1.AddControl(0, 1, 1, 1, Label2);
+ Grid1.AddControl(1, 1, 1, 1, URIEntry);
+ Grid1.AddControl(0, 2, 1, 1, Label1);
+ Grid1.AddControl(1, 2, 1, 1, PluginComboBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 5;
+ VBox.MarginEnd := 5;
+ VBox.MarginTop := 10;
+ VBox.MarginBottom := 10;
+ Grid1.AddControl(0, 3, 2, 1, VBox);
+ Grid1.AddControl(0, 4, 2, 1, Label3);
+
+
+ Grid2 := TGTKGrid.Create(Self);
+ Box.AddControlEx(Grid2, True, True, 5);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 10;
+ VBox.MarginEnd := 10;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid2.AddControl(0, 0, 1, 1, VBox);
+ Grid2.AddControl(1, 0, 1, 1, Label9);
+ Grid2.AddControl(2, 0, 1, 1, ServiceTypeComboBox);
+ Grid2.AddControl(1, 1, 1, 1, Label5);
+ Grid2.AddControl(2, 1, 1, 1, ServerEntry);
+ Grid2.AddControl(1, 2, 1, 1, Label6);
+ Grid2.AddControl(2, 2, 1, 1, UserNameEntry);
+ Grid2.AddControl(1, 3, 1, 1, Label7);
+ Grid2.AddControl(2, 3, 1, 1, PasswordEntry);
+ Grid2.AddControl(2, 4, 1, 1, MaskPasswordCheckButton);
+ Grid2.AddControl(1, 5, 1, 1, Label8);
+ Grid2.AddControl(2, 5, 1, 1, TargetDirEntry);
// Fill the plugins menu
- MenuItem := TGTKMenuItem.CreateTyped(Self, itLabel);
- MenuItem.Caption := LANGConnProp_MenuItemCaption;
- PluginOptionMenu.Items.Add(MenuItem);
+ PluginComboBox.AppendItem(LANGConnProp_MenuItemCaption);
for i := 0 to PluginList.Count - 1 do
- if TVFSPlugin(PluginList[i]).HandlesNetwork then begin
- MenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
- MenuItem.Data := PluginList[i];
- MenuItem.SetCaptionPlain(Format('%s [%s]', [TVFSPlugin(PluginList[i]).ModuleName,
- ExtractFileName(TVFSPlugin(PluginList[i]).FullModulePath)]));
- PluginOptionMenu.Items.Add(MenuItem);
- end;
-
+ if TVFSPlugin(PluginList[i]).HandlesNetwork then
+ PluginComboBox.AppendItemID(TVFSPlugin(PluginList[i]).ModuleID,
+ Format('%s [%s]', [TVFSPlugin(PluginList[i]).ModuleName,
+ ExtractFileName(TVFSPlugin(PluginList[i]).FullModulePath)]));
// Fill the protocol menu
- for i := 1 to ServiceTypeTable_Count do begin
- MenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
- MenuItem.Caption := ServiceTypeTable[i, 0];
- ServiceTypeOptionMenu.Items.Add(MenuItem);
- end;
-
+ for i := 1 to ServiceTypeTable_Count do
+ ServiceTypeComboBox.AppendItem(ServiceTypeTable[i, 0]);
Lock := True;
OnKeyDown := @FormKeyDown;
NameEntry.OnChanged := @NameEntryChanged;
URIEntry.OnChanged := @URIEntryChanged;
- ServiceTypeOptionMenu.OnChanged := @ServiceTypeOptionMenuChanged;
- ServerEntry.OnChanged := @ServiceTypeOptionMenuChanged;
- UserNameEntry.OnChanged := @ServiceTypeOptionMenuChanged;
- PasswordEntry.OnChanged := @ServiceTypeOptionMenuChanged;
- TargetDirEntry.OnChanged := @ServiceTypeOptionMenuChanged;
+ ServiceTypeComboBox.OnChanged := @ServiceTypeComboBoxChanged;
+ ServerEntry.OnChanged := @ServiceTypeComboBoxChanged;
+ UserNameEntry.OnChanged := @ServiceTypeComboBoxChanged;
+ PasswordEntry.OnChanged := @ServiceTypeComboBoxChanged;
+ TargetDirEntry.OnChanged := @ServiceTypeComboBoxChanged;
MaskPasswordCheckButton.OnToggled := @MaskPasswordCheckButtonToggled;
-
NameEntry.SetFocus;
NameEntryChanged(Self);
Lock := False;
@@ -226,15 +282,15 @@ end;
procedure TFConnectionProperties.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: if ValidSettings then ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: if ValidSettings then ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
procedure TFConnectionProperties.MaskPasswordCheckButtonToggled(Sender: TObject);
begin
PasswordEntry.Visibility := not MaskPasswordCheckButton.Checked;
- ServiceTypeOptionMenuChanged(Self);
+ ServiceTypeComboBoxChanged(Self);
end;
(********************************************************************************************************************************)
@@ -267,7 +323,7 @@ begin
j := i;
Break;
end;
- ServiceTypeOptionMenu.ItemIndex := j - 1;
+ ServiceTypeComboBox.ItemIndex := j - 1;
Delete(s2, 1, Pos('://', s2) + 2);
end;
@@ -304,7 +360,7 @@ begin
Result := ConstructURI(True, Hidden, GetService, ServerEntry.Text, UserNameEntry.Text, PasswordEntry.Text, TargetDirEntry.Text);
end;
-procedure TFConnectionProperties.ServiceTypeOptionMenuChanged(Sender: TObject);
+procedure TFConnectionProperties.ServiceTypeComboBoxChanged(Sender: TObject);
begin
if Lock then Exit;
CurrentURI := MakeURI(False);
@@ -317,8 +373,8 @@ end;
function TFConnectionProperties.GetService: string;
begin
Result := ServiceTypeTable[ServiceTypeTable_Count, 1];
- if ServiceTypeOptionMenu.ItemIndex < ServiceTypeTable_Count - 1
- then Result := ServiceTypeTable[ServiceTypeOptionMenu.ItemIndex + 1, 1] else
+ if ServiceTypeComboBox.ItemIndex < ServiceTypeTable_Count - 1
+ then Result := ServiceTypeTable[ServiceTypeComboBox.ItemIndex + 1, 1] else
if Pos('://', URIEntry.Text) > 1 then Result := Copy(URIEntry.Text, 1, Pos('://', URIEntry.Text) - 1);
end;
diff --git a/UCopyMove.pas b/UCopyMove.pas
index 0bbbcf2..3a2c3d3 100644
--- a/UCopyMove.pas
+++ b/UCopyMove.pas
@@ -22,7 +22,7 @@ unit UCopyMove;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls;
type
TFCopyMove = class(TGTKDialog)
@@ -54,7 +54,6 @@ begin
Label1 := TGTKLabel.Create(Self);
Label1.Caption := 'Copy 1 file(s) to:';
Label1.XAlign := 0;
- Label1.XPadding := 0;
Label1.SetSizeRequest(-1, 20);
Entry := TGTKEntry.Create(Self);
Box.AddControlEx(Label1, False, False, 0);
@@ -68,8 +67,8 @@ end;
procedure TFCopyMove.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
diff --git a/UCore.pas b/UCore.pas
index 5ff1e0a..5933cd4 100644
--- a/UCore.pas
+++ b/UCore.pas
@@ -161,7 +161,8 @@ begin
4: ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(LANGDIR));
end;
Icon := UpDirIcon.FPixbuf;
- ItemColor := NormalItemGDKColor;
+ // TODO
+// ItemColor := NormalItemGDKColor;
end;
ListItem.Data := Data;
DataList.Add(Data);
diff --git a/UCoreClasses.pas b/UCoreClasses.pas
index f4b8579..7a4a43a 100644
--- a/UCoreClasses.pas
+++ b/UCoreClasses.pas
@@ -21,7 +21,7 @@ unit UCoreClasses;
interface
-uses gtk2, lazglib2, lazgobject2, SysUtils, Classes, ULibc, IniFiles, GTKStdCtrls, GTKPixbuf;
+uses lazglib2, lazgobject2, lazgtk3, SysUtils, Classes, ULibc, IniFiles, GTKStdCtrls, GTKPixbuf;
type TSystemUser = class
public
@@ -55,43 +55,6 @@ type TSystemUser = class
procedure UpdateFile; override;
end;
- TGTKImageButton = class(TGTKButton)
- private
- FHBox: PGtkWidget;
- FLabel: PGtkWidget;
- FImage: PGtkWidget;
- FEventBoxLeft, FEventBoxRight: PGtkWidget;
- function GetCaption: string;
- procedure SetCaption(Value: string);
- procedure SetIcon(Value: TGDKPixbuf);
- procedure SetSpacing(Value: integer);
- public
- procedure SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
- published
- constructor Create(AOwner: TComponent); override;
- constructor CreateWithoutLabel(AOwner: TComponent);
- property Caption: string read GetCaption write SetCaption;
- property Icon: TGDKPixbuf write SetIcon;
- property Spacing: integer write SetSpacing;
- end;
-
- TGTKImageToggleButton = class(TGTKToggleButton)
- private
- FHBox: PGtkWidget;
- FLabel: PGtkWidget;
- FImage: PGtkWidget;
- function GetCaption: string;
- procedure SetCaption(Value: string);
- procedure SetIcon(Value: TGDKPixbuf);
- public
- procedure SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
- published
- constructor Create(AOwner: TComponent); override;
- constructor CreateWithoutLabel(AOwner: TComponent);
- property Caption: string read GetCaption write SetCaption;
- property Icon: TGDKPixbuf write SetIcon;
- end;
-
implementation
@@ -215,134 +178,6 @@ begin
end;
(********************************************************************************************************************************)
-(********************************************************************************************************************************)
-constructor TGTKImageButton.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FWidget := gtk_button_new;
- FLabel := gtk_label_new('');
- FImage := gtk_image_new;
- FHBox := gtk_hbox_new(False, 2);
- FEventBoxLeft := gtk_vbox_new(false, 0);
- FEventBoxRight := gtk_vbox_new(false, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FEventBoxLeft, False, False, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FImage, False, False, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FLabel, True, True, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FEventBoxRight, False, False, 0);
- gtk_container_add(PGtkContainer(FWidget), FHBox);
- g_signal_connect_data(PGObject(FWidget), 'clicked', TGCallback(@TGTKButton_OnClick), Self, nil, G_CONNECT_DEFAULT);
- gtk_widget_show(FLabel);
- gtk_widget_show(FImage);
- gtk_widget_show(FHBox);
- gtk_widget_show(FEventBoxLeft);
- gtk_widget_show(FEventBoxRight);
- Show;
-end;
-
-constructor TGTKImageButton.CreateWithoutLabel(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FWidget := gtk_button_new;
- FLabel := gtk_label_new('');
- FImage := gtk_image_new;
- FHBox := gtk_hbox_new(False, 2);
- FEventBoxLeft := gtk_vbox_new(false, 0);
- FEventBoxRight := gtk_vbox_new(false, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FEventBoxLeft, False, False, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FImage, False, False, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FEventBoxRight, False, False, 0);
- gtk_container_add(PGtkContainer(FWidget), FHBox);
- g_signal_connect_data(PGObject(FWidget), 'clicked', TGCallback(@TGTKButton_OnClick), Self, nil, G_CONNECT_DEFAULT);
- gtk_widget_show(FLabel);
- gtk_widget_show(FImage);
- gtk_widget_show(FHBox);
- gtk_widget_show(FEventBoxLeft);
- gtk_widget_show(FEventBoxRight);
- Show;
-end;
-
-function TGTKImageButton.GetCaption: string;
-begin
- Result := gtk_label_get_text(PGtkLabel(FLabel));
-end;
-
-procedure TGTKImageButton.SetCaption(Value: string);
-begin
- gtk_label_set_text_with_mnemonic(PGtkLabel(FLabel), PChar(Value));
-end;
-
-procedure TGTKImageButton.SetIcon(Value: TGDKPixbuf);
-begin
- if Assigned(Value) and Assigned(Value.FPixbuf) then
- gtk_image_set_from_pixbuf(PGtkImage(FImage), Value.FPixbuf);
-end;
-
-procedure TGTKImageButton.SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
-begin
- gtk_image_set_from_stock(PGtkImage(FImage), PChar(Stock_ID), Ord(IconSize));
-end;
-
-procedure TGTKImageButton.SetSpacing(Value: integer);
-begin
- gtk_widget_set_size_request(FEventBoxLeft, Value, -1);
- gtk_widget_set_size_request(FEventBoxRight, Value, -1);
-end;
-
-
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
-constructor TGTKImageToggleButton.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FWidget := gtk_toggle_button_new;
- FLabel := gtk_label_new('');
- FImage := gtk_image_new;
- FHBox := gtk_hbox_new(False, 2);
- gtk_box_pack_start(PGtkBox(FHBox), FImage, False, False, 0);
- gtk_box_pack_start(PGtkBox(FHBox), FLabel, True, True, 0);
- gtk_container_add(PGtkContainer(FWidget), FHBox);
- g_signal_connect_data(PGObject(FWidget), 'clicked', TGCallback(@TGTKButton_OnClick), Self, nil, G_CONNECT_DEFAULT);
- gtk_widget_show(FLabel);
- gtk_widget_show(FImage);
- gtk_widget_show(FHBox);
- Show;
-end;
-
-constructor TGTKImageToggleButton.CreateWithoutLabel(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FWidget := gtk_button_new;
- FLabel := gtk_label_new('');
- FImage := gtk_image_new;
- gtk_container_add(PGtkContainer(FWidget), FImage);
- g_signal_connect_data(PGObject(FWidget), 'clicked', TGCallback(@TGTKButton_OnClick), Self, nil, G_CONNECT_DEFAULT);
- gtk_widget_show(FLabel);
- gtk_widget_show(FImage);
- Show;
-end;
-
-function TGTKImageToggleButton.GetCaption: string;
-begin
- Result := gtk_label_get_text(PGtkLabel(FLabel));
-end;
-
-procedure TGTKImageToggleButton.SetCaption(Value: string);
-begin
- gtk_label_set_text(PGtkLabel(FLabel), PChar(Value));
-end;
-
-procedure TGTKImageToggleButton.SetIcon(Value: TGDKPixbuf);
-begin
- if Assigned(Value) and Assigned(Value.FPixbuf) then
- gtk_image_set_from_pixbuf(PGtkImage(FImage), Value.FPixbuf);
-end;
-
-procedure TGTKImageToggleButton.SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
-begin
- gtk_image_set_from_stock(PGtkImage(FImage), PChar(Stock_ID), Ord(IconSize));
-end;
-
-(********************************************************************************************************************************)
end.
diff --git a/UCoreUtils.pas b/UCoreUtils.pas
index c204d4e..1e531a3 100644
--- a/UCoreUtils.pas
+++ b/UCoreUtils.pas
@@ -21,7 +21,7 @@ unit UCoreUtils;
interface
-uses gtk2, gdk2, glib2, lazglib2, SysUtils, Classes, ULibc, GTKClasses, UEngines;
+uses SysUtils, Classes, lazglib2, lazgdk3, lazgtk3, GTKClasses, UEngines, ULibc;
type
PIntArray = ^TIntArray;
@@ -819,17 +819,19 @@ const Authors : array[0..1] of PChar = ('Tomáš Bžatek <tbzatek@users.sourcefo
'Jozef Štaffen <jozef.staffen@gmail.com> - Slovak'#10 +
'Américo Monteiro <a_monteiro@netcabo.pt> - Portuguese'#10 +
'Sewon Jang <jangblue@gmail.com> - Korean';
-var AboutBox: PGtkWidget;
+var about_dialog: PGtkWidget;
begin
- if (libGnomeUI2Handle = nil) or (gnome_about_new = nil)
- then Application.MessageBox(Format(LANGAboutString, [ConstAboutVersion, ConstAboutBuildDate]))
- else begin
- AboutBox := gnome_about_new('Tux Commander', nil, 'Copyright © 2002-2024 Tomáš Bžatek',
- PChar(Format(LANGAboutStringGnome, [ConstAboutVersion, ConstAboutBuildDate])),
- @Authors, nil, Translations, AppIcon128.FPixbuf);
- gtk_window_set_transient_for(GTK_WINDOW(AboutBox), GTK_WINDOW(FMain.FWidget));
- gtk_dialog_run(GTK_DIALOG(AboutBox));
- end;
+ about_dialog := gtk_about_dialog_new();
+ gtk_about_dialog_set_program_name(PGtkAboutDialog(about_dialog), PChar('Tux Commander'));
+ gtk_about_dialog_set_version(PGtkAboutDialog(about_dialog), PChar(Format(LANGAboutStringGnome, [ConstAboutVersion, ConstAboutBuildDate])));
+ gtk_about_dialog_set_copyright(PGtkAboutDialog(about_dialog), PChar('Copyright © 2002-2024 Tomáš Bžatek'));
+ gtk_about_dialog_set_website(PGtkAboutDialog(about_dialog), PChar('https://tuxcmd.sourceforge.net/'));
+ gtk_about_dialog_set_authors(PGtkAboutDialog(about_dialog), @Authors);
+ gtk_about_dialog_set_translator_credits(PGtkAboutDialog(about_dialog), Translations);
+ // TODO
+// gtk_about_dialog_set_logo(PGtkAboutDialog(about_dialog), AppIcon128.FPixbuf);
+ gtk_window_set_transient_for(PGtkWindow(about_dialog), PGtkWindow(FMain.FWidget));
+ gtk_dialog_run(PGtkDialog(about_dialog));
end;
procedure SetupAppIcon;
@@ -842,7 +844,7 @@ begin
List := g_list_append(List, AppIcon48.FPixbuf);
List := g_list_append(List, AppIcon64.FPixbuf);
List := g_list_append(List, AppIcon128.FPixbuf);
- gtk_window_set_default_icon_list(GLIB2.PGList(List));
+ gtk_window_set_default_icon_list(List);
g_list_free(List);
end;
@@ -1721,6 +1723,8 @@ procedure SetupColors;
var Color: TGDKColor;
LocalListView: TGTKListView;
begin
+ // TODO
+{
LocalListView := TGTKListView.Create(Application);
try
if ConfNormalItemDefaultColors then begin
@@ -1763,7 +1767,7 @@ begin
except InactiveItemBGColorNum := $D0D0D0FF; end;
finally
LocalListView.Free;
- end;
+ end;}
end;
(********************************************************************************************************************************)
@@ -1865,8 +1869,9 @@ initialization
SetupSignals;
// Parse tuxcmd rc file
- gtk_rc_parse_string(tuxcmd_rc_file);
-
+ // TODO
+// gtk_rc_parse_string(tuxcmd_rc_file);
+
AppPath := IncludeTrailingPathDelimiter(GetHomePath);
IconPath := IncludeTrailingPathDelimiter(GetHomePath);
end.
diff --git a/UCoreWorkers.pas b/UCoreWorkers.pas
index 307e695..4bbe8c6 100644
--- a/UCoreWorkers.pas
+++ b/UCoreWorkers.pas
@@ -20,7 +20,7 @@
unit UCoreWorkers;
interface
-uses lazglib2, lazgobject2, gtk2, SyncObjs, Classes, GTKForms, ULibc, UEngines, UCoreUtils, UVFSCore, uVFSprototypes, UCore, UDirDelete;
+uses lazglib2, lazgobject2, lazgtk3, SyncObjs, Classes, GTKForms, ULibc, UEngines, UCoreUtils, UVFSCore, uVFSprototypes, UCore, UDirDelete;
type TWorkerThreadJobType = (WORKER_JOB_DUMMY, WORKER_JOB_DELETE, WORKER_JOB_COPY, WORKER_JOB_MOVE, WORKER_JOB_EXTRACT_TO_TEMP,
diff --git a/UDirDelete.pas b/UDirDelete.pas
index 953a41a..e1f6687 100644
--- a/UDirDelete.pas
+++ b/UDirDelete.pas
@@ -22,7 +22,7 @@ unit UDirDelete;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls;
const DIR_DELETE_CANCEL = 0;
DIR_DELETE_DELETE = 1;
@@ -108,7 +108,7 @@ begin
if (Key = gdk_keyval_to_lower(gdk_keyval_from_name(PChar(ExtractAccelerator(LANGIgnoreButton_Caption))))) then ModalResult := TMessageButton(DIR_DELETE_IGNORE) else
if (Key = gdk_keyval_to_lower(gdk_keyval_from_name(PChar(ExtractAccelerator(LANGDeleteButton_Caption))))) then ModalResult := TMessageButton(DIR_DELETE_DELETE) else
if (Key = gdk_keyval_to_lower(gdk_keyval_from_name(PChar(ExtractAccelerator(LANGAll))))) then ModalResult := TMessageButton(DIR_DELETE_ALL) else
- if (Key = GDK_ESCAPE) then ModalResult := TMessageButton(DIR_DELETE_CANCEL);
+ if (Key = GDK_KEY_Escape) then ModalResult := TMessageButton(DIR_DELETE_CANCEL);
end;
diff --git a/UEngines.pas b/UEngines.pas
index 4373910..2d69695 100644
--- a/UEngines.pas
+++ b/UEngines.pas
@@ -21,7 +21,7 @@ unit UEngines;
interface
-uses lazglib2, gdk2, Classes, ULibc;
+uses lazglib2, lazgdk3, Classes, ULibc;
const omRead = 0;
diff --git a/UError.pas b/UError.pas
index 3863575..b079007 100644
--- a/UError.pas
+++ b/UError.pas
@@ -21,7 +21,7 @@ unit UError;
interface
-uses lazglib2, gtk2, Classes, SysUtils, GTKForms;
+uses lazglib2, lazgtk3, Classes, SysUtils, GTKForms;
type TuxcmdErrorEnum = (
TUXCMD_ERROR_CANCELLED,
@@ -127,7 +127,7 @@ procedure VFSToTuxcmdError(Error: PPGError; Operation: TuxcmdErrorEnum);
implementation
-uses UCoreUtils, UGnome;
+uses UCoreUtils;
(********************************************************************************************************************************)
@@ -213,10 +213,10 @@ var Dialog: PGtkWidget;
begin
if Error <> nil then error_str := Error^.message
else error_str := '';
- dialog := gtk_message_dialog_new_with_markup(PGtkWindow(Parent.FWidget), GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT,
+ dialog := gtk_message_dialog_new_with_markup(PGtkWindow(Parent.FWidget), [GTK_DIALOG_MODAL, GTK_DIALOG_DESTROY_WITH_PARENT],
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
'<span size="large" weight="ultrabold">%s</span>'#10#10'%s',
- PChar(Text), error_str);
+ [PChar(Text), error_str]);
gtk_window_set_title(PGtkWindow(dialog), '');
gtk_dialog_run(PGtkDialog(Dialog));
gtk_widget_destroy(PGtkWidget(Dialog));
diff --git a/UFileAssoc.pas b/UFileAssoc.pas
index 60ee2d5..a2d9573 100644
--- a/UFileAssoc.pas
+++ b/UFileAssoc.pas
@@ -127,59 +127,59 @@ end;
procedure LoadIcons;
begin
FolderIcon := TGDKPixbuf.Create(Application);
- FolderIcon.LoadFromInline(@stock_folder_16_png[1]);
- FolderIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
+// FolderIcon.LoadFromInline(@stock_folder_16_png[1]);
+// FolderIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
FileIcon := TGDKPixbuf.Create(Application);
- FileIcon.LoadFromInline(@stock_new_16_png[1]);
- FileIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
+// FileIcon.LoadFromInline(@stock_new_16_png[1]);
+// FileIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
UpDirIcon := TGDKPixbuf.Create(Application);
- UpDirIcon.LoadFromInline(@stock_up_one_dir_16_png[1]);
- UpDirIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
+// UpDirIcon.LoadFromInline(@stock_up_one_dir_16_png[1]);
+// UpDirIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
SymLinkEmblem := TGDKPixbuf.Create(Application);
- SymLinkEmblem.LoadFromInline(@emblem_symbolic_link_png[1]);
+// SymLinkEmblem.LoadFromInline(@emblem_symbolic_link_png[1]);
FolderIconLnk := TGDKPixbuf.Create(Application);
- FolderIconLnk.FPixbuf := FolderIcon.Copy;
- FolderIconLnk.CopyArea(SymLinkEmblem, 0, 0, SymLinkEmblem.Width, SymLinkEmblem.Height, FolderIconLnk.Width - SymLinkEmblem.Width, FolderIconLnk.Height - SymLinkEmblem.Height);
+// FolderIconLnk.FPixbuf := FolderIcon.Copy;
+// FolderIconLnk.CopyArea(SymLinkEmblem, 0, 0, SymLinkEmblem.Width, SymLinkEmblem.Height, FolderIconLnk.Width - SymLinkEmblem.Width, FolderIconLnk.Height - SymLinkEmblem.Height);
FileIconLnk := TGDKPixbuf.Create(Application);
- FileIconLnk.FPixbuf := FileIcon.Copy;
- FileIconLnk.CopyArea(SymLinkEmblem, 0, 0, SymLinkEmblem.Width, SymLinkEmblem.Height, FileIconLnk.Width - SymLinkEmblem.Width, FileIconLnk.Height - SymLinkEmblem.Height);
+// FileIconLnk.FPixbuf := FileIcon.Copy;
+// FileIconLnk.CopyArea(SymLinkEmblem, 0, 0, SymLinkEmblem.Width, SymLinkEmblem.Height, FileIconLnk.Width - SymLinkEmblem.Width, FileIconLnk.Height - SymLinkEmblem.Height);
FolderIconCached := FolderIcon;
FileIconCached := FileIcon;
FolderIconLnkCached := FolderIconLnk;
FileIconLnkCached := FileIconLnk;
MounterHDD := TGDKPixbuf.Create(Application);
- MounterHDD.LoadFromInline(@gnome_dev_harddisk_16_png[1]);
+// MounterHDD.LoadFromInline(@gnome_dev_harddisk_16_png[1]);
MounterRemovable := TGDKPixbuf.Create(Application);
- MounterRemovable.LoadFromInline(@gnome_dev_removable_usb_16_png[1]);
+// MounterRemovable.LoadFromInline(@gnome_dev_removable_usb_16_png[1]);
MounterFloppy := TGDKPixbuf.Create(Application);
- MounterFloppy.LoadFromInline(@gnome_dev_floppy_16_png[1]);
+// MounterFloppy.LoadFromInline(@gnome_dev_floppy_16_png[1]);
MounterCD := TGDKPixbuf.Create(Application);
- MounterCD.LoadFromInline(@gnome_dev_cdrom_16_png[1]);
+// MounterCD.LoadFromInline(@gnome_dev_cdrom_16_png[1]);
MounterNetwork := TGDKPixbuf.Create(Application);
- MounterNetwork.LoadFromInline(@gnome_mime_x_directory_smb_share_16_png[1]);
+// MounterNetwork.LoadFromInline(@gnome_mime_x_directory_smb_share_16_png[1]);
StockLock16 := TGDKPixbuf.Create(Application);
- StockLock16.LoadFromInline(@stock_lock_16_png[1]);
+// StockLock16.LoadFromInline(@stock_lock_16_png[1]);
StockLock48 := TGDKPixbuf.Create(Application);
- StockLock48.LoadFromInline(@stock_lock_48_png[1]);
+// StockLock48.LoadFromInline(@stock_lock_48_png[1]);
ArchiveIcon := TGDKPixbuf.Create(Application);
- ArchiveIcon.LoadFromInline(@gnome_mime_application_zip_16_png[1]);
- ArchiveIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
+// ArchiveIcon.LoadFromInline(@gnome_mime_application_zip_16_png[1]);
+// ArchiveIcon.ScaleSimple(ConfRowHeightReal, ConfRowHeightReal);
ArchiveIconLnk := TGDKPixbuf.Create(Application);
- ArchiveIconLnk.FPixbuf := ArchiveIcon.Copy;
- ArchiveIconLnk.CopyArea(SymLinkEmblem, 0, 0, SymLinkEmblem.Width, SymLinkEmblem.Height, FolderIconLnk.Width - SymLinkEmblem.Width, FolderIconLnk.Height - SymLinkEmblem.Height);
+// ArchiveIconLnk.FPixbuf := ArchiveIcon.Copy;
+// ArchiveIconLnk.CopyArea(SymLinkEmblem, 0, 0, SymLinkEmblem.Width, SymLinkEmblem.Height, FolderIconLnk.Width - SymLinkEmblem.Width, FolderIconLnk.Height - SymLinkEmblem.Height);
AppIcon16 := TGDKPixbuf.Create(Application);
- AppIcon16.LoadFromInline(@tuxcmd_16_png[1]);
+// AppIcon16.LoadFromInline(@tuxcmd_16_png[1]);
AppIcon24 := TGDKPixbuf.Create(Application);
- AppIcon24.LoadFromInline(@tuxcmd_24_png[1]);
+// AppIcon24.LoadFromInline(@tuxcmd_24_png[1]);
AppIcon32 := TGDKPixbuf.Create(Application);
- AppIcon32.LoadFromInline(@tuxcmd_32_png[1]);
+// AppIcon32.LoadFromInline(@tuxcmd_32_png[1]);
AppIcon48 := TGDKPixbuf.Create(Application);
- AppIcon48.LoadFromInline(@tuxcmd_48_png[1]);
+// AppIcon48.LoadFromInline(@tuxcmd_48_png[1]);
AppIcon64 := TGDKPixbuf.Create(Application);
- AppIcon64.LoadFromInline(@tuxcmd_64_png[1]);
+// AppIcon64.LoadFromInline(@tuxcmd_64_png[1]);
AppIcon128 := TGDKPixbuf.Create(Application);
- AppIcon128.LoadFromInline(@tuxcmd_128_png[1]);
+// AppIcon128.LoadFromInline(@tuxcmd_128_png[1]);
end;
(********************************************************************************************************************************)
@@ -274,11 +274,12 @@ begin
then Icon := Assoc.LnkPixmap.FPixbuf
else Icon := Assoc.Pixmap.FPixbuf;
end;
- if ItemColor = nil then begin
+ // TODO
+{ if ItemColor = nil then begin
if (Assoc.ColorString = '') or (not StringToGDKColor(Assoc.ColorString, AColor))
then ItemColor := NormalItemGDKColor
- else ItemColor := GDKColorToPGdkColor(AColor);
- end;
+ else ItemColor := GDKColorToPGdkColor(AColor);
+ end; }
end;
end;
end;
diff --git a/UFileTypeSettings.pas b/UFileTypeSettings.pas
index d6d7eca..f868715 100644
--- a/UFileTypeSettings.pas
+++ b/UFileTypeSettings.pas
@@ -22,8 +22,8 @@ unit UFileTypeSettings;
interface
uses
- gtk2, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKView, GTKUtils, GTKDialogs,
- GTKPixbuf, GTKClasses, UGnome;
+ SysUtils, Classes, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView, GTKDialogs, GTKPixbuf,
+ UGnome;
type
TFFileTypeSettings = class(TGTKDialog)
@@ -41,11 +41,11 @@ type
AssocListHBox, FNameExtHBox, FNameExtHBox2, ActionsHBox, ActionsHBox2, AssocDescriptionHBox, ColorHBox: TGTKHBox;
AddFiletypeButton, RemoveFiletypeButton, AddExtButton, RemoveExtButton, AddActionButton, RemoveActionButton,
SetDefaultActionButton, BrowseButton, BrowseIconButton: TGTKButton;
- ColorButton: TGnomeColorButton;
+ ColorButton: TGTKColorButton;
FNameExtEntry, CommandEntry, DescriptionEntry, AssocDescriptionEntry, IconEntry: TGTKEntry;
RunInTerminalCheckBox, AutodetectCheckBox, DefaultColorCheckBox: TGTKCheckButton;
Notebook: TGTKNotebook;
- Table, Table2: TGTKTable;
+ Grid, Grid2: TGTKGrid;
Icon: TGTKImage;
GnomeIconButton: TGnomeIconEntry;
procedure FormCreate(Sender: TObject); override;
@@ -100,19 +100,20 @@ begin
SetDefaultSize(450, 620);
Caption := LANGEditFileTypesCaption;
Buttons := [mbOK, mbCancel];
- ShowSeparator := False;
TitleEventBox := TGTKEventBox.Create(Self);
TitleLabel := TGTKLabel.Create(Self);
TitleLabel.Caption := LANGTitleLabel_Caption;
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-copy', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-copy', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
@@ -150,8 +151,10 @@ begin
AssocListButtonBox := TGTKHButtonBox.Create(Self);
AssocListButtonBox.Layout := blEnd;
AssocListButtonBox.Spacing := 2;
- AddFiletypeButton := TGTKButton.CreateFromStock(Self, 'gtk-add');
- RemoveFiletypeButton := TGTKButton.CreateFromStock(Self, 'gtk-remove');
+ AddFiletypeButton := TGTKButton.CreateFromIconName(Self, 'gtk-add');
+ AddFiletypeButton.Caption := 'Add';
+ RemoveFiletypeButton := TGTKButton.CreateFromIconName(Self, 'gtk-remove');
+ RemoveFiletypeButton.Caption := 'Remove';
AssocListButtonBox.AddControlEx(AddFiletypeButton, False, False, 0);
AssocListButtonBox.AddControlEx(RemoveFiletypeButton, False, False, 0);
AssocListVBox.AddControlEx(AssocListButtonBox, False, False, 5);
@@ -194,8 +197,10 @@ begin
ActionsButtonBox2.Layout := blStart;
ActionsHBox := TGTKHBox.Create(Self);
ActionsHBox2 := TGTKHBox.Create(Self);
- AddActionButton := TGTKButton.CreateFromStock(Self, 'gtk-add');
- RemoveActionButton := TGTKButton.CreateFromStock(Self, 'gtk-remove');
+ AddActionButton := TGTKButton.CreateFromIconName(Self, 'gtk-add');
+ AddActionButton.Caption := 'Add';
+ RemoveActionButton := TGTKButton.CreateFromIconName(Self, 'gtk-remove');
+ RemoveActionButton.Caption := 'Remove';
SetDefaultActionButton := TGTKButton.Create(Self);
SetDefaultActionButton.Caption := LANGSetDefaultActionButton_Caption;
RunInTerminalCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGRunInTerminalCheckBox_Caption);
@@ -223,19 +228,19 @@ begin
DescriptionLabel.XAlign := 0;
DescriptionLabel.FocusControl := DescriptionEntry;
DescriptionLabel.UseUnderline := True;
- Table := TGTKTable.Create(Self);
- Table.SetRowColCount(4, 2);
- Table.Homogeneous := False;
- Table.RowSpacing := 1;
- Table.AddControl(0, 0, 1, 1, DescriptionLabel, 0, 0);
- Table.AddControl(1, 0, 3, 1, DescriptionEntry, 0, 0);
- Table.AddControl(0, 1, 1, 1, CommandLabel, 0, 0);
- Table.AddControl(1, 1, 3, 1, CommandEntry, 0, 0);
+ Grid := TGTKGrid.Create(Self);
+ Grid.RowHomogeneous := False;
+ Grid.ColHomogeneous := False;
+ Grid.RowSpacing := 1;
+ Grid.AddControl(0, 0, 1, 1, DescriptionLabel);
+ Grid.AddControl(1, 0, 3, 1, DescriptionEntry);
+ Grid.AddControl(0, 1, 1, 1, CommandLabel);
+ Grid.AddControl(1, 1, 3, 1, CommandEntry);
ActionsHBox2.Homogeneous := False;
ActionsHBox2.AddControlEx(AutodetectCheckBox, True, True, 5);
ActionsHBox2.AddControlEx(RunInTerminalCheckBox, True, True, 5);
ActionsHBox2.AddControlEx(BrowseButton, False, False, 0);
- ActionsVBox.AddControlEx(Table, False, False, 1);
+ ActionsVBox.AddControlEx(Grid, False, False, 1);
ActionsVBox.AddControlEx(ActionsHBox2, False, False, 0);
l := TGTKLabel.Create(Self);
l.SetSizeRequest(0, 4);
@@ -267,8 +272,10 @@ begin
FNameExtVBox := TGTKVBox.Create(Self);
FNameExtLabel := TGTKLabel.Create(Self);
FNameExtLabel.Caption := LANGFNameExtLabel_Caption;
- AddExtButton := TGTKButton.CreateFromStock(Self, 'gtk-add');
- RemoveExtButton := TGTKButton.CreateFromStock(Self, 'gtk-remove');
+ AddExtButton := TGTKButton.CreateFromIconName(Self, 'gtk-add');
+ AddExtButton.Caption := 'Add';
+ RemoveExtButton := TGTKButton.CreateFromIconName(Self, 'gtk-remove');
+ RemoveExtButton.Caption := 'Remove';
FNameExtEntry := TGTKEntry.Create(Self);
FNameExtEntry.SetSizeRequest(0, -1);
FNameExtLabel.FocusControl := FNameExtEntry;
@@ -294,7 +301,7 @@ begin
ColorLabel := TGTKLabel.Create(Self);
ColorLabel.Caption := LANGColor;
ColorLabel.UseUnderline := True;
- ColorButton := TGnomeColorButton.Create(Self);
+ ColorButton := TGTKColorButton.Create(Self);
ColorButton.SetSizeRequest(40, -1);
ColorButton.OnColorChanged := @ColorButtonColorChanged;
ColorLabel.FocusControl := ColorButton;
@@ -325,22 +332,27 @@ begin
GnomeIconButton.OnIconChanged := @GnomeIconButtonIconChanged;
end;
- Table2 := TGTKTable.Create(Self);
- Table2.SetRowColCount(8, 3);
- Table2.AddControl(0, 1, 1, 1, IconLabel, 10, 0);
- if FUseGnomeIconEntry then Table2.AddControl(1, 0, 1, 3, GnomeIconButton, 0, 0);
- Table2.AddControl(2, 1, 1, 1, IconFrame, 10, 0);
- Table2.AddControl(3, 1, 4, 1, IconEntry, 0, 0);
- Table2.AddControl(7, 1, 1, 1, BrowseIconButton, 10, 0);
+ Grid2 := TGTKGrid.Create(Self);
+ IconLabel.MarginStart := 10;
+ IconLabel.MarginEnd := 10;
+ Grid2.AddControl(0, 1, 1, 1, IconLabel);
+ if FUseGnomeIconEntry then Grid2.AddControl(1, 0, 1, 3, GnomeIconButton);
+ IconFrame.MarginStart := 10;
+ IconFrame.MarginEnd := 10;
+ Grid2.AddControl(2, 1, 1, 1, IconFrame);
+ Grid2.AddControl(3, 1, 4, 1, IconEntry);
+ BrowseIconButton.MarginStart := 10;
+ BrowseIconButton.MarginEnd := 10;
+ Grid2.AddControl(7, 1, 1, 1, BrowseIconButton);
if FUseGnomeIconEntry then begin
- Table2.AddControl(2, 0, 6, 1, TGTKLabel.Create(Self), 0, 0);
- Table2.AddControl(2, 2, 6, 1, TGTKLabel.Create(Self), 0, 0);
+ Grid2.AddControl(2, 0, 6, 1, TGTKLabel.Create(Self));
+ Grid2.AddControl(2, 2, 6, 1, TGTKLabel.Create(Self));
end;
FNameExtVBox3 := TGTKVBox.Create(Self);
FNameExtVBox3.BorderWidth := 10;
FNameExtVBox3.AddControlEx(AssocDescriptionHBox, False, False, 5);
FNameExtVBox3.AddControlEx(TGTKHSeparator.Create(Self), False, False, 3);
- FNameExtVBox3.AddControlEx(Table2, False, False, 1);
+ FNameExtVBox3.AddControlEx(Grid2, False, False, 1);
FNameExtVBox3.AddControlEx(TGTKHSeparator.Create(Self), False, False, 3);
FNameExtVBox3.AddControlEx(FNameExtHBox, True, True, 5);
Notebook.AppendPage(FNameExtVBox3, LANGNotebookPageExtensions);
@@ -374,7 +386,7 @@ end;
procedure TFFileTypeSettings.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
-// if Key = GDK_ESCAPE then ModalResult := mbCancel;
+// if Key = GDK_KEY_Escape then ModalResult := mbCancel;
end;
procedure TFFileTypeSettings.FormDestroy(Sender: TObject);
@@ -521,7 +533,6 @@ var b: boolean;
Item: TFileAssoc;
i: integer;
ListItem: TGTKListItem;
- Color: TGDKColor;
begin
b := Assigned(ListView.Selected) and Assigned(ListView.Selected.AsPointer(2));
RemoveFiletypeButton.Enabled := b and (TFileAssoc(ListView.Selected.AsPointer(2)).FileTypeName <> ConstFTAMetaDirectory) and
@@ -547,7 +558,6 @@ begin
IconEntry.Text := '';
ActionsListView.Items.Clear;
ColorButton.SetDefaultColor;
- ColorButton.Color := PGdkColorToGDKColor(GetDefaultBackgroundColor(0));
DefaultColorCheckBox.Checked := True;
Exit;
end;
@@ -562,12 +572,9 @@ begin
(TFileAssoc(ListView.Selected.AsPointer(2)).FileTypeName = ConstFTAMetaFile)
then AssocDescriptionEntry.Text := ListView.Selected.AsString(0)
else AssocDescriptionEntry.Text := ListView.Selected.AsString(1);
- DefaultColorCheckBox.Checked := not StringToGDKColor(Item.ColorString, Color);
+ DefaultColorCheckBox.Checked := Length(Item.ColorString) < 1;
if DefaultColorCheckBox.Checked then ColorButton.SetDefaultColor
- else begin
- ColorButton.UnsetDefaultColor;
- ColorButton.Color := Color;
- end;
+ else ColorButton.Color := Item.ColorString;
// Actions
ActionsListView.Items.Clear;
if Item.ActionList.Count > 0 then
@@ -629,7 +636,7 @@ end;
procedure TFFileTypeSettings.FNameExtEntryKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
- if (Key = GDK_RETURN) or (Key = GDK_KP_ENTER) then AddExtButtonClick(Sender);
+ if (Key = GDK_KEY_Return) or (Key = GDK_KEY_KP_Enter) then AddExtButtonClick(Sender);
end;
procedure TFFileTypeSettings.FNameExtListViewSelectionChanged(Sender: TObject);
@@ -655,7 +662,7 @@ begin
b := (ActionsListView.Items.Count > 0) and Assigned(ActionsListView.Selected) and Assigned(ActionsListView.Selected.AsPointer(2));
RemoveActionButton.Enabled := b;
SetDefaultActionButton.Enabled := b;
- Table.Enabled := b;
+ Grid.Enabled := b;
BrowseButton.Enabled := b;
RunInTerminalCheckBox.Enabled := b;
AutodetectCheckBox.Enabled := b;
@@ -759,13 +766,12 @@ begin
end;
procedure TFFileTypeSettings.BrowseButtonClick(Sender: TObject);
-var Dialog: TGTKFileSelectionDialog;
+var Dialog: TGTKFileChooserDialog;
begin
if (ActionsListView.Items.Count = 0) or (not Assigned(ActionsListView.Selected)) or
(not Assigned(ListView.Selected)) or (not Assigned(ListView.Selected.AsPointer(2))) then Exit;
- Dialog := TGTKFileSelectionDialog.Create(Self);
+ Dialog := TGTKFileChooserDialog.Create(Self);
try
- Dialog.ShowFileOpButtons := False;
Dialog.FileName := AppPath;
if Byte(Dialog.Run) = 251 then CommandEntry.Text := Dialog.FileName;
AppPath := IncludeTrailingPathDelimiter(ExtractFilePath(Dialog.FileName));
@@ -802,12 +808,11 @@ begin
end;
procedure TFFileTypeSettings.BrowseIconButtonClick(Sender: TObject);
-var Dialog: TGTKFileSelectionDialog;
+var Dialog: TGTKFileChooserDialog;
begin
if (not Assigned(ListView.Selected)) or (not Assigned(ListView.Selected.AsPointer(2))) then Exit;
- Dialog := TGTKFileSelectionDialog.CreateWithTitle(Self, LANGBrowseForIcon);
+ Dialog := TGTKFileChooserDialog.CreateWithTitle(Self, LANGBrowseForIcon);
try
- Dialog.ShowFileOpButtons := False;
if FileExists(IconEntry.Text) then Dialog.FileName := IconEntry.Text
else Dialog.FileName := IconPath;
if Byte(Dialog.Run) = 251 then IconEntry.Text := Dialog.FileName;
@@ -820,13 +825,12 @@ end;
procedure TFFileTypeSettings.ColorButtonColorChanged(Sender: TObject);
begin
if Assigned(ListView.Selected) and Assigned(ListView.Selected.AsPointer(2)) then
- TFileAssoc(ListView.Selected.AsPointer(2)).ColorString := GDKColorToString(ColorButton.Color);
+ TFileAssoc(ListView.Selected.AsPointer(2)).ColorString := ColorButton.Color;
end;
procedure TFFileTypeSettings.DefaultColorCheckBoxToggled(Sender: TObject);
begin
- if DefaultColorCheckBox.Checked then ColorButton.SetDefaultColor
- else ColorButton.UnsetDefaultColor;
+ if DefaultColorCheckBox.Checked then ColorButton.SetDefaultColor;
if DefaultColorCheckBox.Checked and Assigned(ListView.Selected) and Assigned(ListView.Selected.AsPointer(2))
then TFileAssoc(ListView.Selected.AsPointer(2)).ColorString := '';
end;
@@ -842,11 +846,11 @@ var ColumnID: integer;
begin
ColumnID := gtk_tree_view_column_get_sort_column_id(tree_column);
ImageCol := False;
- if ColumnID = 0 then ImageCol := GTK_IS_CELL_RENDERER_PIXBUF(cell);
+ if ColumnID = 0 then ImageCol := Assigned(cell);
if ImageCol then Exit;
Data := nil;
- gtk_tree_model_get(tree_model, iter, 2, @Data, -1);
- gtk_tree_model_get(tree_model, iter, ColumnID, @s, -1);
+ gtk_tree_model_get(tree_model, iter, [2, @Data, -1]);
+ gtk_tree_model_get(tree_model, iter, [ColumnID, @s, -1]);
if Assigned(Data) and (Data is TFileAssoc) and ((Data.FileTypeName = ConstFTAMetaDirectory) or (Data.FileTypeName = ConstFTAMetaFile))
then
@@ -867,13 +871,13 @@ var ColumnID: integer;
begin
ColumnID := gtk_tree_view_column_get_sort_column_id(tree_column);
ImageCol := False;
- if ColumnID = 0 then ImageCol := GTK_IS_CELL_RENDERER_PIXBUF(cell);
+ if ColumnID = 0 then ImageCol := Assigned(cell);
if ImageCol then Exit;
Item := TFileAssoc(ListView.Selected.AsPointer(2));
if Item = nil then Exit;
Data := nil;
- gtk_tree_model_get(tree_model, iter, 2, @Data, -1);
- gtk_tree_model_get(tree_model, iter, ColumnID, @s, -1);
+ gtk_tree_model_get(tree_model, iter, [2, @Data, -1]);
+ gtk_tree_model_get(tree_model, iter, [ColumnID, @s, -1]);
if Assigned(Data) and (Data is TAssocAction) and (Item.ActionList.IndexOf(Data) = Item.DefaultAction)
then g_object_set(cell, 'markup', [g_strconcat('<span weight="bold">', s, '</span>', nil), nil])
diff --git a/UGnome.pas b/UGnome.pas
index 6d690a2..f835ff9 100644
--- a/UGnome.pas
+++ b/UGnome.pas
@@ -21,27 +21,11 @@ unit UGnome;
interface
-uses glib2, lazglib2, lazgobject2, gdk2, gdk2pixbuf, gtk2, Classes, ULibc,
+uses lazglib2, lazgobject2, lazgdk3, lazgdkpixbuf2, lazgtk3, Classes, ULibc,
GTKForms, GTKControls, GTKStdCtrls, GTKExtCtrls, GTKClasses, GTKDialogs, GTKUtils, GTKConsts,
uVFSprototypes;
-type TGnomeColorButton = class(TGTKButton)
- private
- FUseGnomeUI: boolean;
- FColor: TGDKColor;
- FColorChanged: TNotifyEvent;
- function GetColor: TGDKColor;
- procedure SetColor(Value: TGDKColor);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure SetDefaultColor;
- procedure UnsetDefaultColor;
- property Color: GTKClasses.TGDKColor read GetColor write SetColor;
- published
- property OnColorChanged: TNotifyEvent read FColorChanged write FColorChanged;
- end;
-
+type
TGnomeIconEntry = class(TGTKVBox)
private
FIconChanged: TNotifyEvent;
@@ -81,10 +65,8 @@ type TGnomeColorButton = class(TGTKButton)
TEphyNotebook = class(TGTKNotebook)
private
FShowCloseButtons: boolean;
- FShowTooltips: boolean;
FAllowDragDrop: boolean;
FAllowDragOutside: boolean;
- FTooltips: PGtkTooltips;
FOnNotebookReordered: TEphyNotebookReorderedEvent;
FOnTabClose: TEphyNotebookTabCloseEvent;
FOnTabDoubleClick: TEphyNotebookTabDoubleClickEvent;
@@ -103,7 +85,6 @@ type TGnomeColorButton = class(TGTKButton)
FBusy: boolean;
procedure SetShowCloseButtons(Value: boolean);
- procedure SetShowTooltips(Value: boolean);
procedure SetAllowDragDrop(Value: boolean);
procedure SetAllowDragOutside(Value: boolean);
@@ -129,7 +110,6 @@ type TGnomeColorButton = class(TGTKButton)
published
property PageIndex: integer read GetPageIndex write SetPageIndex;
property ShowCloseButtons: boolean read FShowCloseButtons write SetShowCloseButtons default False;
- property ShowTooltips: boolean read FShowTooltips write SetShowTooltips default False;
property AllowDragDrop: boolean read FAllowDragDrop write SetAllowDragDrop default False;
property AllowDragOutside: boolean read FAllowDragOutside write SetAllowDragOutside default False;
property OnNotebookReordered: TEphyNotebookReorderedEvent read FOnNotebookReordered write FOnNotebookReordered;
@@ -176,15 +156,7 @@ type PGnomeColorPicker = PGtkWidget;
const AFTER_ALL_TABS = -1;
NOT_IN_APP_WINDOWS = -2;
-var libGtk2Handle, libGnome2Handle, libGnomeUI2Handle: Pointer;
- gnome_about_new: function (const name, version, copyright, comments: Pchar; const authors, documenters: PPchar;
- const translator_credits: Pchar; logo_pixbuf: PGdkPixbuf): PGtkWidget; cdecl;
- gnome_program_init: function (const app_id, app_version: PChar; const module_info: Pointer; argc: integer; argv: PPChar): Pointer; varargs; cdecl;
- libgnome_module_info_get: function: Pointer; cdecl;
- libgnomeui_module_info_get: function: Pointer; cdecl;
- gnome_color_picker_new: function: PGnomeColorPicker; cdecl;
- gnome_color_picker_get_i16: procedure (cp: PGnomeColorPicker; R, G, B, A: Pword); cdecl;
- gnome_color_picker_set_i16: procedure (cp: PGnomeColorPicker; R, G, B, A: word); cdecl;
+var
gnome_icon_entry_new: function (const history_id, browse_dialog_title: Pchar): PGtkWidget; cdecl;
gnome_icon_entry_set_pixmap_subdir: procedure (ientry: PGnomeIconEntry; const subdir: Pgchar); cdecl;
gnome_icon_entry_get_filename: function (ientry: PGnomeIconEntry): Pgchar; cdecl;
@@ -195,17 +167,6 @@ var libGtk2Handle, libGnome2Handle, libGnomeUI2Handle: Pointer;
-procedure gtk_event_box_set_visible_window(event_box: PGtkEventBox; visible_window: gboolean); cdecl; external gtklib;
-function gtk_icon_size_lookup_for_settings(settings: PGtkSettings; size: TGtkIconSize; width, height: Pgint): gboolean; cdecl; external gtklib;
-procedure gtk_window_set_icon_name(window: PGtkWindow; const name: Pgchar); cdecl; external gtklib;
-function gtk_notebook_insert_page(notebook:PGtkNotebook; child:PGtkWidget;tab_label:PGtkWidget; position:gint):gint; cdecl; external gtklib;
-function gtk_message_dialog_new_with_markup(parent:PGtkWindow; flags:TGtkDialogFlags;
- _type:TGtkMessageType; buttons:TGtkButtonsType;
- message_format:Pgchar):PGtkWidget; varargs; cdecl; external gtklib;
-
-
-
-
procedure LoadGnomeLibs;
implementation
@@ -217,99 +178,6 @@ uses SysUtils, DateUtils, UCoreUtils, ULocale, UFileAssoc;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-procedure TGnomeColorButton_OnClick(button: PGtkButton; user_data: Pgpointer); cdecl;
-var Dialog: TGTKColorSelectionDialog;
- i: integer;
-begin
- if Assigned(user_data) then
- with TGnomeColorButton(user_data) do begin
- Dialog := TGTKColorSelectionDialog.CreateWithTitle(Parent, LANGSelectFileTypeColor);
- try
- Dialog.ShowPalette := True;
- Dialog.Color := Color;
- if Byte(Dialog.Run) = 251 then begin
- for i := 0 to 4 do SetBackgroundColor(i, GDKColorToPGdkColor(Dialog.Color));
- FColor := Dialog.Color;
- if Assigned(FColorChanged) then FColorChanged(TGnomeColorButton(user_data));
- end;
- finally
- Dialog.Free;
- end;
- end;
-end;
-
-procedure TGnomeColorButton_color_set(colorpicker: PGnomeColorPicker; arg1, arg2, arg3, arg4: Word; user_data: Pointer); cdecl;
-begin
- if Assigned(user_data) and Assigned(TGnomeColorButton(user_data).FColorChanged) then
- with TGnomeColorButton(user_data) do begin
- FColorChanged(TGnomeColorButton(user_data));
- FColor := Color;
- end;
-end;
-
-constructor TGnomeColorButton.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FUseGnomeUI := Assigned(gnome_color_picker_new) and Assigned(gnome_color_picker_get_i16) and Assigned(gnome_color_picker_set_i16);
- if FUseGnomeUI then begin
- FWidget := gnome_color_picker_new();
- g_signal_connect_data(PGObject(FWidget), 'color-set', TGCallback(@TGnomeColorButton_color_set), Self, nil, G_CONNECT_DEFAULT);
- end else begin
- FWidget := gtk_button_new_with_label(''); // This should be here due to height-related troubles
- g_signal_connect_data(PGObject(FWidget), 'clicked', TGCallback(@TGnomeColorButton_OnClick), Self, nil, G_CONNECT_DEFAULT);
- BorderStyle := bsHalf;
- end;
- Show;
- FColorChanged := nil;
-end;
-
-destructor TGnomeColorButton.Destroy;
-begin
- inherited Destroy;
-end;
-
-function TGnomeColorButton.GetColor: TGDKColor;
-var R, G, B, A: word;
-begin
- if FUseGnomeUI then begin
- if Enabled then begin
- gnome_color_picker_get_i16(FWidget, @R, @G, @B, @A);
- Result := PGdkColorToGDKColor(AllocateColor(nil, R, G, B));
- end else Result := FColor;
- end else Result := FColor;
-end;
-
-procedure TGnomeColorButton.SetColor(Value: TGDKColor);
-var i: integer;
-begin
- FColor := Value;
- if FUseGnomeUI then gnome_color_picker_set_i16(FWidget, Value.red, Value.green, Value.blue, 0)
- else for i := 0 to 4 do SetBackgroundColor(i, GDKColorToPGdkColor(Value));
-end;
-
-procedure TGnomeColorButton.SetDefaultColor;
-var i: integer;
-begin
- if not Enabled then Exit;
- gtk_widget_set_sensitive(PGtkWidget(FWidget), False);
- if FUseGnomeUI then begin
- FColor := GetColor;
- gnome_color_picker_set_i16(FWidget, 0, 0, 0, 0)
-// SetColor(PGdkColorToGDKColor(AllocateColor(FWidget, 0, 0, 0){GetDefaultBackgroundColor(1)}));
- end else for i := 0 to 4 do SetBackgroundColor(i, GetDefaultBackgroundColor(i));
-end;
-
-procedure TGnomeColorButton.UnsetDefaultColor;
-var i: integer;
-begin
- if Enabled then Exit;
- gtk_widget_set_sensitive(PGtkWidget(FWidget), True);
- if FUseGnomeUI then SetColor(FColor) else
- for i := 0 to 4 do SetBackgroundColor(i, GDKColorToPGdkColor(FColor));
-end;
-
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
procedure TGnomeIconEntry_changed(iconentry: PGnomeIconEntry; user_data: gpointer); cdecl;
begin
if Assigned(user_data) and Assigned(TGnomeIconEntry(user_data).FIconChanged) then
@@ -380,11 +248,8 @@ function label_ebox_button_pressed(widget: PGtkWidget; event: PGdkEventButton; d
constructor TEphyNotebook.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FTooltips := gtk_tooltips_new;
- gtk_tooltips_disable(FTooltips);
cursor := nil;
FShowCloseButtons := False;
- FShowTooltips := False;
FAllowDragDrop := False;
FAllowDragOutside := False;
FOnNotebookReordered := nil;
@@ -399,7 +264,7 @@ begin
g_signal_connect_data(PGObject(FWidget), 'button-press-event', TGCallback(@button_press_cb), Self, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(FWidget), 'button-release-event', TGCallback(@button_release_cb), Self, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(FWidget), 'scroll-event', TGCallback(@scroll_event_callback), Self, nil, G_CONNECT_DEFAULT);
- gtk_widget_add_events(FWidget, GDK_BUTTON1_MOTION_MASK);
+ gtk_widget_add_events(FWidget, guint(GDK_BUTTON1_MOTION_MASK));
Show;
end;
@@ -416,14 +281,6 @@ begin
// Apply settings here
end;
-
-procedure TEphyNotebook.SetShowTooltips(Value: boolean);
-begin
- FShowTooltips := Value;
- if Value then gtk_tooltips_enable(FTooltips)
- else gtk_tooltips_disable(FTooltips);
-end;
-
procedure TEphyNotebook.SetAllowDragDrop(Value: boolean);
begin
FAllowDragDrop := Value;
@@ -449,7 +306,9 @@ begin
char_width := pango_font_metrics_get_approximate_digit_width(metrics);
pango_font_metrics_unref(metrics); }
- gtk_icon_size_lookup_for_settings(gtk_widget_get_settings(hbox), GTK_ICON_SIZE_MENU, @w, @h);
+ w := 16;
+ h := 16;
+// gtk_icon_size_lookup_for_settings(gtk_widget_get_settings(hbox), GTK_ICON_SIZE_MENU, @w, @h);
// gtk_widget_set_size_request(hbox, TAB_WIDTH_N_CHARS * PANGO_PIXELS(char_width) + 2 * w, -1);
@@ -466,14 +325,14 @@ begin
tab := g_object_get_data(PGObject(widget), 'child');
ntb := TEphyNotebook(data);
- position := gtk_notebook_page_num(GTK_NOTEBOOK(ntb.FWidget), GTK_WIDGET(tab));
+ position := gtk_notebook_page_num(PGtkNotebook(ntb.FWidget), PGtkWidget(tab));
// DebugMsg(['@******* close_button_clicked_cb: Position = ', position, ', data = 0x', IntToHex(Integer(data), 8), ', widget = 0x', IntToHex(Integer(widget), 8)]);
CanClose := True;
if @ntb.FOnTabClose <> nil then ntb.FOnTabClose(ntb, position, CanClose);
- if CanClose then gtk_notebook_remove_page(GTK_NOTEBOOK(ntb.FWidget), position);
+ if CanClose then gtk_notebook_remove_page(PGtkNotebook(ntb.FWidget), position);
end;
function TEphyNotebook.AppendPage(Child: TGTKControl; Caption: string): integer;
@@ -483,52 +342,54 @@ end;
function TEphyNotebook.InsertPage(Position: integer; Child: TGTKControl; Caption: string): integer;
var hbox, label_hbox, label_ebox, _label, close_button, image, icon: PGtkWidget;
- rcstyle: PGtkRcStyle;
+// rcstyle: PGtkRcStyle;
begin
// set hbox spacing and label padding (see below) so that there's an equal amount of space around the label
- hbox := gtk_hbox_new(FALSE, 0);
+ hbox := gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
label_ebox := gtk_event_box_new();
- gtk_event_box_set_visible_window(GTK_EVENT_BOX (label_ebox), FALSE);
- gtk_box_pack_start(GTK_BOX (hbox), label_ebox, TRUE, TRUE, 0);
+ gtk_event_box_set_visible_window(PGtkEventBox (label_ebox), FALSE);
+ gtk_box_pack_start(PGtkBox (hbox), label_ebox, TRUE, TRUE, 0);
g_signal_connect_data(PGObject(label_ebox), 'button-press-event', TGCallback(@label_ebox_button_pressed), Self, nil, G_CONNECT_DEFAULT);
g_object_set_data(PGObject(label_ebox), 'child', Child.FWidget);
- label_hbox := gtk_hbox_new (FALSE, 0);
- gtk_container_add(GTK_CONTAINER (label_ebox), label_hbox);
+ label_hbox := gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_container_add(PGtkContainer (label_ebox), label_hbox);
// setup close button
close_button := gtk_button_new ();
- gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+ gtk_button_set_relief (PGtkButton (close_button), GTK_RELIEF_NONE);
// don't allow focus on the close button
g_object_set(PGObject(close_button), 'can-focus', [gboolean(FALSE), nil]);
- gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+ gtk_button_set_relief (PGtkButton (close_button), GTK_RELIEF_NONE);
- rcstyle := gtk_rc_style_new ();
+ // TODO
+{ rcstyle := gtk_rc_style_new ();
rcstyle^.xthickness := Ord(rcstyle^.ythickness = 0);
gtk_widget_modify_style (close_button, rcstyle);
gtk_rc_style_unref (rcstyle);
+}
+ image := gtk_image_new_from_icon_name('gtk-close', GTK_ICON_SIZE_MENU);
+ gtk_container_add(PGtkContainer(close_button), image);
+ gtk_box_pack_start(PGtkBox(hbox), close_button, FALSE, FALSE, 0);
- image := gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
- gtk_container_add (GTK_CONTAINER (close_button), image);
- gtk_box_pack_start (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
-
- gtk_tooltips_set_tip(FTooltips, close_button, PChar(LANGEphyNotebookCloseTab), nil);
+ gtk_widget_set_tooltip_text(close_button, PChar(LANGEphyNotebookCloseTab));
g_object_set_data(PGObject(close_button), 'tab', hbox);
g_object_set_data(PGObject(close_button), 'child', Child.FWidget);
g_signal_connect_data(PGObject(close_button), 'clicked', TGCallback(@close_button_clicked_cb), Self, nil, G_CONNECT_DEFAULT);
// setup site icon, empty by default
icon := gtk_image_new ();
- gtk_box_pack_start (GTK_BOX (label_hbox), icon, FALSE, FALSE, 0);
+ gtk_box_pack_start (PGtkBox (label_hbox), icon, FALSE, FALSE, 0);
// setup label
_label := gtk_label_new(PChar(Caption));
-// gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
-// gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC(_label), 0.0, 0.5);
- gtk_misc_set_padding (GTK_MISC(_label), 2, 0);
- gtk_box_pack_start (GTK_BOX(label_hbox), _label, TRUE, TRUE, 0);
+// gtk_label_set_ellipsize (PGtkLabel (label), PANGO_ELLIPSIZE_END);
+// gtk_label_set_single_line_mode (PGtkLabel (label), TRUE);
+ gtk_label_set_yalign(PGtkLabel(_label), 0.5);
+ gtk_widget_set_margin_start(_label, 2);
+ gtk_widget_set_margin_end(_label, 2);
+ gtk_box_pack_start (PGtkBox(label_hbox), _label, TRUE, TRUE, 0);
// Set minimal size
g_signal_connect_data(PGObject(hbox), 'style-set', TGCallback(@tab_label_style_set_cb), nil, nil, G_CONNECT_DEFAULT);
@@ -545,7 +406,6 @@ begin
g_object_set_data(PGObject(hbox), 'label-ebox', label_ebox);
g_object_set_data(PGObject(hbox), 'icon', icon);
g_object_set_data(PGObject(hbox), 'close-button', close_button);
- g_object_set_data(PGObject(hbox), 'tooltips', FTooltips);
Result := gtk_notebook_insert_page(PGtkNotebook(FWidget), Child.FWidget, hbox, Position);
end;
@@ -560,7 +420,7 @@ var wid, lab: PGtkWidget;
begin
wid := gtk_notebook_get_tab_label(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo));
lab := g_object_get_data (PGObject(wid), 'label');
- Result := String(gtk_label_get_text(GTK_LABEL(lab)));
+ Result := String(gtk_label_get_text(PGtkLabel(lab)));
end;
procedure TEphyNotebook.SetTabCaption(PageNo: integer; Caption: string);
@@ -568,7 +428,7 @@ var wid, lab: PGtkWidget;
begin
wid := gtk_notebook_get_tab_label(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo));
lab := g_object_get_data (PGObject(wid), 'label');
- gtk_label_set_text(GTK_LABEL(lab), PChar(Caption));
+ gtk_label_set_text(PGtkLabel(lab), PChar(Caption));
end;
procedure TEphyNotebook.SetTabTooltip(PageNo: integer; ATooltip: string);
@@ -576,7 +436,7 @@ var wid, lab: PGtkWidget;
begin
wid := gtk_notebook_get_tab_label(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo));
lab := g_object_get_data (PGObject(wid), 'label-ebox');
- gtk_tooltips_set_tip(FTooltips, lab, PChar(ATooltip), nil);
+ gtk_widget_set_tooltip_text(lab, PChar(ATooltip));
end;
function TEphyNotebook.GetPageIndex: integer;
@@ -588,7 +448,7 @@ procedure TEphyNotebook.SetPageIndex(Value: integer);
begin
DebugMsg(['SetPageIndex(Value = ', Value, ')']);
if (GetPageIndex <> Value) and (Value >= 0) then begin
- gtk_notebook_set_page(PGtkNotebook(FWidget), Value);
+ gtk_notebook_set_current_page(PGtkNotebook(FWidget), Value);
if Assigned(FOnTabSwitchedEvent) then FOnTabSwitchedEvent(Self, Value, True);
end;
end;
@@ -599,11 +459,12 @@ var tab_pos: TGtkPositionType;
page_num: integer;
page, tab: PGtkWidget;
max_x, max_y, x_root, y_root: integer;
+ allocation: TGtkAllocation;
begin
page_num := 0;
tab_pos := gtk_notebook_get_tab_pos(PGtkNotebook(FWidget));
- if PGtkNotebook(FWidget)^.first_tab = nil then begin
+ if gtk_notebook_get_n_pages(PGtkNotebook(FWidget)) < 1 then begin
DebugMsg(['@***************** first_tab = nil']);
Result := AFTER_ALL_TABS;
// DebugMsg(['@******* find_tab_num_at_pos(abs_x = ', abs_x, ', abs_y = ', abs_y, ', Result = ', Result, ')']);
@@ -627,15 +488,16 @@ begin
Exit;
end;
- if (not GTK_WIDGET_MAPPED(GTK_WIDGET(tab))) then begin
+ if (not gtk_widget_get_mapped(PGtkWidget(tab))) then begin
Inc(page_num);
Continue;
end;
- gdk_window_get_origin(GDK_WINDOW(tab^.window), @x_root, @y_root);
+ gdk_window_get_origin(PGdkWindow(tab^.window), @x_root, @y_root);
- max_x := x_root + tab^.allocation.x + tab^.allocation.width;
- max_y := y_root + tab^.allocation.y + tab^.allocation.height;
+ gtk_widget_get_allocation(tab, @allocation);
+ max_x := x_root + allocation.x + allocation.width;
+ max_y := y_root + allocation.y + allocation.height;
if (((tab_pos = GTK_POS_TOP) or (tab_pos = GTK_POS_BOTTOM)) and (abs_x <= max_x)) or
((tab_pos = GTK_POS_LEFT) or (tab_pos = GTK_POS_RIGHT)) and (abs_y <= max_y) then
@@ -706,7 +568,7 @@ terminal_notebook_move_tab (TerminalNotebook *src,
if (dest == NULL || src == dest)
{
gtk_notebook_reorder_child
- (GTK_NOTEBOOK (src), GTK_WIDGET (screen), dest_position);
+ (PGtkNotebook (src), PGtkWidget (screen), dest_position);
if (src->priv->drag_in_progress == FALSE)
{
@@ -725,7 +587,7 @@ terminal_notebook_move_tab (TerminalNotebook *src,
/* Set new window for screen so TerminalScreen widget realize function
* works.
*/
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (dest));
+ toplevel = gtk_widget_get_toplevel (PGtkWidget (dest));
g_assert (GTK_WIDGET_TOPLEVEL (toplevel));
g_assert (TERMINAL_IS_WINDOW (toplevel));
@@ -744,11 +606,11 @@ begin
DebugMsg(['@######## drag_stop']);
toplevel := gtk_widget_get_toplevel(FWidget);
- if not GTK_WIDGET_TOPLEVEL(toplevel) then begin
+ if not Assigned(toplevel) then begin
DebugMsg(['@######## drag_stop: GTK_WIDGET_TOPLEVEL(toplevel) = False']);
Exit;
end;
-{ child := gtk_bin_get_child(GTK_BIN(toplevel));
+{ child := gtk_bin_get_child(GtkBin(toplevel));
if child = nil then begin
DebugMsg(['@######## drag_stop: child = nil']);
Exit;
@@ -777,13 +639,13 @@ begin
end;
// ungrab the pointer if it's grabbed
- // FIXME multihead
- if gdk_pointer_is_grabbed() then gdk_pointer_ungrab(time);
+ // TODO
+// if gdk_pointer_is_grabbed() then gdk_pointer_ungrab(time);
gtk_grab_remove(toplevel);
if drag_in_progress then begin
if FBusy then Exit;
- drag_stop_idx := gtk_notebook_get_current_page(GTK_NOTEBOOK(FWidget));
+ drag_stop_idx := gtk_notebook_get_current_page(PGtkNotebook(FWidget));
DebugMsg(['@######## drag_stop: final move: ', drag_start_idx, ' --> ', drag_stop_idx]);
// The two indexes are equal when moving tab to another notebook
@@ -865,11 +727,11 @@ begin
ntb := TEphyNotebook(data);
if ntb.drag_in_progress then begin
-// cur_page_num := gtk_notebook_get_current_page(GTK_NOTEBOOK(ntb.FWidget));
-// cur_page := gtk_notebook_get_nth_page(GTK_NOTEBOOK(ntb.FWidget), cur_page_num);
+// cur_page_num := gtk_notebook_get_current_page(PGtkNotebook(ntb.FWidget));
+// cur_page := gtk_notebook_get_nth_page(PGtkNotebook(ntb.FWidget), cur_page_num);
(* if (!is_in_notebook_window (notebook, event->x_root, event->y_root)
- && gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) > 1)
+ && gtk_notebook_get_n_pages (PGtkNotebook (notebook)) > 1)
{
/* Tab was detached */
g_signal_emit (G_OBJECT (notebook),
@@ -887,8 +749,8 @@ var toplevel, child: PGtkWidget;
begin
DebugMsg(['@######## drag_start']);
Result := False;
- // FIXME multihead
- if drag_in_progress or gdk_pointer_is_grabbed() then Exit;
+ // TODO
+ if drag_in_progress { or gdk_pointer_is_grabbed()} then Exit;
if not FAllowDragDrop then Exit;
if FBusy then Exit;
@@ -899,13 +761,13 @@ begin
if cursor = nil then cursor := gdk_cursor_new(GDK_FLEUR);
toplevel := gtk_widget_get_toplevel(FWidget);
- if not GTK_WIDGET_TOPLEVEL(toplevel) then begin
+ if not Assigned(toplevel) then begin
DebugMsg(['@######## drag_start: GTK_WIDGET_TOPLEVEL(toplevel) = False']);
Result := False;
Exit;
end;
- child := gtk_bin_get_child(GTK_BIN(toplevel));
+ child := gtk_bin_get_child(PGtkBin(toplevel));
if child = nil then begin
DebugMsg(['@######## drag_start: child = nil']);
Result := False;
@@ -916,7 +778,7 @@ begin
gtk_grab_add(toplevel);
// FIXME multi-head
- if gdk_pointer_grab(toplevel^.window, False, GDK_BUTTON1_MOTION_MASK or GDK_BUTTON_RELEASE_MASK, nil,
+ if gdk_pointer_grab(toplevel^.window, False, [GDK_BUTTON1_MOTION_MASK, GDK_BUTTON_RELEASE_MASK], nil,
cursor, time) <> GDK_GRAB_SUCCESS then
begin
DebugMsg(['@######## drag_start: gdk_pointer_grab <> GDK_GRAB_SUCCESS']);
@@ -933,7 +795,7 @@ begin
toplevel_button_release_handler_id := g_signal_connect_data(PGObject(toplevel), 'button-release-event', TGCallback(@toplevel_button_release_cb), Self, nil, G_CONNECT_DEFAULT);
grab_notify_handler_id := g_signal_connect_data(PGObject(FWidget), 'grab-notify', TGCallback(@grab_notify_cb), Self, nil, G_CONNECT_DEFAULT);
- drag_start_idx := gtk_notebook_get_current_page(GTK_NOTEBOOK(FWidget));
+ drag_start_idx := gtk_notebook_get_current_page(PGtkNotebook(FWidget));
Result := True;
end else begin
DebugMsg(['@######## drag_start: some handlers are non-null']);
@@ -946,11 +808,11 @@ procedure TEphyNotebook.move_tab(dest_position: integer);
var cur_page_num: integer;
cur_tab: PGtkWidget;
begin
- cur_page_num := gtk_notebook_get_current_page(GTK_NOTEBOOK(FWidget));
+ cur_page_num := gtk_notebook_get_current_page(PGtkNotebook(FWidget));
// DebugMsg(['@######## move_tab(dest_position = ', dest_position, ', cur_page_num = ', cur_page_num]);
if (dest_position <> cur_page_num) and (dest_position >= 0) then begin
- cur_tab := gtk_notebook_get_nth_page(GTK_NOTEBOOK(FWidget), cur_page_num);
- gtk_notebook_reorder_child(GTK_NOTEBOOK(FWidget), cur_tab, dest_position);
+ cur_tab := gtk_notebook_get_nth_page(PGtkNotebook(FWidget), cur_page_num);
+ gtk_notebook_reorder_child(PGtkNotebook(FWidget), cur_tab, dest_position);
{ terminal_notebook_move_tab (TERMINAL_NOTEBOOK (notebook), NULL,
TERMINAL_SCREEN (cur_tab),
@@ -966,7 +828,7 @@ begin
Result := False;
if (not ntb.drag_in_progress) and (ntb.x_start >= 0) and (ntb.y_start >= 0) and
- gtk_drag_check_threshold(GTK_WIDGET(notebook), ntb.x_start, ntb.y_start,
+ gtk_drag_check_threshold(PGtkWidget(notebook), ntb.x_start, ntb.y_start,
Trunc(event^.x_root), Trunc(event^.y_root))
then Result := ntb.drag_start(event^.time);
end;
@@ -993,7 +855,7 @@ begin
Exit;
end;
- cur_page := gtk_notebook_get_current_page(GTK_NOTEBOOK(FWidget));
+ cur_page := gtk_notebook_get_current_page(PGtkNotebook(FWidget));
// stop drag in origin window
// ungrab the pointer if it's grabbed
@@ -1006,8 +868,8 @@ begin
(* g_assert (TERMINAL_IS_NOTEBOOK (dest));
g_assert (dest != src);
- cur_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (src));
- screen = gtk_notebook_get_nth_page (GTK_NOTEBOOK (src), cur_page);
+ cur_page = gtk_notebook_get_current_page (PGtkNotebook (src));
+ screen = gtk_notebook_get_nth_page (PGtkNotebook (src), cur_page);
/* stop drag in origin window */
/* ungrab the pointer if it's grabbed */
@@ -1016,7 +878,7 @@ begin
{
gdk_pointer_ungrab (event->time);
}
- gtk_grab_remove (GTK_WIDGET (src));
+ gtk_grab_remove (PGtkWidget (src));
terminal_notebook_move_tab (src, dest, TERMINAL_SCREEN (screen),
dest_position);
@@ -1068,11 +930,11 @@ begin
Result := False;
ntb := TEphyNotebook(data);
tab := g_object_get_data(PGObject(widget), 'child');
- position := gtk_notebook_page_num(GTK_NOTEBOOK(ntb.FWidget), GTK_WIDGET(tab));
+ position := gtk_notebook_page_num(PGtkNotebook(ntb.FWidget), PGtkWidget(tab));
// DebugMsg(['@******* label_ebox_button_pressed, button = ', event^.button, ', Position = ', position, ', data = 0x', IntToHex(Integer(data), 8), ', widget = 0x', IntToHex(Integer(widget), 8)]);
- if (((event^.button = 2) and (event^._type = GDK_BUTTON_PRESS)) or // Middle-click
- ((event^.button = 1) and (event^._type = GDK_2BUTTON_PRESS))) and // Double-click
+ if (((event^.button = 2) and (event^.type_ = GDK_BUTTON_PRESS)) or // Middle-click
+ ((event^.button = 1) and (event^.type_ = GDK_2BUTTON_PRESS))) and // Double-click
Assigned(ntb.FOnTabDoubleClick) then
begin
ntb.FOnTabDoubleClick(ntb, position);
@@ -1100,7 +962,7 @@ begin
Exit;
end;
- if ((event^.button = 1) or (event^.button = 3)) and (event^._type = GDK_BUTTON_PRESS) and (tab_clicked >= 0) then
+ if ((event^.button = 1) or (event^.button = 3)) and (event^.type_ = GDK_BUTTON_PRESS) and (tab_clicked >= 0) then
begin
if event^.button = 1 then begin
ntb.x_start := Trunc(event^.x_root);
@@ -1112,7 +974,7 @@ begin
if tab_clicked >= 0 then begin
if tab_clicked <> gtk_notebook_get_current_page(PGtkNotebook(ntb.FWidget)) then begin
ntb.FBusy := True;
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), tab_clicked);
+ gtk_notebook_set_current_page(PGtkNotebook(notebook), tab_clicked);
if Assigned(ntb.FOnTabSwitchedEvent) then ntb.FOnTabSwitchedEvent(ntb, tab_clicked, True);
Application.ProcessMessages;
ntb.FBusy := False;
@@ -1124,13 +986,13 @@ begin
Result := event^.button <> 3;
end else Result := True; // consume the event if not clicked any tab
{ else
- if (GDK_BUTTON_PRESS = event^._type) and (event^.button = 3) then begin
+ if (GDK_BUTTON_PRESS = event^.type_) and (event^.button = 3) then begin
if tab_clicked = -1 then begin
// consume event, so that we don't pop up the context menu when the mouse if not over a screen label
Result := True;
end else
// switch to the page the mouse is over, but don't consume the event
- if (tab_clicked >= 0) then gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), tab_clicked);
+ if (tab_clicked >= 0) then gtk_notebook_set_current_page(PGtkNotebook(notebook), tab_clicked);
end; }
end;
@@ -1144,12 +1006,13 @@ begin
ntb := TEphyNotebook(user_data);
if ntb.FBusy then Exit;
- child := gtk_notebook_get_nth_page(GTK_NOTEBOOK(ntb.FWidget), gtk_notebook_get_current_page(PGtkNotebook(ntb.FWidget)));
+ child := gtk_notebook_get_nth_page(PGtkNotebook(ntb.FWidget), gtk_notebook_get_current_page(PGtkNotebook(ntb.FWidget)));
if (child <> nil) then begin
// DebugMsg(['scroll_event_callback: x = ', event^.x, ', y = ', event^.y]);
px := 0;
py := 0;
- gtk_widget_get_pointer(child, @px, @py);
+ // TODO
+// gtk_widget_get_pointer(child, @px, @py);
// DebugMsg(['scroll_event_callback: px = ', px, ', py = ', py]);
if (px >= 0) and (py >= 0) then Exit;
end;
@@ -1175,8 +1038,8 @@ end;
function Gnome_MessageBox_key_press_event(widget: PGtkWidget; event: PGdkEventKey; user_data : gpointer): gboolean; cdecl;
begin
Result := False;
- if event^.keyval = GDK_ESCAPE then begin
- gtk_dialog_response(PGtkDialog(widget), integer(user_data));
+ if event^.keyval = GDK_KEY_Escape then begin
+ gtk_dialog_response(PGtkDialog(widget), TGtkResponseType(guint(user_data)));
// Beep;
Result := True;
end;
@@ -1196,19 +1059,19 @@ begin
Result := Escape;
Exit;
end;
- Dialog := gtk_message_dialog_new(ParentWindow, GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT, TMessageStyleID[Integer(Style)],
- GTK_BUTTONS_NONE, '%s', PChar(Text));
+ Dialog := gtk_message_dialog_new(ParentWindow, [GTK_DIALOG_MODAL, GTK_DIALOG_DESTROY_WITH_PARENT], TMessageStyleID[Integer(Style)],
+ GTK_BUTTONS_NONE, '%s', [PChar(Text)]);
CheckBox := PGtkCheckButton(gtk_check_button_new_with_mnemonic(PChar(DontShowAgainText)));
gtk_widget_show(PGtkWidget(CheckBox));
- gtk_box_pack_end(GTK_BOX(GTK_DIALOG(Dialog)^.vbox), PGtkWidget(CheckBox), False, False, 12);
+ gtk_box_pack_end(PGtkBox(gtk_dialog_get_content_area(PGtkDialog(Dialog))), PGtkWidget(CheckBox), False, False, 12);
for i := 1 to NumMessageButtons do
if TMessageButton(i - 1) in Buttons then begin
- w := gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], i);
+ w := gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], TGtkResponseType(i));
if TMessageButton(i - 1) = Default then gtk_widget_grab_focus(w);
end;
if Escape <> mbNone then g_signal_connect_data(PGObject(Dialog), 'key-press-event', TGCallback(@Gnome_MessageBox_key_press_event),
Pointer(Ord(Escape) + 1{MessageButtonID[Ord(Escape)]}), nil, G_CONNECT_DEFAULT);
- if Default <> mbNone then gtk_dialog_set_default_response(PGtkDialog(Dialog), Ord(Default));
+ if Default <> mbNone then gtk_dialog_set_default_response(PGtkDialog(Dialog), TGtkResponseType(Default));
Result := TMessageButton(gtk_dialog_run(PGtkDialog(Dialog)) - 1);
DontShowAgainChecked := gtk_toggle_button_get_active(PGtkToggleButton(CheckBox));
gtk_widget_destroy(Dialog);
@@ -1239,13 +1102,13 @@ begin
end;
if (primary <> nil) and (secondary <> nil)
- then dialog := gtk_message_dialog_new_with_markup (PGtkWindow(DialogParent), 0,
+ then dialog := gtk_message_dialog_new_with_markup (PGtkWindow(DialogParent), [],
GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
'<span size="large" weight="ultrabold">%s</span>'#10'%s',
- primary, secondary)
- else dialog := gtk_message_dialog_new (PGtkWindow(DialogParent), 0,
+ [primary, secondary])
+ else dialog := gtk_message_dialog_new (PGtkWindow(DialogParent), [],
GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE, '%s', AMessage);
+ GTK_BUTTONS_NONE, '%s', [AMessage]);
if primary <> nil then g_free (primary);
// gtk_window_set_title (PGtkWindow(dialog), 'VFS Question');
@@ -1256,7 +1119,7 @@ begin
do Inc(len);
for count := len - 1 downto 0 do
- gtk_dialog_add_button (PGtkDialog(dialog), TOpenPCharArray(choices)[count], count);
+ gtk_dialog_add_button(PGtkDialog(dialog), TOpenPCharArray(choices)[count], TGtkResponseType(count));
res := gtk_dialog_run (PGtkDialog(Dialog));
if choice <> nil then choice^ := res;
@@ -1292,9 +1155,9 @@ end;
procedure pw_dialog_verify_input(editable: PGtkEditable; priv: PVFSAskPasswordCallbackPriv); cdecl;
begin
- gtk_dialog_set_response_sensitive (GTK_DIALOG (priv^.dialog),
- GTK_RESPONSE_OK,
- pw_dialog_input_is_valid(priv));
+ gtk_dialog_set_response_sensitive(PGtkDialog(priv^.dialog),
+ GTK_RESPONSE_OK,
+ pw_dialog_input_is_valid(priv));
end;
procedure pw_dialog_anonymous_toggled(widget: PGtkWidget; priv: PVFSAskPasswordCallbackPriv); cdecl;
@@ -1304,7 +1167,7 @@ begin
if anonymous then is_valid := True
else is_valid := pw_dialog_input_is_valid(priv);
gtk_widget_set_sensitive (priv^.entry_container, not anonymous);
- gtk_dialog_set_response_sensitive(GTK_DIALOG (priv^.dialog), GTK_RESPONSE_OK, is_valid);
+ gtk_dialog_set_response_sensitive(PGtkDialog (priv^.dialog), GTK_RESPONSE_OK, is_valid);
end;
procedure pw_dialog_cycle_focus(widget: PGtkWidget; priv: PVFSAskPasswordCallbackPriv); cdecl;
@@ -1318,7 +1181,7 @@ begin
then next_widget := PGtkWidget(priv^.password_entry);
if next_widget <> nil then gtk_widget_grab_focus(next_widget)
else if pw_dialog_input_is_valid(priv)
- then gtk_window_activate_default(GTK_WINDOW(priv^.dialog));
+ then gtk_window_activate_default(PGtkWindow(priv^.dialog));
end;
procedure unmask_checkbox_toggled(togglebutton: PGtkToggleButton; priv: PVFSAskPasswordCallbackPriv); cdecl;
@@ -1341,27 +1204,28 @@ function HandleVFSAskPasswordCallback(DialogParent: PGtkWidget;
anonymous: Pgboolean;
domain: PPChar;
password_save: PVFSPasswordSave): gboolean;
-
+// TODO
+{
function table_add_entry(table: PGtkWidget; row: integer; const label_text: PChar; const value: PChar; user_data: PVFSAskPasswordCallbackPriv): PGtkEntry;
var entry: PGtkEntry;
alabel: PGtkWidget;
begin
alabel := gtk_label_new_with_mnemonic (label_text);
- gtk_misc_set_alignment (GTK_MISC (alabel), 0.0, 0.5);
+ gtk_label_set_yalign(PGtkLabel(alabel), 0.5);
entry := PGtkEntry(gtk_entry_new ());
if value <> nil then gtk_entry_set_text (PGtkEntry(entry), value);
- gtk_table_attach (GTK_TABLE (table), alabel, 0, 1, row, row + 1, GTK_FILL, GTK_EXPAND or GTK_FILL, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), alabel, 0, 1, row, row + 1, GTK_FILL, [GTK_EXPAND, GTK_FILL], 0, 0);
gtk_table_attach_defaults (GTK_TABLE (table), PGtkWidget(entry), 1, 2, row, row + 1);
gtk_label_set_mnemonic_widget (PGtkLabel(alabel), PGtkWidget(entry));
g_signal_connect_data(PGObject(entry), 'changed', TGCallback (@pw_dialog_verify_input), user_data, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(entry), 'activate', TGCallback (@pw_dialog_cycle_focus), user_data, nil, G_CONNECT_DEFAULT);
Result := entry;
end;
-
+}
var widget: PGtkWidget;
window: PGtkWindow;
hbox, main_vbox, vbox, icon: PGtkWidget;
- table: PGtkWidget;
+ grid: PGtkWidget;
message_label: PGtkWidget;
can_anonymous: boolean;
Rows: integer;
@@ -1385,11 +1249,10 @@ begin
gtk_window_set_title (window, '');
// Set the dialog up with HIG properties
- gtk_dialog_set_has_separator (priv.dialog, False);
- gtk_container_set_border_width (GTK_CONTAINER (priv.dialog), 5);
- gtk_box_set_spacing (GTK_BOX (priv.dialog^.vbox), 2); // 2 * 5 + 2 = 12
- gtk_container_set_border_width (GTK_CONTAINER (priv.dialog^.action_area), 5);
- gtk_box_set_spacing (GTK_BOX (priv.dialog^.action_area), 6);
+ gtk_container_set_border_width (PGtkContainer (priv.dialog), 5);
+// gtk_box_set_spacing (PGtkBox (priv.dialog^.vbox), 2); // 2 * 5 + 2 = 12
+ gtk_container_set_border_width(PGtkContainer(gtk_dialog_get_action_area(PGtkDialog(priv.dialog))), 5);
+ gtk_box_set_spacing(PGtkBox(gtk_dialog_get_action_area(PGtkDialog(priv.dialog))), 6);
gtk_window_set_resizable (window, False);
// gtk_window_set_icon_name (window, 'gtk-dialog-authentication');
@@ -1399,47 +1262,45 @@ begin
else s := PChar(LANGConnMgr_ConnectButton);
gtk_dialog_add_buttons (priv.dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_CANCEL, [GTK_RESPONSE_CANCEL,
s, GTK_RESPONSE_OK,
- nil);
+ nil]);
gtk_dialog_set_default_response (priv.dialog, GTK_RESPONSE_OK);
// Build contents
- hbox := gtk_hbox_new (FALSE, 12);
- gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_pack_start (GTK_BOX (priv.dialog^.vbox), hbox, TRUE, TRUE, 0);
+ hbox := gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
+ gtk_container_set_border_width (PGtkContainer (hbox), 5);
+ gtk_box_pack_start(PGtkBox(gtk_dialog_get_content_area(priv.dialog)), hbox, TRUE, TRUE, 0);
- if gtk_style_lookup_icon_set(gtk_widget_get_style(PGtkWidget(priv.dialog)), 'gtk-dialog-authentication') <> nil
- then icon := gtk_image_new_from_stock('gtk-dialog-authentication', GTK_ICON_SIZE_DIALOG)
- else icon := gtk_image_new_from_pixbuf(StockLock48.FPixbuf);
+ icon := gtk_image_new_from_icon_name('gtk-dialog-authentication', GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
- gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
+ gtk_widget_set_halign(icon, GTK_ALIGN_CENTER);
+ gtk_box_pack_start (PGtkBox (hbox), icon, FALSE, FALSE, 0);
- main_vbox := gtk_vbox_new (FALSE, 18);
- gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
+ main_vbox := gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
+ gtk_box_pack_start (PGtkBox (hbox), main_vbox, TRUE, TRUE, 0);
message_label := gtk_label_new (AMessage);
- gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
- gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
- gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label), FALSE, FALSE, 0);
+ gtk_label_set_yalign(PGtkLabel(message_label), 0.5);
+ gtk_label_set_line_wrap (PGtkLabel (message_label), TRUE);
+ gtk_box_pack_start (PGtkBox (main_vbox), PGtkWidget (message_label), FALSE, FALSE, 0);
- vbox := gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
+ vbox := gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_pack_start (PGtkBox (main_vbox), vbox, FALSE, FALSE, 0);
can_anonymous := (flags and VFS_ASK_PASSWORD_ANONYMOUS_SUPPORTED) = VFS_ASK_PASSWORD_ANONYMOUS_SUPPORTED;
if can_anonymous then begin
- anon_box := gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (vbox), anon_box, FALSE, FALSE, 0);
+ anon_box := gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_pack_start (PGtkBox (vbox), anon_box, FALSE, FALSE, 0);
priv.choice_anon := gtk_radio_button_new_with_mnemonic(nil, PChar(LANGGtkMountOperation_ConnectAnonymously));
- gtk_box_pack_start(GTK_BOX (anon_box), priv.choice_anon, FALSE, FALSE, 0);
+ gtk_box_pack_start(PGtkBox (anon_box), priv.choice_anon, FALSE, FALSE, 0);
g_signal_connect_data(PGObject(priv.choice_anon), 'toggled', TGCallback (@pw_dialog_anonymous_toggled), @priv, nil, G_CONNECT_DEFAULT);
- group := LAZGLIB2.PGSList(gtk_radio_button_get_group(GTK_RADIO_BUTTON(priv.choice_anon)));
- priv.choice_user := gtk_radio_button_new_with_mnemonic(GLIB2.PGSList(group), PChar(LANGGtkMountOperation_ConnectAsUser));
- gtk_box_pack_start(GTK_BOX(anon_box), priv.choice_user, FALSE, FALSE, 0);
+ group := PGSList(gtk_radio_button_get_group(PGtkRadioButton(priv.choice_anon)));
+ priv.choice_user := gtk_radio_button_new_with_mnemonic(group, PChar(LANGGtkMountOperation_ConnectAsUser));
+ gtk_box_pack_start(PGtkBox(anon_box), priv.choice_user, FALSE, FALSE, 0);
g_signal_connect_data(PGObject(priv.choice_user), 'toggled', TGCallback (@pw_dialog_anonymous_toggled), @priv, nil, G_CONNECT_DEFAULT);
end;
@@ -1449,15 +1310,18 @@ begin
if (flags and VFS_ASK_PASSWORD_NEED_DOMAIN) = VFS_ASK_PASSWORD_NEED_DOMAIN then Inc(rows);
// The table that holds the entries
+
+ // TODO
+{
priv.entry_container := gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
if can_anonymous then g_object_set(PGObject(priv.entry_container), 'left-padding', [12, nil]);
- gtk_box_pack_start(GTK_BOX(vbox), priv.entry_container, FALSE, FALSE, 0);
+ gtk_box_pack_start(PGtkBox(vbox), priv.entry_container, FALSE, FALSE, 0);
table := gtk_table_new (rows, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_container_add (GTK_CONTAINER (priv.entry_container), table);
+ gtk_container_add (PGtkContainer (priv.entry_container), table);
Rows := 0;
if (flags and VFS_ASK_PASSWORD_NEED_USERNAME) = VFS_ASK_PASSWORD_NEED_USERNAME then begin
@@ -1473,39 +1337,39 @@ begin
if (default_password <> nil) and (strlen(default_password) > 0) then
gtk_entry_set_text(priv.password_entry, default_password);
// Inc(Rows);
- gtk_entry_set_visibility (GTK_ENTRY (priv.password_entry), FALSE);
+ gtk_entry_set_visibility (PGtkEntry (priv.password_entry), FALSE);
end;
if (flags and VFS_ASK_PASSWORD_ARCHIVE_MODE) = VFS_ASK_PASSWORD_ARCHIVE_MODE then begin
unmask_checkbox := gtk_check_button_new_with_mnemonic (PChar(LANGFSetPassword_ShowPasswordCheckButton));
g_object_set(PGObject(unmask_checkbox), 'can-focus', [0, nil]);
- gtk_box_pack_start (GTK_BOX (vbox), unmask_checkbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (PGtkBox (vbox), unmask_checkbox, FALSE, FALSE, 0);
g_signal_connect_data(PGObject(unmask_checkbox), 'toggled', TGCallback (@unmask_checkbox_toggled), @priv, nil, G_CONNECT_DEFAULT);
end;
if ((flags and VFS_ASK_PASSWORD_SAVING_SUPPORTED) = VFS_ASK_PASSWORD_SAVING_SUPPORTED) or
((flags and VFS_ASK_PASSWORD_SAVE_INTERNAL) = VFS_ASK_PASSWORD_SAVE_INTERNAL) then
begin
- remember_box := gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (vbox), remember_box, FALSE, FALSE, 0);
+ remember_box := gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_pack_start (PGtkBox (vbox), remember_box, FALSE, FALSE, 0);
if (flags and VFS_ASK_PASSWORD_SAVING_SUPPORTED) = 0 then s := PChar(LANGGtkMountOperation_DoNotSavePassword)
else s := PChar(LANGGtkMountOperation_ForgetPasswordImmediately);
radio_forget := gtk_radio_button_new_with_mnemonic (nil, s);
- gtk_box_pack_start (GTK_BOX (remember_box), radio_forget, FALSE, FALSE, 0);
+ gtk_box_pack_start (PGtkBox (remember_box), radio_forget, FALSE, FALSE, 0);
- group := LAZGLIB2.PGSList(gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_forget)));
+ group := PGSList(gtk_radio_button_get_group(PGtkRadioButton(radio_forget)));
// gnome-keyring only
if (flags and VFS_ASK_PASSWORD_SAVING_SUPPORTED) = VFS_ASK_PASSWORD_SAVING_SUPPORTED then begin
- radio_session := gtk_radio_button_new_with_mnemonic(GLIB2.PGSList(group), PChar(LANGGtkMountOperation_RememberPasswordUntilYouLogout));
- gtk_box_pack_start (GTK_BOX (remember_box), radio_session, FALSE, FALSE, 0);
- group := LAZGLIB2.PGSList(gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_session)));
+ radio_session := gtk_radio_button_new_with_mnemonic(group, PChar(LANGGtkMountOperation_RememberPasswordUntilYouLogout));
+ gtk_box_pack_start (PGtkBox (remember_box), radio_session, FALSE, FALSE, 0);
+ group := gtk_radio_button_get_group(PGtkRadioButton(radio_session));
end;
if (flags and VFS_ASK_PASSWORD_SAVING_SUPPORTED) = 0 then s := PChar(LANGGtkMountOperation_SavePasswordInConnectionManager)
else s := PChar(LANGGtkMountOperation_RememberForever);
- radio_remember := gtk_radio_button_new_with_mnemonic(GLIB2.PGSList(group), s);
- gtk_box_pack_start (GTK_BOX (remember_box), radio_remember, FALSE, FALSE, 0);
+ radio_remember := gtk_radio_button_new_with_mnemonic(group, s);
+ gtk_box_pack_start (PGtkBox (remember_box), radio_remember, FALSE, FALSE, 0);
// Select to save password when internal saving is supported
if (flags and VFS_ASK_PASSWORD_SAVE_INTERNAL) = VFS_ASK_PASSWORD_SAVE_INTERNAL
@@ -1513,13 +1377,13 @@ begin
end;
// The anonymous option will be active by default, ensure the toggled signal is emitted for it.
- if can_anonymous then gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (priv.choice_anon)) else
+ if can_anonymous then gtk_toggle_button_toggled (PGtkToggleButton(priv.choice_anon)) else
if not pw_dialog_input_is_valid(@priv) then gtk_dialog_set_response_sensitive(priv.dialog, GTK_RESPONSE_OK, False);
- gtk_widget_show_all (GTK_WIDGET (priv.dialog));
+ gtk_widget_show_all (PGtkWidget (priv.dialog));
gtk_window_set_transient_for (window, PGtkWindow(DialogParent));
- Result := gtk_dialog_run(PGtkDialog(priv.dialog)) = GTK_RESPONSE_OK;
+ Result := gint(gtk_dialog_run(PGtkDialog(priv.dialog))) = gint(GTK_RESPONSE_OK);
if Result then begin
if (priv.username_entry <> nil) and (username <> nil) then username^ := g_strdup(gtk_entry_get_text(priv.username_entry));
if (priv.domain_entry <> nil) and (domain <> nil) then domain^ := g_strdup(gtk_entry_get_text(priv.domain_entry));
@@ -1531,7 +1395,7 @@ begin
if gtk_toggle_button_get_active(PGtkToggleButton(radio_remember)) then password_save^ := VFS_PASSWORD_SAVE_PERMANENTLY;
end;
end;
-
+}
gtk_widget_destroy (PGtkWidget(priv.dialog));
end;
@@ -1547,48 +1411,47 @@ begin
if not Assigned(List) or (List.Count = 0) then Exit;
dialog := gtk_dialog_new;
if DialogParent <> nil then gtk_window_set_transient_for(PGtkWindow(dialog), PGtkWindow(DialogParent));
- gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
- gtk_box_set_spacing(GTK_BOX(PGtkDialog(dialog)^.vbox), 14);
- gtk_window_set_resizable(GTK_WINDOW (dialog), False);
- gtk_dialog_set_has_separator(PGtkDialog(dialog), False);
- gtk_window_set_title(GTK_WINDOW(dialog), '');
- gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), True);
+ gtk_container_set_border_width(PGtkContainer(dialog), 5);
+ gtk_box_set_spacing(PGtkBox(gtk_dialog_get_content_area(PGtkDialog(dialog))), 14);
+ gtk_window_set_resizable(PGtkWindow (dialog), False);
+ gtk_window_set_title(PGtkWindow(dialog), '');
+ gtk_window_set_skip_taskbar_hint(PGtkWindow(dialog), True);
primary_label := gtk_label_new(nil);
gtk_label_set_markup(PGtkLabel(primary_label), PChar(Format('<span size="large" weight="ultrabold">%s</span>', ['Inaccessible folders and files'])));
secondary_label := gtk_label_new('Some files are not accessible and will be skipped. Press Cancel to abort the operation or Continue to ignore this warning.');
details_label := gtk_label_new(nil);
gtk_label_set_label(PGtkLabel(details_label), PChar(List.Text));
- image := gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.0);
- gtk_label_set_line_wrap(GTK_LABEL(primary_label), True);
- gtk_label_set_selectable(GTK_LABEL(primary_label), True);
- gtk_misc_set_alignment(GTK_MISC(primary_label), 0.0, 0.5);
- gtk_label_set_line_wrap(GTK_LABEL(secondary_label), True);
- gtk_label_set_selectable(GTK_LABEL(secondary_label), True);
- gtk_misc_set_alignment(GTK_MISC(secondary_label), 0.0, 0.5);
- gtk_label_set_line_wrap(GTK_LABEL(details_label), False);
- gtk_label_set_selectable(GTK_LABEL(details_label), True);
- gtk_misc_set_alignment(GTK_MISC(details_label), 0.0, 0.0);
+ image := gtk_image_new_from_icon_name('gtk-dialog-warning', GTK_ICON_SIZE_DIALOG);
+ gtk_widget_set_halign(image, GTK_ALIGN_CENTER);
+ gtk_label_set_line_wrap(PGtkLabel(primary_label), True);
+ gtk_label_set_selectable(PGtkLabel(primary_label), True);
+ gtk_label_set_yalign(PGtkLabel(primary_label), 0.5);
+ gtk_label_set_line_wrap(PGtkLabel(secondary_label), True);
+ gtk_label_set_selectable(PGtkLabel(secondary_label), True);
+ gtk_label_set_yalign(PGtkLabel(secondary_label), 0.5);
+ gtk_label_set_line_wrap(PGtkLabel(details_label), False);
+ gtk_label_set_selectable(PGtkLabel(details_label), True);
scrolled_window := gtk_scrolled_window_new(nil, nil);
gtk_scrolled_window_set_policy(PGtkScrolledWindow(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(scrolled_window), details_label);
- hbox := gtk_hbox_new (False, 12);
- gtk_container_set_border_width(GTK_CONTAINER(hbox), 5);
- gtk_box_pack_start(GTK_BOX(hbox), image, False, False, 0);
- vbox := gtk_vbox_new(False, 12);
- gtk_box_pack_start(GTK_BOX(hbox), vbox, False, False, 0);
- gtk_box_pack_start(GTK_BOX(vbox), primary_label, False, False, 0);
- gtk_box_pack_start(GTK_BOX(vbox), secondary_label, False, False, 0);
+ hbox := gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
+ gtk_container_set_border_width(PGtkContainer(hbox), 5);
+ gtk_box_pack_start(PGtkBox(hbox), image, False, False, 0);
+ vbox := gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
+ gtk_box_pack_start(PGtkBox(hbox), vbox, False, False, 0);
+ gtk_box_pack_start(PGtkBox(vbox), primary_label, False, False, 0);
+ gtk_box_pack_start(PGtkBox(vbox), secondary_label, False, False, 0);
expander := gtk_expander_new_with_mnemonic('Show more _details');
- gtk_expander_set_spacing(GTK_EXPANDER(expander), 6);
- gtk_container_add(GTK_CONTAINER(expander), scrolled_window);
- gtk_box_pack_start(GTK_BOX(vbox), expander, False, False, 0);
- gtk_box_pack_start(GTK_BOX(PGtkDialog(dialog)^.vbox), hbox, False, False, 0);
-
- gtk_dialog_add_button(PGtkDialog(dialog), GTK_STOCK_CANCEL, 0);
- gtk_dialog_add_button(PGtkDialog(dialog), 'C_ontinue', 1);
- gtk_dialog_set_default_response(PGtkDialog(dialog), 1);
+ // TODO
+// gtk_expander_set_spacing(PGtkExpander(expander), 6);
+ gtk_container_add(PGtkContainer(expander), scrolled_window);
+ gtk_box_pack_start(PGtkBox(vbox), expander, False, False, 0);
+ gtk_box_pack_start(PGtkBox(gtk_dialog_get_content_area(PGtkDialog(dialog))), hbox, False, False, 0);
+
+ gtk_dialog_add_button(PGtkDialog(dialog), GTK_STOCK_CANCEL, TGtkResponseType(0));
+ gtk_dialog_add_button(PGtkDialog(dialog), 'C_ontinue', TGtkResponseType(1));
+ gtk_dialog_set_default_response(PGtkDialog(dialog), TGtkResponseType(1));
gtk_widget_show_all(dialog);
Result := gtk_dialog_run(PGtkDialog(dialog));
@@ -1607,13 +1470,6 @@ end;
procedure LoadGnomeLibs;
begin
// Set default values
- gnome_about_new := nil;
- gnome_program_init := nil;
- libgnome_module_info_get := nil;
- libgnomeui_module_info_get := nil;
- gnome_color_picker_new := nil;
- gnome_color_picker_get_i16 := nil;
- gnome_color_picker_set_i16 := nil;
gnome_icon_entry_new := nil;
gnome_icon_entry_set_pixmap_subdir := nil;
gnome_icon_entry_get_filename := nil;
diff --git a/UMain.pas b/UMain.pas
index 69258e2..0c17c7f 100644
--- a/UMain.pas
+++ b/UMain.pas
@@ -22,14 +22,14 @@ unit UMain;
interface
uses
- gtk2, gdk2, gdk2pixbuf, lazglib2, lazgobject2, pango, StrUtils, SysUtils, Types, Classes, DateUtils,
+ StrUtils, SysUtils, Types, Classes, DateUtils,
+ lazglib2, lazgobject2, lazpango1, lazgdkpixbuf2, lazgdk3, lazgtk3,
GTKForms, GTKControls, GTKMenus, GTKStdCtrls, GTKExtCtrls, GTKView, GTKConsts, GTKUtils,
GTKClasses, GTKPixbuf, UEngines, UConfig, UGnome, UVFSCore, UCoreClasses;
type
TFMain = class(TGTKForm)
MainVBox : TGTKVBox;
- MainMenuHandleBox : TGTKHandleBox;
MainMenu : TGTKMenuBar;
LeftPanelBox, RightPanelBox : TGTKVBox;
PanelSeparator : TGTKHPaned;
@@ -43,7 +43,7 @@ type
LeftBookmarkButton, RightBookmarkButton : TGTKButton;
LeftEqualButton, RightEqualButton : TGTKButton;
LeftDiskInfoLabel, RightDiskInfoLabel : TGTKLabel;
- ButtonsBox : TGTKTable;
+ ButtonsBox : TGTKHBox;
F2Button, F3Button, F4Button, F5Button, F6Button, F7Button, F8Button : TGTKButton;
mnuFile, mnuMark, mnuCommands, mnuShow, mnuSettings, mnuHelp : TGTKMenuItem;
miExit : TGTKMenuItem;
@@ -62,7 +62,7 @@ type
LeftQuickFindEntry, RightQuickFindEntry: TGTKEntry;
LeftQuickFindSeparator, RightQuickFindSeparator, ButtonBoxSeparator: TGTKHSeparator;
CommandLineHBox: TGTKHBox;
- CommandLineCombo: TGTKCombo;
+ CommandLineCombo: TGTKComboBoxEntry;
CommandLineLabel: TGTKLabel;
SplitterPopupMenu: TGTKMenuItem;
FilePopupMenu: TGTKMenuItem;
@@ -71,11 +71,9 @@ type
miShowDirectorySizes, miTargetSource: TGTKMenuItem;
miCopyNames, miCopyFullPaths: TGTKMenuItem;
ButtonBoxSpace: TGTKEventBox;
- MounterBarHandleBox : TGTKHandleBox;
- MounterBarTable: TGTKTable;
+ MounterBarBox, LeftMounterBarBox, RightMounterBarBox: TGTKHBox;
MounterButtonPopupMenu, miMount, miUmount, miEject: TGTKMenuItem;
miMounterSettings, miNoMounterBar, miShowOneMounterBar, miShowTwoMounterBar: TGTKMenuItem;
- LeftMounterTable, RightMounterTable: TGTKTable;
miColumns: TGTKMenuItem;
mnuPlugins, miTestPlugin: TGTKMenuItem;
miSavePosition: TGTKMenuItem;
@@ -87,7 +85,7 @@ type
LeftDisconnectButton, RightDisconnectButton, LeftLeaveArchiveButton, RightLeaveArchiveButton: TGTKButton;
OpenTerminalButton: TGTKButton;
miNewTab: TGTKMenuItem;
- LeftPasswordButton, RightPasswordButton: TGTKImageButton;
+ LeftPasswordButton, RightPasswordButton: TGTKButton;
PathBoxPopupMenu: TGTKMenuItem;
miPathBoxRefresh, miPathBoxCopyPath: TGTKMenuItem;
miDiff, miSynchronizeDirs: TGTKMenuItem;
@@ -189,7 +187,7 @@ type
InplaceEditItem: TGTKListItem;
SavedCmdLine: string;
LastMounterButton: TGTKButton;
- MounterTableList, MounterTableListLeft, MounterTableListRight: TList;
+ MounterBarBoxList, MounterBarBoxListLeft, MounterBarBoxListRight: TList;
LeftNotebookBoxList, RightNotebookBoxList: TList;
LeftPathsHighlight, RightPathsHighlight: TStringList;
LeftTabEngines, RightTabEngines: TList;
@@ -242,7 +240,7 @@ type
function ExtractFromArchive(var NewPath: string; Engine: TPanelEngine; const FileToExtract: string; ExtractAll: boolean): boolean;
function HandleKey(Key: Word; Shift: TShiftState; LeftPanel: boolean): boolean;
function IsEditing(AListView: TGTKListView): boolean;
- function PanelFindEditableWidget(AListView: TGTKListView): PGtkWidget;
+ function PanelFindEditableWidget(AListView: TGTKListView): PGtkEditable;
function CheckForUnsavedConnection(Engine: TVFSEngine; AllowCancel: boolean): boolean; // Returns False to Cancel
procedure SaveCursorPositionTabbed(LeftPanel: boolean);
public
@@ -288,9 +286,9 @@ begin
LastUsedFilter := '*.*';
RedrawLeftInactive := False;
RedrawRightInactive := False;
- MounterTableList := TList.Create;
- MounterTableListLeft := TList.Create;
- MounterTableListRight := TList.Create;
+ MounterBarBoxList := TList.Create;
+ MounterBarBoxListLeft := TList.Create;
+ MounterBarBoxListRight := TList.Create;
LeftNotebookBoxList := TList.Create;
RightNotebookBoxList := TList.Create;
LeftPathsHighlight := TStringList.Create;
@@ -301,10 +299,8 @@ begin
WindowPosition := wpCenter;
MainVBox := TGTKVBox.Create(Self);
AddControl(MainVBox);
- MainMenuHandleBox := TGTKHandleBox.Create(Self);
- MainVBox.AddControlEx(MainMenuHandleBox, False, True, 0);
MainMenu := TGTKMenuBar.Create(Self);
- MainMenuHandleBox.AddControl(MainMenu);
+ MainVBox.AddControlEx(MainMenu, False, True, 0);
ConstructMenu;
InplaceEditTimer := TGTKTimer.Create(Self);
InplaceEditTimer.Enabled := False;
@@ -315,11 +311,8 @@ begin
RightMouseSelectPopupTimer := TGTKTimer.Create(Self);
RightMouseSelectPopupTimer.Enabled := False;
RightMouseSelectPopupTimer.OnTimer := @RightMouseSelectPopupTimerTimer;
- MounterBarHandleBox := TGTKHandleBox.Create(Self);
- MounterBarHandleBox.SetSizeRequest(10, -1);
- MainVBox.AddControlEx(MounterBarHandleBox, False, True, 0);
- MounterBarTable := TGTKTable.Create(Self);
- MounterBarHandleBox.AddControl(MounterBarTable);
+ MounterBarBox := TGTKHBox.Create(Self);
+ MainVBox.AddControlEx(MounterBarBox, False, True, 0);
LeftPanelBox := TGTKVBox.Create(Self);
RightPanelBox := TGTKVBox.Create(Self);
PanelSeparator := TGTKHPaned.Create(Self);
@@ -329,14 +322,12 @@ begin
ConstructPanels;
CommandLineHBox := TGTKHBox.Create(Self);
CommandLineHBox.Homogeneous := False;
- CommandLineCombo := TGTKCombo.Create(Self);
- CommandLineCombo.DisableActivate;
- CommandLineCombo.MatchValue := False;
- CommandLineCombo.CaseSensitive := True;
+ CommandLineCombo := TGTKComboBoxEntry.Create(Self);
// CommandLineCombo.Entry.OnKeyDown := CommandLineComboKeyDown;
CommandLineLabel := TGTKLabel.Create(Self);
CommandLineLabel.Alignment := taRightJustify;
- CommandLineLabel.SetAlignment(1, 0.5);
+ CommandLineLabel.XAlign := 1;
+ CommandLineLabel.YAlign := 0.5;
CommandLineLabel.SetSizeRequest(300, -1);
OpenTerminalButton := TGTKButton.Create(Self);
OpenTerminalButton.Caption := LANGOpenTerminalButton_Caption;
@@ -350,7 +341,7 @@ begin
CommandLineHBox.AddControlEx(OpenTerminalButton, False, False, 2);
MainVBox.AddControlEx(TGTKHSeparator.Create(Self), False, False, 2);
MainVBox.AddControlEx(CommandLineHBox, False, False, 0);
- ButtonsBox := TGTKTable.Create(Self);
+ ButtonsBox := TGTKHBox.Create(Self);
F2Button := TGTKButton.Create(Self);
F3Button := TGTKButton.Create(Self);
F4Button := TGTKButton.Create(Self);
@@ -358,19 +349,20 @@ begin
F6Button := TGTKButton.Create(Self);
F7Button := TGTKButton.Create(Self);
F8Button := TGTKButton.Create(Self);
- ButtonsBox.AddControlEx(0, 0, 1, 1, F2Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- ButtonsBox.AddControlEx(1, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4);
- ButtonsBox.AddControlEx(2, 0, 1, 1, F3Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- ButtonsBox.AddControlEx(3, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4);
- ButtonsBox.AddControlEx(4, 0, 1, 1, F4Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- ButtonsBox.AddControlEx(5, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4);
- ButtonsBox.AddControlEx(6, 0, 1, 1, F5Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- ButtonsBox.AddControlEx(7, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4);
- ButtonsBox.AddControlEx(8, 0, 1, 1, F6Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- ButtonsBox.AddControlEx(9, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4);
- ButtonsBox.AddControlEx(10, 0, 1, 1, F7Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- ButtonsBox.AddControlEx(11, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4);
- ButtonsBox.AddControlEx(12, 0, 1, 1, F8Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
+ ButtonsBox.AddControlEx(F2Button, True, True, 0);
+ // TODO: ypadding = 4
+ ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2);
+ ButtonsBox.AddControlEx(F3Button, True, True, 0);
+ ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2);
+ ButtonsBox.AddControlEx(F4Button, True, True, 0);
+ ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2);
+ ButtonsBox.AddControlEx(F5Button, True, True, 0);
+ ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2);
+ ButtonsBox.AddControlEx(F6Button, True, True, 0);
+ ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2);
+ ButtonsBox.AddControlEx(F7Button, True, True, 0);
+ ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2);
+ ButtonsBox.AddControlEx(F8Button, True, True, 0);
ButtonBoxSeparator := TGTKHSeparator.Create(Self);
ButtonBoxSpace := TGTKEventBox.Create(Self);
MainVBox.AddControlEx(ButtonBoxSpace, False, False, 2);
@@ -456,14 +448,14 @@ end;
procedure TFMain.ConstructPanels;
begin
- LeftMounterTable := TGTKTable.Create(Self);
- LeftMounterTable.SetSizeRequest(10, -1);
- RightMounterTable := TGTKTable.Create(Self);
- RightMounterTable.SetSizeRequest(10, -1);
- LeftMounterTable.BorderWidth := 2;
- RightMounterTable.BorderWidth := 2;
- LeftPanelBox.AddControlEx(LeftMounterTable, False, False, 0);
- RightPanelBox.AddControlEx(RightMounterTable, False, False, 0);
+ LeftMounterBarBox := TGTKHBox.Create(Self);
+ LeftMounterBarBox.SetSizeRequest(10, -1);
+ RightMounterBarBox := TGTKHBox.Create(Self);
+ RightMounterBarBox.SetSizeRequest(10, -1);
+ LeftMounterBarBox.BorderWidth := 2;
+ RightMounterBarBox.BorderWidth := 2;
+ LeftPanelBox.AddControlEx(LeftMounterBarBox, False, False, 0);
+ RightPanelBox.AddControlEx(RightMounterBarBox, False, False, 0);
LeftStatusBox := TGTKHBox.Create(Self);
RightStatusBox := TGTKHBox.Create(Self);
LeftStatusBox.Homogeneous := False;
@@ -480,8 +472,8 @@ begin
RightPathLabelHBox.Homogeneous := False;
LeftBookmarkButton := TGTKButton.Create(Self); LeftBookmarkButton.Caption := '❇';
RightBookmarkButton := TGTKButton.Create(Self); RightBookmarkButton.Caption := '❇';
- LeftPasswordButton := TGTKImageButton.Create(Self); LeftPasswordButton.Icon := StockLock16;
- RightPasswordButton := TGTKImageButton.Create(Self); RightPasswordButton.Icon := StockLock16;
+ LeftPasswordButton := TGTKButton.CreateFromIconName(Self, 'lock');
+ RightPasswordButton := TGTKButton.CreateFromIconName(Self, 'lock');
LeftPasswordButton.BorderStyle := bsNone;
RightPasswordButton.BorderStyle := bsNone;
LeftBookmarkButton.SetSizeRequest(22, 22); LeftBookmarkButton.Tooltip := LANGBookmarkButton_Tooltip + ' (Ctrl+D)';
@@ -575,7 +567,6 @@ begin
LeftPanelNotebook.ShowCloseButtons := True;
LeftPanelNotebook.AllowDragDrop := True;
LeftPanelNotebook.AllowDragOutside := True;
- LeftPanelNotebook.ShowTooltips := True;
LeftPanelNotebook.OnNotebookReordered := @NotebookReordered;
LeftPanelNotebook.OnTabClose := @NotebookTabClosed;
LeftPanelNotebook.OnTabDoubleClick := @NotebookTabDoubleClick;
@@ -591,7 +582,6 @@ begin
RightPanelNotebook.ShowCloseButtons := True;
RightPanelNotebook.AllowDragDrop := True;
RightPanelNotebook.AllowDragOutside := True;
- RightPanelNotebook.ShowTooltips := True;
RightPanelNotebook.OnNotebookReordered := @NotebookReordered;
RightPanelNotebook.OnTabClose := @NotebookTabClosed;
RightPanelNotebook.OnTabDoubleClick := @NotebookTabDoubleClick;
@@ -661,22 +651,30 @@ begin
ConstructColumns(LeftListView);
ConstructColumns(RightListView);
LeftPathLabel.XAlign := 0;
- LeftPathLabel.XPadding := 5;
- LeftPathLabel.YPadding := 1;
+ LeftPathLabel.MarginStart := 5;
+ LeftPathLabel.MarginEnd := 5;
+ LeftPathLabel.MarginTop := 1;
+ LeftPathLabel.MarginBottom := 1;
RightPathLabel.XAlign := 0;
- RightPathLabel.XPadding := 5;
- RightPathLabel.YPadding := 1;
+ RightPathLabel.MarginStart := 5;
+ RightPathLabel.MarginEnd := 5;
+ RightPathLabel.MarginTop := 1;
+ RightPathLabel.MarginBottom := 1;
LeftDiskInfoLabel.XAlign := 0;
- LeftDiskInfoLabel.XPadding := 5;
+ LeftDiskInfoLabel.MarginStart := 5;
+ LeftDiskInfoLabel.MarginEnd := 5;
LeftDiskInfoLabel.YAlign := 0.5;
RightDiskInfoLabel.XAlign := 0;
- RightDiskInfoLabel.XPadding := 5;
+ RightDiskInfoLabel.MarginStart := 5;
+ RightDiskInfoLabel.MarginEnd := 5;
RightDiskInfoLabel.YAlign := 0.5;
LeftStatusLine.XAlign := 0;
- LeftStatusLine.XPadding := 5;
+ LeftStatusLine.MarginStart := 5;
+ LeftStatusLine.MarginEnd := 5;
LeftStatusLine.YAlign := 0.5;
RightStatusLine.XAlign := 0;
- RightStatusLine.XPadding := 5;
+ RightStatusLine.MarginStart := 5;
+ RightStatusLine.MarginEnd := 5;
RightStatusLine.YAlign := 0.5;
{ LeftStatusBox.SetSizeRequest(1, 18);
RightStatusBox.SetSizeRequest(1, 18); }
@@ -697,10 +695,9 @@ begin
mnuFile := TGTKMenuItem.Create(Self);
mnuFile.Caption := LANGmnuFile_Caption;
MainMenu.Items.Add(mnuFile);
-// mnuFile.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miChangePermissions := TGTKMenuItem.CreateTyped(Self, itImageText);
miChangePermissions.Caption := LANGmiChangePermissions_Caption;
- miChangePermissions.StockIcon := 'gtk-convert';
+ miChangePermissions.IconName := 'gtk-convert';
miChangePermissions.OnClick := @miChangePermissionsClick;
mnuFile.Add(miChangePermissions);
miChangeOwner := TGTKMenuItem.Create(Self);
@@ -710,7 +707,7 @@ begin
mnuFile.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miCreateSymlink := TGTKMenuItem.CreateTyped(Self, itImageText);
miCreateSymlink.Caption := LANGmiCreateSymlink_Caption;
- miCreateSymlink.StockIcon := 'gtk-jump-to';
+ miCreateSymlink.IconName := 'gtk-jump-to';
miCreateSymlink.OnClick := @miCreateSymlinkClick;
mnuFile.Add(miCreateSymlink);
miEditSymlink := TGTKMenuItem.Create(Self);
@@ -747,48 +744,46 @@ begin
mnuFile.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miExit := TGTKMenuItem.CreateTyped(Self, itImageText);
miExit.Caption := LANGmiExit_Caption;
- miExit.StockIcon := 'gtk-quit';
+ miExit.IconName := 'gtk-quit';
miExit.OnClick := @miExitClick;
mnuFile.Add(miExit);
mnuMark := TGTKMenuItem.Create(Self);
mnuMark.Caption := LANGmnuMark_Caption;
MainMenu.Items.Add(mnuMark);
-// mnuMark.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miSelectGroup := TGTKMenuItem.CreateTyped(Self, itImageText);
miSelectGroup.Caption := LANGmiSelectGroup_Caption;
- miSelectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KP_PLUS, False, False, False, False));
- miSelectGroup.StockIcon := 'gtk-add';
+ miSelectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_plus, False, False, False, False));
+ miSelectGroup.IconName := 'gtk-add';
miSelectGroup.OnClick := @mnuMarkClick;
mnuMark.Add(miSelectGroup);
miUnselectGroup := TGTKMenuItem.CreateTyped(Self, itImageText);
miUnselectGroup.Caption := LANGmiUnselectGroup_Caption;
- miUnselectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KP_MINUS, False, False, False, False));
- miUnselectGroup.StockIcon := 'gtk-remove';
+ miUnselectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_minus, False, False, False, False));
+ miUnselectGroup.IconName := 'gtk-remove';
miUnselectGroup.OnClick := @mnuMarkClick;
mnuMark.Add(miUnselectGroup);
miSelectAll := TGTKMenuItem.Create(Self);
miSelectAll.Caption := LANGmiSelectAll_Caption;
- miSelectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KP_PLUS, False, False, False, True));
+ miSelectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_plus, False, False, False, True));
miSelectAll.OnClick := @mnuMarkClick;
mnuMark.Add(miSelectAll);
miUnselectAll := TGTKMenuItem.Create(Self);
miUnselectAll.Caption := LANGmiUnselectAll_Caption;
- miUnselectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KP_MINUS, False, False, False, True));
+ miUnselectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_minus, False, False, False, True));
miUnselectAll.OnClick := @mnuMarkClick;
mnuMark.Add(miUnselectAll);
miInvertSelection := TGTKMenuItem.Create(Self);
miInvertSelection.Caption := LANGmiInvertSelection_Caption;
- miInvertSelection.ShortCuts.Add(MakeGDKShortCut(GDK_KP_ASTERISK, False, False, False, False));
+ miInvertSelection.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_asterisk, False, False, False, False));
miInvertSelection.OnClick := @mnuMarkClick;
mnuMark.Add(miInvertSelection);
mnuCommands := TGTKMenuItem.Create(Self);
mnuCommands.Caption := LANGmnuCommands_Caption;
MainMenu.Items.Add(mnuCommands);
-// mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miSearch := TGTKMenuItem.CreateTyped(Self, itImageText);
- miSearch.StockIcon := 'gtk-find';
+ miSearch.IconName := 'gtk-find';
miSearch.Caption := LANGmiSearchCaption2;
miSearch.ShortCuts.AddName('<Alt>F7');
miSearch.OnClick := @miSearchClick;
@@ -796,7 +791,7 @@ begin
mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miRefresh := TGTKMenuItem.CreateTyped(Self, itImageText);
miRefresh.Caption := LANGmiRefresh_Caption;
- miRefresh.StockIcon := 'gtk-refresh';
+ miRefresh.IconName := 'gtk-refresh';
miRefresh.ShortCuts.AddName('<Control>R');
miRefresh.OnClick := @miRefreshClick;
mnuCommands.Add(miRefresh);
@@ -813,7 +808,7 @@ begin
miCopyFullPaths := TGTKMenuItem.CreateTyped(Self, itImageText);
miCopyFullPaths.Caption := LANGCopyFullPathNamesToClipboard;
miCopyFullPaths.ShortCuts.AddName('<Control>F2');
- miCopyFullPaths.StockIcon := 'gtk-copy';
+ miCopyFullPaths.IconName := 'gtk-copy';
miCopyFullPaths.OnClick := @miCopyNamesClick;
mnuCommands.Add(miCopyFullPaths);
mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
@@ -821,7 +816,7 @@ begin
miNewTab.Caption := LANGmiNewTab_Caption;
miNewTab.ShortCuts.AddName('<Control>T');
miNewTab.OnClick := @miDuplicateTabClick;
- miNewTab.StockIcon := 'gtk-index';
+ miNewTab.IconName := 'gtk-index';
mnuCommands.Add(miNewTab);
mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miTargetSource := TGTKMenuItem.CreateTyped(Self, itImageText);
@@ -833,7 +828,6 @@ begin
mnuShow := TGTKMenuItem.Create(Self);
mnuShow.Caption := LANGmnuShow_Caption;
MainMenu.Items.Add(mnuShow);
-// mnuShow.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miShowDotFiles := TGTKMenuItem.CreateTyped(Self, itCheck);
miShowDotFiles.Caption := LANGmiShowDotFiles_Caption;
miShowDotFiles.Checked := ConfShowDotFiles;
@@ -865,10 +859,9 @@ begin
mnuBookmarks.OnPopup := @mnuBookmarksPopup;
mnuBookmarks.OnClick := @mnuBookmarksPopup;
MainMenu.Items.Add(mnuBookmarks);
-// mnuBookmarks.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miAddBookmark := TGTKMenuItem.CreateTyped(Self, itImageText);
miAddBookmark.Caption := LANGmiAddBookmark_Caption;
- miAddBookmark.StockIcon := 'gtk-add';
+ miAddBookmark.IconName := 'gtk-add';
miAddBookmark.OnClick := @miAddBookmarkClick;
mnuBookmarks.Add(miAddBookmark);
miEditBookmarks := TGTKMenuItem.CreateTyped(Self, itImageText);
@@ -889,17 +882,16 @@ begin
mnuNetwork := TGTKMenuItem.Create(Self);
mnuNetwork.Caption := LANGmnuNetworkCaption;
MainMenu.Items.Add(mnuNetwork);
-// mnuNetwork.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miConnections := TGTKMenuItem.CreateTyped(Self, itImageText);
miConnections.Caption := LANGmiConnectionsCaption;
- miConnections.StockIcon := 'gtk-network';
+ miConnections.IconName := 'gtk-network';
miConnections.Enabled := False;
mnuNetwork.Add(miConnections);
mnuNetwork.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miOpenConnection := TGTKMenuItem.CreateTyped(Self, itImageText);
miOpenConnection.Caption := LANGmiOpenConnectionCaption;
miOpenConnection.OnClick := @miOpenConnectionClick;
- miOpenConnection.StockIcon := 'gtk-connect';
+ miOpenConnection.IconName := 'gtk-connect';
miOpenConnection.ShortCuts.AddName('<Control>F');
mnuNetwork.Add(miOpenConnection);
miQuickConnect := TGTKMenuItem.CreateTyped(Self, itImageText);
@@ -912,14 +904,13 @@ begin
miDisconnect.Caption := LANGmiDisconnect_Caption;
miDisconnect.Enabled := False;
miDisconnect.ShortCuts.AddName('<Shift><Control>F');
- miDisconnect.StockIcon := 'gtk-disconnect';
+ miDisconnect.IconName := 'gtk-disconnect';
miDisconnect.OnClick := @miDisconnectClick;
mnuNetwork.Add(miDisconnect);
mnuPlugins := TGTKMenuItem.Create(Self);
mnuPlugins.Caption := LANGmnuPluginsCaption;
MainMenu.Items.Add(mnuPlugins);
-// mnuPlugins.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miTestPlugin := TGTKMenuItem.CreateTyped(Self, itImageText);
miTestPlugin.Caption := LANGmiTestPluginCaption;
miTestPlugin.OnClick := @miTestPluginClick;
@@ -929,10 +920,9 @@ begin
mnuSettings := TGTKMenuItem.Create(Self);
mnuSettings.Caption := LANGmnuSettings_Caption;
MainMenu.Items.Add(mnuSettings);
-// mnuSettings.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miPreferences := TGTKMenuItem.CreateTyped(Self, itImageText);
miPreferences.Caption := LANGmiPreferences_Caption;
- miPreferences.StockIcon := 'gtk-preferences';
+ miPreferences.IconName := 'gtk-preferences';
miPreferences.OnClick := @miPreferencesClick;
mnuSettings.Add(miPreferences);
miFileTypes := TGTKMenuItem.CreateTyped(Self, itImageText);
@@ -956,16 +946,14 @@ begin
mnuHelp := TGTKMenuItem.Create(Self);
mnuHelp.Caption := LANGmnuHelp_Caption;
MainMenu.Items.Add(mnuHelp);
-// mnuHelp.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
miAbout := TGTKMenuItem.CreateTyped(Self, itImageText);
miAbout.Caption := LANGmiAbout_Caption;
- miAbout.StockIcon := 'gtk-about';
+ miAbout.IconName := 'gtk-about';
miAbout.OnClick := @miAboutClick;
mnuHelp.Add(miAbout);
// Splitter popup menu
SplitterPopupMenu := TGTKMenuItem.Create(Self);
-// SplitterPopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itTearOff));
for i := 2 to 8 do begin
Item := TGTKMenuItem.Create(Self);
Item.Caption := Format('%d - %d', [i * 10, (10 - i) * 10]);
@@ -983,17 +971,17 @@ begin
MounterButtonPopupMenu.OnPopup := @MounterButtonPopupMenuPopup;
miMount := TGTKMenuItem.CreateTyped(Self, itImageText);
miMount.Caption := LANGmiMountCaption;
- miMount.StockIcon := 'gtk-connect';
+ miMount.IconName := 'gtk-connect';
miMount.OnClick := @miMountClick;
MounterButtonPopupMenu.Add(miMount);
miUmount := TGTKMenuItem.CreateTyped(Self, itImageText);
miUmount.Caption := LANGmiUmountCaption;
- miUmount.StockIcon := 'gtk-disconnect';
+ miUmount.IconName := 'gtk-disconnect';
miUmount.OnClick := @miUmountClick;
MounterButtonPopupMenu.Add(miUmount);
miEject := TGTKMenuItem.CreateTyped(Self, itImageText);
miEject.Caption := LANGmiEjectCaption;
-// miEject.StockIcon := 'gtk-cdrom';
+// miEject.IconName := 'gtk-cdrom';
miEject.OnClick := @miEjectClick;
MounterButtonPopupMenu.Add(miEject);
@@ -1004,14 +992,14 @@ begin
miDuplicateTab.Caption := LANGmiDuplicateTabCaption;
miDuplicateTab.ShortCuts.AddName('<Control>T');
miDuplicateTab.OnClick := @miDuplicateTabClick;
- miDuplicateTab.StockIcon := 'gtk-index';
+ miDuplicateTab.IconName := 'gtk-index';
TabPopupMenu.Add(miDuplicateTab);
TabPopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miCloseTab := TGTKMenuItem.CreateTyped(Self, itImageText);
miCloseTab.Caption := LANGmiCloseTabCaption;
miCloseTab.ShortCuts.AddName('<Control>W');
miCloseTab.OnClick := @miCloseTabClick;
- miCloseTab.StockIcon := 'gtk-close';
+ miCloseTab.IconName := 'gtk-close';
TabPopupMenu.Add(miCloseTab);
miCloseAllTabs := TGTKMenuItem.CreateTyped(Self, itImageText);
miCloseAllTabs.Caption := LANGmiCloseAllTabsCaption;
@@ -1022,14 +1010,14 @@ begin
PathBoxPopupMenu := TGTKMenuItem.Create(Self);
miPathBoxRefresh := TGTKMenuItem.CreateTyped(Self, itImageText);
miPathBoxRefresh.Caption := LANGmiRefresh_Caption;
- miPathBoxRefresh.StockIcon := 'gtk-refresh';
+ miPathBoxRefresh.IconName := 'gtk-refresh';
miPathBoxRefresh.ShortCuts.AddName('<Control>R');
miPathBoxRefresh.OnClick := @miRefreshClick;
PathBoxPopupMenu.Add(miPathBoxRefresh);
PathBoxPopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
miPathBoxCopyPath := TGTKMenuItem.CreateTyped(Self, itImageText);
miPathBoxCopyPath.Caption := LANGCopyPathToClipboard;
- miPathBoxCopyPath.StockIcon := 'gtk-copy';
+ miPathBoxCopyPath.IconName := 'gtk-copy';
miPathBoxCopyPath.OnClick := @miPathBoxCopyPathClick;
PathBoxPopupMenu.Add(miPathBoxCopyPath);
end;
@@ -1126,10 +1114,13 @@ begin
end;
// Set the list font
+ // TODO
+{
if not ConfUseSystemFont then begin
FontDesc := pango_font_description_from_string(PChar(ConfPanelFont));
gtk_widget_modify_font(ListView.FWidget, FontDesc);
end else gtk_widget_modify_font(ListView.FWidget, nil);
+}
g_object_set(PGObject(ListView.FWidget), 'fixed_height_mode', [1, nil]);
end;
@@ -1274,15 +1265,16 @@ begin
// Apply the settings
ApplySettings(False, False, True);
- MounterBarHandleBox.Visible := ConfShowMounterBar = 1;
- LeftMounterTable.Visible := ConfShowMounterBar = 2;
- RightMounterTable.Visible := ConfShowMounterBar = 2;
+ MounterBarBox.Visible := ConfShowMounterBar = 1;
+ LeftMounterBarBox.Visible := ConfShowMounterBar = 2;
+ RightMounterBarBox.Visible := ConfShowMounterBar = 2;
FillMounterBar;
LeftListView.SetFocus;
if CommandLineHistory.Count > 0 then
for i := 0 to CommandLineHistory.Count - 1 do
- CommandLineCombo.Items.Append(CommandLineHistory[i]);
+ CommandLineCombo.AppendItem(CommandLineHistory[i]);
+ CommandLineCombo.ItemIndex := -1;
CommandLineCombo.Entry.Text := '';
RefreshBookmarksMenu;
@@ -1366,8 +1358,9 @@ var XLeft, XRight: gint;
begin
if Button = mbRight then begin
Accept := False;
- gtk_widget_get_pointer(LeftPanelBox.FWidget, @XLeft, nil);
- gtk_widget_get_pointer(RightPanelBox.FWidget, @XRight, nil);
+ // TODO
+// gtk_widget_get_pointer(LeftPanelBox.FWidget, @XLeft, nil);
+// gtk_widget_get_pointer(RightPanelBox.FWidget, @XRight, nil);
if (XLeft >= LeftPanelBox.Width) and (XRight < 0) then SplitterPopupMenu.PopUp;
end;
end;
@@ -1402,7 +1395,7 @@ begin
KeyHandled := False;
case Key of
- GDK_TAB, 65056 : if (ssCtrl in Shift) and ANotebook.Visible then begin
+ GDK_KEY_Tab, GDK_KEY_ISO_Left_Tab : if (ssCtrl in Shift) and ANotebook.Visible then begin
Accept := False;
KeyHandled := True;
x := (ANotebook.PageIndex + 1 - 2*Ord(ssShift in Shift)) mod ANotebook.ChildrenCount;
@@ -1417,9 +1410,9 @@ begin
if LeftPanel then RightListView.SetFocus
else LeftListView.SetFocus;
end;
- GDK_RETURN, GDK_KP_ENTER : begin
+ GDK_KEY_Return, GDK_KEY_KP_Enter : begin
KeyHandled := True;
- if {(Key = GDK_RETURN) and} (Shift = [ssAlt, ssShift]) then DoGetDirSize(True)
+ if {(Key = GDK_KEY_Return) and} (Shift = [ssAlt, ssShift]) then DoGetDirSize(True)
else
if ([ssAlt] = Shift) or ([ssCtrl] = Shift) then begin
CommandLineComboKeyDown(Sender, Key, Shift, Accept);
@@ -1430,7 +1423,7 @@ begin
if Length(Trim(CommandLineCombo.Entry.Text)) > 0 then CommandLineComboKeyDown(Sender, Key, Shift, Accept)
else if Assigned(AListView.Selected) then ActivateItem(AListView.Selected.Index);
end;
- GDK_BACKSPACE : begin
+ GDK_KEY_BackSpace : begin
KeyHandled := True;
if QuickFind then QuickFindSendKey(LeftPanel, Key)
else begin
@@ -1438,7 +1431,7 @@ begin
else PathButtonClick(RightUpButton);
end;
end;
- GDK_Right : begin
+ GDK_KEY_Right : begin
if [ssCtrl] = Shift then SwitchPanelCtrlLeftRight(LeftPanel, False) else
if ConfLynxLikeMotion then begin
if Assigned(AListView.Selected) then ActivateItem(AListView.Selected.Index);
@@ -1446,7 +1439,7 @@ begin
Accept := False;
KeyHandled := True;
end;
- GDK_Left : begin
+ GDK_KEY_Left : begin
if [ssCtrl] = Shift then SwitchPanelCtrlLeftRight(LeftPanel, True) else
if ConfLynxLikeMotion then
if LeftPanel then PathButtonClick(LeftUpButton)
@@ -1454,11 +1447,11 @@ begin
Accept := False;
KeyHandled := True;
end;
- GDK_INSERT : begin
+ GDK_KEY_Insert : begin
KeyHandled := True;
DoSelect(5);
end;
- GDK_SPACE : if not QuickFind then begin
+ GDK_KEY_space : if not QuickFind then begin
Accept := False;
KeyHandled := True;
if Length(CommandLineCombo.Entry.Text) > 0 then ActivateCommandLine(Key)
@@ -1467,14 +1460,14 @@ begin
DoSelect(8);
end;
end;
- GDK_F1 : begin
+ GDK_KEY_F1 : begin
KeyHandled := True;
if Shift = [ssAlt] then begin
ShowBookmarkQuick(True);
Accept := False;
end;
end;
- GDK_F2 : begin
+ GDK_KEY_F2 : begin
KeyHandled := True;
if Shift = [ssAlt] then begin
ShowBookmarkQuick(False);
@@ -1485,27 +1478,27 @@ begin
F6ButtonClick(nil);
end;
end;
- GDK_F3 : begin
+ GDK_KEY_F3 : begin
DeactivateQuickFind(LeftPanel);
Accept:= False;
KeyHandled := True;
F3F4ButtonClick(F3Button);
end;
- GDK_F4 : begin
+ GDK_KEY_F4 : begin
DeactivateQuickFind(LeftPanel);
Accept:= False;
KeyHandled := True;
if ssShift in Shift then EditViewFile(LeftPanel, AListView, False, True)
else F3F4ButtonClick(F4Button);
end;
- GDK_F5 : begin
+ GDK_KEY_F5 : begin
DeactivateQuickFind(LeftPanel);
Accept:= False;
KeyHandled := True;
if ssShift in Shift then F5ButtonClick(nil)
else F5ButtonClick(Sender);
end;
- GDK_F6 : begin
+ GDK_KEY_F6 : begin
DeactivateQuickFind(LeftPanel);
Accept:= False;
KeyHandled := True;
@@ -1514,31 +1507,31 @@ begin
DoQuickRename(LeftPanel, AListView, True);
end else F6ButtonClick(Sender);
end;
- GDK_F7 : begin
+ GDK_KEY_F7 : begin
DeactivateQuickFind(LeftPanel);
Accept:= False;
KeyHandled := True;
if ssAlt in Shift then miSearchClick(Sender)
else F7ButtonClick(Sender);
end;
- GDK_F8, GDK_Delete_Key : begin
+ GDK_KEY_F8, GDK_KEY_Delete : begin
DeactivateQuickFind(LeftPanel);
Accept:= False;
KeyHandled := True;
F8ButtonClick(Sender);
end;
- GDK_ESCAPE : begin
+ GDK_KEY_Escape : begin
if not QuickFind then CommandLineCombo.Entry.Text := '';
DeactivateQuickFind(LeftPanel);
KeyHandled := True;
if RunningEscSensitive > 0 then FMainEscPressed := True;
end;
- GDK_WIN_POPUP : begin
+{ GDK_WIN_POPUP : begin
Accept := False;
KeyHandled := True;
PopupFileMenuPos;
- end;
- GDK_HOME: begin
+ end; }
+ GDK_KEY_Home: begin
if Shift = [ssCtrl] then begin
if LeftPanel then PathButtonClick(LeftHomeButton)
else PathButtonClick(RightHomeButton);
@@ -1546,27 +1539,27 @@ begin
end else if Assigned(AListView.Selected) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0) then Accept := False;
KeyHandled := True;
end;
- GDK_END: begin
+ GDK_KEY_End: begin
if Assigned(AListView.Selected) and (AListView.ConvertToSorted(AListView.Selected.Index) = AListView.Items.Count - 1)
then Accept := False;
KeyHandled := True;
end;
- GDK_SLASH, GDK_KP_SLASH: begin
- if Shift = [ssCtrl] then begin
- if LeftPanel then PathButtonClick(LeftRootButton)
- else PathButtonClick(RightRootButton);
- Accept := False;
- end else
- if (Shift = []) then ActivateQuickFind(LeftPanel);
- KeyHandled := True;
- end;
+ GDK_KEY_slash: begin
+ if Shift = [ssCtrl] then begin
+ if LeftPanel then PathButtonClick(LeftRootButton)
+ else PathButtonClick(RightRootButton);
+ Accept := False;
+ end else
+ if (Shift = []) then ActivateQuickFind(LeftPanel);
+ KeyHandled := True;
+ end;
{ GDK_0..GDK_9: if ConfBookmarkQuickJump and (Shift = [ssAlt]) then QuickJumpToBookmark(LeftPanel, Key - GDK_1)
else begin
Accept := False;
if QuickFind then QuickFindSendKey(LeftPanel, Key)
else ActivateCommandLine(Key);
end; }
- GDK_Down : begin
+ GDK_KEY_Down : begin
KeyHandled := False;
if [ssCtrl] = Shift then begin
Accept := False;
@@ -1584,7 +1577,7 @@ begin
end;
end;
end;
- GDK_Up : begin
+ GDK_KEY_Up : begin
KeyHandled := False;
if QuickFind and (Shift = []) then begin
KeyHandled := QuickFindSendKey(LeftPanel, Key);
@@ -1595,42 +1588,42 @@ begin
if Assigned(AListView.Selected) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0) then Accept := False;
end;
end;
- GDK_Page_Up, GDK_Page_Down: begin
+ GDK_KEY_Page_Up, GDK_KEY_Page_Down: begin
KeyHandled := True;
if (Shift = [ssCtrl]) and ANotebook.Visible then begin
Accept := False;
- x := (ANotebook.PageIndex + 1 - 2*Ord(Key = GDK_Page_Up)) mod ANotebook.ChildrenCount;
+ x := (ANotebook.PageIndex + 1 - 2*Ord(Key = GDK_KEY_Page_Up)) mod ANotebook.ChildrenCount;
if x < 0 then x := ANotebook.ChildrenCount - 1;
ANotebook.PageIndex := x;
end else begin
if Assigned(AListView.Selected) and
- (((Key = GDK_Page_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0)) or
- ((Key = GDK_Page_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) = AListView.Items.Count - 1)))
+ (((Key = GDK_KEY_Page_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0)) or
+ ((Key = GDK_KEY_Page_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) = AListView.Items.Count - 1)))
then Accept := False;
end;
end;
- GDK_A, GDK_Capital_A: if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin
+ GDK_KEY_A: if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin
KeyHandled := True;
CommandLineComboKeyDown(Sender, Key, Shift, Accept);
end;
- GDK_D, GDK_Capital_D: if Shift = [ssCtrl] then begin
+ GDK_KEY_D: if Shift = [ssCtrl] then begin
Accept := False;
KeyHandled := True;
ShowBookmarkQuick(LeftPanel);
end;
- GDK_O, GDK_Capital_O : if (Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2) then begin
+ GDK_KEY_O : if (Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2) then begin
Accept := False;
KeyHandled := True;
SwitchOtherPanel(LeftPanel, False);
end;
- GDK_P, GDK_Capital_P, GDK_N, GDK_Capital_N:
+ GDK_KEY_P, GDK_KEY_N:
if (((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl])) { and (CommandLineHistory.Count > 0) } then begin
KeyHandled := True;
CommandLineComboKeyDown(Sender, Key, Shift, Accept);
end;
- GDK_S, GDK_Capital_S : if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin
+ GDK_KEY_S : if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin
KeyHandled := True;
ActivateQuickFind(LeftPanel);
end;
@@ -2205,19 +2198,23 @@ function TFMain.IsEditing(AListView: TGTKListView): boolean;
var i: integer;
begin
Result := False;
- for i := 0 to AListView.Columns.Count - 1 do
- if Assigned(AListView.Columns[i].FColumn^.editable_widget) then Result := True;
+ // TODO
+{ for i := 0 to AListView.Columns.Count - 1 do
+ if Assigned(AListView.Columns[i].FColumn^.editable_widget) then Result := True; }
end;
-function TFMain.PanelFindEditableWidget(AListView: TGTKListView): PGtkWidget;
+function TFMain.PanelFindEditableWidget(AListView: TGTKListView): PGtkEditable;
var i: integer;
begin
Result := nil;
+ // TODO
+{
for i := 0 to AListView.Columns.Count - 1 do
if Assigned(AListView.Columns[i].FColumn^.editable_widget) then begin
Result := AListView.Columns[i].FColumn^.editable_widget;
Break;
end;
+ }
end;
procedure TFMain.ProcessMarkKey(KeyType, Key: integer);
@@ -2244,11 +2241,11 @@ end;
procedure TFMain.mnuMarkClick(Sender: TObject);
begin
- if Sender = miSelectGroup then ProcessMarkKey(1, GDK_KP_PLUS) else
- if Sender = miUnselectGroup then ProcessMarkKey(2, GDK_KP_MINUS) else
+ if Sender = miSelectGroup then ProcessMarkKey(1, GDK_KEY_plus) else
+ if Sender = miUnselectGroup then ProcessMarkKey(2, GDK_KEY_minus) else
if Sender = miSelectAll then DoSelect(6) else
if Sender = miUnselectAll then DoSelect(7) else
- if Sender = miInvertSelection then ProcessMarkKey(4, GDK_KP_ASTERISK);
+ if Sender = miInvertSelection then ProcessMarkKey(4, GDK_KEY_asterisk);
end;
(********************************************************************************************************************************)
@@ -2259,13 +2256,15 @@ var s: PChar;
i, ColumnID, ColumnIdx: integer;
DataList: TList;
TreePath: PGtkTreePath;
- AFGColor, ABGColor: PGdkColor;
+ AFGColor, ABGColor: string;
+ ABGColorRGBA: TGdkRGBA;
{ Rect, VisibleRect: TGdkRectangle; }
begin
ColumnIdx := gtk_tree_view_column_get_sort_column_id(tree_column);
ColumnID := ColumnSortIDs[ColumnIdx + 1] - 1;
ImageCol := False;
- if ColumnIdx = 0 then ImageCol := GTK_IS_CELL_RENDERER_PIXBUF(cell);
+ // TODO
+ if ColumnIdx = 0 then ImageCol := Assigned(cell);
Data := nil;
if Sender = LeftListView then DataList := LeftPanelData
else DataList := RightPanelData;
@@ -2284,6 +2283,8 @@ begin
Sel := gtk_tree_selection_iter_is_selected((Sender as TGTKView).FSelection, iter);
with Data^ do begin
// ################ Prepare colors
+ // TODO
+{
if Selected then AFGColor := SelectedItemGDKColor else begin
if Sel then begin
if (Sender as TGTKView).Focused
@@ -2294,27 +2295,28 @@ begin
if not Sel then ABGColor := NormalItemGDKBackground else
if (Sender as TGTKView).Focused then ABGColor := ActiveItemGDKBackground
else ABGColor := InactiveItemGDKBackground;
-
-
-
+ // TODO - FG
+ gdk_rgba_parse(@ABGColorRGBA, PChar(ABGColor));
+}
// ################ Setting the properties
if not ImageCol then begin
- if Editing and (InplaceEditItem.Data = Data) and (ColumnID < 3) and ((ColumnID = 0) or (ColumnID = 1) or Assigned(tree_column^.editable_widget))
+ if Editing and (InplaceEditItem.Data = Data) and (ColumnID < 3) and ((ColumnID = 0) or (ColumnID = 1) { TODO or Assigned(tree_column^.editable_widget)})
then begin
if (ColumnID = 0) or (ColumnID = 1) then s := FDisplayName else s := nil;
- g_object_set(PGObject(cell), 'text', [s, 'foreground-gdk', AFGColor, nil]);
- g_object_set(PGObject(cell), 'background-gdk', [ABGColor, nil]);
+ // TODO
+ g_object_set(PGObject(cell), 'text', [s, 'foreground-gdk', PChar(AFGColor), nil]);
+ g_object_set(PGObject(cell), 'cell-background-rgba', [@ABGColorRGBA, nil]);
end
else begin // not editing
if ConfDirsInBold then begin
- if IsDir or UpDir then g_object_set(PGObject(cell), 'markup', [PChar(Format('<span weight="bold">%s</span>', [QuoteMarkupStr(ColumnData[ColumnID])])), 'foreground-gdk', AFGColor, nil])
- else g_object_set(PGObject(cell), 'markup', [PChar(QuoteMarkupStr(ColumnData[ColumnID])), 'foreground-gdk', AFGColor, nil]);
- end else g_object_set(PGObject(cell), 'text', [ColumnData[ColumnID], 'foreground-gdk', AFGColor, nil]);
- g_object_set(PGObject(cell), 'background-gdk', [ABGColor, nil]);
+ if IsDir or UpDir then g_object_set(PGObject(cell), 'markup', [PChar(Format('<span weight="bold">%s</span>', [QuoteMarkupStr(ColumnData[ColumnID])])), 'foreground-gdk', PChar(AFGColor), nil])
+ else g_object_set(PGObject(cell), 'markup', [PChar(QuoteMarkupStr(ColumnData[ColumnID])), 'foreground-gdk', PChar(AFGColor), nil]);
+ end else g_object_set(PGObject(cell), 'text', [ColumnData[ColumnID], 'foreground-gdk', PChar(AFGColor), nil]);
+ g_object_set(PGObject(cell), 'cell-background-rgba', [@ABGColorRGBA, nil]);
end;
end else // this is the image column
if ConfUseFileTypeIcons then begin // Assign icons
- g_object_set(PGObject(cell), 'cell-background-gdk', [ABGColor, nil]);
+ g_object_set(PGObject(cell), 'cell-background-rgba', [@ABGColorRGBA, nil]);
if Sel and (not (Sender as TGTKView).Focused) then begin
if Sender = LeftListView then RedrawLeftInactive := True
else RedrawRightInactive := True;
@@ -2831,14 +2833,16 @@ begin
if ColumnSortIDs[i] in [1, 2] then begin
ListView.Columns[i - 1].SetProperty('editable', 1);
ListView.StartEditing(i - 1);
- if ConfQuickRenameSkipExt and (ListView.Columns[i - 1].FColumn^.editable_widget <> nil) then begin
+ // TODO
+(*
+ if ConfQuickRenameSkipExt { TODO and (ListView.Columns[i - 1].FColumn^.editable_widget <> nil) } then begin
s := gtk_entry_get_text(PGtkEntry(ListView.Columns[i - 1].FColumn^.editable_widget));
if (s <> nil) and (g_utf8_strlen(s, -1) > 0) then begin
// DebugMsg(['TFMain.DoQuickRename: s = "', s, '", g_utf8_strlen(s) = ', g_utf8_strlen(s, -1)]);
if AnsiPos('.', s) > 0 then
gtk_editable_select_region(PGtkEditable(ListView.Columns[i - 1].FColumn^.editable_widget), 0, g_utf8_strlen(s, -1) - g_utf8_strlen(PChar(ExtractFileExt(s)), -1));
end;
- end;
+ end; *)
Break;
end;
end;
@@ -2978,8 +2982,8 @@ begin
DataList := RightPanelData;
end;
-// DebugMsg(['TFMain.QuickFindSendKey: Key = ', Key, ', GDK_Down = ', GDK_Down, ', GDK_Up = ', GDK_Up]);
- if Key = GDK_BACKSPACE then begin
+// DebugMsg(['TFMain.QuickFindSendKey: Key = ', Key, ', GDK_KEY_Down = ', GDK_KEY_Down, ', GDK_KEY_Up = ', GDK_KEY_Up]);
+ if Key = GDK_KEY_BackSpace then begin
if g_utf8_strlen(PChar(Entry.Text), -1) > 0 then begin
// DebugMsg(['TFMain.QuickFindSendKey: before delete: "', Entry.Text, '", ansi = "', UTF8ToStr(Entry.Text), '"']);
g := malloc(Length(Entry.Text));
@@ -2991,7 +2995,7 @@ begin
end;
NewText := Entry.Text;
end else
- if (Key = GDK_Down) or (Key = GDK_Up) then begin
+ if (Key = GDK_KEY_Down) or (Key = GDK_KEY_Up) then begin
if Length(Entry.Text) = 0 then begin
DeactivateQuickFind(LeftPanel);
Result := False;
@@ -3005,12 +3009,12 @@ begin
if (DataList.Count > 0) and (Length(NewText) > 0) then begin
NewIndex := -1;
- StartIndex := (AListView.ConvertToSorted(AListView.Selected.Index) + Ord(Key = GDK_Down) - Ord(Key = GDK_Up)) mod DataList.Count;
+ StartIndex := (AListView.ConvertToSorted(AListView.Selected.Index) + Ord(Key = GDK_KEY_Down) - Ord(Key = GDK_KEY_Up)) mod DataList.Count;
if StartIndex < 0 then StartIndex := 0;
if StartIndex > DataList.Count - 1 then StartIndex := DataList.Count - 1;
// DebugMsg(['TFMain.QuickFindSendKey: StartIndex = ', StartIndex]);
- if Key <> GDK_Up then begin
+ if Key <> GDK_KEY_Up then begin
// Search down
for i := StartIndex to DataList.Count - 1 do begin
Data := DataList[AListView.ConvertFromSorted(i)];
@@ -3625,7 +3629,7 @@ begin
try
InternalLock;
case Key of
- GDK_RETURN, GDK_KP_ENTER: begin
+ GDK_KEY_Return, GDK_KEY_KP_Enter: begin
Accept := False;
if LeftLastFocused then Engine := LeftPanelEngine
else Engine := RightPanelEngine;
@@ -3671,41 +3675,39 @@ begin
if Length(Orig) > 0 then begin
SaveItemToHistory(Orig, CommandLineHistory);
- if CommandLineCombo.Items.Count > 0 then
- for i := CommandLineCombo.Items.Count - 1 downto 0 do
- CommandLineCombo.Items.Delete(i);
+ CommandLineCombo.ClearItems();
if CommandLineHistory.Count > 0 then
for i := 0 to CommandLineHistory.Count - 1 do
- CommandLineCombo.Items.Append(CommandLineHistory[i]);
+ CommandLineCombo.AppendItem(CommandLineHistory[i]);
CommandLineCombo.Entry.Text := '';
end;
end;
- GDK_Down, GDK_Up:
+ GDK_KEY_Down, GDK_KEY_Up:
begin
Accept := False;
if LeftLastFocused then AListView := LeftListView
else AListView := RightListView;
- if (not (([ssCtrl] = Shift) and (Key = GDK_Up))) and (
- ((Key = GDK_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) < AListView.Items.Count - 1)) or
- ((Key = GDK_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) > 0))) then
+ if (not (([ssCtrl] = Shift) and (Key = GDK_KEY_Up))) and (
+ ((Key = GDK_KEY_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) < AListView.Items.Count - 1)) or
+ ((Key = GDK_KEY_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) > 0))) then
begin
- AListView.Selected := AListView.Items[AListView.ConvertFromSorted(AListView.ConvertToSorted(AListView.Selected.Index) + (Ord(Key = GDK_Down) * 2) - 1)];
+ AListView.Selected := AListView.Items[AListView.ConvertFromSorted(AListView.ConvertToSorted(AListView.Selected.Index) + (Ord(Key = GDK_KEY_Down) * 2) - 1)];
AListView.Selected.SetCursor(0, False, False, 0, 0);
end;
AListView.SetFocus;
end;
- GDK_ESCAPE: begin
+ GDK_KEY_Escape: begin
Accept := False;
CommandLineCombo.Entry.Text := '';
if LeftLastFocused then LeftListView.SetFocus
else RightListView.SetFocus;
end;
- GDK_TAB: begin
- Accept := False;
- if LeftLastFocused then RightListView.SetFocus
- else LeftListView.SetFocus;
- end;
- GDK_P, GDK_Capital_P: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then
+ GDK_KEY_Tab: begin
+ Accept := False;
+ if LeftLastFocused then RightListView.SetFocus
+ else LeftListView.SetFocus;
+ end;
+ GDK_KEY_P: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then
begin
Accept := False;
Orig := Trim(CommandLineCombo.Entry.Text);
@@ -3719,7 +3721,7 @@ begin
CommandLineCombo.Entry.SetFocus;
CommandLineCombo.Entry.SelectRegion(Length(CommandLineCombo.Entry.Text), Length(CommandLineCombo.Entry.Text));
end else if not CommandLineCombo.Entry.Focused then ActivateCommandLine(Key);
- GDK_N, GDK_Capital_N: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then
+ GDK_KEY_N: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then
begin
Accept := False;
Orig := Trim(CommandLineCombo.Entry.Text);
@@ -3734,7 +3736,7 @@ begin
CommandLineCombo.Entry.SetFocus;
CommandLineCombo.Entry.SelectRegion(Length(CommandLineCombo.Entry.Text), Length(CommandLineCombo.Entry.Text));
end else if not CommandLineCombo.Entry.Focused then ActivateCommandLine(Key);
- GDK_A, GDK_Capital_A: if (Shift = [ssAlt]) or (Shift = [ssCtrl]) then
+ GDK_KEY_A: if (Shift = [ssAlt]) or (Shift = [ssCtrl]) then
begin
Accept := False;
if LeftLastFocused then Engine := LeftPanelEngine
@@ -3784,7 +3786,7 @@ begin
end;
if CommandLineCombo.Entry.Focused then CommandLineComboKeyDown(Sender, Key, Shift, Accept);
- if Editing and (Key = GDK_ESCAPE) then begin
+ if Editing and (Key = GDK_KEY_Escape) then begin
Editing := False;
if LeftLastFocused then AListView := LeftListView
else AListView := RightListView;
@@ -3868,7 +3870,7 @@ begin
if Assigned(AListView.Selected) then AWorkingThread.SelectedItem := AListView.Selected.Data;
if not FChmod.RecursiveCheckButton.Checked
then AWorkingThread.ChmodRecurseType := -1
- else AWorkingThread.ChmodRecurseType := FChmod.RecursiveOptionMenu.ItemIndex;
+ else AWorkingThread.ChmodRecurseType := FChmod.RecursiveComboBox.ItemIndex;
AWorkingThread.ChmodMode := FChmod.LastMode;
AWorkingThread.AEngine := Engine;
AWorkingThread.DataList := DataList;
@@ -4097,7 +4099,7 @@ begin
if not DataItem^.IsDir then begin
Item := TGTKMenuItem.CreateTyped(Self, itImageText);
Item.Caption := Format(LANGPopupRunS, [QuoteMarkupStr(StrToUTF8(ShortFName), True)]);
- Item.StockIcon := 'gtk-execute';
+ Item.IconName := 'gtk-execute';
Item.Data := Pointer(1);
Item.OnClick := @FilePopupMenuItemClick;
Item.Enabled := Engine.FileCanRun(FileName);
@@ -4107,7 +4109,7 @@ begin
Item := TGTKMenuItem.CreateTyped(Self, itImageText);
if UpDir then Item.Caption := LANGPopupGoUp
else Item.Caption := Format(LANGPopupOpenS, [QuoteMarkupStr(StrToUTF8(ShortFName), True)]);
- Item.StockIcon := 'gtk-open';
+ Item.IconName := 'gtk-open';
Item.Data := Pointer(1);
Item.OnClick := @FilePopupMenuItemClick;
FilePopupMenu.Add(Item);
@@ -4170,7 +4172,7 @@ begin
FilePopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
Item := TGTKMenuItem.CreateTyped(Self, itImageText);
Item.Caption := LANGPopupViewFile;
- Item.StockIcon := 'gtk-find';
+ Item.IconName := 'gtk-find';
Item.Data := Pointer(200); // This number HAVE to be here due to F3F4ButtonClick method using
Item.OnClick := @F3F4ButtonClick;
FilePopupMenu.Add(Item);
@@ -4183,7 +4185,7 @@ begin
if not DataItem^.IsDir then FilePopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
Item := TGTKMenuItem.CreateTyped(Self, itImageText);
Item.Caption := LANGPopupMakeSymlink;
- Item.StockIcon := 'gtk-jump-to';
+ Item.IconName := 'gtk-jump-to';
Item.OnClick := @miCreateSymlinkClick;
FilePopupMenu.Add(Item);
if DataItem^.IsLnk then begin
@@ -4195,7 +4197,7 @@ begin
FilePopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator));
Item := TGTKMenuItem.CreateTyped(Self, itImageText);
Item.Caption := LANGmiChangePermissions_Caption;
- Item.StockIcon := 'gtk-convert';
+ Item.IconName := 'gtk-convert';
Item.OnClick := @miChangePermissionsClick;
Item.Enabled := not UpDir;
FilePopupMenu.Add(Item);
@@ -4212,7 +4214,7 @@ begin
FilePopupMenu.Add(Item);
Item := TGTKMenuItem.CreateTyped(Self, itImageText);
Item.Caption := LANGPopupDelete;
- Item.StockIcon := 'gtk-delete';
+ Item.IconName := 'gtk-delete';
Item.OnClick := @F8ButtonClick;
Item.Enabled := not UpDir;
FilePopupMenu.Add(Item);
@@ -4376,6 +4378,8 @@ begin
// Colors Section
SetupColors;
+ // TODO
+{
gtk_widget_modify_base(LeftListView.FWidget, GTK_STATE_NORMAL, NormalItemGDKBackground);
gtk_widget_modify_base(RightListView.FWidget, GTK_STATE_NORMAL, NormalItemGDKBackground);
gtk_widget_modify_base(LeftListView.FWidget, GTK_STATE_SELECTED, ActiveItemGDKBackground);
@@ -4389,18 +4393,16 @@ begin
gtk_widget_modify_text(RightListView.FWidget, GTK_STATE_SELECTED, ActiveItemGDKColor);
gtk_widget_modify_text(LeftListView.FWidget, GTK_STATE_ACTIVE, InactiveItemGDKColor);
gtk_widget_modify_text(RightListView.FWidget, GTK_STATE_ACTIVE, InactiveItemGDKColor);
-
+}
// Resize commandline history
if ConfNumHistoryItems < CommandLineHistory.Count then begin
try
for i := CommandLineHistory.Count downto ConfNumHistoryItems + 1 do
CommandLineHistory.Delete(i - 1);
- if CommandLineCombo.Items.Count > 0 then
- for i := CommandLineCombo.Items.Count - 1 downto 0 do
- CommandLineCombo.Items.Delete(i);
+ CommandLineCombo.ClearItems();
if CommandLineHistory.Count > 0 then
for i := 0 to CommandLineHistory.Count - 1 do
- CommandLineCombo.Items.Append(CommandLineHistory[i]);
+ CommandLineCombo.AppendItem(CommandLineHistory[i]);
except end;
CommandLineCombo.Entry.Text := '';
end;
@@ -4510,14 +4512,19 @@ end;
function form_event_handler(widget: PGtkWidget; event: PGdkEvent; user_data: gpointer): gboolean; cdecl;
begin
Result := False;
- if event^._type = GDK_FOCUS_CHANGE then
- if event^.focus_change._in = 1 then FMain.HandleFormFocusIn
+ if event^.type_ = GDK_FOCUS_CHANGE then
+ if event^.focus_change.in_ = 1 then FMain.HandleFormFocusIn
else FileListTipsHide;
end;
procedure TFMain.HandleFormFocusIn;
var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, ChangedMounter, ChangedConnMgr, APerformRefresh: boolean;
begin
+ ChangedMainGUI := False;
+ ChangedAssoc := False;
+ ChangedBookmarks := False;
+ ChangedMounter := False;
+ ChangedConnMgr := False;
try
if (csDestroying in ComponentState) or (not Assigned(FMain)) then Exit;
if ApplicationShuttingDown then begin
@@ -4586,15 +4593,17 @@ end;
procedure menu_position_cb(menu: PGtkMenu; x, y: Pgint; push_in: pgboolean; user_data: gpointer); cdecl;
var menu_requisition: TGtkRequisition;
+ allocation: TGtkAllocation;
max_x, max_y: integer;
begin
(* Calculate our preferred position. *)
gdk_window_get_origin(PGtkWidget(user_data)^.Window, x, y);
- x^ := x^ + PGtkWidget(user_data)^.allocation.x + PGtkWidget(user_data)^.allocation.width;
- y^ := y^ + PGtkWidget(user_data)^.allocation.y + PGtkWidget(user_data)^.allocation.height;
+ gtk_widget_get_allocation(PGtkWidget(user_data), @allocation);
+ x^ := x^ + allocation.x + allocation.width;
+ y^ := y^ + allocation.y + allocation.height;
(* Now make sure we are on the screen. *)
- gtk_widget_size_request(PGtkWidget(menu), @menu_requisition);
+ gtk_widget_get_preferred_size(PGtkWidget(menu), @menu_requisition, nil);
max_x := Max(0, gdk_screen_width () - menu_requisition.width);
max_y := Max(0, gdk_screen_height () - menu_requisition.height);
x^ := x^ - menu_requisition.width;
@@ -4631,7 +4640,7 @@ begin
gdk_window_get_origin(gtk_tree_view_get_bin_window(TreeView), x, y);
y^ := y^ + Rect.y + Rect.height;
- gtk_widget_size_request(PGtkWidget(menu), @menu_requisition);
+ gtk_widget_get_preferred_size(PGtkWidget(menu), @menu_requisition, nil);
if y^ > gdk_screen_height - menu_requisition.height then begin
gdk_window_get_origin(gtk_tree_view_get_bin_window(TreeView), x, y);
y^ := y^ + Rect.y - menu_requisition.height;
@@ -4676,6 +4685,7 @@ var AListView: TGTKListView;
s: string;
DontShowAgain: boolean;
begin
+ DontShowAgain := False;
if LeftPanel then begin
AListView := LeftListView;
SrcEngine := LeftPanelEngine;
@@ -4728,7 +4738,7 @@ end;
(********************************************************************************************************************************)
procedure TFMain.FillMounterBar;
- procedure ClearButtons(List: TList; Table: TGTKTable);
+ procedure ClearButtons(List: TList; Table: TGTKHBox);
var i: integer;
begin
if List.Count > 0 then
@@ -4737,7 +4747,7 @@ procedure TFMain.FillMounterBar;
List.Clear;
end;
- procedure FillTableButtons(List: TList; Table: TGTKTable);
+ procedure FillTableButtons(List: TList; Box: TGTKHBox);
var i: integer;
Button: TGTKButton;
Pixmap: TGDKPixbuf;
@@ -4748,14 +4758,14 @@ procedure TFMain.FillMounterBar;
for i := 0 to MounterList.Count - 1 do
with TMounterItem(MounterList[i]) do begin
if ConfMounterPushDown then begin
- Button := TGTKImageToggleButton.Create(Self);
- if Length(DisplayText) > 0 then (Button as TGTKImageToggleButton).Caption := DisplayText else
- (Button as TGTKImageToggleButton).Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1,
- Length(ExcludeTrailingPathDelimiter(MountPath)) - LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)));
+ Button := TGTKToggleButton.Create(Self);
+ if Length(DisplayText) > 0 then (Button as TGTKToggleButton).Caption := DisplayText else
+ (Button as TGTKToggleButton).Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1,
+ Length(ExcludeTrailingPathDelimiter(MountPath)) - LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)));
end else begin
- Button := TGTKImageButton.Create(Self);
- if Length(DisplayText) > 0 then (Button as TGTKImageButton).Caption := DisplayText else
- (Button as TGTKImageButton).Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1,
+ Button := TGTKButton.Create(Self);
+ if Length(DisplayText) > 0 then (Button as TGTKButton).Caption := DisplayText else
+ Button.Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1,
Length(ExcludeTrailingPathDelimiter(MountPath)) - LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)));
end;
Button.CanFocus := False;
@@ -4788,44 +4798,51 @@ procedure TFMain.FillMounterBar;
3 : Pixmap := MounterFloppy;
4 : Pixmap := MounterNetwork;
end;
+ // TODO
if ConfMounterPushDown then begin
- (Button as TGTKImageToggleButton).Icon := Pixmap;
- (Button as TGTKImageToggleButton).Checked := Mounted;
- end else (Button as TGTKImageButton).Icon := Pixmap;
+// (Button as TGTKToggleButton).Icon := Pixmap;
+ (Button as TGTKToggleButton).Checked := Mounted;
+ end; // TODO else Button.Icon := Pixmap;
Button.OnClick := @MounterButtonClick; // It has to be here because setting the Checked property causes the signal emitting
+ Button.MarginTop := 1;
+ Button.MarginBottom := 1;
- Table.AddControlEx(2*i + 1, 0, 1, 1, Button, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 1);
+ Box.AddControlEx(Button, False, True, 0);
List.Add(Button);
if i < MounterList.Count - 1 then begin
Sep := TGTKVSeparator.Create(Self);
- Table.AddControlEx(2*(i + 1), 0, 1, 1, Sep, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 6);
+ Sep.MarginTop := 6;
+ Sep.MarginBottom := 6;
+ Box.AddControlEx(Sep, False, True, 2);
List.Add(Sep);
end;
end;
end;
-
+
var Lab: TGTKLabel;
begin
if ConfMounterUseFSTab then FillDefaultFstabMounterItems;
// Clean all items
- ClearButtons(MounterTableList, MounterBarTable);
- ClearButtons(MounterTableListLeft, LeftMounterTable);
- ClearButtons(MounterTableListRight, RightMounterTable);
+ ClearButtons(MounterBarBoxList, MounterBarBox);
+ ClearButtons(MounterBarBoxListLeft, LeftMounterBarBox);
+ ClearButtons(MounterBarBoxListRight, RightMounterBarBox);
// Fill the new items
Lab := TGTKLabel.Create(Self);
Lab.Caption := Format('<span weight="bold">%s</span>', [LANGMountSC]);
Lab.UseMarkup := True;
- MounterTableList.Add(Lab);
- MounterBarTable.AddControlEx(0, 0, 1, 1, Lab, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 1);
+ Lab.MarginTop := 1;
+ Lab.MarginBottom := 1;
+ MounterBarBoxList.Add(Lab);
+ MounterBarBox.AddControlEx(Lab, False, True, 5);
case ConfShowMounterBar of
- 1: FillTableButtons(MounterTableList, MounterBarTable);
+ 1: FillTableButtons(MounterBarBoxList, MounterBarBox);
2: begin
- FillTableButtons(MounterTableListLeft, LeftMounterTable);
- FillTableButtons(MounterTableListRight, RightMounterTable);
+ FillTableButtons(MounterBarBoxListLeft, LeftMounterBarBox);
+ FillTableButtons(MounterBarBoxListRight, RightMounterBarBox);
end;
end;
end;
@@ -4839,8 +4856,8 @@ begin
try
Item := TMounterItem((Sender as TGTKButton).Tag);
if (not Assigned(Item)) or (Item.MountPath = '') then DebugMsg(['*** Error in mounter button: incorrect data']) else begin
- if MounterTableListLeft.IndexOf(Sender) > -1 then LeftPanel := True else
- if MounterTableListRight.IndexOf(Sender) > -1 then LeftPanel := False else LeftPanel := LeftLastFocused;
+ if MounterBarBoxListLeft.IndexOf(Sender) > -1 then LeftPanel := True else
+ if MounterBarBoxListRight.IndexOf(Sender) > -1 then LeftPanel := False else LeftPanel := LeftLastFocused;
if LeftPanel then Engine := LeftPanelEngine
else Engine := RightPanelEngine;
try
@@ -4976,9 +4993,9 @@ procedure TFMain.miShowMounterBarClick(Sender: TObject);
begin
if miShowOneMounterBar.Checked then ConfShowMounterBar := 1 else
if miShowTwoMounterBar.Checked then ConfShowMounterBar := 2 else ConfShowMounterBar := 0;
- MounterBarHandleBox.Visible := ConfShowMounterBar = 1;
- LeftMounterTable.Visible := ConfShowMounterBar = 2;
- RightMounterTable.Visible := ConfShowMounterBar = 2;
+ MounterBarBox.Visible := ConfShowMounterBar = 1;
+ LeftMounterBarBox.Visible := ConfShowMounterBar = 2;
+ RightMounterBarBox.Visible := ConfShowMounterBar = 2;
FillMounterBar;
end;
@@ -5112,7 +5129,7 @@ begin
InternalLock;
FTestPlugin := TFTestPlugin.Create(Self);
if (FTestPlugin.Run = mbOK) and (PluginList.Count > 0) then begin
- Engine := TVFSEngine.Create(TVFSPlugin(PluginList[FTestPlugin.PluginOptionMenu.ItemIndex]));
+ Engine := TVFSEngine.Create(LookupVFSPlugin(FTestPlugin.PluginComboBox.ItemID));
if not Engine.VFSOpenURI(FTestPlugin.CommandEntry.Text, nil, nil, nil, nil, nil) then begin
Application.MessageBox(LANGCouldntOpenURI, [mbOK], mbError, mbOK, mbOK);
Exit;
@@ -5140,14 +5157,13 @@ var AboutBox: PGtkWidget;
begin
VFSItem := TVFSPlugin(PluginList[(Sender as TGTKMenuItem).Tag]);
InternalLock;
- if (libGnomeUI2Handle = nil) or (gnome_about_new = nil) then
- Application.MessageBox(Format(LANGPluginAboutInside, [VFSItem.ModuleName, VFSItem.ModuleAbout, VFSItem.ModuleCopyright]))
- else begin
+ // TODO
+ Application.MessageBox(Format(LANGPluginAboutInside, [VFSItem.ModuleName, VFSItem.ModuleAbout, VFSItem.ModuleCopyright]));
+{ else begin
AboutBox := gnome_about_new(PChar(VFSItem.ModuleName), nil, PChar(VFSItem.ModuleCopyright), PChar(VFSItem.ModuleAbout), @Authors, nil, nil, AppIcon64.FPixbuf);
- gtk_window_set_transient_for(GTK_WINDOW(AboutBox), GTK_WINDOW(FMain.FWidget));
- gtk_dialog_run(GTK_DIALOG(AboutBox));
- end;
- Application.ProcessMessages;
+ gtk_window_set_transient_for(PGtkWindow(AboutBox), PGtkWindow(FMain.FWidget));
+ gtk_dialog_run(PGtkDialog(AboutBox));
+ end; }
InternalLockInit(False);
end;
@@ -5244,6 +5260,7 @@ var AEngine: TPanelEngine;
DontShowAgain: boolean;
NewTabPosition: integer;
begin
+ DontShowAgain := False;
if LeftPanel then begin
AEngine := LeftPanelEngine;
ATabList := LeftPanelTabs;
@@ -5617,29 +5634,39 @@ end;
function TFMain.NotebookFindNotebookAtPointerEvent(Sender: TObject; const AbsX, AbsY: integer): TEphyNotebook;
var wx, wy: Integer;
+ allocation: TGtkAllocation;
begin
// DebugMsg([' *** NotebookFindNotebookAtPointerEvent(AbsX = ', AbsX, ', AbsY = ', AbsY, ')']);
Result := nil;
+ // TODO
if LeftPanelNotebook.Visible then begin
- gtk_widget_get_pointer(LeftPanelNotebook.FWidget, @wx, @wy);
- if (wx > 0) and (wy > 0) and (wx < LeftPanelNotebook.FWidget^.allocation.width) and
- (wy < LeftPanelNotebook.FWidget^.allocation.height) then Result := LeftPanelNotebook;
+ gdk_window_get_device_position(gtk_widget_get_window(LeftPanelNotebook.FWidget), nil, @wx, @wy, nil);
+// gtk_widget_get_pointer(LeftPanelNotebook.FWidget, @wx, @wy);
+ gtk_widget_get_allocation(LeftPanelNotebook.FWidget, @allocation);
+ if (wx > 0) and (wy > 0) and (wx < allocation.width) and
+ (wy < allocation.height) then Result := LeftPanelNotebook;
end else begin
- gtk_widget_get_pointer(LeftScrolledWindow.FWidget, @wx, @wy);
- if (wx > 0) and (wy > 0) and (wx < LeftScrolledWindow.FWidget^.allocation.width) and
- (wy < LeftScrolledWindow.FWidget^.allocation.height) then Result := LeftPanelNotebook;
+ gdk_window_get_device_position(gtk_widget_get_window(LeftScrolledWindow.FWidget), nil, @wx, @wy, nil);
+// gtk_widget_get_pointer(LeftScrolledWindow.FWidget, @wx, @wy);
+ gtk_widget_get_allocation(LeftScrolledWindow.FWidget, @allocation);
+ if (wx > 0) and (wy > 0) and (wx < allocation.width) and
+ (wy < allocation.height) then Result := LeftPanelNotebook;
end;
if Result = nil then begin
if RightPanelNotebook.Visible then begin
- gtk_widget_get_pointer(RightPanelNotebook.FWidget, @wx, @wy);
- if (wx > 0) and (wy > 0) and (wx < RightPanelNotebook.FWidget^.allocation.width) and
- (wy < RightPanelNotebook.FWidget^.allocation.height) then Result := RightPanelNotebook;
+ gdk_window_get_device_position(gtk_widget_get_window(RightPanelNotebook.FWidget), nil, @wx, @wy, nil);
+// gtk_widget_get_pointer(RightPanelNotebook.FWidget, @wx, @wy);
+ gtk_widget_get_allocation(RightPanelNotebook.FWidget, @allocation);
+ if (wx > 0) and (wy > 0) and (wx < allocation.width) and
+ (wy < allocation.height) then Result := RightPanelNotebook;
end else begin
- gtk_widget_get_pointer(RightScrolledWindow.FWidget, @wx, @wy);
- if (wx > 0) and (wy > 0) and (wx < RightScrolledWindow.FWidget^.allocation.width) and
- (wy < RightScrolledWindow.FWidget^.allocation.height) then Result := RightPanelNotebook;
+ gdk_window_get_device_position(gtk_widget_get_window(RightScrolledWindow.FWidget), nil, @wx, @wy, nil);
+// gtk_widget_get_pointer(RightScrolledWindow.FWidget, @wx, @wy);
+ gtk_widget_get_allocation(RightScrolledWindow.FWidget, @allocation);
+ if (wx > 0) and (wy > 0) and (wx < allocation.width) and
+ (wy < allocation.height) then Result := RightPanelNotebook;
end;
end;
@@ -5832,10 +5859,8 @@ begin
AFConnectionProperties := TFConnectionProperties.Create(Self);
try
AFConnectionProperties.URIEntry.Text := URI;
- if (Engine.CustomPluginIDSave <> '') and (AFConnectionProperties.PluginOptionMenu.Items.Count > 0) then
- for i := 0 to PluginList.Count - 1 do
- if TVFSPlugin(PluginList[i]).ModuleID = Engine.CustomPluginIDSave
- then AFConnectionProperties.PluginOptionMenu.ItemIndex := i + 1;
+ if (Engine.CustomPluginIDSave <> '') and (PluginList.Count > 0) then
+ AFConnectionProperties.PluginComboBox.ItemID := Engine.CustomPluginIDSave;
if AFConnectionProperties.Run = mbOK then begin
ReadConnections;
ConnMgrItem := TConnMgrItem.Create;
@@ -5845,9 +5870,7 @@ begin
ConnMgrItem.Username := AFConnectionProperties.UserNameEntry.Text;
ConnMgrItem.Password := AFConnectionProperties.PasswordEntry.Text;
ConnMgrItem.TargetDir := AFConnectionProperties.TargetDirEntry.Text;
- ConnMgrItem.PluginID := '';
- if AFConnectionProperties.PluginOptionMenu.ItemIndex <> 0 then
- ConnMgrItem.PluginID := TVFSPlugin(PluginList[AFConnectionProperties.PluginOptionMenu.ItemIndex - 1]).ModuleID;
+ ConnMgrItem.PluginID := AFConnectionProperties.PluginComboBox.ItemID;
ConfConnMgrActiveItem := ConnectionMgrList.Add(ConnMgrItem);
WriteConnections;
end;
diff --git a/UMounterPrefs.pas b/UMounterPrefs.pas
index 7194370..fa81abe 100644
--- a/UMounterPrefs.pas
+++ b/UMounterPrefs.pas
@@ -22,9 +22,9 @@ unit UMounterPrefs;
interface
uses
- lazglib2, lazgobject2, gdk2, gtk2, SysUtils, Classes, Variants, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls,
- GTKView, GTKDialogs, GTKPixbuf, GTKMenus,
- UCoreClasses, UGnome;
+ SysUtils, Classes, lazglib2, lazgobject2, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls,
+ GTKView, GTKDialogs, GTKPixbuf,
+ UGnome;
type
TFMounterPrefs = class(TGTKDialog)
@@ -36,16 +36,15 @@ type
ListView: TGTKListView;
ListViewScrolledWindow: TGTKScrolledWindow;
ListViewFrame, PropertiesFrame: TGTKFrame;
- MounterListTable, PropertiesTable: TGTKTable;
+ MounterListGrid, PropertiesGrid: TGTKGrid;
AddItemButton, RemoveItemButton: TGTKButton;
- MoveUpButton, MoveDownButton: TGTKImageButton;
+ MoveUpButton, MoveDownButton: TGTKButton;
HBox1: TGTKHBox;
DisplayTextLabel, MountPointLabel, MountDeviceLabel, MountCommandLabel, UmountCommandLabel, IconLabel, DeviceTypeLabel: TGTKLabel;
DisplayTextEntry, MountPointEntry, MountDeviceEntry, MountCommandEntry, UmountCommandEntry: TGTKEntry;
IconEntry: TGnomeIconEntry;
IconEntry2: TGTKButton;
- DeviceTypeOptionMenu: TGTKOptionMenu;
- miLocalDisk, miRemovable, miCD, miFloppy, miNetwork: TGTKMenuItem;
+ DeviceTypeComboBox: TGTKComboBoxText;
UseFSTabDefaultsCheckBox: TGTKCheckButton;
ToggleModeCheckBox: TGTKCheckButton;
procedure FormCreate(Sender: TObject); override;
@@ -60,7 +59,7 @@ type
procedure MountDeviceEntryChanged(Sender: TObject);
procedure MountCommandEntryChanged(Sender: TObject);
procedure UmountCommandEntryChanged(Sender: TObject);
- procedure DeviceTypeOptionMenuChanged(Sender: TObject);
+ procedure DeviceTypeComboBoxChanged(Sender: TObject);
procedure IconEntryChanged(Sender: TObject);
procedure IconEntry2Click(Sender: TObject);
private
@@ -83,27 +82,28 @@ uses ULocale, UFileAssoc, UCoreUtils, UConfig, UCore;
function TGTKListView_drag_end(widget: PGtkWidget; drag_context: PGdkDragContext; user_data: gpointer): gboolean; cdecl; forward;
procedure TFMounterPrefs.FormCreate(Sender: TObject);
-const row_targets: TGtkTargetEntry = (target:'GTK_TREE_MODEL_ROW'; flags:GTK_TARGET_SAME_APP; info:100);
+const row_targets: TGtkTargetEntry = (target:'GTK_TREE_MODEL_ROW'; flags:guint(GTK_TARGET_SAME_APP); info:100);
var Column: TGTKTreeViewColumn;
+ VBox: TGTKVBox;
begin
- FUseGnomeIconEntry := Assigned(gnome_icon_entry_new) and Assigned(gnome_icon_entry_get_filename) and Assigned(gnome_icon_entry_set_filename);
-// FUseGnomeIconEntry := False;
+ FUseGnomeIconEntry := False;
SetDefaultSize(500, 520);
Caption := LANGMounterPrefs_Caption;
Buttons := [mbOK, mbCancel];
- ShowSeparator := False;
TitleEventBox := TGTKEventBox.Create(Self);
TitleLabel := TGTKLabel.Create(Self);
TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [LANGMounterPrefs_TitleLabelCaption]);
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-cdrom', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-cdrom', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
@@ -117,14 +117,14 @@ begin
ListViewFrame.Caption := LANGMounterPrefs_ListViewFrameCaption;
ListViewFrame.BorderWidth := 7;
ClientArea.AddControlEx(ListViewFrame, True, True, 0);
- MounterListTable := TGTKTable.Create(Self);
- ListViewFrame.AddControl(MounterListTable);
- MounterListTable.BorderWidth := 7;
+ MounterListGrid := TGTKGrid.Create(Self);
+ ListViewFrame.AddControl(MounterListGrid);
+ MounterListGrid.BorderWidth := 7;
ListView := TGTKListView.CreateTyped(Self, False, [lcText, lcText, lcText, lcPointer, lcPixbuf]);
g_signal_connect_data(PGObject(ListView.FWidget), 'drag-end', TGCallback(@TGTKListView_drag_end), nil, nil, G_CONNECT_DEFAULT);
- gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(ListView.FWidget), GDK_BUTTON1_MASK, @row_targets, 1, GDK_ACTION_MOVE or GDK_ACTION_COPY);
- gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(ListView.FWidget), @row_targets, 1, GDK_ACTION_MOVE or GDK_ACTION_COPY);
+ gtk_tree_view_enable_model_drag_source(PGtkTreeView(ListView.FWidget), [GDK_BUTTON1_MASK], @row_targets, 1, [GDK_ACTION_MOVE, GDK_ACTION_COPY]);
+ gtk_tree_view_enable_model_drag_dest(PGtkTreeView(ListView.FWidget), @row_targets, 1, [GDK_ACTION_MOVE, GDK_ACTION_COPY]);
ListView.RulesHint := True;
// ListView.Reorderable := True;
Column := ListView.Columns.AddTyped(ctImageText);
@@ -154,128 +154,189 @@ begin
ListViewScrolledWindow.HorizScrollBarPolicy := sbAutomatic;
ListViewScrolledWindow.VertScrollBarPolicy := sbAutomatic;
ListViewScrolledWindow.ShadowType := stShadowIn;
+ ListViewScrolledWindow.MarginTop := 5;
+ ListViewScrolledWindow.MarginBottom := 5;
- AddItemButton := TGTKButton.CreateFromStock(Self, 'gtk-add');
- RemoveItemButton := TGTKButton.CreateFromStock(Self, 'gtk-remove');
+ AddItemButton := TGTKButton.CreateFromIconName(Self, 'gtk-add');
+ AddItemButton.Caption := 'Add';
+ RemoveItemButton := TGTKButton.CreateFromIconName(Self, 'gtk-remove');
+ RemoveItemButton.Caption := 'Remove';
HBox1 := TGTKHBox.Create(Self);
HBox1.Homogeneous := True;
HBox1.AddControlEx(AddItemButton, True, True, 2);
HBox1.AddControlEx(RemoveItemButton, True, True, 2);
- MoveUpButton := TGTKImageButton.CreateWithoutLabel(Self);
- MoveUpButton.SetFromStock('gtk-go-up', isSmallToolbar);
+ HBox1.MarginTop := 2;
+ HBox1.MarginBottom := 2;
+ MoveUpButton := TGTKButton.CreateFromIconName(Self, 'gtk-go-up');
MoveUpButton.Tooltip := LANGMounterPrefs_MoveUpButtonTooltip;
MoveUpButton.CanFocus := False;
- MoveDownButton := TGTKImageButton.CreateWithoutLabel(Self);
- MoveDownButton.SetFromStock('gtk-go-down', isSmallToolbar);
+ MoveUpButton.MarginStart := 5;
+ MoveUpButton.MarginEnd := 5;
+ MoveUpButton.MarginTop := 5;
+ MoveUpButton.MarginBottom := 5;
+ MoveDownButton := TGTKButton.CreateFromIconName(Self, 'gtk-go-down');
MoveDownButton.Tooltip := LANGMounterPrefs_MoveDownButtonTooltip;
MoveDownButton.CanFocus := False;
+ MoveDownButton.MarginStart := 5;
+ MoveDownButton.MarginEnd := 5;
+ MoveDownButton.MarginTop := 5;
+ MoveDownButton.MarginBottom := 5;
UseFSTabDefaultsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGMounterPrefs_UseFSTabDefaultsCheckBox);
UseFSTabDefaultsCheckBox.Tooltip := LANGMounterPrefs_UseFSTabDefaultsCheckBoxTooltip;
+ UseFSTabDefaultsCheckBox.MarginTop := 2;
+ UseFSTabDefaultsCheckBox.MarginBottom := 2;
ToggleModeCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGMounterPrefs_ToggleModeCheckBox);
ToggleModeCheckBox.Tooltip := LANGMounterPrefs_ToggleModeCheckBoxTooltip;
-
- MounterListTable.AddControlEx(0, 0, 3, 1, UseFSTabDefaultsCheckBox, [taoExpand, taoFill], [taoShrink, taoFill], 0, 2);
- MounterListTable.AddControlEx(0, 1, 3, 1, ToggleModeCheckBox, [taoExpand, taoFill], [taoShrink, taoFill], 0, 2);
- MounterListTable.AddControlEx(0, 2, 3, 4, ListViewScrolledWindow, [taoExpand, taoFill], [taoExpand, taoFill], 0, 5);
- MounterListTable.AddControlEx(0, 6, 1, 1, TGTKLabel.Create(Self), [taoExpand, taoFill], [taoShrink, taoFill], 0, 2);
- MounterListTable.AddControlEx(2, 6, 1, 1, HBox1, [taoShrink, taoFill], [taoShrink, taoFill], 0, 2);
- MounterListTable.AddControlEx(3, 3, 1, 1, MoveUpButton, [taoShrink, taoFill], [taoShrink], 5, 5);
- MounterListTable.AddControlEx(3, 4, 1, 1, MoveDownButton, [taoShrink, taoFill], [taoShrink], 5, 5);
- MounterListTable.AddControlEx(3, 2, 1, 1, TGTKLabel.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 0, 2);
- MounterListTable.AddControlEx(3, 5, 1, 1, TGTKLabel.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 0, 2);
+ ToggleModeCheckBox.MarginTop := 2;
+ ToggleModeCheckBox.MarginBottom := 2;
+
+ MounterListGrid.AddControl(0, 0, 3, 1, UseFSTabDefaultsCheckBox);
+ MounterListGrid.AddControl(0, 1, 3, 1, ToggleModeCheckBox);
+ MounterListGrid.AddControl(0, 2, 3, 4, ListViewScrolledWindow);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ MounterListGrid.AddControl(0, 6, 1, 1, VBox);
+ MounterListGrid.AddControl(2, 6, 1, 1, HBox1);
+ MounterListGrid.AddControl(3, 3, 1, 1, MoveUpButton);
+ MounterListGrid.AddControl(3, 4, 1, 1, MoveDownButton);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ MounterListGrid.AddControl(3, 2, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ MounterListGrid.AddControl(3, 5, 1, 1, VBox);
PropertiesFrame := TGTKFrame.Create(Self);
PropertiesFrame.Caption := LANGMounterPrefs_PropertiesFrameCaption;
PropertiesFrame.BorderWidth := 7;
- PropertiesTable := TGTKTable.Create(Self);
- PropertiesFrame.AddControl(PropertiesTable);
+ PropertiesGrid := TGTKGrid.Create(Self);
+ PropertiesFrame.AddControl(PropertiesGrid);
ClientArea.AddControlEx(PropertiesFrame, False, False, 0);
DisplayTextLabel := TGTKLabel.Create(Self);
DisplayTextLabel.Caption := LANGMounterPrefs_DisplayTextLabelCaption;
- DisplayTextLabel.XAlign := 0;
DisplayTextLabel.UseUnderline := True;
+ DisplayTextLabel.XAlign := 0;
+ DisplayTextLabel.MarginStart := 10;
+ DisplayTextLabel.MarginEnd := 10;
+ DisplayTextLabel.MarginTop := 2;
+ DisplayTextLabel.MarginBottom := 2;
MountPointLabel := TGTKLabel.Create(Self);
MountPointLabel.Caption := LANGMounterPrefs_MountPointLabelCaption;
- MountPointLabel.XAlign := 0;
MountPointLabel.UseUnderline := True;
+ MountPointLabel.XAlign := 0;
+ MountPointLabel.MarginStart := 10;
+ MountPointLabel.MarginEnd := 10;
+ MountPointLabel.MarginTop := 2;
+ MountPointLabel.MarginBottom := 2;
MountDeviceLabel := TGTKLabel.Create(Self);
MountDeviceLabel.Caption := LANGMounterPrefs_MountDeviceLabelCaption;
- MountDeviceLabel.XAlign := 0;
MountDeviceLabel.UseUnderline := True;
+ MountDeviceLabel.XAlign := 0;
+ MountDeviceLabel.MarginStart := 10;
+ MountDeviceLabel.MarginEnd := 10;
+ MountDeviceLabel.MarginTop := 2;
+ MountDeviceLabel.MarginBottom := 2;
DeviceTypeLabel := TGTKLabel.Create(Self);
DeviceTypeLabel.Caption := LANGMounterPrefs_DeviceTypeLabelCaption;
- DeviceTypeLabel.XAlign := 0;
DeviceTypeLabel.UseUnderline := True;
+ DeviceTypeLabel.XAlign := 0;
+ DeviceTypeLabel.MarginTop := 2;
+ DeviceTypeLabel.MarginBottom := 2;
DisplayTextEntry := TGTKEntry.Create(Self);
+ DisplayTextEntry.MarginStart := 10;
+ DisplayTextEntry.MarginEnd := 10;
+ DisplayTextEntry.MarginTop := 2;
+ DisplayTextEntry.MarginBottom := 2;
DisplayTextLabel.FocusControl := DisplayTextEntry;
MountPointEntry := TGTKEntry.Create(Self);
+ MountPointEntry.MarginStart := 10;
+ MountPointEntry.MarginEnd := 10;
+ MountPointEntry.MarginTop := 2;
+ MountPointEntry.MarginBottom := 2;
MountPointLabel.FocusControl := MountPointEntry;
MountDeviceEntry := TGTKEntry.Create(Self);
+ MountDeviceEntry.MarginStart := 10;
+ MountDeviceEntry.MarginEnd := 10;
+ MountDeviceEntry.MarginTop := 2;
+ MountDeviceEntry.MarginBottom := 2;
MountDeviceLabel.FocusControl := MountDeviceEntry;
- DeviceTypeOptionMenu := TGTKOptionMenu.Create(Self);
- DeviceTypeLabel.FocusControl := DeviceTypeOptionMenu;
- miLocalDisk := TGTKMenuItem.CreateTyped(Self, itImageText);
- miLocalDisk.Caption := LANGMounterPrefs_miLocalDiskCaption;
- miLocalDisk.Icon := MounterHDD;
- miRemovable := TGTKMenuItem.CreateTyped(Self, itImageText);
- miRemovable.Caption := LANGMounterPrefs_miRemovableCaption;
- miRemovable.Icon := MounterRemovable;
- miCD := TGTKMenuItem.CreateTyped(Self, itImageText);
- miCD.Caption := LANGMounterPrefs_miCDCaption;
- miCD.Icon := MounterCD;
- miFloppy := TGTKMenuItem.CreateTyped(Self, itImageText);
- miFloppy.Caption := LANGMounterPrefs_miFloppyCaption;
- miFloppy.Icon := MounterFloppy;
- miNetwork := TGTKMenuItem.CreateTyped(Self, itImageText);
- miNetwork.Caption := LANGMounterPrefs_miNetworkCaption;
- miNetwork.Icon := MounterNetwork;
- DeviceTypeOptionMenu.Items.Add(miLocalDisk);
- DeviceTypeOptionMenu.Items.Add(miRemovable);
- DeviceTypeOptionMenu.Items.Add(miCD);
- DeviceTypeOptionMenu.Items.Add(miFloppy);
- DeviceTypeOptionMenu.Items.Add(miNetwork);
+ DeviceTypeComboBox := TGTKComboBoxText.Create(Self);
+ DeviceTypeLabel.FocusControl := DeviceTypeComboBox;
+ // TODO: icons
+ DeviceTypeComboBox.AppendItem(LANGMounterPrefs_miLocalDiskCaption);
+ DeviceTypeComboBox.AppendItem(LANGMounterPrefs_miRemovableCaption);
+ DeviceTypeComboBox.AppendItem(LANGMounterPrefs_miCDCaption);
+ DeviceTypeComboBox.AppendItem(LANGMounterPrefs_miFloppyCaption);
+ DeviceTypeComboBox.AppendItem(LANGMounterPrefs_miNetworkCaption);
+ DeviceTypeComboBox.MarginStart := 10;
+ DeviceTypeComboBox.MarginEnd := 10;
+ DeviceTypeComboBox.MarginTop := 2;
+ DeviceTypeComboBox.MarginBottom := 2;
MountCommandLabel := TGTKLabel.Create(Self);
MountCommandLabel.Caption := LANGMounterPrefs_MountCommandLabelCaption;
- MountCommandLabel.XAlign := 0;
MountCommandLabel.UseUnderline := True;
+ MountCommandLabel.XAlign := 0;
+ MountCommandLabel.MarginStart := 10;
+ MountCommandLabel.MarginEnd := 10;
+ MountCommandLabel.MarginTop := 2;
+ MountCommandLabel.MarginBottom := 2;
UmountCommandLabel := TGTKLabel.Create(Self);
UmountCommandLabel.Caption := LANGMounterPrefs_UmountCommandLabelCaption;
- UmountCommandLabel.XAlign := 0;
UmountCommandLabel.UseUnderline := True;
+ UmountCommandLabel.XAlign := 0;
+ UmountCommandLabel.MarginTop := 2;
+ UmountCommandLabel.MarginBottom := 2;
MountCommandEntry := TGTKEntry.Create(Self);
MountCommandEntry.Tooltip := LANGMounterPrefs_MountCommandEntryTooltip;
+ MountCommandEntry.MarginStart := 10;
+ MountCommandEntry.MarginEnd := 10;
+ MountCommandEntry.MarginTop := 2;
+ MountCommandEntry.MarginBottom := 2;
MountCommandLabel.FocusControl := MountCommandEntry;
UmountCommandEntry := TGTKEntry.Create(Self);
UmountCommandEntry.Tooltip := LANGMounterPrefs_UmountCommandEntryTooltip;
+ UmountCommandEntry.MarginStart := 10;
+ UmountCommandEntry.MarginEnd := 10;
+ UmountCommandEntry.MarginTop := 2;
+ UmountCommandEntry.MarginBottom := 2;
UmountCommandLabel.FocusControl := UmountCommandEntry;
- PropertiesTable.AddControlEx(0, 0, 1, 1, DisplayTextLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(1, 0, 2, 1, DisplayTextEntry, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(0, 1, 1, 1, MountPointLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(1, 1, 2, 1, MountPointEntry, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(0, 2, 1, 1, MountDeviceLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(1, 2, 1, 1, MountDeviceEntry, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(2, 2, 1, 1, DeviceTypeLabel, [taoShrink, taoFill], [taoShrink, taoFill], 0, 2);
- PropertiesTable.AddControlEx(3, 2, 2, 1, DeviceTypeOptionMenu, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(0, 3, 1, 1, MountCommandLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(1, 3, 1, 1, MountCommandEntry, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- PropertiesTable.AddControlEx(2, 3, 1, 1, UmountCommandLabel, [taoShrink, taoFill], [taoShrink, taoFill], 0, 2);
- PropertiesTable.AddControlEx(3, 3, 2, 1, UmountCommandEntry, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
+ PropertiesGrid.AddControl(0, 0, 1, 1, DisplayTextLabel);
+ PropertiesGrid.AddControl(1, 0, 2, 1, DisplayTextEntry);
+ PropertiesGrid.AddControl(0, 1, 1, 1, MountPointLabel);
+ PropertiesGrid.AddControl(1, 1, 2, 1, MountPointEntry);
+ PropertiesGrid.AddControl(0, 2, 1, 1, MountDeviceLabel);
+ PropertiesGrid.AddControl(1, 2, 1, 1, MountDeviceEntry);
+ PropertiesGrid.AddControl(2, 2, 1, 1, DeviceTypeLabel);
+ PropertiesGrid.AddControl(3, 2, 2, 1, DeviceTypeComboBox);
+ PropertiesGrid.AddControl(0, 3, 1, 1, MountCommandLabel);
+ PropertiesGrid.AddControl(1, 3, 1, 1, MountCommandEntry);
+ PropertiesGrid.AddControl(2, 3, 1, 1, UmountCommandLabel);
+ PropertiesGrid.AddControl(3, 3, 2, 1, UmountCommandEntry);
IconLabel := TGTKLabel.Create(Self);
IconLabel.Caption := LANGMounterPrefs_IconLabelCaption;
IconLabel.XAlign := 1;
+ IconLabel.MarginTop := 2;
+ IconLabel.MarginBottom := 2;
IconLabel.UseUnderline := True;
- PropertiesTable.AddControlEx(3, 0, 1, 2, IconLabel, [taoExpand, taoFill], [taoShrink, taoFill], 0, 2);
+ PropertiesGrid.AddControl(3, 0, 1, 2, IconLabel);
if FUseGnomeIconEntry then begin
IconEntry := TGnomeIconEntry.Create(Self);
IconLabel.FocusControl := IconEntry;
- PropertiesTable.AddControlEx(4, 0, 1, 2, IconEntry, [taoExpand, taoFill], [taoExpand, taoFill], 0, 0);
+ PropertiesGrid.AddControl(4, 0, 1, 2, IconEntry);
end else begin
IconEntry2 := TGTKButton.Create(Self);
IconEntry2.Caption := LANGBrowseButton_Caption;
- PropertiesTable.AddControlEx(4, 0, 1, 2, IconEntry2, [taoExpand, taoFill], [taoExpand, taoFill], 10, 4);
+ IconEntry2.MarginStart := 10;
+ IconEntry2.MarginEnd := 10;
+ IconEntry2.MarginTop := 4;
+ IconEntry2.MarginBottom := 4;
+ PropertiesGrid.AddControl(4, 0, 1, 2, IconEntry2);
end;
@@ -292,7 +353,7 @@ begin
MountDeviceEntry.OnChanged := @MountDeviceEntryChanged;
MountCommandEntry.OnChanged := @MountCommandEntryChanged;
UmountCommandEntry.OnChanged := @UmountCommandEntryChanged;
- DeviceTypeOptionMenu.OnChanged := @DeviceTypeOptionMenuChanged;
+ DeviceTypeComboBox.OnChanged := @DeviceTypeComboBoxChanged;
if FUseGnomeIconEntry then IconEntry.OnIconChanged := @IconEntryChanged
else IconEntry2.OnClick := @IconEntry2Click;
@@ -308,14 +369,14 @@ begin
RemoveItemButton.Enabled := b;
MoveUpButton.Enabled := b and (ListView.Selected.Index > 0);
MoveDownButton.Enabled := b and (ListView.Selected.Index < ListView.Items.Count - 1);
- PropertiesTable.Enabled := b;
+ PropertiesGrid.Enabled := b;
if not b then begin
DisplayTextEntry.Text := '';
MountPointEntry.Text := '';
MountDeviceEntry.Text := '';
MountCommandEntry.Text := '';
UmountCommandEntry.Text := '';
- DeviceTypeOptionMenu.ItemIndex := 0;
+ DeviceTypeComboBox.ItemIndex := 0;
if FUseGnomeIconEntry then IconEntry.Filename := '';
Exit;
end;
@@ -325,7 +386,7 @@ begin
MountDeviceEntry.Text := StrToUTF8(Item.Device);
MountCommandEntry.Text := StrToUTF8(Item.MountCommand);
UmountCommandEntry.Text := StrToUTF8(Item.UmountCommand);
- DeviceTypeOptionMenu.ItemIndex := Item.DeviceType;
+ DeviceTypeComboBox.ItemIndex := Item.DeviceType;
if FUseGnomeIconEntry then IconEntry.Filename := Item.IconPath;
end;
@@ -428,10 +489,10 @@ begin
end;
end;
-procedure TFMounterPrefs.DeviceTypeOptionMenuChanged(Sender: TObject);
+procedure TFMounterPrefs.DeviceTypeComboBoxChanged(Sender: TObject);
begin
if Assigned(ListView.Selected) and Assigned(ListView.Selected.AsPointer(3)) and (not UseFSTabDefaultsCheckBox.Checked) then begin
- TMounterItem(ListView.Selected.AsPointer(3)).DeviceType := DeviceTypeOptionMenu.ItemIndex;
+ TMounterItem(ListView.Selected.AsPointer(3)).DeviceType := DeviceTypeComboBox.ItemIndex;
RefreshIcon(ListView.Selected.Index);
end;
end;
@@ -470,12 +531,11 @@ begin
end;
procedure TFMounterPrefs.IconEntry2Click(Sender: TObject);
-var Dialog: TGTKFileSelectionDialog;
+var Dialog: TGTKFileChooserDialog;
begin
if (not Assigned(ListView.Selected)) or (not Assigned(ListView.Selected.AsPointer(3))) then Exit;
- Dialog := TGTKFileSelectionDialog.CreateWithTitle(Self, LANGBrowseForIcon);
+ Dialog := TGTKFileChooserDialog.CreateWithTitle(Self, LANGBrowseForIcon);
try
- Dialog.ShowFileOpButtons := False;
Dialog.FileName := TMounterItem(ListView.Selected.AsPointer(3)).IconPath;
if Byte(Dialog.Run) = 251 then TMounterItem(ListView.Selected.AsPointer(3)).IconPath := Dialog.FileName;
RefreshIcon(ListView.Selected.Index);
diff --git a/UNewDir.pas b/UNewDir.pas
index a55f5c3..1f1e583 100644
--- a/UNewDir.pas
+++ b/UNewDir.pas
@@ -22,7 +22,7 @@ unit UNewDir;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls;
type
TFNewDir = class(TGTKDialog)
@@ -55,7 +55,6 @@ begin
Label1.Caption := LANGEnterDirectoryName;
Label1.UseUnderline := True;
Label1.XAlign := 0;
- Label1.XPadding := 0;
Label1.LineWrap := True;
Entry := TGTKEntry.Create(Self);
Label1.FocusControl := Entry;
@@ -70,8 +69,8 @@ end;
procedure TFNewDir.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
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.
diff --git a/UPreferences.pas b/UPreferences.pas
index 008ecf5..f66c1eb 100644
--- a/UPreferences.pas
+++ b/UPreferences.pas
@@ -22,13 +22,13 @@ unit UPreferences;
interface
uses
- gtk2, pango, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls,
- GTKUtils, GTKDialogs, GTKPixbuf, GTKClasses, GTKMenus, ULibc,
- UGnome;
+ SysUtils, Classes, lazgdk3, lazgtk3, lazpango1, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls,
+ GTKUtils, GTKDialogs, GTKPixbuf, GTKClasses, GTKMenus,
+ ULibc;
type
TFPreferences = class(TGTKDialog)
- TitleFrame, ListFontFrame: TGTKFrame;
+ TitleFrame: TGTKFrame;
TitleLabel: TGTKLabel;
TitleEventBox: TGTKEventBox;
TitleIcon: TGTKImage;
@@ -36,7 +36,7 @@ type
Notebook: TGTKNotebook;
GeneralPage, ColorsPage, FontsPage, PanelsPage, ApplicationsPage, ExperimentalPage: TGTKVBox;
RowHeightLabel, NumHistoryItemsLabel, ViewerLabel, EditorLabel, TerminalLabel, GeneralLabel2, ExternalAppsLabel, FontsLabel2,
- ListFontLabel, ListFontPreview, ColorsLabel2, ForegroundLabel, BackgroundLabel, PanelsLabel2, ApplicationsLabel2,
+ ListFontLabel, ColorsLabel2, ForegroundLabel, BackgroundLabel, PanelsLabel2, ApplicationsLabel2,
ExperimentalLabel2, PanelsLabel3, PanelsLabel4: TGTKLabel;
NormalItemFGColorLabel, ActiveItemFGColorLabel, InactiveItemFGColorLabel, SelectedItemFGColorLabel, LinkItemFGColorLabel,
DotFileItemFGColorLabel: TGTKLabel;
@@ -50,48 +50,45 @@ type
LinkItemFGColorDefault, DotFileItemFGColorDefault: TGTKCheckButton;
HBox1, HBox2, HBox3, HBox4: TGTKHBox;
VBox1: TGTKVBox;
- ViewerCombo, EditorCombo, TerminalCombo: TGTKCombo;
- ViewerBrowseButton, EditorBrowseButton, TerminalBrowseButton, ChangeFontButton: TGTKButton;
+ ViewerCommandComboBox, EditorCommandComboBox, TerminalCommandComboBox: TGTKComboBoxEntry;
+ ViewerBrowseButton, EditorBrowseButton, TerminalBrowseButton: TGTKButton;
NormalItemFGColorButton, ActiveItemFGColorButton, InactiveItemFGColorButton, SelectedItemFGColorButton, LinkItemFGColorButton,
- DotFileItemFGColorButton, NormalItemBGColorButton, ActiveItemBGColorButton, InactiveItemBGColorButton: TGnomeColorButton;
- Table1, Table2, Table3, Table4, Table5, Table6: TGTKTable;
+ DotFileItemFGColorButton, NormalItemBGColorButton, ActiveItemBGColorButton, InactiveItemBGColorButton: TGTKColorButton;
+ Grid1, Grid2, Grid3, Grid4, Grid5, Grid6: TGTKGrid;
RowHeightSpinEdit, NumHistoryItemsSpinEdit: TGTKSpinEdit;
SizeFormatLabel: TGTKLabel;
- SizeFormatOptionMenu: TGTKOptionMenu;
- miSizeFormat1, miSizeFormat2, miSizeFormat3, miSizeFormat4, miSizeFormat5, miSizeFormat6: TGTKMenuItem;
+ SizeFormatComboBox: TGTKComboBoxText;
UseInternalViewerCheckBox: TGTKCheckButton;
ViewerLabel2, EditorLabel2, TerminalLabel2, CmdLineBehaviourLabel: TGTKLabel;
- ViewerOptionMenu, EditorOptionMenu, TerminalOptionMenu: TGTKOptionMenu;
- miViewerTerminalDetect, miViewerAlwaysTerminal, miViewerNoTerminal,
- miEditorTerminalDetect, miEditorAlwaysTerminal, miEditorNoTerminal,
- miTerminalDetect, miAlwaysTerminal, miNoTerminal: TGTKMenuItem;
+ ViewerX11AppComboBox, EditorX11AppComboBox, CmdLineBehaviourComboBox: TGTKComboBoxText;
ShowTextUIDsCheckBox: TGTKCheckButton;
DateFormatLabel: TGTKLabel;
- DateFormatOptionMenu: TGTKOptionMenu;
+ DateFormatComboBox: TGTKComboBoxText;
CustomDateFormatEntry: TGTKEntry;
TimeFormatLabel: TGTKLabel;
- TimeFormatOptionMenu: TGTKOptionMenu;
+ TimeFormatComboBox: TGTKComboBoxText;
CustomTimeFormatEntry: TGTKEntry;
DateTimeFormatLabel: TGTKLabel;
- DateTimeFormatOptionMenu: TGTKOptionMenu;
+ DateTimeFormatComboBox: TGTKComboBoxText;
QuickSearchLabel: TGTKLabel;
- QuickSearchOptionMenu: TGTKOptionMenu;
+ QuickSearchComboBox: TGTKComboBoxText;
SortDirectoriesLikeFilesCheckBox: TGTKCheckButton;
TempPathLabel, VFSTempPathLabel: TGTKLabel;
VFSTempPathEntry: TGTKEntry;
QuickRenameSkipExtCheckBox: TGTKCheckButton;
RightClickSelectCheckBox: TGTKCheckButton;
+ ListFontButton: TGTKFontButton;
procedure FormCreate(Sender: TObject); override;
procedure FormDestroy(Sender: TObject);
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
procedure ViewerBrowseButtonClick(Sender: TObject);
procedure DefaultFontCheckBoxToggled(Sender: TObject);
- procedure ChangeFontButtonClick(Sender: TObject);
procedure ColorButtonDefaultsToggled(Sender: TObject);
procedure DefaultRowHeightCheckBoxToggled(Sender: TObject);
procedure UseInternalViewerCheckBoxToggled(Sender: TObject);
- procedure DateTimeFormatOptionMenuChanged(Sender: TObject);
+ procedure DateTimeFormatComboBoxChanged(Sender: TObject);
+ procedure ListFontButtonFontNameChanged(Sender: TObject);
private
DefaultGTKFont, LocalListFont: string;
FormatTime: time_t;
@@ -111,24 +108,25 @@ uses ULocale, UCoreUtils, UConfig;
procedure TFPreferences.FormCreate(Sender: TObject);
var i: integer;
- Item: TGTKMenuItem;
+ VBox: TGTKVBox;
begin
SetDefaultSize(450, 600);
Caption := LANGPreferences_Caption;
Buttons := [mbOK, mbCancel];
- ShowSeparator := False;
TitleEventBox := TGTKEventBox.Create(Self);
TitleLabel := TGTKLabel.Create(Self);
TitleLabel.Caption := LANGPreferences_TitleLabel_Caption;
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-preferences', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-preferences', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
@@ -166,164 +164,203 @@ begin
GeneralPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
GeneralLabel2 := TGTKLabel.Create(Self);
GeneralLabel2.XAlign := 0;
- GeneralLabel2.XPadding := 10;
+ GeneralLabel2.MarginStart := 10;
+ GeneralLabel2.MarginEnd := 10;
GeneralLabel2.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferences_GeneralPage]);
GeneralLabel2.UseMarkup := True;
GeneralPage.AddControlEx(GeneralLabel2, False, False, 5);
- Table2 := TGTKTable.Create(Self);
- Table2.SetRowColCount(8, 5);
- GeneralPage.AddControlEx(Table2, False, False, 0);
+ Grid2 := TGTKGrid.Create(Self);
+ GeneralPage.AddControlEx(Grid2, False, False, 0);
ClearROAttr := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_ClearReadonlyAttribute);
- Table2.AddControlEx(1, 0, 3, 1, ClearROAttr, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ ClearROAttr.MarginTop := 2;
+ ClearROAttr.MarginBottom := 2;
+ Grid2.AddControl(1, 0, 3, 1, ClearROAttr);
SelectAllDirectoriesCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesSelectAllDirectoriesCheckBox_Caption);
- Table2.AddControlEx(1, 1, 3, 1, SelectAllDirectoriesCheckBox, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ SelectAllDirectoriesCheckBox.MarginTop := 2;
+ SelectAllDirectoriesCheckBox.MarginBottom := 2;
+ Grid2.AddControl(1, 1, 3, 1, SelectAllDirectoriesCheckBox);
NewStyleAltOCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesNewStyleAltOCheckBox_Caption);
NewStyleAltOCheckBox.Tooltip := LANGPreferencesNewStyleAltOCheckBox_Tooltip;
- Table2.AddControlEx(1, 2, 3, 1, NewStyleAltOCheckBox, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ NewStyleAltOCheckBox.MarginTop := 2;
+ NewStyleAltOCheckBox.MarginBottom := 2;
+ Grid2.AddControl(1, 2, 3, 1, NewStyleAltOCheckBox);
ShowFuncButtonsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesShowFuncButtonsCheckBox_Caption);
- Table2.AddControlEx(1, 3, 3, 1, ShowFuncButtonsCheckBox, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ ShowFuncButtonsCheckBox.MarginTop := 2;
+ ShowFuncButtonsCheckBox.MarginBottom := 2;
+ Grid2.AddControl(1, 3, 3, 1, ShowFuncButtonsCheckBox);
NumHistoryItemsLabel := TGTKLabel.Create(Self);
NumHistoryItemsLabel.Caption := LANGPreferences_NumHistoryItems;
NumHistoryItemsLabel.XAlign := 0;
+ NumHistoryItemsLabel.MarginTop := 2;
+ NumHistoryItemsLabel.MarginBottom := 2;
NumHistoryItemsSpinEdit := TGTKSpinEdit.Create(Self);
NumHistoryItemsSpinEdit.Digits := 0;
+ NumHistoryItemsSpinEdit.MarginStart := 10;
+ NumHistoryItemsSpinEdit.MarginEnd := 10;
+ NumHistoryItemsSpinEdit.MarginTop := 2;
+ NumHistoryItemsSpinEdit.MarginBottom := 2;
NumHistoryItemsLabel.FocusControl := NumHistoryItemsSpinEdit;
NumHistoryItemsLabel.UseUnderline := True;
- Table2.AddControlEx(0, 4, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 15, 2);
- Table2.AddControlEx(1, 4, 1, 1, NumHistoryItemsLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 4, 1, 1, NumHistoryItemsSpinEdit, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 15;
+ VBox.MarginEnd := 15;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid2.AddControl(0, 4, 1, 1, VBox);
+ Grid2.AddControl(1, 4, 1, 1, NumHistoryItemsLabel);
+ Grid2.AddControl(2, 4, 1, 1, NumHistoryItemsSpinEdit);
RowHeightLabel := TGTKLabel.Create(Self);
RowHeightLabel.Caption := LANGPreferences_RowHeight;
RowHeightLabel.XAlign := 0;
+ RowHeightLabel.MarginTop := 2;
+ RowHeightLabel.MarginBottom := 2;
RowHeightSpinEdit := TGTKSpinEdit.Create(Self);
RowHeightSpinEdit.Digits := 0;
+ RowHeightSpinEdit.MarginStart := 10;
+ RowHeightSpinEdit.MarginEnd := 10;
+ RowHeightSpinEdit.MarginTop := 2;
+ RowHeightSpinEdit.MarginBottom := 2;
RowHeightLabel.FocusControl := RowHeightSpinEdit;
RowHeightLabel.UseUnderline := True;
DefaultRowHeightCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_Default);
DefaultRowHeightCheckBox.OnToggled := @DefaultRowHeightCheckBoxToggled;
- Table2.AddControlEx(1, 5, 1, 1, RowHeightLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 5, 1, 1, RowHeightSpinEdit, [taoFill, taoExpand], [taoShrink, taoExpand, taoFill], 10, 2);
- Table2.AddControlEx(3, 5, 1, 1, DefaultRowHeightCheckBox, [taoFill, taoExpand], [taoShrink, taoExpand, taoFill], 10, 2);
- Table2.AddControlEx(4, 5, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 8, 2);
+ DefaultRowHeightCheckBox.MarginStart := 10;
+ DefaultRowHeightCheckBox.MarginEnd := 10;
+ DefaultRowHeightCheckBox.MarginTop := 2;
+ DefaultRowHeightCheckBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 8;
+ VBox.MarginEnd := 8;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid2.AddControl(1, 5, 1, 1, RowHeightLabel);
+ Grid2.AddControl(2, 5, 1, 1, RowHeightSpinEdit);
+ Grid2.AddControl(3, 5, 1, 1, DefaultRowHeightCheckBox);
+ Grid2.AddControl(4, 5, 1, 1, VBox);
SizeFormatLabel := TGTKLabel.Create(Self);
SizeFormatLabel.Caption := LANGPreferencesSizeFormatLabel_Caption;
SizeFormatLabel.XAlign := 0;
SizeFormatLabel.UseUnderline := True;
- SizeFormatOptionMenu := TGTKOptionMenu.Create(Self);
- SizeFormatLabel.FocusControl := SizeFormatOptionMenu;
- miSizeFormat1 := TGTKMenuItem.CreateTyped(Self, itLabel);
- miSizeFormat1.Caption := Format('%s (%s)', [LANGPreferencesmiSizeFormat1, FormatSize(123456, 0, 0)]);
- miSizeFormat2 := TGTKMenuItem.CreateTyped(Self, itLabel);
- miSizeFormat2.Caption := FormatSize(123456, 0, 1);
- miSizeFormat3 := TGTKMenuItem.CreateTyped(Self, itLabel);
- miSizeFormat3.Caption := FormatSize(123456, 0, 2);
- miSizeFormat4 := TGTKMenuItem.CreateTyped(Self, itLabel);
- miSizeFormat4.Caption := FormatSize(123456, 0, 3);
- miSizeFormat5 := TGTKMenuItem.CreateTyped(Self, itLabel);
- miSizeFormat5.Caption := FormatSize(123456, 0, 4);
- miSizeFormat6 := TGTKMenuItem.CreateTyped(Self, itLabel);
- miSizeFormat6.Caption := LANGPreferencesmiSizeFormat6;
- SizeFormatOptionMenu.Items.Add(miSizeFormat1);
- SizeFormatOptionMenu.Items.Add(miSizeFormat2);
- SizeFormatOptionMenu.Items.Add(miSizeFormat3);
- SizeFormatOptionMenu.Items.Add(miSizeFormat4);
- SizeFormatOptionMenu.Items.Add(miSizeFormat5);
- SizeFormatOptionMenu.Items.Add(miSizeFormat6);
- Table2.AddControl(0, 7, 1, 1, TGTKVBox.Create(Self), 0, 4);
- Table2.AddControlEx(1, 8, 1, 1, SizeFormatLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 8, 2, 1, SizeFormatOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
-
- TerminalOptionMenu := TGTKOptionMenu.Create(Self);
- miTerminalDetect := TGTKMenuItem.CreateTyped(Self, itLabel);
- miTerminalDetect.Caption := LANGPreferencesAutodetectXApp;
- miAlwaysTerminal := TGTKMenuItem.CreateTyped(Self, itLabel);
- miAlwaysTerminal.Caption := LANGPreferencesAlwaysRunInTerminal;
- miNoTerminal := TGTKMenuItem.CreateTyped(Self, itLabel);
- miNoTerminal.Caption := LANGPreferencesNeverRunInTerminal;
- TerminalOptionMenu.Items.Add(miTerminalDetect);
- TerminalOptionMenu.Items.Add(miAlwaysTerminal);
- TerminalOptionMenu.Items.Add(miNoTerminal);
+ SizeFormatLabel.MarginTop := 2;
+ SizeFormatLabel.MarginBottom := 2;
+ SizeFormatComboBox := TGTKComboBoxText.Create(Self);
+ SizeFormatLabel.FocusControl := SizeFormatComboBox;
+ SizeFormatComboBox.AppendItem(Format('%s (%s)', [LANGPreferencesmiSizeFormat1, FormatSize(123456, 0, 0)]));
+ SizeFormatComboBox.AppendItem(FormatSize(123456, 0, 1));
+ SizeFormatComboBox.AppendItem(FormatSize(123456, 0, 2));
+ SizeFormatComboBox.AppendItem(FormatSize(123456, 0, 3));
+ SizeFormatComboBox.AppendItem(FormatSize(123456, 0, 4));
+ SizeFormatComboBox.AppendItem(LANGPreferencesmiSizeFormat6);
+ SizeFormatComboBox.MarginStart := 10;
+ SizeFormatComboBox.MarginEnd := 10;
+ SizeFormatComboBox.MarginTop := 2;
+ SizeFormatComboBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 4;
+ VBox.MarginBottom := 4;
+ Grid2.AddControl(0, 7, 1, 1, VBox);
+ Grid2.AddControl(1, 8, 1, 1, SizeFormatLabel);
+ Grid2.AddControl(2, 8, 2, 1, SizeFormatComboBox);
+
+ CmdLineBehaviourComboBox := TGTKComboBoxText.Create(Self);
+ CmdLineBehaviourComboBox.AppendItem(LANGPreferencesAutodetectXApp);
+ CmdLineBehaviourComboBox.AppendItem(LANGPreferencesAlwaysRunInTerminal);
+ CmdLineBehaviourComboBox.AppendItem(LANGPreferencesNeverRunInTerminal);
+ CmdLineBehaviourComboBox.MarginStart := 10;
+ CmdLineBehaviourComboBox.MarginEnd := 10;
+ CmdLineBehaviourComboBox.MarginTop := 2;
+ CmdLineBehaviourComboBox.MarginBottom := 2;
CmdLineBehaviourLabel := TGTKLabel.Create(Self);
CmdLineBehaviourLabel.Caption := LANGPreferencesCmdLineBehaviourLabel_Caption;
CmdLineBehaviourLabel.XAlign := 0;
- CmdLineBehaviourLabel.FocusControl := TerminalOptionMenu;
+ CmdLineBehaviourLabel.MarginTop := 2;
+ CmdLineBehaviourLabel.MarginBottom := 2;
+ CmdLineBehaviourLabel.FocusControl := CmdLineBehaviourComboBox;
CmdLineBehaviourLabel.UseUnderline := True;
- Table2.AddControlEx(1, 6, 1, 1, CmdLineBehaviourLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 6, 2, 1, TerminalOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ Grid2.AddControl(1, 6, 1, 1, CmdLineBehaviourLabel);
+ Grid2.AddControl(2, 6, 2, 1, CmdLineBehaviourComboBox);
FormatTime := libc_time(nil);
DateFormatLabel := TGTKLabel.Create(Self);
DateFormatLabel.Caption := LANGPreferences_DateFormatLabel_Caption;
DateFormatLabel.XAlign := 0;
+ DateFormatLabel.MarginTop := 2;
+ DateFormatLabel.MarginBottom := 2;
DateFormatLabel.UseUnderline := True;
- DateFormatOptionMenu := TGTKOptionMenu.Create(Self);
- DateFormatLabel.FocusControl := DateFormatOptionMenu;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := Format('%s (%s)', [LANGPreferences_System, FormatDate(FormatTime, False, True, -1, 0, -1)]);
- DateFormatOptionMenu.Items.Add(Item);
- for i := 1 to 14 do begin
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := FormatDate(FormatTime, False, True, -1, i, -1);
- DateFormatOptionMenu.Items.Add(Item);
- end;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := LANGPreferences_Custom;
- DateFormatOptionMenu.Items.Add(Item);
- DateFormatOptionMenu.OnChanged := @DateTimeFormatOptionMenuChanged;
- Table2.AddControlEx(1, 9, 1, 1, DateFormatLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 9, 2, 1, DateFormatOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ DateFormatComboBox := TGTKComboBoxText.Create(Self);
+ DateFormatLabel.FocusControl := DateFormatComboBox;
+ DateFormatComboBox.AppendItem(Format('%s (%s)', [LANGPreferences_System, FormatDate(FormatTime, False, True, -1, 0, -1)]));
+ for i := 1 to 14 do
+ DateFormatComboBox.AppendItem(FormatDate(FormatTime, False, True, -1, i, -1));
+ DateFormatComboBox.AppendItem(LANGPreferences_Custom);
+ DateFormatComboBox.OnChanged := @DateTimeFormatComboBoxChanged;
+ DateFormatComboBox.MarginStart := 10;
+ DateFormatComboBox.MarginEnd := 10;
+ DateFormatComboBox.MarginTop := 2;
+ DateFormatComboBox.MarginBottom := 2;
+ Grid2.AddControl(1, 9, 1, 1, DateFormatLabel);
+ Grid2.AddControl(2, 9, 2, 1, DateFormatComboBox);
CustomDateFormatEntry := TGTKEntry.Create(Self);
CustomDateFormatEntry.Enabled := False;
CustomDateFormatEntry.Tooltip := LANGPreferences_CustomDateFormatEntry_Tooltip;
- CustomDateFormatEntry.OnChanged := @DateTimeFormatOptionMenuChanged;
- Table2.AddControlEx(2, 10, 2, 1, CustomDateFormatEntry, [taoShrink], [taoShrink], 10, 2);
+ CustomDateFormatEntry.OnChanged := @DateTimeFormatComboBoxChanged;
+ CustomDateFormatEntry.MarginStart := 10;
+ CustomDateFormatEntry.MarginEnd := 10;
+ CustomDateFormatEntry.MarginTop := 2;
+ CustomDateFormatEntry.MarginBottom := 2;
+ Grid2.AddControl(2, 10, 2, 1, CustomDateFormatEntry);
TimeFormatLabel := TGTKLabel.Create(Self);
TimeFormatLabel.Caption := LANGPreferences_TimeFormatLabel_Caption;
TimeFormatLabel.XAlign := 0;
+ TimeFormatLabel.MarginTop := 2;
+ TimeFormatLabel.MarginBottom := 2;
TimeFormatLabel.UseUnderline := True;
- TimeFormatOptionMenu := TGTKOptionMenu.Create(Self);
- TimeFormatLabel.FocusControl := TimeFormatOptionMenu;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := Format('%s (%s)', [LANGPreferences_System, FormatDate(FormatTime, True, False, 0, -1, -1)]);
- TimeFormatOptionMenu.Items.Add(Item);
- for i := 1 to 11 do begin
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := FormatDate(FormatTime, True, False, i, -1, -1);
- TimeFormatOptionMenu.Items.Add(Item);
- end;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := LANGPreferences_Custom;
- TimeFormatOptionMenu.Items.Add(Item);
- TimeFormatOptionMenu.OnChanged := @DateTimeFormatOptionMenuChanged;
- Table2.AddControlEx(1, 11, 1, 1, TimeFormatLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 11, 2, 1, TimeFormatOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ TimeFormatComboBox := TGTKComboBoxText.Create(Self);
+ TimeFormatLabel.FocusControl := TimeFormatComboBox;
+ TimeFormatComboBox.AppendItem(Format('%s (%s)', [LANGPreferences_System, FormatDate(FormatTime, True, False, 0, -1, -1)]));
+ for i := 1 to 11 do
+ TimeFormatComboBox.AppendItem(FormatDate(FormatTime, True, False, i, -1, -1));
+ TimeFormatComboBox.AppendItem(LANGPreferences_Custom);
+ TimeFormatComboBox.OnChanged := @DateTimeFormatComboBoxChanged;
+ TimeFormatComboBox.MarginStart := 10;
+ TimeFormatComboBox.MarginEnd := 10;
+ TimeFormatComboBox.MarginTop := 2;
+ TimeFormatComboBox.MarginBottom := 2;
+ Grid2.AddControl(1, 11, 1, 1, TimeFormatLabel);
+ Grid2.AddControl(2, 11, 2, 1, TimeFormatComboBox);
CustomTimeFormatEntry := TGTKEntry.Create(Self);
CustomTimeFormatEntry.Enabled := False;
CustomTimeFormatEntry.Tooltip := LANGPreferences_CustomTimeFormatEntry_Tooltip;
- CustomTimeFormatEntry.OnChanged := @DateTimeFormatOptionMenuChanged;
- Table2.AddControlEx(2, 12, 2, 1, CustomTimeFormatEntry, [taoShrink], [taoShrink], 10, 2);
+ CustomTimeFormatEntry.OnChanged := @DateTimeFormatComboBoxChanged;
+ CustomTimeFormatEntry.MarginStart := 10;
+ CustomTimeFormatEntry.MarginEnd := 10;
+ CustomTimeFormatEntry.MarginTop := 2;
+ CustomTimeFormatEntry.MarginBottom := 2;
+ Grid2.AddControl(2, 12, 2, 1, CustomTimeFormatEntry);
DateTimeFormatLabel := TGTKLabel.Create(Self);
DateTimeFormatLabel.Caption := LANGPreferences_DateTimeFormatLabel_Caption;
DateTimeFormatLabel.XAlign := 0;
+ DateTimeFormatLabel.MarginTop := 2;
+ DateTimeFormatLabel.MarginBottom := 2;
DateTimeFormatLabel.UseUnderline := True;
- DateTimeFormatOptionMenu := TGTKOptionMenu.Create(Self);
- DateTimeFormatLabel.FocusControl := DateTimeFormatOptionMenu;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := FormatDate(FormatTime, True, True, -1, -1, 0);
- DateTimeFormatOptionMenu.Items.Add(Item);
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := FormatDate(FormatTime, True, True, -1, -1, 1);
- DateTimeFormatOptionMenu.Items.Add(Item);
- Table2.AddControlEx(1, 13, 1, 1, DateTimeFormatLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table2.AddControlEx(2, 13, 2, 1, DateTimeFormatOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ DateTimeFormatComboBox := TGTKComboBoxText.Create(Self);
+ DateTimeFormatLabel.FocusControl := DateTimeFormatComboBox;
+ DateTimeFormatComboBox.AppendItem(FormatDate(FormatTime, True, True, -1, -1, 0));
+ DateTimeFormatComboBox.AppendItem(FormatDate(FormatTime, True, True, -1, -1, 1));
+ DateTimeFormatComboBox.MarginStart := 10;
+ DateTimeFormatComboBox.MarginEnd := 10;
+ DateTimeFormatComboBox.MarginTop := 2;
+ DateTimeFormatComboBox.MarginBottom := 2;
+ Grid2.AddControl(1, 13, 1, 1, DateTimeFormatLabel);
+ Grid2.AddControl(2, 13, 2, 1, DateTimeFormatComboBox);
// ********* PAGE Panels
@@ -331,349 +368,612 @@ begin
PanelsPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
PanelsLabel2 := TGTKLabel.Create(Self);
PanelsLabel2.XAlign := 0;
- PanelsLabel2.XPadding := 10;
+ PanelsLabel2.MarginStart := 10;
+ PanelsLabel2.MarginEnd := 10;
PanelsLabel2.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesFeatures]);
PanelsLabel2.UseMarkup := True;
PanelsPage.AddControlEx(PanelsLabel2, False, False, 5);
- Table5 := TGTKTable.Create(Self);
- Table5.SetRowColCount(19, 2);
- PanelsPage.AddControlEx(Table5, False, False, 0);
+ Grid5 := TGTKGrid.Create(Self);
+ PanelsPage.AddControlEx(Grid5, False, False, 0);
DisableMouseRename := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_DisableMouseRenaming);
DisableMouseRename.Tooltip := LANGPreferencesDisableMouseRename_Tooltip;
- Table5.AddControl(0, 0, 2, 1, DisableMouseRename, 30, 2);
+ DisableMouseRename.MarginStart := 30;
+ DisableMouseRename.MarginEnd := 30;
+ DisableMouseRename.MarginTop := 2;
+ DisableMouseRename.MarginBottom := 2;
QuickRenameSkipExtCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_QuickRenameSkipExtCheckBox);
QuickRenameSkipExtCheckBox.Tooltip := LANGPreferences_QuickRenameSkipExtCheckBox_Tooltip;
- Table5.AddControl(0, 1, 2, 1, QuickRenameSkipExtCheckBox, 30, 2);
+ QuickRenameSkipExtCheckBox.MarginStart := 30;
+ QuickRenameSkipExtCheckBox.MarginEnd := 30;
+ QuickRenameSkipExtCheckBox.MarginTop := 2;
+ QuickRenameSkipExtCheckBox.MarginBottom := 2;
RightClickSelectCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_RightClickSelectCheckBox);
RightClickSelectCheckBox.Tooltip := LANGPreferences_RightClickSelectCheckBox_Tooltip;
- Table5.AddControl(0, 2, 2, 1, RightClickSelectCheckBox, 30, 2);
+ RightClickSelectCheckBox.MarginStart := 30;
+ RightClickSelectCheckBox.MarginEnd := 30;
+ RightClickSelectCheckBox.MarginTop := 2;
+ RightClickSelectCheckBox.MarginBottom := 2;
DisableFileTipsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesDisableFileTipsCheckBox_Caption);
DisableFileTipsCheckBox.Tooltip := LANGPreferencesDisableFileTipsCheckBox_Tooltip;
- Table5.AddControl(0, 3, 2, 1, DisableFileTipsCheckBox, 30, 2);
+ DisableFileTipsCheckBox.MarginStart := 30;
+ DisableFileTipsCheckBox.MarginEnd := 30;
+ DisableFileTipsCheckBox.MarginTop := 2;
+ DisableFileTipsCheckBox.MarginBottom := 2;
SortDirectoriesLikeFilesCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_SortDirectoriesLikeFilesCheckBox);
SortDirectoriesLikeFilesCheckBox.Tooltip := LANGPreferences_SortDirectoriesLikeFilesCheckBox_Tooltip;
- Table5.AddControl(0, 4, 2, 1, SortDirectoriesLikeFilesCheckBox, 30, 2);
- Table5.AddControl(0, 5, 2, 1, TGTKVBox.Create(Self), 0, 7);
+ SortDirectoriesLikeFilesCheckBox.MarginStart := 30;
+ SortDirectoriesLikeFilesCheckBox.MarginEnd := 30;
+ SortDirectoriesLikeFilesCheckBox.MarginTop := 2;
+ SortDirectoriesLikeFilesCheckBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 7;
+ VBox.MarginBottom := 7;
+ Grid5.AddControl(0, 0, 2, 1, DisableMouseRename);
+ Grid5.AddControl(0, 1, 2, 1, QuickRenameSkipExtCheckBox);
+ Grid5.AddControl(0, 2, 2, 1, RightClickSelectCheckBox);
+ Grid5.AddControl(0, 3, 2, 1, DisableFileTipsCheckBox);
+ Grid5.AddControl(0, 4, 2, 1, SortDirectoriesLikeFilesCheckBox);
+ Grid5.AddControl(0, 5, 2, 1, VBox);
PanelsLabel3 := TGTKLabel.Create(Self);
- PanelsLabel3.XAlign := 0;
- PanelsLabel3.XPadding := 0;
PanelsLabel3.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesShow]);
PanelsLabel3.UseMarkup := True;
- Table5.AddControl(0, 6, 2, 1, PanelsLabel3, 10, 2);
+ PanelsLabel3.XAlign := 0;
+ PanelsLabel3.MarginStart := 10;
+ PanelsLabel3.MarginEnd := 10;
+ PanelsLabel3.MarginTop := 2;
+ PanelsLabel3.MarginBottom := 2;
+ Grid5.AddControl(0, 6, 2, 1, PanelsLabel3);
ShowFiletypeIcons := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_ShowFiletypeIconsInList);
- Table5.AddControl(0, 7, 2, 1, ShowFiletypeIcons, 30, 2);
+ ShowFiletypeIcons.MarginStart := 30;
+ ShowFiletypeIcons.MarginEnd := 30;
+ ShowFiletypeIcons.MarginTop := 2;
+ ShowFiletypeIcons.MarginBottom := 2;
DirsInBoldCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesDirsInBoldCheckBox_Caption);
- Table5.AddControl(0, 8, 2, 1, DirsInBoldCheckBox, 30, 2);
+ DirsInBoldCheckBox.MarginStart := 30;
+ DirsInBoldCheckBox.MarginEnd := 30;
+ DirsInBoldCheckBox.MarginTop := 2;
+ DirsInBoldCheckBox.MarginBottom := 2;
DisableDirectoryBracketsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesDisableDirectoryBracketsCheckBox_Caption);
- Table5.AddControl(0, 9, 2, 1, DisableDirectoryBracketsCheckBox, 30, 2);
+ DisableDirectoryBracketsCheckBox.MarginStart := 30;
+ DisableDirectoryBracketsCheckBox.MarginEnd := 30;
+ DisableDirectoryBracketsCheckBox.MarginTop := 2;
+ DisableDirectoryBracketsCheckBox.MarginBottom := 2;
OctalPermissionsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesOctalPermissionsCheckBox_Caption);
OctalPermissionsCheckBox.Tooltip := LANGPreferencesOctalPermissionsCheckBox_Tooltip;
- Table5.AddControl(0, 10, 2, 1, OctalPermissionsCheckBox, 30, 2);
+ OctalPermissionsCheckBox.MarginStart := 30;
+ OctalPermissionsCheckBox.MarginEnd := 30;
+ OctalPermissionsCheckBox.MarginTop := 2;
+ OctalPermissionsCheckBox.MarginBottom := 2;
ShowTextUIDsCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGShowTextUIDsCheckBox_Caption);
ShowTextUIDsCheckBox.Tooltip := LANGShowTextUIDsCheckBox_Tooltip;
- Table5.AddControl(0, 11, 2, 1, ShowTextUIDsCheckBox, 30, 2);
- Table5.AddControl(0, 12, 2, 1, TGTKVBox.Create(Self), 0, 7);
+ ShowTextUIDsCheckBox.MarginStart := 30;
+ ShowTextUIDsCheckBox.MarginEnd := 30;
+ ShowTextUIDsCheckBox.MarginTop := 2;
+ ShowTextUIDsCheckBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 7;
+ VBox.MarginBottom := 7;
+ Grid5.AddControl(0, 7, 2, 1, ShowFiletypeIcons);
+ Grid5.AddControl(0, 8, 2, 1, DirsInBoldCheckBox);
+ Grid5.AddControl(0, 9, 2, 1, DisableDirectoryBracketsCheckBox);
+ Grid5.AddControl(0, 10, 2, 1, OctalPermissionsCheckBox);
+ Grid5.AddControl(0, 11, 2, 1, ShowTextUIDsCheckBox);
+ Grid5.AddControl(0, 12, 2, 1, VBox);
PanelsLabel4 := TGTKLabel.Create(Self);
- PanelsLabel4.XAlign := 0;
- PanelsLabel4.XPadding := 0;
PanelsLabel4.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesMovement]);
PanelsLabel4.UseMarkup := True;
- Table5.AddControl(0, 13, 2, 1, PanelsLabel4, 10, 2);
+ PanelsLabel4.XAlign := 0;
+ PanelsLabel4.MarginStart := 10;
+ PanelsLabel4.MarginEnd := 10;
+ PanelsLabel4.MarginTop := 2;
+ PanelsLabel4.MarginBottom := 2;
+ Grid5.AddControl(0, 13, 2, 1, PanelsLabel4);
LynxLikeMotionCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesLynxLikeMotionCheckBox_Caption);
- Table5.AddControl(0, 14, 2, 1, LynxLikeMotionCheckBox, 30, 2);
+ LynxLikeMotionCheckBox.MarginStart := 30;
+ LynxLikeMotionCheckBox.MarginEnd := 30;
+ LynxLikeMotionCheckBox.MarginTop := 2;
+ LynxLikeMotionCheckBox.MarginBottom := 2;
InsertMovesDownCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesInsertMovesDownCheckBox_Caption);
- Table5.AddControl(0, 15, 2, 1, InsertMovesDownCheckBox, 30, 2);
+ InsertMovesDownCheckBox.MarginStart := 30;
+ InsertMovesDownCheckBox.MarginEnd := 30;
+ InsertMovesDownCheckBox.MarginTop := 2;
+ InsertMovesDownCheckBox.MarginBottom := 2;
SpaceMovesDownCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesSpaceMovesDownCheckBox_Caption);
- Table5.AddControl(0, 16, 2, 1, SpaceMovesDownCheckBox, 30, 2);
+ SpaceMovesDownCheckBox.MarginStart := 30;
+ SpaceMovesDownCheckBox.MarginEnd := 30;
+ SpaceMovesDownCheckBox.MarginTop := 2;
+ SpaceMovesDownCheckBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid5.AddControl(0, 14, 2, 1, LynxLikeMotionCheckBox);
+ Grid5.AddControl(0, 15, 2, 1, InsertMovesDownCheckBox);
+ Grid5.AddControl(0, 16, 2, 1, SpaceMovesDownCheckBox);
+ Grid5.AddControl(0, 17, 2, 1, VBox);
QuickSearchLabel := TGTKLabel.Create(Self);
QuickSearchLabel.Caption := LANGPreferences_QuickSearchLabel_Caption;
- QuickSearchLabel.XAlign := 0;
QuickSearchLabel.UseUnderline := True;
- QuickSearchOptionMenu := TGTKOptionMenu.Create(Self);
- QuickSearchOptionMenu.Tooltip := LANGPreferences_QuickSearchOptionMenu_Tooltip;
- QuickSearchLabel.FocusControl := QuickSearchOptionMenu;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := LANGPreferences_QuickSearch_Option1;
- QuickSearchOptionMenu.Items.Add(Item);
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := LANGPreferences_QuickSearch_Option2;
- QuickSearchOptionMenu.Items.Add(Item);
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := LANGPreferences_QuickSearch_Option3;
- QuickSearchOptionMenu.Items.Add(Item);
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := LANGPreferences_QuickSearch_Option4;
- QuickSearchOptionMenu.Items.Add(Item);
- Table5.AddControl(0, 17, 2, 1, TGTKVBox.Create(Self), 0, 2);
- Table5.AddControlEx(0, 18, 1, 1, QuickSearchLabel, [taoShrink], [taoShrink], 35, 2);
- Table5.AddControlEx(1, 18, 1, 1, QuickSearchOptionMenu, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 20, 2);
+ QuickSearchLabel.XAlign := 0;
+ QuickSearchLabel.MarginStart := 35;
+ QuickSearchLabel.MarginEnd := 35;
+ QuickSearchLabel.MarginTop := 2;
+ QuickSearchLabel.MarginBottom := 2;
+ QuickSearchComboBox := TGTKComboBoxText.Create(Self);
+ QuickSearchComboBox.Tooltip := LANGPreferences_QuickSearchOptionMenu_Tooltip;
+ QuickSearchLabel.FocusControl := QuickSearchComboBox;
+ QuickSearchComboBox.AppendItem(LANGPreferences_QuickSearch_Option1);
+ QuickSearchComboBox.AppendItem(LANGPreferences_QuickSearch_Option2);
+ QuickSearchComboBox.AppendItem(LANGPreferences_QuickSearch_Option3);
+ QuickSearchComboBox.AppendItem(LANGPreferences_QuickSearch_Option4);
+ QuickSearchComboBox.MarginStart := 20;
+ QuickSearchComboBox.MarginEnd := 20;
+ QuickSearchComboBox.MarginTop := 2;
+ QuickSearchComboBox.MarginBottom := 2;
+ Grid5.AddControl(0, 18, 1, 1, QuickSearchLabel);
+ Grid5.AddControl(1, 18, 1, 1, QuickSearchComboBox);
// ********* PAGE Applications
ApplicationsPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
- Table1 := TGTKTable.Create(Self);
- Table1.SetRowColCount(5, 5);
- ApplicationsPage.AddControlEx(Table1, False, True, 5);
+ Grid1 := TGTKGrid.Create(Self);
+ ApplicationsPage.AddControlEx(Grid1, False, True, 5);
ViewerLabel := TGTKLabel.Create(Self);
ViewerLabel.XAlign := 0;
- ViewerLabel.XPadding := 10;
+ ViewerLabel.MarginStart := 10;
+ ViewerLabel.MarginEnd := 10;
ViewerLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesViewer]);
ViewerLabel.UseMarkup := True;
- Table1.AddControlEx(0, 0, 5, 1, ViewerLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- Table1.AddControlEx(0, 1, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 0, 5, 1, ViewerLabel);
+ Grid1.AddControl(0, 1, 5, 1, VBox);
- ViewerCombo := TGTKCombo.Create(Self);
+ ViewerCommandComboBox := TGTKComboBoxEntry.Create(Self);
for i := 1 to Length(ConfViewersApps) do
- ViewerCombo.Items.Append(ConfViewersApps[i]);
+ ViewerCommandComboBox.AppendItem(ConfViewersApps[i]);
+ ViewerCommandComboBox.MarginStart := 10;
+ ViewerCommandComboBox.MarginEnd := 10;
+ ViewerCommandComboBox.MarginTop := 2;
+ ViewerCommandComboBox.MarginBottom := 2;
ViewerBrowseButton := TGTKButton.Create(Self);
ViewerBrowseButton.Caption := Format(' %s ', [LANGBrowseButton_Caption]);
ViewerBrowseButton.OnClick := @ViewerBrowseButtonClick;
+ ViewerBrowseButton.MarginStart := 10;
+ ViewerBrowseButton.MarginEnd := 10;
+ ViewerBrowseButton.MarginTop := 2;
+ ViewerBrowseButton.MarginBottom := 2;
ViewerLabel2 := TGTKLabel.Create(Self);
ViewerLabel2.Caption := LANGPreferencesCommandSC;
- ViewerLabel2.XAlign := 0;
- ViewerLabel2.FocusControl := ViewerCombo.Entry;
+ ViewerLabel2.FocusControl := ViewerCommandComboBox.Entry;
ViewerLabel2.UseUnderline := True;
+ ViewerLabel2.XAlign := 0;
+ ViewerLabel2.MarginTop := 2;
+ ViewerLabel2.MarginBottom := 2;
UseInternalViewerCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesUseInternalViewer);
UseInternalViewerCheckBox.OnToggled := @UseInternalViewerCheckBoxToggled;
- ViewerOptionMenu := TGTKOptionMenu.Create(Self);
- miViewerTerminalDetect := TGTKMenuItem.CreateTyped(Self, itLabel);
- miViewerTerminalDetect.Caption := LANGPreferencesAutodetectXApp;
- miViewerAlwaysTerminal := TGTKMenuItem.CreateTyped(Self, itLabel);
- miViewerAlwaysTerminal.Caption := LANGPreferencesAlwaysRunInTerminal;
- miViewerNoTerminal := TGTKMenuItem.CreateTyped(Self, itLabel);
- miViewerNoTerminal.Caption := LANGPreferencesNeverRunInTerminal;
- ViewerOptionMenu.Items.Add(miViewerTerminalDetect);
- ViewerOptionMenu.Items.Add(miViewerAlwaysTerminal);
- ViewerOptionMenu.Items.Add(miViewerNoTerminal);
-
- Table1.AddControlEx(0, 2, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 12, 2);
- Table1.AddControlEx(1, 2, 1, 1, ViewerLabel2, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table1.AddControlEx(2, 2, 3, 1, ViewerCombo, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table1.AddControlEx(4, 3, 1, 1, ViewerBrowseButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table1.AddControlEx(3, 3, 1, 1, ViewerOptionMenu, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table1.AddControlEx(0, 4, 5, 1, UseInternalViewerCheckBox, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 30, 2);
+ UseInternalViewerCheckBox.MarginStart := 30;
+ UseInternalViewerCheckBox.MarginEnd := 30;
+ UseInternalViewerCheckBox.MarginTop := 2;
+ UseInternalViewerCheckBox.MarginBottom := 2;
+ ViewerX11AppComboBox := TGTKComboBoxText.Create(Self);
+ ViewerX11AppComboBox.AppendItem(LANGPreferencesAutodetectXApp);
+ ViewerX11AppComboBox.AppendItem(LANGPreferencesAlwaysRunInTerminal);
+ ViewerX11AppComboBox.AppendItem(LANGPreferencesNeverRunInTerminal);
+ ViewerX11AppComboBox.MarginStart := 10;
+ ViewerX11AppComboBox.MarginEnd := 10;
+ ViewerX11AppComboBox.MarginTop := 2;
+ ViewerX11AppComboBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 12;
+ VBox.MarginEnd := 12;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 2, 1, 1, VBox);
+ Grid1.AddControl(1, 2, 1, 1, ViewerLabel2);
+ Grid1.AddControl(2, 2, 3, 1, ViewerCommandComboBox);
+ Grid1.AddControl(4, 3, 1, 1, ViewerBrowseButton);
+ Grid1.AddControl(3, 3, 1, 1, ViewerX11AppComboBox);
+ Grid1.AddControl(0, 4, 5, 1, UseInternalViewerCheckBox);
EditorLabel := TGTKLabel.Create(Self);
- EditorLabel.XAlign := 0;
- EditorLabel.XPadding := 10;
EditorLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesEditor]);
EditorLabel.UseMarkup := True;
- Table1.AddControlEx(0, 5, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 13);
- Table1.AddControlEx(0, 6, 5, 1, EditorLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- Table1.AddControlEx(0, 7, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
-
- EditorCombo := TGTKCombo.Create(Self);
+ EditorLabel.XAlign := 0;
+ EditorLabel.MarginStart := 10;
+ EditorLabel.MarginEnd := 10;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 13;
+ VBox.MarginBottom := 13;
+ Grid1.AddControl(0, 5, 5, 1, VBox);
+ Grid1.AddControl(0, 6, 5, 1, EditorLabel);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 7, 5, 1, VBox);
+
+ EditorCommandComboBox := TGTKComboBoxEntry.Create(Self);
for i := 1 to Length(ConfEditorApps) do
- EditorCombo.Items.Append(ConfEditorApps[i]);
+ EditorCommandComboBox.AppendItem(ConfEditorApps[i]);
+ EditorCommandComboBox.MarginStart := 10;
+ EditorCommandComboBox.MarginEnd := 10;
+ EditorCommandComboBox.MarginTop := 2;
+ EditorCommandComboBox.MarginBottom := 2;
EditorBrowseButton := TGTKButton.Create(Self);
EditorBrowseButton.Caption := Format(' %s ', [LANGBrowseButton_Caption]);
EditorBrowseButton.OnClick := @ViewerBrowseButtonClick;
+ EditorBrowseButton.MarginStart := 10;
+ EditorBrowseButton.MarginEnd := 10;
+ EditorBrowseButton.MarginTop := 2;
+ EditorBrowseButton.MarginBottom := 2;
EditorLabel2 := TGTKLabel.Create(Self);
EditorLabel2.Caption := LANGPreferencesCommandSC;
- EditorLabel2.XAlign := 0;
- EditorLabel2.FocusControl := EditorCombo.Entry;
+ EditorLabel2.FocusControl := EditorCommandComboBox.Entry;
EditorLabel2.UseUnderline := True;
- EditorOptionMenu := TGTKOptionMenu.Create(Self);
- miEditorTerminalDetect := TGTKMenuItem.CreateTyped(Self, itLabel);
- miEditorTerminalDetect.Caption := LANGPreferencesAutodetectXApp;
- miEditorAlwaysTerminal := TGTKMenuItem.CreateTyped(Self, itLabel);
- miEditorAlwaysTerminal.Caption := LANGPreferencesAlwaysRunInTerminal;
- miEditorNoTerminal := TGTKMenuItem.CreateTyped(Self, itLabel);
- miEditorNoTerminal.Caption := LANGPreferencesNeverRunInTerminal;
- EditorOptionMenu.Items.Add(miEditorTerminalDetect);
- EditorOptionMenu.Items.Add(miEditorAlwaysTerminal);
- EditorOptionMenu.Items.Add(miEditorNoTerminal);
-
- Table1.AddControlEx(0, 8, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 12, 2);
- Table1.AddControlEx(1, 8, 1, 1, EditorLabel2, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table1.AddControlEx(2, 8, 3, 1, EditorCombo, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table1.AddControlEx(4, 9, 1, 1, EditorBrowseButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table1.AddControlEx(3, 9, 1, 1, EditorOptionMenu, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ EditorLabel2.XAlign := 0;
+ EditorLabel2.MarginTop := 2;
+ EditorLabel2.MarginBottom := 2;
+ EditorX11AppComboBox := TGTKComboBoxText.Create(Self);
+ EditorX11AppComboBox.AppendItem(LANGPreferencesAutodetectXApp);
+ EditorX11AppComboBox.AppendItem(LANGPreferencesAlwaysRunInTerminal);
+ EditorX11AppComboBox.AppendItem(LANGPreferencesNeverRunInTerminal);
+ EditorX11AppComboBox.MarginStart := 10;
+ EditorX11AppComboBox.MarginEnd := 10;
+ EditorX11AppComboBox.MarginTop := 2;
+ EditorX11AppComboBox.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 12;
+ VBox.MarginEnd := 12;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 8, 1, 1, VBox);
+ Grid1.AddControl(1, 8, 1, 1, EditorLabel2);
+ Grid1.AddControl(2, 8, 3, 1, EditorCommandComboBox);
+ Grid1.AddControl(4, 9, 1, 1, EditorBrowseButton);
+ Grid1.AddControl(3, 9, 1, 1, EditorX11AppComboBox);
TerminalLabel := TGTKLabel.Create(Self);
- TerminalLabel.XAlign := 0;
- TerminalLabel.XPadding := 10;
TerminalLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesTerminal]);
TerminalLabel.UseMarkup := True;
- Table1.AddControlEx(0, 10, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 13);
- Table1.AddControlEx(0, 11, 5, 1, TerminalLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- Table1.AddControlEx(0, 12, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
-
- TerminalCombo := TGTKCombo.Create(Self);
+ TerminalLabel.XAlign := 0;
+ TerminalLabel.MarginStart := 10;
+ TerminalLabel.MarginEnd := 10;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 13;
+ VBox.MarginBottom := 13;
+ Grid1.AddControl(0, 10, 5, 1, VBox);
+ Grid1.AddControl(0, 11, 5, 1, TerminalLabel);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 12, 5, 1, VBox);
+
+ TerminalCommandComboBox := TGTKComboBoxEntry.Create(Self);
for i := 1 to Length(ConfTerminalApps) do
- TerminalCombo.Items.Append(ConfTerminalApps[i]);
+ TerminalCommandComboBox.AppendItem(ConfTerminalApps[i]);
+ TerminalCommandComboBox.MarginStart := 10;
+ TerminalCommandComboBox.MarginEnd := 10;
+ TerminalCommandComboBox.MarginTop := 2;
+ TerminalCommandComboBox.MarginBottom := 2;
TerminalBrowseButton := TGTKButton.Create(Self);
TerminalBrowseButton.Caption := Format(' %s ', [LANGBrowseButton_Caption]);
TerminalBrowseButton.OnClick := @ViewerBrowseButtonClick;
+ TerminalBrowseButton.MarginStart := 10;
+ TerminalBrowseButton.MarginEnd := 10;
+ TerminalBrowseButton.MarginTop := 2;
+ TerminalBrowseButton.MarginBottom := 2;
TerminalLabel2 := TGTKLabel.Create(Self);
TerminalLabel2.Caption := LANGPreferencesCommandSC;
TerminalLabel2.XAlign := 0;
- TerminalLabel2.FocusControl := TerminalCombo.Entry;
+ TerminalLabel2.MarginTop := 2;
+ TerminalLabel2.MarginBottom := 2;
+ TerminalLabel2.FocusControl := TerminalCommandComboBox.Entry;
TerminalLabel2.UseUnderline := True;
-
- Table1.AddControlEx(0, 13, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 12, 2);
- Table1.AddControlEx(1, 13, 1, 1, TerminalLabel2, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table1.AddControlEx(2, 13, 3, 1, TerminalCombo, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table1.AddControlEx(4, 14, 1, 1, TerminalBrowseButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ TerminalLabel2.XAlign := 0;
+ TerminalLabel2.MarginTop := 2;
+ TerminalLabel2.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 12;
+ VBox.MarginEnd := 12;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 13, 1, 1, VBox);
+ Grid1.AddControl(1, 13, 1, 1, TerminalLabel2);
+ Grid1.AddControl(2, 13, 3, 1, TerminalCommandComboBox);
+ Grid1.AddControl(4, 14, 1, 1, TerminalBrowseButton);
TempPathLabel := TGTKLabel.Create(Self);
- TempPathLabel.XAlign := 0;
- TempPathLabel.XPadding := 10;
TempPathLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferences_TempPathLabel_Caption]);
TempPathLabel.UseMarkup := True;
- Table1.AddControlEx(0, 15, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 13);
- Table1.AddControlEx(0, 16, 5, 1, TempPathLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- Table1.AddControlEx(0, 17, 5, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ TempPathLabel.XAlign := 0;
+ TempPathLabel.MarginStart := 10;
+ TempPathLabel.MarginEnd := 10;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 13;
+ VBox.MarginBottom := 13;
+ Grid1.AddControl(0, 15, 5, 1, VBox);
+ Grid1.AddControl(0, 16, 5, 1, TempPathLabel);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 17, 5, 1, VBox);
VFSTempPathLabel := TGTKLabel.Create(Self);
VFSTempPathLabel.Caption := LANGPreferences_VFSTempPathLabel_Caption;
- VFSTempPathLabel.XAlign := 0;
VFSTempPathLabel.UseUnderline := True;
+ VFSTempPathLabel.XAlign := 0;
+ VFSTempPathLabel.MarginTop := 2;
+ VFSTempPathLabel.MarginBottom := 2;
VFSTempPathEntry := TGTKEntry.Create(Self);
VFSTempPathEntry.Tooltip := LANGPreferences_VFSTempPathEntry_Tooltip;
+ VFSTempPathEntry.MarginStart := 10;
+ VFSTempPathEntry.MarginEnd := 10;
+ VFSTempPathEntry.MarginTop := 2;
+ VFSTempPathEntry.MarginBottom := 2;
VFSTempPathLabel.FocusControl := VFSTempPathEntry;
- Table1.AddControlEx(0, 18, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 12, 2);
- Table1.AddControlEx(1, 18, 1, 1, VFSTempPathLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
- Table1.AddControlEx(2, 18, 4, 1, VFSTempPathEntry, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 12;
+ VBox.MarginEnd := 12;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 18, 1, 1, VBox);
+ Grid1.AddControl(1, 18, 1, 1, VFSTempPathLabel);
+ Grid1.AddControl(2, 18, 4, 1, VFSTempPathEntry);
// ********* PAGE Fonts
FontsPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
FontsLabel2 := TGTKLabel.Create(Self);
- FontsLabel2.XAlign := 0;
- FontsLabel2.XPadding := 10;
FontsLabel2.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferences_FontsPage]);
FontsLabel2.UseMarkup := True;
+ FontsLabel2.XAlign := 0;
+ FontsLabel2.MarginStart := 10;
+ FontsLabel2.MarginEnd := 10;
FontsPage.AddControlEx(FontsLabel2, False, False, 5);
- Table3 := TGTKTable.Create(Self);
- Table3.SetRowColCount(2, 4);
- FontsPage.AddControlEx(Table3, False, False, 0);
+ Grid3 := TGTKGrid.Create(Self);
+ FontsPage.AddControlEx(Grid3, False, False, 0);
ListFontLabel := TGTKLabel.Create(Self);
ListFontLabel.Caption := LANGPreferences_ListFont;
ListFontLabel.XAlign := 0;
- ListFontFrame := TGTKFrame.CreateWithoutLabel(Self);
- ListFontFrame.ShadowType := stEtchedIn;
- ListFontPreview := TGTKLabel.Create(Self);
- ListFontPreview.Caption := 'Luxi Sans, 10';
- ListFontFrame.AddControl(ListFontPreview);
- ChangeFontButton := TGTKButton.Create(Self);
- ChangeFontButton.Caption := LANGPreferences_Change;
- ChangeFontButton.OnClick := @ChangeFontButtonClick;
+ ListFontLabel.MarginStart := 5;
+ ListFontLabel.MarginEnd := 5;
+ ListFontLabel.MarginTop := 2;
+ ListFontLabel.MarginBottom := 2;
+ ListFontButton := TGTKFontButton.Create(Self);
+ ListFontButton.OnFontNameChanged := @ListFontButtonFontNameChanged;
+ ListFontButton.MarginStart := 10;
+ ListFontButton.MarginEnd := 10;
+ ListFontButton.MarginTop := 2;
+ ListFontButton.MarginBottom := 2;
DefaultFontCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_UseDefaultFont);
DefaultFontCheckBox.OnToggled := @DefaultFontCheckBoxToggled;
-
- Table3.AddControlEx(0, 0, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 12, 2);
- Table3.AddControlEx(1, 0, 1, 1, ListFontLabel, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table3.AddControlEx(2, 0, 1, 1, ListFontFrame, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 2, 2);
- Table3.AddControlEx(3, 0, 1, 1, ChangeFontButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 2);
- Table3.AddControlEx(1, 1, 3, 1, DefaultFontCheckBox, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 10, 4);
+ DefaultFontCheckBox.MarginStart := 10;
+ DefaultFontCheckBox.MarginEnd := 10;
+ DefaultFontCheckBox.MarginTop := 4;
+ DefaultFontCheckBox.MarginBottom := 4;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 12;
+ VBox.MarginEnd := 12;
+ VBox.MarginTop := 2;
+ Grid3.AddControl(0, 0, 1, 1, VBox);
+ Grid3.AddControl(1, 0, 1, 1, ListFontLabel);
+ Grid3.AddControl(2, 0, 2, 1, ListFontButton);
+ Grid3.AddControl(1, 1, 3, 1, DefaultFontCheckBox);
// ********* PAGE Colors
ColorsPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
ColorsLabel2 := TGTKLabel.Create(Self);
- ColorsLabel2.XAlign := 0;
- ColorsLabel2.XPadding := 10;
ColorsLabel2.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferences_ColorsPage]);
ColorsLabel2.UseMarkup := True;
+ ColorsLabel2.XAlign := 0;
+ ColorsLabel2.MarginStart := 10;
+ ColorsLabel2.MarginEnd := 10;
ColorsPage.AddControlEx(ColorsLabel2, False, False, 5);
- Table4 := TGTKTable.Create(Self);
- Table4.SetRowColCount(7, 8);
- ColorsPage.AddControlEx(Table4, False, False, 0);
+ Grid4 := TGTKGrid.Create(Self);
+ ColorsPage.AddControlEx(Grid4, False, False, 0);
ForegroundLabel := TGTKLabel.Create(Self);
ForegroundLabel.Caption := LANGPreferences_Foreground;
+ ForegroundLabel.MarginStart := 5;
+ ForegroundLabel.MarginEnd := 5;
+ ForegroundLabel.MarginTop := 2;
+ ForegroundLabel.MarginBottom := 2;
BackgroundLabel := TGTKLabel.Create(Self);
BackgroundLabel.Caption := LANGPreferences_Background;
- Table4.AddControl(1, 0, 3, 1, ForegroundLabel, 5, 2);
- Table4.AddControl(4, 0, 3, 1, BackgroundLabel, 5, 2);
+ BackgroundLabel.MarginStart := 5;
+ BackgroundLabel.MarginEnd := 5;
+ BackgroundLabel.MarginTop := 2;
+ BackgroundLabel.MarginBottom := 2;
+ Grid4.AddControl(1, 0, 3, 1, ForegroundLabel);
+ Grid4.AddControl(4, 0, 3, 1, BackgroundLabel);
NormalItemFGColorLabel := TGTKLabel.Create(Self);
- NormalItemFGColorLabel.XAlign := 0;
NormalItemFGColorLabel.Caption := LANGPreferences_NormalItem;
- NormalItemFGColorButton := TGnomeColorButton.Create(Self);
+ NormalItemFGColorLabel.XAlign := 0;
+ NormalItemFGColorLabel.MarginStart := 30;
+ NormalItemFGColorLabel.MarginEnd := 30;
+ NormalItemFGColorLabel.MarginTop := 2;
+ NormalItemFGColorLabel.MarginBottom := 2;
+ NormalItemFGColorButton := TGTKColorButton.Create(Self);
NormalItemFGColorButton.SetSizeRequest(30, -1);
- NormalItemBGColorButton := TGnomeColorButton.Create(Self);
+ NormalItemFGColorButton.MarginStart := 5;
+ NormalItemFGColorButton.MarginEnd := 5;
+ NormalItemFGColorButton.MarginTop := 2;
+ NormalItemFGColorButton.MarginBottom := 2;
+ NormalItemBGColorButton := TGTKColorButton.Create(Self);
NormalItemBGColorButton.SetSizeRequest(30, -1);
+ NormalItemBGColorButton.MarginStart := 5;
+ NormalItemBGColorButton.MarginEnd := 5;
+ NormalItemBGColorButton.MarginTop := 2;
+ NormalItemBGColorButton.MarginBottom := 2;
NormalItemFGColorDefault := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_Default);
NormalItemFGColorDefault.Tooltip := LANGPreferences_SetToDefaultToUseGTKThemeColors;
NormalItemFGColorDefault.OnToggled := @ColorButtonDefaultsToggled;
- Table4.AddControl(0, 1, 1, 1, NormalItemFGColorLabel, 30, 2);
- Table4.AddControl(2, 1, 1, 1, NormalItemFGColorButton, 5, 2);
- Table4.AddControl(5, 1, 1, 1, NormalItemBGColorButton, 5, 2);
- Table4.AddControl(7, 1, 1, 1, NormalItemFGColorDefault, 10, 2);
+ NormalItemFGColorDefault.MarginStart := 10;
+ NormalItemFGColorDefault.MarginEnd := 10;
+ NormalItemFGColorDefault.MarginTop := 2;
+ NormalItemFGColorDefault.MarginBottom := 2;
+ Grid4.AddControl(0, 1, 1, 1, NormalItemFGColorLabel);
+ Grid4.AddControl(2, 1, 1, 1, NormalItemFGColorButton);
+ Grid4.AddControl(5, 1, 1, 1, NormalItemBGColorButton);
+ Grid4.AddControl(7, 1, 1, 1, NormalItemFGColorDefault);
ActiveItemFGColorLabel := TGTKLabel.Create(Self);
ActiveItemFGColorLabel.Caption := LANGPreferences_Cursor;
ActiveItemFGColorLabel.XAlign := 0;
- ActiveItemFGColorButton := TGnomeColorButton.Create(Self);
- ActiveItemBGColorButton := TGnomeColorButton.Create(Self);
+ ActiveItemFGColorLabel.MarginStart := 30;
+ ActiveItemFGColorLabel.MarginEnd := 30;
+ ActiveItemFGColorLabel.MarginTop := 2;
+ ActiveItemFGColorLabel.MarginBottom := 2;
+ ActiveItemFGColorButton := TGTKColorButton.Create(Self);
+ ActiveItemFGColorButton.MarginStart := 5;
+ ActiveItemFGColorButton.MarginEnd := 5;
+ ActiveItemFGColorButton.MarginTop := 2;
+ ActiveItemFGColorButton.MarginBottom := 2;
+ ActiveItemBGColorButton := TGTKColorButton.Create(Self);
+ ActiveItemBGColorButton.MarginStart := 5;
+ ActiveItemBGColorButton.MarginEnd := 5;
+ ActiveItemBGColorButton.MarginTop := 2;
+ ActiveItemBGColorButton.MarginBottom := 2;
ActiveItemFGColorDefault := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_Default);
ActiveItemFGColorDefault.Tooltip := LANGPreferences_SetToDefaultToUseGTKThemeColors;
ActiveItemFGColorDefault.OnToggled := @ColorButtonDefaultsToggled;
- Table4.AddControl(0, 2, 1, 1, ActiveItemFGColorLabel, 30, 2);
- Table4.AddControl(2, 2, 1, 1, ActiveItemFGColorButton, 5, 2);
- Table4.AddControl(5, 2, 1, 1, ActiveItemBGColorButton, 5, 2);
- Table4.AddControl(7, 2, 1, 1, ActiveItemFGColorDefault, 10, 2);
+ ActiveItemFGColorDefault.MarginStart := 10;
+ ActiveItemFGColorDefault.MarginEnd := 10;
+ ActiveItemFGColorDefault.MarginTop := 2;
+ ActiveItemFGColorDefault.MarginBottom := 2;
+ Grid4.AddControl(0, 2, 1, 1, ActiveItemFGColorLabel);
+ Grid4.AddControl(2, 2, 1, 1, ActiveItemFGColorButton);
+ Grid4.AddControl(5, 2, 1, 1, ActiveItemBGColorButton);
+ Grid4.AddControl(7, 2, 1, 1, ActiveItemFGColorDefault);
InactiveItemFGColorLabel := TGTKLabel.Create(Self);
InactiveItemFGColorLabel.Caption := LANGPreferences_InactiveItem;
InactiveItemFGColorLabel.XAlign := 0;
- InactiveItemFGColorButton := TGnomeColorButton.Create(Self);
- InactiveItemBGColorButton := TGnomeColorButton.Create(Self);
+ InactiveItemFGColorLabel.MarginStart := 30;
+ InactiveItemFGColorLabel.MarginEnd := 30;
+ InactiveItemFGColorLabel.MarginTop := 2;
+ InactiveItemFGColorLabel.MarginBottom := 2;
+ InactiveItemFGColorButton := TGTKColorButton.Create(Self);
+ InactiveItemFGColorButton.MarginStart := 5;
+ InactiveItemFGColorButton.MarginEnd := 5;
+ InactiveItemFGColorButton.MarginTop := 2;
+ InactiveItemFGColorButton.MarginBottom := 2;
+ InactiveItemBGColorButton := TGTKColorButton.Create(Self);
+ InactiveItemBGColorButton.MarginStart := 5;
+ InactiveItemBGColorButton.MarginEnd := 5;
+ InactiveItemBGColorButton.MarginTop := 2;
+ InactiveItemBGColorButton.MarginBottom := 2;
InactiveItemFGColorDefault := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_Default);
InactiveItemFGColorDefault.Tooltip := LANGPreferences_SetToDefaultToUseGTKThemeColors;
InactiveItemFGColorDefault.OnToggled := @ColorButtonDefaultsToggled;
- Table4.AddControl(0, 3, 1, 1, InactiveItemFGColorLabel, 30, 2);
- Table4.AddControl(2, 3, 1, 1, InactiveItemFGColorButton, 5, 2);
- Table4.AddControl(5, 3, 1, 1, InactiveItemBGColorButton, 5, 2);
- Table4.AddControl(7, 3, 1, 1, InactiveItemFGColorDefault, 10, 2);
+ InactiveItemFGColorDefault.MarginStart := 10;
+ InactiveItemFGColorDefault.MarginEnd := 10;
+ InactiveItemFGColorDefault.MarginTop := 2;
+ InactiveItemFGColorDefault.MarginBottom := 2;
+ Grid4.AddControl(0, 3, 1, 1, InactiveItemFGColorLabel);
+ Grid4.AddControl(2, 3, 1, 1, InactiveItemFGColorButton);
+ Grid4.AddControl(5, 3, 1, 1, InactiveItemBGColorButton);
+ Grid4.AddControl(7, 3, 1, 1, InactiveItemFGColorDefault);
SelectedItemFGColorLabel := TGTKLabel.Create(Self);
SelectedItemFGColorLabel.Caption := LANGPreferences_SelectedItem;
SelectedItemFGColorLabel.XAlign := 0;
- SelectedItemFGColorButton := TGnomeColorButton.Create(Self);
- Table4.AddControl(0, 4, 1, 1, SelectedItemFGColorLabel, 30, 2);
- Table4.AddControl(2, 4, 1, 1, SelectedItemFGColorButton, 5, 2);
+ SelectedItemFGColorLabel.MarginStart := 30;
+ SelectedItemFGColorLabel.MarginEnd := 30;
+ SelectedItemFGColorLabel.MarginTop := 2;
+ SelectedItemFGColorLabel.MarginBottom := 2;
+ SelectedItemFGColorButton := TGTKColorButton.Create(Self);
+ SelectedItemFGColorButton.MarginStart := 5;
+ SelectedItemFGColorButton.MarginEnd := 5;
+ SelectedItemFGColorButton.MarginTop := 2;
+ SelectedItemFGColorButton.MarginBottom := 2;
+ Grid4.AddControl(0, 4, 1, 1, SelectedItemFGColorLabel);
+ Grid4.AddControl(2, 4, 1, 1, SelectedItemFGColorButton);
LinkItemFGColorLabel := TGTKLabel.Create(Self);
LinkItemFGColorLabel.Caption := LANGPreferences_LinkItem;
LinkItemFGColorLabel.XAlign := 0;
- LinkItemFGColorButton := TGnomeColorButton.Create(Self);
+ LinkItemFGColorLabel.MarginStart := 30;
+ LinkItemFGColorLabel.MarginEnd := 30;
+ LinkItemFGColorLabel.MarginTop := 2;
+ LinkItemFGColorLabel.MarginBottom := 2;
+ LinkItemFGColorButton := TGTKColorButton.Create(Self);
+ LinkItemFGColorButton.MarginStart := 5;
+ LinkItemFGColorButton.MarginEnd := 5;
+ LinkItemFGColorButton.MarginTop := 2;
+ LinkItemFGColorButton.MarginBottom := 2;
LinkItemFGColorDefault := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_Default);
LinkItemFGColorDefault.Tooltip := LANGPreferences_LinkItemHint;
LinkItemFGColorDefault.OnToggled := @ColorButtonDefaultsToggled;
- Table4.AddControl(0, 5, 1, 1, LinkItemFGColorLabel, 30, 2);
- Table4.AddControl(2, 5, 1, 1, LinkItemFGColorButton, 5, 2);
- Table4.AddControl(7, 5, 1, 1, LinkItemFGColorDefault, 10, 2);
+ LinkItemFGColorDefault.MarginStart := 10;
+ LinkItemFGColorDefault.MarginEnd := 10;
+ LinkItemFGColorDefault.MarginTop := 2;
+ LinkItemFGColorDefault.MarginBottom := 2;
+ Grid4.AddControl(0, 5, 1, 1, LinkItemFGColorLabel);
+ Grid4.AddControl(2, 5, 1, 1, LinkItemFGColorButton);
+ Grid4.AddControl(7, 5, 1, 1, LinkItemFGColorDefault);
DotFileItemFGColorLabel := TGTKLabel.Create(Self);
DotFileItemFGColorLabel.Caption := LANGPreferences_DotFileItem;
DotFileItemFGColorLabel.XAlign := 0;
- DotFileItemFGColorButton := TGnomeColorButton.Create(Self);
+ DotFileItemFGColorLabel.MarginStart := 30;
+ DotFileItemFGColorLabel.MarginEnd := 30;
+ DotFileItemFGColorLabel.MarginTop := 2;
+ DotFileItemFGColorLabel.MarginBottom := 2;
+ DotFileItemFGColorButton := TGTKColorButton.Create(Self);
+ DotFileItemFGColorButton.MarginStart := 5;
+ DotFileItemFGColorButton.MarginEnd := 5;
+ DotFileItemFGColorButton.MarginTop := 2;
+ DotFileItemFGColorButton.MarginBottom := 2;
DotFileItemFGColorDefault := TGTKCheckButton.CreateWithLabel(Self, LANGPreferences_Default);
DotFileItemFGColorDefault.Tooltip := LANGPreferences_DotFileItemHint;
DotFileItemFGColorDefault.OnToggled := @ColorButtonDefaultsToggled;
- Table4.AddControl(0, 6, 1, 1, DotFileItemFGColorLabel, 30, 2);
- Table4.AddControl(2, 6, 1, 1, DotFileItemFGColorButton, 5, 2);
- Table4.AddControl(7, 6, 1, 1, DotFileItemFGColorDefault, 10, 2);
-
- Table4.AddControl(1, 6, 1, 1, TGTKVBox.Create(Self), 2, 2);
- Table4.AddControl(3, 6, 1, 1, TGTKVBox.Create(Self), 2, 2);
- Table4.AddControl(4, 6, 1, 1, TGTKVBox.Create(Self), 2, 2);
- Table4.AddControl(6, 6, 1, 1, TGTKVBox.Create(Self), 2, 2);
+ DotFileItemFGColorDefault.MarginStart := 10;
+ DotFileItemFGColorDefault.MarginEnd := 10;
+ DotFileItemFGColorDefault.MarginTop := 2;
+ DotFileItemFGColorDefault.MarginBottom := 2;
+ Grid4.AddControl(0, 6, 1, 1, DotFileItemFGColorLabel);
+ Grid4.AddControl(2, 6, 1, 1, DotFileItemFGColorButton);
+ Grid4.AddControl(7, 6, 1, 1, DotFileItemFGColorDefault);
+
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 2;
+ VBox.MarginEnd := 2;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid4.AddControl(1, 6, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 2;
+ VBox.MarginEnd := 2;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid4.AddControl(3, 6, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 2;
+ VBox.MarginEnd := 2;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid4.AddControl(4, 6, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 2;
+ VBox.MarginEnd := 2;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid4.AddControl(6, 6, 1, 1, VBox);
// ********* PAGE Experimental
@@ -681,7 +981,8 @@ begin
ExperimentalPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
ExperimentalLabel2 := TGTKLabel.Create(Self);
ExperimentalLabel2.XAlign := 0;
- ExperimentalLabel2.XPadding := 10;
+ ExperimentalLabel2.MarginStart := 10;
+ ExperimentalLabel2.MarginEnd := 10;
ExperimentalLabel2.Caption := Format('<span weight="ultrabold">%s</span>', [LANGPreferencesExperimentalFeatures]);
ExperimentalLabel2.UseMarkup := True;
ExperimentalPage.AddControlEx(ExperimentalLabel2, False, False, 5);
@@ -694,7 +995,7 @@ begin
ExperimentalWarningLabel.LineWrap := True;
ExperimentalWarningLabel.SetSizeRequest(300, -1);
ExperimentalWarningIcon := TGTKImage.Create(Self);
- ExperimentalWarningIcon.SetFromStock('gtk-dialog-warning', isDialog);
+ ExperimentalWarningIcon.SetFromIconName('gtk-dialog-warning', isDialog);
HBox4.AddControlEx(TGTKVBox.Create(Self), False, False, 12);
HBox4.AddControlEx(ExperimentalWarningIcon, False, False, 7);
HBox4.AddControlEx(ExperimentalWarningLabel, True, True, 7);
@@ -702,19 +1003,30 @@ begin
ExperimentalPage.AddControlEx(HBox4, False, False, 5);
ExperimentalPage.AddControlEx(TGTKVBox.Create(Self), False, False, 10);
- Table6 := TGTKTable.Create(Self);
- Table6.SetRowColCount(3, 1);
- ExperimentalPage.AddControlEx(Table6, False, False, 0);
+ Grid6 := TGTKGrid.Create(Self);
+ ExperimentalPage.AddControlEx(Grid6, False, False, 0);
FocusRefreshCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesFocusRefreshCheckBox_Caption);
FocusRefreshCheckBox.Tooltip := LANGPreferencesFocusRefreshCheckBox_Tooltip;
- Table6.AddControl(0, 0, 1, 1, FocusRefreshCheckBox, 30, 2);
+ FocusRefreshCheckBox.MarginStart := 30;
+ FocusRefreshCheckBox.MarginEnd := 30;
+ FocusRefreshCheckBox.MarginTop := 2;
+ FocusRefreshCheckBox.MarginBottom := 2;
+ Grid6.AddControl(0, 0, 1, 1, FocusRefreshCheckBox);
WMCompatModeCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesWMCompatModeCheckBox_Caption);
WMCompatModeCheckBox.Tooltip := LANGPreferencesWMCompatModeCheckBox_Tooltip;
- Table6.AddControl(0, 1, 1, 1, WMCompatModeCheckBox, 30, 2);
+ WMCompatModeCheckBox.MarginStart := 30;
+ WMCompatModeCheckBox.MarginEnd := 30;
+ WMCompatModeCheckBox.MarginTop := 2;
+ WMCompatModeCheckBox.MarginBottom := 2;
+ Grid6.AddControl(0, 1, 1, 1, WMCompatModeCheckBox);
CompatUseLibcSystemCheckBox := TGTKCheckButton.CreateWithLabel(Self, LANGPreferencesCompatUseLibcSystemCheckBox_Caption);
CompatUseLibcSystemCheckBox.Tooltip := LANGPreferencesCompatUseLibcSystemCheckBox_Tooltip;
- Table6.AddControl(0, 2, 1, 1, CompatUseLibcSystemCheckBox, 30, 2);
+ CompatUseLibcSystemCheckBox.MarginStart := 30;
+ CompatUseLibcSystemCheckBox.MarginEnd := 30;
+ CompatUseLibcSystemCheckBox.MarginTop := 2;
+ CompatUseLibcSystemCheckBox.MarginBottom := 2;
+ Grid6.AddControl(0, 2, 1, 1, CompatUseLibcSystemCheckBox);
// ******************
@@ -724,7 +1036,7 @@ end;
procedure TFPreferences.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
-// if Key = GDK_ESCAPE then ModalResult := mbCancel;
+// if Key = GDK_KEY_Escape then ModalResult := mbCancel;
end;
procedure TFPreferences.FormDestroy(Sender: TObject);
@@ -732,33 +1044,27 @@ begin
end;
-procedure TFPreferences.DateTimeFormatOptionMenuChanged(Sender: TObject);
-var Item: TGTKMenuItem;
- OldIndex: integer;
+procedure TFPreferences.DateTimeFormatComboBoxChanged(Sender: TObject);
+var OldIndex: integer;
begin
- CustomTimeFormatEntry.Enabled := TimeFormatOptionMenu.ItemIndex = TimeFormatOptionMenu.Items.Count - 1;
- CustomDateFormatEntry.Enabled := DateFormatOptionMenu.ItemIndex = DateFormatOptionMenu.Items.Count - 1;
-
- OldIndex := DateTimeFormatOptionMenu.ItemIndex;
- DateTimeFormatOptionMenu.Items.Clear;
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := FormatDate(FormatTime, True, True, TimeFormatOptionMenu.ItemIndex, DateFormatOptionMenu.ItemIndex, 0, CustomDateFormatEntry.Text, CustomTimeFormatEntry.Text);
- DateTimeFormatOptionMenu.Items.Add(Item);
- Item := TGTKMenuItem.CreateTyped(Self, itLabel);
- Item.Caption := FormatDate(FormatTime, True, True, TimeFormatOptionMenu.ItemIndex, DateFormatOptionMenu.ItemIndex, 1, CustomDateFormatEntry.Text, CustomTimeFormatEntry.Text);
- DateTimeFormatOptionMenu.Items.Add(Item);
- DateTimeFormatOptionMenu.ItemIndex := OldIndex;
+ CustomTimeFormatEntry.Enabled := TimeFormatComboBox.ItemIndex = 12;
+ CustomDateFormatEntry.Enabled := DateFormatComboBox.ItemIndex = 15;
+
+ OldIndex := DateTimeFormatComboBox.ItemIndex;
+ DateTimeFormatComboBox.ClearItems;
+ DateTimeFormatComboBox.AppendItem(FormatDate(FormatTime, True, True, TimeFormatComboBox.ItemIndex, DateFormatComboBox.ItemIndex, 0, CustomDateFormatEntry.Text, CustomTimeFormatEntry.Text));
+ DateTimeFormatComboBox.AppendItem(FormatDate(FormatTime, True, True, TimeFormatComboBox.ItemIndex, DateFormatComboBox.ItemIndex, 1, CustomDateFormatEntry.Text, CustomTimeFormatEntry.Text));
+ DateTimeFormatComboBox.ItemIndex := OldIndex;
end;
(********************************************************************************************************************************)
procedure TFPreferences.ViewerBrowseButtonClick(Sender: TObject);
procedure BrowseForFile(ToControl: TGTKEntry);
- var Dialog: TGTKFileSelectionDialog;
+ var Dialog: TGTKFileChooserDialog;
begin
- Dialog := TGTKFileSelectionDialog.CreateWithTitle(Self, LANGPreferences_BrowseForApplication);
+ Dialog := TGTKFileChooserDialog.CreateWithTitle(Self, LANGPreferences_BrowseForApplication);
try
- Dialog.ShowFileOpButtons := False;
Dialog.FileName := ToControl.Text;
if Byte(Dialog.Run) = 251 then ToControl.Text := Dialog.FileName;
finally
@@ -767,54 +1073,28 @@ procedure TFPreferences.ViewerBrowseButtonClick(Sender: TObject);
end;
begin
- if Sender = ViewerBrowseButton then BrowseForFile(ViewerCombo.Entry)
- else if Sender = EditorBrowseButton then BrowseForFile(EditorCombo.Entry)
- else if Sender = TerminalBrowseButton then BrowseForFile(TerminalCombo.Entry);
+ if Sender = ViewerBrowseButton then BrowseForFile(ViewerCommandComboBox.Entry)
+ else if Sender = EditorBrowseButton then BrowseForFile(EditorCommandComboBox.Entry)
+ else if Sender = TerminalBrowseButton then BrowseForFile(TerminalCommandComboBox.Entry);
end;
procedure TFPreferences.DefaultFontCheckBoxToggled(Sender: TObject);
var FontDesc: PPangoFontDescription;
begin
ListFontLabel.Enabled := not DefaultFontCheckBox.Checked;
- ChangeFontButton.Enabled := not DefaultFontCheckBox.Checked;
- ListFontFrame.Enabled := not DefaultFontCheckBox.Checked;
- if DefaultFontCheckBox.Checked then begin
- gtk_widget_modify_font(ListFontPreview.FWidget, nil);
- ListFontPreview.Caption := Format(LANGPreferences_DefaultS, [DefaultGTKFont]);
- end else begin
- FontDesc := pango_font_description_from_string(PChar(LocalListFont));
- gtk_widget_modify_font(ListFontPreview.FWidget, FontDesc);
- ListFontPreview.Caption := LocalListFont;
- end;
+ ListFontButton.Enabled := not DefaultFontCheckBox.Checked;
+ if ListFontButton.Enabled then ListFontButton.FontName := LocalListFont
+ else ListFontButton.FontName := DefaultGTKFont;
end;
-procedure TFPreferences.ChangeFontButtonClick(Sender: TObject);
-
- procedure ChangeFont(ToControl: TGTKLabel);
- var Dialog: TGTKFontSelectionDialog;
- FontDesc: PPangoFontDescription;
- begin
- Dialog := TGTKFontSelectionDialog.CreateWithTitle(Self, LANGPreferences_SelectFont);
- try
- Dialog.FontName := ToControl.Caption;
- if Byte(Dialog.Run) = 251 then begin
- ToControl.Caption := Dialog.FontName;
- FontDesc := pango_font_description_from_string(PChar(Dialog.FontName));
- gtk_widget_modify_font(ToControl.FWidget, FontDesc);
-// g_object_unref(FontDesc); // *** - cannot unref, causes SIGSEGV
- LocalListFont := Dialog.FontName;
- end;
- finally
- Dialog.Free;
- end;
- end;
-
+procedure TFPreferences.ListFontButtonFontNameChanged(Sender: TObject);
begin
- if Sender = ChangeFontButton then ChangeFont(ListFontPreview);
+ if ListFontButton.Enabled then LocalListFont := ListFontButton.FontName;
end;
procedure TFPreferences.ColorButtonDefaultsToggled(Sender: TObject);
begin
+{
if NormalItemFGColorDefault.Checked then NormalItemFGColorButton.SetDefaultColor
else NormalItemFGColorButton.UnsetDefaultColor;
if NormalItemFGColorDefault.Checked then NormalItemBGColorButton.SetDefaultColor
@@ -831,6 +1111,7 @@ begin
else LinkItemFGColorButton.UnsetDefaultColor;
if DotFileItemFGColorDefault.Checked then DotFileItemFGColorButton.SetDefaultColor
else DotFileItemFGColorButton.UnsetDefaultColor;
+}
end;
procedure TFPreferences.DefaultRowHeightCheckBoxToggled(Sender: TObject);
@@ -841,15 +1122,14 @@ end;
procedure TFPreferences.UseInternalViewerCheckBoxToggled(Sender: TObject);
begin
- ViewerCombo.Enabled := not UseInternalViewerCheckBox.Checked;
+ ViewerCommandComboBox.Enabled := not UseInternalViewerCheckBox.Checked;
ViewerLabel2.Enabled := not UseInternalViewerCheckBox.Checked;
ViewerBrowseButton.Enabled := not UseInternalViewerCheckBox.Checked;
- ViewerOptionMenu.Enabled := not UseInternalViewerCheckBox.Checked;
+ ViewerX11AppComboBox.Enabled := not UseInternalViewerCheckBox.Checked;
end;
(********************************************************************************************************************************)
procedure TFPreferences.AssignDefaultValues;
-var AColor: TGDKColor;
begin
DefaultGTKFont := pango_font_description_to_string(pango_context_get_font_description(gtk_widget_get_pango_context(FWidget)));
LocalListFont := ConfPanelFont;
@@ -864,29 +1144,29 @@ begin
ClearROAttr.Checked := ConfClearReadOnlyAttr;
DisableMouseRename.Checked := ConfDisableMouseRename;
ShowFiletypeIcons.Checked := ConfUseFileTypeIcons;
- ViewerCombo.Entry.Text := StrToUTF8(ConfViewer);
- EditorCombo.Entry.Text := StrToUTF8(ConfEditor);
- TerminalCombo.Entry.Text := StrToUTF8(ConfTerminalCommand);
+ ViewerCommandComboBox.Entry.Text := StrToUTF8(ConfViewer);
+ EditorCommandComboBox.Entry.Text := StrToUTF8(ConfEditor);
+ TerminalCommandComboBox.Entry.Text := StrToUTF8(ConfTerminalCommand);
DefaultFontCheckBox.Checked := ConfUseSystemFont;
- if not StringToGDKColor(ConfNormalItemFGColor, AColor) then StringToGDKColor(ConfDefaultNormalItemFGColor, AColor);
- NormalItemFGColorButton.Color := AColor;
- if not StringToGDKColor(ConfNormalItemBGColor, AColor) then StringToGDKColor(ConfDefaultNormalItemBGColor, AColor);
- NormalItemBGColorButton.Color := AColor;
- if not StringToGDKColor(ConfActiveItemFGColor, AColor) then StringToGDKColor(ConfDefaultActiveItemFGColor, AColor);
- ActiveItemFGColorButton.Color := AColor;
- if not StringToGDKColor(ConfActiveItemBGColor, AColor) then StringToGDKColor(ConfDefaultActiveItemBGColor, AColor);
- ActiveItemBGColorButton.Color := AColor;
- if not StringToGDKColor(ConfInactiveItemFGColor, AColor) then StringToGDKColor(ConfDefaultInactiveItemFGColor, AColor);
- InactiveItemFGColorButton.Color := AColor;
- if not StringToGDKColor(ConfInactiveItemBGColor, AColor) then StringToGDKColor(ConfDefaultInactiveItemBGColor, AColor);
- InactiveItemBGColorButton.Color := AColor;
- if not StringToGDKColor(ConfSelectedItemFGColor, AColor) then StringToGDKColor(ConfDefaultSelectedItemFGColor, AColor);
- SelectedItemFGColorButton.Color := AColor;
- if not StringToGDKColor(ConfLinkItemFGColor, AColor) then StringToGDKColor(ConfDefaultLinkItemFGColor, AColor);
- LinkItemFGColorButton.Color := AColor;
- if not StringToGDKColor(ConfDotFileItemFGColor, AColor) then StringToGDKColor(ConfDefaultDotFileItemFGColor, AColor);
- DotFileItemFGColorButton.Color := AColor;
+ if ValidateColorString(ConfNormalItemFGColor) then NormalItemFGColorButton.Color := ConfNormalItemFGColor
+ else NormalItemFGColorButton.Color := ConfDefaultNormalItemFGColor;
+ if ValidateColorString(ConfNormalItemBGColor) then NormalItemBGColorButton.Color := ConfNormalItemBGColor
+ else NormalItemBGColorButton.Color := ConfDefaultNormalItemBGColor;
+ if ValidateColorString(ConfActiveItemFGColor) then ActiveItemFGColorButton.Color := ConfActiveItemFGColor
+ else ActiveItemFGColorButton.Color := ConfDefaultActiveItemFGColor;
+ if ValidateColorString(ConfActiveItemBGColor) then ActiveItemBGColorButton.Color := ConfActiveItemBGColor
+ else ActiveItemBGColorButton.Color := ConfDefaultActiveItemBGColor;
+ if ValidateColorString(ConfInactiveItemFGColor) then InactiveItemFGColorButton.Color := ConfInactiveItemFGColor
+ else InactiveItemFGColorButton.Color := ConfDefaultInactiveItemFGColor;
+ if ValidateColorString(ConfInactiveItemBGColor) then InactiveItemBGColorButton.Color := ConfInactiveItemBGColor
+ else InactiveItemBGColorButton.Color := ConfDefaultInactiveItemBGColor;
+ if ValidateColorString(ConfSelectedItemFGColor) then SelectedItemFGColorButton.Color := ConfSelectedItemFGColor
+ else SelectedItemFGColorButton.Color := ConfDefaultSelectedItemFGColor;
+ if ValidateColorString(ConfLinkItemFGColor) then LinkItemFGColorButton.Color := ConfLinkItemFGColor
+ else LinkItemFGColorButton.Color := ConfDefaultLinkItemFGColor;
+ if ValidateColorString(ConfDotFileItemFGColor) then DotFileItemFGColorButton.Color := ConfDotFileItemFGColor
+ else DotFileItemFGColorButton.Color := ConfDefaultDotFileItemFGColor;
NormalItemFGColorDefault.Checked := ConfNormalItemDefaultColors;
ActiveItemFGColorDefault.Checked := ConfCursorDefaultColors;
@@ -897,8 +1177,8 @@ begin
SelectAllDirectoriesCheckBox.Checked := ConfSelectAllDirs;
NewStyleAltOCheckBox.Checked := ConfNewStyleAltO;
ShowFuncButtonsCheckBox.Checked := ConfShowFuncButtons;
- SizeFormatOptionMenu.ItemIndex := ConfSizeFormat;
- TerminalOptionMenu.ItemIndex := ConfCmdLineTerminalBehaviour;
+ SizeFormatComboBox.ItemIndex := ConfSizeFormat;
+ CmdLineBehaviourComboBox.ItemIndex := ConfCmdLineTerminalBehaviour;
DisableFileTipsCheckBox.Checked := ConfDisableFileTips;
DirsInBoldCheckBox.Checked := ConfDirsInBold;
DisableDirectoryBracketsCheckBox.Checked := ConfDisableDirectoryBrackets;
@@ -908,18 +1188,18 @@ begin
InsertMovesDownCheckBox.Checked := ConfInsMoveDown;
SpaceMovesDownCheckBox.Checked := ConfSpaceMovesDown;
UseInternalViewerCheckBox.Checked := ConfUseInternalViewer;
- ViewerOptionMenu.ItemIndex := ConfViewerTerminalBehaviour;
- EditorOptionMenu.ItemIndex := ConfEditorTerminalBehaviour;
+ ViewerX11AppComboBox.ItemIndex := ConfViewerTerminalBehaviour;
+ EditorX11AppComboBox.ItemIndex := ConfEditorTerminalBehaviour;
FocusRefreshCheckBox.Checked := ConfFocusRefresh;
WMCompatModeCheckBox.Checked := ConfWMCompatMode;
CompatUseLibcSystemCheckBox.Checked := ConfUseLibcSystem;
CustomTimeFormatEntry.Text := ConfCustomTimeFormat;
CustomDateFormatEntry.Text := ConfCustomDateFormat;
- DateFormatOptionMenu.ItemIndex := ConfDateFormat;
- TimeFormatOptionMenu.ItemIndex := ConfTimeFormat;
- DateTimeFormatOptionMenu.ItemIndex := ConfDateTimeFormat;
- QuickSearchOptionMenu.ItemIndex := ConfQuickSearchActivationKey;
+ DateFormatComboBox.ItemIndex := ConfDateFormat;
+ TimeFormatComboBox.ItemIndex := ConfTimeFormat;
+ DateTimeFormatComboBox.ItemIndex := ConfDateTimeFormat;
+ QuickSearchComboBox.ItemIndex := ConfQuickSearchActivationKey;
SortDirectoriesLikeFilesCheckBox.Checked := ConfSortDirectoriesLikeFiles;
VFSTempPathEntry.Text := StrToUTF8(ConfTempPath);
QuickRenameSkipExtCheckBox.Checked := ConfQuickRenameSkipExt;
@@ -928,7 +1208,7 @@ begin
DefaultFontCheckBoxToggled(Self);
ColorButtonDefaultsToggled(Self);
UseInternalViewerCheckBoxToggled(Self);
- DateTimeFormatOptionMenuChanged(Self);
+ DateTimeFormatComboBoxChanged(Self);
end;
procedure TFPreferences.SaveSettings;
@@ -938,7 +1218,7 @@ begin
else x := -1;
RebuildListViews := (ConfRowHeight <> x) or (ConfUseFileTypeIcons <> ShowFiletypeIcons.Checked) or
(ConfUseSystemFont <> DefaultFontCheckBox.Checked) or
- ((not DefaultFontCheckBox.Checked) and (ConfPanelFont <> ListFontPreview.Caption));
+ ((not DefaultFontCheckBox.Checked) and (ConfPanelFont <> ListFontButton.FontName));
RebuildIcons := ConfRowHeight <> x;
ConfRowHeight := x;
@@ -946,21 +1226,21 @@ begin
ConfClearReadOnlyAttr := ClearROAttr.Checked;
ConfDisableMouseRename := DisableMouseRename.Checked;
ConfUseFileTypeIcons := ShowFiletypeIcons.Checked;
- ConfViewer := UTF8ToStr(ViewerCombo.Entry.Text);
- ConfEditor := UTF8ToStr(EditorCombo.Entry.Text);
- ConfTerminalCommand := UTF8ToStr(TerminalCombo.Entry.Text);
+ ConfViewer := UTF8ToStr(ViewerCommandComboBox.Entry.Text);
+ ConfEditor := UTF8ToStr(EditorCommandComboBox.Entry.Text);
+ ConfTerminalCommand := UTF8ToStr(TerminalCommandComboBox.Entry.Text);
ConfUseSystemFont := DefaultFontCheckBox.Checked;
- if not ConfUseSystemFont then ConfPanelFont := ListFontPreview.Caption;
-
- ConfNormalItemFGColor := GDKColorToString(NormalItemFGColorButton.Color);
- ConfNormalItemBGColor := GDKColorToString(NormalItemBGColorButton.Color);
- ConfActiveItemFGColor := GDKColorToString(ActiveItemFGColorButton.Color);
- ConfActiveItemBGColor := GDKColorToString(ActiveItemBGColorButton.Color);
- ConfInactiveItemFGColor := GDKColorToString(InactiveItemFGColorButton.Color);
- ConfInactiveItemBGColor := GDKColorToString(InactiveItemBGColorButton.Color);
- ConfSelectedItemFGColor := GDKColorToString(SelectedItemFGColorButton.Color);
- ConfLinkItemFGColor := GDKColorToString(LinkItemFGColorButton.Color);
- ConfDotFileItemFGColor := GDKColorToString(DotFileItemFGColorButton.Color);
+ if not ConfUseSystemFont then ConfPanelFont := ListFontButton.FontName;
+
+ ConfNormalItemFGColor := NormalItemFGColorButton.Color;
+ ConfNormalItemBGColor := NormalItemBGColorButton.Color;
+ ConfActiveItemFGColor := ActiveItemFGColorButton.Color;
+ ConfActiveItemBGColor := ActiveItemBGColorButton.Color;
+ ConfInactiveItemFGColor := InactiveItemFGColorButton.Color;
+ ConfInactiveItemBGColor := InactiveItemBGColorButton.Color;
+ ConfSelectedItemFGColor := SelectedItemFGColorButton.Color;
+ ConfLinkItemFGColor := LinkItemFGColorButton.Color;
+ ConfDotFileItemFGColor := DotFileItemFGColorButton.Color;
ConfNormalItemDefaultColors := NormalItemFGColorDefault.Checked;
ConfCursorDefaultColors := ActiveItemFGColorDefault.Checked;
@@ -970,8 +1250,8 @@ begin
ConfSelectAllDirs := SelectAllDirectoriesCheckBox.Checked;
ConfNewStyleAltO := NewStyleAltOCheckBox.Checked;
- ConfSizeFormat := SizeFormatOptionMenu.ItemIndex;
- ConfCmdLineTerminalBehaviour := TerminalOptionMenu.ItemIndex;
+ ConfSizeFormat := SizeFormatComboBox.ItemIndex;
+ ConfCmdLineTerminalBehaviour := CmdLineBehaviourComboBox.ItemIndex;
ConfDirsInBold := DirsInBoldCheckBox.Checked;
ConfDisableDirectoryBrackets := DisableDirectoryBracketsCheckBox.Checked;
ConfOctalPerm := OctalPermissionsCheckBox.Checked;
@@ -980,8 +1260,8 @@ begin
ConfInsMoveDown := InsertMovesDownCheckBox.Checked;
ConfSpaceMovesDown := SpaceMovesDownCheckBox.Checked;
ConfUseInternalViewer := UseInternalViewerCheckBox.Checked;
- ConfViewerTerminalBehaviour := ViewerOptionMenu.ItemIndex;
- ConfEditorTerminalBehaviour := EditorOptionMenu.ItemIndex;
+ ConfViewerTerminalBehaviour := ViewerX11AppComboBox.ItemIndex;
+ ConfEditorTerminalBehaviour := EditorX11AppComboBox.ItemIndex;
ConfFocusRefresh := FocusRefreshCheckBox.Checked;
ConfWMCompatMode := WMCompatModeCheckBox.Checked;
ConfUseLibcSystem := CompatUseLibcSystemCheckBox.Checked;
@@ -990,10 +1270,10 @@ begin
ConfCustomTimeFormat := CustomTimeFormatEntry.Text;
ConfCustomDateFormat := CustomDateFormatEntry.Text;
- ConfDateFormat := DateFormatOptionMenu.ItemIndex;
- ConfTimeFormat := TimeFormatOptionMenu.ItemIndex;
- ConfDateTimeFormat := DateTimeFormatOptionMenu.ItemIndex;
- ConfQuickSearchActivationKey := QuickSearchOptionMenu.ItemIndex;
+ ConfDateFormat := DateFormatComboBox.ItemIndex;
+ ConfTimeFormat := TimeFormatComboBox.ItemIndex;
+ ConfDateTimeFormat := DateTimeFormatComboBox.ItemIndex;
+ ConfQuickSearchActivationKey := QuickSearchComboBox.ItemIndex;
ConfSortDirectoriesLikeFiles := SortDirectoriesLikeFilesCheckBox.Checked;
ConfTempPath := UTF8ToStr(VFSTempPathEntry.Text);
ConfQuickRenameSkipExt := QuickRenameSkipExtCheckBox.Checked;
diff --git a/UProgress.pas b/UProgress.pas
index bc6410b..3b167d6 100644
--- a/UProgress.pas
+++ b/UProgress.pas
@@ -22,7 +22,7 @@ unit UProgress;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls;
type
TFProgress = class(TGTKDialog)
@@ -54,7 +54,6 @@ begin
WindowPosition := wpCenter;
Cancelled := False;
Buttons := [];
- ShowSeparator := False;
ActionArea.SetSizeRequest(0, 4);
Caption := LANGProgress;
CancelButton := TGTKButton.Create(Self);
@@ -96,7 +95,7 @@ end;
procedure TFProgress.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
- if Key = GDK_ESCAPE then begin
+ if Key = GDK_KEY_Escape then begin
Accept := False;
CancelButtonClick(Sender);
end;
@@ -126,8 +125,12 @@ begin
LabelBox.AddControlEx(Label1, True, True, 0);
LabelBox.AddControlEx(Label2, True, True, 0);
LabelBox.AddControlEx(Label3, True, True, 0);
- Label2.XAlign := 0; Label2.XPadding := 20;
- Label3.XAlign := 0; Label3.XPadding := 20;
+ Label2.XAlign := 0;
+ Label2.MarginStart := 20;
+ Label2.MarginEnd := 20;
+ Label3.XAlign := 0;
+ Label3.MarginStart := 20;
+ Label3.MarginEnd := 20;
BarBox.AddControlEx(Bar1HBox, False, False, 0);
BarBox.AddControlEx(Space2, False, False, 0);
BarBox.AddControlEx(Bar2HBox, False, False, 0);
diff --git a/UQuickConnect.pas b/UQuickConnect.pas
index 18725fc..26025ee 100644
--- a/UQuickConnect.pas
+++ b/UQuickConnect.pas
@@ -22,8 +22,8 @@ unit UQuickConnect;
interface
uses
- lazglib2, gtk2, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts,
- GTKPixbuf, GTKClasses, GTKMenus,
+ SysUtils, Classes, lazglib2, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls,
+ GTKPixbuf,
UCore, UVFSCore, UEngines, UConnectionManager;
type
@@ -33,12 +33,12 @@ type
TitleEventBox: TGTKEventBox;
TitleIcon: TGTKImage;
TitleHBox: TGTKHBox;
- Table: TGTKTable;
+ Grid: TGTKGrid;
ActionButtonBox: TGTKHButtonBox;
ConnectButton, StopButton, CloseButton: TGTKButton;
Label1, Label2: TGTKLabel;
- URIComboBox: TGTKCombo;
- PluginOptionMenu: TGTKOptionMenu;
+ URIComboBox: TGTKComboBoxEntry;
+ PluginComboBox: TGTKComboBoxText;
procedure FormCreate(Sender: TObject); override;
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
@@ -68,7 +68,6 @@ uses ULocale, UCoreUtils, UConfig, UConnectionProperties, UGnome, UError;
procedure TFQuickConnect.FormCreate(Sender: TObject);
var i: integer;
- MenuItem: TGTKMenuItem;
begin
SavedData := '';
ConnectedEngine := nil;
@@ -77,13 +76,14 @@ begin
SetDefaultSize(435, 200);
Caption := LANGFQuickConnect_Caption;
Buttons := [];
- ShowSeparator := False;
ConnectButton := TGTKButton.Create(Self);
ConnectButton.Caption := LANGConnMgr_ConnectButton;
// ConnectButton.Default := True;
- CloseButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_CLOSE);
- StopButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_STOP);
+ CloseButton := TGTKButton.CreateFromIconName(Self, 'gtk-close');
+ CloseButton.Caption := 'Close';
+ StopButton := TGTKButton.CreateFromIconName(Self, 'gtk-stop');
+ StopButton.Caption := 'Stop';
StopButton.Visible := False;
StopButton.Enabled := False;
// Default := ConnectButton;
@@ -102,13 +102,15 @@ begin
TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [LANGFQuickConnect_TitleLabel_Caption]);
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-connect', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-connect', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
@@ -118,13 +120,16 @@ begin
TitleFrame.AddControl(TitleEventBox);
ClientArea.AddControlEx(TitleFrame, False, True, 0);
- Table := TGTKTable.Create(Self);
- Table.BorderWidth := 25;
- ClientArea.AddControlEx(Table, True, True, 0);
+ Grid := TGTKGrid.Create(Self);
+ Grid.BorderWidth := 25;
+ ClientArea.AddControlEx(Grid, True, True, 0);
- URIComboBox := TGtkCombo.Create(Self);
- URIComboBox.DisableActivate;
- PluginOptionMenu := TGTKOptionMenu.Create(Self);
+ URIComboBox := TGtkComboBoxEntry.Create(Self);
+ URIComboBox.MarginTop := 5;
+ URIComboBox.MarginBottom := 5;
+ PluginComboBox := TGTKComboBoxText.Create(Self);
+ PluginComboBox.MarginTop := 5;
+ PluginComboBox.MarginBottom := 5;
Label1 := TGTKLabel.Create(Self);
Label1.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFQuickConnect_ConnectToURILabel_Caption]);
@@ -132,43 +137,41 @@ begin
Label1.UseMarkup := True;
Label1.UseUnderline := True;
Label1.XAlign := 0;
+ Label1.MarginTop := 2;
+ Label1.MarginBottom := 2;
Label2 := TGTKLabel.Create(Self);
Label2.Caption := LANGConnProp_VFSModule;
- Label2.FocusControl := PluginOptionMenu;
+ Label2.FocusControl := PluginComboBox;
Label2.UseUnderline := True;
Label2.XAlign := 0;
+ Label2.MarginStart := 10;
+ Label2.MarginEnd := 10;
+ Label2.MarginTop := 5;
+ Label2.MarginBottom := 5;
if QuickConnectHistory.Count > 0 then
for i := 0 to QuickConnectHistory.Count - 1 do
- URIComboBox.Items.Append(QuickConnectHistory[i]);
+ URIComboBox.AppendItem(QuickConnectHistory[i]);
URIComboBox.Entry.Text := '';
// Fill the plugins menu
- MenuItem := TGTKMenuItem.CreateTyped(Self, itLabel);
- MenuItem.Caption := LANGConnProp_MenuItemCaption;
- PluginOptionMenu.Items.Add(MenuItem);
+ PluginComboBox.AppendItem(LANGConnProp_MenuItemCaption);
for i := 0 to PluginList.Count - 1 do
- if TVFSPlugin(PluginList[i]).HandlesNetwork then begin
- MenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
- MenuItem.Data := PluginList[i];
- MenuItem.SetCaptionPlain(Format('%s [%s]', [TVFSPlugin(PluginList[i]).ModuleName,
- ExtractFileName(TVFSPlugin(PluginList[i]).FullModulePath)]));
- PluginOptionMenu.Items.Add(MenuItem);
- end;
+ if TVFSPlugin(PluginList[i]).HandlesNetwork then
+ PluginComboBox.AppendItemID(TVFSPlugin(PluginList[i]).ModuleID,
+ Format('%s [%s]', [TVFSPlugin(PluginList[i]).ModuleName,
+ ExtractFileName(TVFSPlugin(PluginList[i]).FullModulePath)]));
// Find last used plugin
- if (Length(Trim(ConfQuickConnectPluginID)) > 0) and (PluginOptionMenu.Items.Count > 0) then
- for i := 0 to PluginOptionMenu.Items.Count - 1 do
- if (PluginOptionMenu.Items[i].Data <> nil) and (TVFSPlugin(PluginOptionMenu.Items[i].Data).ModuleID = ConfQuickConnectPluginID) then begin
- PluginOptionMenu.ItemIndex := i;
- Break;
- end;
-
-// Table.AddControlEx(1, 1, 2, 1, TGTKEventBox.Create(Self), [taoExpand, taoFill], [taoShrink], 0, 2);
- Table.AddControlEx(0, 0, 2, 1, Label1, [taoShrink, taoFill], [taoShrink], 0, 2);
- Table.AddControlEx(0, 1, 2, 1, URIComboBox, [taoExpand, taoFill], [taoShrink], 0, 5);
- Table.AddControlEx(0, 2, 1, 1, Label2, [taoShrink, taoFill], [taoShrink], 10, 5);
- Table.AddControlEx(1, 2, 1, 1, PluginOptionMenu, [taoExpand, taoFill], [taoShrink], 0, 5);
+ if (Length(Trim(ConfQuickConnectPluginID)) > 0) and (PluginList.Count > 0)
+ then PluginComboBox.ItemID := ConfQuickConnectPluginID
+ else PluginComboBox.ItemIndex := 0;
+
+// Grid.AddControlEx(1, 1, 2, 1, TGTKEventBox.Create(Self), [taoExpand, taoFill], [taoShrink], 0, 2);
+ Grid.AddControl(0, 0, 2, 1, Label1);
+ Grid.AddControl(0, 1, 2, 1, URIComboBox);
+ Grid.AddControl(0, 2, 1, 1, Label2);
+ Grid.AddControl(1, 2, 1, 1, PluginComboBox);
CloseButton.OnClick := @CloseButtonClick;
ConnectButton.OnClick := @ConnectButtonClick;
@@ -184,13 +187,13 @@ end;
procedure TFQuickConnect.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: if StopButton.Visible then StopButtonClick(Sender)
- else if ConnectButton.Enabled then DoConnect;
- GDK_ESCAPE: begin
- Accept := False;
- if StopButton.Visible then StopButtonClick(Sender)
- else ModalResult := mbCancel;
- end;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: if StopButton.Visible then StopButtonClick(Sender)
+ else if ConnectButton.Enabled then DoConnect;
+ GDK_KEY_Escape: begin
+ Accept := False;
+ if StopButton.Visible then StopButtonClick(Sender)
+ else ModalResult := mbCancel;
+ end;
end;
end;
@@ -199,13 +202,13 @@ var Orig, s: string;
i: integer;
begin
case Key of
- GDK_UP, GDK_DOWN: if Shift = [] then begin
+ GDK_KEY_Up, GDK_KEY_Down: if Shift = [] then begin
Accept := False;
if QuickConnectHistory.Count > 0 then begin
Orig := Trim(URIComboBox.Entry.Text);
i := QuickConnectHistory.IndexOf(Orig);
- if Key = GDK_DOWN then begin
+ if Key = GDK_KEY_Down then begin
if i < 0 then begin
SavedData := Orig;
i := 0;
@@ -238,9 +241,7 @@ procedure TFQuickConnect.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if Length(Trim(URIComboBox.Entry.Text)) > 0 then
SaveItemToHistory(URIComboBox.Entry.Text, QuickConnectHistory);
- if (PluginOptionMenu.ItemIndex <> 0) and (PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data <> nil)
- then ConfQuickConnectPluginID := TVFSPlugin(PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data).ModuleID
- else ConfQuickConnectPluginID := '';
+ ConfQuickConnectPluginID := PluginComboBox.ItemID;
end;
procedure TFQuickConnect.FormResponse(Sender: TObject; const ResponseID: integer);
@@ -285,8 +286,8 @@ begin
// Find VFS module to use for this connection
VFSPlugin := nil;
- if (PluginOptionMenu.ItemIndex <> 0) and (PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data <> nil) then begin
- VFSPlugin := TVFSPlugin(PluginOptionMenu.Items[PluginOptionMenu.ItemIndex].Data);
+ if Length(PluginComboBox.ItemID) > 0 then begin
+ VFSPlugin := LookupVFSPlugin(PluginComboBox.ItemID);
ConfQuickConnectPluginID := VFSPlugin.ModuleID;
end else ConfQuickConnectPluginID := '';
if VFSPlugin = nil then begin
@@ -315,7 +316,7 @@ begin
if res <> mbYes then Exit;
end;
- Table.Enabled := False;
+ Grid.Enabled := False;
CloseButton.Enabled := False;
ConnectButton.Enabled := False;
ConnectButton.Visible := False;
@@ -337,7 +338,7 @@ begin
if not AFConnectionManager.DoConnectInternal(URI, Engine, Self, True, @Error) then begin
if not AFConnectionManager.FSilenceError then
ShowError(Self, 'Couldn''t open the URI specified', Error);
- Table.Enabled := True;
+ Grid.Enabled := True;
CloseButton.Enabled := True;
ConnectButton.Enabled := True;
ConnectButton.Visible := True;
diff --git a/URemoteWait.pas b/URemoteWait.pas
index c3802d1..c727296 100644
--- a/URemoteWait.pas
+++ b/URemoteWait.pas
@@ -22,7 +22,7 @@ unit URemoteWait;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
type
TFRemoteWait = class(TGTKDialog)
@@ -61,7 +61,6 @@ begin
Label1.UseUnderline := True;
Label1.UseMarkup := True;
Label1.XAlign := 0;
- Label1.XPadding := 0;
Label1.LineWrap := True;
Box.AddControlEx(Label1, False, False, 2);
{
@@ -74,7 +73,8 @@ begin
}
Box.BorderWidth := 6;
ClientArea.AddControlEx(Box, True, True, 0);
- CancelButton := TGTKButton.CreateFromStock(Self, 'gtk-cancel');
+ CancelButton := TGTKButton.CreateFromIconName(Self, 'gtk-cancel');
+ CancelButton.Caption := 'Cancel';
CancelButton.Default := True;
ActionArea.AddControlEndEx(CancelButton, False, False, 2);
OnKeyDown := @FormKeyDown;
@@ -86,7 +86,7 @@ end;
procedure TFRemoteWait.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER, GDK_ESCAPE: Cancelled := True;
+ GDK_KEY_Return, GDK_KEY_KP_Enter, GDK_KEY_Escape: Cancelled := True;
end;
end;
diff --git a/URunFromVFS.pas b/URunFromVFS.pas
index 4710a33..3654abc 100644
--- a/URunFromVFS.pas
+++ b/URunFromVFS.pas
@@ -22,8 +22,8 @@ unit URunFromVFS;
interface
uses
- gtk2, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts,
- GTKPixbuf, UCoreClasses;
+ SysUtils, Classes, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKPixbuf,
+ UCoreClasses;
type
TFRunFromVFS = class(TGTKDialog)
@@ -35,14 +35,14 @@ type
ButtonBox: TGTKHButtonBox;
CloseButton: TGTKButton;
- Table: TGTKTable;
- ExecuteButton, ExecuteAllButton: TGTKImageButton;
-
+ Grid: TGTKGrid;
+ ExecuteButton, ExecuteAllButton: TGTKButton;
+
FileNameLabel, FileNameLabel2, FileTypeLabel, FileTypeLabel2, SizeLabel, SizeLabel2, PackedSizeLabel, PackedSizeLabel2,
DateLabel, DateLabel2: TGTKLabel;
OpensWithLabel, OpensWithLabel2, InfoLabel: TGTKLabel;
InfoIcon: TGTKImage;
-
+
HBox1, HBox2: TGTKHBox;
procedure FormCreate(Sender: TObject); override;
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
@@ -60,23 +60,25 @@ uses ULocale;
procedure TFRunFromVFS.FormCreate(Sender: TObject);
+var VBox: TGTKVBox;
begin
// SetDefaultSize(55, 40);
Caption := LANGFRunFromVFS_Caption;
Buttons := [];
- ShowSeparator := False;
TitleEventBox := TGTKEventBox.Create(Self);
TitleLabel := TGTKLabel.Create(Self);
TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [LANGFRunFromVFS_TitleLabel]);
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-properties', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-properties', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
@@ -86,7 +88,8 @@ begin
TitleFrame.AddControl(TitleEventBox);
ClientArea.AddControlEx(TitleFrame, False, True, 0);
- CloseButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_CLOSE);
+ CloseButton := TGTKButton.CreateFromIconName(Self, GTK_STOCK_CLOSE);
+ CloseButton.Caption := 'Close';
// CloseButton.Default := True;
// Default := CloseButton;
CloseButton.OnClick := @CloseButtonClick;
@@ -96,114 +99,187 @@ begin
ButtonBox.BorderWidth := 0;
FileNameLabel := TGTKLabel.Create(Self);
- FileNameLabel.XAlign := 1;
- FileNameLabel.YAlign := 0;
FileNameLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFRunFromVFS_FileNameLabel]);
FileNameLabel.UseMarkup := True;
+ FileNameLabel.XAlign := 1;
+ FileNameLabel.YAlign := 0;
+ FileNameLabel.MarginStart := 10;
+ FileNameLabel.MarginEnd := 10;
+ FileNameLabel.MarginTop := 2;
+ FileNameLabel.MarginBottom := 2;
FileNameLabel2 := TGTKLabel.Create(Self);
FileNameLabel2.Caption := Format('%s<span weight="ultrabold"> </span>', ['/tmp/t/bbbbb.txt']);
- FileNameLabel2.XAlign := 0;
FileNameLabel2.UseMarkup := True;
FileNameLabel2.Selectable := True;
FileNameLabel2.CanFocus := False;
FileNameLabel2.LineWrap := True;
+ FileNameLabel2.XAlign := 0;
+ FileNameLabel2.MarginStart := 10;
+ FileNameLabel2.MarginEnd := 10;
+ FileNameLabel2.MarginTop := 2;
+ FileNameLabel2.MarginBottom := 2;
FileTypeLabel := TGTKLabel.Create(Self);
FileTypeLabel.XAlign := 1;
+ FileTypeLabel.MarginStart := 10;
+ FileTypeLabel.MarginEnd := 10;
+ FileTypeLabel.MarginTop := 2;
+ FileTypeLabel.MarginBottom := 2;
FileTypeLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFRunFromVFS_FileTypeLabel]);
FileTypeLabel.UseMarkup := True;
FileTypeLabel2 := TGTKLabel.Create(Self);
FileTypeLabel2.Caption := Format('%s<span weight="ultrabold"> </span>', ['HTML page']);
FileTypeLabel2.XAlign := 0;
+ FileTypeLabel2.MarginStart := 10;
+ FileTypeLabel2.MarginEnd := 10;
+ FileTypeLabel2.MarginTop := 2;
+ FileTypeLabel2.MarginBottom := 2;
FileTypeLabel2.UseMarkup := True;
SizeLabel := TGTKLabel.Create(Self);
- SizeLabel.XAlign := 1;
SizeLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFRunFromVFS_SizeLabel]);
SizeLabel.UseMarkup := True;
+ SizeLabel.XAlign := 1;
+ SizeLabel.MarginStart := 10;
+ SizeLabel.MarginEnd := 10;
+ SizeLabel.MarginTop := 2;
+ SizeLabel.MarginBottom := 2;
SizeLabel2 := TGTKLabel.Create(Self);
SizeLabel2.Caption := Format('%s<span weight="ultrabold"> </span>', ['192 168 bytes']);
- SizeLabel2.XAlign := 0;
SizeLabel2.UseMarkup := True;
+ SizeLabel2.XAlign := 0;
+ SizeLabel2.MarginStart := 10;
+ SizeLabel2.MarginEnd := 10;
+ SizeLabel2.MarginTop := 2;
+ SizeLabel2.MarginBottom := 2;
PackedSizeLabel := TGTKLabel.Create(Self);
- PackedSizeLabel.XAlign := 1;
PackedSizeLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFRunFromVFS_PackedSizeLabel]);
PackedSizeLabel.UseMarkup := True;
+ PackedSizeLabel.XAlign := 1;
+ PackedSizeLabel.MarginStart := 10;
+ PackedSizeLabel.MarginEnd := 10;
+ PackedSizeLabel.MarginTop := 2;
+ PackedSizeLabel.MarginBottom := 2;
PackedSizeLabel2 := TGTKLabel.Create(Self);
PackedSizeLabel2.Caption := Format('%s<span weight="ultrabold"> </span>', ['168 192 bytes']);
- PackedSizeLabel2.XAlign := 0;
PackedSizeLabel2.UseMarkup := True;
+ PackedSizeLabel2.XAlign := 0;
+ PackedSizeLabel2.MarginStart := 10;
+ PackedSizeLabel2.MarginEnd := 10;
+ PackedSizeLabel2.MarginTop := 2;
+ PackedSizeLabel2.MarginBottom := 2;
DateLabel := TGTKLabel.Create(Self);
- DateLabel.XAlign := 1;
DateLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFRunFromVFS_DateLabel]);
DateLabel.UseMarkup := True;
+ DateLabel.XAlign := 1;
+ DateLabel.MarginStart := 10;
+ DateLabel.MarginEnd := 10;
+ DateLabel.MarginTop := 2;
+ DateLabel.MarginBottom := 2;
DateLabel2 := TGTKLabel.Create(Self);
DateLabel2.Caption := Format('%s<span weight="ultrabold"> </span>', ['2007-01-01']);
- DateLabel2.XAlign := 0;
DateLabel2.UseMarkup := True;
+ DateLabel2.XAlign := 0;
+ DateLabel2.MarginStart := 10;
+ DateLabel2.MarginEnd := 10;
+ DateLabel2.MarginTop := 2;
+ DateLabel2.MarginBottom := 2;
HBox1 := TGTKHBox.Create(Self);
HBox1.Homogeneous := False;
+ HBox1.MarginTop := 2;
+ HBox1.MarginBottom := 2;
InfoLabel := TGTKLabel.Create(Self);
InfoLabel.Caption := LANGFRunFromVFS_InfoLabel;
InfoLabel.UseMarkup := True;
InfoLabel.LineWrap := True;
InfoLabel.SetSizeRequest(400, -1);
InfoIcon := TGTKImage.Create(Self);
- InfoIcon.SetFromStock('gtk-dialog-info', isDialog);
+ InfoIcon.SetFromIconName('gtk-dialog-info', isDialog);
HBox1.AddControlEx(TGTKVBox.Create(Self), False, False, 12);
HBox1.AddControlEx(InfoIcon, False, False, 7);
HBox1.AddControlEx(InfoLabel, True, True, 0);
HBox1.AddControlEx(TGTKVBox.Create(Self), False, False, 8);
OpensWithLabel := TGTKLabel.Create(Self);
- OpensWithLabel.XAlign := 1;
- OpensWithLabel.YAlign := 0;
OpensWithLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGFRunFromVFS_OpensWithLabel]);
OpensWithLabel.UseMarkup := True;
+ OpensWithLabel.XAlign := 1;
+ OpensWithLabel.YAlign := 0;
+ OpensWithLabel.MarginStart := 10;
+ OpensWithLabel.MarginEnd := 10;
+ OpensWithLabel.MarginTop := 10;
+ OpensWithLabel.MarginBottom := 10;
OpensWithLabel2 := TGTKLabel.Create(Self);
OpensWithLabel2.Caption := Format('%s<span weight="ultrabold"> </span>', ['galeon']);
- OpensWithLabel2.XAlign := 0;
OpensWithLabel2.Selectable := True;
OpensWithLabel2.CanFocus := False;
OpensWithLabel2.UseMarkup := True;
+ OpensWithLabel2.XAlign := 0;
+ OpensWithLabel2.MarginStart := 10;
+ OpensWithLabel2.MarginEnd := 10;
+ OpensWithLabel2.MarginTop := 10;
+ OpensWithLabel2.MarginBottom := 10;
- ExecuteButton := TGTKImageButton.Create(Self);
- ExecuteButton.SetFromStock('gtk-execute', isButton);
+ ExecuteButton := TGTKButton.CreateFromIconName(Self, 'gtk-execute');
ExecuteButton.Caption := LANGFRunFromVFS_ExecuteButton;
ExecuteButton.OnClick := @ExecuteButtonClick;
- ExecuteButton.Spacing := 7;
- ExecuteAllButton := TGTKImageButton.Create(Self);
+// ExecuteButton.Spacing := 7;
+ ExecuteAllButton := TGTKButton.Create(Self);
ExecuteAllButton.Caption := LANGFRunFromVFS_ExecuteAllButton;
ExecuteAllButton.OnClick := @ExecuteAllButtonClick;
- ExecuteAllButton.Spacing := 7;
-
-
- Table := TGTKTable.Create(Self);
- Table.SetRowColCount(13, 4);
- ClientArea.AddControlEx(Table, True, True, 12);
- Table.AddControlEx(0, 0, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink], 10, 6);
- Table.AddControlEx(0, 1, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoFill], 12, 2);
- Table.AddControlEx(1, 1, 1, 1, FileNameLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(3, 1, 2, 1, FileNameLabel2, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(1, 2, 1, 1, FileTypeLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(3, 2, 2, 1, FileTypeLabel2, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(1, 3, 1, 1, SizeLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(3, 3, 2, 1, SizeLabel2, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(1, 4, 1, 1, PackedSizeLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(3, 4, 2, 1, PackedSizeLabel2, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(1, 5, 1, 1, DateLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(3, 5, 2, 1, DateLabel2, [taoExpand, taoFill], [taoShrink, taoFill], 10, 2);
- Table.AddControlEx(0, 6, 5, 1, TGTKHBox.Create(Self), [taoShrink], [taoShrink], 50, 17);
- Table.AddControlEx(0, 7, 5, 1, HBox1, [taoExpand, taoFill], [taoShrink], 0, 2);
- Table.AddControlEx(1, 8, 1, 1, OpensWithLabel, [taoShrink, taoFill], [taoShrink, taoFill], 10, 10);
- Table.AddControlEx(3, 8, 2, 1, OpensWithLabel2, [taoExpand, taoFill], [taoShrink, taoFill], 10, 10);
-// Table.AddControlEx(3, 9, 1, 1, ExecuteButton, [taoFill], [taoShrink], 10, 2);
-// Table.AddControlEx(3, 10, 1, 1, ExecuteAllButton, [taoFill], [taoShrink], 10, 2);
- Table.AddControlEx(4, 11, 1, 1, TGTKHBox.Create(Self), [taoExpand, taoFill], [taoShrink], 30, 2);
- Table.AddControlEx(0, 12, 4, 1, TGTKVBox.Create(Self), [taoExpand, taoFill], [taoShrink], 30, 10);
+// ExecuteAllButton.Spacing := 7;
+
+
+ Grid := TGTKGrid.Create(Self);
+ ClientArea.AddControlEx(Grid, True, True, 12);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 10;
+ VBox.MarginEnd := 10;
+ VBox.MarginTop := 6;
+ VBox.MarginBottom := 6;
+ Grid.AddControl(0, 0, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 12;
+ VBox.MarginEnd := 12;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid.AddControl(0, 1, 1, 1, VBox);
+ Grid.AddControl(1, 1, 1, 1, FileNameLabel);
+ Grid.AddControl(3, 1, 2, 1, FileNameLabel2);
+ Grid.AddControl(1, 2, 1, 1, FileTypeLabel);
+ Grid.AddControl(3, 2, 2, 1, FileTypeLabel2);
+ Grid.AddControl(1, 3, 1, 1, SizeLabel);
+ Grid.AddControl(3, 3, 2, 1, SizeLabel2);
+ Grid.AddControl(1, 4, 1, 1, PackedSizeLabel);
+ Grid.AddControl(3, 4, 2, 1, PackedSizeLabel2);
+ Grid.AddControl(1, 5, 1, 1, DateLabel);
+ Grid.AddControl(3, 5, 2, 1, DateLabel2);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 50;
+ VBox.MarginEnd := 50;
+ VBox.MarginTop := 17;
+ VBox.MarginBottom := 17;
+ Grid.AddControl(0, 6, 5, 1, VBox);
+ Grid.AddControl(0, 7, 5, 1, HBox1);
+ Grid.AddControl(1, 8, 1, 1, OpensWithLabel);
+ Grid.AddControl(3, 8, 2, 1, OpensWithLabel2);
+// Grid.AddControlEx(3, 9, 1, 1, ExecuteButton, [taoFill], [taoShrink], 10, 2);
+// Grid.AddControlEx(3, 10, 1, 1, ExecuteAllButton, [taoFill], [taoShrink], 10, 2);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 30;
+ VBox.MarginEnd := 30;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid.AddControl(4, 11, 1, 1, VBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 30;
+ VBox.MarginEnd := 30;
+ VBox.MarginTop := 10;
+ VBox.MarginBottom := 10;
+ Grid.AddControl(0, 12, 4, 1, VBox);
HBox2 := TGTKHBox.Create(Self);
HBox2.BorderWidth := 3;
@@ -221,17 +297,17 @@ end;
procedure TFRunFromVFS.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
- if Key = GDK_ESCAPE then begin
+ if Key = GDK_KEY_Escape then begin
ModalResult := mbClose;
Accept := False;
end else
- if Key = GDK_RIGHT then begin
+ if Key = GDK_KEY_Right then begin
if ExecuteButton.Focused then ExecuteAllButton.SetFocus else
if ExecuteAllButton.Focused then CloseButton.SetFocus else
ExecuteButton.SetFocus;
Accept := False;
end else
- if Key = GDK_LEFT then begin
+ if Key = GDK_KEY_Left then begin
if ExecuteButton.Focused then CloseButton.SetFocus else
if ExecuteAllButton.Focused then ExecuteButton.SetFocus else
ExecuteAllButton.SetFocus;
diff --git a/USearch.pas b/USearch.pas
index 1a9b527..5e981e0 100644
--- a/USearch.pas
+++ b/USearch.pas
@@ -22,9 +22,8 @@ unit USearch;
interface
uses
- lazglib2, gtk2, SyncObjs, SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKView,
- GTKMenus,
- UEngines, UGnome, ULibc;
+ SyncObjs, SysUtils, Classes, lazglib2, lazgdk3, lazgtk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKView,
+ UEngines, ULibc;
type
TFSearch = class(TGTKDialog)
@@ -35,21 +34,20 @@ type
FileListScrolledWindow: TGTKScrolledWindow;
Notebook: TGTKNotebook;
- Table1, Table2: TGTKTable;
+ Grid1, Grid2: TGTKGrid;
ResultsLabel, StatusLabel: TGTKLabel;
Label1, Label2, Label3, Label4, Label5, Label6: TGTKLabel;
- FileMaskEntry, FindTextEntry: TGTKCombo;
+ FileMaskEntry, FindTextEntry: TGTKComboBoxEntry;
SearchInEntry: TGTKEntry;
ViewButton, NewSearchButton, GoToFileButton, FeedToListboxButton: TGTKButton;
SearchArchivesCheckButton, CaseSensitiveCheckButton, StayCurrentFSCheckButton, CaseSensitiveMatchCheckButton: TGTKCheckButton;
FindButton, StopButton, CloseButton: TGTKButton;
BiggerThanCheckButton, SmallerThanCheckButton: TGTKCheckButton;
BiggerThanEntry, SmallerThanEntry: TGTKSpinEdit;
- BiggerThanOptionMenu, SmallerThanOptionMenu, ModifiedLastOptionMenu, ModifiedNotLastOptionMenu: TGTKOptionMenu;
+ BiggerThanComboBox, SmallerThanComboBox, ModifiedLastComboBox, ModifiedNotLastComboBox: TGTKComboBoxText;
ModifiedBetweenRadioButton, NotModifiedAfterRadioButton, ModifiedLastRadioButton, ModifiedNotLastRadionButton: TGTKCheckButton;
ModifiedLastSpinEdit, ModifiedNotLastSpinEdit: TGTKSpinEdit;
ModifiedBetweenEntry1, ModifiedBetweenEntry2, NotModifiedAfterEntry: TGTKEntry;
- ModifiedBetweenEntry1G, ModifiedBetweenEntry2G, NotModifiedAfterEntryG: TGnomeDateEdit;
procedure FormCreate(Sender: TObject); override;
procedure FormDestroy(Sender: TObject);
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
@@ -67,7 +65,7 @@ type
procedure FileMaskEntryKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
procedure FindTextEntryKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
private
- Processing, Stop, FUseGnomeWidgets: boolean;
+ Processing, Stop: boolean;
SavedData: string;
procedure ConstructViews;
procedure DoSearch;
@@ -114,8 +112,9 @@ var SizeUnits: array[0..2] of string;
procedure TFSearch.FormCreate(Sender: TObject);
-var MenuItem: TGTKMenuItem;
- i: integer;
+var i: integer;
+ HSeparator: TGTKHSeparator;
+ VBox: TGTKVBox;
begin
// Set the constants
SizeUnits[0] := LANGSearch_Bytes;
@@ -127,7 +126,6 @@ begin
DayUnits[3] := LANGSearch_years;
// Initialization
-// WindowTypeHint := whNormal;
List := TList.Create;
List.Clear;
Processing := False;
@@ -137,23 +135,20 @@ begin
SetDefaultSize(650, 600);
Caption := LANGSearch_Caption;
Buttons := [];
- ShowSeparator := False;
- FUseGnomeWidgets := False;
Notebook := TGTKNotebook.Create(Self);
Notebook.BorderWidth := 10;
- Table1 := TGTKTable.Create(Self);
- Table1.BorderWidth := 10;
- Table2 := TGTKTable.Create(Self);
- Table2.BorderWidth := 10;
- Notebook.AppendPage(Table1, LANGSearch_General);
- Notebook.AppendPage(Table2, LANGSearch_Advanced);
+ Grid1 := TGTKGrid.Create(Self);
+ Grid1.BorderWidth := 10;
+ Grid2 := TGTKGrid.Create(Self);
+ Grid2.BorderWidth := 10;
+ Notebook.AppendPage(Grid1, LANGSearch_General);
+ Notebook.AppendPage(Grid2, LANGSearch_Advanced);
ConstructViews;
ResultsLabel := TGTKLabel.Create(Self);
ResultsLabel.XAlign := 0;
- ResultsLabel.XPadding := 0;
ResultsLabel.Caption := Format('<span weight="ultrabold">%s</span>', [LANGSearch_SearchResults]);
ResultsLabel.FocusControl := FileList;
ResultsLabel.UseMarkup := True;
@@ -163,170 +158,260 @@ begin
Label1 := TGTKLabel.Create(Self);
- Label1.XAlign := 0;
- Label1.XPadding := 0;
Label1.Caption := Format('<span weight="ultrabold">%s</span>', [LANGSearch_SearchFor]);
- FileMaskEntry := TGTKCombo.Create(Self);
+ Label1.XAlign := 0;
+ Label1.MarginStart := 5;
+ Label1.MarginEnd := 5;
+ Label1.MarginTop := 2;
+ Label1.MarginBottom := 2;
+ FileMaskEntry := TGTKComboBoxEntry.Create(Self);
FileMaskEntry.Tooltip := LANGSearch_FileMaskEntryTooltip;
FileMaskEntry.Entry.OnKeyDown := @FileMaskEntryKeyDown;
if SearchHistory.Count > 0 then
for i := 0 to SearchHistory.Count - 1 do
- FileMaskEntry.Items.Append(SearchHistory[i]);
+ FileMaskEntry.AppendItem(SearchHistory[i]);
FileMaskEntry.Entry.Text := '';
+ FileMaskEntry.MarginStart := 5;
+ FileMaskEntry.MarginEnd := 5;
+ FileMaskEntry.MarginTop := 2;
+ FileMaskEntry.MarginBottom := 2;
Label1.FocusControl := FileMaskEntry.Entry;
Label1.UseMarkup := True;
Label1.UseUnderline := True;
Label2 := TGTKLabel.Create(Self);
- Label2.XAlign := 0;
- Label2.XPadding := 0;
Label2.Caption := LANGSearch_SearchIn;
+ Label2.XAlign := 0;
+ Label2.MarginStart := 5;
+ Label2.MarginEnd := 5;
+ Label2.MarginTop := 2;
+ Label2.MarginBottom := 2;
SearchInEntry := TGTKEntry.Create(Self);
+ SearchInEntry.MarginStart := 5;
+ SearchInEntry.MarginEnd := 5;
+ SearchInEntry.MarginTop := 2;
+ SearchInEntry.MarginBottom := 2;
Label2.FocusControl := SearchInEntry;
Label2.UseMarkup := True;
Label2.UseUnderline := True;
SearchArchivesCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_SearchArchivesCheckButton);
SearchArchivesCheckButton.Enabled := PluginList.Count > 0;
+ SearchArchivesCheckButton.MarginStart := 5;
+ SearchArchivesCheckButton.MarginEnd := 5;
+ SearchArchivesCheckButton.MarginTop := 2;
+ SearchArchivesCheckButton.MarginBottom := 2;
Label3 := TGTKLabel.Create(Self);
- Label3.XAlign := 0;
- Label3.XPadding := 0;
Label3.Caption := LANGSearch_FindText;
- FindTextEntry := TGTKCombo.Create(Self);
+ Label3.XAlign := 0;
+ Label3.MarginStart := 5;
+ Label3.MarginEnd := 5;
+ Label3.MarginTop := 2;
+ Label3.MarginBottom := 2;
+ FindTextEntry := TGTKComboBoxEntry.Create(Self);
FindTextEntry.Tooltip := LANGSearch_FindTextEntryTooltip;
FindTextEntry.Entry.OnKeyDown := @FindTextEntryKeyDown;
if SearchTextHistory.Count > 0 then
for i := 0 to SearchTextHistory.Count - 1 do
- FindTextEntry.Items.Append(SearchTextHistory[i]);
+ FindTextEntry.AppendItem(SearchTextHistory[i]);
FindTextEntry.Entry.Text := '';
+ FindTextEntry.MarginStart := 5;
+ FindTextEntry.MarginEnd := 5;
+ FindTextEntry.MarginTop := 2;
+ FindTextEntry.MarginBottom := 2;
Label3.FocusControl := FindTextEntry.Entry;
Label3.UseMarkup := True;
Label3.UseUnderline := True;
CaseSensitiveCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_CaseSensitiveCheckButton);
+ CaseSensitiveCheckButton.MarginStart := 5;
+ CaseSensitiveCheckButton.MarginEnd := 5;
+ CaseSensitiveCheckButton.MarginTop := 2;
+ CaseSensitiveCheckButton.MarginBottom := 2;
StayCurrentFSCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_StayCurrentFSCheckButton);
+ StayCurrentFSCheckButton.MarginStart := 5;
+ StayCurrentFSCheckButton.MarginEnd := 5;
+ StayCurrentFSCheckButton.MarginTop := 2;
+ StayCurrentFSCheckButton.MarginBottom := 2;
CaseSensitiveMatchCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_CaseSensitiveMatchCheckButton);
-
- Table1.AddControlEx(0, 0, 1, 1, Label1, [taoShrink, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(1, 0, 1, 1, FileMaskEntry, [taoExpand, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(2, 0, 1, 1, CaseSensitiveMatchCheckButton, [taoShrink, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(0, 1, 1, 1, Label2, [taoShrink, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(1, 1, 1, 1, SearchInEntry, [taoExpand, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(2, 1, 1, 1, StayCurrentFSCheckButton, [taoShrink], [taoShrink], 5, 2);
- Table1.AddControlEx(1, 2, 2, 1, SearchArchivesCheckButton, [taoShrink, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(0, 3, 3, 1, TGTKHSeparator.Create(Self), [taoExpand, taoFill], [taoShrink], 5, 4);
- Table1.AddControlEx(0, 4, 1, 1, Label3, [taoShrink, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(1, 4, 2, 1, FindTextEntry, [taoExpand, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(1, 5, 2, 1, CaseSensitiveCheckButton, [taoShrink, taoFill], [taoShrink], 5, 2);
- Table1.AddControlEx(0, 6, 3, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 5, 2);
-
+ CaseSensitiveMatchCheckButton.MarginStart := 5;
+ CaseSensitiveMatchCheckButton.MarginEnd := 5;
+ CaseSensitiveMatchCheckButton.MarginTop := 2;
+ CaseSensitiveMatchCheckButton.MarginBottom := 2;
+
+ HSeparator := TGTKHSeparator.Create(Self);
+ HSeparator.MarginStart := 5;
+ HSeparator.MarginEnd := 5;
+ HSeparator.MarginTop := 4;
+ HSeparator.MarginBottom := 4;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 5;
+ VBox.MarginEnd := 5;
+ VBox.MarginTop := 2;
+ VBox.MarginBottom := 2;
+ Grid1.AddControl(0, 0, 1, 1, Label1);
+ Grid1.AddControl(1, 0, 1, 1, FileMaskEntry);
+ Grid1.AddControl(2, 0, 1, 1, CaseSensitiveMatchCheckButton);
+ Grid1.AddControl(0, 1, 1, 1, Label2);
+ Grid1.AddControl(1, 1, 1, 1, SearchInEntry);
+ Grid1.AddControl(2, 1, 1, 1, StayCurrentFSCheckButton);
+ Grid1.AddControl(1, 2, 2, 1, SearchArchivesCheckButton);
+ Grid1.AddControl(0, 3, 3, 1, HSeparator);
+ Grid1.AddControl(0, 4, 1, 1, Label3);
+ Grid1.AddControl(1, 4, 2, 1, FindTextEntry);
+ Grid1.AddControl(1, 5, 2, 1, CaseSensitiveCheckButton);
+ Grid1.AddControl(0, 6, 3, 1, VBox);
Label4 := TGTKLabel.Create(Self);
- Label4.XAlign := 0;
- Label4.XPadding := 0;
Label4.Caption := Format('<span weight="ultrabold">%s</span>', [LANGSearch_Size]);
Label4.UseMarkup := True;
+ Label4.XAlign := 0;
+ Label4.MarginStart := 5;
+ Label4.MarginEnd := 5;
Label5 := TGTKLabel.Create(Self);
- Label5.XAlign := 0;
- Label5.XPadding := 0;
Label5.Caption := Format('<span weight="ultrabold">%s</span>', [LANGSearch_Date]);
Label5.UseMarkup := True;
+ Label5.XAlign := 0;
+ Label5.MarginStart := 5;
+ Label5.MarginEnd := 5;
+ Label5.MarginTop := 1;
+ Label5.MarginBottom := 1;
BiggerThanCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_BiggerThan);
+ BiggerThanCheckButton.MarginStart := 2;
+ BiggerThanCheckButton.MarginEnd := 2;
SmallerThanCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_SmallerThan);
+ SmallerThanCheckButton.MarginStart := 5;
+ SmallerThanCheckButton.MarginEnd := 5;
BiggerThanEntry := TGTKSpinEdit.Create(Self);
BiggerThanEntry.Min := 0;
BiggerThanEntry.Max := 999999999;
BiggerThanEntry.Digits := 0;
BiggerThanEntry.IncrementStep := 1;
BiggerThanEntry.IncrementPage := 10;
+ BiggerThanEntry.MarginStart := 5;
+ BiggerThanEntry.MarginEnd := 5;
SmallerThanEntry := TGTKSpinEdit.Create(Self);
SmallerThanEntry.Min := 0;
SmallerThanEntry.Max := 999999999;
SmallerThanEntry.Digits := 0;
SmallerThanEntry.IncrementStep := 1;
SmallerThanEntry.IncrementPage := 10;
- BiggerThanOptionMenu := TGTKOptionMenu.Create(Self);
+ SmallerThanEntry.MarginStart := 5;
+ SmallerThanEntry.MarginEnd := 5;
+ BiggerThanComboBox := TGTKComboBoxText.Create(Self);
+ SmallerThanComboBox := TGTKComboBoxText.Create(Self);
for i := Low(SizeUnits) to High(SizeUnits) do begin
- MenuItem := TGTKMenuItem.Create(Self);
- MenuItem.Caption := SizeUnits[i];
- BiggerThanOptionMenu.Items.Add(MenuItem);
- end;
- SmallerThanOptionMenu := TGTKOptionMenu.Create(Self);
- for i := Low(SizeUnits) to High(SizeUnits) do begin
- MenuItem := TGTKMenuItem.Create(Self);
- MenuItem.Caption := SizeUnits[i];
- SmallerThanOptionMenu.Items.Add(MenuItem);
+ BiggerThanComboBox.AppendItem(SizeUnits[i]);
+ SmallerThanComboBox.AppendItem(SizeUnits[i]);
end;
+ BiggerThanComboBox.ItemIndex := 0;
+ SmallerThanComboBox.ItemIndex := 0;
ModifiedBetweenRadioButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_ModifiedBetweenRadioButton);
+ ModifiedBetweenRadioButton.MarginStart := 2;
+ ModifiedBetweenRadioButton.MarginEnd := 2;
+ ModifiedBetweenRadioButton.MarginTop := 2;
+ ModifiedBetweenRadioButton.MarginBottom := 2;
NotModifiedAfterRadioButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_NotModifiedAfterRadioButton);
+ NotModifiedAfterRadioButton.MarginStart := 2;
+ NotModifiedAfterRadioButton.MarginEnd := 2;
+ NotModifiedAfterRadioButton.MarginTop := 2;
+ NotModifiedAfterRadioButton.MarginBottom := 2;
ModifiedLastRadioButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_ModifiedLastRadioButton);
+ ModifiedLastRadioButton.MarginStart := 2;
+ ModifiedLastRadioButton.MarginEnd := 2;
+ ModifiedLastRadioButton.MarginTop := 2;
+ ModifiedLastRadioButton.MarginBottom := 2;
ModifiedNotLastRadionButton := TGTKCheckButton.CreateWithLabel(Self, LANGSearch_ModifiedNotLastRadionButton);
+ ModifiedNotLastRadionButton.MarginStart := 5;
+ ModifiedNotLastRadionButton.MarginEnd := 5;
+ ModifiedNotLastRadionButton.MarginTop := 2;
+ ModifiedNotLastRadionButton.MarginBottom := 2;
ModifiedLastSpinEdit := TGTKSpinEdit.Create(Self);
ModifiedLastSpinEdit.Min := 0;
ModifiedLastSpinEdit.Max := 10000;
ModifiedLastSpinEdit.Digits := 0;
ModifiedLastSpinEdit.IncrementStep := 1;
ModifiedLastSpinEdit.IncrementPage := 10;
+ ModifiedLastSpinEdit.MarginStart := 5;
+ ModifiedLastSpinEdit.MarginEnd := 5;
+ ModifiedLastSpinEdit.MarginTop := 2;
+ ModifiedLastSpinEdit.MarginBottom := 2;
ModifiedNotLastSpinEdit := TGTKSpinEdit.Create(Self);
ModifiedNotLastSpinEdit.Min := 0;
ModifiedNotLastSpinEdit.Max := 10000;
ModifiedNotLastSpinEdit.Digits := 0;
ModifiedNotLastSpinEdit.IncrementStep := 1;
ModifiedNotLastSpinEdit.IncrementPage := 10;
- ModifiedLastOptionMenu := TGTKOptionMenu.Create(Self);
- for i := Low(DayUnits) to High(DayUnits) do begin
- MenuItem := TGTKMenuItem.Create(Self);
- MenuItem.Caption := DayUnits[i];
- ModifiedLastOptionMenu.Items.Add(MenuItem);
- end;
- ModifiedNotLastOptionMenu := TGTKOptionMenu.Create(Self);
+ ModifiedNotLastSpinEdit.MarginStart := 5;
+ ModifiedNotLastSpinEdit.MarginEnd := 5;
+ ModifiedNotLastSpinEdit.MarginTop := 2;
+ ModifiedNotLastSpinEdit.MarginBottom := 2;
+ ModifiedLastComboBox := TGTKComboBoxText.Create(Self);
+ ModifiedNotLastComboBox := TGTKComboBoxText.Create(Self);
for i := Low(DayUnits) to High(DayUnits) do begin
- MenuItem := TGTKMenuItem.Create(Self);
- MenuItem.Caption := DayUnits[i];
- ModifiedNotLastOptionMenu.Items.Add(MenuItem);
+ ModifiedLastComboBox.AppendItem(DayUnits[i]);
+ ModifiedNotLastComboBox.AppendItem(DayUnits[i]);
end;
+ ModifiedLastComboBox.MarginStart := 2;
+ ModifiedLastComboBox.MarginEnd := 2;
+ ModifiedLastComboBox.MarginTop := 2;
+ ModifiedLastComboBox.MarginBottom := 2;
+ ModifiedNotLastComboBox.MarginTop := 2;
+ ModifiedNotLastComboBox.MarginBottom := 2;
Label6 := TGTKLabel.Create(Self);
- Label6.XAlign := 0;
- Label6.XPadding := 0;
Label6.Caption := LANGSearch_And;
Label6.UseMarkup := True;
-
- if not FUseGnomeWidgets then begin
- ModifiedBetweenEntry1 := TGTKEntry.Create(Self);
- ModifiedBetweenEntry1.Tooltip := SysUtils.FormatDateTime(LANGSearch_ModifiedBetweenEntry1, Date);
- ModifiedBetweenEntry2 := TGTKEntry.Create(Self);
- ModifiedBetweenEntry2.Tooltip := SysUtils.FormatDateTime(LANGSearch_ModifiedBetweenEntry1, Date);
- NotModifiedAfterEntry := TGTKEntry.Create(Self);
- NotModifiedAfterEntry.Tooltip := SysUtils.FormatDateTime(LANGSearch_ModifiedBetweenEntry1, Date);
- Table2.AddControlEx(2, 5, 2, 1, ModifiedBetweenEntry1, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(5, 5, 2, 1, ModifiedBetweenEntry2, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 6, 2, 1, NotModifiedAfterEntry, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- end else begin
- ModifiedBetweenEntry1G := TGnomeDateEdit.Create(Self);
- ModifiedBetweenEntry2G := TGnomeDateEdit.Create(Self);
- NotModifiedAfterEntryG := TGnomeDateEdit.Create(Self);
- Table2.AddControlEx(2, 5, 2, 1, ModifiedBetweenEntry1G, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(5, 5, 2, 1, ModifiedBetweenEntry2G, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(2, 6, 2, 1, NotModifiedAfterEntryG, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- end;
-
- Table2.AddControlEx(0, 0, 3, 1, Label4, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 0);
- Table2.AddControlEx(0, 1, 1, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 8, 0);
- Table2.AddControlEx(1, 1, 1, 1, BiggerThanCheckButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 0);
- Table2.AddControlEx(2, 1, 1, 1, BiggerThanEntry, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 0);
- Table2.AddControlEx(3, 1, 1, 1, BiggerThanOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- Table2.AddControlEx(5, 1, 1, 1, SmallerThanCheckButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 0);
- Table2.AddControlEx(6, 1, 1, 1, SmallerThanEntry, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 0);
- Table2.AddControlEx(7, 1, 1, 1, SmallerThanOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 0);
- Table2.AddControlEx(1, 3, 3, 1, TGTKVBox.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 6);
- Table2.AddControlEx(0, 4, 3, 1, Label5, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 1);
- Table2.AddControlEx(1, 5, 1, 1, ModifiedBetweenRadioButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 2);
- Table2.AddControlEx(4, 5, 1, 1, Label6, [taoShrink], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(1, 6, 1, 1, NotModifiedAfterRadioButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 2);
- Table2.AddControlEx(1, 7, 1, 1, ModifiedLastRadioButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 2);
- Table2.AddControlEx(2, 7, 1, 1, ModifiedLastSpinEdit, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(3, 7, 1, 1, ModifiedLastOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 2);
- Table2.AddControlEx(4, 7, 2, 1, ModifiedNotLastRadionButton, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(6, 7, 1, 1, ModifiedNotLastSpinEdit, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table2.AddControlEx(7, 7, 1, 1, ModifiedNotLastOptionMenu, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 2);
+ Label6.XAlign := 0;
+ Label6.MarginStart := 5;
+ Label6.MarginEnd := 5;
+ Label6.MarginTop := 2;
+ Label6.MarginBottom := 2;
+
+ ModifiedBetweenEntry1 := TGTKEntry.Create(Self);
+ ModifiedBetweenEntry1.Tooltip := SysUtils.FormatDateTime(LANGSearch_ModifiedBetweenEntry1, Date);
+ ModifiedBetweenEntry1.MarginStart := 5;
+ ModifiedBetweenEntry1.MarginEnd := 5;
+ ModifiedBetweenEntry1.MarginTop := 2;
+ ModifiedBetweenEntry1.MarginBottom := 2;
+ ModifiedBetweenEntry2 := TGTKEntry.Create(Self);
+ ModifiedBetweenEntry2.Tooltip := SysUtils.FormatDateTime(LANGSearch_ModifiedBetweenEntry1, Date);
+ ModifiedBetweenEntry2.MarginStart := 5;
+ ModifiedBetweenEntry2.MarginEnd := 5;
+ ModifiedBetweenEntry2.MarginTop := 2;
+ ModifiedBetweenEntry2.MarginBottom := 2;
+ NotModifiedAfterEntry := TGTKEntry.Create(Self);
+ NotModifiedAfterEntry.Tooltip := SysUtils.FormatDateTime(LANGSearch_ModifiedBetweenEntry1, Date);
+ NotModifiedAfterEntry.MarginStart := 5;
+ NotModifiedAfterEntry.MarginEnd := 5;
+ NotModifiedAfterEntry.MarginTop := 2;
+ NotModifiedAfterEntry.MarginBottom := 2;
+ Grid2.AddControl(2, 5, 2, 1, ModifiedBetweenEntry1);
+ Grid2.AddControl(5, 5, 2, 1, ModifiedBetweenEntry2);
+ Grid2.AddControl(2, 6, 2, 1, NotModifiedAfterEntry);
+
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 8;
+ VBox.MarginEnd := 8;
+ Grid2.AddControl(0, 0, 3, 1, Label4);
+ Grid2.AddControl(0, 1, 1, 1, VBox);
+ Grid2.AddControl(1, 1, 1, 1, BiggerThanCheckButton);
+ Grid2.AddControl(2, 1, 1, 1, BiggerThanEntry);
+ Grid2.AddControl(3, 1, 1, 1, BiggerThanComboBox);
+ Grid2.AddControl(5, 1, 1, 1, SmallerThanCheckButton);
+ Grid2.AddControl(6, 1, 1, 1, SmallerThanEntry);
+ Grid2.AddControl(7, 1, 1, 1, SmallerThanComboBox);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginTop := 6;
+ VBox.MarginBottom := 6;
+ Grid2.AddControl(1, 3, 3, 1, VBox);
+ Grid2.AddControl(0, 4, 3, 1, Label5);
+ Grid2.AddControl(1, 5, 1, 1, ModifiedBetweenRadioButton);
+ Grid2.AddControl(4, 5, 1, 1, Label6);
+ Grid2.AddControl(1, 6, 1, 1, NotModifiedAfterRadioButton);
+ Grid2.AddControl(1, 7, 1, 1, ModifiedLastRadioButton);
+ Grid2.AddControl(2, 7, 1, 1, ModifiedLastSpinEdit);
+ Grid2.AddControl(3, 7, 1, 1, ModifiedLastComboBox);
+ Grid2.AddControl(4, 7, 2, 1, ModifiedNotLastRadionButton);
+ Grid2.AddControl(6, 7, 1, 1, ModifiedNotLastSpinEdit);
+ Grid2.AddControl(7, 7, 1, 1, ModifiedNotLastComboBox);
BottomBox := TGTKVBox.Create(Self);
@@ -356,7 +441,6 @@ begin
FeedToListboxButton.Visible := True;
StatusLabel := TGTKLabel.Create(Self);
StatusLabel.XAlign := 0;
- StatusLabel.XPadding := 0;
StatusLabel.Caption := Format('<span weight="ultrabold">%s</span> %s', [LANGSearch_StatusSC, LANGSearch_Ready]);
StatusLabel.UseMarkup := True;
StatusLabel.SetSizeRequest(100, -1);
@@ -373,12 +457,15 @@ begin
BottomBox.AddControlEx(HBox2, False, False, 2);
ClientArea.AddControlEx(BottomBox, True, True, 5);
- FindButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_FIND);
+ FindButton := TGTKButton.CreateFromIconName(Self, GTK_STOCK_FIND);
+ FindButton.Caption := 'Find';
FindButton.Default := True;
- StopButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_STOP);
+ StopButton := TGTKButton.CreateFromIconName(Self, GTK_STOCK_STOP);
+ StopButton.Caption := 'Stop';
StopButton.Visible := False;
StopButton.Default := True;
- CloseButton := TGTKButton.CreateFromStock(Self, GTK_STOCK_CLOSE);
+ CloseButton := TGTKButton.CreateFromIconName(Self, GTK_STOCK_CLOSE);
+ CloseButton.Caption := 'Close';
CloseButton.Default := True;
Default := FindButton;
ButtonBox := TGTKHButtonBox.Create(Self);
@@ -461,23 +548,23 @@ end;
procedure TFSearch.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_F3: if FileList.Focused and Assigned(FileList.Selected) then begin
- Accept := False;
- ViewButtonClick(Sender);
- end;
- GDK_RETURN, GDK_KP_ENTER: if FileList.Focused and Assigned(FileList.Selected) then begin
- Accept := False;
- GoToFileButtonClick(Sender);
- end else
- if FindButton.Visible then begin
- FindButtonClick(Sender);
- Accept := False;
- end;
- GDK_ESCAPE: begin
+ GDK_KEY_F3: if FileList.Focused and Assigned(FileList.Selected) then begin
Accept := False;
- if Processing then Stop := True
- else ModalResult := mbCancel;
+ ViewButtonClick(Sender);
end;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: if FileList.Focused and Assigned(FileList.Selected) then begin
+ Accept := False;
+ GoToFileButtonClick(Sender);
+ end else
+ if FindButton.Visible then begin
+ FindButtonClick(Sender);
+ Accept := False;
+ end;
+ GDK_KEY_Escape: begin
+ Accept := False;
+ if Processing then Stop := True
+ else ModalResult := mbCancel;
+ end;
end;
end;
@@ -488,23 +575,19 @@ begin
s := Trim(FileMaskEntry.Entry.Text);
if Length(s) > 0 then begin
SaveItemToHistory(s, SearchHistory);
- if FileMaskEntry.Items.Count > 0 then
- for i := FileMaskEntry.Items.Count - 1 downto 0 do
- FileMaskEntry.Items.Delete(i);
+ FileMaskEntry.ClearItems();
if SearchHistory.Count > 0 then
for i := 0 to SearchHistory.Count - 1 do
- FileMaskEntry.Items.Append(SearchHistory[i]);
+ FileMaskEntry.AppendItem(SearchHistory[i]);
end;
s := Trim(FindTextEntry.Entry.Text);
if Length(s) > 0 then begin
SaveItemToHistory(s, SearchTextHistory);
- if FindTextEntry.Items.Count > 0 then
- for i := FindTextEntry.Items.Count - 1 downto 0 do
- FindTextEntry.Items.Delete(i);
+ FindTextEntry.ClearItems();
if SearchTextHistory.Count > 0 then
for i := 0 to SearchTextHistory.Count - 1 do
- FindTextEntry.Items.Append(SearchTextHistory[i]);
+ FindTextEntry.AppendItem(SearchTextHistory[i]);
end;
DoSearch;
@@ -524,23 +607,17 @@ end;
procedure TFSearch.BiggerThanCheckButtonToggled(Sender: TObject);
begin
BiggerThanEntry.Enabled := BiggerThanCheckButton.Checked;
- BiggerThanOptionMenu.Enabled := BiggerThanCheckButton.Checked;
+ BiggerThanComboBox.Enabled := BiggerThanCheckButton.Checked;
SmallerThanEntry.Enabled := SmallerThanCheckButton.Checked;
- SmallerThanOptionMenu.Enabled := SmallerThanCheckButton.Checked;
+ SmallerThanComboBox.Enabled := SmallerThanCheckButton.Checked;
Label6.Enabled := ModifiedBetweenRadioButton.Checked;
ModifiedLastSpinEdit.Enabled := ModifiedLastRadioButton.Checked;
- ModifiedLastOptionMenu.Enabled := ModifiedLastRadioButton.Checked;
+ ModifiedLastComboBox.Enabled := ModifiedLastRadioButton.Checked;
ModifiedNotLastSpinEdit.Enabled := ModifiedNotLastRadionButton.Checked;
- ModifiedNotLastOptionMenu.Enabled := ModifiedNotLastRadionButton.Checked;
- if not FUseGnomeWidgets then begin
- ModifiedBetweenEntry1.Enabled := ModifiedBetweenRadioButton.Checked;
- ModifiedBetweenEntry2.Enabled := ModifiedBetweenRadioButton.Checked;
- NotModifiedAfterEntry.Enabled := NotModifiedAfterRadioButton.Checked;
- end else begin
- ModifiedBetweenEntry1G.Enabled := ModifiedBetweenRadioButton.Checked;
- ModifiedBetweenEntry2G.Enabled := ModifiedBetweenRadioButton.Checked;
- NotModifiedAfterEntryG.Enabled := NotModifiedAfterRadioButton.Checked;
- end;
+ ModifiedNotLastComboBox.Enabled := ModifiedNotLastRadionButton.Checked;
+ ModifiedBetweenEntry1.Enabled := ModifiedBetweenRadioButton.Checked;
+ ModifiedBetweenEntry2.Enabled := ModifiedBetweenRadioButton.Checked;
+ NotModifiedAfterEntry.Enabled := NotModifiedAfterRadioButton.Checked;
end;
procedure TFSearch.FileListSelectionChanged(Sender: TObject);
@@ -628,13 +705,13 @@ var Orig, s: string;
i: integer;
begin
case Key of
- GDK_UP, GDK_DOWN: if Shift = [] then begin
+ GDK_KEY_Up, GDK_KEY_Down: if Shift = [] then begin
Accept := False;
if SearchHistory.Count > 0 then begin
Orig := Trim(FileMaskEntry.Entry.Text);
i := SearchHistory.IndexOf(Orig);
- if Key = GDK_DOWN then begin
+ if Key = GDK_KEY_Down then begin
if i < 0 then begin
SavedData := Orig;
i := 0;
@@ -663,13 +740,13 @@ var Orig, s: string;
i: integer;
begin
case Key of
- GDK_UP, GDK_DOWN: if Shift = [] then begin
+ GDK_KEY_Up, GDK_KEY_Down: if Shift = [] then begin
Accept := False;
if SearchTextHistory.Count > 0 then begin
Orig := Trim(FindTextEntry.Entry.Text);
i := SearchTextHistory.IndexOf(Orig);
- if Key = GDK_DOWN then begin
+ if Key = GDK_KEY_Down then begin
if i < 0 then begin
SavedData := Orig;
i := 0;
@@ -713,8 +790,8 @@ begin
StatusLabel.UseMarkup := True;
// Disable the UI
- Table1.Enabled := False;
- Table2.Enabled := False;
+ Grid1.Enabled := False;
+ Grid2.Enabled := False;
// Clear the items
FileList.Items.Clear;
@@ -738,35 +815,26 @@ begin
FSearchArchives := SearchArchivesCheckButton.Checked;
if not BiggerThanCheckButton.Checked then FBiggerThan := -1 else begin
i := StrToIntDef(BiggerThanEntry.Text, -1);
- i := i * Trunc(Power(1024, BiggerThanOptionMenu.ItemIndex));
+ i := i * Trunc(Power(1024, BiggerThanComboBox.ItemIndex));
FBiggerThan := i;
end;
if not SmallerThanCheckButton.Checked then FSmallerThan := -1 else begin
i := StrToIntDef(SmallerThanEntry.Text, -1);
- i := i * Trunc(Power(1024, SmallerThanOptionMenu.ItemIndex));
+ i := i * Trunc(Power(1024, SmallerThanComboBox.ItemIndex));
FSmallerThan := i;
end;
FModifiedBetween1 := 0;
FModifiedBetween2 := 0;
FNotModifiedAfter := 0;
- if not FUseGnomeWidgets then begin
- if ModifiedBetweenRadioButton.Checked then begin
- FModifiedBetween1 := StrTotimetDef(ModifiedBetweenEntry1.Text, 0);
- FModifiedBetween2 := StrTotimetDef(ModifiedBetweenEntry2.Text, 0);
- end;
- if NotModifiedAfterRadioButton.Checked then
- FNotModifiedAfter := StrTotimetDef(NotModifiedAfterEntry.Text, 0);
- end else begin
- if ModifiedBetweenRadioButton.Checked then begin
- FModifiedBetween1 := ModifiedBetweenEntry1G.Time;
- FModifiedBetween2 := ModifiedBetweenEntry2G.Time;
- end;
- if NotModifiedAfterRadioButton.Checked then
- FNotModifiedAfter := NotModifiedAfterEntryG.Time;
+ if ModifiedBetweenRadioButton.Checked then begin
+ FModifiedBetween1 := StrTotimetDef(ModifiedBetweenEntry1.Text, 0);
+ FModifiedBetween2 := StrTotimetDef(ModifiedBetweenEntry2.Text, 0);
end;
+ if NotModifiedAfterRadioButton.Checked then
+ FNotModifiedAfter := StrTotimetDef(NotModifiedAfterEntry.Text, 0);
if not ModifiedLastRadioButton.Checked then FModifiedLast := -1 else begin
i := StrToIntDef(ModifiedLastSpinEdit.Text, -1);
- case ModifiedLastOptionMenu.ItemIndex of
+ case ModifiedLastComboBox.ItemIndex of
1: i := i * 7; // weeks
2: i := i * 30; // months
3: i := i * 365; // years
@@ -775,7 +843,7 @@ begin
end;
if not ModifiedNotLastRadionButton.Checked then FModifiedNotLast := -1 else begin
i := StrToIntDef(ModifiedNotLastSpinEdit.Text, -1);
- case ModifiedNotLastOptionMenu.ItemIndex of
+ case ModifiedNotLastComboBox.ItemIndex of
1: i := i * 7; // weeks
2: i := i * 30; // months
3: i := i * 365; // years
@@ -835,8 +903,8 @@ begin
DebugMsg(['DoSearch: cannot change back to saved directory']);
// Enable the UI
- Table1.Enabled := True;
- Table2.Enabled := True;
+ Grid1.Enabled := True;
+ Grid2.Enabled := True;
end;
end;
diff --git a/USelect.pas b/USelect.pas
index 5fcc8cc..dba8422 100644
--- a/USelect.pas
+++ b/USelect.pas
@@ -22,7 +22,7 @@ unit USelect;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts, GTKClasses;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls;
type
TFSelect = class(TGTKDialog)
@@ -33,7 +33,7 @@ type
TitleHBox: TGTKHBox; }
Label1: TGTKLabel;
- ComboBox: TGTKCombo;
+ ComboBox: TGTKComboBoxEntry;
Box: TGTKVBox;
procedure FormCreate(Sender: TObject); override;
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
@@ -84,12 +84,10 @@ begin
Label1.Caption := LANGSpecifyFileType;
Label1.UseUnderline := True;
Label1.XAlign := 0;
- Label1.XPadding := 0;
- ComboBox := TGTKCombo.Create(Self);
- ComboBox.DisableActivate;
+ ComboBox := TGTKComboBoxEntry.Create(Self);
if SelectHistory.Count > 0 then
for i := 0 to SelectHistory.Count - 1 do
- ComboBox.Items.Append(SelectHistory[i]);
+ ComboBox.AppendItem(SelectHistory[i]);
ComboBox.Entry.Text := '*.*';
ComboBox.Entry.OnKeyDown := @ComboBoxKeyDown;
Label1.FocusControl := ComboBox.Entry;
@@ -104,8 +102,8 @@ end;
procedure TFSelect.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
@@ -114,33 +112,33 @@ var Orig, s: string;
i: integer;
begin
case Key of
- GDK_UP, GDK_DOWN: if Shift = [] then begin
- Accept := False;
- if SelectHistory.Count > 0 then begin
- Orig := Trim(ComboBox.Entry.Text);
- i := SelectHistory.IndexOf(Orig);
-
- if Key = GDK_DOWN then begin
- if i < 0 then begin
- SavedData := Orig;
- i := 0;
- end else
- if SelectHistory.Count > i + 1 then Inc(i);
- s := SelectHistory[i];
- end else begin
- if i < 0 then Exit else
- if i = 0 then begin
- s := SavedData;
- SavedData := '';
- end else
- if SelectHistory.Count > i then s := SelectHistory[i - 1];
- end;
-
- ComboBox.Entry.Text := s;
- ComboBox.Entry.SetFocus;
- ComboBox.Entry.SelectAll;
- end;
- end;
+ GDK_KEY_Up, GDK_KEY_Down: if Shift = [] then begin
+ Accept := False;
+ if SelectHistory.Count > 0 then begin
+ Orig := Trim(ComboBox.Entry.Text);
+ i := SelectHistory.IndexOf(Orig);
+
+ if Key = GDK_KEY_Down then begin
+ if i < 0 then begin
+ SavedData := Orig;
+ i := 0;
+ end else
+ if SelectHistory.Count > i + 1 then Inc(i);
+ s := SelectHistory[i];
+ end else begin
+ if i < 0 then Exit else
+ if i = 0 then begin
+ s := SavedData;
+ SavedData := '';
+ end else
+ if SelectHistory.Count > i then s := SelectHistory[i - 1];
+ end;
+
+ ComboBox.Entry.Text := s;
+ ComboBox.Entry.SetFocus;
+ ComboBox.Entry.SelectAll;
+ end;
+ end;
end;
end;
diff --git a/USplitFile.pas b/USplitFile.pas
index 39e9505..d7df1b3 100644
--- a/USplitFile.pas
+++ b/USplitFile.pas
@@ -22,7 +22,7 @@ unit USplitFile;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls;
type
TFSplitFile = class(TGTKDialog)
@@ -30,7 +30,7 @@ type
Entry: TGTKEntry;
Box: TGTKVBox;
SizeBox: TGTKHBox;
- SizeCombo: TGTKCombo;
+ SizeCombo: TGTKComboBoxEntry;
DeleteTargetCheckBox: TGTKCheckButton;
procedure FormCreate(Sender: TObject); override;
procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
@@ -71,7 +71,6 @@ begin
Box := TGTKVBox.Create(Self);
Label1 := TGTKLabel.Create(Self);
Label1.XAlign := 0;
- Label1.XPadding := 0;
Entry := TGTKEntry.Create(Self);
Label1.FocusControl := Entry;
Box.AddControlEx(Label1, False, False, 0);
@@ -82,14 +81,15 @@ begin
SizeBox.Homogeneous := False;
Label2 := TGTKLabel.Create(Self);
Label2.XAlign := 0;
- Label2.XPadding := 10;
+ Label2.MarginStart := 10;
+ Label2.MarginEnd := 10;
Label2.Caption := LANGBytesPerFile;
- SizeCombo := TGTKCombo.Create(Self);
+ SizeCombo := TGTKComboBoxEntry.Create(Self);
Label2.FocusControl := SizeCombo.Entry;
Label2.UseUnderline := True;
- SizeCombo.Items.Append(LANGAutomatic);
+ SizeCombo.AppendItem(LANGAutomatic);
for i := 1 to Length(SplitConsts) do
- SizeCombo.Items.Append(SplitConsts[i].Title);
+ SizeCombo.AppendItem(SplitConsts[i].Title);
SizeCombo.Entry.Text := LANGAutomatic;
SizeBox.AddControlEx(Label2, False, False, 0);
SizeBox.AddControlEx(SizeCombo, False, False, 5);
@@ -105,8 +105,8 @@ end;
procedure TFSplitFile.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
diff --git a/USymlink.pas b/USymlink.pas
index 40a7cd6..f107d92 100644
--- a/USymlink.pas
+++ b/USymlink.pas
@@ -22,7 +22,7 @@ unit USymlink;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls;
type
TFSymlink = class(TGTKDialog)
@@ -57,14 +57,12 @@ begin
Label1.Caption := LANGFSymlink_ExistingFilename;
Label1.UseUnderline := True;
Label1.XAlign := 0;
- Label1.XPadding := 0;
FromEntry := TGTKEntry.Create(Self);
Label1.FocusControl := FromEntry;
Label2 := TGTKLabel.Create(Self);
Label2.Caption := LANGFSymlink_SymlinkFilename;
Label2.UseUnderline := True;
Label2.XAlign := 0;
- Label2.XPadding := 0;
ToEntry := TGTKEntry.Create(Self);
Label2.FocusControl := ToEntry;
RelativeCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGFSymlink_RelativePath);
@@ -84,8 +82,8 @@ end;
procedure TFSymlink.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
diff --git a/UTestPlugin.pas b/UTestPlugin.pas
index 1673103..5e90de4 100644
--- a/UTestPlugin.pas
+++ b/UTestPlugin.pas
@@ -22,8 +22,7 @@ unit UTestPlugin;
interface
uses
- SysUtils, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts,
- GTKPixbuf, GTKMenus;
+ SysUtils, Classes, lazgdk3, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKPixbuf;
type
TFTestPlugin = class(TGTKDialog)
@@ -32,9 +31,9 @@ type
TitleEventBox: TGTKEventBox;
TitleIcon: TGTKImage;
TitleHBox: TGTKHBox;
- Table: TGTKTable;
+ Grid: TGTKGrid;
Label1, Label2, Label3, Label4: TGTKLabel;
- PluginOptionMenu: TGTKOptionMenu;
+ PluginComboBox: TGTKComboBoxText;
CommandEntry, UserEntry, PasswordEntry: TGTKEntry;
ExperimentalWarningLabel: TGTKLabel;
ExperimentalWarningIcon: TGTKImage;
@@ -56,25 +55,26 @@ uses UVFSCore, ULocale;
procedure TFTestPlugin.FormCreate(Sender: TObject);
var i: integer;
- MenuItem: TGTKMenuItem;
+ VBox: TGTKVBox;
begin
SetDefaultSize(400, 200);
Caption := LANGTestPlugin_Caption;
Buttons := [mbOK, mbCancel];
DefaultButton := mbOK;
- ShowSeparator := False;
TitleEventBox := TGTKEventBox.Create(Self);
TitleLabel := TGTKLabel.Create(Self);
TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [LANGTestPlugin_Title]);
TitleLabel.UseMarkup := True;
TitleLabel.XAlign := 0;
- TitleLabel.XPadding := 0;
- TitleLabel.YPadding := 3;
+ TitleLabel.MarginStart := 0;
+ TitleLabel.MarginEnd := 0;
+ TitleLabel.MarginTop := 3;
+ TitleLabel.MarginBottom := 3;
TitleEventBox.ControlState := csPrelight;
TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
TitleFrame.ShadowType := stShadowOut;
TitleIcon := TGTKImage.Create(Self);
- TitleIcon.SetFromStock('gtk-justify-center', isLargeToolbar);
+ TitleIcon.SetFromIconName('gtk-justify-center', isLargeToolbar);
TitleHBox := TGTKHBox.Create(Self);
TitleHBox.Homogeneous := False;
TitleHBox.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
@@ -86,74 +86,121 @@ begin
HBox4 := TGTKHBox.Create(Self);
HBox4.Homogeneous := False;
+ HBox4.MarginStart := 5;
+ HBox4.MarginEnd := 5;
+ HBox4.MarginTop := 2;
+ HBox4.MarginBottom := 2;
ExperimentalWarningLabel := TGTKLabel.Create(Self);
ExperimentalWarningLabel.Caption := LANGTestPlugin_ExperimentalWarningLabelCaption;
ExperimentalWarningLabel.UseMarkup := True;
ExperimentalWarningLabel.LineWrap := True;
ExperimentalWarningLabel.SetSizeRequest(300, -1);
ExperimentalWarningIcon := TGTKImage.Create(Self);
- ExperimentalWarningIcon.SetFromStock('gtk-dialog-warning', isDialog);
+ ExperimentalWarningIcon.SetFromIconName('gtk-dialog-warning', isDialog);
HBox4.AddControlEx(TGTKEventBox.Create(Self), False, False, 5);
HBox4.AddControlEx(ExperimentalWarningIcon, False, False, 7);
HBox4.AddControlEx(ExperimentalWarningLabel, True, True, 7);
HBox4.AddControlEx(TGTKEventBox.Create(Self), False, False, 8);
- Table := TGTKTable.Create(Self);
- Table.BorderWidth := 20;
- ClientArea.AddControlEx(Table, True, True, 0);
- Table.AddControlEx(0, 0, 2, 1, HBox4, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table.AddControlEx(0, 1, 2, 1, TGTKEventBox.Create(Self), [taoShrink, taoFill], [taoShrink], 5, 10);
+ Grid := TGTKGrid.Create(Self);
+ Grid.BorderWidth := 20;
+ ClientArea.AddControlEx(Grid, True, True, 0);
+ Grid.AddControl(0, 0, 2, 1, HBox4);
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 5;
+ VBox.MarginEnd := 5;
+ VBox.MarginTop := 10;
+ VBox.MarginBottom := 10;
+ Grid.AddControl(0, 1, 2, 1, VBox);
Label1 := TGTKLabel.Create(Self);
- Label1.XAlign := 0;
Label1.Caption := LANGTestPlugin_Plugin;
+ Label1.XAlign := 0;
+ Label1.MarginStart := 5;
+ Label1.MarginEnd := 5;
+ Label1.MarginTop := 2;
+ Label1.MarginBottom := 2;
Label2 := TGTKLabel.Create(Self);
- Label2.XAlign := 0;
Label2.Caption := LANGTestPlugin_Command;
- PluginOptionMenu := TGTKOptionMenu.Create(Self);
- Label1.FocusControl := PluginOptionMenu;
+ Label2.XAlign := 0;
+ Label2.MarginStart := 5;
+ Label2.MarginEnd := 5;
+ Label2.MarginTop := 2;
+ Label2.MarginBottom := 2;
+ PluginComboBox := TGTKComboBoxText.Create(Self);
+ PluginComboBox.MarginStart := 5;
+ PluginComboBox.MarginEnd := 5;
+ PluginComboBox.MarginTop := 2;
+ PluginComboBox.MarginBottom := 2;
+ Label1.FocusControl := PluginComboBox;
Label1.UseUnderline := True;
CommandEntry := TGTKEntry.Create(Self);
+ CommandEntry.MarginStart := 5;
+ CommandEntry.MarginEnd := 5;
+ CommandEntry.MarginTop := 2;
+ CommandEntry.MarginBottom := 2;
Label2.FocusControl := CommandEntry;
Label2.UseUnderline := True;
- Table.AddControlEx(0, 2, 1, 1, Label1, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table.AddControlEx(0, 3, 1, 1, Label2, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table.AddControlEx(1, 2, 1, 1, PluginOptionMenu, [taoExpand, taoFill], [taoShrink], 5, 2);
- Table.AddControlEx(1, 3, 1, 1, CommandEntry, [taoExpand, taoFill], [taoShrink], 5, 2);
+ Grid.AddControl(0, 2, 1, 1, Label1);
+ Grid.AddControl(0, 3, 1, 1, Label2);
+ Grid.AddControl(1, 2, 1, 1, PluginComboBox);
+ Grid.AddControl(1, 3, 1, 1, CommandEntry);
Label3 := TGTKLabel.Create(Self);
- Label3.XAlign := 0;
Label3.Caption := LANGTestPlugin_Username;
UserEntry := TGTKEntry.Create(Self);
+ UserEntry.MarginStart := 5;
+ UserEntry.MarginEnd := 5;
+ UserEntry.MarginTop := 2;
+ UserEntry.MarginBottom := 2;
Label3.FocusControl := UserEntry;
Label3.UseUnderline := True;
+ Label3.XAlign := 0;
+ Label3.MarginStart := 5;
+ Label3.MarginEnd := 5;
+ Label3.MarginTop := 2;
+ Label3.MarginBottom := 2;
Label4 := TGTKLabel.Create(Self);
Label4.XAlign := 0;
Label4.Caption := LANGTestPlugin_Password;
+ Label4.MarginStart := 5;
+ Label4.MarginEnd := 5;
+ Label4.MarginTop := 2;
+ Label4.MarginBottom := 2;
PasswordEntry := TGTKEntry.Create(Self);
+ PasswordEntry.MarginStart := 5;
+ PasswordEntry.MarginEnd := 5;
+ PasswordEntry.MarginTop := 2;
+ PasswordEntry.MarginBottom := 2;
Label4.FocusControl := PasswordEntry;
Label4.UseUnderline := True;
AnonymousCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGTestPlugin_AnonymousCheckButton);
AnonymousCheckButton.OnToggled := @AnonymousCheckButtonToggled;
AnonymousCheckButton.Checked := True;
- Table.AddControlEx(0, 4, 2, 1, TGTKEventBox.Create(Self), [taoShrink, taoFill], [taoExpand, taoFill], 5, 4);
- Table.AddControlEx(0, 5, 1, 1, Label3, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table.AddControlEx(1, 5, 1, 1, UserEntry, [taoExpand, taoFill], [taoShrink], 5, 2);
- Table.AddControlEx(0, 6, 1, 1, Label4, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 2);
- Table.AddControlEx(1, 6, 1, 1, PasswordEntry, [taoExpand, taoFill], [taoShrink], 5, 2);
- Table.AddControlEx(0, 7, 2, 1, AnonymousCheckButton, [taoExpand, taoFill], [taoShrink], 20, 2);
+ AnonymousCheckButton.MarginStart := 20;
+ AnonymousCheckButton.MarginEnd := 20;
+ AnonymousCheckButton.MarginTop := 2;
+ AnonymousCheckButton.MarginBottom := 2;
+ VBox := TGTKVBox.Create(Self);
+ VBox.MarginStart := 5;
+ VBox.MarginEnd := 5;
+ VBox.MarginTop := 4;
+ VBox.MarginBottom := 4;
+ Grid.AddControl(0, 4, 2, 1, VBox);
+ Grid.AddControl(0, 5, 1, 1, Label3);
+ Grid.AddControl(1, 5, 1, 1, UserEntry);
+ Grid.AddControl(0, 6, 1, 1, Label4);
+ Grid.AddControl(1, 6, 1, 1, PasswordEntry);
+ Grid.AddControl(0, 7, 2, 1, AnonymousCheckButton);
if PluginList.Count = 0 then begin
- MenuItem := TGTKMenuItem.CreateTyped(Self, itLabel);
- MenuItem.Caption := LANGTestPlugin_NoPluginsFound;
- MenuItem.Enabled := False;
- PluginOptionMenu.Items.Add(MenuItem);
+ PluginComboBox.AppendItem(LANGTestPlugin_NoPluginsFound);
+ PluginComboBox.Enabled := False;
end else
for i := 0 to PluginList.Count - 1 do begin
- MenuItem := TGTKMenuItem.CreateTyped(Self, itImageText);
- MenuItem.SetCaptionPlain(Format('%s [%s]', [TVFSPlugin(PluginList[i]).ModuleName,
- ExtractFileName(TVFSPlugin(PluginList[i]).FullModulePath)]));
- PluginOptionMenu.Items.Add(MenuItem);
+ PluginComboBox.AppendItemID(TVFSPlugin(PluginList[i]).ModuleID,
+ Format('%s [%s]', [TVFSPlugin(PluginList[i]).ModuleName,
+ ExtractFileName(TVFSPlugin(PluginList[i]).FullModulePath)]));
end;
OnKeyDown := @FormKeyDown;
@@ -162,8 +209,8 @@ end;
procedure TFTestPlugin.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
case Key of
- GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK;
- GDK_ESCAPE: ModalResult := mbCancel;
+ GDK_KEY_Return, GDK_KEY_KP_Enter: ModalResult := mbOK;
+ GDK_KEY_Escape: ModalResult := mbCancel;
end;
end;
diff --git a/UToolTips.pas b/UToolTips.pas
index 6926456..8ce6666 100644
--- a/UToolTips.pas
+++ b/UToolTips.pas
@@ -22,7 +22,7 @@ unit UToolTips;
interface
-uses lazglib2, lazgobject2, gdk2, gtk2, pango;
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, lazpango1;
procedure FileListTipsInstall(ATreeView: PGtkTreeView);
procedure FileListTipsEnable;
@@ -55,8 +55,11 @@ function tips_button_press_event(widget: PGtkWidget; event: PGdkEventButton; use
procedure FileListTipsInstall(ATreeView: PGtkTreeView);
begin
+ // TODO
+{
g_signal_connect_data(PGObject(ATreeView), 'event-after', TGCallback(@event_handler), nil, nil, [G_CONNECT_AFTER]);
g_signal_connect_data(PGObject(ATreeView), 'leave-notify-event', TGCallback(@on_leave_notify), nil, nil, G_CONNECT_DEFAULT);
+}
end;
procedure file_list_tips_show_tip(AListView: PGtkTreeView; row: PGtkTreePath; column: PGtkTreeViewColumn);
@@ -79,7 +82,7 @@ begin
if (sec < 1) and (ms < ConstFileListTipsDelayNeighbour * 1000) then Timeout := 1;
// DebugMsg(['Time elapsed = ', Double(sec), ':', integer(ms div 1000)]);
end;
- timer_id := gtk_timeout_add(Timeout, @show_tip_widget, nil);
+ timer_id := g_timeout_add(Timeout, @show_tip_widget, nil);
end;
@@ -89,9 +92,9 @@ var view: PGtkTreeView;
path: PGtkTreePath;
begin
Result := False;
- view := GTK_TREE_VIEW(widget);
+ view := PGtkTreeView(widget);
if event^.any.window <> gtk_tree_view_get_bin_window(view) then Exit;
- case event^._type of
+ case event^.type_ of
GDK_KEY_PRESS, GDK_SCROLL:
begin
FileListTipsHide;
@@ -103,11 +106,11 @@ begin
end;
GDK_FOCUS_CHANGE: begin
Result := True;
- if event^.focus_change._in <> 1 then FileListTipsHide;
+ if event^.focus_change.in_ <> 1 then FileListTipsHide;
end;
GDK_MOTION_NOTIFY: begin
Result := True;
- if not gtk_tree_view_get_path_at_pos(view, Trunc(event^.motion.x), Trunc(event^.motion.y), path, column, nil, nil)
+ if not gtk_tree_view_get_path_at_pos(view, Trunc(event^.motion.x), Trunc(event^.motion.y), @path, @column, nil, nil)
then begin
FileListTipsHide;
if tips_timer <> nil then begin
@@ -131,14 +134,15 @@ begin
try
if not Assigned(tip_window) then create_widgets;
- if not ConfUseSystemFont then begin
+ // TODO
+{ if not ConfUseSystemFont then begin
FontDesc := pango_font_description_from_string(PChar(ConfPanelFont));
gtk_widget_modify_font(PGtkWidget(tip_label), FontDesc);
end else gtk_widget_modify_font(PGtkWidget(tip_label), nil);
-
- gtk_label_set_markup(GTK_LABEL(tip_label), Text);
- widget := GTK_WIDGET(panel);
- hadjustment := gtk_tree_view_get_hadjustment(panel);
+}
+ gtk_label_set_markup(PGtkLabel(tip_label), Text);
+ widget := PGtkWidget(panel);
+ hadjustment := gtk_scrollable_get_hadjustment(PGtkScrollable(panel));
x := x - Trunc(gtk_adjustment_get_value(hadjustment));
gdk_window_get_origin(widget^.window, @wx, @wy);
@@ -147,10 +151,10 @@ begin
scr_w := gdk_screen_width;
gtk_label_set_line_wrap(tip_label, False);
- gtk_widget_size_request(GTK_WIDGET(tip_window), @requisition);
+ gtk_widget_get_preferred_size(PGtkWidget(tip_window), @requisition, nil);
if x + requisition.width > scr_w {PGtkWidget(panel)^.allocation.width} then begin
gtk_label_set_line_wrap(tip_label, True);
- gtk_widget_size_request(GTK_WIDGET(tip_window), @requisition);
+ gtk_widget_get_preferred_size(PGtkWidget(tip_window), @requisition, nil);
end;
w := requisition.width;
@@ -164,30 +168,31 @@ end;
function gtk_tooltips_paint_window(widget: PGtkWidget; event: PGdkEventExpose; user_data: gpointer): gboolean; cdecl;
begin
- gtk_paint_flat_box(gtk_widget_get_style(widget), widget^.window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ // TODO
+{ gtk_paint_flat_box(gtk_widget_get_style(widget), widget^.window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
nil, widget, 'tooltip', 0, 0, -1, -1);
- Result := False;
+ Result := False; }
end;
procedure create_widgets;
begin
if Assigned(tip_window) then Exit;
- tip_window := GTK_WINDOW(gtk_window_new(GTK_WINDOW_POPUP));
- gtk_widget_set_app_paintable(GTK_WIDGET(tip_window), True);
+ tip_window := PGtkWindow(gtk_window_new(GTK_WINDOW_POPUP));
+ gtk_widget_set_app_paintable(PGtkWidget(tip_window), True);
gtk_window_set_resizable(tip_window, False);
- gtk_widget_set_name(GTK_WIDGET(tip_window), 'gtk-tooltips');
- gtk_container_set_border_width(GTK_CONTAINER(tip_window), 4);
- gtk_widget_set_events(GTK_WIDGET(tip_window), GDK_POINTER_MOTION_MASK or GDK_BUTTON_PRESS_MASK or GDK_KEY_PRESS_MASK or GDK_FOCUS_CHANGE_MASK or GDK_SCROLL_MASK);
+ gtk_widget_set_name(PGtkWidget(tip_window), 'gtk-tooltips');
+ gtk_container_set_border_width(PGtkContainer(tip_window), 4);
+ gtk_widget_set_events(PGtkWidget(tip_window), [GDK_POINTER_MOTION_MASK, GDK_BUTTON_PRESS_MASK, GDK_KEY_PRESS_MASK, GDK_FOCUS_CHANGE_MASK, GDK_SCROLL_MASK]);
g_signal_connect_data(PGObject(tip_window), 'event', TGCallback(@tip_event_handler), nil, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(tip_window), 'expose_event', TGCallback(@gtk_tooltips_paint_window), tip_window, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(tip_window), 'button-press-event', TGCallback(@tips_button_press_event), tip_window, nil, G_CONNECT_DEFAULT);
- tip_label := GTK_LABEL(gtk_label_new(nil));
- gtk_misc_set_alignment(GTK_MISC(tip_label), 0, 0.5);
- gtk_widget_show(GTK_WIDGET(tip_label));
+ tip_label := PGtkLabel(gtk_label_new(nil));
+ gtk_label_set_yalign(tip_label, 0.5);
+ gtk_widget_show(PGtkWidget(tip_label));
- gtk_container_add(GTK_CONTAINER(tip_window), GTK_WIDGET(tip_label));
+ gtk_container_add(PGtkContainer(tip_window), PGtkWidget(tip_label));
end;
procedure FileListTipsHide;
@@ -197,8 +202,8 @@ begin
data_row := nil;
data_column := nil;
- if GTK_WIDGET_VISIBLE(tip_window) then begin
- gtk_widget_hide(GTK_WIDGET(tip_window));
+ if gtk_widget_get_visible(tip_window) then begin
+ gtk_widget_hide(PGtkWidget(tip_window));
if tips_timer = nil then tips_timer := g_timer_new;
g_timer_start(tips_timer);
// gdk_beep();
@@ -206,7 +211,7 @@ begin
end;
if timer_id <> 0 then begin
- gtk_timeout_remove(timer_id);
+ g_source_remove(timer_id);
timer_id := 0;
end;
end;
@@ -308,7 +313,7 @@ begin
if ConfDirsInBold and Data^.IsDir then Text := PChar(Format('<span weight="bold">%s</span>', [Text]));
draw_tip_widget(data_panel, Text, Rect.x, Rect.y + Rect.height + 2);
// if Assigned(text) then g_free(text);
- if not GTK_WIDGET_VISIBLE(GTK_WIDGET(tip_window)) then gtk_widget_show(GTK_WIDGET(tip_window));
+ if not gtk_widget_get_visible(PGtkWidget(tip_window)) then gtk_widget_show(PGtkWidget(tip_window));
except
on E: Exception do DebugMsg(['*** Exception raised in function show_tip_widget(user_data: gpointer): gboolean (', E.ClassName, '): ', E.Message]);
@@ -334,7 +339,7 @@ end;
function tip_event_handler(widget: PGtkWidget; event: PGdkEvent; user_data: gpointer): gboolean; cdecl;
begin
Result := True;
- case event^._type of
+ case event^.type_ of
GDK_KEY_PRESS, {GDK_BUTTON_PRESS, }GDK_SCROLL, GDK_FOCUS_CHANGE{, GDK_MOTION_NOTIFY}:
begin
FileListTipsHide;
@@ -350,7 +355,7 @@ end;
function on_leave_notify(widget: PGtkWidget; event: PGdkEventCrossing; user_data: gpointer): gboolean; cdecl;
begin
- if Assigned(tip_window) and (not GTK_WIDGET_VISIBLE(tip_window))
+ if Assigned(tip_window) and (not gtk_widget_get_visible(tip_window))
then begin
FileListTipsHide;
if tips_timer <> nil then begin
diff --git a/UViewer.pas b/UViewer.pas
index e3eff81..0eceba8 100644
--- a/UViewer.pas
+++ b/UViewer.pas
@@ -24,9 +24,8 @@ unit UViewer;
interface
uses
- lazglib2, lazgobject2, gdk2, gtk2, pango,
- SysUtils, Classes, GTKControls, GTKForms, GTKExtCtrls, GTKConsts,
- GTKText;
+ lazglib2, lazgobject2, lazgdk3, lazgtk3, lazpango1,
+ SysUtils, Classes, GTKControls, GTKForms, GTKExtCtrls, GTKText;
type
TFViewer = class(TGTKForm)
@@ -67,7 +66,7 @@ var
implementation
-uses UCoreUtils, UConfig, DateUtils, ULibc, UGnome;
+uses UCoreUtils, UConfig, DateUtils, ULibc;
@@ -127,14 +126,15 @@ end;
procedure TFViewer.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
- if Key = GDK_ESCAPE then Close;
+ if Key = GDK_KEY_Escape then Close;
end;
procedure TFViewer.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
SetParent(nil);
- if Assigned(FWidget) and GTK_IS_WIDGET(FWidget) then gtk_widget_destroy(PGtkWidget(FWidget));
+ // TODO WTF
+ if Assigned(FWidget) then g_object_unref(PGObject(FWidget));
// AThread.Terminate;
// ModalResult := mbOK;
end;
@@ -183,11 +183,11 @@ begin
// DebugMsg(['Setting value to ', val]);
Inc(i);
end;
- gdk_window_process_all_updates;
+// gdk_window_process_all_updates;
usleep(100);
until (microseconds div 1000) > dur;
gtk_adjustment_set_value(adj, dest_value);
- gdk_window_process_all_updates;
+// gdk_window_process_all_updates;
// DebugMsg(['End value ', dest_value]);
g_timer_stop(timer);
@@ -207,67 +207,67 @@ begin
Accept := True;
case Key of
- GDK_HOME: begin
- smooth_scroll(vadj, 0, True);
- smooth_scroll(hadj, 0, True);
+ GDK_KEY_Home: begin
+ smooth_scroll(vadj, 0, True);
+ smooth_scroll(hadj, 0, True);
+ Accept := False;
+ end;
+ GDK_KEY_End: begin
+ smooth_scroll(vadj, vadj^.upper - vadj^.page_size, True);
+ Accept := False;
+ end;
+ GDK_KEY_Page_Down, GDK_KEY_KP_Page_Down, GDK_KEY_space: begin
+ x := gtk_adjustment_get_value(vadj) + vadj^.page_increment;
+ if x + vadj^.page_size > vadj^.upper then x := vadj^.upper - vadj^.page_size;
+ smooth_scroll(vadj, x, True);
+ Accept := False;
+ end;
+ GDK_KEY_Page_Up, GDK_KEY_KP_Page_Up: begin
+ x := gtk_adjustment_get_value(vadj) - vadj^.page_increment;
+ if x < 0 then x := 0;
+ smooth_scroll(vadj, x, True);
+ Accept := False;
+ end;
+ GDK_KEY_Down, GDK_KEY_KP_Down: begin
+ x := gtk_adjustment_get_value(vadj) + vadj^.step_increment;
+ if x + vadj^.page_size > vadj^.upper then x := vadj^.upper - vadj^.page_size;
+ smooth_scroll(vadj, x, False);
+ Accept := False;
+ end;
+ GDK_KEY_Up, GDK_KEY_KP_Up: begin
+ x := gtk_adjustment_get_value(vadj) - vadj^.step_increment;
+ if x < 0 then x := 0;
+ smooth_scroll(vadj, x, False);
+ Accept := False;
+ end;
+ GDK_KEY_Right, GDK_KEY_KP_Right: begin
+ x := gtk_adjustment_get_value(hadj) + hadj^.step_increment;
+ if x + hadj^.page_size > hadj^.upper then x := hadj^.upper - hadj^.page_size;
+ smooth_scroll(hadj, x, False);
+ Accept := False;
+ end;
+ GDK_KEY_Left, GDK_KEY_KP_Left: begin
+ x := gtk_adjustment_get_value(hadj) - hadj^.step_increment;
+ if x < 0 then x := 0;
+ smooth_scroll(hadj, x, False);
+ Accept := False;
+ end;
+ GDK_KEY_W: if (Shift = []) then begin
+ if TextView.WrapMode = wmWrapNone then TextView.WrapMode := wmWrapWord
+ else TextView.WrapMode := wmWrapNone;
Accept := False;
end;
- GDK_END: begin
- smooth_scroll(vadj, vadj^.upper - vadj^.page_size, True);
- Accept := False;
- end;
- GDK_Page_Down, GDK_SPACE: begin
- x := gtk_adjustment_get_value(vadj) + vadj^.page_increment;
- if x + vadj^.page_size > vadj^.upper then x := vadj^.upper - vadj^.page_size;
- smooth_scroll(vadj, x, True);
- Accept := False;
- end;
- GDK_Page_Up: begin
- x := gtk_adjustment_get_value(vadj) - vadj^.page_increment;
- if x < 0 then x := 0;
- smooth_scroll(vadj, x, True);
- Accept := False;
- end;
- GDK_Down: begin
- x := gtk_adjustment_get_value(vadj) + vadj^.step_increment;
- if x + vadj^.page_size > vadj^.upper then x := vadj^.upper - vadj^.page_size;
- smooth_scroll(vadj, x, False);
- Accept := False;
- end;
- GDK_Up: begin
- x := gtk_adjustment_get_value(vadj) - vadj^.step_increment;
- if x < 0 then x := 0;
- smooth_scroll(vadj, x, False);
- Accept := False;
- end;
- GDK_Right: begin
- x := gtk_adjustment_get_value(hadj) + hadj^.step_increment;
- if x + hadj^.page_size > hadj^.upper then x := hadj^.upper - hadj^.page_size;
- smooth_scroll(hadj, x, False);
+// GDK_C, GDK_Capital_C, GDK_Insert: if (ssCtrl in Shift) then Accept := True;
+ GDK_KEY_S: if (Shift = []) then begin
+ ConfViewerMonospaceFont := True;
+ ApplyFont;
Accept := False;
end;
- GDK_Left: begin
- x := gtk_adjustment_get_value(hadj) - hadj^.step_increment;
- if x < 0 then x := 0;
- smooth_scroll(hadj, x, False);
+ GDK_KEY_A: if (Shift = []) then begin
+ ConfViewerMonospaceFont := False;
+ ApplyFont;
Accept := False;
end;
- GDK_W, GDK_Capital_W: if (Shift = []) then begin
- if TextView.WrapMode = wmWrapNone then TextView.WrapMode := wmWrapWord
- else TextView.WrapMode := wmWrapNone;
- Accept := False;
- end;
-// GDK_C, GDK_Capital_C, GDK_Insert: if (ssCtrl in Shift) then Accept := True;
- GDK_S, GDK_Capital_S: if (Shift = []) then begin
- ConfViewerMonospaceFont := True;
- ApplyFont;
- Accept := False;
- end;
- GDK_A, GDK_Capital_A: if (Shift = []) then begin
- ConfViewerMonospaceFont := False;
- ApplyFont;
- Accept := False;
- end;
end;
end;
@@ -301,13 +301,13 @@ begin
Accept := True;
adj := gtk_scrolled_window_get_vadjustment(PGtkScrolledWindow(ScrolledWindow.FWidget));
case Key of
- GDK_ESCAPE: Close;
- GDK_Down: begin
+ GDK_KEY_Escape: Close;
+ GDK_KEY_Down: begin
x := Trunc(gtk_adjustment_get_value(adj)) + LineHeight;
if x + Trunc(adj^.page_size) > LineHeight * NumLines then x := LineHeight * NumLines - Trunc(adj^.page_size);
gtk_adjustment_set_value(adj, x);
end;
- GDK_Up: begin
+ GDK_KEY_Up: begin
x := Trunc(gtk_adjustment_get_value(adj)) - LineHeight;
if x < 0 then x := 0;
gtk_adjustment_set_value(adj, x);
@@ -443,19 +443,20 @@ end;
procedure TFViewer.ApplyFont;
begin
- if ConfViewerMonospaceFont
+ // TODO
+{ if ConfViewerMonospaceFont
then gtk_widget_modify_font(TextView.FWidget, pango_font_description_from_string('Monospace'))
- else gtk_widget_modify_font(TextView.FWidget, nil);
+ else gtk_widget_modify_font(TextView.FWidget, nil); }
end;
(********************************************************************************************************************************)
procedure TViewerThread.Execute;
begin
- gdk_threads_enter;
+// gdk_threads_enter;
// DoIt;
AViewer.Show;
// AViewer.Run;
- gdk_threads_leave;
+// gdk_threads_leave;
end;
constructor TViewerThread.Create(Parent: TComponent);
diff --git a/libgtk_kylix/GTKClasses.pas b/libgtk_kylix/GTKClasses.pas
index 6071d74..aab76a2 100644
--- a/libgtk_kylix/GTKClasses.pas
+++ b/libgtk_kylix/GTKClasses.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKClasses - Non-visual objects
- Version 0.6.4 (last updated 2003-04-03)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,13 +23,40 @@ unit GTKClasses;
interface
-uses gtk2, lazglib2, Classes, SysUtils;
-
+uses lazglib2, lazgobject2, lazgtk3, Classes, SysUtils;
+
+const
+{ Basic Type Macros }
+ G_TYPE_FUNDAMENTAL_SHIFT = 2;
+ G_TYPE_FUNDAMENTAL_MAX = 255 shl G_TYPE_FUNDAMENTAL_SHIFT;
+
+{ Constant fundamental types,
+ introduced by g_type_init(). }
+ G_TYPE_INVALID = TGType(0 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_NONE = TGType(1 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_INTERFACE = TGType(2 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_CHAR = TGType(3 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_UCHAR = TGType(4 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_BOOLEAN = TGType(5 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_INT = TGType(6 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_UINT = TGType(7 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_LONG = TGType(8 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_ULONG = TGType(9 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_INT64 = TGType(10 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_UINT64 = TGType(11 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_ENUM = TGType(12 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_FLAGS = TGType(13 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_FLOAT = TGType(14 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_DOUBLE = TGType(15 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_STRING = TGType(16 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_POINTER = TGType(17 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_BOXED = TGType(18 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_PARAM = TGType(19 shl G_TYPE_FUNDAMENTAL_SHIFT);
+ G_TYPE_OBJECT = TGType(20 shl G_TYPE_FUNDAMENTAL_SHIFT);
type
TGDKColor = record
- pixel: Cardinal;
- red, green, blue: Word;
+ red, green, blue, alpha: gdouble;
end;
(****************************************** TGLIST ******************************************************************************)
@@ -154,12 +180,12 @@ end;
procedure TGTKTimer.Start;
begin
if FHandlerID > 0 then Stop;
- if FEnabled then FHandlerID := gtk_timeout_add(FInterval, @TGTKTimer_Timeout, Self);
+ if FEnabled then FHandlerID := g_timeout_add(FInterval, @TGTKTimer_Timeout, Self);
end;
procedure TGTKTimer.Stop;
begin
- if FHandlerID > 0 then gtk_timeout_remove(FHandlerID);
+ if FHandlerID > 0 then g_source_remove(FHandlerID);
FHandlerID := 0;
end;
diff --git a/libgtk_kylix/GTKConsts.pas b/libgtk_kylix/GTKConsts.pas
index 0b18b1c..965548b 100644
--- a/libgtk_kylix/GTKConsts.pas
+++ b/libgtk_kylix/GTKConsts.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKConsts - Various constants, mainly key codes
- Version 0.5.20 (last updated 2003-01-25)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,219 +23,9 @@ unit GTKConsts;
interface
-uses lazglib2, gtk2;
-
-const // copied from gdkkeysyms
- GDK_BackSpace = $FF08;
- GDK_Tab = $FF09;
- GDK_Linefeed = $FF0A;
- GDK_Clear_Key = $FF0B;
- GDK_Return = $FF0D;
- GDK_Pause = $FF13;
- GDK_Scroll_Lock = $FF14;
- GDK_Sys_Req = $FF15;
- GDK_Escape = $FF1B;
- GDK_Delete_Key = $FFFF;
- GDK_Home = $FF50;
- GDK_Left = $FF51;
- GDK_Up = $FF52;
- GDK_Right = $FF53;
- GDK_Down = $FF54;
- GDK_Prior = $FF55;
- GDK_Page_Up = $FF55;
- GDK_Next = $FF56;
- GDK_Page_Down = $FF56;
- GDK_End = $FF57;
- GDK_Insert = $FF63;
- GDK_Num_Lock = $FF7F;
- GDK_KP_Space = $FF80;
- GDK_KP_Tab = $FF89;
- GDK_KP_Enter = $FF8D;
- GDK_KP_F1 = $FF91;
- GDK_KP_F2 = $FF92;
- GDK_KP_F3 = $FF93;
- GDK_KP_F4 = $FF94;
- GDK_KP_Home = $FF95;
- GDK_KP_Left = $FF96;
- GDK_KP_Up = $FF97;
- GDK_KP_Right = $FF98;
- GDK_KP_Down = $FF99;
- GDK_KP_Prior = $FF9A;
- GDK_KP_Page_Up = $FF9A;
- GDK_KP_Next = $FF9B;
- GDK_KP_Page_Down = $FF9B;
- GDK_KP_End = $FF9C;
- GDK_KP_PLUS = 65451;
- GDK_KP_MINUS = 65453;
- GDK_KP_ASTERISK = 65450;
- GDK_KP_SLASH = 65455;
- GDK_KP_0 = $FFB0;
- GDK_KP_1 = $FFB1;
- GDK_KP_2 = $FFB2;
- GDK_KP_3 = $FFB3;
- GDK_KP_4 = $FFB4;
- GDK_KP_5 = $FFB5;
- GDK_KP_6 = $FFB6;
- GDK_KP_7 = $FFB7;
- GDK_KP_8 = $FFB8;
- GDK_KP_9 = $FFB9;
- GDK_F1 = $FFBE;
- GDK_F2 = $FFBF;
- GDK_F3 = $FFC0;
- GDK_F4 = $FFC1;
- GDK_F5 = $FFC2;
- GDK_F6 = $FFC3;
- GDK_F7 = $FFC4;
- GDK_F8 = $FFC5;
- GDK_F9 = $FFC6;
- GDK_F10 = $FFC7;
- GDK_F11 = $FFC8;
- GDK_L1 = $FFC8;
- GDK_F12 = $FFC9;
- GDK_L2 = $FFC9;
- GDK_F13 = $FFCA;
- GDK_L3 = $FFCA;
- GDK_F14 = $FFCB;
- GDK_L4 = $FFCB;
- GDK_F15 = $FFCC;
- GDK_L5 = $FFCC;
- GDK_F16 = $FFCD;
- GDK_L6 = $FFCD;
- GDK_F17 = $FFCE;
- GDK_L7 = $FFCE;
- GDK_F18 = $FFCF;
- GDK_L8 = $FFCF;
- GDK_F19 = $FFD0;
- GDK_L9 = $FFD0;
- GDK_F20 = $FFD1;
- GDK_L10 = $FFD1;
- GDK_F21 = $FFD2;
- GDK_R1 = $FFD2;
- GDK_F22 = $FFD3;
- GDK_R2 = $FFD3;
- GDK_F23 = $FFD4;
- GDK_R3 = $FFD4;
- GDK_F24 = $FFD5;
- GDK_R4 = $FFD5;
- GDK_F25 = $FFD6;
- GDK_R5 = $FFD6;
- GDK_F26 = $FFD7;
- GDK_R6 = $FFD7;
- GDK_F27 = $FFD8;
- GDK_R7 = $FFD8;
- GDK_F28 = $FFD9;
- GDK_R8 = $FFD9;
- GDK_F29 = $FFDA;
- GDK_R9 = $FFDA;
- GDK_F30 = $FFDB;
- GDK_R10 = $FFDB;
- GDK_F31 = $FFDC;
- GDK_R11 = $FFDC;
- GDK_F32 = $FFDD;
- GDK_R12 = $FFDD;
- GDK_F33 = $FFDE;
- GDK_R13 = $FFDE;
- GDK_F34 = $FFDF;
- GDK_R14 = $FFDF;
- GDK_F35 = $FFE0;
- GDK_R15 = $FFE0;
- GDK_space = $020;
- GDK_exclam = $021;
- GDK_quotedbl = $022;
- GDK_numbersign = $023;
- GDK_dollar = $024;
- GDK_percent = $025;
- GDK_ampersand = $026;
- GDK_apostrophe = $027;
- GDK_quoteright = $027;
- GDK_parenleft = $028;
- GDK_parenright = $029;
- GDK_asterisk = $02a;
- GDK_plus_key = $02b;
- GDK_comma = $02c;
- GDK_minus = $02d;
- GDK_period = $02e;
- GDK_slash = $02f;
- GDK_0 = $030;
- GDK_1 = $031;
- GDK_2 = $032;
- GDK_3 = $033;
- GDK_4 = $034;
- GDK_5 = $035;
- GDK_6 = $036;
- GDK_7 = $037;
- GDK_8 = $038;
- GDK_9 = $039;
- GDK_colon = $03a;
- GDK_semicolon = $03b;
- GDK_less = $03c;
- GDK_equal = $03d;
- GDK_greater = $03e;
- GDK_question = $03f;
- GDK_at = $040;
- GDK_Capital_A = $041;
- GDK_Capital_B = $042;
- GDK_Capital_C = $043;
- GDK_Capital_D = $044;
- GDK_Capital_E = $045;
- GDK_Capital_F = $046;
- GDK_Capital_G = $047;
- GDK_Capital_H = $048;
- GDK_Capital_I = $049;
- GDK_Capital_J = $04a;
- GDK_Capital_K = $04b;
- GDK_Capital_L = $04c;
- GDK_Capital_M = $04d;
- GDK_Capital_N = $04e;
- GDK_Capital_O = $04f;
- GDK_Capital_P = $050;
- GDK_Capital_Q = $051;
- GDK_Capital_R = $052;
- GDK_Capital_S = $053;
- GDK_Capital_T = $054;
- GDK_Capital_U = $055;
- GDK_Capital_V = $056;
- GDK_Capital_W = $057;
- GDK_Capital_X = $058;
- GDK_Capital_Y = $059;
- GDK_Capital_Z = $05a;
- GDK_bracketleft = $05b;
- GDK_backslash = $05c;
- GDK_bracketright = $05d;
- GDK_quoteleft = $060;
- GDK_a = $061;
- GDK_b = $062;
- GDK_c = $063;
- GDK_d = $064;
- GDK_e = $065;
- GDK_f = $066;
- GDK_g = $067;
- GDK_h = $068;
- GDK_i = $069;
- GDK_j = $06a;
- GDK_k = $06b;
- GDK_l = $06c;
- GDK_m = $06d;
- GDK_n = $06e;
- GDK_o = $06f;
- GDK_p = $070;
- GDK_q = $071;
- GDK_r = $072;
- GDK_s = $073;
- GDK_t = $074;
- GDK_u = $075;
- GDK_v = $076;
- GDK_w = $077;
- GDK_x = $078;
- GDK_y = $079;
- GDK_z = $07a;
- GDK_aacute = $0e1;
- GDK_leftarrow = $8fb;
- GDK_uparrow = $8fc;
- GDK_rightarrow = $8fd;
- GDK_downarrow = $8fe;
- GDK_WIN_POPUP = $FF67;
+uses lazglib2, lazgtk3;
+const
NumMessageButtons = 12;
MessageButtonID : array[1..NumMessageButtons] of Pgchar =
(GTK_STOCK_YES, GTK_STOCK_NO, GTK_STOCK_OK, GTK_STOCK_CANCEL, GTK_STOCK_APPLY, GTK_STOCK_CLOSE, GTK_STOCK_HELP,
diff --git a/libgtk_kylix/GTKControls.pas b/libgtk_kylix/GTKControls.pas
index 82de154..4729266 100644
--- a/libgtk_kylix/GTKControls.pas
+++ b/libgtk_kylix/GTKControls.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKControls - Basic objects
- Version 0.6.23 (last updated 2008-11-11)
Copyright (C) 2007 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKControls;
interface
-uses gtk2, gdk2, lazglib2, lazgobject2, Classes;
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, Classes;
const
@@ -58,14 +57,15 @@ type
type
TGTKShadowType = (stNone, stShadowIn, stShadowOut, stEtchedIn, stEtchedOut);
TGTKPosition = (poLeft, poRight, poTop, poBottom);
-
+ TGTKAlignment = (taLeftJustify, taRightJustify, taCenter, taFill);
+
(****************************************** TGTKCONTROL *************************************************************************)
TGDKMouseButton = (mbLeft, mbMiddle, mbRight, mbNoButton);
TGDKKeyEvent = procedure (Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean) of object;
TGDKMouseEvent = procedure (Sender: TObject; Button: TGDKMouseButton; Shift: TShiftState; X, Y: Integer; var Accept: boolean) of object;
TGDKFocusEvent = procedure (Sender: TObject; var Accept: boolean) of object;
TGDKExposeEvent = procedure (Sender: TObject; const Rect: PGdkRectangle; var Accept: boolean) of object;
- TGTKControlState = (csNormal, csActive, csPrelight, csSelected, csInsensitive);
+ TGTKControlState = (csNormal, csActive, csPrelight, csSelected, csInsensitive, csInconsistent, csFocused, csBackdrop, csDirLTR, cdDirRTL, csLink, csVisited, csChecked, csDropActive);
TGTKControl = class(TComponent64)
private
FVisible: Boolean;
@@ -92,6 +92,12 @@ type
function GetFocused: boolean;
function GetDefault: boolean;
function GetControlState: TGTKControlState;
+ function GetHAlign: TGTKAlignment;
+ function GetVAlign: TGTKAlignment;
+ function GetMarginStart: Integer;
+ function GetMarginEnd: Integer;
+ function GetMarginTop: Integer;
+ function GetMarginBottom: Integer;
procedure SetHeight(const Value: Integer);
procedure SetVisible(const Value: Boolean);
procedure SetWidth(const Value: Integer);
@@ -111,6 +117,12 @@ type
procedure SetOnExpose(Value: TGDKExposeEvent);
procedure SetControlState(Value: TGTKControlState);
procedure SetOnMouseMove(Value: TGDKMouseEvent);
+ procedure SetHAlign(Value: TGTKAlignment);
+ procedure SetVAlign(Value: TGTKAlignment);
+ procedure SetMarginStart(Value: Integer);
+ procedure SetMarginEnd(Value: Integer);
+ procedure SetMarginTop(Value: Integer);
+ procedure SetMarginBottom(Value: Integer);
protected
procedure SetParent(const Value: TGTKControl); virtual;
public
@@ -118,7 +130,6 @@ type
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Hide;
- procedure HideAll;
procedure Show;
procedure ShowAll;
procedure SetSizeRequest(const Width, Height: Integer);
@@ -127,21 +138,7 @@ type
property Enabled: Boolean read GetEnabled write SetEnabled default True;
property PopupMenu: TGTKControl read FPopupMenu write SetPopupMenu;
procedure SetFocus;
- procedure SetForegroundColor(Red, Green, Blue: word); overload;
- procedure SetForegroundColor(State: integer; Red, Green, Blue: word); overload;
- procedure SetForegroundColor(State: integer; Color: PGdkColor); overload;
- procedure SetForegroundColor(Color: PGdkColor); overload;
- procedure SetBackgroundColor(Red, Green, Blue: word); overload;
- procedure SetBackgroundColor(State: integer; Red, Green, Blue: word); overload;
- procedure SetBackgroundColor(State: integer; Color: PGdkColor); overload;
- procedure SetBackgroundColor(Color: PGdkColor); overload;
- procedure SetTextColor(Red, Green, Blue: word); overload;
- procedure SetTextColor(State: integer; Red, Green, Blue: word); overload;
- procedure SetBaseColor(Red, Green, Blue: word); overload;
- procedure SetBaseColor(State: integer; Red, Green, Blue: word); overload;
procedure Invalidate;
- procedure SetAlignment(XAlign, YAlign: Double);
- procedure SetPadding(XPad, YPad: integer);
function GetData(Key: string): Pointer;
procedure SetData(Key: string; Value: Pointer);
published
@@ -164,6 +161,12 @@ type
property OnExpose: TGDKExposeEvent read FOnExpose write SetOnExpose;
property ComponentState;
property ControlState: TGTKControlState read GetControlState write SetControlState;
+ property HAlign: TGTKAlignment read GetHAlign write SetHAlign;
+ property VAlign: TGTKAlignment read GetVAlign write SetHAlign;
+ property MarginStart: Integer read GetMarginStart write SetMarginStart;
+ property MarginEnd: Integer read GetMarginEnd write SetMarginEnd;
+ property MarginTop: Integer read GetMarginTop write SetMarginTop;
+ property MarginBottom: Integer read GetMarginBottom write SetMarginBottom;
end;
(****************************************** TGTKCONTAINER ***********************************************************************)
@@ -234,46 +237,27 @@ type
destructor Destroy; override;
end;
-(****************************************** TGTKTOOLTIPS ************************************************************************)
- TGTKTooltips = class(TComponent)
- private
- function GetEnabled: boolean;
- procedure SetEnabled(Value: boolean);
- public
- FObject: PGtkTooltips;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- published
- property Enabled: boolean read GetEnabled write SetEnabled;
- end;
-
-(****************************************** TGTKTABLE ***************************************************************************)
- TGTKTableAttachOptions = set of (taoExpand, taoShrink, taoFill);
- TGTKTable = class(TGTKContainer)
+(****************************************** TGTKGRID ****************************************************************************)
+ TGTKGridAttachOptions = set of (taoExpand, taoShrink, taoFill);
+ TGTKGrid = class(TGTKContainer)
private
- function GetRowCount: integer;
- procedure SetRowCount(Value: integer);
- function GetColCount: integer;
- procedure SetColCount(Value: integer);
function GetRowSpacing: integer;
procedure SetRowSpacing(Value: integer);
function GetColSpacing: integer;
procedure SetColSpacing(Value: integer);
- function GetHomogeneous: boolean;
- procedure SetHomogeneous(Value: boolean);
+ function GetRowHomogeneous: boolean;
+ function GetColHomogeneous: boolean;
+ procedure SetRowHomogeneous(Value: boolean);
+ procedure SetColHomogeneous(Value: boolean);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
- procedure SetRowColCount(Rows, Cols: integer);
- procedure AddControl(Column, Row, NumCols, NumRows: integer; Control: TGTKControl; XPadding, YPadding: integer);
- procedure AddControlEx(Column, Row, NumCols, NumRows: integer; Control: TGTKControl; XAttachOptions,
- YAttachOptions: TGTKTableAttachOptions; XPadding, YPadding: integer);
+ procedure AddControl(Column, Row, NumCols, NumRows: integer; Control: TGTKControl);
published
- property RowCount: integer read GetRowCount write SetRowCount;
- property ColCount: integer read GetColCount write SetColCount;
property RowSpacing: integer read GetRowSpacing write SetRowSpacing;
property ColSpacing: integer read GetColSpacing write SetColSpacing;
- property Homogeneous: boolean read GetHomogeneous write SetHomogeneous;
+ property RowHomogeneous: boolean read GetRowHomogeneous write SetRowHomogeneous;
+ property ColHomogeneous: boolean read GetColHomogeneous write SetColHomogeneous;
end;
@@ -289,7 +273,7 @@ uses GTKMenus, GTKForms, GTKUtils;
procedure Beep;
begin
- gdk_beep;
+ gdk_beep();
end;
@@ -334,13 +318,6 @@ begin
gtk_widget_hide(FWidget);
end;
-procedure TGTKControl.HideAll;
-begin
- if Parent <> nil then Parent.HideAll;
- FVisible := False;
- gtk_widget_hide_all(FWidget);
-end;
-
procedure TGTKControl.Show;
begin
FVisible := True;
@@ -362,7 +339,7 @@ begin
raise EInvalidOperation.Create('Invalid Operation');
FParent := Value;
try
- if Assigned(FWidget) and GTK_IS_WIDGET(FWidget) then
+ if Assigned(FWidget) then
if Assigned(Value)
then gtk_widget_set_parent(FWidget, Value.FWidget)
else gtk_widget_unparent(FWidget);
@@ -378,12 +355,12 @@ end;
function TGTKControl.GetWidth: Integer;
begin
- Result := FWidget^.allocation.width;
+ Result := gtk_widget_get_allocated_width(FWidget);
end;
function TGTKControl.GetHeight: Integer;
begin
- Result := FWidget^.allocation.height;
+ Result := gtk_widget_get_allocated_height(FWidget);
end;
procedure TGTKControl.SetWidth(const Value: Integer);
@@ -402,13 +379,17 @@ begin
end;
function TGTKControl.GetLeft: Integer;
+var A: TGtkAllocation;
begin
- Result := FWidget^.allocation.x;
+ gtk_widget_get_allocation(FWidget, @A);
+ Result := A.x;
end;
function TGTKControl.GetTop: Integer;
+var A: TGtkAllocation;
begin
- Result := FWidget^.allocation.y;
+ gtk_widget_get_allocation(FWidget, @A);
+ Result := A.y;
end;
function TGTKControl.GetEnabled: boolean;
@@ -429,13 +410,13 @@ var Shift: TShiftState;
Accept: boolean;
begin
Shift := [];
- if event^.state and GDK_SHIFT_MASK = GDK_SHIFT_MASK then Include(Shift, ssShift);
- if event^.state and GDK_CONTROL_MASK = GDK_CONTROL_MASK then Include(Shift, ssCtrl);
- if event^.state and GDK_MOD1_MASK = GDK_MOD1_MASK then Include(Shift, ssAlt);
+ if GDK_SHIFT_MASK in event^.state then Include(Shift, ssShift);
+ if GDK_CONTROL_MASK in event^.state then Include(Shift, ssCtrl);
+ if GDK_MOD1_MASK in event^.state then Include(Shift, ssAlt);
Accept := True;
- if Assigned(TGTKControl(user_data).FOnMouseDown) and (event^._type = GDK_BUTTON_PRESS)
+ if Assigned(TGTKControl(user_data).FOnMouseDown) and (event^.type_ = GDK_BUTTON_PRESS)
then TGTKControl(user_data).FOnMouseDown(TGTKControl(user_data), TGDKMouseButton(event^.button - 1), Shift, Trunc(event^.x), Trunc(event^.y), Accept);
- if Assigned(TGTKControl(user_data).FOnDblClick) and (event^._type = GDK_2BUTTON_PRESS)
+ if Assigned(TGTKControl(user_data).FOnDblClick) and (event^.type_ = GDK_2BUTTON_PRESS)
then TGTKControl(user_data).FOnDblClick(TGTKControl(user_data), TGDKMouseButton(event^.button - 1), Shift, Trunc(event^.x), Trunc(event^.y), Accept);
Result := not Accept;
if Accept then
@@ -463,17 +444,13 @@ begin
end;
function TGTKControl.GetTooltip: string;
-var text: PChar;
begin
- text := nil;
- Result := '';
- g_object_get(PGObject(FWidget), 'tooltip-text', [@text, nil]);
- if text <> nil then Result := string(text);
+ Result := gtk_widget_get_tooltip_text(FWidget);
end;
procedure TGTKControl.SetTooltip(Value: string);
begin
- g_object_set(PGObject(FWidget), 'tooltip-text', [PChar(Value), nil])
+ gtk_widget_set_tooltip_text(FWidget, PChar(Value));
end;
procedure TGTKControl.SetFocus;
@@ -520,9 +497,9 @@ var Shift: TShiftState;
begin
Accept := True;
Shift := [];
- if event^.state and GDK_SHIFT_MASK = GDK_SHIFT_MASK then Include(Shift, ssShift);
- if event^.state and GDK_CONTROL_MASK = GDK_CONTROL_MASK then Include(Shift, ssCtrl);
- if event^.state and GDK_MOD1_MASK = GDK_MOD1_MASK then Include(Shift, ssAlt);
+ if GDK_SHIFT_MASK in event^.state then Include(Shift, ssShift);
+ if GDK_CONTROL_MASK in event^.state then Include(Shift, ssCtrl);
+ if GDK_MOD1_MASK in event^.state then Include(Shift, ssAlt);
if KeyDown then begin
if Assigned(TGTKControl(user_data).FOnKeyDown) then TGTKControl(user_data).FOnKeyDown(TGTKControl(user_data), event^.keyval,
Shift, Accept);
@@ -597,66 +574,6 @@ begin
end;
end;
-procedure TGTKControl.SetForegroundColor(Red, Green, Blue: word);
-begin
- gtk_widget_modify_fg(FWidget, 0, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetForegroundColor(State: integer; Red, Green, Blue: word);
-begin
- gtk_widget_modify_fg(FWidget, State, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetForegroundColor(State: integer; Color: PGdkColor);
-begin
- gtk_widget_modify_fg(FWidget, State, Color);
-end;
-
-procedure TGTKControl.SetForegroundColor(Color: PGdkColor);
-begin
- gtk_widget_modify_fg(FWidget, 0, Color);
-end;
-
-procedure TGTKControl.SetBackgroundColor(Red, Green, Blue: word);
-begin
- gtk_widget_modify_bg(FWidget, 0, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetBackgroundColor(State: integer; Red, Green, Blue: word);
-begin
- gtk_widget_modify_bg(FWidget, State, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetBackgroundColor(State: integer; Color: PGdkColor);
-begin
- gtk_widget_modify_bg(FWidget, State, Color);
-end;
-
-procedure TGTKControl.SetBackgroundColor(Color: PGdkColor);
-begin
- gtk_widget_modify_bg(FWidget, 0, Color);
-end;
-
-procedure TGTKControl.SetTextColor(Red, Green, Blue: word);
-begin
- gtk_widget_modify_text(FWidget, 0, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetTextColor(State: integer; Red, Green, Blue: word);
-begin
- gtk_widget_modify_text(FWidget, State, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetBaseColor(Red, Green, Blue: word);
-begin
- gtk_widget_modify_base(FWidget, 0, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
-procedure TGTKControl.SetBaseColor(State: integer; Red, Green, Blue: word);
-begin
- gtk_widget_modify_base(FWidget, State, AllocateColor(FWidget, Red, Green, Blue));
-end;
-
procedure TGTKControl.SetOnMouseDown(Value: TGDKMouseEvent);
begin
if @FOnMouseDown <> @Value then begin
@@ -692,9 +609,9 @@ var Shift: TShiftState;
Accept: boolean;
begin
Shift := [];
- if event^.state and GDK_SHIFT_MASK = GDK_SHIFT_MASK then Include(Shift, ssShift);
- if event^.state and GDK_CONTROL_MASK = GDK_CONTROL_MASK then Include(Shift, ssCtrl);
- if event^.state and GDK_MOD1_MASK = GDK_MOD1_MASK then Include(Shift, ssAlt);
+ if GDK_SHIFT_MASK in event^.state then Include(Shift, ssShift);
+ if GDK_CONTROL_MASK in event^.state then Include(Shift, ssCtrl);
+ if GDK_MOD1_MASK in event^.state then Include(Shift, ssAlt);
Accept := True;
if Assigned(TGTKControl(user_data).FOnMouseUp)
then TGTKControl(user_data).FOnMouseUp(TGTKControl(user_data), TGDKMouseButton(event^.button - 1), Shift, Trunc(event^.x), Trunc(event^.y), Accept);
@@ -719,12 +636,12 @@ begin
Result := False;
if event^.is_hint <> 0 then Exit;
Shift := [];
- if event^.state and GDK_SHIFT_MASK = GDK_SHIFT_MASK then Include(Shift, ssShift);
- if event^.state and GDK_CONTROL_MASK = GDK_CONTROL_MASK then Include(Shift, ssCtrl);
- if event^.state and GDK_MOD1_MASK = GDK_MOD1_MASK then Include(Shift, ssAlt);
- if event^.state and GDK_BUTTON1_MASK = GDK_BUTTON1_MASK then Button := mbLeft else
- if event^.state and GDK_BUTTON2_MASK = GDK_BUTTON2_MASK then Button := mbMiddle else
- if event^.state and GDK_BUTTON3_MASK = GDK_BUTTON3_MASK then Button := mbRight else
+ if GDK_SHIFT_MASK in event^.state then Include(Shift, ssShift);
+ if GDK_CONTROL_MASK in event^.state then Include(Shift, ssCtrl);
+ if GDK_MOD1_MASK in event^.state then Include(Shift, ssAlt);
+ if GDK_BUTTON1_MASK in event^.state then Button := mbLeft else
+ if GDK_BUTTON2_MASK in event^.state then Button := mbMiddle else
+ if GDK_BUTTON3_MASK in event^.state then Button := mbRight else
Button := mbNoButton;
if Assigned(TGTKControl(user_data).FOnMouseMove)
then TGTKControl(user_data).FOnMouseMove(TGTKControl(user_data), Button, Shift, Trunc(event^.x), Trunc(event^.y), Accept);
@@ -760,16 +677,6 @@ begin
gtk_widget_queue_draw(FWidget);
end;
-procedure TGTKControl.SetAlignment(XAlign, YAlign: Double);
-begin
- gtk_misc_set_alignment(PGtkMisc(FWidget), XAlign, YAlign);
-end;
-
-procedure TGTKControl.SetPadding(XPad, YPad: integer);
-begin
- gtk_misc_set_padding(PGtkMisc(FWidget), XPad, YPad);
-end;
-
function TGTKControl_expose_event(widget: PGtkWidget; event: PGdkEventExpose; user_data: gpointer):gboolean; cdecl;
var Accept: boolean;
begin
@@ -791,12 +698,12 @@ end;
function TGTKControl.GetControlState: TGTKControlState;
begin
- Result := TGTKControlState(FWidget^.state);
+ Result := TGTKControlState(gtk_widget_get_state_flags(FWidget));
end;
procedure TGTKControl.SetControlState(Value: TGTKControlState);
begin
- gtk_widget_set_state(FWidget, integer(Value));
+ gtk_widget_set_state_flags(FWidget, TGtkStateFlags(Value), True);
end;
function TGTKControl.GetData(Key: string): Pointer;
@@ -809,6 +716,67 @@ begin
g_object_set_data(PGObject(FWidget), PChar(Key), Value);
end;
+function TGTKControl.GetHAlign: TGTKAlignment;
+begin
+ Result := TGTKAlignment(gtk_widget_get_halign(FWidget));
+end;
+
+function TGTKControl.GetVAlign: TGTKAlignment;
+begin
+ Result := TGTKAlignment(gtk_widget_get_valign(FWidget));
+end;
+
+procedure TGTKControl.SetHAlign(Value: TGTKAlignment);
+begin
+ gtk_widget_set_halign(FWidget, TGtkAlign(Value));
+end;
+
+procedure TGTKControl.SetVAlign(Value: TGTKAlignment);
+begin
+ gtk_widget_set_valign(FWidget, TGtkAlign(Value));
+end;
+
+function TGTKControl.GetMarginStart: Integer;
+begin
+ Result := gtk_widget_get_margin_start(FWidget);
+end;
+
+function TGTKControl.GetMarginEnd: Integer;
+begin
+ Result := gtk_widget_get_margin_end(FWidget);
+end;
+
+function TGTKControl.GetMarginTop: Integer;
+begin
+ Result := gtk_widget_get_margin_top(FWidget);
+end;
+
+function TGTKControl.GetMarginBottom: Integer;
+begin
+ Result := gtk_widget_get_margin_bottom(FWidget);
+end;
+
+procedure TGTKControl.SetMarginStart(Value: Integer);
+begin
+ gtk_widget_set_margin_start(FWidget, Value);
+end;
+
+procedure TGTKControl.SetMarginEnd(Value: Integer);
+begin
+ gtk_widget_set_margin_end(FWidget, Value);
+end;
+
+procedure TGTKControl.SetMarginTop(Value: Integer);
+begin
+ gtk_widget_set_margin_top(FWidget, Value);
+end;
+
+procedure TGTKControl.SetMarginBottom(Value: Integer);
+begin
+ gtk_widget_set_margin_bottom(FWidget, Value);
+end;
+
+
(********************************************************************************************************************************)
(********************************************************************************************************************************)
constructor TGTKContainer.Create(AOwner: TComponent);
@@ -889,12 +857,12 @@ end;
procedure TGTKBox.AddControl(Control: TGTKControl);
begin
- gtk_box_pack_start_defaults(PGtkBox(FWidget), Control.FWidget);
+ gtk_box_pack_start(PGtkBox(FWidget), Control.FWidget, True, True, 0);
end;
procedure TGTKBox.AddControlEnd(Control: TGTKControl);
begin
- gtk_box_pack_end_defaults(PGtkBox(FWidget), Control.FWidget);
+ gtk_box_pack_end(PGtkBox(FWidget), Control.FWidget, True, True, 0);
end;
procedure TGTKBox.AddControlEx(Control: TGTKControl; Expand, Fill: boolean; Padding: integer);
@@ -933,7 +901,7 @@ constructor TGTKHBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
if ClassName = 'TGTKHBox' then begin
- FWidget := gtk_hbox_new(True, 0);
+ FWidget := gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
Show;
end;
end;
@@ -949,7 +917,7 @@ constructor TGTKVBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
if ClassName = 'TGTKVBox' then begin
- FWidget := gtk_vbox_new(False, 0);
+ FWidget := gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
Show;
end;
end;
@@ -961,32 +929,6 @@ end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKTooltips.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FObject := gtk_tooltips_new;
-end;
-
-destructor TGTKTooltips.Destroy;
-begin
- inherited Destroy;
-end;
-
-function TGTKTooltips.GetEnabled: boolean;
-begin
- // FIXME: This is horrible expression
- Result := Boolean(gtk2.enabled(FObject^));
-end;
-
-procedure TGTKTooltips.SetEnabled(Value: boolean);
-begin
- if Value then gtk_tooltips_enable(FObject)
- else gtk_tooltips_disable(FObject);
-end;
-
-
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
constructor TGTKEventBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@@ -1001,95 +943,63 @@ end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKTable.Create(AOwner: TComponent);
+constructor TGTKGrid.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_table_new(0, 0, False);
+ FWidget := gtk_grid_new();
Show;
end;
-destructor TGTKTable.Destroy;
+destructor TGTKGrid.Destroy;
begin
inherited Destroy;
end;
-function TGTKTable.GetRowCount: integer;
-var nrows: guint;
-begin
- nrows := 1;
- g_object_get(PGObject(FWidget), 'n-rows', [@nrows, nil]);
- Result := nrows;
-end;
-
-procedure TGTKTable.SetRowCount(Value: integer);
-begin
- SetRowColCount(Value, ColCount);
-end;
-
-function TGTKTable.GetColCount: integer;
-var ncols: guint;
+function TGTKGrid.GetRowSpacing: integer;
begin
- ncols := 1;
- g_object_get(PGObject(FWidget), 'n-columns', [@ncols, nil]);
- Result := ncols;
+ Result := gtk_grid_get_row_spacing(PGtkGrid(FWidget));
end;
-procedure TGTKTable.SetColCount(Value: integer);
+procedure TGTKGrid.SetRowSpacing(Value: integer);
begin
- SetRowColCount(RowCount, Value);
+ gtk_grid_set_row_spacing(PGtkGrid(FWidget), Value);
end;
-procedure TGTKTable.SetRowColCount(Rows, Cols: integer);
+function TGTKGrid.GetColSpacing: integer;
begin
- gtk_table_resize(PGtkTable(FWidget), Rows, Cols);
+ Result := gtk_grid_get_column_spacing(PGtkGrid(FWidget));
end;
-function TGTKTable.GetRowSpacing: integer;
+procedure TGTKGrid.SetColSpacing(Value: integer);
begin
- Result := gtk_table_get_default_row_spacing(PGtkTable(FWidget));
+ gtk_grid_set_column_spacing(PGtkGrid(FWidget), Value);
end;
-procedure TGTKTable.SetRowSpacing(Value: integer);
+function TGTKGrid.GetRowHomogeneous: boolean;
begin
- gtk_table_set_row_spacings(PGtkTable(FWidget), Value);
+ Result := gtk_grid_get_row_homogeneous(PGtkGrid(FWidget));
end;
-function TGTKTable.GetColSpacing: integer;
+function TGTKGrid.GetColHomogeneous: boolean;
begin
- Result := gtk_table_get_default_col_spacing(PGtkTable(FWidget));
+ Result := gtk_grid_get_column_homogeneous(PGtkGrid(FWidget));
end;
-procedure TGTKTable.SetColSpacing(Value: integer);
+procedure TGTKGrid.SetRowHomogeneous(Value: boolean);
begin
- gtk_table_set_col_spacings(PGtkTable(FWidget), Value);
+ gtk_grid_set_row_homogeneous(PGtkGrid(FWidget), Value);
end;
-function TGTKTable.GetHomogeneous: boolean;
+procedure TGTKGrid.SetColHomogeneous(Value: boolean);
begin
- Result := gtk_table_get_homogeneous(PGtkTable(FWidget));
+ gtk_grid_set_column_homogeneous(PGtkGrid(FWidget), Value);
end;
-procedure TGTKTable.SetHomogeneous(Value: boolean);
+procedure TGTKGrid.AddControl(Column, Row, NumCols, NumRows: integer; Control: TGTKControl);
begin
- gtk_table_set_homogeneous(PGtkTable(FWidget), Value);
+ gtk_grid_attach(PGtkGrid(FWidget), Control.FWidget, Column, Row, NumCols, NumRows);
end;
-procedure TGTKTable.AddControl(Column, Row, NumCols, NumRows: integer; Control: TGTKControl; XPadding, YPadding: integer);
-begin
- gtk_table_attach(PGtkTable(FWidget), Control.FWidget, Column, Column + NumCols, Row, Row + NumRows,
- GTK_EXPAND or GTK_SHRINK or GTK_FILL, GTK_EXPAND or GTK_SHRINK or GTK_FILL, XPadding, YPadding);
-end;
-
-procedure TGTKTable.AddControlEx(Column, Row, NumCols, NumRows: integer; Control: TGTKControl; XAttachOptions,
- YAttachOptions: TGTKTableAttachOptions; XPadding, YPadding: integer);
-begin
- gtk_table_attach(PGtkTable(FWidget), Control.FWidget, Column, Column + NumCols, Row, Row + NumRows,
- (GTK_EXPAND*Ord(taoExpand in XAttachOptions)) or (GTK_SHRINK*Ord(taoShrink in XAttachOptions)) or (GTK_FILL*Ord(taoFill in XAttachOptions)),
- (GTK_EXPAND*Ord(taoExpand in YAttachOptions)) or (GTK_SHRINK*Ord(taoShrink in YAttachOptions)) or (GTK_FILL*Ord(taoFill in YAttachOptions)),
- XPadding, YPadding);
-end;
-
-
(********************************************************************************************************************************)
(********************************************************************************************************************************)
diff --git a/libgtk_kylix/GTKDialogs.pas b/libgtk_kylix/GTKDialogs.pas
index 17b32d0..dfbe1b2 100644
--- a/libgtk_kylix/GTKDialogs.pas
+++ b/libgtk_kylix/GTKDialogs.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKDialogs - Special purpose dialogs
- Version 0.7.0 (last updated 2006-02-05)
Copyright (C) 2006 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,20 +23,15 @@ unit GTKDialogs;
interface
-uses gtk2, gdk2, lazglib2, lazgobject2, Classes, GTKControls, GTKUtils, GTKClasses, GTKForms;
-
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, Classes, GTKControls, GTKStdCtrls, GTKForms;
type
-(****************************************** TGTKFILESELECTIONDIALOG *************************************************************)
- TGTKFileSelectionDialog = class(TGTKDialog)
+(****************************************** TGTKFILECHOOSERDIALOG *************************************************************)
+ TGTKFileChooserDialog = class(TGTKDialog)
private
function GetFileName: string;
- function GetShowFileOpButtons: boolean;
- function GetMultiSelect: boolean;
procedure SetFileName(Value: string);
- procedure SetShowFileOpButtons(Value: boolean);
- procedure SetMultiSelect(Value: boolean);
protected
public
constructor Create(AOwner: TComponent); override;
@@ -45,45 +39,37 @@ type
destructor Destroy; override;
published
property FileName: string read GetFileName write SetFileName;
- property ShowFileOpButtons: boolean read GetShowFileOpButtons write SetShowFileOpButtons;
- property MultiSelect: boolean read GetMultiSelect write SetMultiSelect;
end;
-(****************************************** TGTKCOLORSELECTIONDIALOG ************************************************************)
- TGTKColorSelectionDialog = class(TGTKDialog)
+(****************************************** TGTKCOLORBUTTON *******************************************************************)
+ TGTKColorButton = class(TGTKButton)
private
- function GetShowOpacity: boolean;
- procedure SetShowOpacity(Value: boolean);
- function GetShowPalette: boolean;
- procedure SetShowPalette(Value: boolean);
- function GetColor: TGDKColor;
- procedure SetColor(Value: TGDKColor);
+ FColorChanged: TNotifyEvent;
+ function GetColor: string;
+ procedure SetColor(Value: string);
protected
public
constructor Create(AOwner: TComponent); override;
- constructor CreateWithTitle(AOwner: TComponent; const Title: string);
destructor Destroy; override;
- property Color: TGDKColor read GetColor write SetColor;
+ procedure SetDefaultColor;
published
- property ShowOpacity: boolean read GetShowOpacity write SetShowOpacity;
- property ShowPalette: boolean read GetShowPalette write SetShowPalette;
+ property Color: string read GetColor write SetColor;
+ property OnColorChanged: TNotifyEvent read FColorChanged write FColorChanged;
end;
-(****************************************** TGTKFONTSELECTIONDIALOG *************************************************************)
- TGTKFontSelectionDialog = class(TGTKDialog)
+(****************************************** TGTKFontButton *************************************************************)
+ TGTKFontButton = class(TGTKButton)
private
+ FFontNameChanged: TNotifyEvent;
function GetFontName: string;
procedure SetFontName(Value: string);
- function GetPreviewText: string;
- procedure SetPreviewText(Value: string);
protected
public
constructor Create(AOwner: TComponent); override;
- constructor CreateWithTitle(AOwner: TComponent; const Title: string);
destructor Destroy; override;
published
property FontName: string read GetFontName write SetFontName;
- property PreviewText: string read GetPreviewText write SetPreviewText;
+ property OnFontNameChanged: TNotifyEvent read FFontNameChanged write FFontNameChanged;
end;
(********************************************************************************************************************************)
@@ -95,154 +81,107 @@ uses SysUtils, DateUtils;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKFileSelectionDialog.Create(AOwner: TComponent);
+constructor TGTKFileChooserDialog.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_file_selection_new(nil);
+ FWidget := gtk_file_chooser_dialog_new(nil, PGtkWindow((AOwner as TCustomGTKForm).FWidget), GTK_FILE_CHOOSER_ACTION_OPEN, nil, [nil]);
Show;
end;
-constructor TGTKFileSelectionDialog.CreateWithTitle(AOwner: TComponent; const Title: string);
+constructor TGTKFileChooserDialog.CreateWithTitle(AOwner: TComponent; const Title: string);
begin
inherited Create(AOwner);
- FWidget := gtk_file_selection_new(PChar(Title));
+ FWidget := gtk_file_chooser_dialog_new(PChar(Title), PGtkWindow((AOwner as TCustomGTKForm).FWidget), GTK_FILE_CHOOSER_ACTION_OPEN, nil, [nil]);
Show;
end;
-destructor TGTKFileSelectionDialog.Destroy;
+destructor TGTKFileChooserDialog.Destroy;
begin
inherited Destroy;
end;
-function TGTKFileSelectionDialog.GetFileName: string;
-begin
- Result := string(gtk_file_selection_get_filename(PGtkFileSelection(FWidget)));
-end;
-
-procedure TGTKFileSelectionDialog.SetFileName(Value: string);
-begin
- gtk_file_selection_set_filename(PGtkFileSelection(FWidget), PChar(Value));
-end;
-
-function TGTKFileSelectionDialog.GetShowFileOpButtons: boolean;
-var b: Boolean;
+function TGTKFileChooserDialog.GetFileName: string;
begin
- b := False;
- g_object_get(PGObject(FWidget), 'show-fileops', [@b, nil]);
- Result := b;
+ Result := String(gtk_file_chooser_get_filename(PGtkFileChooser(FWidget)));
end;
-procedure TGTKFileSelectionDialog.SetShowFileOpButtons(Value: boolean);
+procedure TGTKFileChooserDialog.SetFileName(Value: string);
begin
- if Value then gtk_file_selection_show_fileop_buttons(PGtkFileSelection(FWidget))
- else gtk_file_selection_hide_fileop_buttons(PGtkFileSelection(FWidget));
-end;
-
-function TGTKFileSelectionDialog.GetMultiSelect: boolean;
-begin
- Result := gtk_file_selection_get_select_multiple(PGtkFileSelection(FWidget));
-end;
-
-procedure TGTKFileSelectionDialog.SetMultiSelect(Value: boolean);
-begin
- gtk_file_selection_set_select_multiple(PGtkFileSelection(FWidget), Value);
+ gtk_file_chooser_set_filename(PGtkFileChooser(FWidget), PChar(Value));
end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKColorSelectionDialog.Create(AOwner: TComponent);
+procedure GtkColorButton_color_set(widget: PGtkColorButton; user_data: gpointer); cdecl;
begin
- inherited Create(AOwner);
- FWidget := gtk_color_selection_dialog_new(nil);
- Show;
+ if Assigned(user_data) and Assigned(TGTKColorButton(user_data).FColorChanged) then
+ TGTKColorButton(user_data).FColorChanged(TGTKColorButton(user_data));
end;
-constructor TGTKColorSelectionDialog.CreateWithTitle(AOwner: TComponent; const Title: string);
+constructor TGTKColorButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_color_selection_dialog_new(PChar(Title));
+ FWidget := gtk_color_button_new();
+ g_signal_connect_data(PGObject(FWidget), 'color-set', TGCallback(@GtkColorButton_color_set), Self, nil, G_CONNECT_DEFAULT);
Show;
+ FColorChanged := nil;
end;
-destructor TGTKColorSelectionDialog.Destroy;
+destructor TGTKColorButton.Destroy;
begin
inherited Destroy;
end;
-function TGTKColorSelectionDialog.GetShowOpacity: boolean;
+function TGTKColorButton.GetColor: string;
+var c: TGdkRGBA;
begin
- Result := gtk_color_selection_get_has_opacity_control(PGtkColorSelection(PGtkColorSelectionDialog(FWidget)^.colorsel));
+ FillChar(c, sizeof(TGdkRGBA), 0);
+ gtk_color_chooser_get_rgba(PGtkColorChooser(FWidget), @c);
+ Result := string(gdk_rgba_to_string(@c));
end;
-procedure TGTKColorSelectionDialog.SetShowOpacity(Value: boolean);
+procedure TGTKColorButton.SetColor(Value: string);
+var c: TGdkRGBA;
begin
- gtk_color_selection_set_has_opacity_control(PGtkColorSelection(PGtkColorSelectionDialog(FWidget)^.colorsel), Value);
+ if gdk_rgba_parse(@c, PChar(Value)) then
+ gtk_color_chooser_set_rgba(PGtkColorChooser(FWidget), @c);
end;
-function TGTKColorSelectionDialog.GetShowPalette: boolean;
+procedure TGTKColorButton.SetDefaultColor;
begin
- Result := gtk_color_selection_get_has_palette(PGtkColorSelection(PGtkColorSelectionDialog(FWidget)^.colorsel));
-end;
-
-procedure TGTKColorSelectionDialog.SetShowPalette(Value: boolean);
-begin
- gtk_color_selection_set_has_palette(PGtkColorSelection(PGtkColorSelectionDialog(FWidget)^.colorsel), Value);
-end;
-
-function TGTKColorSelectionDialog.GetColor: TGDKColor;
-var Col: gdk2.TGDkColor;
-begin
- FillChar(Col, sizeof(gdk2.TGDkColor), 0);
- gtk_color_selection_get_current_color(PGtkColorSelection(PGtkColorSelectionDialog(FWidget)^.colorsel), @Col);
- Result := PGdkColorToGDKColor(@Col);
-end;
-
-procedure TGTKColorSelectionDialog.SetColor(Value: TGDKColor);
-var Col: PGDkColor;
-begin
- Col := GDKColorToPGdkColor(Value);
- gtk_color_selection_set_current_color(PGtkColorSelection(PGtkColorSelectionDialog(FWidget)^.colorsel), Col);
+ gtk_color_chooser_set_rgba(PGtkColorChooser(FWidget), nil);
end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKFontSelectionDialog.Create(AOwner: TComponent);
+procedure GtkFontButton_font_set(widget: PGtkFontButton; user_data: gpointer); cdecl;
begin
- inherited Create(AOwner);
- FWidget := gtk_font_selection_dialog_new(nil);
- Show;
+ if Assigned(user_data) and Assigned(TGTKFontButton(user_data).FFontNameChanged) then
+ TGTKFontButton(user_data).FFontNameChanged(TGTKFontButton(user_data));
end;
-constructor TGTKFontSelectionDialog.CreateWithTitle(AOwner: TComponent; const Title: string);
+constructor TGTKFontButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_font_selection_dialog_new(PChar(Title));
+ FWidget := gtk_font_button_new();
+ g_signal_connect_data(PGObject(FWidget), 'font-set', TGCallback(@GtkFontButton_font_set), Self, nil, G_CONNECT_DEFAULT);
Show;
+ FFontNameChanged := nil;
end;
-destructor TGTKFontSelectionDialog.Destroy;
+destructor TGTKFontButton.Destroy;
begin
inherited Destroy;
end;
-function TGTKFontSelectionDialog.GetFontName: string;
-begin
- Result := String(gtk_font_selection_dialog_get_font_name(PGtkFontSelectionDialog(FWidget)));
-end;
-
-procedure TGTKFontSelectionDialog.SetFontName(Value: string);
-begin
- gtk_font_selection_dialog_set_font_name(PGtkFontSelectionDialog(FWidget), PChar(Value));
-end;
-
-function TGTKFontSelectionDialog.GetPreviewText: string;
+function TGTKFontButton.GetFontName: string;
begin
- Result := String(gtk_font_selection_dialog_get_preview_text(PGtkFontSelectionDialog(FWidget)));
+ Result := String(gtk_font_chooser_get_font(PGtkFontChooser(FWidget)));
end;
-procedure TGTKFontSelectionDialog.SetPreviewText(Value: string);
+procedure TGTKFontButton.SetFontName(Value: string);
begin
- gtk_font_selection_dialog_set_preview_text(PGtkFontSelectionDialog(FWidget), PChar(Value));
+ gtk_font_chooser_set_font(PGtkFontChooser(FWidget), PChar(Value));
end;
(********************************************************************************************************************************)
diff --git a/libgtk_kylix/GTKExtCtrls.pas b/libgtk_kylix/GTKExtCtrls.pas
index 777f8ed..4cb925e 100644
--- a/libgtk_kylix/GTKExtCtrls.pas
+++ b/libgtk_kylix/GTKExtCtrls.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKExtCtrls - Extended visual controls
- Version 0.6.23 (last updated 2008-08-23)
Copyright (C) 2004 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKExtCtrls;
interface
-uses gtk2, lazglib2, lazgobject2, Classes, GTKControls, GTKStdCtrls, GTKMenus;
+uses lazglib2, lazgobject2, lazgtk3, Classes, GTKControls, GTKStdCtrls, GTKMenus;
type
@@ -47,24 +46,6 @@ type
constructor Create(AOwner: TComponent); override;
end;
-(****************************************** TGTKHANDLEBOX ***********************************************************************)
- TGTKHandleBox = class(TGTKBin)
- private
- function GetShadowType: TGTKShadowType;
- function GetHandlePosition: TGTKPosition;
- function GetSnapEdge: TGTKPosition;
- procedure SetShadowType(Value: TGTKShadowType);
- procedure SetHandlePosition(Value: TGTKPosition);
- procedure SetSnapEdge(Value: TGTKPosition);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- published
- property ShadowType: TGTKShadowType read GetShadowType write SetShadowType;
- property HandlePosition: TGTKPosition read GetHandlePosition write SetHandlePosition;
- property SnapEdge: TGTKPosition read GetSnapEdge write SetSnapEdge;
- end;
-
(****************************************** TGTKPROGRESSBAR *********************************************************************)
TGTKProgressBarOrientation = (poLeftToRight, poRightToLeft, poBottomToTop, poTopToBottom);
TGTKProgressBar = class(TGTKControl)
@@ -73,12 +54,10 @@ type
function GetText: string;
function GetFraction: Double;
function GetPulseStep: Double;
- function GetOrientation: TGTKProgressBarOrientation;
function GetValue: Int64;
procedure SetText(Value: string);
procedure SetFraction(Value: Double);
procedure SetPulseStep(Value: Double);
- procedure SetOrientation(Value: TGTKProgressBarOrientation);
procedure SetValue(Value: Int64);
public
constructor Create(AOwner: TComponent); override;
@@ -88,7 +67,6 @@ type
property Text: string read GetText write SetText;
property Fraction: Double read GetFraction write SetFraction;
property PulseStep: Double read GetPulseStep write SetPulseStep;
- property Orientation: TGTKProgressBarOrientation read GetOrientation write SetOrientation;
property Max: Int64 read FMax write FMax;
property Value: Int64 read GetValue write SetValue;
end;
@@ -147,10 +125,6 @@ type
procedure SetCaption(PageNo: integer; Caption: string);
procedure NextPage;
procedure PrevPage;
- function GetExpandTab(PageNo: integer): boolean;
- procedure SetExpandTab(PageNo: integer; Value: boolean);
- function GetFillTab(PageNo: integer): boolean;
- procedure SetFillTab(PageNo: integer; Value: boolean);
function GetTabLabel(PageNo: integer): TGTKLabel;
published
property PageIndex: integer read GetPageIndex write SetPageIndex;
@@ -161,23 +135,45 @@ type
property OnSwitchPage: TNotifyEvent read FOnSwitchPage write FOnSwitchPage;
end;
-(****************************************** TGTKOPTIONMENU **********************************************************************)
- TGTKOptionMenu = class(TGTKButton)
+(****************************************** TGTKCOMBOBOX ***********************************************************************)
+ TGTKComboBox = class(TGTKBin)
private
- FItems: TGTKMenuItem;
FOnChanged: TNotifyEvent;
- procedure ItemsChanged(Sender: TObject);
function GetItemIndex: integer;
+ function GetItemID: string;
procedure SetItemIndex(Value: integer);
+ procedure SetItemID(Value: string);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
+ procedure AppendItem(const Text: string);
+ procedure AppendItemID(const ID: string; const Text: string);
+ procedure ClearItems();
published
- property Items: TGTKMenuItem read FItems;
property ItemIndex: integer read GetItemIndex write SetItemIndex;
+ property ItemID: string read GetItemID write SetItemID;
property OnChanged: TNotifyEvent read FOnChanged write FOnChanged;
end;
+(****************************************** TGTKCOMBOBOXTEXT *******************************************************************)
+ TGTKComboBoxText = class(TGTKComboBox)
+ private
+ public
+ constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
+ published
+ end;
+
+(****************************************** TGTKCOMBOBOXENTRY *******************************************************************)
+ TGTKComboBoxEntry = class(TGTKComboBox)
+ private
+ public
+ Entry: TGTKEntry;
+ constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
+ published
+ end;
+
(****************************************** TGTKSCROLLEDWINDOW ******************************************************************)
TGTKScrollBarPolicy = (sbAlways, sbAutomatic, sbNever);
TGTKScrolledWindow = class(TGTKBin)
@@ -199,7 +195,7 @@ type
end;
(****************************************** TGTKBUTTONBOX ***********************************************************************)
- TGTKButtonBoxLayout = (blDefault, blSpread, blEdge, blStart, blEnd);
+ TGTKButtonBoxLayout = (blDefault, blSpread, blEdge, blStart, blEnd, blCenter, blExpand);
TGTKButtonBox = class(TGTKBox)
private
function GetLayout: TGTKButtonBoxLayout;
@@ -245,7 +241,7 @@ end;
constructor TGTKHSeparator.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_hseparator_new;
+ FWidget := gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
Show;
end;
@@ -254,56 +250,12 @@ end;
constructor TGTKVSeparator.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_vseparator_new;
+ FWidget := gtk_separator_new(GTK_ORIENTATION_VERTICAL);
Show;
end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKHandleBox.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FWidget := gtk_handle_box_new;
- Show;
-end;
-
-destructor TGTKHandleBox.Destroy;
-begin
- inherited Destroy;
-end;
-
-function TGTKHandleBox.GetShadowType: TGTKShadowType;
-begin
- Result := TGTKShadowType(gtk_handle_box_get_shadow_type(PGtkHandleBox(FWidget)));
-end;
-
-procedure TGTKHandleBox.SetShadowType(Value: TGTKShadowType);
-begin
- gtk_handle_box_set_shadow_type(PGtkHandleBox(FWidget), gtk2.TGtkShadowType(Value));
-end;
-
-function TGTKHandleBox.GetHandlePosition: TGTKPosition;
-begin
- Result := TGTKPosition(gtk_handle_box_get_handle_position(PGtkHandleBox(FWidget)));
-end;
-
-procedure TGTKHandleBox.SetHandlePosition(Value: TGTKPosition);
-begin
- gtk_handle_box_set_handle_position(PGtkHandleBox(FWidget), Integer(Value));
-end;
-
-function TGTKHandleBox.GetSnapEdge: TGTKPosition;
-begin
- Result := TGTKPosition(gtk_handle_box_get_snap_edge(PGtkHandleBox(FWidget)));
-end;
-
-procedure TGTKHandleBox.SetSnapEdge(Value: TGTKPosition);
-begin
- gtk_handle_box_set_snap_edge(PGtkHandleBox(FWidget), Integer(Value));
-end;
-
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
constructor TGTKProgressBar.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@@ -352,16 +304,6 @@ begin
gtk_progress_bar_set_pulse_step(PGtkProgressbar(FWidget), Value);
end;
-function TGTKProgressBar.GetOrientation: TGTKProgressBarOrientation;
-begin
- Result := TGTKProgressBarOrientation(gtk_progress_bar_get_orientation(PGtkProgressBar(FWidget)));
-end;
-
-procedure TGTKProgressBar.SetOrientation(Value: TGTKProgressBarOrientation);
-begin
- gtk_progress_bar_set_orientation(PGtkProgressbar(FWidget), gtk2.TGtkProgressBarOrientation(Value));
-end;
-
function TGTKProgressBar.GetValue: Int64;
begin
Result := Round(Fraction * Max);
@@ -419,7 +361,7 @@ end;
constructor TGTKHPaned.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_hpaned_new;
+ FWidget := gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
Show;
end;
@@ -428,14 +370,14 @@ end;
constructor TGTKVPaned.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_vpaned_new;
+ FWidget := gtk_paned_new(GTK_ORIENTATION_VERTICAL);
Show;
end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-procedure TGTKNotebook_switch_page(notebook: PGtkNotebook; page: PGtkNotebookPage; page_num: guint; user_data: gpointer); cdecl;
+procedure TGTKNotebook_switch_page(notebook: PGtkNotebook; page: PGtkWidget; page_num: guint; user_data: gpointer); cdecl;
begin
if Assigned(user_data) and Assigned(TGTKNotebook(user_data).FOnSwitchPage) then TGTKNotebook(user_data).FOnSwitchPage(TObject(user_data));
end;
@@ -454,11 +396,9 @@ begin
inherited Destroy;
end;
-function _gtk_notebook_append_page(notebook:PGtkNotebook; child:PGtkWidget; tab_label:PGtkWidget): gint; cdecl; external gtklib name 'gtk_notebook_append_page';
-
function TGTKNotebook.AppendPage(Child: TGTKControl; Caption: string): integer;
begin
- Result := _gtk_notebook_append_page(PGtkNotebook(FWidget), Child.FWidget, nil);
+ Result := gtk_notebook_append_page(PGtkNotebook(FWidget), Child.FWidget, nil);
gtk_notebook_set_tab_label_text(PGtkNotebook(FWidget), Child.FWidget, PChar(Caption));
end;
@@ -484,7 +424,7 @@ end;
procedure TGTKNotebook.SetPageIndex(Value: integer);
begin
- gtk_notebook_set_page(PGtkNotebook(FWidget), Value);
+ gtk_notebook_set_current_page(PGtkNotebook(FWidget), Value);
end;
procedure TGTKNotebook.NextPage;
@@ -504,7 +444,7 @@ end;
procedure TGTKNotebook.SetTabPosition(Value: TGTKPosition);
begin
- gtk_notebook_set_tab_pos(PGtkNotebook(FWidget), Integer(Value));
+ gtk_notebook_set_tab_pos(PGtkNotebook(FWidget), TGtkPositionType(Value));
end;
function TGTKNotebook.GetShowTabs: boolean;
@@ -537,79 +477,91 @@ begin
gtk_notebook_set_scrollable(PGtkNotebook(FWidget), Value);
end;
-procedure _gtk_notebook_query_tab_label_packing(notebook:PGtkNotebook;child:PGtkWidget;expand:Pgboolean;fill:Pgboolean;pack_type:PGtkPackType); cdecl; external gtklib name 'gtk_notebook_query_tab_label_packing';
+function TGTKNotebook.GetTabLabel(PageNo: integer): TGTKLabel;
+begin
+ Result := TGTKLabel.CreateFromWidget(Self, gtk_notebook_get_tab_label(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo)));
+end;
-function TGTKNotebook.GetExpandTab(PageNo: integer): boolean;
-var expand: gboolean;
+(********************************************************************************************************************************)
+(********************************************************************************************************************************)
+procedure TGTKComboBox_changed(widget: PGtkComboBox; user_data: pgpointer); cdecl;
begin
- expand := False;
- _gtk_notebook_query_tab_label_packing(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo), @expand, nil, nil);
- Result := expand;
+ if Assigned(TGTKComboBox(user_data).FOnChanged) then TGTKComboBox(user_data).FOnChanged(TGTKComboBox(user_data));
end;
-procedure TGTKNotebook.SetExpandTab(PageNo: integer; Value: boolean);
+constructor TGTKComboBox.Create(AOwner: TComponent);
begin
- gtk_notebook_set_tab_label_packing(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo), Value, GetFillTab(PageNo), GTK_PACK_START);
+ inherited Create(AOwner);
+ FOnChanged := nil;
end;
-function TGTKNotebook.GetFillTab(PageNo: integer): boolean;
-var fill: gboolean;
+destructor TGTKComboBox.Destroy;
begin
- fill := False;
- _gtk_notebook_query_tab_label_packing(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo), nil, @fill, nil);
- Result := fill;
+ inherited Destroy;
end;
-procedure TGTKNotebook.SetFillTab(PageNo: integer; Value: boolean);
+function TGTKComboBox.GetItemIndex: integer;
begin
- gtk_notebook_set_tab_label_packing(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo), GetExpandTab(PageNo), Value, GTK_PACK_START);
+ Result := gtk_combo_box_get_active(PGtkComboBox(FWidget));
end;
-function TGTKNotebook.GetTabLabel(PageNo: integer): TGTKLabel;
+function TGTKComboBox.GetItemID: string;
begin
- Result := TGTKLabel.CreateFromWidget(Self, gtk_notebook_get_tab_label(PGtkNotebook(FWidget), gtk_notebook_get_nth_page(PGtkNotebook(FWidget), PageNo)));
+ Result := string(gtk_combo_box_get_active_id(PGtkComboBox(FWidget)));
end;
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
-procedure TGTKOptionMenu_changed(optionmenu: PGtkOptionMenu; user_data: pgpointer); cdecl;
+procedure TGTKComboBox.SetItemIndex(Value: integer);
begin
- if Assigned(TGTKOptionMenu(user_data).FOnChanged) then TGTKOptionMenu(user_data).FOnChanged(TGTKOptionMenu(user_data));
+ gtk_combo_box_set_active(PGtkComboBox(FWidget), Value);
end;
-constructor TGTKOptionMenu.Create(AOwner: TComponent);
+procedure TGTKComboBox.SetItemID(Value: string);
begin
- inherited Create(AOwner);
- FOnChanged := nil;
- FWidget := gtk_option_menu_new;
- g_signal_connect_data(PGObject(FWidget), 'changed', TGCallback(@TGTKOptionMenu_changed), Self, nil, G_CONNECT_DEFAULT);
- Show;
- FItems := TGTKMenuItem.Create(Self);
- FItems.FParentMenu := Self;
- FItems.Notify := @ItemsChanged;
+ gtk_combo_box_set_active_id(PGtkComboBox(FWidget), PChar(Value));
end;
-destructor TGTKOptionMenu.Destroy;
+procedure TGTKComboBox.AppendItem(const Text: string);
begin
- FItems.Notify := nil;
- FItems.Free;
- inherited Destroy;
+ gtk_combo_box_text_append_text(PGtkComboBoxText(FWidget), PChar(Text));
end;
-procedure TGTKOptionMenu.ItemsChanged(Sender: TObject);
+procedure TGTKComboBox.AppendItemID(const ID: string; const Text: string);
begin
- if Assigned(FItems.FMenu) and (gtk_option_menu_get_menu(PGtkOptionMenu(FWidget)) <> FItems.FMenu)
- then gtk_option_menu_set_menu(PGtkOptionMenu(FWidget), FItems.FMenu);
+ gtk_combo_box_text_append(PGtkComboBoxText(FWidget), PChar(ID), PChar(Text));
end;
-function TGTKOptionMenu.GetItemIndex: integer;
+procedure TGTKComboBox.ClearItems();
begin
- Result := gtk_option_menu_get_history(PGtkOptionMenu(FWidget));
+ gtk_combo_box_text_remove_all(PGtkComboBoxText(FWidget));
end;
-procedure TGTKOptionMenu.SetItemIndex(Value: integer);
+(********************************************************************************************************************************)
+(********************************************************************************************************************************)
+constructor TGTKComboBoxText.Create(AOwner: TComponent);
begin
- gtk_option_menu_set_history(PGtkOptionMenu(FWidget), Value);
+ inherited Create(AOwner);
+ FWidget := gtk_combo_box_text_new();
+ g_signal_connect_data(PGObject(FWidget), 'changed', TGCallback(@TGTKComboBox_changed), Self, nil, G_CONNECT_DEFAULT);
+ Show;
+end;
+
+destructor TGTKComboBoxText.Destroy;
+begin
+ inherited Destroy;
+end;
+
+constructor TGTKComboBoxEntry.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ FWidget := gtk_combo_box_text_new_with_entry();
+ Entry := TGTKEntry.CreateFromWidget(Self, gtk_bin_get_child(PGtkBin(FWidget)));
+ g_signal_connect_data(PGObject(FWidget), 'changed', TGCallback(@TGTKComboBox_changed), Self, nil, G_CONNECT_DEFAULT);
+ Show;
+end;
+
+destructor TGTKComboBoxEntry.Destroy;
+begin
+ inherited Destroy;
end;
(********************************************************************************************************************************)
@@ -657,12 +609,12 @@ end;
procedure TGTKScrolledWindow.SetShadowType(Value: TGTKShadowType);
begin
- gtk_scrolled_window_set_shadow_type(PGtkScrolledWindow(FWidget), gtk2.TGtkShadowType(Value));
+ gtk_scrolled_window_set_shadow_type(PGtkScrolledWindow(FWidget), lazgtk3.TGtkShadowType(Value));
end;
procedure TGTKScrolledWindow.AddWithViewPort(Control: TGTKControl);
begin
- gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(FWidget), Control.FWidget);
+ gtk_container_add(PGtkContainer(FWidget), Control.FWidget);
end;
(********************************************************************************************************************************)
@@ -679,7 +631,7 @@ end;
procedure TGTKButtonBox.SetLayout(Value: TGTKButtonBoxLayout);
begin
- gtk_button_box_set_layout(PGtkButtonBox(FWidget), Integer(Value));
+ gtk_button_box_set_layout(PGtkButtonBox(FWidget), TGtkButtonBoxStyle(Value));
end;
(********************************************************************************************************************************)
@@ -687,7 +639,7 @@ end;
constructor TGTKHButtonBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_hbutton_box_new;
+ FWidget := gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
Show;
end;
@@ -696,7 +648,7 @@ end;
constructor TGTKVButtonBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_vbutton_box_new;
+ FWidget := gtk_button_box_new(GTK_ORIENTATION_VERTICAL);
Show;
end;
diff --git a/libgtk_kylix/GTKForms.pas b/libgtk_kylix/GTKForms.pas
index a3572b6..b1467db 100644
--- a/libgtk_kylix/GTKForms.pas
+++ b/libgtk_kylix/GTKForms.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKForms - Basic windows (TGTKForm, TGTKDialog), TGTKApplication, TGDKScreen
- Version 0.6.28 (last updated 2008-10-12)
Copyright (C) 2007 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKForms;
interface
-uses gtk2, gdk2, lazglib2, lazgobject2, Classes, SysUtils, GTKControls, GTKConsts;
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, Classes, SysUtils, GTKControls, GTKConsts;
type // Some basic types
PCharArray = array[0..0] of PChar;
@@ -109,7 +108,6 @@ type // Some basic types
property Default: TGTKControl write SetDefault;
public
FAccelGroup: PGtkAccelGroup;
- Tooltips: TGTKTooltips;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Release;
@@ -144,9 +142,7 @@ type // Some basic types
private
FButtons: TMessageButtons;
FOnResponse: TGTKDialogResponseEvent;
- function GetShowSeparator: boolean;
procedure SetButtons(Value: TMessageButtons);
- procedure SetShowSeparator(Value: boolean);
procedure SetModalResult(Value: TMessageButton);
procedure SetDefaultButton(Value: TMessageButton);
procedure SetParentForm(Value: TCustomGTKForm);
@@ -159,7 +155,6 @@ type // Some basic types
procedure SetResponseSensitive(ButtonID: integer; Sensitive: boolean);
published
property Buttons: TMessageButtons read FButtons write SetButtons default [];
- property ShowSeparator: boolean read GetShowSeparator write SetShowSeparator;
property ModalResult: TMessageButton write SetModalResult;
property DefaultButton: TMessageButton write SetDefaultButton;
property Caption;
@@ -275,7 +270,7 @@ begin
Result := not TCustomGTKForm(user_data).Close;
end;
-procedure TCustomGTKForm_show(anobject : PGtkObject; user_data: pgpointer); cdecl;
+procedure TCustomGTKForm_show(widget: PGtkWidget; user_data: gpointer); cdecl;
begin
if Assigned(TCustomGTKForm(user_data).FOnShow) then TCustomGTKForm(user_data).FOnShow(TCustomGTKForm(user_data));
end;
@@ -288,7 +283,6 @@ end;
constructor TCustomGTKForm.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- Tooltips := TGTKTooltips.Create(Self);
FOnClose := nil;
FOnCloseQuery := nil;
FOnDestroy := nil;
@@ -304,7 +298,6 @@ begin
if Assigned(FOnDestroy) then FOnDestroy(Self);
except
end;
- Tooltips.Free;
if not Application.Terminated then gtk_widget_destroy(FWidget);
inherited Destroy;
end;
@@ -409,7 +402,7 @@ end;
procedure TCustomGTKForm.SetWindowTypeHint(Value: TGDKWindowTypeHint);
begin
- gtk_window_set_type_hint(PGtkWindow(FWidget), gdk2.TGdkWindowTypeHint(Value));
+ gtk_window_set_type_hint(PGtkWindow(FWidget), lazgdk3.TGdkWindowTypeHint(Value));
end;
function TCustomGTKForm.GetWindowState: TGDKWindowState;
@@ -689,9 +682,8 @@ end;
function TGTKApplication_MessageBox_key_press_event(widget: PGtkWidget; event: PGdkEventKey; user_data : gpointer): gboolean; cdecl;
begin
Result := False;
- if event^.keyval = GDK_ESCAPE then begin
- gtk_dialog_response(PGtkDialog(widget), integer(user_data));
-// Beep;
+ if event^.keyval = GDK_KEY_Escape then begin
+ gtk_dialog_response(PGtkDialog(widget), TGtkResponseType(guint(user_data)));
Result := True;
end;
end;
@@ -717,14 +709,14 @@ begin
Result := Escape;
Exit;
end;
- Dialog := gtk_message_dialog_new(ParentWindow, GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT, TMessageStyleID[Integer(Style)],
- GTK_BUTTONS_NONE, '%s', PChar(Text));
+ Dialog := gtk_message_dialog_new(ParentWindow, [GTK_DIALOG_MODAL, GTK_DIALOG_DESTROY_WITH_PARENT], TMessageStyleID[Integer(Style)],
+ GTK_BUTTONS_NONE, '%s', [PChar(Text)]);
for i := 1 to NumMessageButtons do
if TMessageButton(i - 1) in Buttons
- then gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], i);
+ then gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], TGtkResponseType(i));
if Escape <> mbNone then g_signal_connect_data(PGObject(Dialog), 'key-press-event', TGCallback(@TGTKApplication_MessageBox_key_press_event),
Pointer(Ord(Escape) + 1{MessageButtonID[Ord(Escape)]}), nil, G_CONNECT_DEFAULT);
- if Default <> mbNone then gtk_dialog_set_default_response(PGtkDialog(Dialog), Ord(Default));
+ if Default <> mbNone then gtk_dialog_set_default_response(PGtkDialog(Dialog), TGtkResponseType(Ord(Default)));
Result := TMessageButton(gtk_dialog_run(PGtkDialog(Dialog)) - 1);
gtk_widget_destroy(Dialog);
end;
@@ -795,8 +787,8 @@ begin
g_signal_connect_data(PGObject(FWidget), 'delete-event', TGCallback(@TCustomGTKForm_delete_event), Self, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(FWidget), 'show', TGCallback(@TCustomGTKForm_show), Self, nil, G_CONNECT_DEFAULT);
g_signal_connect_data(PGObject(FWidget), 'response', TGCallback(@TGTKDialog_response_event), Self, nil, G_CONNECT_DEFAULT);
- ClientArea := TGTKVBox.CreateLinked(Self, PGtkDialog(FWidget)^.vbox);
- ActionArea := TGTKHBox.CreateLinked(Self, PGtkDialog(FWidget)^.action_area);
+ ClientArea := TGTKVBox.CreateLinked(Self, gtk_dialog_get_content_area(PGtkDialog(FWidget)));
+ ActionArea := TGTKHBox.CreateLinked(Self, gtk_dialog_get_action_area(PGtkDialog(FWidget)));
FButtons := [];
Visible := False;
SetResizeable(True);
@@ -815,37 +807,27 @@ var i: integer;
begin
for i := 1 to NumMessageButtons do
if TMessageButton(i - 1) in Value
- then gtk_dialog_add_button(PGtkDialog(FWidget), MessageButtonID[i], i - 1);
-end;
-
-function TGTKDialog.GetShowSeparator: boolean;
-begin
- Result := gtk_dialog_get_has_separator(PGtkDialog(FWidget));
-end;
-
-procedure TGTKDialog.SetShowSeparator(Value: boolean);
-begin
- gtk_dialog_set_has_separator(PGtkDialog(FWidget), Value);
+ then gtk_dialog_add_button(PGtkDialog(FWidget), MessageButtonID[i], TGtkResponseType(i - 1));
end;
procedure TGTKDialog.SetModalResult(Value: TMessageButton);
begin
- gtk_dialog_response(PGtkDialog(FWidget), Integer(Value));
+ gtk_dialog_response(PGtkDialog(FWidget), TGtkResponseType(Integer(Value)));
end;
procedure TGTKDialog.SetDefaultButton(Value: TMessageButton);
begin
- gtk_dialog_set_default_response(PGtkDialog(FWidget), Integer(Value));
+ gtk_dialog_set_default_response(PGtkDialog(FWidget), TGtkResponseType(Integer(Value)));
end;
procedure TGTKDialog.AddButton(ButtonCaption: string; ButtonID: integer);
begin
- gtk_dialog_add_button(PGtkDialog(FWidget), PChar(ButtonCaption), ButtonID);
+ gtk_dialog_add_button(PGtkDialog(FWidget), PChar(ButtonCaption), TGtkResponseType(ButtonID));
end;
procedure TGTKDialog.SetResponseSensitive(ButtonID: integer; Sensitive: boolean);
begin
- gtk_dialog_set_response_sensitive(PGtkDialog(FWidget), ButtonID, Sensitive);
+ gtk_dialog_set_response_sensitive(PGtkDialog(FWidget), TGtkResponseType(ButtonID), Sensitive);
end;
procedure TGTKDialog.SetParentForm(Value: TCustomGTKForm);
diff --git a/libgtk_kylix/GTKMenus.pas b/libgtk_kylix/GTKMenus.pas
index ed2bfba..5819d5c 100644
--- a/libgtk_kylix/GTKMenus.pas
+++ b/libgtk_kylix/GTKMenus.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKMenus - Menu handling and related routines
- Version 0.6.13 (last updated 2003-07-10)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKMenus;
interface
-uses gtk2, gdk2, glib2, lazglib2, lazgobject2, Classes, GTKControls, GTKConsts, GTKPixbuf;
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, Classes, GTKControls, GTKConsts, GTKPixbuf;
type
(****************************************** TGDKSHORTCUTS ***********************************************************************)
@@ -55,12 +54,11 @@ type
end;
(****************************************** TGTKMENUITEM ************************************************************************)
- TGTKMenuItemType = (itLabel, itSeparator, itTearOff, itCheck, itImageText, itRadio);
+ TGTKMenuItemType = (itLabel, itSeparator, itCheck, itImageText, itRadio);
TGTKMenuItemGroup = PGSList;
TGTKMenuItem = class(TGTKBin)
private
FItems: TList;
- FTearOffTitle: string;
FOnClick: TNotifyEvent;
FUKey: guint;
FItemType: TGTKMenuItemType;
@@ -71,17 +69,12 @@ type
function GetCount: Integer;
function GetItem(Index: Integer): TGTKMenuItem;
function GetCaption: string;
- function GetRightJustified: boolean;
- function GetTornOff: boolean;
function GetChecked: boolean;
function GetGroup: TGTKMenuItemGroup;
procedure SetCaption(Value: string);
- procedure SetTearOffTitle(Value: string);
- procedure SetRightJustified(Value: boolean);
procedure SetItemType(Value: TGTKMenuItemType);
- procedure SetTornOff(Value: boolean);
procedure SetChecked(Value: boolean);
- procedure SetStockIcon(Value: string);
+ procedure SetIconName(Value: string);
procedure SetIcon(Value: TGDKPixbuf);
procedure SetGroup(Value: TGTKMenuItemGroup);
protected
@@ -97,22 +90,17 @@ type
procedure Clear;
procedure Delete(Index: Integer);
procedure Insert(Index: Integer; Item: TGTKMenuItem);
- procedure TearOff;
- procedure UnTearOff;
procedure PopUp;
procedure PopDown;
procedure SetCaptionPlain(Value: string);
property Count: Integer read GetCount;
property Items[Index: Integer]: TGTKMenuItem read GetItem; default;
property Caption: string read GetCaption write SetCaption;
- property TearOffTitle: string read FTearOffTitle write SetTearOffTitle;
- property RightJustified: boolean read GetRightJustified write SetRightJustified default False;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property ItemType: TGTKMenuItemType read FItemType write SetItemType default itLabel;
- property TornOff: boolean read GetTornOff write SetTornOff;
property Checked: boolean read GetChecked write SetChecked;
property Notify: TNotifyEvent read FNotify write FNotify;
- property StockIcon: string write SetStockIcon;
+ property IconName: string write SetIconName;
property Icon: TGDKPixbuf write SetIcon;
property Data: Pointer read FData write FData;
property OnPopup: TNotifyEvent read FOnPopup write FOnPopup;
@@ -131,7 +119,7 @@ type
property Items: TGTKMenuItem read FItems;
end;
-
+
function MakeGDKShortCut(Key: word; Locked, ModAlt, ModShift, ModCtrl : boolean): TGDKShortCut;
(********************************************************************************************************************************)
@@ -142,6 +130,9 @@ implementation
uses GTKForms;
+function gtk_image_menu_item_new_with_mnemonic(const L: Pgchar): PGtkImageMenuItem; cdecl; external LazGtk3_library;
+
+
(********************************************************************************************************************************)
(********************************************************************************************************************************)
constructor TGTKMenuBar.Create(AOwner: TComponent);
@@ -180,7 +171,6 @@ begin
FData := nil;
FOnPopup := nil;
ShortCuts := TGDKShortCuts.Create(Self);
- FTearOffTitle := '';
FUKey := 0;
Recreate;
end;
@@ -198,7 +188,6 @@ begin
FNotify := nil;
FData := nil;
ShortCuts := TGDKShortCuts.Create(Self);
- FTearOffTitle := '';
FUKey := 0;
Recreate(AGroup);
end;
@@ -225,8 +214,7 @@ begin
end;
case FItemType of
itLabel: FWidget := gtk_menu_item_new_with_mnemonic(Pgchar(SCDefaultMenuItemCaption));
- itSeparator: FWidget := gtk_menu_item_new;
- itTearOff: FWidget := gtk_tearoff_menu_item_new;
+ itSeparator: FWidget := gtk_separator_menu_item_new();
itCheck: FWidget := gtk_check_menu_item_new_with_mnemonic(Pgchar(SCDefaultMenuItemCaption));
itImageText: begin
FWidget := gtk_image_menu_item_new_with_mnemonic(Pgchar(SCDefaultMenuItemCaption));
@@ -234,7 +222,7 @@ begin
gtk_widget_show(FImageWidget);
gtk_image_menu_item_set_image(PGtkImageMenuItem(FWidget), FImageWidget);
end;
- itRadio: FWidget := gtk_radio_menu_item_new_with_mnemonic(GLIB2.PGSList(AGroup), Pgchar(SCDefaultMenuItemCaption));
+ itRadio: FWidget := gtk_radio_menu_item_new_with_mnemonic(PGSList(AGroup), Pgchar(SCDefaultMenuItemCaption));
end;
g_signal_connect_data(PGObject(FWidget), 'activate', TGCallback(@TGTKMenuItem_activate), Self, nil, G_CONNECT_DEFAULT);
Show;
@@ -277,7 +265,7 @@ begin
if (FParentMenu is TGTKMenuItem) or (FParentMenu is TGTKMenuBar)
then begin
if (FParentMenu is TGTKMenuItem) or (FParentMenu is TGTKMenuBar)
- then gtk_menu_item_remove_submenu(PGtkMenuItem(FWidget));
+ then gtk_menu_item_set_submenu(PGtkMenuItem(FWidget), nil);
gtk_widget_destroy(FMenu);
FMenu := nil;
end;
@@ -289,13 +277,12 @@ end;
procedure TGTKMenuItem.Insert(Index: Integer; Item: TGTKMenuItem);
begin
- if (Item = Self) or (FItemType in [itSeparator, itTearOff]) then Exit;
+ if (Item = Self) or (FItemType in [itSeparator]) then Exit;
if FItems = nil then begin
FItems := TList.Create;
if FMenu = nil then FMenu := gtk_menu_new;
if (FParentMenu is TGTKMenuItem) or (FParentMenu is TGTKMenuBar)
- then gtk_menu_item_set_submenu(PGtkMenuItem(FWidget), FMenu);
- SetTearOffTitle(FTearOffTitle);
+ then gtk_menu_item_set_submenu(PGtkMenuItem(FWidget), PGtkMenu(FMenu));
end;
Item.FParentMenu := Self;
FItems.Insert(Index, Item);
@@ -308,44 +295,20 @@ end;
function TGTKMenuItem.GetCaption: string;
begin
Result := '';
- if FItemType in [itSeparator, itTearOff] then Exit;
+ if FItemType in [itSeparator] then Exit;
if Assigned(ChildControl) then Result := String(gtk_label_get_text(PGtkLabel(ChildControl)));
end;
procedure TGTKMenuItem.SetCaption(Value: string);
begin
- if FItemType in [itSeparator, itTearOff] then Exit;
+ if FItemType in [itSeparator] then Exit;
gtk_label_set_markup_with_mnemonic(PGtkLabel(ChildControl), PChar(Value));
- if FTearOffTitle = '' then SetTearOffTitle(Value);
end;
procedure TGTKMenuItem.SetCaptionPlain(Value: string);
begin
- if FItemType in [itSeparator, itTearOff] then Exit;
+ if FItemType in [itSeparator] then Exit;
gtk_label_set_markup(PGtkLabel(ChildControl), PChar(Value));
- if FTearOffTitle = '' then SetTearOffTitle(Value);
-end;
-
-procedure TGTKMenuItem.SetTearOffTitle(Value: string);
-begin
- FTearOffTitle := Value;
- if FItemType = itTearOff then begin
- if Assigned(FParentMenu) and (FParentMenu is TGTKMenuItem) and Assigned((FParentMenu as TGTKMenuItem).FMenu)
- then gtk_menu_set_title(PGtkMenu((FParentMenu as TGTKMenuItem).FMenu), PChar(FTearOffTitle))
- end else if Assigned(FMenu) then gtk_menu_set_title(PGtkMenu(FMenu), PChar(FTearOffTitle));
-end;
-
-function TGTKMenuItem.GetRightJustified: boolean;
-begin
- Result := False;
- if FItemType in [itSeparator, itTearOff] then Exit;
- Result := gtk_menu_item_get_right_justified(PGtkMenuItem(FWidget));
-end;
-
-procedure TGTKMenuItem.SetRightJustified(Value: boolean);
-begin
- if FItemType in [itSeparator, itTearOff] then Exit;
- gtk_menu_item_set_right_justified(PGtkMenuItem(FWidget), Value);
end;
procedure TGTKMenuItem.SetItemType(Value: TGTKMenuItemType);
@@ -356,33 +319,6 @@ begin
end;
end;
-function TGTKMenuItem.GetTornOff: boolean;
-var b: gboolean;
-begin
- b := False;
- if FItemType = itTearOff then g_object_get(PGObject(FWidget), 'tearoff-state', [@b, nil]) else
- if Assigned(FMenu) and (Count > 0) then g_object_get(PGObject(FMenu), 'tearoff-state', [@b, nil]);
- Result := b;
-end;
-
-procedure TGTKMenuItem.SetTornOff(Value: boolean);
-begin
- if FItemType = itTearOff then begin
- if Assigned(FParentMenu) and (FParentMenu is TGTKMenuItem) and Assigned((FParentMenu as TGTKMenuItem).FMenu)
- then gtk_menu_set_tearoff_state(PGtkMenu((FParentMenu as TGTKMenuItem).FMenu), Value);
- end else if Assigned(FMenu) then gtk_menu_set_tearoff_state(PGtkMenu(FMenu), Value);
-end;
-
-procedure TGTKMenuItem.TearOff;
-begin
- SetTornOff(True);
-end;
-
-procedure TGTKMenuItem.UnTearOff;
-begin
- SetTornOff(False);
-end;
-
function TGTKMenuItem.GetChecked: boolean;
begin
Result := False;
@@ -407,9 +343,9 @@ begin
if (FItems <> nil) and (FItems.Count > 0) then gtk_menu_popdown(PGtkMenu(FMenu));
end;
-procedure TGTKMenuItem.SetStockIcon(Value: string);
+procedure TGTKMenuItem.SetIconName(Value: string);
begin
- gtk_image_set_from_stock(PGtkImage(FImageWidget), PChar(Value), GTK_ICON_SIZE_MENU);
+ gtk_image_set_from_icon_name(PGtkImage(FImageWidget), PChar(Value), GTK_ICON_SIZE_MENU);
end;
procedure TGTKMenuItem.SetIcon(Value: TGDKPixbuf);
@@ -419,12 +355,12 @@ end;
function TGTKMenuItem.GetGroup: TGTKMenuItemGroup;
begin
- Result := LAZGLIB2.PGSList(gtk_radio_menu_item_get_group(PGtkRadioMenuItem(FWidget)));
+ Result := PGSList(gtk_radio_menu_item_get_group(PGtkRadioMenuItem(FWidget)));
end;
procedure TGTKMenuItem.SetGroup(Value: TGTKMenuItemGroup);
begin
- gtk_radio_menu_item_set_group(PGtkRadioMenuItem(FWidget), GLIB2.PGSList(Value) );
+ gtk_radio_menu_item_set_group(PGtkRadioMenuItem(FWidget), PGSList(Value));
end;
(********************************************************************************************************************************)
@@ -453,10 +389,13 @@ begin
end;
procedure TGDKShortCuts.AddName(Item: string);
-var Key, Modifiers: guint;
+var accelerator_key: guint;
+ accelerator_mods: TGdkModifierType;
begin
- gtk_accelerator_parse(PChar(Item), @Key, @Modifiers);
- if Key <> 0 then Add(MakeGDKShortCut(Key, False, Modifiers and GDK_MOD1_MASK = GDK_MOD1_MASK, Modifiers and GDK_SHIFT_MASK = GDK_SHIFT_MASK, Modifiers and GDK_CONTROL_MASK = GDK_CONTROL_MASK));
+ accelerator_key := 0;
+ accelerator_mods := [];
+ gtk_accelerator_parse(PChar(Item), @accelerator_key, @accelerator_mods);
+ if accelerator_key <> 0 then Add(MakeGDKShortCut(accelerator_key, False, GDK_MOD1_MASK in accelerator_mods, GDK_SHIFT_MASK in accelerator_mods, GDK_CONTROL_MASK in accelerator_mods));
end;
procedure TGDKShortCuts.Clear;
@@ -465,18 +404,18 @@ begin
for i := Count - 1 downto 0 do Delete(i);
end;
-function GetAccelMods(SC: TGDKShortCut): guint;
+function GetAccelMods(SC: TGDKShortCut): TGdkModifierType;
begin
- Result := 0;
- if SC.ModShift then Inc(Result, GDK_SHIFT_MASK);
- if SC.ModCtrl then Inc(Result, GDK_CONTROL_MASK);
- if SC.ModAlt then Inc(Result, GDK_MOD1_MASK);
+ Result := [];
+ if SC.ModShift then Result += [GDK_SHIFT_MASK];
+ if SC.ModCtrl then Result += [GDK_CONTROL_MASK];
+ if SC.ModAlt then Result += [GDK_MOD1_MASK];
end;
function GetAccelFlags(SC: TGDKShortCut): TGtkAccelFlags;
begin
- Result := GTK_ACCEL_VISIBLE;
- if SC.Locked then Result := GTK_ACCEL_LOCKED;
+ Result := [GTK_ACCEL_VISIBLE];
+ if SC.Locked then Result := [GTK_ACCEL_LOCKED];
end;
procedure TGDKShortCuts.Delete(Index: Integer);
diff --git a/libgtk_kylix/GTKPixbuf.pas b/libgtk_kylix/GTKPixbuf.pas
index c296add..c199ac4 100644
--- a/libgtk_kylix/GTKPixbuf.pas
+++ b/libgtk_kylix/GTKPixbuf.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKPixbuf - Image handling routines
- Version 0.6.2 (last updated 2003-03-30)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKPixbuf;
interface
-uses lazglib2, gdk2pixbuf, gtk2, Classes, GTKControls, GTKStdCtrls;
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, lazgdkpixbuf2, Classes, GTKControls;
type
TGTKIconSize = (isInvalid, isMenu, isSmallToolbar, isLargeToolbar, isButton, isDND, isDialog);
@@ -39,16 +38,14 @@ type
public
FPixbuf: PGdkPixbuf;
constructor Create(AOwner: TComponent); override;
- constructor CreateNew(AOwner: TComponent; const Width, Height, BPP: integer; const HasAlpha: boolean);
destructor Destroy; override;
function LoadFromFile(const FileName: string): boolean;
- function LoadFromXPM(const Data: PPChar): boolean;
- function LoadFromInline(Data: Pointer): boolean;
+ function LoadFromResource(ResourcePath: string): boolean;
+ function LoadFromIconTheme(IconName: string; IconSize: Integer): boolean;
procedure Fill(const Pixel: Cardinal);
procedure ScaleSimple(const DestWidth, DestHeight: integer);
function Copy: PGdkPixbuf;
procedure CopyArea(Source: TGDKPixbuf; SourceX, SourceY, SourceWidth, SourceHeight, DestX, DestY: integer);
- procedure SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
published
property Width: integer read GetWidth;
property Height: integer read GetHeight;
@@ -56,7 +53,7 @@ type
end;
(****************************************** TGTKIMAGE ***************************************************************************)
- TGTKImage = class(TGTKMisc)
+ TGTKImage = class(TGTKControl)
private
protected
public
@@ -66,7 +63,7 @@ type
procedure SetFromPixbuf(Pixbuf: TGDKPixbuf);
function GetPixbuf: PGdkPixbuf;
procedure CopyFromPixbuf(Pixbuf: TGDKPixbuf);
- procedure SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
+ procedure SetFromIconName(IconName: string; IconSize: TGTKIconSize);
end;
(********************************************************************************************************************************)
@@ -84,15 +81,9 @@ begin
FPixbuf := nil;
end;
-constructor TGDKPixbuf.CreateNew(AOwner: TComponent; const Width, Height, BPP: integer; const HasAlpha: boolean);
-begin
- inherited Create(AOwner);
- FPixbuf := gdk_pixbuf_new(GDK_COLORSPACE_RGB, HasAlpha, BPP, Width, Height);
-end;
-
destructor TGDKPixbuf.Destroy;
begin
- if FPixbuf <> nil then gdk_pixbuf_unref(FPixbuf);
+ if FPixbuf <> nil then g_object_unref(FPixbuf);
inherited Destroy;
end;
@@ -121,23 +112,29 @@ begin
if P <> nil then FPixbuf := P;
end;
-function TGDKPixbuf.LoadFromXPM(const Data: PPChar): boolean;
+function TGDKPixbuf.LoadFromResource(ResourcePath: string): boolean;
var P: Pointer;
+ Error: PGError;
begin
- P := gdk_pixbuf_new_from_xpm_data(Data);
+ Error := nil;
+ P := gdk_pixbuf_new_from_resource(PChar(ResourcePath), @Error);
Result := P <> nil;
+ if Error <> nil then begin
+ WriteLn('TGDKPixbuf.LoadFromResource error: ', Error^.message);
+ g_error_free(Error);
+ end;
if P <> nil then FPixbuf := P;
end;
-function TGDKPixbuf.LoadFromInline(Data: Pointer): boolean;
+function TGDKPixbuf.LoadFromIconTheme(IconName: string; IconSize: Integer): boolean;
var P: Pointer;
Error: PGError;
begin
Error := nil;
- P := gdk_pixbuf_new_from_inline(-1, Pguint8(Data)^, True, @Error);
+ P := gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), PChar(IconName), IconSize, [], @Error);
Result := P <> nil;
if Error <> nil then begin
- WriteLn('TGDKPixbuf.LoadFromInline error: ', Error^.message);
+ WriteLn('TGDKPixbuf.LoadFromIconTheme error: ', Error^.message);
g_error_free(Error);
end;
if P <> nil then FPixbuf := P;
@@ -163,12 +160,6 @@ begin
gdk_pixbuf_copy_area(Source.FPixbuf, SourceX, SourceY, SourceWidth, SourceHeight, FPixbuf, DestX, DestY);
end;
-procedure TGDKPixbuf.SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
-begin
- FPixbuf := gtk_widget_render_icon(gtk_label_new(nil), PChar(Stock_ID), Ord(IconSize), nil);
-end;
-
-
(********************************************************************************************************************************)
(********************************************************************************************************************************)
constructor TGTKImage.Create(AOwner: TComponent);
@@ -203,9 +194,9 @@ begin
gtk_image_set_from_pixbuf(PGtkImage(FWidget), Pixbuf.Copy);
end;
-procedure TGTKImage.SetFromStock(Stock_ID: string; IconSize: TGTKIconSize);
+procedure TGTKImage.SetFromIconName(IconName: string; IconSize: TGTKIconSize);
begin
- gtk_image_set_from_stock(PGtkImage(FWidget), PChar(Stock_ID), Ord(IconSize));
+ gtk_image_set_from_icon_name(PGtkImage(FWidget), PChar(IconName), lazgtk3.TGtkIconSize(IconSize));
end;
(********************************************************************************************************************************)
diff --git a/libgtk_kylix/GTKStdCtrls.pas b/libgtk_kylix/GTKStdCtrls.pas
index 33ca7a6..2bca3bb 100644
--- a/libgtk_kylix/GTKStdCtrls.pas
+++ b/libgtk_kylix/GTKStdCtrls.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKStdCtrls - Standard visual controls (such as buttons, labels, entry)
- Version 0.6.24 (last updated 2008-11-17)
Copyright (C) 2007 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKStdCtrls;
interface
-uses gtk2, glib2, lazglib2, lazgobject2, Classes, GTKControls, GTKConsts, GTKClasses;
+uses lazglib2, lazgobject2, lazgtk3, Classes, GTKControls, GTKConsts;
type
@@ -34,51 +33,24 @@ type
private
FOnClick: TNotifyEvent;
function GetCaption: string;
- function GetUseStock: boolean;
function GetUseUnderline: boolean;
function GetBorderStyle: TGTKBorderStyle;
procedure SetCaption(Value: string);
- procedure SetUseStock(Value: boolean);
procedure SetUseUnderline(Value: boolean);
procedure SetBorderStyle(Value: TGTKBorderStyle);
public
constructor Create(AOwner: TComponent); override;
- constructor CreateFromStock(AOwner: TComponent; const StockID: PChar);
+ constructor CreateFromIconName(AOwner: TComponent; const IconName: string);
destructor Destroy; override;
published
property Caption: string read GetCaption write SetCaption;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
- property UseStock: boolean read GetUseStock write SetUseStock;
property UseUnderline: boolean read GetUseUnderline write SetUseUnderline;
property BorderStyle: TGTKBorderStyle read GetBorderStyle write SetBorderStyle;
end;
-(****************************************** TGTKMISC ****************************************************************************)
- TGTKMisc = class(TGTKControl)
- private
- function GetXAlign: Single;
- function GetYAlign: Single;
- function GetXPadding: integer;
- function GetYPadding: integer;
- procedure SetXAlign(Value: Single);
- procedure SetYAlign(Value: Single);
- procedure SetXPadding(Value: integer);
- procedure SetYPadding(Value: integer);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure SetAlignment(XAlign, YAlign : Single);
- procedure SetPadding(XPadding, YPadding : integer);
- published
- property XAlign: Single read GetXAlign write SetXAlign;
- property YAlign: Single read GetYAlign write SetYAlign;
- property XPadding: integer read GetXPadding write SetXPadding;
- property YPadding: integer read GetYPadding write SetYPadding;
- end;
-
(****************************************** TGTKLABEL **************************************************************************)
- TGTKAlignment = (taLeftJustify, taRightJustify, taCenter, taFill);
- TGTKLabel = class(TGTKMisc)
+ TGTKLabel = class(TGTKControl)
private
FLinked: boolean;
function GetCaption: string;
@@ -87,6 +59,8 @@ type
function GetLineWrap: boolean;
function GetUseUnderline: boolean;
function GetSelectable: boolean;
+ function GetXAlign: Single;
+ function GetYAlign: Single;
procedure SetCaption(Value: string);
procedure SetAlignment(Value: TGTKAlignment);
procedure SetUseMarkup(Value: boolean);
@@ -94,6 +68,8 @@ type
procedure SetUseUnderline(Value: boolean);
procedure SetFocusControl(Value: TGTKControl);
procedure SetSelectable(Value: boolean);
+ procedure SetXAlign(Value: Single);
+ procedure SetYAlign(Value: Single);
public
constructor Create(AOwner: TComponent); override;
constructor CreateFromWidget(AOwner: TComponent; Widget: PGtkWidget);
@@ -107,6 +83,8 @@ type
property UseUnderline: boolean read GetUseUnderline write SetUseUnderline;
property FocusControl: TGTKControl write SetFocusControl;
property Selectable: boolean read GetSelectable write SetSelectable;
+ property XAlign: Single read GetXAlign write SetXAlign;
+ property YAlign: Single read GetYAlign write SetYAlign;
end;
(****************************************** TGTKTOGGLEBUTTON ********************************************************************)
@@ -223,30 +201,6 @@ type
property Visibility: boolean read GetVisibility write SetVisibility;
end;
-(****************************************** TGTKCOMBO **************************************************************************)
- TGTKCombo = class(TGTKHBox)
- private
- procedure ItemsChanged(Sender: TObject);
- function GetAllowEmpty: boolean;
- function GetMatchValue: boolean;
- function GetCaseSensitive: boolean;
- procedure SetAllowEmpty(Value: boolean);
- procedure SetMatchValue(Value: boolean);
- procedure SetCaseSensitive(Value: boolean);
- public
- Items: TGList;
- Entry: TGTKEntry;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure UpdateItems;
- procedure SetPolicy(MatchValue, AllowEmpty: boolean);
- procedure DisableActivate;
- published
- property AllowEmpty: boolean read GetAllowEmpty write SetAllowEmpty;
- property MatchValue: boolean read GetMatchValue write SetMatchValue;
- property CaseSensitive: boolean read GetCaseSensitive write SetCaseSensitive;
- end;
-
(****************************************** TGTKSPINEDIT ************************************************************************)
TGTKSpinEdit = class(TGTKEntry)
private
@@ -302,12 +256,12 @@ begin
end;
end;
-constructor TGTKButton.CreateFromStock(AOwner: TComponent; const StockID: PChar);
+constructor TGTKButton.CreateFromIconName(AOwner: TComponent; const IconName: string);
begin
inherited Create(AOwner);
FOnClick := nil;
if ClassName = 'TGTKButton' then begin
- FWidget := gtk_button_new_from_stock(StockID);
+ FWidget := gtk_button_new_from_icon_name(PChar(IconName), GTK_ICON_SIZE_BUTTON);
g_signal_connect_data(PGObject(FWidget), 'clicked', TGCallback(@TGTKButton_OnClick), Self, nil, G_CONNECT_DEFAULT);
Show;
end;
@@ -320,22 +274,12 @@ end;
function TGTKButton.GetCaption: string;
begin
- Result := String(gtk_label_get_text(PGtkLabel(ChildControl)));
+ Result := String(gtk_button_get_label(PGtkButton(FWidget)));
end;
procedure TGTKButton.SetCaption(Value: string);
begin
- gtk_label_set_text_with_mnemonic(PGtkLabel(ChildControl), PChar(Value));
-end;
-
-function TGTKButton.GetUseStock: boolean;
-begin
- Result := gtk_button_get_use_stock(PGtkButton(FWidget));
-end;
-
-procedure TGTKButton.SetUseStock(Value: boolean);
-begin
- gtk_button_set_use_stock(PGtkButton(FWidget), Value);
+ gtk_button_set_label(PGtkButton(FWidget), PChar(Value));
end;
function TGTKButton.GetUseUnderline: boolean;
@@ -355,84 +299,7 @@ end;
procedure TGTKButton.SetBorderStyle(Value: TGTKBorderStyle);
begin
- gtk_button_set_relief(PGtkButton(FWidget), integer(Value));
-end;
-
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
-constructor TGTKMisc.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
-end;
-
-destructor TGTKMisc.Destroy;
-begin
- inherited Destroy;
-end;
-
-procedure TGTKMisc.SetAlignment(XAlign, YAlign : Single);
-begin
- gtk_misc_set_alignment(PGtkMisc(FWidget), XAlign, YAlign);
-end;
-
-procedure _gtk_misc_get_alignment(misc:PGtkMisc; xalign:Pgfloat; yalign:Pgfloat); cdecl; external gtklib name 'gtk_misc_get_alignment';
-procedure _gtk_misc_get_padding(misc:PGtkMisc; xpad:Pgint; ypad:Pgint); cdecl; external gtklib name 'gtk_misc_get_padding';
-
-function TGTKMisc.GetXAlign: Single;
-var axalign: gfloat;
-begin
- axalign := 0.0;
- _gtk_misc_get_alignment(PGtkMisc(FWidget), @axalign, nil);
- Result := axalign;
-end;
-
-procedure TGTKMisc.SetXAlign(Value: Single);
-begin
- SetAlignment(Value, YAlign);
-end;
-
-function TGTKMisc.GetYAlign: Single;
-var ayalign: gfloat;
-begin
- ayalign := 0.0;
- _gtk_misc_get_alignment(PGtkMisc(FWidget), nil, @ayalign);
- Result := ayalign;
-end;
-
-procedure TGTKMisc.SetYAlign(Value: Single);
-begin
- SetAlignment(XAlign, Value);
-end;
-
-procedure TGTKMisc.SetPadding(XPadding, YPadding : integer);
-begin
- gtk_misc_set_padding(PGtkMisc(FWidget), XPadding, YPadding);
-end;
-
-function TGTKMisc.GetXPadding: integer;
-var xpad: gint;
-begin
- xpad := 0;
- _gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, nil);
- Result := xpad;
-end;
-
-procedure TGTKMisc.SetXPadding(Value: integer);
-begin
- SetPadding(Value, YPadding);
-end;
-
-function TGTKMisc.GetYPadding: integer;
-var ypad: gint;
-begin
- ypad := 0;
- _gtk_misc_get_padding(PGtkMisc(FWidget), nil, @ypad);
- Result := ypad;
-end;
-
-procedure TGTKMisc.SetYPadding(Value: integer);
-begin
- SetPadding(XPadding, Value);
+ gtk_button_set_relief(PGtkButton(FWidget), TGtkReliefStyle(Value));
end;
(********************************************************************************************************************************)
@@ -528,6 +395,26 @@ begin
gtk_label_set_selectable(PGtkLabel(FWidget), Value);
end;
+function TGTKLabel.GetXAlign: Single;
+begin
+ Result := gtk_label_get_xalign(PGtkLabel(FWidget));
+end;
+
+procedure TGTKLabel.SetXAlign(Value: Single);
+begin
+ gtk_label_set_xalign(PGtkLabel(FWidget), Value);
+end;
+
+function TGTKLabel.GetYAlign: Single;
+begin
+ Result := gtk_label_get_yalign(PGtkLabel(FWidget));
+end;
+
+procedure TGTKLabel.SetYAlign(Value: Single);
+begin
+ gtk_label_set_yalign(PGtkLabel(FWidget), Value);
+end;
+
(********************************************************************************************************************************)
(********************************************************************************************************************************)
procedure TGTKToggleButton_OnToggled(ToggleButton: PGtkToggleButton; user_data: Pgpointer); cdecl;
@@ -689,7 +576,7 @@ end;
procedure TGTKFrame.SetShadowType(Value: TGTKShadowType);
begin
- gtk_frame_set_shadow_type(PGtkFrame(FWidget), gtk2.TGtkShadowType(Value));
+ gtk_frame_set_shadow_type(PGtkFrame(FWidget), lazgtk3.TGtkShadowType(Value));
end;
(********************************************************************************************************************************)
@@ -717,7 +604,7 @@ end;
procedure TGTKEditable.SetEditable(Value: boolean);
begin
- gtk_entry_set_editable(PGtkEntry(FWidget), Value);
+ gtk_editable_set_editable(PGtkEditable(FWidget), Value);
end;
procedure TGTKEditable.CutClipboard;
@@ -833,83 +720,6 @@ end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
-constructor TGTKCombo.Create(AOwner: TComponent);
-begin
- inherited Create(AOwner);
- FWidget := gtk_combo_new;
- Items := TGList.Create(Self);
- Items.Notify := @ItemsChanged;
- Entry := TGTKEntry.CreateFromWidget(Self, PGtkCombo(FWidget)^.entry);
- Show;
-end;
-
-destructor TGTKCombo.Destroy;
-begin
- Items.Free;
- inherited Destroy;
-end;
-
-procedure TGTKCombo.UpdateItems;
-begin
- gtk_combo_set_popdown_strings(PGtkCombo(FWidget), GLIB2.PGList(Items.FList));
-end;
-
-function TGTKCombo.GetAllowEmpty: boolean;
-var b: gboolean;
-begin
- b := False;
- g_object_get(PGObject(FWidget), 'allow-empty', [@b, nil]);
- Result := b;
-end;
-
-procedure TGTKCombo.SetAllowEmpty(Value: boolean);
-begin
- g_object_set(PGObject(FWidget), 'allow-empty', [Ord(Value), nil]);
-end;
-
-function TGTKCombo.GetMatchValue: boolean;
-var b: gboolean;
-begin
- b := False;
- g_object_get(PGObject(FWidget), 'value-in-list', [@b, nil]);
- Result := b;
-end;
-
-procedure TGTKCombo.SetMatchValue(Value: boolean);
-begin
- g_object_set(PGObject(FWidget), 'value-in-list', [Ord(Value), nil]);
-end;
-
-procedure TGTKCombo.SetPolicy(MatchValue, AllowEmpty: boolean);
-begin
- gtk_combo_set_value_in_list(PGtkCombo(FWidget), MatchValue, AllowEmpty);
-end;
-
-function TGTKCombo.GetCaseSensitive: boolean;
-var b: gboolean;
-begin
- b := False;
- g_object_get(PGObject(FWidget), 'case-sensitive', [@b, nil]);
- Result := b;
-end;
-
-procedure TGTKCombo.SetCaseSensitive(Value: boolean);
-begin
- gtk_combo_set_case_sensitive(PGtkCombo(FWidget), Value);
-end;
-
-procedure TGTKCombo.DisableActivate;
-begin
- gtk_combo_disable_activate(PGtkCombo(FWidget));
-end;
-
-procedure TGTKCombo.ItemsChanged(Sender: TObject);
-begin
- UpdateItems;
-end;
-
-(********************************************************************************************************************************)
-(********************************************************************************************************************************)
constructor TGTKSpinEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
diff --git a/libgtk_kylix/GTKText.pas b/libgtk_kylix/GTKText.pas
index d3152b1..31423d7 100644
--- a/libgtk_kylix/GTKText.pas
+++ b/libgtk_kylix/GTKText.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKText - Multiline Text Editor (GtkTextView)
- Version 0.5.16 (last updated 2003-01-21)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKText;
interface
-uses gtk2, lazgobject2, Classes, GTKControls, GTKForms;
+uses lazgobject2, lazgtk3, Classes, GTKControls, GTKForms;
type
@@ -103,7 +102,7 @@ end;
procedure TGTKTextView.SetWrapMode(Value: TGTKTextViewWrapMode);
begin
- gtk_text_view_set_wrap_mode(PGtkTextView(FWidget), integer(Value));
+ gtk_text_view_set_wrap_mode(PGtkTextView(FWidget), TGtkWrapMode(Value));
end;
function TGTKTextView.GetReadOnly: boolean;
diff --git a/libgtk_kylix/GTKUtils.pas b/libgtk_kylix/GTKUtils.pas
index f893858..c1b662e 100644
--- a/libgtk_kylix/GTKUtils.pas
+++ b/libgtk_kylix/GTKUtils.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKUtils - Various utilities
- Version 0.6.17 (last updated 2003-10-07)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,13 +23,16 @@ unit GTKUtils;
interface
-uses gtk2, gdk2, lazglib2, SysUtils, GTKControls, GTKClasses;
+uses lazglib2, lazgdk3, lazgtk3, SysUtils, GTKControls, GTKClasses;
(********************************************************************************************************************************)
+(*
function AllocateColor(Widget: PGtkWidget; R, G, B: Word): PGdkColor; overload;
function AllocateColor(R, G, B: Word): TGDKColor; overload;
+*)
function KeyValToUnicode(const Key: word): guint32;
function UnicodeToKeyVal(const UnicodeVal: guint32): word;
+(*
function GetDefaultForegroundColor(State: integer): PGdkColor; overload;
function GetDefaultForegroundColor(Widget: TGTKControl; State: integer): PGdkColor; overload;
function GetDefaultBackgroundColor(State: integer): PGdkColor; overload;
@@ -39,15 +41,20 @@ function GetDefaultBaseColor(State: integer): PGdkColor; overload;
function GetDefaultBaseColor(Widget: TGTKControl; State: integer): PGdkColor; overload;
function GetDefaultTextColor(State: integer): PGdkColor; overload;
function GetDefaultTextColor(Widget: TGTKControl; State: integer): PGdkColor; overload;
-function GDKColorToPGdkColor(Color: TGDKColor): PGdkColor;
-function PGdkColorToGDKColor(Color: PGdkColor): TGDKColor;
+
+function GDKColorToPGdkRGBA(Color: TGDKColor): PGdkRGBA;
+function PGdkRGBAToGDKColor(Color: PGdkRGBA): TGDKColor;
function GDKColorToString(Color: TGDKColor): string;
function StringToGDKColor(Str: string; var Color: TGDKColor): boolean;
+*)
+function ValidateColorString(const Color: string): boolean;
+
(********************************************************************************************************************************)
implementation
(********************************************************************************************************************************)
+(*
function AllocateColor(Widget: PGtkWidget; R, G, B: Word): PGdkColor;
begin
New(Result);
@@ -66,6 +73,7 @@ begin
Result.green := G;
Result.blue := B;
end;
+*)
(********************************************************************************************************************************)
function KeyValToUnicode(const Key: word): guint32;
@@ -80,6 +88,7 @@ begin
end;
(********************************************************************************************************************************)
+(*
function GetDefaultForegroundColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -96,8 +105,10 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.fg[State]);
end;
+*)
(********************************************************************************************************************************)
+(*
function GetDefaultBackgroundColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -114,8 +125,10 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.bg[State]);
end;
+*)
(********************************************************************************************************************************)
+(*
function GetDefaultBaseColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -132,8 +145,10 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.base[State]);
end;
+*)
(********************************************************************************************************************************)
+(*
function GetDefaultTextColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -150,9 +165,11 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.text[State]);
end;
+*)
(********************************************************************************************************************************)
-function GDKColorToPGdkColor(Color: TGDKColor): PGdkColor;
+(*
+function GDKColorToPGdkRGBA(Color: TGDKColor): PGdkRGBA;
begin
New(Result);
Result^.pixel := Color.pixel;
@@ -160,8 +177,11 @@ begin
Result^.green := Color.green;
Result^.blue := Color.blue;
end;
+*)
(********************************************************************************************************************************)
+(*
+function PGdkRGBAToGDKColor(Color: PGdkRGBA): TGDKColor;
function PGdkColorToGDKColor(Color: PGdkColor): TGDKColor;
begin
Result.pixel := Color^.pixel;
@@ -169,14 +189,18 @@ begin
Result.green := Color^.green;
Result.blue := Color^.blue;
end;
+*)
(********************************************************************************************************************************)
+(*
function GDKColorToString(Color: TGDKColor): string;
begin
Result := Format('#%.2x%.2x%.2xFF', [Color.red div 256, Color.green div 256, Color.blue div 256]);
end;
+*)
(********************************************************************************************************************************)
+(*
function StringToGDKColor(Str: string; var Color: TGDKColor): boolean;
var AColor: PGdkColor;
begin
@@ -191,7 +215,14 @@ begin
Dispose(AColor);
except end;
end;
+*)
(********************************************************************************************************************************)
+function ValidateColorString(const Color: string): boolean;
+var rgba: TGdkRGBA;
+begin
+ Result := gdk_rgba_parse(@rgba, PChar(Color));
+end;
+
end.
diff --git a/libgtk_kylix/GTKView.pas b/libgtk_kylix/GTKView.pas
index 3cd00dc..b971e7d 100644
--- a/libgtk_kylix/GTKView.pas
+++ b/libgtk_kylix/GTKView.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKView - GtkTreeView and its modifications
- Version 0.6.21 (last updated 2006-05-06)
Copyright (C) 2006 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,7 +23,7 @@ unit GTKView;
interface
-uses gtk2, gdk2, gdk2pixbuf, glib2, lazglib2, lazgobject2, Classes, GTKControls, GTKForms;
+uses lazglib2, lazgobject2, lazgdk3, lazgtk3, lazgdkpixbuf2, Classes, GTKClasses, GTKControls, GTKForms;
type
TGTKListItem = class;
@@ -307,7 +306,7 @@ end;
procedure TGTKView.SetSelectionMode(Value: TGTKSelectionMode);
begin
- gtk_tree_selection_set_mode(FSelection, Integer(Value));
+ gtk_tree_selection_set_mode(FSelection, lazgtk3.TGtkSelectionMode(Value));
end;
procedure TGTKView.SelectAll;
@@ -331,13 +330,16 @@ begin
end;
function TGTKView.GetRulesHint: boolean;
+var b: boolean;
begin
- Result := gtk_tree_view_get_rules_hint(PGtkTreeView(FWidget));
+ b := False;
+ g_object_get(PGObject(FWidget), 'rules-hint', [@b, nil]);
+ Result := b;
end;
procedure TGTKView.SetRulesHint(Value: boolean);
begin
- gtk_tree_view_set_rules_hint(PGtkTreeView(FWidget), Value);
+ g_object_set(PGObject(FWidget), 'rules-hint', [gboolean(Value), nil]);
end;
function TGTKView.GetReorderable: boolean;
@@ -417,7 +419,7 @@ var sort_column_id: gint;
order: TGtkSortType;
begin
Result := soNone;
- order := 0;
+ order := GTK_SORT_ASCENDING;
if (FTreeModelSort <> nil) and gtk_tree_sortable_get_sort_column_id(PGtkTreeSortable(FTreeModelSort), @sort_column_id, @order)
then Result := TGTKTreeViewSortOrder(order);
end;
@@ -511,8 +513,8 @@ begin
FTreeModelSort := nil;
if not FSortable then FWidget := gtk_tree_view_new_with_model(PGtkTreeModel(FListItems.FStore))
else begin
- FTreeModelSort := gtk_tree_model_sort_new_with_model(FListItems.FStore);
- FWidget := gtk_tree_view_new_with_model(FTreeModelSort);
+ FTreeModelSort := gtk_tree_model_sort_new_with_model(PGtkTreeModel(FListItems.FStore));
+ FWidget := gtk_tree_view_new_with_model(PGtkTreeModel(FTreeModelSort));
end;
FSelection := gtk_tree_view_get_selection(PGtkTreeView(FWidget));
g_signal_connect_data(PGObject(FSelection), 'changed', TGCallback(@TGTKListView_changed), Self, nil, G_CONNECT_DEFAULT);
@@ -592,7 +594,7 @@ begin
Result := nil;
Path := nil;
Column := nil;
- if gtk_tree_view_get_path_at_pos(PGtkTreeView(FWidget), X, Y, Path, Column, nil, nil) then begin
+ if gtk_tree_view_get_path_at_pos(PGtkTreeView(FWidget), X, Y, @Path, @Column, nil, nil) then begin
if not Assigned(Path) then Exit;
ConvertPathToChild(Path);
AIndex := gtk_tree_path_get_indices(Path)^;
@@ -606,11 +608,10 @@ end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
constructor TGTKListItems.Create(AOwner: TComponent);
-const Types : GType = G_TYPE_STRING;
begin
inherited Create(AOwner);
FOwner := AOwner;
- FStore := gtk_list_store_newv(1, @Types);
+ FStore := gtk_list_store_new(1, [G_TYPE_STRING]);
FList := TList.Create;
end;
@@ -619,14 +620,14 @@ begin
if not (csDestroying in ComponentState) then begin
Clear;
FList.Free;
- gtk_object_destroy(PGtkObject(FStore));
+ g_object_unref(PGObject(FStore));
end;
inherited Destroy;
end;
constructor TGTKListItems.CreateTyped(AOwner: TComponent; ColumnTypes: array of TGTKListColumnType);
var i: integer;
- Cols : array[0..255] of GType;
+ Cols: array[0..255] of TGType;
begin
inherited Create(AOwner);
FOwner := AOwner;
@@ -636,7 +637,7 @@ begin
lcText : Cols[i] := G_TYPE_STRING;
lcNumber : Cols[i] := G_TYPE_LONG;
lcPointer : Cols[i] := G_TYPE_POINTER;
- lcPixbuf : Cols[i] := GDK_TYPE_PIXBUF;
+ lcPixbuf : Cols[i] := gdk_pixbuf_get_type();
lcBoolean : Cols[i] := G_TYPE_BOOLEAN;
end;
FStore := gtk_list_store_newv(Length(ColumnTypes), @Cols);
@@ -644,14 +645,14 @@ end;
procedure TGTKListItems.SetColumnTypes(Types: array of TGTKListColumnType);
var i: integer;
- Cols : array[0..255] of GType;
+ Cols : array[0..255] of TGType;
begin
for i := Low(Types) to High(Types) do
case Types[i] of
lcText : Cols[i] := G_TYPE_STRING;
lcNumber : Cols[i] := G_TYPE_LONG;
lcPointer : Cols[i] := G_TYPE_POINTER;
- lcPixbuf : Cols[i] := GDK_TYPE_PIXBUF;
+ lcPixbuf : Cols[i] := gdk_pixbuf_get_type();
lcBoolean : Cols[i] := G_TYPE_BOOLEAN;
end;
g_object_unref(PGObject(FStore));
@@ -827,8 +828,8 @@ end;
destructor TGTKTreeViewColumn.Destroy;
begin
if not (csDestroying in ComponentState) then begin
- gtk_object_destroy(PGtkObject(FRenderer));
- if GTK_IS_OBJECT(FColumn) then gtk_object_destroy(PGtkObject(FColumn));
+ if Assigned(FRenderer) then g_object_unref(PGObject(FRenderer));
+ if Assigned(FColumn) then g_object_unref(PGObject(FColumn));
end;
inherited Destroy;
end;
@@ -1011,7 +1012,7 @@ begin
FColumnType := Value;
if Assigned(FRenderer) then begin
gtk_tree_view_column_clear(FColumn);
- gtk_object_destroy(PGtkObject(FRenderer));
+ g_object_unref(PGObject(FRenderer));
end;
case Value of
ctText : FRenderer := gtk_cell_renderer_text_new;
@@ -1177,28 +1178,28 @@ procedure TGTKListItem.SetValue(Index: longint; Value: string);
var Iter: TGtkTreeIter;
begin
if gtk_tree_model_get_iter_from_string(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, PChar(IntToStr(FIndex)))
- then gtk_list_store_set(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, Index, PChar(Value), -1);
+ then gtk_list_store_set((FOwner as TGTKListItems).FStore, @Iter, [Index, PChar(Value), -1]);
end;
procedure TGTKListItem.SetValue(Index: longint; Value: integer);
var Iter: TGtkTreeIter;
begin
if gtk_tree_model_get_iter_from_string(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, PChar(IntToStr(FIndex)))
- then gtk_list_store_set(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, Index, Value, -1);
+ then gtk_list_store_set((FOwner as TGTKListItems).FStore, @Iter, [Index, Value, -1]);
end;
procedure TGTKListItem.SetValue(Index: longint; Value: pointer);
var Iter: TGtkTreeIter;
begin
if gtk_tree_model_get_iter_from_string(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, PChar(IntToStr(FIndex)))
- then gtk_list_store_set(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, Index, Value, -1);
+ then gtk_list_store_set((FOwner as TGTKListItems).FStore, @Iter, [Index, Value, -1]);
end;
procedure TGTKListItem.SetValue(Index: longint; Value: boolean);
var Iter: TGtkTreeIter;
begin
if gtk_tree_model_get_iter_from_string(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, PChar(IntToStr(FIndex)))
- then gtk_list_store_set(PGtkTreeModel((FOwner as TGTKListItems).FStore), @Iter, Index, Value, -1);
+ then gtk_list_store_set((FOwner as TGTKListItems).FStore, @Iter, [Index, Value, -1]);
end;
function TGTKListItem.GetSelected: boolean;
@@ -1266,8 +1267,8 @@ begin
gtk_tree_view_column_focus_cell(Column, ((FOwner as TGTKListItems).FOwner as TGTKView).Columns[ColumnNo].FRenderer);
CellEditable := gtk_cell_renderer_start_editing(((FOwner as TGTKListItems).FOwner as TGTKView).Columns[ColumnNo].FRenderer,
nil, ((FOwner as TGTKListItems).FOwner as TGTKView).FWidget, PChar(PChar(IntToStr(FIndex))),
- @BackgroundRect, @CellRect, {GTK_CELL_RENDERER_SELECTED or GTK_CELL_RENDERER_SORTED} 0);
- gtk_widget_show(CellEditable);
+ @BackgroundRect, @CellRect, []);
+ gtk_widget_show(PGtkWidget(CellEditable));
// gtk_cell_editable_start_editing(CellEditable, nil);
@@ -1287,7 +1288,7 @@ begin
gtk_tree_view_get_background_area(PGtkTreeView(((FOwner as TGTKListItems).FOwner as TGTKView).FWidget), Path, Column, @BackgroundRect);
Rect.x := 0;
- Rect.width := ((FOwner as TGTKListItems).FOwner as TGTKView).FWidget^.allocation.width;
+ Rect.width := gtk_widget_get_allocated_width(((FOwner as TGTKListItems).FOwner as TGTKView).FWidget);
Rect.y := BackgroundRect.y;
Rect.height := BackgroundRect.height;
gdk_window_invalidate_rect(gtk_tree_view_get_bin_window(PGtkTreeView(((FOwner as TGTKListItems).FOwner as TGTKView).FWidget)), @Rect, True);
diff --git a/vfs/UVFSCore.pas b/vfs/UVFSCore.pas
index b6c516d..216cd5e 100644
--- a/vfs/UVFSCore.pas
+++ b/vfs/UVFSCore.pas
@@ -173,6 +173,7 @@ type
procedure DoInitPlugins;
+function LookupVFSPlugin(const ModuleID: string): TVFSPlugin;
var PluginList: TList;
@@ -1006,6 +1007,19 @@ end;
(********************************************************************************************************************************)
(********************************************************************************************************************************)
+function LookupVFSPlugin(const ModuleID: string): TVFSPlugin;
+var i: integer;
+begin
+ Result := nil;
+ for i := 0 to PluginList.Count - 1 do
+ if Trim(TVFSPlugin(PluginList[i]).ModuleID) = ModuleID then begin
+ Result := TVFSPlugin(PluginList[i]);
+ Break;
+ end;
+end;
+
+(********************************************************************************************************************************)
+(********************************************************************************************************************************)
function GetBinaryPath: string;
var i: integer;
Buf: array[0..1024] of char;