You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(46) |
Oct
(3) |
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(11) |
Mar
(6) |
Apr
(77) |
May
|
Jun
(29) |
Jul
(5) |
Aug
(8) |
Sep
(76) |
Oct
(55) |
Nov
(4) |
Dec
(18) |
2009 |
Jan
(22) |
Feb
(3) |
Mar
(28) |
Apr
(5) |
May
(9) |
Jun
(10) |
Jul
(2) |
Aug
(12) |
Sep
(19) |
Oct
(12) |
Nov
(9) |
Dec
(14) |
2010 |
Jan
(1) |
Feb
(12) |
Mar
(1) |
Apr
(1) |
May
(3) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(16) |
Oct
(3) |
Nov
|
Dec
(11) |
2011 |
Jan
(11) |
Feb
(3) |
Mar
(10) |
Apr
|
May
|
Jun
(21) |
Jul
(8) |
Aug
(3) |
Sep
(20) |
Oct
|
Nov
|
Dec
(6) |
2012 |
Jan
(2) |
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(15) |
Sep
(15) |
Oct
(10) |
Nov
(33) |
Dec
(3) |
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
(10) |
May
|
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
|
Oct
(8) |
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(67) |
May
(11) |
Jun
(6) |
Jul
|
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(17) |
May
(11) |
Jun
(29) |
Jul
(8) |
Aug
|
Sep
(15) |
Oct
(72) |
Nov
(80) |
Dec
(47) |
2016 |
Jan
(125) |
Feb
(51) |
Mar
(13) |
Apr
(127) |
May
(84) |
Jun
(86) |
Jul
(47) |
Aug
(11) |
Sep
(62) |
Oct
(52) |
Nov
(4) |
Dec
|
2017 |
Jan
(62) |
Feb
(24) |
Mar
(40) |
Apr
(51) |
May
(1) |
Jun
(13) |
Jul
(20) |
Aug
(4) |
Sep
(6) |
Oct
(2) |
Nov
|
Dec
(15) |
2018 |
Jan
(28) |
Feb
(8) |
Mar
(21) |
Apr
(66) |
May
(31) |
Jun
(19) |
Jul
(44) |
Aug
(29) |
Sep
(21) |
Oct
(11) |
Nov
(57) |
Dec
(61) |
2019 |
Jan
|
Feb
(26) |
Mar
(38) |
Apr
(25) |
May
(24) |
Jun
(13) |
Jul
(30) |
Aug
(10) |
Sep
(53) |
Oct
(55) |
Nov
(81) |
Dec
(111) |
2020 |
Jan
(31) |
Feb
(14) |
Mar
(18) |
Apr
(18) |
May
(72) |
Jun
(21) |
Jul
(68) |
Aug
(15) |
Sep
(47) |
Oct
(39) |
Nov
(23) |
Dec
(33) |
2021 |
Jan
(9) |
Feb
(17) |
Mar
(19) |
Apr
(41) |
May
(39) |
Jun
(7) |
Jul
(13) |
Aug
(15) |
Sep
(52) |
Oct
(51) |
Nov
(30) |
Dec
(58) |
2022 |
Jan
(33) |
Feb
(4) |
Mar
(12) |
Apr
(17) |
May
(12) |
Jun
(7) |
Jul
(3) |
Aug
(7) |
Sep
(44) |
Oct
(6) |
Nov
(5) |
Dec
(13) |
2023 |
Jan
(25) |
Feb
(16) |
Mar
(35) |
Apr
(13) |
May
(6) |
Jun
|
Jul
(13) |
Aug
(8) |
Sep
(1) |
Oct
(24) |
Nov
(34) |
Dec
(56) |
2024 |
Jan
(28) |
Feb
(27) |
Mar
|
Apr
(8) |
May
(25) |
Jun
(17) |
Jul
(14) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <aka...@us...> - 2024-08-27 18:47:29
|
Revision: 4304 http://sourceforge.net/p/gexperts/code/4304 Author: akalwahome Date: 2024-08-27 18:47:27 +0000 (Tue, 27 Aug 2024) Log Message: ----------- Try to fix Bug #388 Modified Paths: -------------- branches/dark-mode/Source/CodeLibrarian/GX_CodeLib.pas branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.dfm branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.pas Modified: branches/dark-mode/Source/CodeLibrarian/GX_CodeLib.pas =================================================================== --- branches/dark-mode/Source/CodeLibrarian/GX_CodeLib.pas 2024-08-27 18:33:39 UTC (rev 4303) +++ branches/dark-mode/Source/CodeLibrarian/GX_CodeLib.pas 2024-08-27 18:47:27 UTC (rev 4304) @@ -7,12 +7,13 @@ interface uses - Windows, SysUtils, + Windows, SysUtils, Forms, Controls, StdActns, Classes, ActnList, Actions, UITypes, Dialogs, Menus, ComCtrls, ToolWin, ExtCtrls, GpStructuredStorage, GX_Experts, GX_EnhancedEditor, - GX_GenericUtils, GX_StringList, GX_SharedImages, GX_BaseForm; + GX_GenericUtils, GX_StringList, GX_SharedImages, GX_BaseForm, + GX_CodeOpt; type TSearchRecord = record @@ -21,8 +22,6 @@ WholeWord: Boolean; end; - TCodeLayout = (clSide, clTop); - TGXStorageFile = class(TObject) private FStorage: IGpStructuredStorage; @@ -287,7 +286,7 @@ Clipbrd, u_dzVclUtils, u_dzStringUtils, {$IFOPT D+} GX_DbugIntf, {$ENDIF} - GX_CodeSrch, GX_CodeOpt, GX_GxUtils, + GX_CodeSrch, GX_GxUtils, GX_OtaUtils, GX_IdeUtils, GX_GExperts, GX_ConfigurationInfo, GX_MessageBox; @@ -390,20 +389,22 @@ clSide: begin tvTopics.Align := alLeft; - tvTopics.Width := Self.Width div 2; + tvTopics.Width := ClientWidth div 3; Splitter.Align := alLeft; - if Splitter.Left < tvTopics.Left then - Splitter.Left := Self.Width; + Splitter.Left := tvTopics.Left + tvTopics.Width + 1; Splitter.Cursor := crHSplit; + Splitter.Width := 4; + Splitter.Height := Splitter.Parent.ClientHeight; FCodeText.Align := AlClient; end; clTop: begin tvTopics.Align := alTop; - tvTopics.Height := Self.Height div 2; + tvTopics.Height := ClientHeight div 3; Splitter.Align := alTop; - if Splitter.Top < tvTopics.Top then - Splitter.Top := Self.Height; + Splitter.Top := tvTopics.Top + tvTopics.Height + 1; + Splitter.Height := 4; + Splitter.Width := Splitter.Parent.ClientWidth; FCodeText.Align := AlClient; Splitter.Cursor := crVSplit; end; @@ -903,11 +904,12 @@ Settings.LoadForm('Window', Self); Settings := Settings.Subkey('Window'); - Layout := TCodeLayout(Settings.ReadInteger('Layout', 0)); + FLayout := TCodeLayout.clUnknown; // Force next line to set the new layout + Layout := TCodeLayout(Settings.ReadInteger('Layout', Ord(clSide))); if Layout = clSide then - tvTopics.Width := Settings.ReadInteger('Splitter', tvTopics.Width) + tvTopics.Width := Settings.ReadInteger('Splitter', ClientWidth div 4) else - tvTopics.Height := Settings.ReadInteger('Splitter', tvTopics.Height); + tvTopics.Height := Settings.ReadInteger('Splitter', ClientHeight div 3); end; procedure TfmCodeLib.HelpExecute(Sender: TObject); @@ -953,59 +955,27 @@ procedure TfmCodeLib.OptionsExecute(Sender: TObject); var - frm: TfmCodeOptions; + lStoragePath: string; + lLayout: TCodeLayout; begin - frm := TfmCodeOptions.Create(nil); - try - frm.edPath.Text := StoragePath; - if Layout = clSide then - frm.rbSide.Checked := True - else - frm.rbTop.Checked := True; -{$IFOPT D+}SendDebug('Setting fcTreeView.Text to ' + tvTopics.Font.Name); {$ENDIF} - frm.fcTreeView.ItemIndex := frm.fcTreeView.Items.IndexOf(tvTopics.Font.Name); -{$IFOPT D+}SendDebug('fcTreeView.Text is ' + frm.fcTreeView.Text);{$ENDIF} - frm.udTreeView.Position := tvTopics.Font.Size; - frm.fcEditor.ItemIndex := frm.fcEditor.Items.IndexOf(FCodeText.Font.Name); - frm.udEditor.Position := FCodeText.Font.Size; - - if frm.ShowModal = mrOk then - begin - if (StoragePath <> frm.edPath.Text) then - begin - if CodeDB <> nil then - CloseDB(True); - - FreeAndNil(CodeDB); - tvTopics.Items.Clear; - FCodeText.Clear; - StoragePath := AddSlash(frm.edPath.Text); - CodeDB := OpenStorage(StoragePath + DefaultFileName); - if CodeDB = nil then - begin - MessageDlg(SCouldNotCreateStorage, mtError, [mbOK], 0); - Exit; - end; - InitializeTreeView; + lStoragePath := StoragePath; + lLayout := Layout; + if TfmCodeOptions.Execute(Self, lStoragePath, lLayout, tvTopics.Font, FCodeText.Font) then begin + if StoragePath <> lStoragePath then begin + if CodeDB <> nil then + CloseDB(True); + FreeAndNil(CodeDB); + tvTopics.Items.Clear; + FCodeText.Clear; + StoragePath := AddSlash(lStoragePath); + CodeDB := OpenStorage(StoragePath + DefaultFileName); + if CodeDB = nil then begin + MessageDlg(SCouldNotCreateStorage, mtError, [mbOK], 0); + Exit; end; - if frm.rbSide.Checked then - Layout := clSide - else - Layout := clTop; - - with tvTopics.Font do - begin - Name := frm.fcTreeView.Text; - Size := Trunc(StrToInt(frm.eTreeView.Text)); - end; - with FCodeText.Font do - begin - Name := frm.fcEditor.Text; - Size := Trunc(StrToInt(frm.eEditor.Text)); - end; + InitializeTreeView; end; - finally - FreeAndNil(frm); + Layout := lLayout; end; end; @@ -1040,6 +1010,7 @@ if FModified then SaveRecord; CloseDB; + SaveSettings; // Fix Bug #388? end; procedure TfmCodeLib.FormShow(Sender: TObject); @@ -1047,6 +1018,7 @@ Node: TTreeNode; begin inherited; + LoadSettings; // Fix Bug #388? CodeDB.OpenStorage(StoragePath + DefaultFileName); if TryGetSelected(Node) and (IsCodeSnippet(Node)) then CodeDB.OpenFile(GetNodePath(Node)); Modified: branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.dfm =================================================================== --- branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.dfm 2024-08-27 18:33:39 UTC (rev 4303) +++ branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.dfm 2024-08-27 18:47:27 UTC (rev 4304) @@ -43,7 +43,7 @@ Top = 8 Width = 305 Height = 185 - ActivePage = tabLayout + ActivePage = tabPaths Anchors = [akLeft, akTop, akRight, akBottom] TabOrder = 0 object tabPaths: TTabSheet @@ -167,6 +167,7 @@ Height = 22 Style = csDropDownList DropDownCount = 18 + ItemHeight = 0 TabOrder = 0 end object fcEditor: TComboBox @@ -176,6 +177,7 @@ Height = 22 Style = csDropDownList DropDownCount = 18 + ItemHeight = 0 TabOrder = 3 end object udTreeview: TUpDown @@ -188,6 +190,7 @@ Max = 24 Position = 8 TabOrder = 2 + Wrap = False end object udEditor: TUpDown Left = 273 @@ -199,6 +202,7 @@ Max = 24 Position = 8 TabOrder = 5 + Wrap = False end object eTreeview: TEdit Left = 232 Modified: branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.pas =================================================================== --- branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.pas 2024-08-27 18:33:39 UTC (rev 4303) +++ branches/dark-mode/Source/CodeLibrarian/GX_CodeOpt.pas 2024-08-27 18:47:27 UTC (rev 4304) @@ -5,9 +5,12 @@ interface uses - Classes, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, GX_BaseForm; + Classes, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, Graphics, GX_BaseForm; type + TCodeLayout = (clSide, clTop, clUnknown); + +type TfmCodeOptions = class(TfmBaseForm) btnOK: TButton; btnCancel: TButton; @@ -40,7 +43,13 @@ private procedure InitializeForm; procedure edPathOnFilesDropped(_Sender: TObject; _Files: TStrings); + procedure SetData(const _StoragePath: string; _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); + procedure GetData(out _StoragePath: string; out _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); public + class function Execute(_Owner: TWinControl; var _StoragePath: string; var _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont): Boolean; constructor Create(_Owner: TComponent); override; end; @@ -49,8 +58,59 @@ {$R *.dfm} uses - SysUtils, Graphics, GX_GenericUtils, GX_IdeUtils, u_dzVclUtils; + SysUtils, GX_GenericUtils, GX_IdeUtils, u_dzVclUtils; +class function TfmCodeOptions.Execute(_Owner: TWinControl; var _StoragePath: string; + var _Layout: TCodeLayout; _TreeFont, _EditFont: TFont): Boolean; +var + frm: TfmCodeOptions; +begin + frm := TfmCodeOptions.Create(nil); + try + TForm_CenterOn(frm, _Owner); + frm.SetData(_StoragePath, _Layout, _TreeFont, _EditFont); + Result :=( frm.ShowModal = mrOk); + if Result then + frm.GetData(_StoragePath, _Layout, _TreeFont, _EditFont); + finally + FreeAndNil(frm); + end; +end; + +procedure TfmCodeOptions.SetData(const _StoragePath: string; _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); +begin + edPath.Text := _StoragePath; + + if _Layout = clSide then + rbSide.Checked := True + else + rbTop.Checked := True; + + fcTreeview.ItemIndex := fcTreeview.Items.IndexOf(_TreeFont.Name); + udTreeview.Position := _TreeFont.Size; + eTreeview.Text := IntToStr(_TreeFont.Size); + + fcEditor.ItemIndex := fcEditor.Items.IndexOf(_EditFont.Name); + udEditor.Position := _EditFont.Size; + eEditor.Text := IntToStr(_EditFont.Size); +end; + +procedure TfmCodeOptions.GetData(out _StoragePath: string; out _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); +begin + _StoragePath := edPath.Text; + if rbSide.Checked then + _Layout := clSide + else + _Layout := clTop; + + _TreeFont.Name := fcTreeview.Text; + _TreeFont.Size := Trunc(StrToInt(eTreeview.Text)); + _EditFont.Name := fcEditor.Text; + _EditFont.Size := Trunc(StrToInt(eEditor.Text)); +end; + procedure TfmCodeOptions.sbBrowseClick(Sender: TObject); var Temp: string; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-27 18:33:41
|
Revision: 4303 http://sourceforge.net/p/gexperts/code/4303 Author: akalwahome Date: 2024-08-27 18:33:39 +0000 (Tue, 27 Aug 2024) Log Message: ----------- Dark Mode: Register TScrollingStyleHook for TCustomSynEdit (dark scroll bars). Modified Paths: -------------- branches/dark-mode/Source/Framework/GX_SynMemoUtils.pas Modified: branches/dark-mode/Source/Framework/GX_SynMemoUtils.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_SynMemoUtils.pas 2024-08-27 18:27:25 UTC (rev 4302) +++ branches/dark-mode/Source/Framework/GX_SynMemoUtils.pas 2024-08-27 18:33:39 UTC (rev 4303) @@ -6,7 +6,12 @@ uses // If you get errors here, add SynEdit to your library path SynEdit, - GX_GenericUtils, GX_IDEUtils; +{$IFDEF GX_SUPPORTS_THEMING} + Vcl.Themes, + Vcl.Forms, +{$ENDIF} + GX_GenericUtils, + GX_IDEUtils; function GetGXHighlighterForCurrentSourceEditor: TGXSyntaxHighlighter; @@ -114,5 +119,13 @@ Result := GxOtaGetCurrentSyntaxHighlighter(SourceEditor); end; +{$IFDEF GX_SUPPORTS_THEMING} +Initialization + TCustomStyleEngine.RegisterStyleHook(TCustomSynEdit, TScrollingStyleHook); + +Finalization + TCustomStyleEngine.UnRegisterStyleHook(TCustomSynEdit, TScrollingStyleHook); +{$ENDIF} + end. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-27 18:27:28
|
Revision: 4302 http://sourceforge.net/p/gexperts/code/4302 Author: akalwahome Date: 2024-08-27 18:27:25 +0000 (Tue, 27 Aug 2024) Log Message: ----------- Merged revision(s) from trunk Modified Paths: -------------- branches/dark-mode/Documentation/License.txt branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp branches/dark-mode/Projects/GExperts_version.ini Property Changed: ---------------- branches/dark-mode/ Index: branches/dark-mode =================================================================== --- branches/dark-mode 2024-08-24 14:17:47 UTC (rev 4301) +++ branches/dark-mode 2024-08-27 18:27:25 UTC (rev 4302) Property changes on: branches/dark-mode ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4085-4291 \ No newline at end of property +/trunk:4085-4301 \ No newline at end of property Modified: branches/dark-mode/Documentation/License.txt =================================================================== --- branches/dark-mode/Documentation/License.txt 2024-08-24 14:17:47 UTC (rev 4301) +++ branches/dark-mode/Documentation/License.txt 2024-08-27 18:27:25 UTC (rev 4302) @@ -1,6 +1,6 @@ GExperts License Agreement - GExperts is copyright 1996-2023 by Thomas Mueller, Erik Berry and the GExperts development team. This license agreement only covers code written by Erik Berry and the rest of the GExperts development team who have specifically submitted their code for inclusion with GExperts. You should contact the other third-party authors concerning their respective copyrights and conditions. + GExperts is copyright 1996-2024 by Thomas Mueller, Erik Berry and the GExperts development team. This license agreement only covers code written by Erik Berry and the rest of the GExperts development team who have specifically submitted their code for inclusion with GExperts. You should contact the other third-party authors concerning their respective copyrights and conditions. The rules governing the use of GExperts and the GExperts source code are derived from the official Open Source Definition, available at http://www.opensource.org. The conditions and limitations are as follows: Modified: branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp =================================================================== (Binary files differ) Modified: branches/dark-mode/Projects/GExperts_version.ini =================================================================== --- branches/dark-mode/Projects/GExperts_version.ini 2024-08-24 14:17:47 UTC (rev 4301) +++ branches/dark-mode/Projects/GExperts_version.ini 2024-08-27 18:27:25 UTC (rev 4302) @@ -2,7 +2,7 @@ Build=85 MajorVer=1 MinorVer=3 -Release=24 +Release=25 AutoIncBuild=0 Revision= Private=0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-24 14:17:49
|
Revision: 4301 http://sourceforge.net/p/gexperts/code/4301 Author: twm Date: 2024-08-24 14:17:47 +0000 (Sat, 24 Aug 2024) Log Message: ----------- moved code from TfmCodeLib.OptionsExecute to TfmCodeOptions.Execute, .SetData and .GetData Modified Paths: -------------- trunk/Source/CodeLibrarian/GX_CodeLib.pas trunk/Source/CodeLibrarian/GX_CodeOpt.pas Modified: trunk/Source/CodeLibrarian/GX_CodeLib.pas =================================================================== --- trunk/Source/CodeLibrarian/GX_CodeLib.pas 2024-08-24 13:15:24 UTC (rev 4300) +++ trunk/Source/CodeLibrarian/GX_CodeLib.pas 2024-08-24 14:17:47 UTC (rev 4301) @@ -7,12 +7,13 @@ interface uses - Windows, SysUtils, + Windows, SysUtils, Forms, Controls, StdActns, Classes, ActnList, Actions, UITypes, Dialogs, Menus, ComCtrls, ToolWin, ExtCtrls, GpStructuredStorage, GX_Experts, GX_EnhancedEditor, - GX_GenericUtils, GX_StringList, GX_SharedImages, GX_BaseForm; + GX_GenericUtils, GX_StringList, GX_SharedImages, GX_BaseForm, + GX_CodeOpt; type TSearchRecord = record @@ -21,8 +22,6 @@ WholeWord: Boolean; end; - TCodeLayout = (clSide, clTop); - TGXStorageFile = class(TObject) private FStorage: IGpStructuredStorage; @@ -287,7 +286,7 @@ Clipbrd, u_dzVclUtils, u_dzStringUtils, {$IFOPT D+} GX_DbugIntf, {$ENDIF} - GX_CodeSrch, GX_CodeOpt, GX_GxUtils, + GX_CodeSrch, GX_GxUtils, GX_OtaUtils, GX_IdeUtils, GX_GExperts, GX_ConfigurationInfo, GX_MessageBox; @@ -953,59 +952,27 @@ procedure TfmCodeLib.OptionsExecute(Sender: TObject); var - frm: TfmCodeOptions; + lStoragePath: string; + lLayout: TCodeLayout; begin - frm := TfmCodeOptions.Create(nil); - try - frm.edPath.Text := StoragePath; - if Layout = clSide then - frm.rbSide.Checked := True - else - frm.rbTop.Checked := True; -{$IFOPT D+}SendDebug('Setting fcTreeView.Text to ' + tvTopics.Font.Name); {$ENDIF} - frm.fcTreeView.ItemIndex := frm.fcTreeView.Items.IndexOf(tvTopics.Font.Name); -{$IFOPT D+}SendDebug('fcTreeView.Text is ' + frm.fcTreeView.Text);{$ENDIF} - frm.udTreeView.Position := tvTopics.Font.Size; - frm.fcEditor.ItemIndex := frm.fcEditor.Items.IndexOf(FCodeText.Font.Name); - frm.udEditor.Position := FCodeText.Font.Size; - - if frm.ShowModal = mrOk then - begin - if (StoragePath <> frm.edPath.Text) then - begin - if CodeDB <> nil then - CloseDB(True); - - FreeAndNil(CodeDB); - tvTopics.Items.Clear; - FCodeText.Clear; - StoragePath := AddSlash(frm.edPath.Text); - CodeDB := OpenStorage(StoragePath + DefaultFileName); - if CodeDB = nil then - begin - MessageDlg(SCouldNotCreateStorage, mtError, [mbOK], 0); - Exit; - end; - InitializeTreeView; + lStoragePath := StoragePath; + lLayout := Layout; + if TfmCodeOptions.Execute(Self, lStoragePath, lLayout, tvTopics.Font, FCodeText.Font) then begin + if StoragePath <> lStoragePath then begin + if CodeDB <> nil then + CloseDB(True); + FreeAndNil(CodeDB); + tvTopics.Items.Clear; + FCodeText.Clear; + StoragePath := AddSlash(lStoragePath); + CodeDB := OpenStorage(StoragePath + DefaultFileName); + if CodeDB = nil then begin + MessageDlg(SCouldNotCreateStorage, mtError, [mbOK], 0); + Exit; end; - if frm.rbSide.Checked then - Layout := clSide - else - Layout := clTop; - - with tvTopics.Font do - begin - Name := frm.fcTreeView.Text; - Size := Trunc(StrToInt(frm.eTreeView.Text)); - end; - with FCodeText.Font do - begin - Name := frm.fcEditor.Text; - Size := Trunc(StrToInt(frm.eEditor.Text)); - end; + InitializeTreeView; end; - finally - FreeAndNil(frm); + Layout := lLayout; end; end; Modified: trunk/Source/CodeLibrarian/GX_CodeOpt.pas =================================================================== --- trunk/Source/CodeLibrarian/GX_CodeOpt.pas 2024-08-24 13:15:24 UTC (rev 4300) +++ trunk/Source/CodeLibrarian/GX_CodeOpt.pas 2024-08-24 14:17:47 UTC (rev 4301) @@ -3,9 +3,12 @@ interface uses - Classes, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, GX_BaseForm; + Classes, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, Graphics, GX_BaseForm; type + TCodeLayout = (clSide, clTop); + +type TfmCodeOptions = class(TfmBaseForm) btnOK: TButton; btnCancel: TButton; @@ -38,7 +41,13 @@ private procedure InitializeForm; procedure edPathOnFilesDropped(_Sender: TObject; _Files: TStrings); + procedure SetData(const _StoragePath: string; _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); + procedure GetData(out _StoragePath: string; out _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); public + class function Execute(_Owner: TWinControl; var _StoragePath: string; var _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont): Boolean; constructor Create(_Owner: TComponent); override; end; @@ -49,6 +58,55 @@ uses SysUtils, GX_GenericUtils, u_dzVclUtils; +class function TfmCodeOptions.Execute(_Owner: TWinControl; var _StoragePath: string; + var _Layout: TCodeLayout; _TreeFont, _EditFont: TFont): Boolean; +var + frm: TfmCodeOptions; +begin + frm := TfmCodeOptions.Create(nil); + try + TForm_CenterOn(frm, _Owner); + frm.SetData(_StoragePath, _Layout, _TreeFont, _EditFont); + Result :=( frm.ShowModal = mrOk); + if Result then + frm.GetData(_StoragePath, _Layout, _TreeFont, _EditFont); + finally + FreeAndNil(frm); + end; +end; + +procedure TfmCodeOptions.SetData(const _StoragePath: string; _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); +begin + edPath.Text := _StoragePath; + + if _Layout = clSide then + rbSide.Checked := True + else + rbTop.Checked := True; + + fcTreeview.ItemIndex := fcTreeview.Items.IndexOf(_TreeFont.Name); + udTreeview.Position := _TreeFont.Size; + + fcEditor.ItemIndex := fcEditor.Items.IndexOf(_EditFont.Name); + udEditor.Position := _EditFont.Size; +end; + +procedure TfmCodeOptions.GetData(out _StoragePath: string; out _Layout: TCodeLayout; + _TreeFont, _EditFont: TFont); +begin + _StoragePath := edPath.Text; + if rbSide.Checked then + _Layout := clSide + else + _Layout := clTop; + + _TreeFont.Name := fcTreeview.Text; + _TreeFont.Size := Trunc(StrToInt(eTreeview.Text)); + _EditFont.Name := fcEditor.Text; + _EditFont.Size := Trunc(StrToInt(eEditor.Text)); +end; + procedure TfmCodeOptions.sbBrowseClick(Sender: TObject); var Temp: string; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-24 13:15:25
|
Revision: 4300 http://sourceforge.net/p/gexperts/code/4300 Author: twm Date: 2024-08-24 13:15:24 +0000 (Sat, 24 Aug 2024) Log Message: ----------- Added Paths: ----------- tags/1.3.25/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-24 12:25:05
|
Revision: 4299 http://sourceforge.net/p/gexperts/code/4299 Author: twm Date: 2024-08-24 12:25:03 +0000 (Sat, 24 Aug 2024) Log Message: ----------- incremented release number Modified Paths: -------------- trunk/Projects/GExperts_version.ini Modified: trunk/Projects/GExperts_version.ini =================================================================== --- trunk/Projects/GExperts_version.ini 2024-08-24 12:10:30 UTC (rev 4298) +++ trunk/Projects/GExperts_version.ini 2024-08-24 12:25:03 UTC (rev 4299) @@ -2,7 +2,7 @@ Build=85 MajorVer=1 MinorVer=3 -Release=24 +Release=25 AutoIncBuild=0 Revision= Private=0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-24 12:10:32
|
Revision: 4298 http://sourceforge.net/p/gexperts/code/4298 Author: twm Date: 2024-08-24 12:10:30 +0000 (Sat, 24 Aug 2024) Log Message: ----------- updated copyright to -2024 Modified Paths: -------------- trunk/Documentation/License.txt Modified: trunk/Documentation/License.txt =================================================================== --- trunk/Documentation/License.txt 2024-08-18 16:39:18 UTC (rev 4297) +++ trunk/Documentation/License.txt 2024-08-24 12:10:30 UTC (rev 4298) @@ -1,6 +1,6 @@ GExperts License Agreement - GExperts is copyright 1996-2023 by Thomas Mueller, Erik Berry and the GExperts development team. This license agreement only covers code written by Erik Berry and the rest of the GExperts development team who have specifically submitted their code for inclusion with GExperts. You should contact the other third-party authors concerning their respective copyrights and conditions. + GExperts is copyright 1996-2024 by Thomas Mueller, Erik Berry and the GExperts development team. This license agreement only covers code written by Erik Berry and the rest of the GExperts development team who have specifically submitted their code for inclusion with GExperts. You should contact the other third-party authors concerning their respective copyrights and conditions. The rules governing the use of GExperts and the GExperts source code are derived from the official Open Source Definition, available at http://www.opensource.org. The conditions and limitations are as follows: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-18 16:39:20
|
Revision: 4297 http://sourceforge.net/p/gexperts/code/4297 Author: akalwahome Date: 2024-08-18 16:39:18 +0000 (Sun, 18 Aug 2024) Log Message: ----------- Created an icon fpr the FilterExceptionExpert. Added Paths: ----------- branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp Added: branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp =================================================================== (Binary files differ) Index: branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp =================================================================== --- branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp 2024-08-18 16:38:51 UTC (rev 4296) +++ branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp 2024-08-18 16:39:18 UTC (rev 4297) Property changes on: branches/dark-mode/Images/TGxFilterExceptionsExpert.bmp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-18 16:38:53
|
Revision: 4296 http://sourceforge.net/p/gexperts/code/4296 Author: akalwahome Date: 2024-08-18 16:38:51 +0000 (Sun, 18 Aug 2024) Log Message: ----------- make code compile with Delphi 2007 Modified Paths: -------------- branches/dark-mode/Projects/Delphi2007/GExpertsDelphi2007.dpr branches/dark-mode/Source/Grep/GX_GrepResults.dfm branches/dark-mode/Source/Grep/GX_GrepResults.pas branches/dark-mode/Source/Grep/GX_GrepSearch.pas branches/dark-mode/Source/Utils/GX_CheckButton.pas Modified: branches/dark-mode/Projects/Delphi2007/GExpertsDelphi2007.dpr =================================================================== --- branches/dark-mode/Projects/Delphi2007/GExpertsDelphi2007.dpr 2024-08-15 07:41:13 UTC (rev 4295) +++ branches/dark-mode/Projects/Delphi2007/GExpertsDelphi2007.dpr 2024-08-18 16:38:51 UTC (rev 4296) @@ -18,6 +18,7 @@ GX_BaseForm in '..\..\source\Framework\GX_BaseForm.pas' {fmBaseForm}, GX_BookmarkList in '..\..\source\Utils\GX_BookmarkList.pas', GX_Bookmarks in '..\..\source\Bookmarks\GX_Bookmarks.pas' {fmGxBookmarksForm}, + GX_CheckButton in '..\..\Source\Utils\GX_CheckButton.pas', GX_CheckListBoxWithHints in '..\..\Source\ProjectOptionSets\GX_CheckListBoxWithHints.pas', GX_ClassBrowser in '..\..\source\ClassBrowser\GX_ClassBrowser.pas' {fmClassBrowser}, GX_ClassHacks in '..\..\source\Framework\GX_ClassHacks.pas', Modified: branches/dark-mode/Source/Grep/GX_GrepResults.dfm =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepResults.dfm 2024-08-15 07:41:13 UTC (rev 4295) +++ branches/dark-mode/Source/Grep/GX_GrepResults.dfm 2024-08-18 16:38:51 UTC (rev 4296) @@ -9,6 +9,7 @@ KeyPreview = True OldCreateOrder = False ShowHint = True + OnActivate = FormActivate OnKeyPress = FormKeyPress OnResize = FormResize OnShow = FormShow Modified: branches/dark-mode/Source/Grep/GX_GrepResults.pas =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepResults.pas 2024-08-15 07:41:13 UTC (rev 4295) +++ branches/dark-mode/Source/Grep/GX_GrepResults.pas 2024-08-18 16:38:51 UTC (rev 4296) @@ -326,6 +326,7 @@ procedure SplitterHistoryListCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); procedure actHistoryClearExecute(Sender: TObject); procedure actFileOptionsStandAloneExecute(Sender: TObject); + procedure FormActivate(Sender: TObject); private FLastRepaintTick: DWORD; FSearchInProgress: Boolean; @@ -360,6 +361,7 @@ FSaveSortCaption: string; FSavedFormCaption: string; FlbHistoryListIndexForHistoryMenuActions: Integer; + procedure InitThemedColors; procedure SetStayOnTop(Value: Boolean); procedure RefreshContextLines; procedure SetShowContext(Value: Boolean); @@ -545,6 +547,19 @@ { TfmGrepResults } +procedure TfmGrepResults.FormActivate(Sender: TObject); +// will be called by the IDE if the form is in the saved layout. +begin + inherited; + InitThemedColors; + + AssignSettingsToForm; + ResizeListBox; + ResizeStatusBar; + + ForceRedraw; +end; + procedure TfmGrepResults.FormKeyPress(Sender: TObject; var Key: Char); begin if Key = #27 then @@ -895,6 +910,29 @@ lbResults.Refresh; end; +procedure TfmGrepResults.InitThemedColors; +var + LBackColor : TColor; +begin +{$IFDEF GX_SUPPORTS_THEMING} + if IsThemingEnabled then begin + InitTheming(Self); + GxOtaGetIDEThemingServices.ApplyTheme(tcHistoryListPage); + + LBackColor := GetThemedColor(clWindow); + + tcHistoryListPage.Style := tsFlatButtons; // don't paint the control themed + tcHistoryListPage.Brush.Color := LBackColor; + + pnlMain.Color := LBackColor; + pnlBottom.Color := LBackColor; + lbResults.Color := LBackColor; + lbHistoryList.Color := LBackColor; + reContext.Color := LBackColor; + end; +{$ENDIF} +end; + procedure TfmGrepResults.InitGrepSettings(AGrepSettings: TGrepSettings); begin FGrepSettings := AGrepSettings; @@ -2030,24 +2068,48 @@ lbHistoryList.Refresh; end; -procedure TfmGrepResults.FormShow(Sender: TObject); +(* +procedure TfmGrepResults.TabControlDrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); var + LCaption : string; + LTextRect : TRect; LBackColor : TColor; + LTextColor : TColor; begin + LCaption := TTabControl(Control).Tabs[TabIndex]; + if Active then + begin + LBackColor := GetThemedColor(clHighlight); + LTextColor := GetThemedColor(clHighlightText) + end + else begin + LBackColor := GetThemedColor(clBtnFace); + LTextColor := GetThemedColor(clBtnText); + end; + + Control.Canvas.Brush.Color := LBackColor; + Control.Canvas.FillRect(Rect); + Control.Canvas.Font.Color := LTextColor; + + LTextRect := Rect; + LTextRect.Inflate(-3, -3); + DrawText(Control.Canvas.Handle, PChar(LCaption), -1, LTextRect, DT_TOP or DT_LEFT); +end; +*) + +type + TWinControlAccess = class(TWinControl); + +procedure TfmGrepResults.FormShow(Sender: TObject); +begin inherited; + InitThemedColors; + AssignSettingsToForm; ResizeListBox; ResizeStatusBar; - if IsThemingEnabled then begin - InitTheming(Self); - LBackColor := GetThemedColor(clWindow); - pnlMain.Color := LBackColor; - pnlBottom.Color := LBackColor; - lbResults.Color := LBackColor; - lbHistoryList.Color := LBackColor; - reContext.Color := LBackColor; - end; + ForceRedraw; end; Modified: branches/dark-mode/Source/Grep/GX_GrepSearch.pas =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-08-15 07:41:13 UTC (rev 4295) +++ branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-08-18 16:38:51 UTC (rev 4296) @@ -811,8 +811,10 @@ inherited; TControl_SetConstraints(Self, [ccMinWidth, ccMinHeight, ccMaxHeight]); +{$IFDEF GX_SUPPORTS_THEMING} if not IsStandAlone then InitTheming; +{$ENDIF} FixComboBoxSelections(Self); end; Modified: branches/dark-mode/Source/Utils/GX_CheckButton.pas =================================================================== --- branches/dark-mode/Source/Utils/GX_CheckButton.pas 2024-08-15 07:41:13 UTC (rev 4295) +++ branches/dark-mode/Source/Utils/GX_CheckButton.pas 2024-08-18 16:38:51 UTC (rev 4296) @@ -22,8 +22,10 @@ private FSavedOnClick: TNotifyEvent; FData: Pointer; +{$IFDEF GX_SUPPORTS_THEMING} class constructor Create; class destructor Destroy; +{$ENDIF} function GetDownState: Boolean; procedure SetDownState(const Value: Boolean); protected @@ -71,6 +73,7 @@ GX_IdeUtils ; +{$IFDEF GX_SUPPORTS_THEMING} type TGXCheckButtonStyleHook = class(TButtonStyleHook) protected @@ -154,6 +157,7 @@ end; end; end; +{$ENDIF} { TGXCheckButton } @@ -160,6 +164,7 @@ type TWinControlAccess = class(TWinControl); +{$IFDEF GX_SUPPORTS_THEMING} class constructor TGXCheckButton.Create; begin TCustomStyleEngine.UnRegisterStyleHook(TGXCheckButton, TCheckBoxStyleHook); @@ -170,6 +175,7 @@ begin TCustomStyleEngine.UnRegisterStyleHook(TGXCheckButton, TGXCheckButtonStyleHook); end; +{$ENDIF} constructor TGXCheckButton.Clone(var AControl); var This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-15 07:41:15
|
Revision: 4295 http://sourceforge.net/p/gexperts/code/4295 Author: akalwahome Date: 2024-08-15 07:41:13 +0000 (Thu, 15 Aug 2024) Log Message: ----------- Project file for Delphi 11.x Modified Paths: -------------- branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dpr Modified: branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dpr =================================================================== --- branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dpr 2024-08-15 07:40:03 UTC (rev 4294) +++ branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dpr 2024-08-15 07:41:13 UTC (rev 4295) @@ -18,6 +18,7 @@ GX_BaseForm in '..\..\source\Framework\GX_BaseForm.pas' {fmBaseForm}, GX_BookmarkList in '..\..\source\Utils\GX_BookmarkList.pas', GX_Bookmarks in '..\..\source\Bookmarks\GX_Bookmarks.pas' {fmGxBookmarksForm}, + GX_CheckButton in '..\..\source\Utils\GX_CheckButton.pas', GX_CheckListBoxWithHints in '..\..\Source\ProjectOptionSets\GX_CheckListBoxWithHints.pas', GX_ClassBrowser in '..\..\source\ClassBrowser\GX_ClassBrowser.pas' {fmClassBrowser}, GX_ClassHacks in '..\..\source\Framework\GX_ClassHacks.pas', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-15 07:40:17
|
Revision: 4294 http://sourceforge.net/p/gexperts/code/4294 Author: akalwahome Date: 2024-08-15 07:40:03 +0000 (Thu, 15 Aug 2024) Log Message: ----------- Code cleanup. Modified Paths: -------------- branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.dfm branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.pas branches/dark-mode/Source/Framework/GX_BaseForm.pas branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm branches/dark-mode/Source/RenameComponents/GX_CompRename.pas branches/dark-mode/Source/Utils/GX_CheckButton.pas Modified: branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj =================================================================== --- branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj 2024-08-15 07:40:03 UTC (rev 4294) @@ -49,11 +49,13 @@ <DCC_UsePackage>rtl;vcl;designide;$(DCC_UsePackage)</DCC_UsePackage> <GenDll>true</GenDll> <Manifest_File>(None)</Manifest_File> - <PreBuildEvent><![CDATA[call ..\..\source\_CreateGExpertsManifest.cmd + <PreBuildEvent> + <![CDATA[call ..\..\source\_CreateGExpertsManifest.cmd call ..\..\images\_CreateGXIconsRc.cmd call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)" call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)" -$(PreBuildEvent)]]></PreBuildEvent> +$(PreBuildEvent)]]> + </PreBuildEvent> <UsePackages>True</UsePackages> <VerInfo_Keys>FileVersion=1.0.0.0</VerInfo_Keys> <VerInfo_Locale>2057</VerInfo_Locale> @@ -132,6 +134,7 @@ <Form>fmGxBookmarksForm</Form> <FormType>dfm</FormType> </DCCReference> + <DCCReference Include="..\..\source\Utils\GX_CheckButton.pas"/> <DCCReference Include="..\..\Source\ProjectOptionSets\GX_CheckListBoxWithHints.pas"/> <DCCReference Include="..\..\source\ClassBrowser\GX_ClassBrowser.pas"> <Form>fmClassBrowser</Form> @@ -751,14 +754,6 @@ <PostBuildEvent/> <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> </PropertyGroup> - <PropertyGroup Condition="'$(Config)'=='Release' And '$(Platform)'=='Win64'"> - <PreBuildEvent>call ..\..\source\_CreateGExpertsManifest.cmd&&call ..\..\images\_CreateGXIconsRc.cmd&&call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)"&&call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)"</PreBuildEvent> - <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode> - <PreLinkEvent/> - <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode> - <PostBuildEvent/> - <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> - </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win32'"> <PreBuildEvent>call ..\..\source\_CreateGExpertsManifest.cmd&&call ..\..\images\_CreateGXIconsRc.cmd&&call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)"&&call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)"</PreBuildEvent> <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode> @@ -767,12 +762,4 @@ <PostBuildEvent/> <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> </PropertyGroup> - <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win64'"> - <PreBuildEvent>call ..\..\source\_CreateGExpertsManifest.cmd&&call ..\..\images\_CreateGXIconsRc.cmd&&call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)"&&call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)"</PreBuildEvent> - <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode> - <PreLinkEvent/> - <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode> - <PostBuildEvent/> - <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> - </PropertyGroup> </Project> Modified: branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj =================================================================== --- branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj 2024-08-15 07:40:03 UTC (rev 4294) @@ -7,9 +7,9 @@ <MainSource>GExpertsRS120.dpr</MainSource> <Platform Condition="'$(Platform)'==''">Win32</Platform> <ProjectGuid>{BB29661E-3FA2-4EA6-96EB-0768940BAAB6}</ProjectGuid> + <ProjectName Condition="'$(ProjectName)'==''">GExpertsRS120</ProjectName> <ProjectVersion>20.1</ProjectVersion> <TargetedPlatforms>1</TargetedPlatforms> - <ProjectName Condition="'$(ProjectName)'==''">GExpertsRS120</ProjectName> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''"> <Base>true</Base> @@ -57,11 +57,13 @@ <DCC_UsePackage>rtl;vcl;designide;$(DCC_UsePackage)</DCC_UsePackage> <GenDll>true</GenDll> <Manifest_File>(None)</Manifest_File> - <PreBuildEvent><![CDATA[call ..\..\images\_CreateGXIconsRc.cmd + <PreBuildEvent> + <![CDATA[call ..\..\images\_CreateGXIconsRc.cmd call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)" call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)" call ..\..\source\_CreateGExpertsManifest.cmd -$(PreBuildEvent)]]></PreBuildEvent> +$(PreBuildEvent)]]> + </PreBuildEvent> <UsePackages>True</UsePackages> <VerInfo_Keys>FileVersion=1.0.0.0</VerInfo_Keys> <VerInfo_Locale>2057</VerInfo_Locale> @@ -764,14 +766,6 @@ <PostBuildEvent/> <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> </PropertyGroup> - <PropertyGroup Condition="'$(Config)'=='Release' And '$(Platform)'=='Win64'"> - <PreBuildEvent>call ..\..\images\_CreateGXIconsRc.cmd&&call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)"&&call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)"&&call ..\..\source\_CreateGExpertsManifest.cmd</PreBuildEvent> - <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode> - <PreLinkEvent/> - <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode> - <PostBuildEvent/> - <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> - </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win32'"> <PreBuildEvent>call ..\..\images\_CreateGXIconsRc.cmd&&call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)"&&call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)"&&call ..\..\source\_CreateGExpertsManifest.cmd</PreBuildEvent> <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode> @@ -780,12 +774,4 @@ <PostBuildEvent/> <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> </PropertyGroup> - <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win64'"> - <PreBuildEvent>call ..\..\images\_CreateGXIconsRc.cmd&&call ..\..\buildtools\prebuild.cmd "$(PROJECTPATH)"&&call ..\..\buildtools\movedll.cmd "$(OUTPUTPATH)"&&call ..\..\source\_CreateGExpertsManifest.cmd</PreBuildEvent> - <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode> - <PreLinkEvent/> - <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode> - <PostBuildEvent/> - <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode> - </PropertyGroup> </Project> Modified: branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.dfm =================================================================== --- branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.dfm 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.dfm 2024-08-15 07:40:03 UTC (rev 4294) @@ -32,8 +32,8 @@ object l_SpacesPerIndent: TLabel Left = 16 Top = 8 - Width = 88 - Height = 13 + Width = 93 + Height = 15 Caption = 'Spaces per Indent' end object ed_SpacePerIndent: TEdit @@ -179,15 +179,15 @@ object l_BeginStyle: TLabel Left = 240 Top = 96 - Width = 52 - Height = 13 + Width = 57 + Height = 15 Caption = 'Begin style' end object l_WrapAtPosition: TLabel Left = 248 Top = 216 - Width = 51 - Height = 13 + Width = 58 + Height = 15 Caption = 'At position' end object l_TryStyle: TLabel @@ -194,7 +194,7 @@ Left = 240 Top = 144 Width = 42 - Height = 13 + Height = 15 Caption = 'Try style' end object cmb_FeedRoundBegin: TComboBox @@ -201,9 +201,8 @@ Left = 240 Top = 112 Width = 185 - Height = 21 + Height = 23 Style = csDropDownList - ItemHeight = 13 TabOrder = 2 OnChange = UpdatePreview Items.Strings = ( @@ -387,9 +386,8 @@ Left = 240 Top = 160 Width = 185 - Height = 21 + Height = 23 Style = csDropDownList - ItemHeight = 13 TabOrder = 3 OnChange = UpdatePreview Items.Strings = ( @@ -402,40 +400,40 @@ Caption = 'Capitalization' DesignSize = ( 426 - 454) + 452) object l_Capitalize: TLabel Left = 16 Top = 8 - Width = 46 - Height = 13 + Width = 51 + Height = 15 Caption = 'Capitalize' end object l_ReservedWords: TLabel Left = 16 Top = 48 - Width = 78 - Height = 13 + Width = 82 + Height = 15 Caption = 'Reserved words' end object l_StandardDirectives: TLabel Left = 144 Top = 48 - Width = 93 - Height = 13 + Width = 100 + Height = 15 Caption = 'Standard directives' end object l_Identifiers: TLabel Left = 272 Top = 48 - Width = 49 - Height = 13 + Width = 52 + Height = 15 Caption = 'Identifiers' end object l_CapitalizationInFile: TLabel Left = 16 Top = 248 - Width = 126 - Height = 13 + Width = 140 + Height = 15 Caption = 'Capitalization stored in file' end object chk_UpperCompDirectives: TCheckBox @@ -460,9 +458,8 @@ Left = 16 Top = 64 Width = 118 - Height = 21 + Height = 23 Style = csDropDownList - ItemHeight = 13 TabOrder = 2 OnChange = UpdatePreview Items.Strings = ( @@ -475,9 +472,8 @@ Left = 144 Top = 64 Width = 117 - Height = 21 + Height = 23 Style = csDropDownList - ItemHeight = 13 TabOrder = 3 OnChange = UpdatePreview Items.Strings = ( @@ -534,9 +530,8 @@ Left = 272 Top = 64 Width = 118 - Height = 21 + Height = 23 Style = csDropDownList - ItemHeight = 13 TabOrder = 4 OnChange = UpdatePreview Items.Strings = ( @@ -552,15 +547,15 @@ object l_AlignComentsAtPosition: TLabel Left = 40 Top = 40 - Width = 51 - Height = 13 + Width = 58 + Height = 15 Caption = 'At position' end object l_AlignVarAtPosition: TLabel Left = 40 Top = 136 - Width = 51 - Height = 13 + Width = 58 + Height = 15 Caption = 'At position' end object chk_AlignComments: TCheckBox @@ -673,14 +668,14 @@ Left = 8 Top = 24 Width = 24 - Height = 13 + Height = 15 Caption = 'Start' end object l_MiscEnd: TLabel Left = 128 Top = 24 - Width = 18 - Height = 13 + Width = 20 + Height = 15 Caption = 'End' end object ed_StartComment: TEdit @@ -715,15 +710,15 @@ object l_Before: TLabel Left = 24 Top = 1 - Width = 32 - Height = 13 + Width = 34 + Height = 15 Caption = 'Before' end object l_After: TLabel Left = 202 Top = 1 - Width = 22 - Height = 13 + Width = 26 + Height = 15 Caption = 'After' end end Modified: branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.pas =================================================================== --- branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.pas 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Source/Formatter/GX_CodeFormatterConfig.pas 2024-08-15 07:40:03 UTC (rev 4294) @@ -279,7 +279,9 @@ begin inherited; h := grid_Spacing.Canvas.TextHeight('Mg') + 4; +{$IF declared(FScaler)} grid_Spacing.DefaultRowHeight := FScaler.Calc(h); +{$IFEND} end; procedure TfmCodeFormatterConfig.HandleCaptitalizationFileDropped(_Sender: TObject; _Files: TStrings); Modified: branches/dark-mode/Source/Framework/GX_BaseForm.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_BaseForm.pas 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Source/Framework/GX_BaseForm.pas 2024-08-15 07:40:03 UTC (rev 4294) @@ -122,6 +122,7 @@ procedure TfmBaseForm.ArrangeControls; begin + // end; procedure TfmBaseForm.Loaded; Modified: branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm =================================================================== --- branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm 2024-08-15 07:40:03 UTC (rev 4294) @@ -202,7 +202,6 @@ Top = 0 Width = 169 Height = 25 - Anchors = [] Caption = 'Top' TabOrder = 0 OnClick = b_AlignTopClick @@ -212,7 +211,6 @@ Top = 24 Width = 41 Height = 65 - Anchors = [] Caption = 'Left' TabOrder = 1 OnClick = b_AlignLeftClick @@ -222,7 +220,6 @@ Top = 24 Width = 89 Height = 65 - Anchors = [] Caption = 'Client' TabOrder = 2 OnClick = b_AlignClientClick @@ -232,7 +229,6 @@ Top = 120 Width = 65 Height = 25 - Anchors = [] Caption = 'None' TabOrder = 5 OnClick = b_AlignNoneClick @@ -242,7 +238,6 @@ Top = 120 Width = 65 Height = 25 - Anchors = [] Caption = 'Custom' TabOrder = 6 OnClick = b_AlignCustomClick @@ -252,7 +247,6 @@ Top = 24 Width = 41 Height = 65 - Anchors = [] Caption = 'Right' TabOrder = 3 OnClick = b_AlignRightClick @@ -262,7 +256,6 @@ Top = 88 Width = 169 Height = 25 - Anchors = [] Caption = 'Bottom' TabOrder = 4 OnClick = b_AlignBottomClick @@ -276,7 +269,6 @@ Top = 46 Width = 49 Height = 49 - Anchors = [] Caption = 'Left' TabOrder = 1 end @@ -285,7 +277,6 @@ Top = 46 Width = 49 Height = 49 - Anchors = [] Caption = 'Right' TabOrder = 2 end @@ -294,7 +285,6 @@ Top = 16 Width = 49 Height = 49 - Anchors = [] Caption = 'Top' TabOrder = 0 end @@ -303,7 +293,6 @@ Top = 71 Width = 49 Height = 49 - Anchors = [] Caption = 'Bottom' TabOrder = 3 end Modified: branches/dark-mode/Source/RenameComponents/GX_CompRename.pas =================================================================== --- branches/dark-mode/Source/RenameComponents/GX_CompRename.pas 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Source/RenameComponents/GX_CompRename.pas 2024-08-15 07:40:03 UTC (rev 4294) @@ -14,7 +14,7 @@ Classes, Controls, Forms, StdCtrls, ExtCtrls, ToolsAPI, ComCtrls, Buttons, GX_Experts, GX_ConfigurationInfo, GX_EditorChangeServices, GX_CheckButton, Contnrs, Messages, - Types, GX_BaseForm, u_dzSpeedBitBtn; + Types, GX_BaseForm; type TIsValidComponentName = function (const OldName, NewName: WideString; var Reason: WideString): Boolean of object; Modified: branches/dark-mode/Source/Utils/GX_CheckButton.pas =================================================================== --- branches/dark-mode/Source/Utils/GX_CheckButton.pas 2024-08-14 20:53:09 UTC (rev 4293) +++ branches/dark-mode/Source/Utils/GX_CheckButton.pas 2024-08-15 07:40:03 UTC (rev 4294) @@ -1,5 +1,14 @@ unit GX_CheckButton; +{ This unit provides: + - TGXCheckButton: A CheckBox-like component, which looks like a TButton; + similar to TSpeedButton, but with keyboard focus control. + - TGXCheckButtonGroup: Group TGXCheckButtons to behave like a RadioGroup. + - TGXCheckButtonStyleHook for themed drawing. +} + +{$I GX_CondDefine.inc} + interface uses @@ -58,7 +67,9 @@ Types, Windows, SysUtils, - Graphics; + Graphics, + GX_IdeUtils + ; type TGXCheckButtonStyleHook = class(TButtonStyleHook) @@ -68,6 +79,12 @@ { TGXCheckButtonStyleHook } +const + Pattern : array[0..7] of Word = ( + $5555, $AAAA, $5555, $AAAA + ,$5555, $AAAA, $5555, $AAAA + ); + procedure TGXCheckButtonStyleHook.DrawButton(ACanvas: TCanvas; AMouseInControl: Boolean); var LStyle : TCustomStyleServices; @@ -74,6 +91,38 @@ Details : TThemedElementDetails; LControl: TGXCheckButton; R : TRect; + + procedure GXDrawFocusRect(DC: HDC; R: TRect); + var + hbmpPattern : HBITMAP; + hbrPattern : HBRUSH; + hbrOriginal : HBRUSH; + cx, cy : Integer; + nSaved : Integer; + begin + nSaved := SaveDC(DC); + hbmpPattern := CreateBitmap(8, 8, 1, 1, @Pattern); + hbrPattern := CreatePatternBrush(hbmpPattern); + hbrOriginal := SelectObject(DC, hbrPattern); + + SetBkColor(DC, ColorToRGB(GetThemedColor(clWindow))); + SetTextColor(DC, ColorToRGB(GetThemedColor(clWindowText))); + + SystemParametersInfo(SPI_GETFOCUSBORDERWIDTH, 0, cx, 0); + SystemParametersInfo(SPI_GETFOCUSBORDERHEIGHT, 0, cy, 0); + + PatBlt(DC, R.Left , R.Top , R.Width, cy , PATINVERT); // top + PatBlt(DC, R.Left , R.Bottom - cy, R.Width, cy , PATINVERT); // bottom + PatBlt(DC, R.Left , R.Top + cy, cx , R.Height - (cy * 2), PATINVERT); // left + PatBlt(DC, R.Right - cx, R.Top + cy, cx , R.Height - (cy * 2), PATINVERT); // right + + SelectObject(DC, hbrOriginal); + DeleteObject(hbrPattern); + DeleteObject(hbmpPattern); + + RestoreDC(DC, nSaved); + end; + begin LStyle := StyleServices; if not LStyle.Available then @@ -85,17 +134,23 @@ if Control is TGXCheckButton then begin LControl := TGXCheckButton(Control); - if LControl.Checked - then Details := LStyle.GetElementDetails(tbPushButtonPressed) - else Details := LStyle.GetElementDetails(tbPushButtonNormal); + if LControl.Checked then + Details := LStyle.GetElementDetails(tbPushButtonPressed) + else + Details := LStyle.GetElementDetails(tbPushButtonNormal); + R := LControl.ClientRect; LStyle.DrawElement(ACanvas.Handle, Details, R, nil); LStyle.DrawText(ACanvas.Handle, Details, LControl.Caption, R, [tfCenter, tfVerticalCenter]); + if Focused then begin - R.Inflate(-2, -2); - DrawFocusRect(ACanvas.Handle, R); + R.Inflate(-2, -2); // for better visibility + + // DrawFocusRect(ACanvas.Handle, R); // respects SPI_GETFOCUSBORDERWIDTH/SPI_GETFOCUSBORDERHEIGHT + // DrawStyleFocusRect(ACanvas.Handle, R); // only 1 pixel; ignores system settings + GXDrawFocusRect(ACanvas.Handle, R); // own implementation end; end; end; @@ -196,7 +251,7 @@ if AButton.Down then begin - if Assigned(AButton.FSavedOnClick) then + if Assigned(AButton.FSavedOnClick) then AButton.FSavedOnClick(AButton) else if Assigned(FOnClick) then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-14 20:53:12
|
Revision: 4293 http://sourceforge.net/p/gexperts/code/4293 Author: akalwahome Date: 2024-08-14 20:53:09 +0000 (Wed, 14 Aug 2024) Log Message: ----------- Fixed more dark mode issues. NEW: TGX_CheckButton and TGXCheckButtonGroup with theme support; replaces TdzSpeedBitBtn Added Image for TGxFilterExceptionsExpert. Modified Paths: -------------- branches/dark-mode/ExternalSource/dzlib/u_dzSpeedBitBtn.pas branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas branches/dark-mode/Images/GXIcons.rc branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dpr branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.dfm branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas branches/dark-mode/Source/Framework/GX_About.dfm branches/dark-mode/Source/Framework/GX_FeedbackWizard.pas branches/dark-mode/Source/Framework/GX_GExperts.pas branches/dark-mode/Source/Grep/GX_GrepSearch.pas branches/dark-mode/Source/ProjectDependencies/GX_ProjDepend.pas branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm branches/dark-mode/Source/RenameComponents/GX_CompRename.pas branches/dark-mode/Source/UsesExpert/GX_UsesExpert.dfm branches/dark-mode/Source/UsesExpert/GX_UsesExpert.pas Added Paths: ----------- branches/dark-mode/Source/Utils/GX_CheckButton.pas Modified: branches/dark-mode/ExternalSource/dzlib/u_dzSpeedBitBtn.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzSpeedBitBtn.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/ExternalSource/dzlib/u_dzSpeedBitBtn.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -38,9 +38,6 @@ /// Note: Actions do not work.</summary> TdzSpeedBitBtn = class(TWindowProcHook) private - FColorRaised: TColor; - FColorSunken: TColor; - FColorText: TColor; FCaption: string; FUpGlyph: TBitmap; FDownGlyph: TBitmap; @@ -57,7 +54,8 @@ procedure SetDown(const Value: Boolean); procedure UpdateGlyph; function GetBitBtn: TBitBtn; - procedure PrepareBmp(_w, _h: Integer; _Color: TColor; _Edge: UINT; _Glyph: TBitmap; _bmp: TBitmap); + procedure PrepareBmp(_w, _h: Integer; _Color: TColor; _Edge: UINT; _Glyph: TBitmap; + _bmp: TBitmap); procedure PrepareBmps(_UpBmp, _DownBmp: TBitmap); protected procedure NewWindowProc(var _Msg: TMessage); override; @@ -65,7 +63,6 @@ constructor Create(_btn: TBitBtn); reintroduce; overload; constructor Create(_btn: TBitBtn; _UpGlyph, _DownGlyph: TBitmap); overload; constructor Create(_btn: TBitBtn; _ImageList: TImageList; _UpGlyphIdx, _DownGlyphIdx: Integer); overload; - constructor Create(_btn: TWinControl; AColorText: TColor = clNone; AColorRaised: TColor = clNone; AColorSunken: TColor = clNone); overload; destructor Destroy; override; property Down: Boolean read GetDown write SetDown; property BitBtn: TBitBtn read GetBitBtn; @@ -82,9 +79,6 @@ FOnClick: TNotifyEvent; FList: TList; FAllowAllUp: Boolean; - FColorRaised: TColor; - FColorSunken: TColor; - FColorText: TColor; procedure HandleClick(_Sender: TObject); procedure doOnClick; function TryGetSelectedSb(out _Idx: Integer; out _sb: TdzSpeedBitBtn): Boolean; @@ -121,26 +115,13 @@ function TryGetSelected(out _Data: Pointer): Boolean; overload; property AllowAllUp: Boolean read FAllowAllUp write FAllowAllUp; property OnClick: TNotifyEvent read FOnClick write FOnClick; - property ColorRaised: TColor read FColorRaised write FColorRaised default clNone; - property ColorSunken: TColor read FColorSunken write FColorSunken default clNone; - property ColorText: TColor read FColorText write FColorText default clNone; end; + end; implementation -{$IF CompilerVersion >= 35} // Delphi 11 and up. - {$DEFINE USE_THEMING} -{$IFEND} - uses Math, Forms, -{$IFDEF USE_THEMING} - UxTheme, - Themes, - {$IFDEF USE_IDE_THEMING} - GX_OtaUtils, - {$ENDIF} -{$ENDIF} u_dzGraphicsUtils, u_dzMiscUtils; @@ -190,20 +171,6 @@ UpdateGlyph; end; -constructor TdzSpeedBitBtn.Create(_btn: TWinControl; - AColorText, AColorRaised, AColorSunken: TColor); -begin - inherited Create(_btn); - - FColorRaised := AColorRaised; - FColorSunken := AColorSunken; - FColorText := AColorText; - - if FColorRaised = clNone then FColorRaised := RGB(240, 240, 240); // clBtnFace; - if FColorSunken = clNone then FColorSunken := RGB(245, 245, 245); // a bit lighter than clBtnFace; - if FColorText = clNone then FColorText := RGB(0, 0, 0); // Black -end; - constructor TdzSpeedBitBtn.Create(_btn: TBitBtn; _ImageList: TImageList; _UpGlyphIdx, _DownGlyphIdx: Integer); var @@ -242,14 +209,10 @@ begin w := BitBtn.ClientWidth; h := BitBtn.ClientHeight; - BitBtn.Spacing := 0; ColBack1 := RGB(240, 240, 240); // clBtnFace; ColBack2 := RGB(245, 245, 245); // a bit lighter than clBtnFace; - if FColorRaised <> clNone then ColBack1 := FColorRaised; - if FColorSunken <> clNone then ColBack2 := FColorSunken; - PrepareBmp(w, h, ColBack1, EDGE_RAISED, FUpGlyph, FUpBmp); PrepareBmp(w, h, ColBack2, EDGE_SUNKEN, FDownGlyph, FDownBmp); end; @@ -258,11 +221,6 @@ _bmp: TBitmap); var cnv: TCanvas; -{$IFDEF USE_THEMING} - LStyleService : TCustomStyleServices; - LDetails : TThemedElementDetails; - DC : HDC; -{$ENDIF} procedure HandleBmpOnly; var @@ -294,21 +252,7 @@ HorizontalAlignment := dthaLeft; r := Rect(X + 2, 0, _w - 3, _h); end; -{$IFDEF USE_THEMING} - if Assigned(LStyleService) and (LStyleService.Enabled) then - begin - LStyleService.DrawText( - DC, - LDetails, - FCaption, - R, - [tfCenter, tfVerticalCenter, tfSingleLine], - FColorText - ); - end - else -{$ENDIF} - TCanvas_DrawTextSingleLine(cnv, FCaption, r, HorizontalAlignment, dtvaCenter, []); + TCanvas_DrawTextSingleLine(cnv, FCaption, r, HorizontalAlignment, dtvaCenter, []); end; procedure HandleTextOnlyMultiLine; @@ -447,40 +391,14 @@ _bmp.Height := _h; _bmp.TransparentColor := clFuchsia; -{$IFDEF USE_THEMING} - _bmp.PixelFormat := pfDevice; cnv := _bmp.Canvas; - {$IFDEF USE_IDE_THEMING} - LStyleService := IdeStyleService; - {$ELSE} - LStyleService := Themes.StyleServices; - {$ENDIF} - if Assigned(LStyleService) and LStyleService.Enabled then - begin - R := Rect(0, 0, _w, _h); - if _Edge = EDGE_SUNKEN then // "down" - begin - LDetails := LStyleService.GetElementDetails(TThemedButton.tbPushButtonPressed); - FColorText := LStyleService.GetStyleFontColor(TStyleFont.sfButtonTextPressed); - end - else begin // "up" - LDetails := LStyleService.GetElementDetails(TThemedButton.tbPushButtonNormal); - FColorText := LStyleService.GetStyleFontColor(TStyleFont.sfButtonTextNormal); - end; - LStyleService.DrawElement(DC, LDetails, R, nil, 0); -// _bmp.Canvas.Pixels[0, 0] := clFuchsia; - end - else -{$ENDIF USE_THEMING} - begin - cnv := _bmp.Canvas; - cnv.Brush.Color := _Color; - cnv.Brush.Style := bsSolid; - cnv.FillRect(Rect(0, 0, _w, _h)); + cnv.Brush.Color := _Color; + cnv.Brush.Style := bsSolid; + cnv.FillRect(Rect(0, 0, _w, _h)); - r := Rect(0, 0, _w - 1, _h - 2); - DrawEdge(cnv.Handle, r, _Edge, BF_RECT); - end; + r := Rect(0, 0, _w - 1, _h - 2); + DrawEdge(cnv.Handle, r, _Edge, BF_RECT); + cnv.Brush.Style := bsClear; cnv.Font := BitBtn.Font; @@ -572,9 +490,6 @@ begin inherited Create; FList := TList.Create; - FColorRaised := clNone; - FColorSunken := clNone; - FColorText := clNone; end; destructor TdzSpeedBitBtnGroup.Destroy; @@ -586,10 +501,7 @@ function TdzSpeedBitBtnGroup.Add(_btn: TBitBtn; _Data: Pointer): TdzSpeedBitBtn; begin _btn.OnClick := Self.HandleClick; -{$IFDEF USE_THEMING} - _btn.StyleElements := []; -{$ENDIF} - Result := TdzSpeedBitBtn.Create(_btn, FColorText, FColorRaised, FColorSunken); + Result := TdzSpeedBitBtn.Create(_btn); Result.Data := _Data; FList.Add(Result); end; @@ -599,7 +511,7 @@ Result := Add(_btn, nil); end; -function TdzSpeedBitBtnGroup.Add(_btn: TBitBtn; _Data: NativeInt): TdzSpeedBitBtn; +function TdzSpeedBitBtnGroup.Add(_btn: TBitBtn; _Data: Integer): TdzSpeedBitBtn; begin Result := Add(_btn, Pointer(_Data)); //FI:W541 Casting from Integer to Pointer type (or vice versa) end; Modified: branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -32,7 +32,7 @@ Themes, MultiMon, // this unit doesn't exist in older Delphi versions, use a unit alias like Multimon=Windows in that case {$IFDEF HAS_UNIT_SYSTEM_ACTIONS} - Actions, + System.Actions, {$ENDIF} {$IFDEF HAS_UNIT_SYSTEM_UITYPES} UITypes, Modified: branches/dark-mode/Images/GXIcons.rc =================================================================== --- branches/dark-mode/Images/GXIcons.rc 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Images/GXIcons.rc 2024-08-14 20:53:09 UTC (rev 4293) @@ -49,6 +49,7 @@ TGrepNextItemExpert BITMAP "TGrepNextItemExpert.bmp" TGrepPrevItemExpert BITMAP "TGrepPrevItemExpert.bmp" TGrepSearchExpert BITMAP "TGrepSearchExpert.bmp" +TGxFilterExceptionsExpert BITMAP "TGxFilterExceptionsExpert.bmp" THideNonVisualCompsExpert BITMAP "THideNonVisualCompsExpert.bmp" TIDEMenuShortCutsExpert BITMAP "TIDEMenuShortCutsExpert.bmp" TIfDefExpert BITMAP "TIfDefExpert.bmp" Modified: branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dpr =================================================================== --- branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dpr 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dpr 2024-08-14 20:53:09 UTC (rev 4293) @@ -18,6 +18,7 @@ GX_BaseForm in '..\..\source\Framework\GX_BaseForm.pas' {fmBaseForm}, GX_BookmarkList in '..\..\source\Utils\GX_BookmarkList.pas', GX_Bookmarks in '..\..\source\Bookmarks\GX_Bookmarks.pas' {fmGxBookmarksForm}, + GX_CheckButton in '..\..\Source\Utils\GX_CheckButton.pas', GX_CheckListBoxWithHints in '..\..\Source\ProjectOptionSets\GX_CheckListBoxWithHints.pas', GX_ClassBrowser in '..\..\source\ClassBrowser\GX_ClassBrowser.pas' {fmClassBrowser}, GX_ClassHacks in '..\..\source\Framework\GX_ClassHacks.pas', Modified: branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj =================================================================== --- branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Projects/DelphiXx120/GExpertsRS120.dproj 2024-08-14 20:53:09 UTC (rev 4293) @@ -88,7 +88,6 @@ <Manifest_File>None</Manifest_File> </PropertyGroup> <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''"> - <DCC_DebugDCUs>true</DCC_DebugDCUs> <Debugger_HostApplication>$(BDS)\bin\bds.exe</Debugger_HostApplication> <Debugger_RunParams>-rBDSPlain -pDelphi</Debugger_RunParams> </PropertyGroup> @@ -144,6 +143,7 @@ <Form>fmGxBookmarksForm</Form> <FormType>dfm</FormType> </DCCReference> + <DCCReference Include="..\..\Source\Utils\GX_CheckButton.pas"/> <DCCReference Include="..\..\Source\ProjectOptionSets\GX_CheckListBoxWithHints.pas"/> <DCCReference Include="..\..\source\ClassBrowser\GX_ClassBrowser.pas"> <Form>fmClassBrowser</Form> Modified: branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.dfm =================================================================== --- branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.dfm 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.dfm 2024-08-14 20:53:09 UTC (rev 4293) @@ -112,7 +112,7 @@ end object eCustomBeep: TEdit Left = 22 - Top = 48 + Top = 52 Width = 395 Height = 22 Anchors = [akLeft, akTop, akRight] @@ -121,7 +121,7 @@ end object btnSelectFile: TButton Left = 423 - Top = 48 + Top = 52 Width = 75 Height = 22 Anchors = [akTop, akRight] Modified: branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas =================================================================== --- branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -132,6 +132,7 @@ SysUtils, MMSystem, GX_ProofreaderAutoCorrectEntry, GX_KibitzComp, GX_GxUtils, GX_GenericUtils, GX_OtaUtils, u_dzVclUtils, GX_ConfigurationInfo, + GX_IdeUtils, GX_GExperts; {$R *.dfm} @@ -152,6 +153,10 @@ Assert(Assigned(ProofreaderData)); FProofreaderData := ProofreaderData; + if IsThemingEnabled + then Pages.Style := tsButtons + else Pages.Style := tsTabs; + TabIndex := FProofreaderData.ActiveTab; if (TabIndex > -1) and (TabIndex < Pages.PageCount) then Pages.ActivePageIndex := TabIndex; Modified: branches/dark-mode/Source/Framework/GX_About.dfm =================================================================== --- branches/dark-mode/Source/Framework/GX_About.dfm 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/Framework/GX_About.dfm 2024-08-14 20:53:09 UTC (rev 4293) @@ -38,7 +38,7 @@ Left = 368 Top = 72 Width = 147 - Height = 20 + Height = 14 Alignment = taCenter Caption = 'http://www.gexperts.org/' end @@ -46,7 +46,7 @@ Left = 275 Top = 91 Width = 84 - Height = 20 + Height = 14 Alignment = taRightJustify Caption = 'Project Leader:' end @@ -54,7 +54,7 @@ Left = 255 Top = 112 Width = 104 - Height = 20 + Height = 14 Alignment = taRightJustify Caption = 'Major Contributors:' end @@ -62,7 +62,7 @@ Left = 368 Top = 91 Width = 85 - Height = 20 + Height = 14 Cursor = crHandPoint Caption = 'Thomas Mueller' OnClick = btnEmailClick @@ -71,7 +71,7 @@ Left = 304 Top = 72 Width = 55 - Height = 20 + Height = 14 Alignment = taRightJustify Caption = 'Web Site:' end @@ -177,7 +177,9 @@ 'Alex Petrov' 'Puthoon' 'Mahdi Safsafi' - 'Martin Waldenburg') + 'Martin Waldenburg' + 'Thomas M'#252'ller' + 'Achim Kalwa') ParentCtl3D = False ReadOnly = True ScrollBars = ssVertical Modified: branches/dark-mode/Source/Framework/GX_FeedbackWizard.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_FeedbackWizard.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/Framework/GX_FeedbackWizard.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -166,6 +166,10 @@ procedure TfmFeedbackWizard.Init(const ABugEmail, AFeatureEmail: string); begin + if IsThemingEnabled + then pgeMain.Style := tsButtons + else pgeMain.Style := tsTabs; + FBugEmail := ABugEmail; FFeatureEmail := AFeatureEmail; TLabel_MakeUrlLabel(l_BugReportUrl, FBugEmail, True); Modified: branches/dark-mode/Source/Framework/GX_GExperts.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_GExperts.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/Framework/GX_GExperts.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -96,6 +96,7 @@ procedure ShowGXAboutForm; begin + gblAboutFormClass.SetCustomBuildDetails('Dark mode'); gblAboutFormClass.Execute(nil); end; Modified: branches/dark-mode/Source/Grep/GX_GrepSearch.pas =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -812,7 +812,7 @@ TControl_SetConstraints(Self, [ccMinWidth, ccMinHeight, ccMaxHeight]); if not IsStandAlone then - InitTheming(Self); + InitTheming; FixComboBoxSelections(Self); end; Modified: branches/dark-mode/Source/ProjectDependencies/GX_ProjDepend.pas =================================================================== --- branches/dark-mode/Source/ProjectDependencies/GX_ProjDepend.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/ProjectDependencies/GX_ProjDepend.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -785,6 +785,10 @@ InitDpiScaler; + if IsThemingEnabled + then pcData.Style := tsButtons + else pcData.Style := tsTabs; + LoadSettings; ProjectNotifier := TProjectNotifier.Create(Self); Modified: branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm =================================================================== --- branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm 2024-08-14 20:53:09 UTC (rev 4293) @@ -4,7 +4,7 @@ ActiveControl = edtNewName BorderStyle = bsDialog Caption = 'GExperts Rename Component' - ClientHeight = 330 + ClientHeight = 350 ClientWidth = 321 Color = clBtnFace Font.Charset = ANSI_CHARSET @@ -36,9 +36,9 @@ end object p_Buttons: TPanel Left = 0 - Top = 99 + Top = 100 Width = 321 - Height = 231 + Height = 250 Align = alBottom TabOrder = 2 object lblReason: TLabel @@ -80,9 +80,9 @@ end object pc_Additional: TPageControl Left = 1 - Top = 53 + Top = 55 Width = 319 - Height = 177 + Height = 194 ActivePage = ts_Align Align = alBottom TabIndex = 0 @@ -90,9 +90,6 @@ OnChange = pc_AdditionalChange object ts_Align: TTabSheet Caption = '&Align' - DesignSize = ( - 311 - 148) object grp_Margins: TGroupBox Left = 176 Top = 0 @@ -274,9 +271,6 @@ object ts_Anchors: TTabSheet Caption = 'An&chors' ImageIndex = 1 - DesignSize = ( - 311 - 148) object b_AnchorLeft: TBitBtn Left = 80 Top = 46 Modified: branches/dark-mode/Source/RenameComponents/GX_CompRename.pas =================================================================== --- branches/dark-mode/Source/RenameComponents/GX_CompRename.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/RenameComponents/GX_CompRename.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -12,7 +12,8 @@ uses Classes, Controls, Forms, StdCtrls, ExtCtrls, ToolsAPI, ComCtrls, Buttons, - GX_Experts, GX_ConfigurationInfo, GX_EditorChangeServices, Contnrs, Messages, + GX_Experts, GX_ConfigurationInfo, GX_EditorChangeServices, GX_CheckButton, + Contnrs, Messages, Types, GX_BaseForm, u_dzSpeedBitBtn; type @@ -75,8 +76,8 @@ private FIsValidComponentName: TIsValidComponentName; FProperties: TObjectList; - FAnchorButtons: array[TAnchorKind] of TdzSpeedBitBtn; - FAlignButtons: array[TAlign] of TdzSpeedBitBtn; + FAnchorButtons: array[TAnchorKind] of TGXCheckButton; + FAlignButtons: array[TAlign] of TGXCheckButton; FComponentClassName: WideString; procedure InitializeForm; function GetNewName: WideString; @@ -83,7 +84,7 @@ function GetOldName: WideString; procedure SetNewName(const Value: WideString); procedure SetOldName(const Value: WideString); - procedure AddComponentProperty(PropertyName: WideString; const Value: WideString); + procedure AddComponentProperty(Index: Integer; PropertyName: WideString; const Value: WideString); function GetComponentProperty(Index: Integer): WideString; procedure SetComponent(const _Component: IOTAComponent); procedure SetAlign(const _Component: IOTAComponent); @@ -93,6 +94,8 @@ procedure HandleAlignButtons(_Align: TAlign); procedure SetMargins(_Value: integer); procedure DialogKey(var Msg: TWMKey); message CM_DIALOGKEY; + protected + procedure ArrangeControls; override; public constructor Create(Owner: TComponent); override; destructor Destroy; override; @@ -99,7 +102,6 @@ property OldName: WideString read GetOldName write SetOldName; property NewName: WideString read GetNewName write SetNewName; function Execute: TModalResult; - procedure FixTabOrder; procedure SetRuleSelection(SelStart, SelEnd: Integer); property OnIsValidComponentName: TIsValidComponentName read FIsValidComponentName write FIsValidComponentName; end; @@ -111,6 +113,7 @@ uses SysUtils, Windows, Menus, StrUtils, IniFiles, Graphics, TypInfo, u_dzClassUtils, u_dzVclUtils, u_dzStringUtils, + Themes, {$IFOPT D+}GX_DbugIntf, {$ENDIF} GX_CompRenameConfig, GX_OtaUtils, GX_GenericUtils, GX_IdeUtils; @@ -201,39 +204,14 @@ begin ActiveControl := edtNewName; // lblReason.Top := btnOK.Top + Round((btnOK.Height / 2) - (lblReason.Height / 2)); - FixTabOrder; Result := ShowModal; end; -procedure TfmCompRename.FixTabOrder; -var - i : Integer; - C : TWinControl; -begin - edtOldName.TabOrder := 0; - edtNewName.TabOrder := 1; - for i := 0 to FProperties.Count-1 do - begin - if FProperties[i] is TWinControl then begin - C := TWinControl(FProperties[i]); - TWinControl(C).TabOrder := 2 + i; - end; - end; - btnOK.TabOrder := FProperties.Count + 2; - btnCancel.TabOrder := FProperties.Count + 3; - btnSettings.TabOrder := FProperties.Count + 4; - pc_Additional.TabOrder := FProperties.Count + 5; -end; - procedure TfmCompRename.FormShow(Sender: TObject); begin inherited; // Adjust some button positons and size after scaling - // DisableAlign; - b_AlignRight.Left := b_AlignTop.Left + b_AlignTop.Width - b_AlignRight.Width; - b_AlignClient.Left := b_AlignLeft.Left + b_AlignLeft.Width + 1; - b_AlignClient.Width := b_AlignRight.Left - b_AlignClient.Left - 2; - // EnableAlign; +// ArrangeControls; end; function TfmCompRename.GetNewName: WideString; @@ -250,9 +228,9 @@ begin inherited; if pc_Additional.ActivePage = ts_Align then - TWinControl_SetFocus(b_AlignClient) + TWinControl_SetFocus(FAlignButtons[alClient]) else if pc_Additional.ActivePage = ts_Anchors then - TWinControl_SetFocus(b_AnchorTop); + TWinControl_SetFocus(FAnchorButtons[akTop]); end; procedure TfmCompRename.GetAlign(const _Component: IOTAComponent); @@ -431,7 +409,7 @@ edtNewName.SelLength := SelEnd - SelStart; end; -procedure TfmCompRename.AddComponentProperty(PropertyName: WideString; const Value: WideString); +procedure TfmCompRename.AddComponentProperty(Index: Integer; PropertyName: WideString; const Value: WideString); var Lbl: TLabel; Edit: TEdit; @@ -456,7 +434,7 @@ Edit.Left := edtNewName.Left; Edit.Width := edtNewName.Width; Edit.Text := Value; - Edit.TabOrder := FProperties.Count + 1 + edtNewName.TabOrder; + Edit.TabOrder := edtNewName.TabOrder + Index; FProperties.Add(Edit); if Edit.Text = SPropertyNotFound then begin @@ -467,7 +445,7 @@ end; diff := edtNewName.Top - edtOldName.Top; - Height := Height + diff; + ClientHeight := ClientHeight + diff; end; function TfmCompRename.GetComponentProperty(Index: Integer): WideString; @@ -484,19 +462,18 @@ TControl_SetMinConstraints(Self); FProperties := TObjectList.Create(False); + FAlignButtons[alTop] := TGXCheckButton.Clone(b_AlignTop); + FAlignButtons[alLeft] := TGXCheckButton.Clone(b_AlignLeft); + FAlignButtons[alClient] := TGXCheckButton.Clone(b_AlignClient); + FAlignButtons[alRight] := TGXCheckButton.Clone(b_AlignRight); + FAlignButtons[alBottom] := TGXCheckButton.Clone(b_AlignBottom); + FAlignButtons[alNone] := TGXCheckButton.Clone(b_AlignNone); + FAlignButtons[alCustom] := TGXCheckButton.Clone(b_AlignCustom); - FAlignButtons[alTop] := TdzSpeedBitBtn.Create(b_AlignTop); - FAlignButtons[alLeft] := TdzSpeedBitBtn.Create(b_AlignLeft); - FAlignButtons[alClient] := TdzSpeedBitBtn.Create(b_AlignClient); - FAlignButtons[alRight] := TdzSpeedBitBtn.Create(b_AlignRight); - FAlignButtons[alBottom] := TdzSpeedBitBtn.Create(b_AlignBottom); - FAlignButtons[alNone] := TdzSpeedBitBtn.Create(b_AlignNone); - FAlignButtons[alCustom] := TdzSpeedBitBtn.Create(b_AlignCustom); - - FAnchorButtons[akTop] := TdzSpeedBitBtn.Create(b_AnchorTop); - FAnchorButtons[akLeft] := TdzSpeedBitBtn.Create(b_AnchorLeft); - FAnchorButtons[akRight] := TdzSpeedBitBtn.Create(b_AnchorRight); - FAnchorButtons[akBottom] := TdzSpeedBitBtn.Create(b_AnchorBottom); + FAnchorButtons[akTop] := TGXCheckButton.Clone(b_AnchorTop); + FAnchorButtons[akLeft] := TGXCheckButton.Clone(b_AnchorLeft); + FAnchorButtons[akRight] := TGXCheckButton.Clone(b_AnchorRight); + FAnchorButtons[akBottom] := TGXCheckButton.Clone(b_AnchorBottom); p_Buttons.BevelOuter := bvNone; InitializeForm; @@ -513,44 +490,63 @@ // make the selection of alignment and anchors via arrow keys more intuitive case Msg.CharCode of VK_DOWN: begin - if ActiveControl = b_AlignTop then - b_AlignClient.SetFocus - else if (ActiveControl = b_AlignClient) or (ActiveControl = b_AlignLeft) or (ActiveControl = b_AlignRight) then - b_AlignBottom.SetFocus - else if (ActiveControl = b_AnchorTop) or (ActiveControl = b_AnchorLeft) or (ActiveControl = b_AnchorRight) then - b_AnchorBottom.SetFocus + if ActiveControl = FAlignButtons[alTop] then + FAlignButtons[alClient].SetFocus + else if (ActiveControl = FAlignButtons[alClient]) + or (ActiveControl = FAlignButtons[alLeft]) + or (ActiveControl = FAlignButtons[alRight]) + then + FAlignButtons[alBottom].SetFocus + else if (ActiveControl = FAnchorButtons[akTop]) + or (ActiveControl = FAnchorButtons[akLeft]) + or (ActiveControl = FAnchorButtons[akRight]) + then + FAnchorButtons[akBottom].SetFocus else inherited; end; VK_UP: begin - if ActiveControl = b_AlignBottom then - b_AlignClient.SetFocus - else if (ActiveControl = b_AlignClient) or (ActiveControl = b_AlignLeft) or (ActiveControl = b_AlignRight) then - b_AlignTop.SetFocus - else if (ActiveControl = b_AlignNone) or (ActiveControl = b_AlignCustom)then - b_AlignBottom.SetFocus - else if (ActiveControl = b_AnchorBottom) or (ActiveControl = b_AnchorLeft) or (ActiveControl = b_AnchorRight) then - b_AnchorTop.SetFocus + if ActiveControl = FAlignButtons[alBottom] then + FAlignButtons[alClient].SetFocus + else if (ActiveControl = FAlignButtons[alClient]) + or (ActiveControl = FAlignButtons[alLeft]) + or (ActiveControl = FAlignButtons[alRight]) + then + FAlignButtons[alTop].SetFocus + else if (ActiveControl = FAlignButtons[alNone]) + or (ActiveControl = FAlignButtons[alCustom]) + then + FAlignButtons[alBottom].SetFocus + else if (ActiveControl = FAnchorButtons[akBottom]) + or (ActiveControl = FAnchorButtons[akLeft]) + or (ActiveControl = FAnchorButtons[akRight]) + then + FAnchorButtons[akTop].SetFocus else inherited; end; VK_RIGHT: begin - if ActiveControl = b_AlignLeft then - b_AlignClient.SetFocus - else if ActiveControl = b_AlignClient then - b_AlignRight.SetFocus - else if (ActiveControl = b_AnchorTop) or (ActiveControl = b_AnchorBottom) or (ActiveControl = b_AnchorLeft) then - b_AnchorRight.SetFocus + if ActiveControl = FAlignButtons[alLeft] then + FAlignButtons[alClient].SetFocus + else if ActiveControl = FAlignButtons[alClient] then + FAlignButtons[alRight].SetFocus + else if (ActiveControl = FAnchorButtons[akTop]) + or (ActiveControl = FAnchorButtons[akBottom]) + or (ActiveControl = FAnchorButtons[akLeft]) + then + FAnchorButtons[akRight].SetFocus else inherited; end; VK_LEFT: begin - if ActiveControl = b_AlignRight then - b_AlignClient.SetFocus - else if ActiveControl = b_AlignClient then - b_AlignLeft.SetFocus - else if (ActiveControl = b_AnchorTop) or (ActiveControl = b_AnchorBottom) or (ActiveControl = b_AnchorRight) then - b_AnchorLeft.SetFocus + if ActiveControl = FAlignButtons[alRight] then + FAlignButtons[alClient].SetFocus + else if ActiveControl = FAlignButtons[alClient] then + FAlignButtons[alLeft].SetFocus + else if (ActiveControl = FAnchorButtons[akTop]) + or (ActiveControl = FAnchorButtons[akBottom]) + or (ActiveControl = FAnchorButtons[akRight]) then + FAnchorButtons[akLeft].SetFocus else inherited; end; @@ -915,13 +911,13 @@ end; end; if UsePropValue then - frm.AddComponentProperty(PropName, PropValue) + frm.AddComponentProperty(i, PropName, PropValue) else - frm.AddComponentProperty(PropName, + frm.AddComponentProperty(i, PropName, GxOtaGetComponentPropertyAsString(Component, PropName, True)); end else - frm.AddComponentProperty(PropName, SPropertyNotFound); + frm.AddComponentProperty(i, PropName, SPropertyNotFound); end; end end @@ -1302,8 +1298,53 @@ begin SetModalFormPopupMode(Self); lblReason.Font.Color := clRed; + if IsThemingEnabled + then pc_Additional.Style := tsButtons + else pc_Additional.Style := tsTabs; end; +procedure TfmCompRename.ArrangeControls; +var + Spacer : Integer; + H, W : Integer; +begin + inherited; + Spacer := FScaler.Calc(2); + FAlignButtons[alTop].Anchors := [akLeft, akTop]; + + FAlignButtons[alLeft].Anchors := [akLeft, akTop]; + FAlignButtons[alLeft].Left := FAlignButtons[alTop].Left; + FAlignButtons[alLeft].Top := FAlignButtons[alTop].Height + Spacer; + + W := FAlignButtons[alTop].Width - (2 * FAlignButtons[alLeft].Width) - (2 * Spacer); + H := FAlignButtons[alLeft].Height; + + FAlignButtons[alClient].Anchors := [akLeft, akTop]; + FAlignButtons[alClient].Top := FAlignButtons[alLeft].Top; + FAlignButtons[alClient].Width := W; + FAlignButtons[alClient].Left := FAlignButtons[alLeft].Left + FAlignButtons[alLeft].Width + Spacer; + FAlignButtons[alClient].Height := H; + + FAlignButtons[alRight].Anchors := [akLeft, akTop]; + FAlignButtons[alRight].Left := FAlignButtons[alClient].Left + FAlignButtons[alClient].Width + Spacer; + FAlignButtons[alRight].Top := FAlignButtons[alLeft].Top; + FAlignButtons[alRight].Width := FAlignButtons[alLeft].Width; + + FAlignButtons[alBottom].Anchors := [akLeft, akTop]; + FAlignButtons[alBottom].Top := FAlignButtons[alClient].Top + FAlignButtons[alClient].Height + Spacer; + FAlignButtons[alBottom].Left := FAlignButtons[alTop].Left; + FAlignButtons[alBottom].Width := FAlignButtons[alTop].Width; + + FAlignButtons[alNone].Anchors := [akLeft, akTop]; + FAlignButtons[alNone].Left := FAlignButtons[alLeft].Left; + FAlignButtons[alNone].Top := FAlignButtons[alBottom].Top + FAlignButtons[alBottom].Height + (2 * Spacer); + + FAlignButtons[alCustom].Anchors := [akLeft, akTop]; + FAlignButtons[alCustom].Top := FAlignButtons[alNone].Top; + FAlignButtons[alCustom].Width := FAlignButtons[alNone].Width; + FAlignButtons[alCustom].Left := FAlignButtons[alTop].Left + FAlignButtons[alTop].Width - FAlignButtons[alCustom].Width; +end; + procedure TfmCompRename.btnSettingsClick(Sender: TObject); begin Assert(Assigned(PrivateCompRenameExpert)); Modified: branches/dark-mode/Source/UsesExpert/GX_UsesExpert.dfm =================================================================== --- branches/dark-mode/Source/UsesExpert/GX_UsesExpert.dfm 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/UsesExpert/GX_UsesExpert.dfm 2024-08-14 20:53:09 UTC (rev 4293) @@ -45,7 +45,7 @@ ImageIndex = 3 object pnlSearchPathFooter: TPanel Left = 0 - Top = 296 + Top = 295 Width = 654 Height = 48 Align = alBottom @@ -88,7 +88,7 @@ Left = 0 Top = 0 Width = 654 - Height = 296 + Height = 295 Align = alClient BevelOuter = bvNone BorderWidth = 3 @@ -98,7 +98,7 @@ Left = 3 Top = 3 Width = 648 - Height = 290 + Height = 289 Align = alClient ColCount = 1 DefaultColWidth = 100 @@ -125,7 +125,7 @@ Left = 0 Top = 0 Width = 654 - Height = 296 + Height = 295 Align = alClient BevelOuter = bvNone BorderWidth = 3 @@ -135,7 +135,7 @@ Left = 3 Top = 3 Width = 648 - Height = 257 + Height = 256 Align = alClient ColCount = 1 DefaultColWidth = 100 @@ -155,7 +155,7 @@ end object p_NoMapFile: TPanel Left = 3 - Top = 260 + Top = 259 Width = 648 Height = 33 Align = alBottom @@ -178,7 +178,7 @@ WordWrap = True end object b_NoMapFileClose: TButton - Left = 619 + Left = 611 Top = 0 Width = 25 Height = 33 @@ -191,7 +191,7 @@ end object pnlProjFooter: TPanel Left = 0 - Top = 297 + Top = 295 Width = 654 Height = 48 Align = alBottom @@ -265,7 +265,7 @@ Left = 0 Top = 0 Width = 654 - Height = 296 + Height = 295 Align = alClient BevelOuter = bvNone BorderWidth = 3 @@ -275,7 +275,7 @@ Left = 3 Top = 3 Width = 648 - Height = 290 + Height = 289 Align = alClient ColCount = 1 DefaultColWidth = 100 @@ -296,7 +296,7 @@ end object pnlCommonFooter: TPanel Left = 0 - Top = 296 + Top = 295 Width = 654 Height = 48 Align = alBottom @@ -342,8 +342,8 @@ object pnlFavorite: TPanel Left = 0 Top = 0 - Width = 656 - Height = 304 + Width = 654 + Height = 295 Align = alClient BevelOuter = bvNone BorderWidth = 3 @@ -352,8 +352,8 @@ object sg_Favorite: TStringGrid Left = 3 Top = 3 - Width = 650 - Height = 298 + Width = 648 + Height = 289 Align = alClient ColCount = 1 DefaultColWidth = 100 @@ -374,8 +374,8 @@ end object pnlFavFooter: TPanel Left = 0 - Top = 304 - Width = 656 + Top = 295 + Width = 654 Height = 48 Align = alBottom BevelOuter = bvNone @@ -429,7 +429,7 @@ Left = 0 Top = 0 Width = 654 - Height = 296 + Height = 295 Align = alClient BevelOuter = bvNone BorderWidth = 3 @@ -439,7 +439,7 @@ Left = 3 Top = 3 Width = 648 - Height = 290 + Height = 289 Align = alClient ColCount = 2 DefaultColWidth = 150 @@ -457,7 +457,7 @@ end object pnlIdentifiersFooter: TPanel Left = 0 - Top = 296 + Top = 295 Width = 654 Height = 48 Align = alBottom @@ -534,29 +534,29 @@ object lblIdentifiers: TLabel Left = 16 Top = 88 - Width = 104 - Height = 13 + Width = 110 + Height = 15 Caption = 'Identifiers found: %d' end object lblUnitsParsed: TLabel Left = 16 Top = 40 - Width = 84 - Height = 13 + Width = 88 + Height = 15 Caption = 'Units parsed: %d' end object lblUnitsLoaded: TLabel Left = 16 Top = 64 - Width = 83 - Height = 13 + Width = 89 + Height = 15 Caption = 'Units loaded: %d' end object lblUnitsFound: TLabel Left = 16 Top = 16 - Width = 79 - Height = 13 + Width = 85 + Height = 15 Caption = 'Units found: %d' end end @@ -579,7 +579,7 @@ Left = 200 Top = 16 Width = 462 - Height = 22 + Height = 23 Anchors = [akLeft, akTop, akRight] TabOrder = 1 OnChange = edtUnitFilterChange @@ -600,8 +600,8 @@ object lblFilter: TLabel Left = 1 Top = 0 - Width = 24 - Height = 13 + Width = 26 + Height = 15 Caption = 'Filte&r' FocusControl = edtUnitFilter end @@ -610,7 +610,7 @@ Left = 0 Top = 16 Width = 421 - Height = 22 + Height = 23 Anchors = [akLeft, akTop, akRight] TabOrder = 2 Visible = False @@ -636,7 +636,7 @@ Left = 6 Top = 21 Width = 159 - Height = 363 + Height = 358 Align = alLeft BevelOuter = bvNone TabOrder = 2 @@ -645,7 +645,7 @@ Left = 0 Top = 0 Width = 159 - Height = 15 + Height = 18 Align = alTop BevelOuter = bvNone Caption = 'I&nterface' @@ -654,9 +654,9 @@ end object sg_Interface: TStringGrid Left = 0 - Top = 15 + Top = 18 Width = 159 - Height = 348 + Height = 340 Align = alClient ColCount = 1 DefaultColWidth = 100 @@ -678,7 +678,7 @@ Left = 165 Top = 21 Width = 158 - Height = 363 + Height = 358 Align = alClient BevelOuter = bvNone TabOrder = 3 @@ -685,9 +685,9 @@ OnResize = pcUsesResize object lblDprWarning: TLabel Left = 0 - Top = 288 + Top = 289 Width = 158 - Height = 75 + Height = 69 Align = alBottom AutoSize = False Caption = @@ -706,7 +706,7 @@ Left = 0 Top = 0 Width = 158 - Height = 15 + Height = 18 Align = alTop BevelOuter = bvNone Caption = 'I&mplementation' @@ -715,9 +715,9 @@ end object sg_Implementation: TStringGrid Left = 0 - Top = 15 + Top = 18 Width = 158 - Height = 273 + Height = 271 Align = alClient ColCount = 1 DefaultColWidth = 100 @@ -748,9 +748,9 @@ end object pnlUsesBottom: TPanel Left = 6 - Top = 384 + Top = 379 Width = 317 - Height = 44 + Height = 41 Align = alBottom BevelOuter = bvNone TabOrder = 1 @@ -757,7 +757,7 @@ OnResize = pnlUsesBottomResize object b_DeleteFromIntf: TButton Left = 0 - Top = 12 + Top = 9 Width = 73 Height = 25 Action = actIntfDelete @@ -767,7 +767,7 @@ end object b_DeleteFromImpl: TButton Left = 240 - Top = 12 + Top = 9 Width = 73 Height = 25 Action = actImplDelete @@ -777,7 +777,7 @@ end object b_MoveToImpl: TButton Left = 80 - Top = 12 + Top = 9 Width = 73 Height = 25 Action = actIntfMove @@ -787,7 +787,7 @@ end object b_MoveToIntf: TButton Left = 160 - Top = 12 + Top = 9 Width = 73 Height = 25 Action = actImplMove @@ -1185,7 +1185,7 @@ Left = 600 Top = 240 Bitmap = { - 494C010109003800080010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010109003800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000003000000001002000000000000030 000000000000000000000000000000000000D1B08E00C69E7400000000FF0000 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 Modified: branches/dark-mode/Source/UsesExpert/GX_UsesExpert.pas =================================================================== --- branches/dark-mode/Source/UsesExpert/GX_UsesExpert.pas 2024-08-10 16:21:38 UTC (rev 4292) +++ branches/dark-mode/Source/UsesExpert/GX_UsesExpert.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -13,11 +13,9 @@ uses Windows, SysUtils, Classes, Controls, Forms, Menus, ComCtrls, Buttons, ImgList, ImageList, - ExtCtrls, ActnList, Actions, Dialogs, StdCtrls, Grids, Types, -{$IFDEF GX_SUPPORTS_THEMING} - Themes, -{$ENDIF} - u_dzSpeedBitBtn, u_dzStopwatch, + ExtCtrls, ActnList, Actions, Dialogs, StdCtrls, Grids, Types, Themes, + GX_CheckButton, + u_dzStopwatch, u_dzDpiScaleUtils, GX_ConfigurationInfo, GX_Experts, GX_GenericUtils, GX_BaseForm, GX_UnitExportsParser, GX_UsesExpertOptions, GX_UnitExportList, @@ -315,7 +313,7 @@ FOldToNewUnitNameMap: TStringList; FCaption_lblFilter: string; FForceFocusToIdentifierFilter: Boolean; - FIdentifierMatchGrp: TdzSpeedBitBtnGroup; + FIdentifierMatchGrp: TGXCheckButtonGroup; FSelectedUnitLineNo: Integer; FSelectedUnitFn: string; FDefaultToInterfaceList: Boolean; @@ -371,6 +369,12 @@ procedure FinalizeForm; procedure SetSelectedFile(const _fn: string; _LineNo: Integer = -1); procedure UpdateDefaultButton; + + private + ckbIdentifierMatchStart : TGXCheckButton; + ckbIdentifierMatchAnywhere : TGXCheckButton; + ckbIdentifierMatchSort : TGXCheckButton; + protected FProjectUnits: TStringList; FCommonUnits: TStringList; @@ -900,34 +904,18 @@ pnlUnits.DoubleBuffered := True; pnlUses.DoubleBuffered := True; - FIdentifierMatchGrp := TdzSpeedBitBtnGroup.Create; -{$IFDEF SUPPORTS_THEMING} - // consider using a RadioGroup, or TSpeedButtons... - if IsThemingEnabled then - begin - FIdentifierMatchGrp.ColorText := ColorToRGB(GetThemedColor(clWindowText)); - // if FIdentifierMatchGrp.ColorText >= $800000 then - if IdeStyleIsDark then - begin - // dark background - FIdentifierMatchGrp.ColorRaised := GxOtaGetStyleColor(scButtonNormal, clBtnFace); - FIdentifierMatchGrp.ColorSunken := GxOtaGetStyleColor(scButtonPressed, clAppWorkSpace); - end - else begin - // light background - FIdentifierMatchGrp.ColorRaised := GetThemedColor(clBtnFace); - FIdentifierMatchGrp.ColorSunken := FIdentifierMatchGrp.ColorRaised + $00070707; // lighter - end; - end; -{$ENDIF} + FIdentifierMatchGrp := TGXCheckButtonGroup.Create(Self); FIdentifierMatchGrp.AllowAllUp := False; - FIdentifierMatchGrp.Add(b_IdentifierMatchStart, Ord(fieStartOnly)); - FIdentifierMatchGrp.Add(b_IdentifierMatchAnywhere, Ord(fieAnywhere)); - FIdentifierMatchGrp.Add(b_IdentifierMatchSort, Ord(fieStartFirst)); - // this only works if the order the buttons are added is the same as the order of the enums + ckbIdentifierMatchStart := FIdentifierMatchGrp.Add(b_IdentifierMatchStart, Ord(fieStartOnly)); + ckbIdentifierMatchAnywhere := FIdentifierMatchGrp.Add(b_IdentifierMatchAnywhere, Ord(fieAnywhere)); + ckbIdentifierMatchSort := FIdentifierMatchGrp.Add(b_IdentifierMatchSort, Ord(fieStartFirst)); FIdentifierMatchGrp.SetDown(Ord(FUsesExpert.FFilterIdentifiers)); FIdentifierMatchGrp.OnClick := sb_MatchWhereClick; + FIdentifierMatchGrp.AllowAllUp := False; + // this only works if the order the buttons are added is the same as the order of the enums + FIdentifierMatchGrp.SetDown(Ord(FUsesExpert.FFilterIdentifiers)); + chk_FastAdd.Checked := _UsesExpert.FFastAdd; FLeftRatio := pnlUses.Width / ClientWidth; @@ -1131,6 +1119,14 @@ FSearchPathUnits := TStringList.Create; sg_SearchPath.AssociatedList := FSearchPathUnits; + sg_Interface.Color := GetThemedColor(clWindow); + sg_Implementation.Color := GetThemedColor(clWindow); + sg_Project.Color := GetThemedColor(clWindow); + sg_Common.Color := GetThemedColor(clWindow); + sg_Favorite.Color := GetThemedColor(clWindow); + sg_SearchPath.Color := GetThemedColor(clWindow); + sg_Identifiers.Color := GetThemedColor(clWindow); + FIdentifiers := TUnitExportlist.Create(0); FAliases := TStringList.Create; FOldToNewUnitNameMap := TStringList.Create; @@ -1155,6 +1151,10 @@ SendDebug('Started SearchPath FindThread'); {$ENDIF D+} + if IsThemingEnabled + then pcUnits.Style := tsButtons + else pcUnits.Style := tsTabs; + pcUnits.ActivePage := tabSearchPath; GxOtaGetUnitAliases(FAliases); @@ -1675,16 +1675,18 @@ {$IFDEF GX_IDE_IS_HIDPI_AWARE} procedure TfmUsesManager.ApplyDpi(_NewDpi: Integer; _NewBounds: PRect); - procedure AdjustTop(_ctrl: TControl); + procedure AdjustTop(_Ctrl: TControl); begin // todo: Is this still necessary? - _Ctrl.Top := MulDiv(_Ctrl.Top, _NewDPI, FOldDPI); + if Assigned(_Ctrl) then + _Ctrl.Top := MulDiv(_Ctrl.Top, _NewDPI, FOldDPI); end; - procedure AdjustHeight(_ctrl: TControl); + procedure AdjustHeight(_Ctrl: TControl); begin // todo: Is this still necessary? - _Ctrl.Height := MulDiv(_Ctrl.Height, _NewDPI, FOldDPI); + if Assigned(_Ctrl) then + _Ctrl.Height := MulDiv(_Ctrl.Height, _NewDPI, FOldDPI); end; procedure ArrangeButtonsInGroup(const _Buttons: array of TWinControl; _grp: TGroupBox); @@ -1695,6 +1697,8 @@ begin Assert(Length(_Buttons) > 1); btn := _Buttons[0]; + if not Assigned(btn) then Exit; + Offset := _grp.ClientHeight - btn.Top - btn.Height; for i := 0 to Length(_Buttons) - 1 do AdjustTop(_Buttons[i]); @@ -2320,11 +2324,11 @@ TWinControl_Lock(pnlIdentifiers); Filter := Trim(edtIdentifierFilter.Text); + if not Assigned(FIdentifierMatchGrp) then Exit; if FIdentifierMatchGrp.TryGetSelected(Idx) then - FilterType := TFilterIdentifiersEnum(Idx) + FilterType := TFilterIdentifiersEnum(FIdentifierMatchGrp.GetButtonData(Idx)) else FilterType := FUsesExpert.FFilterIdentifiers; - FilterList := TList.Create; try MultiFilter := TStringList.Create; Added: branches/dark-mode/Source/Utils/GX_CheckButton.pas =================================================================== --- branches/dark-mode/Source/Utils/GX_CheckButton.pas (rev 0) +++ branches/dark-mode/Source/Utils/GX_CheckButton.pas 2024-08-14 20:53:09 UTC (rev 4293) @@ -0,0 +1,361 @@ +unit GX_CheckButton; + +interface + +uses + Classes, + Controls, + StdCtrls, + Themes; + +type + TGXCheckButton = class(TCustomCheckBox) + private + FSavedOnClick: TNotifyEvent; + FData: Pointer; + class constructor Create; + class destructor Destroy; + function GetDownState: Boolean; + procedure SetDownState(const Value: Boolean); + protected + procedure CreateParams(var Params: TCreateParams); override; + public + property Caption; + property Data: Pointer read FData write FData; + property Down: Boolean read GetDownState write SetDownState; + property SavedOnClick: TNotifyEvent read FSavedOnClick write FSavedOnClick; + constructor Clone(var AControl); + end; + + TGXCheckButtonGroup = class(TComponent) + private + FButtonList : TList; + FAllowAllUp : Boolean; + FOnClick : TNotifyEvent; + protected + procedure AnyButtonClicked(Sender: TObject); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + property OnClick: TNotifyEvent read FOnClick write FOnClick; + property AllowAllUp: Boolean read FAllowAllUp write FAllowAllUp; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Add(var AControl): TGXCheckButton; overload; + function Add(var AControl; AData: Integer): TGXCheckButton; overload; + function Add(var AControl; AData: Pointer): TGXCheckButton; overload; + function GetButtonData(ndx: Integer): Pointer; + function IsDown(ndx: Integer): Boolean; overload; + function IsDown(ABtn: TGXCheckButton): Boolean; overload; + function TryGetSelected(var Index: Integer): Boolean; + procedure SetButtonState(ndx: Integer; ADown: Boolean); overload; + procedure SetButtonState(ABtn: TGXCheckButton; ADown: Boolean); overload; + procedure SetDown(AData: Integer); + end; + +implementation + +uses + Types, + Windows, + SysUtils, + Graphics; + +type + TGXCheckButtonStyleHook = class(TButtonStyleHook) + protected + procedure DrawButton(ACanvas: TCanvas; AMouseInControl: Boolean); override; + end; + +{ TGXCheckButtonStyleHook } + +procedure TGXCheckButtonStyleHook.DrawButton(ACanvas: TCanvas; AMouseInControl: Boolean); +var + LStyle : TCustomStyleServices; + Details : TThemedElementDetails; + LControl: TGXCheckButton; + R : TRect; +begin + LStyle := StyleServices; + if not LStyle.Available then + begin + inherited; + Exit; + end; + + if Control is TGXCheckButton then + begin + LControl := TGXCheckButton(Control); + if LControl.Checked + then Details := LStyle.GetElementDetails(tbPushButtonPressed) + else Details := LStyle.GetElementDetails(tbPushButtonNormal); + + R := LControl.ClientRect; + LStyle.DrawElement(ACanvas.Handle, Details, R, nil); + LStyle.DrawText(ACanvas.Handle, Details, LControl.Caption, R, [tfCenter, tfVerticalCenter]); + if Focused then + begin + R.Inflate(-2, -2); + DrawFocusRect(ACanvas.Handle, R); + end; + end; +end; + +{ TGXCheckButton } + +type + TWinControlAccess = class(TWinControl); + +class constructor TGXCheckButton.Create; +begin + TCustomStyleEngine.UnRegisterStyleHook(TGXCheckButton, TCheckBoxStyleHook); + TCustomStyleEngine.RegisterStyleHook(TGXCheckButton, TGXCheckButtonStyleHook); +end; + +class destructor TGXCheckButton.Destroy; +begin + TCustomStyleEngine.UnRegisterStyleHook(TGXCheckButton, TGXCheckButtonStyleHook); +end; + +constructor TGXCheckButton.Clone(var AControl); +var + ASource: TWinControl; +begin + if not (TObject(Pointer(AControl)) is TWinControl) then + raise EComponentError.Create('Invalid source control'); + + FSavedOnClick := nil; + ASource := TWinControl(AControl); + + Create(ASource.Owner); + Parent := ASource.Parent; + BoundsRect := ASource.BoundsRect; + Anchors := ASource.Anchors; + Margins := ASource.Margins; + AlignWithMargins := ASource.AlignWithMargins; + Caption := TWinControlAccess(ASource).Caption; + Enabled := ASource.Enabled; + Visible := ASource.Visible; + TabStop := ASource.TabStop; + TabOrder := ASource.TabOrder; + Name := ASource.Name + '_GX'; + OnClick := TWinControlAccess(ASource).OnClick; + + FreeAndNil(ASource); + Pointer(AControl) := nil; +end; + +function TGXCheckButton.GetDownState: Boolean; +begin + Result := Checked; +end; + +procedure TGXCheckButton.SetDownState(const Value: Boolean); +var + SavedClicksDisabled : Boolean; +begin + SavedClicksDisabled := ClicksDisabled; + ClicksDisabled := True; + + SetChecked(Value); + + ClicksDisabled := SavedClicksDisabled; +end; + +procedure TGXCheckButton.CreateParams(var Params: TCreateParams); +// Make the checkbox look like a button. +begin + inherited; + Params.Style := Params.Style + BS_PUSHLIKE; +end; + +{ TGXCheckButtonGroup } + +procedure TGXCheckButtonGroup.AnyButtonClicked(Sender: TObject); +var + AButton : TGXCheckButton; + LButton : TGXCheckButton; + i : Integer; +begin + if Sender is TGXCheckButton then + begin + AButton := TGXCheckButton(Sender); + + // set all other button to "up" + for i := 0 to FButtonList.Count-1 do + begin + LButton := TGXCheckButton(FButtonList.Items[i]); + if LButton <> AButton then + begin + LButton.Down := False; + end; + end; + if (not AButton.Down) and (not FAllowAllUp) then + begin + AButton.Down := True; + end; + + if AButton.Down then + begin + if Assigned(AButton.FSavedOnClick) then + AButton.FSavedOnClick(AButton) + else + if Assigned(FOnClick) then + FOnClick(AButton); + end; + end; // if Sender is TGXCheckButton +end; + +constructor TGXCheckButtonGroup.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FButtonList := TList.Create; + FAllowAllUp := True; +end; + +destructor TGXCheckButtonGroup.Destroy; +begin + FButtonList.Free; + inherited; +end; + +function TGXCheckButtonGroup.GetButtonData(ndx: Integer): Pointer; +begin + Result := nil; + if ndx >= 0 then + Result := TGXCheckButton(FButtonList.Items[ndx]).Data; +end; + +function TGXCheckButtonGroup.IsDown(ndx: Integer): Boolean; +var + LButton : TGXCheckButton; +begin + LButton := TGXCheckButton(FButtonList[ndx]); + Result := LButton.Down; +end; + +function TGXCheckButtonGroup.IsDown(ABtn: TGXCheckButton): Boolean; +var + ndx : Integer; +begin + Result := False; + ndx := FButtonList.IndexOf(ABtn); + if ndx >= 0 then + Result := ABtn.Down; +end; + +procedure TGXCheckButtonGroup.Notification(AComponent: TComponent; Operation: TOperation); +var + ndx : Integer; +begin + if (AComponent is TGXCheckButton) and (Operation = opRemove) then + begin + ndx := FButtonList.IndexOf(AComponent); + if ndx >= 0 then + begin + FButtonList.Items[ndx] := nil; + FButtonList.Delete(ndx); + end; + end; + inherited; +end; + +procedure TGXCheckButtonGroup.SetButtonState(ndx: Integer; ADown: Boolean); +var + LButton : TGXCheckButton; + i : Integer; +begin + LButton := TGXCheckButton(FButtonList.Items[ndx]); + if Assigned(LButton) then + begin + if ADown then + begin + for i := 0 to FButtonList.Count-1 do + TGXCheckButton(FButtonList.Items[i]).Down := False; + TGXCheckButton(FButtonList.Items[ndx]).Down := True; + end + else begin + for i := 0 to FButtonList.Count-1 do + TGXCheckButton(FButtonList.Items[i]).Down := False; + if FAllowAllUp then + TGXCheckButton(FButtonList.Items[ndx]).Down := True + else + TGXCheckButton(FButtonList.Items[ndx]).Down := True; + end; + LButton.Down := ADown; + end; +end; + +procedure TGXCheckButtonGroup.SetButtonState(ABtn: TGXCheckButton; ADown: Boolean); +var + ndx : Integer; +begin + ndx := FButtonList.IndexOf(ABtn); + if ndx >= 0 then + SetButtonState(ndx, ADown); +end; + +procedure TGXCheckButtonGroup.SetDown(AData: Integer); +var + i : Integer; + LButton : TGXCheckButton; +begin + for i := 0 to FButtonList.Count-1 do + begin + LButton := TGXCheckButton(FButtonList.Items[i]); + if LButton.Data = Pointer(AData) then + LButton.Down := True + else + LButton.Down := False; + end; +end; + +function TGXCheckButtonGroup.TryGetSelected(var Index: Integer): Boolean; +var + i : Integer; + LButton : TGXCheckButton; +begin + Result := False; + for i := 0 to FButtonList.Count-1 do + begin + LButton := TGXCheckButton(FButtonList.Items[i]); + if LButton.Down then + begin + Index := i; + Result := True; + Break; + end; + end; +end { TryGetSelected }; + +function TGXCheckButtonGroup.Add(var AControl; AData: Pointer): TGXCheckButton; +var + ASource : TWinControl; + AButton : TGXCheckButton; + LOnClick: TNotifyEvent; +begin + if not (TObject(Pointer(AControl)) is TWinControl) then + raise EComponentError.Create('Invalid source control'); + + ASource := TWinControl(AControl); + LOnClick := TWinControlAccess(ASource).OnClick; + + AButton := TGXCheckButton.Clone(ASource); + AButton.Data := AData; + AButton.SavedOnClick := LOnClick; + AButton.OnClick := Self.AnyButtonClicked; + + FButtonList.Add(AButton); + Result := AButton; +end; + +function TGXCheckButtonGroup.Add(var AControl; AData: Integer): TGXCheckButton; +begin + Result := Add(AControl, Pointer(AData)); +end; + +function TGXCheckButtonGroup.Add(var AControl): TGXCheckButton; +begin + Result := Add(AControl, nil); +end; + +end. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-08-10 16:21:41
|
Revision: 4292 http://sourceforge.net/p/gexperts/code/4292 Author: akalwahome Date: 2024-08-10 16:21:38 +0000 (Sat, 10 Aug 2024) Log Message: ----------- Merged revision(s) from trunk: Modified Paths: -------------- branches/dark-mode/ExternalSource/dzlib/dzlib.inc branches/dark-mode/ExternalSource/dzlib/u_dzConvertUtils.pas branches/dark-mode/ExternalSource/dzlib/u_dzFileStreams.pas branches/dark-mode/ExternalSource/dzlib/u_dzFileUtils.pas branches/dark-mode/ExternalSource/dzlib/u_dzGraphicsUtils.pas branches/dark-mode/ExternalSource/dzlib/u_dzNullableTimespan.pas branches/dark-mode/ExternalSource/dzlib/u_dzTypInfo.pas branches/dark-mode/ExternalSource/dzlib/u_dzTypes.pas branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas branches/dark-mode/Source/Editor/GX_eAlign.pas branches/dark-mode/Source/Editor/GX_eDate.dfm Added Paths: ----------- branches/dark-mode/ExternalSource/dzlib/u_dzTypeInfoUtils.pas Property Changed: ---------------- branches/dark-mode/ Index: branches/dark-mode =================================================================== --- branches/dark-mode 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode 2024-08-10 16:21:38 UTC (rev 4292) Property changes on: branches/dark-mode ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4085-4282 \ No newline at end of property +/trunk:4085-4291 \ No newline at end of property Modified: branches/dark-mode/ExternalSource/dzlib/dzlib.inc =================================================================== --- branches/dark-mode/ExternalSource/dzlib/dzlib.inc 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/dzlib.inc 2024-08-10 16:21:38 UTC (rev 4292) @@ -25,6 +25,7 @@ {$DEFINE SUPPORTS_DEPRECATED_TYPES} {$DEFINE HAS_UNIT_WIDESTRINGS} {$DEFINE OPENDIALOG_EXCUTE_HAS_HANDLE} + {$DEFINE ENUM_NAMES_ARE_UTF8} {$ENDIF} {$IFDEF DELPHI2006_UP} @@ -55,6 +56,7 @@ // THandleStream.FHandle is declared as THandle (before that it's an Integer) {$DEFINE THANDLESTREAM_HANDLE_IS_THANDLE} {$DEFINE HAS_TOBJECT_TOSTRING} + {$DEFINE HAS_UTF8TOWIDESTRING} {$ENDIF} {$IFDEF DELPHI2010_UP} Modified: branches/dark-mode/ExternalSource/dzlib/u_dzConvertUtils.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzConvertUtils.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzConvertUtils.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -47,7 +47,8 @@ TBaseN = 2..36; const - MaxLongWord = $FFFFFFFF; + MaxLongWord = $FFFFFFFF deprecated; // use u_dzTypes MaxUInt32 + MaxInt64 = $7FFFFFFFFFFFFFFF deprecated; // use u_dzTypes MaxInt64 const /// <summary> @@ -254,6 +255,11 @@ /// @raises EStringConvertError if s can not be converted </summary> function Str2Int64(const _s: string; const _Source: string): Int64; overload; +function TryStr2Int64(const _s: string; var _Value: Int64): Boolean; overload; +{$IFDEF SUPPORTS_UNICODE} +function TryStr2Int64(const _s: AnsiString; var _Value: Int64): Boolean; overload; +{$ENDIF SUPPORTS_UNICODE} + ///<summary> /// tries to guess the decimal separator </summary> function GuessDecimalSeparator(const _s: string): Char; @@ -1177,6 +1183,24 @@ end; {$ENDIF SUPPORTS_UNICODE} +function TryStr2Int64(const _s: string; var _Value: Int64): Boolean; overload; +var + e: Integer; + v: Integer; +begin + Val(_s, v, e); + Result := (e = 0); + if Result then + _Value := v; +end; + +{$IFDEF SUPPORTS_UNICODE} +function TryStr2Int64(const _s: AnsiString; var _Value: Int64): Boolean; overload; +begin + Result := TryStr2Int64(string(_s), _Value); +end; +{$ENDIF SUPPORTS_UNICODE} + function Str2Int64(const _s: string; _Default: Int64): Int64; var e: Integer; Modified: branches/dark-mode/ExternalSource/dzlib/u_dzFileStreams.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzFileStreams.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzFileStreams.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -126,6 +126,13 @@ /// * CreateDisposition := fcCreateTruncateIfExists; /// raises an exception on error </summary> procedure OpenCreateWriteNoSharing; + ///<summary> + /// Opens a new file for writing only (or truncates an existing file): + /// * AccessMode := [faWrite]; + /// * ShareMode := fsShareRead; + /// * CreateDisposition := fcCreateTruncateIfExists; + /// raises an exception on error </summary> + procedure OpenCreateWriteShareRead; ///<summary> Opens the file and seeks to the end. Returns the new position (that is: The file length). </summary> function Append: LongInt; ///<summary> @@ -346,6 +353,14 @@ Open; end; +procedure TdzFile.OpenCreateWriteShareRead; +begin + CreateDisposition := fcCreateTruncateIfExists; + ShareMode := [fsRead]; + AccessMode := [faWrite]; + Open; +end; + procedure TdzFile.Open; var LastError: Cardinal; Modified: branches/dark-mode/ExternalSource/dzlib/u_dzFileUtils.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzFileUtils.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzFileUtils.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -935,7 +935,7 @@ /// Uses kernel32.GetFullPathName and then compares the result using SameText. /// Note that this does not handle all possible cases, e.g. two files with totally different /// names could be the same due to hard links, soft links or multiple UNC paths pointing to - // the same directory. </summary> + /// the same directory. </summary> class function IsSameFilename(const _fn1, _fn2: string): Boolean; ///<summary> Modified: branches/dark-mode/ExternalSource/dzlib/u_dzGraphicsUtils.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzGraphicsUtils.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzGraphicsUtils.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -772,6 +772,7 @@ pngimage, // support for TImage.LoadGraphics for PNG files {$ENDIF} GraphUtil, + u_dzTypeInfoUtils, u_dzFileUtils; function _(const _s: string): string; @@ -1708,8 +1709,8 @@ Assert(Assigned(_bmp), 'bitmap is not assigned'); Result := (_bmp.PixelFormat = _Expected); if not Result then begin - ActualName := GetEnumName(TypeInfo(TPixelFormat), Ord(_bmp.PixelFormat)); - ExpectedName := GetEnumName(TypeInfo(TPixelFormat), Ord(_Expected)); + ActualName := SafeGetEnumName(TypeInfo(TPixelFormat), Ord(_bmp.PixelFormat)); + ExpectedName := SafeGetEnumName(TypeInfo(TPixelFormat), Ord(_Expected)); Assert(False, 'unexpected PixelFormat ' + ActualName + ' (expected ' + ExpectedName + ')'); end; end; Modified: branches/dark-mode/ExternalSource/dzlib/u_dzNullableTimespan.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzNullableTimespan.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzNullableTimespan.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -142,6 +142,7 @@ class operator Multiply(_a: TNullableTimespan; _b: Extended): TNullableTimespan; class function Zero: TNullableTimespan; static; + class function OneDay: TNullableTimespan; static; class function FromDays(_Days: Double): TNullableTimespan; static; class function FromHours(_Hours: Extended): TNullableTimespan; overload; static; class function FromHours(_Hours: TNullableExtended): TNullableTimespan; overload; static; @@ -640,6 +641,11 @@ Result.AssignZero; end; +class function TNullableTimespan.OneDay: TNullableTimespan; +begin + Result.AssignDays(1); +end; + class operator TNullableTimespan.GreaterThanOrEqual(_a, _b: TNullableTimespan): Boolean; begin Result := not (_a < _b); Modified: branches/dark-mode/ExternalSource/dzlib/u_dzTypInfo.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzTypInfo.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzTypInfo.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -16,7 +16,7 @@ TypInfo, u_dzTranslator; - // I am not going to proved support for Variant properties here. I hate Variants. +// I am not going to provide support for Variant properties here. I hate Variants. const ///<summary> property types that can be converted to string </summary> @@ -88,6 +88,9 @@ {$IFDEF DELPHI2007_UP} +uses + u_dzTypes; + function _(const _s: string): string; inline; begin Result := dzlibGetText(_s); @@ -353,3 +356,4 @@ {$ENDIF DELPHI2007_UP} end. + Copied: branches/dark-mode/ExternalSource/dzlib/u_dzTypeInfoUtils.pas (from rev 4291, trunk/ExternalSource/dzlib/u_dzTypeInfoUtils.pas) =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzTypeInfoUtils.pas (rev 0) +++ branches/dark-mode/ExternalSource/dzlib/u_dzTypeInfoUtils.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -0,0 +1,92 @@ +unit u_dzTypeInfoUtils; + +{$INCLUDE 'dzlib.inc'} + +interface + +uses + SysUtils, + TypInfo; + +function SafeGetEnumName(TypeInfo: PTypeInfo; Value: Integer): string; + +implementation + +uses + u_dzTypes; + +function SafeGetEnumName(TypeInfo: PTypeInfo; Value: Integer): string; + + procedure IncPtr(var _p: Pointer); + begin + _p := Pointer(Intptr(_p) + 1); + end; + + // P must point to the length field (that is the first byte) of a ShortString + function AfterShortString(const P: Pointer): Pointer; + begin + Result := Pointer(Intptr(P) + PByte(P)^ + 1); + end; + +{$IFDEF ENUM_NAMES_ARE_UTF8} + +{$IFNDEF HAS_UTF8TOWIDESTRING} + function UTF8ToWideString(const _Utf8: RawByteString): WideString; + begin + Result := UTF8Decode(_Utf8); + end; +{$ENDIF} + +// Older Unicode Delphi versions did not have a UTF8ToString overload for a pointer parameter +{$IFNDEF DELPHIX_ATHENS_UP} + function _UTF8ToString(P: Pointer): WideString; + var + Len: Byte; + Buf: UTF8String; + begin + Result := ''; + Len := PByte(P)^; + if Len <> 0 then begin + SetLength(Buf, Len); + IncPtr(P); + Move(PByte(P)^, Buf[1], Len); + Result := UTF8ToWideString(Buf); + end; + end; +{$ENDIF} +{$ENDIF} + +var + P: Pointer; + T: PTypeData; +begin + if TypeInfo^.Kind = tkInteger then begin + Result := IntToStr(Value); + Exit; + end; + T := GetTypeData(GetTypeData(TypeInfo)^.BaseType^); + if (TypeInfo = System.TypeInfo(Boolean)) or (T^.MinValue < 0) then begin + { LongBool/WordBool/ByteBool have MinValue < 0 and arbitrary + content in Value; Boolean has Value in [0, 1] } + Result := BooleanIdents[Value <> 0]; + if SameText(HexDisplayPrefix, '0x') then + Result := LowerCase(Result); + end else begin + if (Value < T.MinValue) or (Value > T.MaxValue) then + Result := Format('OutOfBounds(%d)', [Value]) + else begin + P := @T^.NameList; + while Value <> 0 do begin + P := AfterShortString(P); + Dec(Value); + end; +{$IFDEF ENUM_NAMES_ARE_UTF8} + Result := _UTF8ToString(P); +{$ELSE} + Result := PShortString(P)^; +{$ENDIF} + end; + end; +end; + +end. Modified: branches/dark-mode/ExternalSource/dzlib/u_dzTypes.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzTypes.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzTypes.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -169,16 +169,59 @@ {$IFEND} TStringArray = TStringDynArray; TRawByteStringArray = array of RawByteString; - TIntegerArray = array of Integer; - PIntegerArray = ^TIntegerArray; - TSingleArray = array of Single; - PSingleArray = ^TSingleArray; - TDoubleArray = array of Double; - PDoubleArray = ^TDoubleArray; - TExtendedArray = array of Extended; - PExtendedArray = ^TExtendedArray; - TExtendedDynArray = TExtendedArray; + +{$IF not declared(TInt32DynArray)} + TInt32DynArray = array of Int32; +{$IFEND} +{$IF not declared(PInt32DynArray)} + PInt32DynArray = ^TInt32DynArray; +{$IFEND} +{$IF not declared(TIntegerDynArray)} + TIntegerDynArray = TInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TInt32DynArray instead +{$IFEND} +{$IF not declared(PIntegerDynArray)} + PIntegerDynArray = PInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PInt32DynArray instead +{$IFEND} + TIntegerArray = TInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TInt32DynArray or TIntegerDynArray instead + PIntegerArray = PInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PInt32DynArray or PIntegerDynArray instead + +{$IF not declared(TSingleDynArray)} + TSingleDynArray = array of Single; +{$IFEND} +{$IF not declared(PSingleDynArray)} + PSingleDynArray = ^TSingleDynArray; +{$IFEND} + TSingleArray = TSingleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TSingleDynArray instead + PSingleArray = PSingleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PSingleDynArray instead + +{$IF not declared(TDoubleDynArray)} + TDoubleDynArray = array of Double; +{$IFEND} +{$IF not declared(PDoubleDynArray)} + PDoubleDynArray = ^TDoubleDynArray; +{$IFEND} + TDoubleArray = TDoubleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TDoubleDynArray instead + PDoubleArray = PDoubleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PDoubleDynArray instead + +{$IF not declared(TExtendedDynArray)} + TExtendedDynArray = array of Extended; +{$IFEND} +{$IF not declared(PExtendedDynArray)} PExtendedDynArray = ^TExtendedDynArray; +{$IFEND} + TExtendedArray = TExtendedDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TExtendedDynArray instead + PExtendedArray = PExtendedDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PExtendedDynArray instead + {$IF not Declared(TBytes)} TBytes = array of Byte; {$IFEND} Modified: branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas =================================================================== --- branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/ExternalSource/dzlib/u_dzVclUtils.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -1163,6 +1163,20 @@ function TRadioGroup_GetSelectedObject(_rg: TCustomRadioGroup; out _Obj: Pointer): Boolean; overload; function TRadioGroup_GetSelectedObject(_rg: TCustomRadioGroup; out _ObjAsInt: Integer): Boolean; overload; +///<summary> +/// If Highlighted is True, highlights the RadioGroup's Idx'th button, otherwise it un-highlights it, +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TRadioGroup_HighlightButton(_rg: TRadioGroup; _Idx: Integer; _Highlighted: Boolean; + _Color: TColor = clRed); + +///<summary> +/// Highlights the currently selected button of the ReadioGroup if it is not the given DefaultIdx. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TRadioGroup_HighlightIfNotDefault(_rg: TRadioGroup; _DefaultIdx: Integer; + _Color: TColor = clRed); + ///<summary> Writes a TPicture object to a String. The Format is /// <pictureformat>#26<picturedata> </summary> function TPicture_WriteToString(_Pic: TPicture): string; @@ -1635,6 +1649,34 @@ ///<summary> Sets the Caption value of a TCheckbox or TRadioButton (which both descend from TButtonControl) </summary> procedure TButtonControl_SetCaption(_bctrl: TButtonControl; const _Value: string); +///<summary> +/// If Highlight is True, hightlightes the button, ohterweise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_Highlight(_bctrl: TButtonControl; _Highlighted: Boolean; _Color: TColor = clRed); + +///<summary> +/// Highlights the button if its Checked property does not have the default value. +/// Otherwise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_HighlightIfNotDefault(_bctrl: TButtonControl; _Default: Boolean; + _Color: TColor = clRed); + +///<summary> +/// Highlights the button if is checked. +/// Otherwise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_HighlightIfChecked(_bctrl: TButtonControl; _Color: TColor = clRed); + +///<summary> +/// Highlights the button if is no checked. +/// Otherwise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_HighlightIfNotChecked(_bctrl: TButtonControl; _Color: TColor = clRed); + {$IFNDEF DELPHI2009_UP} //Delphi 2009 introduced TCustomButton as the common Ancestor of TButton and TBitBtn. type @@ -4322,6 +4364,27 @@ _ObjAsInt := Integer(Obj); //FI:W541 Casting from Integer to Pointer type (or vice versa) end; +procedure TRadioGroup_HighlightButton(_rg: TRadioGroup; _Idx: Integer; _Highlighted: Boolean; + _Color: TColor = clRed); +begin + if (_Idx < 0) or (_Idx >= _rg.Items.Count) then + Exit; //==> + + TButtonControl_Highlight(TRadioGroup_GetButton(_rg, _Idx), _Highlighted, _Color); +end; + +procedure TRadioGroup_HighlightIfNotDefault(_rg: TRadioGroup; _DefaultIdx: Integer; + _Color: TColor = clRed); +var + Idx: Integer; + i: Integer; +begin + Idx := _rg.ItemIndex; + for i := 0 to _rg.Items.Count - 1 do begin + TRadioGroup_HighlightButton(_rg, i, (i = Idx) and not (i = _DefaultIdx)); + end; +end; + function TRichEdit_WriteToString(_Re: TRichEdit): string; var st: TMemoryStream; @@ -5708,6 +5771,43 @@ THackButtonControl(_bctrl).Caption := _Value; end; +procedure TButtonControl_Highlight(_bctrl: TButtonControl; _Highlighted: Boolean; _Color: TColor = clRed); +var + bctrl: TButtonControlHack absolute _bctrl; +begin + if not Assigned(bctrl) then + Exit; //==> + + if _Highlighted then + bctrl.Font.Color := _Color + else + bctrl.ParentFont := True; +end; + +procedure TButtonControl_HighlightIfNotDefault(_bctrl: TButtonControl; _Default: Boolean; + _Color: TColor = clRed); +var + bctrl: TButtonControlHack absolute _bctrl; +begin + if not Assigned(bctrl) then + Exit; //==> + + if bctrl.Checked <> _Default then + bctrl.Font.Color := _Color + else + bctrl.ParentFont := True; +end; + +procedure TButtonControl_HighlightIfChecked(_bctrl: TButtonControl; _Color: TColor = clRed); +begin + TButtonControl_HighlightIfNotDefault(_bctrl, False, _Color); +end; + +procedure TButtonControl_HighlightIfNotChecked(_bctrl: TButtonControl; _Color: TColor = clRed); +begin + TButtonControl_HighlightIfNotDefault(_bctrl, True, _Color); +end; + type TButtonPopupMenuLink = class(TComponent) private Modified: branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas =================================================================== --- branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/Source/CodeProofreader/GX_ProofreaderConfig.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -231,8 +231,7 @@ cbLanguage.Items.Add(ReplacementSourceText[i]); // Initialize option settings - btnSelectFile.Top := eCustomBeep.Top - 1; // Ord(IsThemingEnabled); - btnSelectFile.Height := eCustomBeep.Height + 2; // * Ord(IsThemingEnabled); + TButton_AlignVerticallyTo(btnSelectFile, eCustomBeep); cbBeep.Checked := FProofreaderData.BeepOnReplace; eCustomBeep.Text := FProofreaderData.CustomBeepSound; cbReplacerActive.Checked := FProofreaderData.ReplacerActive; Modified: branches/dark-mode/Source/Editor/GX_eAlign.pas =================================================================== --- branches/dark-mode/Source/Editor/GX_eAlign.pas 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/Source/Editor/GX_eAlign.pas 2024-08-10 16:21:38 UTC (rev 4292) @@ -19,7 +19,8 @@ cbxMode: TComboBox; procedure lstTokensDblClick(Sender: TObject); procedure btnConfigClick(Sender: TObject); - procedure FormCreate(Sender: TObject); + private + procedure InitializeForm; public constructor Create(_Owner: TComponent); override; end; @@ -268,11 +269,12 @@ TControl_SetMinConstraints(Self); InitDpiScaler; + + InitializeForm; end; -procedure TfmAlign.FormCreate(Sender: TObject); +procedure TfmAlign.InitializeForm; begin - inherited; SetDefaultFont(Self); end; Modified: branches/dark-mode/Source/Editor/GX_eDate.dfm =================================================================== --- branches/dark-mode/Source/Editor/GX_eDate.dfm 2024-08-10 15:37:29 UTC (rev 4291) +++ branches/dark-mode/Source/Editor/GX_eDate.dfm 2024-08-10 16:21:38 UTC (rev 4292) @@ -1,27 +1,27 @@ inherited fmDateFormat: TfmDateFormat - Left = 285 - Top = 201 + Left = 606 + Top = 312 + BorderIcons = [biSystemMenu] BorderStyle = bsDialog Caption = 'Insert Date/Time Configuration' - ClientHeight = 74 - ClientWidth = 337 + ClientHeight = 90 + ClientWidth = 226 Position = poOwnerFormCenter PixelsPerInch = 96 - TextHeight = 15 + TextHeight = 13 object lblFormat: TLabel - Left = 20 - Top = 13 - Width = 92 - Height = 15 - Alignment = taRightJustify + Left = 8 + Top = 8 + Width = 82 + Height = 13 Caption = 'Date/time &format' FocusControl = cbFormat end object cbFormat: TComboBox - Left = 120 - Top = 10 + Left = 8 + Top = 24 Width = 209 - Height = 23 + Height = 21 DropDownCount = 18 TabOrder = 0 Text = 'cbFormat' @@ -52,8 +52,8 @@ 'mm-dd-yy h:mm') end object btnOK: TButton - Left = 168 - Top = 41 + Left = 64 + Top = 56 Width = 75 Height = 25 Caption = 'OK' @@ -62,8 +62,8 @@ TabOrder = 1 end object btnCancel: TButton - Left = 252 - Top = 41 + Left = 144 + Top = 56 Width = 75 Height = 25 Cancel = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-10 15:37:36
|
Revision: 4291 http://sourceforge.net/p/gexperts/code/4291 Author: twm Date: 2024-08-10 15:37:29 +0000 (Sat, 10 Aug 2024) Log Message: ----------- * removed incompatible StyleElements property * moved label on top of the combobox rather than to the right * aligned all controls to the grid * removed minimize and maximize buttons Modified Paths: -------------- trunk/Source/Editor/GX_eDate.dfm Modified: trunk/Source/Editor/GX_eDate.dfm =================================================================== --- trunk/Source/Editor/GX_eDate.dfm 2024-08-10 15:18:36 UTC (rev 4290) +++ trunk/Source/Editor/GX_eDate.dfm 2024-08-10 15:37:29 UTC (rev 4291) @@ -1,28 +1,27 @@ inherited fmDateFormat: TfmDateFormat - Left = 285 - Top = 201 + Left = 606 + Top = 312 + BorderIcons = [biSystemMenu] BorderStyle = bsDialog Caption = 'Insert Date/Time Configuration' - ClientHeight = 74 - ClientWidth = 337 + ClientHeight = 90 + ClientWidth = 226 Position = poOwnerFormCenter - StyleElements = [seFont, seClient, seBorder] PixelsPerInch = 96 - TextHeight = 15 + TextHeight = 13 object lblFormat: TLabel - Left = 20 - Top = 13 - Width = 92 - Height = 15 - Alignment = taRightJustify + Left = 8 + Top = 8 + Width = 82 + Height = 13 Caption = 'Date/time &format' FocusControl = cbFormat end object cbFormat: TComboBox - Left = 120 - Top = 10 + Left = 8 + Top = 24 Width = 209 - Height = 23 + Height = 21 DropDownCount = 18 TabOrder = 0 Text = 'cbFormat' @@ -53,8 +52,8 @@ 'mm-dd-yy h:mm') end object btnOK: TButton - Left = 168 - Top = 41 + Left = 64 + Top = 56 Width = 75 Height = 25 Caption = 'OK' @@ -63,8 +62,8 @@ TabOrder = 1 end object btnCancel: TButton - Left = 252 - Top = 41 + Left = 144 + Top = 56 Width = 75 Height = 25 Cancel = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-10 15:18:38
|
Revision: 4290 http://sourceforge.net/p/gexperts/code/4290 Author: twm Date: 2024-08-10 15:18:36 +0000 (Sat, 10 Aug 2024) Log Message: ----------- Moved the code from FormCreate to InitializeForm and calle that at the end of the constructor Modified Paths: -------------- trunk/Source/Editor/GX_eAlign.pas Modified: trunk/Source/Editor/GX_eAlign.pas =================================================================== --- trunk/Source/Editor/GX_eAlign.pas 2024-08-10 14:03:32 UTC (rev 4289) +++ trunk/Source/Editor/GX_eAlign.pas 2024-08-10 15:18:36 UTC (rev 4290) @@ -19,7 +19,8 @@ cbxMode: TComboBox; procedure lstTokensDblClick(Sender: TObject); procedure btnConfigClick(Sender: TObject); - procedure FormCreate(Sender: TObject); + private + procedure InitializeForm; public constructor Create(_Owner: TComponent); override; end; @@ -268,11 +269,12 @@ TControl_SetMinConstraints(Self); InitDpiScaler; + + InitializeForm; end; -procedure TfmAlign.FormCreate(Sender: TObject); +procedure TfmAlign.InitializeForm; begin - inherited; SetDefaultFont(Self); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tw...@us...> - 2024-08-10 14:03:35
|
Revision: 4289 http://sourceforge.net/p/gexperts/code/4289 Author: twm Date: 2024-08-10 14:03:32 +0000 (Sat, 10 Aug 2024) Log Message: ----------- updated dzlib to latest version Modified Paths: -------------- trunk/ExternalSource/dzlib/dzlib.inc trunk/ExternalSource/dzlib/u_dzConvertUtils.pas trunk/ExternalSource/dzlib/u_dzFileStreams.pas trunk/ExternalSource/dzlib/u_dzFileUtils.pas trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas trunk/ExternalSource/dzlib/u_dzNullableTimespan.pas trunk/ExternalSource/dzlib/u_dzTypInfo.pas trunk/ExternalSource/dzlib/u_dzTypes.pas trunk/ExternalSource/dzlib/u_dzVclUtils.pas Added Paths: ----------- trunk/ExternalSource/dzlib/u_dzTypeInfoUtils.pas Modified: trunk/ExternalSource/dzlib/dzlib.inc =================================================================== --- trunk/ExternalSource/dzlib/dzlib.inc 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/dzlib.inc 2024-08-10 14:03:32 UTC (rev 4289) @@ -25,6 +25,7 @@ {$DEFINE SUPPORTS_DEPRECATED_TYPES} {$DEFINE HAS_UNIT_WIDESTRINGS} {$DEFINE OPENDIALOG_EXCUTE_HAS_HANDLE} + {$DEFINE ENUM_NAMES_ARE_UTF8} {$ENDIF} {$IFDEF DELPHI2006_UP} @@ -55,6 +56,7 @@ // THandleStream.FHandle is declared as THandle (before that it's an Integer) {$DEFINE THANDLESTREAM_HANDLE_IS_THANDLE} {$DEFINE HAS_TOBJECT_TOSTRING} + {$DEFINE HAS_UTF8TOWIDESTRING} {$ENDIF} {$IFDEF DELPHI2010_UP} Modified: trunk/ExternalSource/dzlib/u_dzConvertUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzConvertUtils.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzConvertUtils.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -47,7 +47,8 @@ TBaseN = 2..36; const - MaxLongWord = $FFFFFFFF; + MaxLongWord = $FFFFFFFF deprecated; // use u_dzTypes MaxUInt32 + MaxInt64 = $7FFFFFFFFFFFFFFF deprecated; // use u_dzTypes MaxInt64 const /// <summary> @@ -254,6 +255,11 @@ /// @raises EStringConvertError if s can not be converted </summary> function Str2Int64(const _s: string; const _Source: string): Int64; overload; +function TryStr2Int64(const _s: string; var _Value: Int64): Boolean; overload; +{$IFDEF SUPPORTS_UNICODE} +function TryStr2Int64(const _s: AnsiString; var _Value: Int64): Boolean; overload; +{$ENDIF SUPPORTS_UNICODE} + ///<summary> /// tries to guess the decimal separator </summary> function GuessDecimalSeparator(const _s: string): Char; @@ -1177,6 +1183,24 @@ end; {$ENDIF SUPPORTS_UNICODE} +function TryStr2Int64(const _s: string; var _Value: Int64): Boolean; overload; +var + e: Integer; + v: Integer; +begin + Val(_s, v, e); + Result := (e = 0); + if Result then + _Value := v; +end; + +{$IFDEF SUPPORTS_UNICODE} +function TryStr2Int64(const _s: AnsiString; var _Value: Int64): Boolean; overload; +begin + Result := TryStr2Int64(string(_s), _Value); +end; +{$ENDIF SUPPORTS_UNICODE} + function Str2Int64(const _s: string; _Default: Int64): Int64; var e: Integer; Modified: trunk/ExternalSource/dzlib/u_dzFileStreams.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzFileStreams.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzFileStreams.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -126,6 +126,13 @@ /// * CreateDisposition := fcCreateTruncateIfExists; /// raises an exception on error </summary> procedure OpenCreateWriteNoSharing; + ///<summary> + /// Opens a new file for writing only (or truncates an existing file): + /// * AccessMode := [faWrite]; + /// * ShareMode := fsShareRead; + /// * CreateDisposition := fcCreateTruncateIfExists; + /// raises an exception on error </summary> + procedure OpenCreateWriteShareRead; ///<summary> Opens the file and seeks to the end. Returns the new position (that is: The file length). </summary> function Append: LongInt; ///<summary> @@ -346,6 +353,14 @@ Open; end; +procedure TdzFile.OpenCreateWriteShareRead; +begin + CreateDisposition := fcCreateTruncateIfExists; + ShareMode := [fsRead]; + AccessMode := [faWrite]; + Open; +end; + procedure TdzFile.Open; var LastError: Cardinal; Modified: trunk/ExternalSource/dzlib/u_dzFileUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzFileUtils.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzFileUtils.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -935,7 +935,7 @@ /// Uses kernel32.GetFullPathName and then compares the result using SameText. /// Note that this does not handle all possible cases, e.g. two files with totally different /// names could be the same due to hard links, soft links or multiple UNC paths pointing to - // the same directory. </summary> + /// the same directory. </summary> class function IsSameFilename(const _fn1, _fn2: string): Boolean; ///<summary> Modified: trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -772,6 +772,7 @@ pngimage, // support for TImage.LoadGraphics for PNG files {$ENDIF} GraphUtil, + u_dzTypeInfoUtils, u_dzFileUtils; function _(const _s: string): string; @@ -1708,8 +1709,8 @@ Assert(Assigned(_bmp), 'bitmap is not assigned'); Result := (_bmp.PixelFormat = _Expected); if not Result then begin - ActualName := GetEnumName(TypeInfo(TPixelFormat), Ord(_bmp.PixelFormat)); - ExpectedName := GetEnumName(TypeInfo(TPixelFormat), Ord(_Expected)); + ActualName := SafeGetEnumName(TypeInfo(TPixelFormat), Ord(_bmp.PixelFormat)); + ExpectedName := SafeGetEnumName(TypeInfo(TPixelFormat), Ord(_Expected)); Assert(False, 'unexpected PixelFormat ' + ActualName + ' (expected ' + ExpectedName + ')'); end; end; Modified: trunk/ExternalSource/dzlib/u_dzNullableTimespan.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzNullableTimespan.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzNullableTimespan.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -142,6 +142,7 @@ class operator Multiply(_a: TNullableTimespan; _b: Extended): TNullableTimespan; class function Zero: TNullableTimespan; static; + class function OneDay: TNullableTimespan; static; class function FromDays(_Days: Double): TNullableTimespan; static; class function FromHours(_Hours: Extended): TNullableTimespan; overload; static; class function FromHours(_Hours: TNullableExtended): TNullableTimespan; overload; static; @@ -640,6 +641,11 @@ Result.AssignZero; end; +class function TNullableTimespan.OneDay: TNullableTimespan; +begin + Result.AssignDays(1); +end; + class operator TNullableTimespan.GreaterThanOrEqual(_a, _b: TNullableTimespan): Boolean; begin Result := not (_a < _b); Modified: trunk/ExternalSource/dzlib/u_dzTypInfo.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzTypInfo.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzTypInfo.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -16,7 +16,7 @@ TypInfo, u_dzTranslator; - // I am not going to proved support for Variant properties here. I hate Variants. +// I am not going to provide support for Variant properties here. I hate Variants. const ///<summary> property types that can be converted to string </summary> @@ -88,6 +88,9 @@ {$IFDEF DELPHI2007_UP} +uses + u_dzTypes; + function _(const _s: string): string; inline; begin Result := dzlibGetText(_s); @@ -353,3 +356,4 @@ {$ENDIF DELPHI2007_UP} end. + Added: trunk/ExternalSource/dzlib/u_dzTypeInfoUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzTypeInfoUtils.pas (rev 0) +++ trunk/ExternalSource/dzlib/u_dzTypeInfoUtils.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -0,0 +1,92 @@ +unit u_dzTypeInfoUtils; + +{$INCLUDE 'dzlib.inc'} + +interface + +uses + SysUtils, + TypInfo; + +function SafeGetEnumName(TypeInfo: PTypeInfo; Value: Integer): string; + +implementation + +uses + u_dzTypes; + +function SafeGetEnumName(TypeInfo: PTypeInfo; Value: Integer): string; + + procedure IncPtr(var _p: Pointer); + begin + _p := Pointer(Intptr(_p) + 1); + end; + + // P must point to the length field (that is the first byte) of a ShortString + function AfterShortString(const P: Pointer): Pointer; + begin + Result := Pointer(Intptr(P) + PByte(P)^ + 1); + end; + +{$IFDEF ENUM_NAMES_ARE_UTF8} + +{$IFNDEF HAS_UTF8TOWIDESTRING} + function UTF8ToWideString(const _Utf8: RawByteString): WideString; + begin + Result := UTF8Decode(_Utf8); + end; +{$ENDIF} + +// Older Unicode Delphi versions did not have a UTF8ToString overload for a pointer parameter +{$IFNDEF DELPHIX_ATHENS_UP} + function _UTF8ToString(P: Pointer): WideString; + var + Len: Byte; + Buf: UTF8String; + begin + Result := ''; + Len := PByte(P)^; + if Len <> 0 then begin + SetLength(Buf, Len); + IncPtr(P); + Move(PByte(P)^, Buf[1], Len); + Result := UTF8ToWideString(Buf); + end; + end; +{$ENDIF} +{$ENDIF} + +var + P: Pointer; + T: PTypeData; +begin + if TypeInfo^.Kind = tkInteger then begin + Result := IntToStr(Value); + Exit; + end; + T := GetTypeData(GetTypeData(TypeInfo)^.BaseType^); + if (TypeInfo = System.TypeInfo(Boolean)) or (T^.MinValue < 0) then begin + { LongBool/WordBool/ByteBool have MinValue < 0 and arbitrary + content in Value; Boolean has Value in [0, 1] } + Result := BooleanIdents[Value <> 0]; + if SameText(HexDisplayPrefix, '0x') then + Result := LowerCase(Result); + end else begin + if (Value < T.MinValue) or (Value > T.MaxValue) then + Result := Format('OutOfBounds(%d)', [Value]) + else begin + P := @T^.NameList; + while Value <> 0 do begin + P := AfterShortString(P); + Dec(Value); + end; +{$IFDEF ENUM_NAMES_ARE_UTF8} + Result := _UTF8ToString(P); +{$ELSE} + Result := PShortString(P)^; +{$ENDIF} + end; + end; +end; + +end. Modified: trunk/ExternalSource/dzlib/u_dzTypes.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzTypes.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzTypes.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -169,16 +169,59 @@ {$IFEND} TStringArray = TStringDynArray; TRawByteStringArray = array of RawByteString; - TIntegerArray = array of Integer; - PIntegerArray = ^TIntegerArray; - TSingleArray = array of Single; - PSingleArray = ^TSingleArray; - TDoubleArray = array of Double; - PDoubleArray = ^TDoubleArray; - TExtendedArray = array of Extended; - PExtendedArray = ^TExtendedArray; - TExtendedDynArray = TExtendedArray; + +{$IF not declared(TInt32DynArray)} + TInt32DynArray = array of Int32; +{$IFEND} +{$IF not declared(PInt32DynArray)} + PInt32DynArray = ^TInt32DynArray; +{$IFEND} +{$IF not declared(TIntegerDynArray)} + TIntegerDynArray = TInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TInt32DynArray instead +{$IFEND} +{$IF not declared(PIntegerDynArray)} + PIntegerDynArray = PInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PInt32DynArray instead +{$IFEND} + TIntegerArray = TInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TInt32DynArray or TIntegerDynArray instead + PIntegerArray = PInt32DynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PInt32DynArray or PIntegerDynArray instead + +{$IF not declared(TSingleDynArray)} + TSingleDynArray = array of Single; +{$IFEND} +{$IF not declared(PSingleDynArray)} + PSingleDynArray = ^TSingleDynArray; +{$IFEND} + TSingleArray = TSingleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TSingleDynArray instead + PSingleArray = PSingleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PSingleDynArray instead + +{$IF not declared(TDoubleDynArray)} + TDoubleDynArray = array of Double; +{$IFEND} +{$IF not declared(PDoubleDynArray)} + PDoubleDynArray = ^TDoubleDynArray; +{$IFEND} + TDoubleArray = TDoubleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TDoubleDynArray instead + PDoubleArray = PDoubleDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PDoubleDynArray instead + +{$IF not declared(TExtendedDynArray)} + TExtendedDynArray = array of Extended; +{$IFEND} +{$IF not declared(PExtendedDynArray)} PExtendedDynArray = ^TExtendedDynArray; +{$IFEND} + TExtendedArray = TExtendedDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use TExtendedDynArray instead + PExtendedArray = PExtendedDynArray + {$IFDEF SUPPORTS_DEPRECATED_TYPES} deprecated {$ENDIF}; // use PExtendedDynArray instead + {$IF not Declared(TBytes)} TBytes = array of Byte; {$IFEND} Modified: trunk/ExternalSource/dzlib/u_dzVclUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzVclUtils.pas 2024-07-08 15:51:56 UTC (rev 4288) +++ trunk/ExternalSource/dzlib/u_dzVclUtils.pas 2024-08-10 14:03:32 UTC (rev 4289) @@ -1163,6 +1163,20 @@ function TRadioGroup_GetSelectedObject(_rg: TCustomRadioGroup; out _Obj: Pointer): Boolean; overload; function TRadioGroup_GetSelectedObject(_rg: TCustomRadioGroup; out _ObjAsInt: Integer): Boolean; overload; +///<summary> +/// If Highlighted is True, highlights the RadioGroup's Idx'th button, otherwise it un-highlights it, +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TRadioGroup_HighlightButton(_rg: TRadioGroup; _Idx: Integer; _Highlighted: Boolean; + _Color: TColor = clRed); + +///<summary> +/// Highlights the currently selected button of the ReadioGroup if it is not the given DefaultIdx. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TRadioGroup_HighlightIfNotDefault(_rg: TRadioGroup; _DefaultIdx: Integer; + _Color: TColor = clRed); + ///<summary> Writes a TPicture object to a String. The Format is /// <pictureformat>#26<picturedata> </summary> function TPicture_WriteToString(_Pic: TPicture): string; @@ -1635,6 +1649,34 @@ ///<summary> Sets the Caption value of a TCheckbox or TRadioButton (which both descend from TButtonControl) </summary> procedure TButtonControl_SetCaption(_bctrl: TButtonControl; const _Value: string); +///<summary> +/// If Highlight is True, hightlightes the button, ohterweise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_Highlight(_bctrl: TButtonControl; _Highlighted: Boolean; _Color: TColor = clRed); + +///<summary> +/// Highlights the button if its Checked property does not have the default value. +/// Otherwise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_HighlightIfNotDefault(_bctrl: TButtonControl; _Default: Boolean; + _Color: TColor = clRed); + +///<summary> +/// Highlights the button if is checked. +/// Otherwise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_HighlightIfChecked(_bctrl: TButtonControl; _Color: TColor = clRed); + +///<summary> +/// Highlights the button if is no checked. +/// Otherwise un-highlights it. +/// Highlighting the button means setting its Font.Color to the given Color, and un-higlighting +/// means to set its ParentFont property to True </summary> +procedure TButtonControl_HighlightIfNotChecked(_bctrl: TButtonControl; _Color: TColor = clRed); + {$IFNDEF DELPHI2009_UP} //Delphi 2009 introduced TCustomButton as the common Ancestor of TButton and TBitBtn. type @@ -4322,6 +4364,27 @@ _ObjAsInt := Integer(Obj); //FI:W541 Casting from Integer to Pointer type (or vice versa) end; +procedure TRadioGroup_HighlightButton(_rg: TRadioGroup; _Idx: Integer; _Highlighted: Boolean; + _Color: TColor = clRed); +begin + if (_Idx < 0) or (_Idx >= _rg.Items.Count) then + Exit; //==> + + TButtonControl_Highlight(TRadioGroup_GetButton(_rg, _Idx), _Highlighted, _Color); +end; + +procedure TRadioGroup_HighlightIfNotDefault(_rg: TRadioGroup; _DefaultIdx: Integer; + _Color: TColor = clRed); +var + Idx: Integer; + i: Integer; +begin + Idx := _rg.ItemIndex; + for i := 0 to _rg.Items.Count - 1 do begin + TRadioGroup_HighlightButton(_rg, i, (i = Idx) and not (i = _DefaultIdx)); + end; +end; + function TRichEdit_WriteToString(_Re: TRichEdit): string; var st: TMemoryStream; @@ -5708,6 +5771,43 @@ THackButtonControl(_bctrl).Caption := _Value; end; +procedure TButtonControl_Highlight(_bctrl: TButtonControl; _Highlighted: Boolean; _Color: TColor = clRed); +var + bctrl: TButtonControlHack absolute _bctrl; +begin + if not Assigned(bctrl) then + Exit; //==> + + if _Highlighted then + bctrl.Font.Color := _Color + else + bctrl.ParentFont := True; +end; + +procedure TButtonControl_HighlightIfNotDefault(_bctrl: TButtonControl; _Default: Boolean; + _Color: TColor = clRed); +var + bctrl: TButtonControlHack absolute _bctrl; +begin + if not Assigned(bctrl) then + Exit; //==> + + if bctrl.Checked <> _Default then + bctrl.Font.Color := _Color + else + bctrl.ParentFont := True; +end; + +procedure TButtonControl_HighlightIfChecked(_bctrl: TButtonControl; _Color: TColor = clRed); +begin + TButtonControl_HighlightIfNotDefault(_bctrl, False, _Color); +end; + +procedure TButtonControl_HighlightIfNotChecked(_bctrl: TButtonControl; _Color: TColor = clRed); +begin + TButtonControl_HighlightIfNotDefault(_bctrl, True, _Color); +end; + type TButtonPopupMenuLink = class(TComponent) private This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-08 15:51:59
|
Revision: 4288 http://sourceforge.net/p/gexperts/code/4288 Author: akalwahome Date: 2024-07-08 15:51:56 +0000 (Mon, 08 Jul 2024) Log Message: ----------- make code compile with Delphi 2007 Modified Paths: -------------- branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas branches/dark-mode/Source/Grep/GX_GrepSearch.dfm branches/dark-mode/Source/Grep/GX_GrepSearch.pas Modified: branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas 2024-07-08 15:50:20 UTC (rev 4287) +++ branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas 2024-07-08 15:51:56 UTC (rev 4288) @@ -1018,12 +1018,15 @@ OrigTop: Integer; OrigWidth: Integer; OrigHeight: Integer; - OrigDpi: Integer; NewLeft: Integer; NewTop: Integer; NewWidth: Integer; NewHeight: Integer; +{$IFDEF GX_IDE_IS_HIDPI_AWARE} + OrigDpi: Integer; NewDpi: Integer; +{$ENDIF} + begin if Section = '' then StorageSection := Form.ClassName @@ -1032,10 +1035,8 @@ {$IFDEF GX_IDE_IS_HIDPI_AWARE} OrigDpi := TScreen_GetDpiForForm(Form); -{$ELSE} - OrigDpi := USER_DEFAULT_SCREEN_DPI; // 96 + NewDPI := OrigDPI; {$ENDIF} - NewDPI := OrigDPI; R := Form.BoundsRect; OrigLeft := R.Left; Modified: branches/dark-mode/Source/Grep/GX_GrepSearch.dfm =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepSearch.dfm 2024-07-08 15:50:20 UTC (rev 4287) +++ branches/dark-mode/Source/Grep/GX_GrepSearch.dfm 2024-07-08 15:51:56 UTC (rev 4288) @@ -18,8 +18,8 @@ ShowHint = True OnClose = FormClose DesignSize = ( - 679 - 580) + 681 + 588) PixelsPerInch = 96 TextHeight = 14 object lblFind: TLabel @@ -470,13 +470,13 @@ end object pnlBottom: TPanel Left = 0 - Top = 545 - Width = 679 + Top = 553 + Width = 681 Height = 35 Align = alBottom TabOrder = 7 DesignSize = ( - 679 + 681 35) object btnOK: TButton Left = 432 Modified: branches/dark-mode/Source/Grep/GX_GrepSearch.pas =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-07-08 15:50:20 UTC (rev 4287) +++ branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-07-08 15:51:56 UTC (rev 4288) @@ -812,7 +812,7 @@ TControl_SetConstraints(Self, [ccMinWidth, ccMinHeight, ccMaxHeight]); if not IsStandAlone then - InitTheming; + InitTheming(Self); FixComboBoxSelections(Self); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-08 15:50:22
|
Revision: 4287 http://sourceforge.net/p/gexperts/code/4287 Author: akalwahome Date: 2024-07-08 15:50:20 +0000 (Mon, 08 Jul 2024) Log Message: ----------- FIX: Delphi 2007: Removed unsupported properties (StyleElements) Modified Paths: -------------- branches/dark-mode/Source/Editor/GX_eDate.dfm branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm Modified: branches/dark-mode/Source/Editor/GX_eDate.dfm =================================================================== --- branches/dark-mode/Source/Editor/GX_eDate.dfm 2024-07-07 20:32:51 UTC (rev 4286) +++ branches/dark-mode/Source/Editor/GX_eDate.dfm 2024-07-08 15:50:20 UTC (rev 4287) @@ -6,7 +6,6 @@ ClientHeight = 74 ClientWidth = 337 Position = poOwnerFormCenter - StyleElements = [seFont, seClient, seBorder] PixelsPerInch = 96 TextHeight = 15 object lblFormat: TLabel Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm 2024-07-07 20:32:51 UTC (rev 4286) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm 2024-07-08 15:50:20 UTC (rev 4287) @@ -13,7 +13,6 @@ Top = 23 Width = 66 Height = 15 - StyleElements = [seFont, seClient, seBorder] end inherited lblFolderType: TLabel Left = 22 @@ -20,15 +19,12 @@ Top = 55 Width = 59 Height = 15 - StyleElements = [seFont, seClient, seBorder] end inherited edtFolderName: TEdit Height = 23 - StyleElements = [seFont, seClient, seBorder] end inherited cbxFolderType: TComboBox Top = 51 - StyleElements = [seFont, seClient, seBorder] end end inherited btnCancel: TButton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-07 20:32:54
|
Revision: 4286 http://sourceforge.net/p/gexperts/code/4286 Author: akalwahome Date: 2024-07-07 20:32:51 +0000 (Sun, 07 Jul 2024) Log Message: ----------- Merged changes from trunk. Modified Paths: -------------- branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm branches/dark-mode/Source/RenameComponents/GX_CompRename.pas Modified: branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm =================================================================== --- branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm 2024-07-07 20:22:52 UTC (rev 4285) +++ branches/dark-mode/Source/RenameComponents/GX_CompRename.dfm 2024-07-07 20:32:51 UTC (rev 4286) @@ -16,6 +16,7 @@ Position = poScreenCenter Scaled = False PixelsPerInch = 96 + OnShow = FormShow TextHeight = 14 object lblOldName: TLabel Left = 8 Modified: branches/dark-mode/Source/RenameComponents/GX_CompRename.pas =================================================================== --- branches/dark-mode/Source/RenameComponents/GX_CompRename.pas 2024-07-07 20:22:52 UTC (rev 4285) +++ branches/dark-mode/Source/RenameComponents/GX_CompRename.pas 2024-07-07 20:32:51 UTC (rev 4286) @@ -71,6 +71,7 @@ procedure b_Margins3Click(Sender: TObject); procedure b_Margins6Click(Sender: TObject); procedure b_Margins8Click(Sender: TObject); + procedure FormShow(Sender: TObject); private FIsValidComponentName: TIsValidComponentName; FProperties: TObjectList; @@ -200,7 +201,6 @@ begin ActiveControl := edtNewName; // lblReason.Top := btnOK.Top + Round((btnOK.Height / 2) - (lblReason.Height / 2)); - InitDpiScaler; FixTabOrder; Result := ShowModal; end; @@ -225,6 +225,17 @@ pc_Additional.TabOrder := FProperties.Count + 5; end; +procedure TfmCompRename.FormShow(Sender: TObject); +begin + inherited; + // Adjust some button positons and size after scaling + // DisableAlign; + b_AlignRight.Left := b_AlignTop.Left + b_AlignTop.Width - b_AlignRight.Width; + b_AlignClient.Left := b_AlignLeft.Left + b_AlignLeft.Width + 1; + b_AlignClient.Width := b_AlignRight.Left - b_AlignClient.Left - 2; + // EnableAlign; +end; + function TfmCompRename.GetNewName: WideString; begin Result := Trim(edtNewName.Text); @@ -470,6 +481,8 @@ constructor TfmCompRename.Create(Owner: TComponent); begin inherited; + TControl_SetMinConstraints(Self); + FProperties := TObjectList.Create(False); FAlignButtons[alTop] := TdzSpeedBitBtn.Create(b_AlignTop); @@ -873,6 +886,7 @@ frm.OldName := CompName; frm.SetComponent(Component); + frm.InitDpiScaler; Index := RenameRuleList.IndexOfName(Component.GetComponentType); if Index <> -1 then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-07 20:22:55
|
Revision: 4285 http://sourceforge.net/p/gexperts/code/4285 Author: akalwahome Date: 2024-07-07 20:22:52 +0000 (Sun, 07 Jul 2024) Log Message: ----------- FIX: RenameComponent scaling issues Modified Paths: -------------- trunk/Source/RenameComponents/GX_CompRename.dfm trunk/Source/RenameComponents/GX_CompRename.pas Modified: trunk/Source/RenameComponents/GX_CompRename.dfm =================================================================== --- trunk/Source/RenameComponents/GX_CompRename.dfm 2024-07-07 11:40:46 UTC (rev 4284) +++ trunk/Source/RenameComponents/GX_CompRename.dfm 2024-07-07 20:22:52 UTC (rev 4285) @@ -16,6 +16,7 @@ Position = poScreenCenter Scaled = False PixelsPerInch = 96 + OnShow = FormShow TextHeight = 14 object lblOldName: TLabel Left = 8 @@ -317,7 +318,7 @@ end object edtOldName: TEdit Left = 8 - Top = 24 + Top = 25 Width = 305 Height = 22 Color = clBtnFace @@ -326,7 +327,7 @@ end object edtNewName: TEdit Left = 8 - Top = 72 + Top = 73 Width = 305 Height = 22 AutoSelect = False Modified: trunk/Source/RenameComponents/GX_CompRename.pas =================================================================== --- trunk/Source/RenameComponents/GX_CompRename.pas 2024-07-07 11:40:46 UTC (rev 4284) +++ trunk/Source/RenameComponents/GX_CompRename.pas 2024-07-07 20:22:52 UTC (rev 4285) @@ -71,6 +71,7 @@ procedure b_Margins3Click(Sender: TObject); procedure b_Margins6Click(Sender: TObject); procedure b_Margins8Click(Sender: TObject); + procedure FormShow(Sender: TObject); private FIsValidComponentName: TIsValidComponentName; FProperties: TObjectList; @@ -199,10 +200,20 @@ begin ActiveControl := edtNewName; // lblReason.Top := btnOK.Top + Round((btnOK.Height / 2) - (lblReason.Height / 2)); - InitDpiScaler; Result := ShowModal; end; +procedure TfmCompRename.FormShow(Sender: TObject); +begin + inherited; + // Adjust some button positons and size after scaling + // DisableAlign; + b_AlignRight.Left := b_AlignTop.Left + b_AlignTop.Width - b_AlignRight.Width; + b_AlignClient.Left := b_AlignLeft.Left + b_AlignLeft.Width + 1; + b_AlignClient.Width := b_AlignRight.Left - b_AlignClient.Left - 2; + // EnableAlign; +end; + function TfmCompRename.GetNewName: WideString; begin Result := Trim(edtNewName.Text); @@ -447,6 +458,8 @@ constructor TfmCompRename.Create(Owner: TComponent); begin inherited; + TControl_SetMinConstraints(Self); + FProperties := TObjectList.Create(False); FAlignButtons[alTop] := TdzSpeedBitBtn.Create(b_AlignTop); @@ -850,6 +863,7 @@ frm.OldName := CompName; frm.SetComponent(Component); + frm.InitDpiScaler; Index := RenameRuleList.IndexOfName(Component.GetComponentType); if Index <> -1 then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-07 11:40:48
|
Revision: 4284 http://sourceforge.net/p/gexperts/code/4284 Author: akalwahome Date: 2024-07-07 11:40:46 +0000 (Sun, 07 Jul 2024) Log Message: ----------- Reverted some recent changes to make it compile with Delphi 2007 Modified Paths: -------------- trunk/Source/CodeProofreader/GX_ProofreaderConfig.pas trunk/Source/Framework/GX_ConfigurationInfo.pas trunk/Source/Utils/GX_IdeUtils.pas trunk/Source/Utils/GX_OtaUtils.pas Modified: trunk/Source/CodeProofreader/GX_ProofreaderConfig.pas =================================================================== --- trunk/Source/CodeProofreader/GX_ProofreaderConfig.pas 2024-07-06 20:24:59 UTC (rev 4283) +++ trunk/Source/CodeProofreader/GX_ProofreaderConfig.pas 2024-07-07 11:40:46 UTC (rev 4284) @@ -231,8 +231,7 @@ cbLanguage.Items.Add(ReplacementSourceText[i]); // Initialize option settings - btnSelectFile.Top := eCustomBeep.Top - 1; // Ord(IsThemingEnabled); - btnSelectFile.Height := eCustomBeep.Height + 2; // * Ord(IsThemingEnabled); + TButton_AlignVerticallyTo(btnSelectFile, eCustomBeep); cbBeep.Checked := FProofreaderData.BeepOnReplace; eCustomBeep.Text := FProofreaderData.CustomBeepSound; cbReplacerActive.Checked := FProofreaderData.ReplacerActive; Modified: trunk/Source/Framework/GX_ConfigurationInfo.pas =================================================================== --- trunk/Source/Framework/GX_ConfigurationInfo.pas 2024-07-06 20:24:59 UTC (rev 4283) +++ trunk/Source/Framework/GX_ConfigurationInfo.pas 2024-07-07 11:40:46 UTC (rev 4284) @@ -1018,12 +1018,15 @@ OrigTop: Integer; OrigWidth: Integer; OrigHeight: Integer; - OrigDpi: Integer; NewLeft: Integer; NewTop: Integer; NewWidth: Integer; NewHeight: Integer; +{$IFDEF GX_IDE_IS_HIDPI_AWARE} + OrigDpi: Integer; NewDpi: Integer; +{$ENDIF} + begin if Section = '' then StorageSection := Form.ClassName @@ -1032,10 +1035,8 @@ {$IFDEF GX_IDE_IS_HIDPI_AWARE} OrigDpi := TScreen_GetDpiForForm(Form); -{$ELSE} - OrigDpi := USER_DEFAULT_SCREEN_DPI; // 96 + NewDPI := OrigDPI; {$ENDIF} - NewDPI := OrigDPI; R := Form.BoundsRect; OrigLeft := R.Left; Modified: trunk/Source/Utils/GX_IdeUtils.pas =================================================================== --- trunk/Source/Utils/GX_IdeUtils.pas 2024-07-06 20:24:59 UTC (rev 4283) +++ trunk/Source/Utils/GX_IdeUtils.pas 2024-07-07 11:40:46 UTC (rev 4284) @@ -856,20 +856,20 @@ end; function IsThemingEnabled: Boolean; -{$IFNDEF GX_DELPHI_RIO_UP} +{$IFDEF GX_DELPHI_RIO_UP} // Delphi 10.3 Rio +begin + Result := GX_OtaUtils.GxOtaThemingEnabled; +end; +{$ELSE} var reg: TRegistry; -{$ENDIF} begin + Result := False; if CompilerVersion < CompilerVersionDelphiX103 then begin - Result := False; Exit; //==> end; -{$IFDEF GX_DELPHI_RIO_UP} // Delphi 10.3 Rio - Result := GX_OtaUtils.GxOtaThemingEnabled; -{$ELSE} // if yes, check if theming is enabled reg := TRegistry.Create; try @@ -885,8 +885,8 @@ finally FreeAndNil(reg); end; -{$ENDIF GX_VER330_up} end; +{$ENDIF GX_DELPHI_RIO_UP} function TScreen_TryFindClassForm(const _ClassName: string; out _Form: TForm): Boolean; var Modified: trunk/Source/Utils/GX_OtaUtils.pas =================================================================== --- trunk/Source/Utils/GX_OtaUtils.pas 2024-07-06 20:24:59 UTC (rev 4283) +++ trunk/Source/Utils/GX_OtaUtils.pas 2024-07-07 11:40:46 UTC (rev 4284) @@ -4005,6 +4005,7 @@ end; function GxOtaThemingEnabled: Boolean; +{$IF declared(IOTAIDEThemingServices)} var LService : IOTAIDEThemingServices; begin @@ -4012,6 +4013,11 @@ if Supports(BorlandIDEServices, ToolsAPI.IOTAIDEThemingServices, LService) then Result := LService.IDEThemingEnabled; end; +{$ELSE} +begin + Result := False; +end; +{$IFEND} type // TODO 3 -cCleanup -oAnyone: Remove this type, since it is confusing and is not .NET compatible This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-06 20:25:02
|
Revision: 4283 http://sourceforge.net/p/gexperts/code/4283 Author: akalwahome Date: 2024-07-06 20:24:59 +0000 (Sat, 06 Jul 2024) Log Message: ----------- Merged changes from trunk. Some more changes to support dark mode. Modified Paths: -------------- branches/dark-mode/ExternalSource/FileView.pas branches/dark-mode/Source/Editor/GX_eAlign.pas branches/dark-mode/Source/Editor/GX_eConvertStrings.pas branches/dark-mode/Source/Editor/GX_eDate.dfm branches/dark-mode/Source/Editor/GX_eSort.pas branches/dark-mode/Source/Editor/GX_eSortOptions.dfm branches/dark-mode/Source/Editor/GX_eSortOptions.pas branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.dfm branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.pas branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.dfm branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.pas branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm branches/dark-mode/Source/FavoriteFiles/GX_FavNewFolder.pas branches/dark-mode/Source/FilterExceptions/GX_FilterExceptionsNotification.pas branches/dark-mode/Source/Framework/GX_BaseForm.pas branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas branches/dark-mode/Source/Grep/GX_GrepSearch.dfm branches/dark-mode/Source/Grep/GX_GrepSearch.pas branches/dark-mode/Source/IDE/GX_IdeSearchPathEnhancer.pas branches/dark-mode/Source/Include/GX_CondDefine.inc branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.dfm branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.pas branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.dfm branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.pas branches/dark-mode/Source/Utils/GX_OtaUtils.pas Property Changed: ---------------- branches/dark-mode/ Index: branches/dark-mode =================================================================== --- branches/dark-mode 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode 2024-07-06 20:24:59 UTC (rev 4283) Property changes on: branches/dark-mode ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4085-4273 \ No newline at end of property +/trunk:4085-4282 \ No newline at end of property Modified: branches/dark-mode/ExternalSource/FileView.pas =================================================================== --- branches/dark-mode/ExternalSource/FileView.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/ExternalSource/FileView.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -36,7 +36,8 @@ implementation uses - Controls, Forms, Graphics, StdCtrls, SysUtils, GX_OtaUtils, GX_StringList; + Controls, Forms, Graphics, StdCtrls, SysUtils, + GX_OtaUtils, GX_StringList; constructor TFileViewer.Create(AOwner: TComponent); begin @@ -77,6 +78,7 @@ Gutter.Width := 0; Visible := False; end; + GxOtaGetEditorFont(FEditor.Font, -1); {$ENDIF SYNEDIT} end; end; @@ -124,10 +126,11 @@ finally FreeAndNil(Strings); end; - begin - SetSynEditHighlighter(FEditor, Parser); - FGXSyntaxParser := Parser; - end; + if Parser > gxpNone then + GxOtaGetEditorFont(FEditor.Font, -1); + + SetSynEditHighlighter(FEditor, Parser); + FGXSyntaxParser := Parser; FEditor.Visible := True; end; {$ENDIF SYNEDIT} @@ -174,6 +177,9 @@ {$IFDEF SYNEDIT} FEditor.Visible := False; {$ENDIF SYNEDIT} +// TODO: Use IDE's editor font? +// FRichEdit.Font.Name := ''; +// FRichEdit.DefAttributes.Name := ''; FRichEdit.Lines.LoadFromFile(FileName); FRichEdit.Visible := True; end Modified: branches/dark-mode/Source/Editor/GX_eAlign.pas =================================================================== --- branches/dark-mode/Source/Editor/GX_eAlign.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Editor/GX_eAlign.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -19,6 +19,7 @@ cbxMode: TComboBox; procedure lstTokensDblClick(Sender: TObject); procedure btnConfigClick(Sender: TObject); + procedure FormCreate(Sender: TObject); public constructor Create(_Owner: TComponent); override; end; @@ -269,6 +270,12 @@ InitDpiScaler; end; +procedure TfmAlign.FormCreate(Sender: TObject); +begin + inherited; + SetDefaultFont(Self); +end; + procedure TfmAlign.lstTokensDblClick(Sender: TObject); begin ModalResult := mrOk; @@ -283,6 +290,9 @@ frm := TfmAlign.Create(nil); try + if frm.lstTokens.Count > 0 then + frm.ActiveControl := frm.lstTokens; + frm.btnOK.Default := True; LoadConfiguration(frm); if frm.lstTokens.Items.Count > 0 then frm.ActiveControl := frm.lstTokens; Modified: branches/dark-mode/Source/Editor/GX_eConvertStrings.pas =================================================================== --- branches/dark-mode/Source/Editor/GX_eConvertStrings.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Editor/GX_eConvertStrings.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -149,10 +149,10 @@ inherited; TControl_SetMinConstraints(Self); + InitDpiScaler; + GxOtaGetEditorFont(m_Input.Font, 0); GxOtaGetEditorFont(m_Output.Font, 0); - - InitDpiScaler; end; destructor TfmEConvertStrings.Destroy; Modified: branches/dark-mode/Source/Editor/GX_eDate.dfm =================================================================== --- branches/dark-mode/Source/Editor/GX_eDate.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Editor/GX_eDate.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -1,4 +1,4 @@ -object fmDateFormat: TfmDateFormat +inherited fmDateFormat: TfmDateFormat Left = 285 Top = 201 BorderStyle = bsDialog @@ -5,21 +5,15 @@ Caption = 'Insert Date/Time Configuration' ClientHeight = 74 ClientWidth = 337 - Color = clBtnFace - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -12 - Font.Name = 'Tahoma' - Font.Style = [] - Position = poScreenCenter - Scaled = False + Position = poOwnerFormCenter + StyleElements = [seFont, seClient, seBorder] PixelsPerInch = 96 - TextHeight = 14 + TextHeight = 15 object lblFormat: TLabel - Left = 17 + Left = 20 Top = 13 - Width = 95 - Height = 14 + Width = 92 + Height = 15 Alignment = taRightJustify Caption = 'Date/time &format' FocusControl = cbFormat @@ -26,11 +20,10 @@ end object cbFormat: TComboBox Left = 120 - Top = 9 + Top = 10 Width = 209 - Height = 22 + Height = 23 DropDownCount = 18 - ItemHeight = 14 TabOrder = 0 Text = 'cbFormat' Items.Strings = ( Modified: branches/dark-mode/Source/Editor/GX_eSort.pas =================================================================== --- branches/dark-mode/Source/Editor/GX_eSort.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Editor/GX_eSort.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -65,8 +65,13 @@ end; constructor TfmeSortConfig.Create(_Owner: TComponent); +var + LSpacer : Integer; begin inherited; + LSpacer := grpSort.Left; + Self.ClientWidth := grpSort.Width + (2 * LSpacer); + Self.ClientHeight := btnCancel.Top + btnCancel.Height + LSpacer; TControl_SetMinConstraints(Self); InitDpiScaler; Modified: branches/dark-mode/Source/Editor/GX_eSortOptions.dfm =================================================================== --- branches/dark-mode/Source/Editor/GX_eSortOptions.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Editor/GX_eSortOptions.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -20,6 +20,7 @@ ItemHeight = 13 TabOrder = 0 OnClick = lbxGroupOrderClick + OnKeyDown = lbxGroupOrderKeyDown end object btnUp: TBitBtn Left = 168 Modified: branches/dark-mode/Source/Editor/GX_eSortOptions.pas =================================================================== --- branches/dark-mode/Source/Editor/GX_eSortOptions.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Editor/GX_eSortOptions.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -27,6 +27,7 @@ procedure btnUpClick(Sender: TObject); procedure btnDownClick(Sender: TObject); procedure lbxGroupOrderClick(Sender: TObject); + procedure lbxGroupOrderKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private procedure GetData(_CustomPrefixOrder: TGXUnicodeStringList); procedure SetData(_CustomPrefixOrder: TGXUnicodeStringList); @@ -84,10 +85,16 @@ end; constructor TfrmSortOptions.Create(_Owner: TComponent); +var + LSpacer : Integer; begin inherited; TControl_SetMinConstraints(Self); + LSpacer := grpSortOrder.Left; + Self.ClientWidth := grpSortOrder.Width + (2 * LSpacer); + Self.ClientHeight := btnCancel.Top + btnCancel.Height + LSpacer; + InitDpiScaler; end; @@ -114,5 +121,17 @@ EnableButtons; end; +procedure TfrmSortOptions.lbxGroupOrderKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + inherited; + if Shift = [ssCtrl] then begin + case Key of + VK_UP : begin btnUpClick(nil); Key := 0; end; + VK_DOWN : begin btnDownClick(nil); Key := 0; end; + end; + end; +end; + end. Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.dfm =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -3,54 +3,47 @@ Top = 192 BorderStyle = bsDialog Caption = 'File Properties' - ClientHeight = 249 + ClientHeight = 272 ClientWidth = 464 Color = clBtnFace - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -12 - Font.Name = 'Tahoma' - Font.Style = [] + ParentFont = True KeyPreview = True - OldCreateOrder = False Position = poScreenCenter Scaled = False OnActivate = FormActivate DesignSize = ( 464 - 249) - PixelsPerInch = 96 - TextHeight = 14 + 272) + TextHeight = 15 object pgeProperties: TPageControl Left = 8 Top = 8 - Width = 447 - Height = 201 + Width = 443 + Height = 225 ActivePage = tabProperties Anchors = [akLeft, akTop, akRight] MultiLine = True - TabIndex = 0 TabOrder = 0 TabStop = False object tabProperties: TTabSheet Caption = 'Properties' DesignSize = ( - 439 - 172) + 435 + 195) object lblFile: TLabel - Left = 71 - Top = 12 - Width = 17 - Height = 14 + Left = 70 + Top = 13 + Width = 18 + Height = 15 Alignment = taRightJustify Caption = '&File' FocusControl = edtFilename end object lblName: TLabel - Left = 57 - Top = 76 - Width = 31 - Height = 14 + Left = 56 + Top = 78 + Width = 32 + Height = 15 Alignment = taRightJustify Caption = '&Name' FocusControl = edtName @@ -57,9 +50,9 @@ end object lblDescription: TLabel Left = 28 - Top = 100 + Top = 107 Width = 60 - Height = 14 + Height = 15 Alignment = taRightJustify Caption = '&Description' FocusControl = edtDescription @@ -66,7 +59,7 @@ end object imgFileIcon: TImage Left = 96 - Top = 34 + Top = 37 Width = 32 Height = 32 Center = True @@ -73,34 +66,34 @@ Transparent = True end object lblIcon: TLabel - Left = 64 - Top = 44 - Width = 24 - Height = 14 + Left = 65 + Top = 45 + Width = 23 + Height = 15 Alignment = taRightJustify Caption = 'Icon' end object lblExecuteType: TLabel - Left = 14 - Top = 124 - Width = 74 - Height = 14 + Left = 21 + Top = 136 + Width = 67 + Height = 15 Alignment = taRightJustify Caption = 'Execute &type' FocusControl = cbxExecuteType end object lblExecuteUsing: TLabel - Left = 11 - Top = 148 - Width = 77 - Height = 14 + Left = 15 + Top = 165 + Width = 73 + Height = 15 Alignment = taRightJustify Caption = 'Execute &using' FocusControl = edtExecuteUsing end object sbnFile: TButton - Left = 412 - Top = 8 + Left = 408 + Top = 7 Width = 20 Height = 20 Anchors = [akTop, akRight] @@ -109,8 +102,8 @@ OnClick = sbnFileClick end object sbnExecute: TButton - Left = 412 - Top = 144 + Left = 408 + Top = 161 Width = 20 Height = 20 Anchors = [akTop, akRight] @@ -120,27 +113,26 @@ end object edtName: TEdit Left = 96 - Top = 72 - Width = 316 - Height = 22 + Top = 75 + Width = 312 + Height = 23 Anchors = [akLeft, akTop, akRight] TabOrder = 2 end object edtDescription: TEdit Left = 96 - Top = 96 - Width = 316 - Height = 22 + Top = 104 + Width = 312 + Height = 23 Anchors = [akLeft, akTop, akRight] TabOrder = 3 end object cbxExecuteType: TComboBox Left = 96 - Top = 120 + Top = 133 Width = 145 - Height = 22 + Height = 23 Style = csDropDownList - ItemHeight = 14 TabOrder = 4 OnClick = cbxExecuteTypeClick Items.Strings = ( @@ -152,8 +144,8 @@ object edtFilename: TEdit Left = 96 Top = 8 - Width = 316 - Height = 22 + Width = 312 + Height = 23 Anchors = [akLeft, akTop, akRight] TabOrder = 0 OnExit = edtFilenameExit @@ -160,9 +152,9 @@ end object edtExecuteUsing: TEdit Left = 96 - Top = 144 - Width = 316 - Height = 22 + Top = 162 + Width = 312 + Height = 23 Anchors = [akLeft, akTop, akRight] Enabled = False TabOrder = 5 @@ -170,8 +162,8 @@ end end object btnCancel: TButton - Left = 380 - Top = 216 + Left = 376 + Top = 239 Width = 75 Height = 26 Anchors = [akRight, akBottom] @@ -181,8 +173,8 @@ TabOrder = 2 end object btnOK: TButton - Left = 299 - Top = 216 + Left = 295 + Top = 239 Width = 75 Height = 26 Anchors = [akRight, akBottom] Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.pas =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavFileProp.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -55,7 +55,11 @@ {$R *.dfm} uses - GX_FavFiles, GX_GenericUtils, GX_IdeUtils, u_dzVclUtils; + GX_FavFiles, + GX_GenericUtils, + GX_GxUtils, + GX_IdeUtils, + u_dzVclUtils; { TfmFavFileProp } @@ -79,9 +83,10 @@ constructor TfmFavFileProp.Create(_Owner: TComponent); begin inherited; - TControl_SetMinConstraints(Self); InitDpiScaler; + GxSetDefaultFont(Self); + InitializeForm; end; @@ -198,6 +203,9 @@ cbxExecuteType.Items.Clear; for ExecType := Low(TExecType) to High(TExecType) do cbxExecuteType.Items.AddObject(ExecTypeNames[ExecType], TObject(Ord(ExecType))); + + TButton_AlignVerticallyTo(sbnFile, edtFilename); + TButton_AlignVerticallyTo(sbnExecute, edtExecuteUsing); end; end. Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.dfm =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -2,18 +2,17 @@ Left = 402 Top = 273 Caption = 'Favorite Files' - ClientHeight = 342 - ClientWidth = 495 + ClientHeight = 334 + ClientWidth = 493 Color = clBtnFace DefaultMonitor = dmDesktop Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -12 + Font.Height = -15 Font.Name = 'Tahoma' Font.Style = [] KeyPreview = True Menu = MainMenu - OldCreateOrder = False Position = poDesigned Scaled = False OnClose = FormClose @@ -20,20 +19,17 @@ OnHide = FormHide OnKeyPress = FormKeyPress OnShow = FormShow - PixelsPerInch = 96 - TextHeight = 14 + TextHeight = 18 object splTreeView: TSplitter Left = 121 Top = 22 - Width = 3 - Height = 301 - Cursor = crHSplit + Height = 293 end object tvFolders: TTreeView Left = 0 Top = 22 Width = 121 - Height = 301 + Height = 293 Align = alLeft DragMode = dmAutomatic HideSelection = False @@ -53,8 +49,8 @@ end object StatusBar: TStatusBar Left = 0 - Top = 323 - Width = 495 + Top = 315 + Width = 493 Height = 19 Panels = <> ParentFont = True @@ -64,15 +60,15 @@ object pnlFiles: TPanel Left = 124 Top = 22 - Width = 371 - Height = 301 + Width = 369 + Height = 293 Align = alClient BevelOuter = bvNone TabOrder = 2 object splFileView: TSplitter Left = 0 - Top = 151 - Width = 371 + Top = 143 + Width = 369 Height = 3 Cursor = crVSplit Align = alBottom @@ -80,8 +76,8 @@ object ListView: TListView Left = 0 Top = 0 - Width = 371 - Height = 151 + Width = 369 + Height = 143 Align = alClient Columns = < item @@ -118,8 +114,8 @@ end object pnlFileView: TPanel Left = 0 - Top = 154 - Width = 371 + Top = 146 + Width = 369 Height = 147 Align = alBottom BevelOuter = bvNone @@ -131,12 +127,10 @@ object ToolBar: TToolBar Left = 0 Top = 0 - Width = 495 + Width = 493 Height = 22 AutoSize = True DisabledImages = dmSharedImages.DisabledImages - EdgeBorders = [] - Flat = True Images = dmSharedImages.Images ParentShowHint = False ShowHint = True Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.pas =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavFiles.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -1763,12 +1763,11 @@ FRootFolder := TGXFolder.Create(nil); FOptions := _Options; + TControl_SetMinConstraints(Self); + InitDpiScaler; SetupSystemImageLists; - InitDpiScaler; GxSetDefaultFont(Self); - TControl_SetMinConstraints(Self); - SetToolbarGradient(ToolBar); pnlFileView.Caption := ''; SetNonModalFormPopupMode(Self); Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavFolderProp.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -1,8 +1,42 @@ inherited fmFavFolderProperties: TfmFavFolderProperties Caption = 'Folder Properties' PixelsPerInch = 96 - TextHeight = 13 + ClientHeight = 135 + ClientWidth = 295 + ParentFont = True + TextHeight = 15 inherited gbxNewFolder: TGroupBox + Height = 88 Caption = ' Folder Properties ' + inherited lblFolderName: TLabel + Left = 15 + Top = 23 + Width = 66 + Height = 15 + StyleElements = [seFont, seClient, seBorder] + end + inherited lblFolderType: TLabel + Left = 22 + Top = 55 + Width = 59 + Height = 15 + StyleElements = [seFont, seClient, seBorder] + end + inherited edtFolderName: TEdit + Height = 23 + StyleElements = [seFont, seClient, seBorder] + end + inherited cbxFolderType: TComboBox + Top = 51 + StyleElements = [seFont, seClient, seBorder] + end end + inherited btnCancel: TButton + Left = 212 + Top = 102 + end + inherited btnOK: TButton + Left = 132 + Top = 102 + end end Modified: branches/dark-mode/Source/FavoriteFiles/GX_FavNewFolder.pas =================================================================== --- branches/dark-mode/Source/FavoriteFiles/GX_FavNewFolder.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FavoriteFiles/GX_FavNewFolder.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -44,6 +44,7 @@ u_dzDpiScaleUtils, {$ENDIF} u_dzVclUtils, + GX_GxUtils, GX_IdeUtils, GX_FavFiles; @@ -68,7 +69,7 @@ constructor TfmFavNewFolder.Create(_Owner: TComponent); begin inherited; - + TControl_SetMinConstraints(Self); InitDpiScaler; InitializeForm; @@ -83,6 +84,7 @@ var i: TFolderType; begin + GxSetDefaultFont(Self); for i := Low(TFolderType) to High(TFolderType) do cbxFolderType.Items.AddObject(FolderNames[i], Pointer(i)); cbxFolderType.ItemIndex := 0; Modified: branches/dark-mode/Source/FilterExceptions/GX_FilterExceptionsNotification.pas =================================================================== --- branches/dark-mode/Source/FilterExceptions/GX_FilterExceptionsNotification.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/FilterExceptions/GX_FilterExceptionsNotification.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -109,6 +109,7 @@ frm := TfmExceptionNotification.Create(_Owner); {$IFEND} try + GxSetDefaultFont(frm); TForm_CenterOn(frm, _Owner); frm.SetData(_OnAddException, _Project, _Exception, _Message, _AdditionalData, _ConfigurationKey); Result := (frm.ShowModal = mrOk); @@ -122,7 +123,6 @@ inherited Create(_Owner); TControl_SetMinConstraints(Self); InitDpiScaler; - GxSetDefaultFont(Self); end; destructor TfmExceptionNotification.Destroy; Modified: branches/dark-mode/Source/Framework/GX_BaseForm.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_BaseForm.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Framework/GX_BaseForm.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -32,11 +32,16 @@ FGxHintCustomDataRec: TGxHintCustomDataRec; FScaler: TFormDpiScaler; FApplicationEvents: TApplicationEvents; + {$IFDEF GX_SUPPORTS_THEMING} + //FThemeChangedNotifier: TThemeChangedNotifier; + procedure InitTheming; virtual; + {$ENDIF} procedure HandleApplicationEventsShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo); procedure WMDpiChanged(var _Msg: TWMDpi); message WM_DPICHANGED; procedure ApplyDpi(_NewDpi: Integer; _NewBounds: PRect); virtual; procedure ArrangeControls; virtual; + protected procedure InitDpiScaler; public @@ -91,6 +96,12 @@ _Msg.Result := 0; end; +{$IFDEF GX_SUPPORTS_THEMING} +procedure TfmBaseForm.InitTheming; +begin +end; +{$ENDIF} + procedure TfmBaseForm.HandleApplicationEventsShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo); begin @@ -127,7 +138,7 @@ constructor TfmBaseForm.Create(AOwner: TComponent); begin inherited; - + //FThemeChangedNotifier := nil; FApplicationEvents := TApplicationEvents.Create(Self); FApplicationEvents.OnShowHint := HandleApplicationEventsShowHint; Modified: branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Framework/GX_ConfigurationInfo.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -1018,10 +1018,12 @@ OrigTop: Integer; OrigWidth: Integer; OrigHeight: Integer; + OrigDpi: Integer; NewLeft: Integer; NewTop: Integer; NewWidth: Integer; NewHeight: Integer; + NewDpi: Integer; begin if Section = '' then StorageSection := Form.ClassName @@ -1028,11 +1030,19 @@ else StorageSection := Section; +{$IFDEF GX_IDE_IS_HIDPI_AWARE} + OrigDpi := TScreen_GetDpiForForm(Form); +{$ELSE} + OrigDpi := USER_DEFAULT_SCREEN_DPI; // 96 +{$ENDIF} + NewDPI := OrigDPI; + R := Form.BoundsRect; OrigLeft := R.Left; OrigTop := R.Top; OrigWidth := R.Right - OrigLeft; OrigHeight := R.Bottom - OrigTop; + // we assign NewXxx to OrigXxx which will 1. prevent a compiler warning and 2. save some checks // below NewLeft := OrigLeft; @@ -1043,6 +1053,11 @@ PosChanged := False; SizeChanged := False; +{$IFDEF GX_IDE_IS_HIDPI_AWARE} + if (FormSaveFlags <> []) and ValueExists(StorageSection, 'DPi') then + NewDpi := ReadInteger(StorageSection, 'Dpi', OrigDpi); +{$ENDIF} + if (fsPosition in FormSaveFlags) and ValueExists(StorageSection, 'Left') then begin NewLeft := ReadInteger(StorageSection, 'Left', OrigLeft); @@ -1057,6 +1072,15 @@ SizeChanged := True; end; +{$IFDEF GX_IDE_IS_HIDPI_AWARE} + if (NewDpi > 0) and (OrigDpi > 0) and (NewDpi<> OrigDpi) then begin + NewLeft := MulDiv(NewLeft, NewDpi, OrigDpi); + NewTop := MulDiv(NewTop, NewDpi, OrigDpi); + NewWidth := MulDiv(NewWidth, NewDpi, OrigDpi); + NewHeight := MulDiv(NewHeight, NewDpi, OrigDpi); + end; +{$ENDIF} + if PosChanged then begin R.Left := NewLeft; R.Top := NewTop; @@ -1095,6 +1119,12 @@ StorageSection := Form.ClassName else StorageSection := Section; +{$IFDEF GX_IDE_IS_HIDPI_AWARE} + if FormSaveFlags <> [] then + begin + WriteInteger(StorageSection, 'Dpi', TScreen_GetDpiForForm(Form)); + end; +{$ENDIF} if fsPosition in FormSaveFlags then begin WriteInteger(StorageSection, 'Left', Form.Left); Modified: branches/dark-mode/Source/Grep/GX_GrepSearch.dfm =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepSearch.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Grep/GX_GrepSearch.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -18,15 +18,15 @@ ShowHint = True OnClose = FormClose DesignSize = ( - 681 - 588) + 679 + 580) PixelsPerInch = 96 - TextHeight = 15 + TextHeight = 14 object lblFind: TLabel - Left = 21 + Left = 14 Top = 12 - Width = 59 - Height = 15 + Width = 66 + Height = 14 Alignment = taRightJustify Caption = '&Text to find' FocusControl = cbText @@ -34,11 +34,10 @@ object cbText: TComboBox Left = 85 Top = 8 - Width = 589 + Width = 585 Height = 22 Anchors = [akLeft, akTop, akRight] DropDownCount = 15 - ItemHeight = 0 TabOrder = 0 OnKeyDown = ComboKeyDown end @@ -216,8 +215,8 @@ object txt_NoMapFile: TStaticText Left = 43 Top = 79 - Width = 117 - Height = 19 + Width = 116 + Height = 18 Hint = 'Parses the .map file to get the unit names of all units used in ' + 'the project.'#13#10'You must enable generating a map file with publics' + @@ -230,18 +229,18 @@ object gbxContentTypes: TGroupBox Left = 488 Top = 40 - Width = 185 + Width = 181 Height = 81 Anchors = [akLeft, akTop, akRight] Caption = 'Delphi Code Content Types' TabOrder = 3 DesignSize = ( - 185 + 181 81) object cbGrepCode: TCheckBox Left = 10 Top = 18 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Code' @@ -251,7 +250,7 @@ object cbGrepStrings: TCheckBox Left = 10 Top = 38 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Strings' @@ -261,7 +260,7 @@ object cbGrepComments: TCheckBox Left = 10 Top = 58 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Comments' @@ -269,7 +268,7 @@ OnClick = cbGrepCommentsClick end object btnGrepAll: TButton - Left = 134 + Left = 130 Top = 48 Width = 43 Height = 25 @@ -282,18 +281,18 @@ object gbxUnitSections: TGroupBox Left = 488 Top = 128 - Width = 185 + Width = 181 Height = 105 Anchors = [akLeft, akTop, akRight] Caption = 'Delphi Code Sections' TabOrder = 4 DesignSize = ( - 185 + 181 105) object cbSectionInterface: TCheckBox Left = 10 Top = 18 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Interface' @@ -303,7 +302,7 @@ object cbSectionImplementation: TCheckBox Left = 10 Top = 38 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Implementation' @@ -313,7 +312,7 @@ object cbSectionInitialization: TCheckBox Left = 10 Top = 58 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Initialization' @@ -323,7 +322,7 @@ object cbSectionFinalization: TCheckBox Left = 10 Top = 78 - Width = 168 + Width = 164 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Finalization' @@ -331,7 +330,7 @@ OnClick = cbSectionFinalizationClick end object btnSectionAll: TButton - Left = 134 + Left = 130 Top = 72 Width = 43 Height = 25 @@ -344,19 +343,19 @@ object gbxDirectories: TGroupBox Left = 8 Top = 240 - Width = 666 + Width = 662 Height = 217 Anchors = [akLeft, akTop, akRight] Caption = 'Directory Search' TabOrder = 5 DesignSize = ( - 666 + 662 217) object lblMasks: TLabel Left = 8 Top = 72 - Width = 183 - Height = 15 + Width = 188 + Height = 14 Caption = 'File mas&ks (separate by semicolon)' FocusControl = cbMasks end @@ -363,8 +362,8 @@ object lblDirectory: TLabel Left = 8 Top = 24 - Width = 185 - Height = 15 + Width = 192 + Height = 14 Caption = 'Di&rectories (separate by semicolon)' FocusControl = cbDirectory end @@ -371,8 +370,8 @@ object lblExcludeDirs: TLabel Left = 24 Top = 168 - Width = 192 - Height = 15 + Width = 200 + Height = 14 Caption = 'Exclude Dirs (separate by semicolon)' FocusControl = cbExcludedDirs end @@ -379,18 +378,17 @@ object l_MinMaxDepth: TLabel Left = 176 Top = 121 - Width = 89 - Height = 15 + Width = 90 + Height = 14 Caption = 'Min / Max Depth' end object cbMasks: TComboBox Left = 8 Top = 88 - Width = 617 + Width = 613 Height = 22 Anchors = [akLeft, akTop, akRight] DropDownCount = 15 - ItemHeight = 0 TabOrder = 2 OnKeyDown = ComboKeyDown end @@ -406,7 +404,7 @@ object cbInclude: TCheckBox Left = 8 Top = 128 - Width = 149 + Width = 145 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Search su&bdirectories' @@ -416,18 +414,17 @@ object cbDirectory: TComboBox Left = 8 Top = 40 - Width = 617 + Width = 613 Height = 22 Hint = 'Separate multiple directories by semicolon' Anchors = [akLeft, akTop, akRight] DropDownCount = 15 - ItemHeight = 14 TabOrder = 0 OnDropDown = cbDirectoryDropDown OnKeyDown = ComboKeyDown end object btnBrowse: TButton - Left = 632 + Left = 628 Top = 39 Width = 25 Height = 25 @@ -442,11 +439,10 @@ object cbExcludedDirs: TComboBox Left = 24 Top = 184 - Width = 601 + Width = 597 Height = 22 Anchors = [akLeft, akTop, akRight] DropDownCount = 15 - ItemHeight = 14 TabOrder = 6 OnDropDown = cbExcludedDirsDropDown OnKeyDown = ComboKeyDown @@ -474,16 +470,16 @@ end object pnlBottom: TPanel Left = 0 - Top = 553 - Width = 681 + Top = 545 + Width = 679 Height = 35 Align = alBottom TabOrder = 7 DesignSize = ( - 681 + 679 35) object btnOK: TButton - Left = 436 + Left = 432 Top = 2 Width = 75 Height = 25 @@ -494,7 +490,7 @@ OnClick = btnOKClick end object btnCancel: TButton - Left = 516 + Left = 512 Top = 2 Width = 75 Height = 25 @@ -505,7 +501,7 @@ TabOrder = 3 end object btnHelp: TButton - Left = 596 + Left = 592 Top = 2 Width = 75 Height = 25 @@ -537,7 +533,7 @@ object rgSaveOption: TRadioGroup Left = 8 Top = 464 - Width = 666 + Width = 662 Height = 81 Anchors = [akLeft, akTop, akRight] Caption = 'Save Search History' Modified: branches/dark-mode/Source/Grep/GX_GrepSearch.pas =================================================================== --- branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Grep/GX_GrepSearch.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -809,14 +809,10 @@ procedure TfmGrepSearch.FormShow(Sender: TObject); begin inherited; - {$IFDEF GX_IDE_IS_HIDPI_AWARE} - if IsThemesEnabled and (Self.CurrentPPI > 110) then - Self.Font.Height := Self.Font.Height + 1; - {$ENDIF} TControl_SetConstraints(Self, [ccMinWidth, ccMinHeight, ccMaxHeight]); if not IsStandAlone then - InitTheming(Self); + InitTheming; FixComboBoxSelections(Self); end; Modified: branches/dark-mode/Source/IDE/GX_IdeSearchPathEnhancer.pas =================================================================== --- branches/dark-mode/Source/IDE/GX_IdeSearchPathEnhancer.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/IDE/GX_IdeSearchPathEnhancer.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -814,7 +814,9 @@ var LineIdx: Integer; YPos: Integer; +{$IFNDEF GX_VER350_up} LSelected: Boolean; +{$ENDIF} begin if FPageControl.ActivePage = FTabSheetMemo then begin FMemo.BeginUpdate; @@ -835,9 +837,14 @@ end; SetFocusTo(FMemo); end else begin +{$IFDEF GX_VER350_up} + FUpClick(FUpBtn); +{$ELSE} + // FIX RSP-32650: LSelected := FListbox.Selected[FListbox.ItemIndex]; FUpClick(FUpBtn); FListbox.Selected[FListbox.ItemIndex] := LSelected; +{$ENDIF} end; end; @@ -845,7 +852,9 @@ var LineCnt: Integer; YPos: Integer; +{$IFNDEF GX_VER350_up} LSelected: Boolean; +{$ENDIF} begin if FPageControl.ActivePage = FTabSheetMemo then begin FMemo.BeginUpdate; @@ -867,9 +876,14 @@ end; SetFocusTo(FMemo); end else begin +{$IFDEF GX_VER350_up} + FDownClick(FDownBtn); +{$ELSE} + // FIX RSP-32650: LSelected := FListbox.Selected[FListbox.ItemIndex]; FDownClick(FDownBtn); FListbox.Selected[FListbox.ItemIndex] := LSelected; +{$ENDIF} end; end; Modified: branches/dark-mode/Source/Include/GX_CondDefine.inc =================================================================== --- branches/dark-mode/Source/Include/GX_CondDefine.inc 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Include/GX_CondDefine.inc 2024-07-06 20:24:59 UTC (rev 4283) @@ -261,6 +261,7 @@ // Define UniSynEdit if SynEdit is available {$IFDEF SYNEDIT} {$DEFINE UniSynEdit} + {$DEFINE GX_ENHANCED_EDITOR} {$ELSE} GExperts now requires SynEdit. {$ENDIF SYNEDIT} Modified: branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.dfm =================================================================== --- branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -2,7 +2,6 @@ Left = 326 Top = 252 ActiveControl = lvMacros - AutoScroll = False Caption = 'Keyboard Macro Library' ClientHeight = 218 ClientWidth = 314 @@ -12,12 +11,10 @@ Font.Height = -12 Font.Name = 'Tahoma' Font.Style = [] - OldCreateOrder = False Position = poScreenCenter Scaled = False OnClose = FormClose OnResize = FormResize - PixelsPerInch = 96 TextHeight = 14 object Splitter: TSplitter Left = 0 @@ -69,8 +66,6 @@ Width = 314 Height = 22 AutoSize = True - EdgeBorders = [] - Flat = True Images = dmSharedImages.Images ParentShowHint = False ShowHint = True Modified: branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.pas =================================================================== --- branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/MacroLibrary/GX_MacroLibrary.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -201,6 +201,7 @@ procedure ApplyDpi(_NewDpi: Integer; _NewBounds: PRect); override; {$ENDIF} procedure AddToMacroLibrary(CR: IOTARecord); + procedure FormShow(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -680,6 +681,8 @@ procedure TfmMacroLibrary.FormClose(Sender: TObject; var Action: TCloseAction); begin + if Self.Floating then + SaveSettings; Action := caHide; end; @@ -758,6 +761,7 @@ FDataList := TList.Create; LoadSettings; FSBWidth := GetSystemMetrics(SM_CXVSCROLL); + OnShow := FormShow; ResizeColumns; InitializeForm; @@ -1032,9 +1036,16 @@ procedure TfmMacroLibrary.ResizeColumns; var + DummyTimeStamp : TDateTime; ColWidth: Integer; begin - ColWidth := Max(lvMacros.Width - fSBWidth - 6 - lvMacros.Columns[1].MinWidth, NameColMinMidth); + // calculate needed with for the timestamp + DummyTimeStamp := EncodeDate(2000, 12, 31) + EncodeTime(23, 53, 55, 0); + ColWidth := lvMacros.Canvas.TextWidth(DateTimeToStr(DummyTimeStamp)) + FSBWidth; + lvMacros.Columns[1].MinWidth := ColWidth; + lvMacros.Columns[1].Width := ColWidth; + + ColWidth := Max(lvMacros.Width - FSBWidth - 6 - lvMacros.Columns[1].MinWidth, NameColMinMidth); lvMacros.Columns[0].MaxWidth := ColWidth; lvMacros.Columns[0].MinWidth := ColWidth; lvMacros.Columns[0].Width := ColWidth; @@ -1228,6 +1239,12 @@ Result := pnlDescription.Visible; end; +procedure TfmMacroLibrary.FormShow(Sender: TObject); +begin + if Self.Floating then + LoadSettings; +end; + { TMacroLibraryExpert } constructor TMacroLibraryExpert.Create; Modified: branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.dfm =================================================================== --- branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.dfm 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.dfm 2024-07-06 20:24:59 UTC (rev 4283) @@ -38,7 +38,7 @@ FocusControl = cbReplace end object btnOK: TButton - Left = 150 + Left = 144 Top = 190 Width = 75 Height = 25 @@ -50,7 +50,7 @@ OnClick = btnOKClick end object btnCancel: TButton - Left = 233 + Left = 227 Top = 190 Width = 75 Height = 25 @@ -61,7 +61,7 @@ TabOrder = 5 end object btnHelp: TButton - Left = 398 + Left = 392 Top = 190 Width = 75 Height = 25 @@ -73,11 +73,10 @@ object cbSearch: TComboBox Left = 111 Top = 12 - Width = 314 + Width = 308 Height = 22 Anchors = [akLeft, akTop, akRight] DropDownCount = 18 - ItemHeight = 14 Sorted = True TabOrder = 0 OnChange = cbSearchChange @@ -85,12 +84,11 @@ end object cbReplace: TComboBox Left = 111 - Top = 36 - Width = 314 + Top = 37 + Width = 308 Height = 22 Anchors = [akLeft, akTop, akRight] DropDownCount = 18 - ItemHeight = 14 Sorted = True TabOrder = 1 OnChange = cbSearchChange @@ -97,7 +95,7 @@ OnKeyDown = cbSearchKeyDown end object gbxScope: TGroupBox - Left = 188 + Left = 182 Top = 70 Width = 285 Height = 108 @@ -186,7 +184,7 @@ end end object btnSettings: TButton - Left = 316 + Left = 310 Top = 190 Width = 75 Height = 25 Modified: branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.pas =================================================================== --- branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/ReplaceComponents/GX_ReplaceComp.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -447,6 +447,7 @@ constructor TfmReplaceComp.Create(AOwner: TComponent); begin inherited Create(AOwner); + TControl_SetMinConstraints(Self); LoadFormSettings; SetupControls; Modified: branches/dark-mode/Source/Utils/GX_OtaUtils.pas =================================================================== --- branches/dark-mode/Source/Utils/GX_OtaUtils.pas 2024-07-06 20:01:13 UTC (rev 4282) +++ branches/dark-mode/Source/Utils/GX_OtaUtils.pas 2024-07-06 20:24:59 UTC (rev 4283) @@ -834,7 +834,19 @@ const FileName: string; var Cancel: Boolean); override; end; +(* type + TThemeChangedNotifier = class(TBaseIdeNotifier, INTAIDEThemingServicesNotifier) + private + FOnThemeChanged : TNotifyEvent; + public + constructor Create(_OnThemeChanged: TNotifyEvent); + procedure ChangingTheme; + procedure ChangedTheme; + end; +*) + +type EStandAloneUsage = class(Exception); const @@ -4096,6 +4108,7 @@ {$IFDEF GX_SUPPORTS_THEMING} var LService : IOTAIDEThemingServices; +// LNotifier : TThemeChangedNotifier; begin Result := False; LService := GxOtaGetIDEThemingServices; @@ -4103,6 +4116,10 @@ begin LService.RegisterFormClass(TCustomFormClass(AForm.ClassType)); LService.ApplyTheme(AForm); + +// LNotifier := TThemeChangedNotifier.Create(AForm); +// LNotifier.AddNotifierToIDE; + Result := True; end; end; @@ -5996,6 +6013,41 @@ end; end; +{ TThemeChangedNotifier } + +(* +function TThemeChangedNotifier.AddNotifierToIDE: Boolean; +var + LService: IOTAIDEThemingServices; +begin + Result := False; + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) and (LService.IDEThemingEnabled) then + begin + FNotifierIndex := LService.AddNotifier(Self); + Result := (FNotifierIndex <> InvalidNotifierIndex); + end; +end; + +procedure TThemeChangedNotifier.ChangedTheme; +begin + if Assigned(FOnThemeChanged) then + FOnThemeChanged(Self); +end; + +procedure TThemeChangedNotifier.ChangingTheme; +begin + // not implemented. +end; + +constructor TThemeChangedNotifier.Create(_OnThemeChanged: TNotifyEvent); +begin + inherited Create; + Assert(Assigned(_OnThemeChanged); + FOnThemeChanged := _OnThemeChanged; +end; +*) + initialization finalization This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-06 20:01:14
|
Revision: 4282 http://sourceforge.net/p/gexperts/code/4282 Author: akalwahome Date: 2024-07-06 20:01:13 +0000 (Sat, 06 Jul 2024) Log Message: ----------- File preview now uses SynEdit control with selected editor font and syntax highlighting. Modified Paths: -------------- trunk/ExternalSource/FileView.pas Modified: trunk/ExternalSource/FileView.pas =================================================================== --- trunk/ExternalSource/FileView.pas 2024-07-06 19:48:54 UTC (rev 4281) +++ trunk/ExternalSource/FileView.pas 2024-07-06 20:01:13 UTC (rev 4282) @@ -36,7 +36,8 @@ implementation uses - Controls, Forms, Graphics, StdCtrls, SysUtils, GX_OtaUtils, GX_StringList; + Controls, Forms, Graphics, StdCtrls, SysUtils, + GX_OtaUtils, GX_StringList; constructor TFileViewer.Create(AOwner: TComponent); begin @@ -77,6 +78,7 @@ Gutter.Width := 0; Visible := False; end; + GxOtaGetEditorFont(FEditor.Font, -1); {$ENDIF SYNEDIT} end; end; @@ -124,10 +126,11 @@ finally FreeAndNil(Strings); end; - begin - SetSynEditHighlighter(FEditor, Parser); - FGXSyntaxParser := Parser; - end; + if Parser > gxpNone then + GxOtaGetEditorFont(FEditor.Font, -1); + + SetSynEditHighlighter(FEditor, Parser); + FGXSyntaxParser := Parser; FEditor.Visible := True; end; {$ENDIF SYNEDIT} @@ -174,6 +177,9 @@ {$IFDEF SYNEDIT} FEditor.Visible := False; {$ENDIF SYNEDIT} +// TODO: Use IDE's editor font? +// FRichEdit.Font.Name := ''; +// FRichEdit.DefAttributes.Name := ''; FRichEdit.Lines.LoadFromFile(FileName); FRichEdit.Visible := True; end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-06 19:48:55
|
Revision: 4281 http://sourceforge.net/p/gexperts/code/4281 Author: akalwahome Date: 2024-07-06 19:48:54 +0000 (Sat, 06 Jul 2024) Log Message: ----------- SizeGrip defaults to the form. Modified Paths: -------------- trunk/Source/IDE/GX_IdeManagedForm.pas Modified: trunk/Source/IDE/GX_IdeManagedForm.pas =================================================================== --- trunk/Source/IDE/GX_IdeManagedForm.pas 2024-07-06 19:48:10 UTC (rev 4280) +++ trunk/Source/IDE/GX_IdeManagedForm.pas 2024-07-06 19:48:54 UTC (rev 4281) @@ -317,6 +317,8 @@ C := FForm.FindComponent('CancelButton'); if C is TButton then Target := TButton(C).Parent; + if not Assigned(Target) then + Target := FForm; if Assigned(Target) then GxSetWindowSizeGrip(Target.Handle, True); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aka...@us...> - 2024-07-06 19:48:12
|
Revision: 4280 http://sourceforge.net/p/gexperts/code/4280 Author: akalwahome Date: 2024-07-06 19:48:10 +0000 (Sat, 06 Jul 2024) Log Message: ----------- Some more DPI/scaling issues fixed. Modified Paths: -------------- trunk/Source/AsciiChart/GX_AsciiChart.pas Modified: trunk/Source/AsciiChart/GX_AsciiChart.pas =================================================================== --- trunk/Source/AsciiChart/GX_AsciiChart.pas 2024-07-06 19:47:49 UTC (rev 4279) +++ trunk/Source/AsciiChart/GX_AsciiChart.pas 2024-07-06 19:48:10 UTC (rev 4280) @@ -770,14 +770,17 @@ end; procedure TfmAsciiChart.doArrangeControls; +var + Spacer: Integer; begin + Spacer := FScaler.Calc(8); sb_Low.Left := 0; sb_High.Left := sb_Low.Left + sb_Low.Width + 1; - sb_Dec.Left := sb_High.Left + sb_High.Width + 8; + sb_Dec.Left := sb_High.Left + sb_High.Width + Spacer; sb_Hex.Left := sb_Dec.Left + sb_Dec.Width + 1; - edFontSize.Left := cbxFontName.Left + cbxFontName.Width + 8; - eChars.Left := edFontSize.Left + edFontSize.Width + updFontSize.Width + 8; + edFontSize.Left := cbxFontName.Left + cbxFontName.Width + Spacer; + eChars.Left := edFontSize.Left + edFontSize.Width + updFontSize.Width + Spacer; btnClear.Left := eChars.Left + eChars.Width + 1; actFontSize8.Caption := Format('Font size: %d', [FScaler.Calc(8)]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |