moved TfrmGoto to separate file (gotofrm.pas)

converted gotofrm to .lfm
improved anchoring of new dialog

git-svn-id: trunk@16971 -
This commit is contained in:
darius 2008-10-11 22:13:02 +00:00
parent 3a28818930
commit 722a96542d
5 changed files with 298 additions and 118 deletions

3
.gitattributes vendored
View File

@ -2391,6 +2391,9 @@ ide/fpdocselectlink.pas svneol=native#text/plain
ide/frmcustomapplicationoptions.lfm svneol=native#text/plain
ide/frmcustomapplicationoptions.lrs svneol=native#text/plain
ide/frmcustomapplicationoptions.pas svneol=native#text/plain
ide/gotofrm.lfm svneol=native#text/plain
ide/gotofrm.lrs svneol=native#text/plain
ide/gotofrm.pas svneol=native#text/plain
ide/helpfpcmessages.pas svneol=native#text/plain
ide/helpmanager.lfm svneol=native#text/plain
ide/helpmanager.lrs svneol=native#text/plain

171
ide/gotofrm.lfm Normal file
View File

@ -0,0 +1,171 @@
object frmGoto: TfrmGoto
Left = 244
Height = 99
Top = 525
Width = 250
HelpContext = 0
ActiveControl = Edit1
Align = alNone
AllowDropFiles = False
AutoScroll = True
AutoSize = True
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'frmGoto'
ChildSizing.LeftRightSpacing = 0
ChildSizing.TopBottomSpacing = 0
ChildSizing.HorizontalSpacing = 0
ChildSizing.VerticalSpacing = 0
ChildSizing.ControlsPerLine = 0
ClientHeight = 99
ClientWidth = 250
DockSite = False
DragKind = dkDrag
DragMode = dmManual
Enabled = True
Font.Height = 0
Font.Style = []
FormStyle = fsNormal
ParentBiDiMode = True
ParentFont = False
Position = poDesigned
ShowInTaskBar = stDefault
UseDockManager = False
LCLVersion = '0.9.27'
WindowState = wsNormal
object Label1: TLabel
Left = 6
Height = 18
Top = 6
Width = 238
HelpContext = 0
Align = alTop
Alignment = taLeftJustify
AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Caption = 'Label1'
DragCursor = crDrag
DragMode = dmManual
Enabled = True
Layout = tlTop
ParentBidiMode = True
ParentColor = False
ParentFont = True
ParentShowHint = True
ShowAccelChar = True
Transparent = True
Visible = True
WordWrap = False
OptimalFill = False
end
object Edit1: TEdit
Left = 6
Height = 23
Top = 30
Width = 238
HelpContext = 0
Align = alTop
AutoSize = False
AutoSelect = False
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
CharCase = ecNormal
DragCursor = crDrag
DragMode = dmManual
EchoMode = emNormal
Enabled = True
MaxLength = -1
ParentBidiMode = True
OnKeyDown = Edit1KeyDown
ParentFont = True
ParentShowHint = True
PasswordChar = #0
ReadOnly = False
TabStop = True
TabOrder = 0
Text = 'Edit1'
Visible = True
end
object btnOK: TBitBtn
AnchorSideTop.Control = Edit1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnCancel
Left = 105
Height = 32
Top = 59
Width = 53
HelpContext = 0
Align = alNone
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Cancel = False
Caption = '&OK'
Default = True
Enabled = True
Kind = bkOK
Layout = blGlyphLeft
Margin = -1
ModalResult = 1
NumGlyphs = 0
ParentFont = True
ParentShowHint = True
Spacing = 3
TabOrder = 1
TabStop = True
Visible = True
end
object btnCancel: TBitBtn
AnchorSideTop.Control = Edit1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 164
Height = 34
Top = 59
Width = 80
HelpContext = 0
Align = alNone
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Cancel = True
Caption = 'Cancel'
Default = False
Enabled = True
Kind = bkCancel
Layout = blGlyphLeft
Margin = -1
ModalResult = 2
NumGlyphs = 0
ParentFont = True
ParentShowHint = True
Spacing = 3
TabOrder = 2
TabStop = True
Visible = True
end
end

55
ide/gotofrm.lrs Normal file
View File

