OnGuard: Fix error in About box due to unknown Font.Color=clText. Rework form design for anchoring and autosizing. Open hyperlinks with OpenURL rather than windows-specific ShellExecute.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8715 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-19 21:52:50 +00:00
parent 0d61deccb6
commit 1db7476596
4 changed files with 744 additions and 661 deletions

View File

@ -4,7 +4,7 @@
<Name Value="tponguard"/> <Name Value="tponguard"/>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<AddToProjectUsesSection Value="True"/> <AddToProjectUsesSection Value="True"/>
<Author Value="Turbo Power Software Company ,Colorado Springs"/> <Author Value="Turbo Power Software Company, Colorado Springs"/>
<CompilerOptions> <CompilerOptions>
<Version Value="11"/> <Version Value="11"/>
<SearchPaths> <SearchPaths>

View File

@ -1,174 +1,231 @@
object OgAboutForm: TOgAboutForm object OgAboutForm: TOgAboutForm
Left = 526 Left = 526
Height = 271 Height = 363
Top = 236 Top = 236
Width = 365 Width = 434
ActiveControl = btnOK ActiveControl = btnOK
AutoSize = True
BorderIcons = [biSystemMenu, biMinimize] BorderIcons = [biSystemMenu, biMinimize]
Caption = 'About TurboPower OnGuard' Caption = 'About TurboPower OnGuard'
ClientHeight = 271 ClientHeight = 363
ClientWidth = 365 ClientWidth = 434
Color = clForm Color = clForm
Font.Color = clText
Font.Height = 11
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
OnCreate = FormCreate OnCreate = FormCreate
OnMouseMove = FormMouseMove OnMouseMove = FormMouseMove
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.27' LCLVersion = '2.3.0.0'
object b0: TBevel object b0: TBevel
Left = 4 AnchorSideLeft.Control = Owner
Height = 13 AnchorSideTop.Control = Panel1
Top = 191 AnchorSideTop.Side = asrBottom
Width = 301 AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 6
Top = 261
Width = 422
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 6
Shape = bsTopLine Shape = bsTopLine
end end
object l1: TLabel object l1: TLabel
Left = 110 AnchorSideLeft.Control = Panel1
Height = 14 AnchorSideLeft.Side = asrBottom
Top = 6 AnchorSideTop.Control = Panel1
Width = 52 Left = 147
Height = 21
Top = 4
Width = 68
Caption = 'OnGuard' Caption = 'OnGuard'
Font.Color = clText Font.Height = -16
Font.Height = 9
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
Font.Style = [fsBold] Font.Style = [fsBold]
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
end end
object lblVersion: TLabel object lblVersion: TLabel
Left = 110 AnchorSideLeft.Control = Panel1
Height = 14 AnchorSideLeft.Side = asrBottom
Top = 24 AnchorSideTop.Control = l1
Width = 60 AnchorSideTop.Side = asrBottom
Left = 147
Height = 15
Top = 25
Width = 62
Caption = 'Version 1.20' Caption = 'Version 1.20'
Font.Color = clText
Font.Height = 8
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
end end
object l2: TLabel object l2: TLabel
Left = 111 AnchorSideLeft.Control = Panel1
Height = 14 AnchorSideLeft.Side = asrBottom
Top = 72 AnchorSideTop.Control = l4
Width = 103 AnchorSideTop.Side = asrBottom
Left = 147
Height = 15
Top = 71
Width = 118
BorderSpacing.Top = 8
Caption = 'OnGuard home page:' Caption = 'OnGuard home page:'
Font.Style = [fsBold]
ParentColor = False ParentColor = False
ParentFont = False
end end
object WebLbl: TLabel object WebLbl: TLabel
AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = l2
AnchorSideTop.Side = asrBottom
Cursor = crHandPoint Cursor = crHandPoint
Left = 120 Left = 155
Height = 14 Height = 15
Top = 88 Top = 86
Width = 201 Width = 226
BorderSpacing.Left = 12
Caption = 'http://sourceforge.net/projects/tponguard' Caption = 'http://sourceforge.net/projects/tponguard'
Font.Color = clNavy Font.Color = clNavy
Font.Height = 8
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
OnClick = WebLblClick OnClick = WebLblClick
OnMouseMove = WebLblMouseMove OnMouseMove = WebLblMouseMove
end end
object l3: TLabel object l3: TLabel
Left = 110 AnchorSideLeft.Control = Panel1
Height = 14 AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblVersion
AnchorSideTop.Side = asrBottom
Left = 147
Height = 15
Top = 48 Top = 48
Width = 187 Width = 201
BorderSpacing.Top = 8
Caption = 'Released under the Mozilla License 1.1' Caption = 'Released under the Mozilla License 1.1'
ParentColor = False ParentColor = False
end end
object l4: TLabel object l4: TLabel
Left = 304 AnchorSideLeft.Control = l3
Height = 14 AnchorSideLeft.Side = asrBottom
Left = 356
Height = 15
Top = 48 Top = 48
Width = 47 Width = 50
BorderSpacing.Left = 8
BorderSpacing.Right = 8
Caption = '(MPL 1.1)' Caption = '(MPL 1.1)'
ParentColor = False ParentColor = False
end end
object l5: TLabel object l5: TLabel
Left = 5 AnchorSideLeft.Control = Owner
Height = 14 AnchorSideTop.Control = b0
Top = 197 AnchorSideTop.Side = asrBottom
Width = 274 Left = 6
Height = 15
Top = 267
Width = 305
BorderSpacing.Left = 6
Caption = 'Copyright (C) 1997-2002, TurboPower Software Company.' Caption = 'Copyright (C) 1997-2002, TurboPower Software Company.'
ParentColor = False ParentColor = False
end end
object l6: TLabel object l6: TLabel
Left = 5 AnchorSideLeft.Control = Owner
Height = 14 AnchorSideTop.Control = l5
Top = 217 AnchorSideTop.Side = asrBottom
Width = 87 Left = 6
Height = 15
Top = 284
Width = 97
BorderSpacing.Left = 6
BorderSpacing.Top = 2
Caption = 'All rights reserved.' Caption = 'All rights reserved.'
ParentColor = False ParentColor = False
end end
object l7: TLabel object l7: TLabel
Left = 110 AnchorSideLeft.Control = Panel1
Height = 14 AnchorSideLeft.Side = asrBottom
Top = 152 AnchorSideTop.Control = WebLbl1
Width = 91 AnchorSideTop.Side = asrBottom
Left = 147
Height = 15
Top = 147
Width = 106
BorderSpacing.Top = 8
Caption = 'Online newsgroups' Caption = 'Online newsgroups'
Font.Style = [fsBold]
ParentColor = False ParentColor = False
ParentFont = False
end end
object NewsLbl: TLabel object NewsLbl: TLabel
AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = l7
AnchorSideTop.Side = asrBottom
Cursor = crHandPoint Cursor = crHandPoint
Left = 120 Left = 155
Height = 14 Height = 15
Top = 168 Top = 162
Width = 230 Width = 256
BorderSpacing.Left = 12
BorderSpacing.Right = 8
Caption = 'https://sourceforge.net/forum/?group_id=71010' Caption = 'https://sourceforge.net/forum/?group_id=71010'
Font.Color = clNavy Font.Color = clNavy
Font.Height = 8
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
OnClick = NewsLblClick OnClick = NewsLblClick
OnMouseMove = NewsLblMouseMove OnMouseMove = NewsLblMouseMove
end end
object l8: TLabel object l8: TLabel
Left = 111 AnchorSideLeft.Control = Panel1
Height = 14 AnchorSideLeft.Side = asrBottom
Top = 112 AnchorSideTop.Control = WebLbl
Width = 62 AnchorSideTop.Side = asrBottom
Left = 147
Height = 15
Top = 109
Width = 71
BorderSpacing.Top = 8
Caption = 'Lazarus port:' Caption = 'Lazarus port:'
Font.Style = [fsBold]
ParentColor = False ParentColor = False
ParentFont = False
end end
object WebLbl1: TLabel object WebLbl1: TLabel
AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = l8
AnchorSideTop.Side = asrBottom
Cursor = crHandPoint Cursor = crHandPoint
Left = 120 Left = 155
Height = 14 Height = 15
Top = 128 Top = 124
Width = 204 Width = 225
BorderSpacing.Left = 12
Caption = 'http://wiki.lazarus.freepascal.org/OnGuard' Caption = 'http://wiki.lazarus.freepascal.org/OnGuard'
Font.Color = clNavy Font.Color = clNavy
Font.Height = 8
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
OnClick = WebLbl1Click OnClick = WebLbl1Click
OnMouseMove = WebLbl1MouseMove OnMouseMove = WebLbl1MouseMove
end end
object Panel1: TPanel object Panel1: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 4 Left = 4
Height = 182 Height = 251
Top = 4 Top = 4
Width = 101 Width = 139
AutoSize = True
BorderSpacing.Around = 4
BevelOuter = bvLowered BevelOuter = bvLowered
ClientHeight = 182 ClientHeight = 251
ClientWidth = 101 ClientWidth = 139
ParentBackground = False
TabOrder = 0 TabOrder = 0
object Image1: TImage object Image1: TImage
Left = 1 Left = 1
Height = 180 Height = 249
Top = 1 Top = 1
Width = 99 Width = 137
Align = alClient Align = alClient
Picture.Data = { Picture.Data = {
07545069786D6170CF8C00002F2A2058504D202A2F0A73746174696320636861 07545069786D6170CF8C00002F2A2058504D202A2F0A73746174696320636861
@ -1299,17 +1356,29 @@ object OgAboutForm: TOgAboutForm
2A2C2A6A2D2A2C752D2A2C2A2C712A2C5A2C2C712C2A2C752C2A2D2C716A2C2C 2A2C2A6A2D2A2C752D2A2C2A2C712A2C5A2C2C712C2A2C752C2A2D2C716A2C2C
2C2D6A2C2C2D2C6A2D2C702C2D6A2D2C2C692D2C692C702C227D0A 2C2D6A2C2C2D2C6A2D2C702C2D6A2D2C2C692D2C692C702C227D0A
} }
Proportional = True
Stretch = True Stretch = True
end end
end end
object btnOK: TButton object btnOK: TButton
Left = 280 AnchorSideLeft.Control = Owner
Height = 22 AnchorSideLeft.Side = asrCenter
Top = 232 AnchorSideTop.Control = l6
Width = 64 AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 343
Height = 25
Top = 301
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.Top = 2
BorderSpacing.Right = 16
BorderSpacing.Bottom = 16
BorderSpacing.InnerBorder = 4 BorderSpacing.InnerBorder = 4
Cancel = True Cancel = True
Caption = 'OK' Caption = 'OK'
Default = True
ModalResult = 2 ModalResult = 2
OnClick = btnOKClick OnClick = btnOKClick
TabOrder = 1 TabOrder = 1

