ProjectTemplates: Make Help button do something. Issue #28759, patch from Alexey Torgashin.

git-svn-id: trunk@49911 -
This commit is contained in:
juha 2015-10-02 11:28:07 +00:00
parent 35dea594e8
commit a74a689ec2
2 changed files with 39 additions and 20 deletions

View File

@ -1,53 +1,66 @@
object TemplateSettingsForm: TTemplateSettingsForm
Left = 470
Height = 127
Top = 175
Width = 400
Left = 472
Height = 103
Top = 287
Width = 409
HorzScrollBar.Page = 399
VertScrollBar.Page = 126
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Project templates settings'
ClientHeight = 127
ClientWidth = 400
ClientHeight = 103
ClientWidth = 409
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.31'
LCLVersion = '1.5'
Visible = False
object Label1: TLabel
Left = 8
AnchorSideLeft.Control = Owner
Left = 6
Height = 24
Top = 16
Top = 8
Width = 160
AutoSize = False
BorderSpacing.Around = 6
Caption = '&Directory with templates:'
FocusControl = DETemplates
Layout = tlCenter
ParentColor = False
end
object DETemplates: TDirectoryEdit
Left = 8
Height = 23
Top = 41
Width = 360
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 27
Top = 32
Width = 397
ShowHidden = False
ButtonWidth = 23
ButtonWidth = 40
NumGlyphs = 1
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
MaxLength = 0
TabOrder = 0
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 34
Top = 87
Width = 388
Height = 29
Top = 68
Width = 397
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
OKButton.OnClick = OKButtonClick
HelpButton.Name = 'HelpButton'
HelpButton.Enabled = False
HelpButton.DefaultCaption = True
HelpButton.OnClick = HelpButtonClick
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CloseButton.Enabled = False
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1
ShowButtons = [pbOK, pbCancel]
ShowButtons = [pbOK, pbCancel, pbHelp]
ShowBevel = False
end
end

View File

@ -5,7 +5,7 @@ unit frmtemplatesettings;
interface
uses
Forms, StdCtrls, EditBtn, ButtonPanel, ProjectTemplates;
Classes, LclIntf, Forms, StdCtrls, EditBtn, ButtonPanel, ProjectTemplates;
type
@ -16,6 +16,7 @@ type
DETemplates: TDirectoryEdit;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure HelpButtonClick(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
private
FTemplates : TProjectTemplates;
@ -45,6 +46,11 @@ begin
ButtonPanel1.CancelButton.Caption:=SbtnCancel;
end;
procedure TTemplateSettingsForm.HelpButtonClick(Sender: TObject);
begin
OpenUrl('http://wiki.lazarus.freepascal.org/Project_Templates');
end;
procedure TTemplateSettingsForm.OKButtonClick(Sender: TObject);
begin
if (Templates.TemplateDir<>DETemplates.Directory) then