@ -0,0 +1,55 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TfrmGoto','FORMDATA',[
'TPF0'#8'TfrmGoto'#7'frmGoto'#4'Left'#3#244#0#6'Height'#2'c'#3'Top'#3#13#2#5
+'Width'#3#250#0#11'HelpContext'#2#0#13'ActiveControl'#7#5'Edit1'#5'Align'#7#6
+'alNone'#14'AllowDropFiles'#8#10'AutoScroll'#9#8'AutoSize'#9#11'BorderIcons'
+#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#7'frmGoto'
+#28'ChildSizing.LeftRightSpacing'#2#0#28'ChildSizing.TopBottomSpacing'#2#0#29
+'ChildSizing.HorizontalSpacing'#2#0#27'ChildSizing.VerticalSpacing'#2#0#27'C'
+'hildSizing.ControlsPerLine'#2#0#12'ClientHeight'#2'c'#11'ClientWidth'#3#250
+#0#8'DockSite'#8#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'
+#9#11'Font.Height'#2#0#10'Font.Style'#11#0#9'FormStyle'#7#8'fsNormal'#14'Par'
+'entBiDiMode'#9#10'ParentFont'#8#8'Position'#7#10'poDesigned'#13'ShowInTaskB'
+'ar'#7#9'stDefault'#14'UseDockManager'#8#10'LCLVersion'#6#6'0.9.27'#11'Windo'
+'wState'#7#8'wsNormal'#0#6'TLabel'#6'Label1'#4'Left'#2#6#6'Height'#2#18#3'To'
+'p'#2#6#5'Width'#3#238#0#11'HelpContext'#2#0#5'Align'#7#5'alTop'#9'Alignment'
+#7#13'taLeftJustify'#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpaci'
+'ng.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'Bor'
+'derSpacing.Around'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31
+'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#6'Label1'#10'Dra'
+'gCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#6'Layout'#7#5't'
+'lTop'#14'ParentBidiMode'#9#11'ParentColor'#8#10'ParentFont'#9#14'ParentShow'
+'Hint'#9#13'ShowAccelChar'#9#11'Transparent'#9#7'Visible'#9#8'WordWrap'#8#11
+'OptimalFill'#8#0#0#5'TEdit'#5'Edit1'#4'Left'#2#6#6'Height'#2#23#3'Top'#2#30
+#5'Width'#3#238#0#11'HelpContext'#2#0#5'Align'#7#5'alTop'#8'AutoSize'#8#10'A'
+'utoSelect'#8#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'Border'
+'Spacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#6
+'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlign'
+'Vertical'#7#7'ccaFill'#8'CharCase'#7#8'ecNormal'#10'DragCursor'#7#6'crDrag'
+#8'DragMode'#7#8'dmManual'#8'EchoMode'#7#8'emNormal'#7'Enabled'#9#9'MaxLengt'
+'h'#2#255#14'ParentBidiMode'#9#9'OnKeyDown'#7#12'Edit1KeyDown'#10'ParentFont'
+#9#14'ParentShowHint'#9#12'PasswordChar'#6#1#0#8'ReadOnly'#8#7'TabStop'#9#8
+'TabOrder'#2#0#4'Text'#6#5'Edit1'#7'Visible'#9#0#0#7'TBitBtn'#5'btnOK'#21'An'
+'chorSideTop.Control'#7#5'Edit1'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'An'
+'chorSideRight.Control'#7#9'btnCancel'#4'Left'#2'i'#6'Height'#2' '#3'Top'#2
+';'#5'Width'#2'5'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#7'Anchors'#11#5'a'
+'kTop'#7'akRight'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacin'
+'g.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'Bord'
+'erSpacing.Around'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'B'
+'orderSpacing.CellAlignVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#3'&OK'
+#7'Default'#9#7'Enabled'#9#4'Kind'#7#4'bkOK'#6'Layout'#7#11'blGlyphLeft'#6'M'
+'argin'#2#255#11'ModalResult'#2#1#9'NumGlyphs'#2#0#10'ParentFont'#9#14'Paren'
+'tShowHint'#9#7'Spacing'#2#3#8'TabOrder'#2#1#7'TabStop'#9#7'Visible'#9#0#0#7
+'TBitBtn'#9'btnCancel'#21'AnchorSideTop.Control'#7#5'Edit1'#18'AnchorSideTop'
+'.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideR'
+'ight.Side'#7#9'asrBottom'#4'Left'#3#164#0#6'Height'#2'"'#3'Top'#2';'#5'Widt'
+'h'#2'P'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#7'Anchors'#11#5'akTop'#7'a'
+'kRight'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0
+#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.A'
+'round'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacin'
+'g.CellAlignVertical'#7#7'ccaFill'#6'Cancel'#9#7'Caption'#6#6'Cancel'#7'Defa'
+'ult'#8#7'Enabled'#9#4'Kind'#7#8'bkCancel'#6'Layout'#7#11'blGlyphLeft'#6'Mar'
+'gin'#2#255#11'ModalResult'#2#2#9'NumGlyphs'#2#0#10'ParentFont'#9#14'ParentS'
+'howHint'#9#7'Spacing'#2#3#8'TabOrder'#2#2#7'TabStop'#9#7'Visible'#9#0#0#0
]);

68
ide/gotofrm.pas Normal file
View File