File diff suppressed because it is too large Load Diff

View File

@ -40,14 +40,12 @@ unit qogabout0; {AH.01}
interface interface
uses uses
{$IFDEF MSWINDOWS} Windows, {$ENDIF} {AH.01} LCLIntf,
SysUtils, Classes, SysUtils, Classes,
Graphics, Controls,Buttons, Forms, Dialogs, StdCtrls, ExtCtrls, Graphics, Controls,Buttons, Forms, Dialogs, StdCtrls, ExtCtrls,
ogutil, ogutil,
{$IFDEF MSWINDOWS} ShellAPI, {$ENDIF} {AH.01}
ComponentEditors, ComponentEditors,
PropEdits; PropEdits;
// LazarusPackageIntf;
@ -103,8 +101,9 @@ type
end; end;
implementation implementation
uses uses
LResources; LResources;
@ -144,20 +143,14 @@ end;
procedure TOgAboutForm.WebLbl1Click(Sender: TObject); procedure TOgAboutForm.WebLbl1Click(Sender: TObject);
begin begin
{$IFDEF MSWINDOWS} OpenURL('http://wiki.lazarus.freepascal.org/OnGuard');
if ShellExecute(0, 'open', PChar('http://wiki.lazarus.freepascal.org/OnGuard'),
'', '', SW_SHOWNORMAL) <= 32 then
ShowMessage('Unable to start web browser');
{$ELSE}
ShowMessage('Unable to start web browser');
{$ENDIF}
WebLbl.Font.Color := clNavy; WebLbl.Font.Color := clNavy;
end; end;
procedure TOgAboutForm.WebLbl1MouseMove(Sender: TObject; Shift: TShiftState; X, procedure TOgAboutForm.WebLbl1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer); Y: Integer);
begin begin
WebLbl1.Font.Color := clRed; WebLbl1.Font.Color := clRed;
end; end;
procedure TOgAboutForm.WebLblMouseMove(Sender: TObject; Shift: TShiftState; procedure TOgAboutForm.WebLblMouseMove(Sender: TObject; Shift: TShiftState;
@ -188,25 +181,13 @@ end;
procedure TOgAboutForm.WebLblClick(Sender: TObject); procedure TOgAboutForm.WebLblClick(Sender: TObject);
begin begin
{$IFDEF MSWINDOWS} OpenURL('http://sourceforge.net/projects/tponguard');
if ShellExecute(0, 'open', PChar('http://sourceforge.net/projects/tponguard'),
'', '', SW_SHOWNORMAL) <= 32 then
ShowMessage('Unable to start web browser');
{$ELSE}
ShowMessage('Unable to start web browser');
{$ENDIF}
WebLbl.Font.Color := clNavy; WebLbl.Font.Color := clNavy;
end; end;
procedure TOgAboutForm.NewsLblClick(Sender: TObject); procedure TOgAboutForm.NewsLblClick(Sender: TObject);
begin begin
{$IFDEF MSWINDOWS} OpenURL('https://sourceforge.net/forum/?group_id=71010');
if ShellExecute(0, 'open', PChar('https://sourceforge.net/forum/?group_id=71010'),
'', '', SW_SHOWNORMAL) <= 32 then
ShowMessage('Unable to start news reader');
{$ELSE}
ShowMessage('Unable to start news reader');
{$ENDIF}
NewsLbl.Font.Color := clNavy; NewsLbl.Font.Color := clNavy;
end; end;