@ -0,0 +1,68 @@
unit GotoFrm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Buttons, LazarusIDEStrConsts, LCLType;
type
{ TfrmGoto }
TfrmGoto = class(TForm)
Label1: TLabel;
Edit1: TEdit;
btnOK: TBitbtn;
btnCancel: TBitBtn;
procedure Edit1KeyDown(Sender: TObject; var Key:Word; Shift:TShiftState);
public
constructor Create(AOwner: TComponent); override;
procedure DoShow; override;
end;
implementation
{ TfrmGoto }
constructor TfrmGoto.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Caption := lisMenuGotoLine;
Label1.Caption := lisUEGotoLine;
Edit1.Caption := '';
btnOK.LoadGlyphFromLazarusResource('btn_ok');
btnCancel.LoadGlyphFromLazarusResource('btn_cancel');
end;
procedure TfrmGoto.DoShow;
begin
Edit1.SelectAll;
Edit1.SetFocus;
inherited DoShow;
end;
procedure TfrmGoto.Edit1KeyDown(Sender: TObject; var Key:Word;
Shift:TShiftState);
begin
if (Key=VK_RETURN) then
begin
ModalResult:=mrOk;
Key := 0;
end;
if (Key=VK_ESCAPE) then
begin
ModalResult:=mrCancel;
Key := 0;
end;
end;
initialization
{$I gotofrm.lrs}
end.

View File

@ -62,7 +62,7 @@ uses
SortSelectionDlg, EncloseSelectionDlg, DiffDialog, ConDef, InvertAssignTool,
SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,
FPDocHints, FPDocEditWindow,
BaseDebugManager, Debugger, MainIntf;
BaseDebugManager, Debugger, MainIntf, GotoFrm;
type
TSourceNotebook = class;
@ -802,20 +802,6 @@ var
//=============================================================================
{ Goto dialog }
type
TfrmGoto = class(TForm)
Label1: TLabel;
Edit1: TEdit;
ButtonPanel: TPanel;
btnOK: TBitbtn;
btnCancel: TBitBtn;
procedure Edit1KeyDown(Sender: TObject; var Key:Word; Shift:TShiftState);
public
constructor Create(AOwner: TComponent); override;
procedure DoShow; override;
end;
const
SourceEditorMenuRootName = 'SourceEditor';
@ -6582,109 +6568,6 @@ begin
FOnCloseClicked(Sender,GetKeyState(VK_CONTROL)<0);
end;
{ TfrmGoto }
constructor TfrmGoto.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Position := poDesigned;
Width := 250;
Height := 115;
Caption := lisMenuGotoLine;
BorderStyle:= bsDialog;
ChildSizing.SetGridSpacing(6);
Label1 := TLabel.Create(Self);
with Label1 do
begin
Name:='Label1';
Parent := Self;
Left := 6;
Top := 6;
AnchorParallel(akRight,5,Parent);
Caption := lisUEGotoLine;
end;
Edit1 := TEdit.Create(Self);
with Edit1 do
begin
Name:='Edit1';
Parent := self;
Left := 6;
AnchorToNeighbour(akTop,6,Label1);
AnchorParallel(akRight,6,Parent);
Constraints.MinWidth:=200;
Caption := '';
OnKeyDown:=@Edit1KeyDown;
end;
ButtonPanel := TPanel.Create(Self);
with ButtonPanel do
begin
Name:='ButtonPanel';
Align:=alBottom;
AnchorToNeighbour(akTop,0,Edit1);
AutoSize:=true;
BevelOuter:=bvNone;
Caption:='';
Parent:=Self;
end;
btnCancel := TBitbtn.Create(Self);
with btnCancel do
begin
Name:='btnCancel';
AnchorParallel(akTop,0,ButtonPanel);
AnchorParallel(akBottom,0,ButtonPanel);
AnchorParallel(akRight,6,ButtonPanel);
Anchors:=Anchors-[akLeft];
Kind := bkCancel;
AutoSize:=true;
Default:=false;
Parent := ButtonPanel;
end;
btnOK := TBitbtn.Create(Self);
with btnOK do
begin
Name:='btnOK';
AnchorParallel(akTop,0,ButtonPanel);
AnchorParallel(akBottom,0,ButtonPanel);
AnchorToNeighbour(akRight,6,btnCancel);
Anchors:=Anchors-[akLeft];
Kind := bkOK;
Default:=true;
AutoSize:=true;
Parent := ButtonPanel;
end;
AutoSize := True;
ActiveControl := Edit1;
end;
procedure TfrmGoto.DoShow;
begin
Edit1.SelectAll;
Edit1.SetFocus;
inherited DoShow;
end;
procedure TfrmGoto.Edit1KeyDown(Sender: TObject; var Key:Word;
Shift:TShiftState);
begin
if (Key=VK_RETURN) then
begin
ModalResult:=mrOk;
Key := 0;
end;
if (Key=VK_ESCAPE) then
begin
ModalResult:=mrCancel;
Key := 0;
end;
end;
{ TSynEditPlugin1 }
constructor TSynEditPlugin1.Create(AOwner: TCustomSynEdit);