LazDE doceditor - patch from alexs:

1. Fixed mainform toolbar autosizing with newautosize;
2. Display hint in statusbar.

git-svn-id: trunk@24053 -
This commit is contained in:
maxim 2010-03-16 21:33:34 +00:00
parent d2280da4c6
commit 66978feef5
2 changed files with 34 additions and 44 deletions

View File

@ -7,7 +7,7 @@ object MainForm: TMainForm
VertScrollBar.Page = 523 VertScrollBar.Page = 523
ActiveControl = Splitter1 ActiveControl = Splitter1
Caption = 'MainForm' Caption = 'MainForm'
ClientHeight = 524 ClientHeight = 519
ClientWidth = 602 ClientWidth = 602
Menu = MMain Menu = MMain
OnCloseQuery = MainFormCloseQuery OnCloseQuery = MainFormCloseQuery
@ -19,6 +19,7 @@ object MainForm: TMainForm
Height = 30 Height = 30
Top = 0 Top = 0
Width = 602 Width = 602
AutoSize = True
ButtonHeight = 28 ButtonHeight = 28
ButtonWidth = 28 ButtonWidth = 28
Caption = 'TBMain' Caption = 'TBMain'
@ -129,20 +130,20 @@ object MainForm: TMainForm
end end
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Height = 23 Height = 21
Top = 501 Top = 498
Width = 602 Width = 602
Panels = <> Panels = <>
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 0 Left = 0
Height = 471 Height = 468
Top = 30 Top = 30
Width = 5 Width = 5
end end
object PCFiles: TPageControl object PCFiles: TPageControl
Left = 5 Left = 5
Height = 471 Height = 468
Top = 30 Top = 30
Width = 597 Width = 597
Align = alClient Align = alClient
@ -4137,4 +4138,9 @@ object MainForm: TMainForm
Action = EditSelectAll1 Action = EditSelectAll1
end end
end end
object ApplicationProperties1: TApplicationProperties
OnHint = ApplicationProperties1Hint
left = 312
top = 146
end
end end

View File

@ -59,6 +59,7 @@ type
ANew: TAction; ANew: TAction;
ANewFromFile: TAction; ANewFromFile: TAction;
AOpen: TAction; AOpen: TAction;
ApplicationProperties1: TApplicationProperties;
ASave: TAction; ASave: TAction;
ASaveAs: TAction; ASaveAs: TAction;
AClose: TAction; AClose: TAction;
@ -147,6 +148,7 @@ type
procedure AExtraOptionsExecute(Sender: TObject); procedure AExtraOptionsExecute(Sender: TObject);
procedure AFormatParagraphHint(var HintStr: string; var CanShow: Boolean); procedure AFormatParagraphHint(var HintStr: string; var CanShow: Boolean);
procedure AHelpAboutExecute(Sender: TObject); procedure AHelpAboutExecute(Sender: TObject);
procedure ApplicationProperties1Hint(Sender: TObject);
procedure CanFormat(Sender: TObject); procedure CanFormat(Sender: TObject);
procedure AInsertLinkExecute(Sender: TObject); procedure AInsertLinkExecute(Sender: TObject);
procedure AInsertLinkUpdate(Sender: TObject); procedure AInsertLinkUpdate(Sender: TObject);
@ -222,20 +224,17 @@ var
function MessageDlg(Fmt: string; Args : Array of const; DlgType: TMsgDlgType; function MessageDlg(Fmt: string; Args : Array of const; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer; Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
begin begin
Result:=Dialogs.MessageDlg(Format(Fmt,Args),DlgType,Buttons,HelpCtx); Result:=Dialogs.MessageDlg(Format(Fmt,Args),DlgType,Buttons,HelpCtx);
end; end;
function MessageDlg(Fmt: string; Args : Array of const; DlgType: TMsgDlgType; function MessageDlg(Fmt: string; Args : Array of const; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons): Integer; Buttons: TMsgDlgButtons): Integer;
begin begin
Result:=Dialogs.MessageDlg(Format(Fmt,Args),DlgType,Buttons,0); Result:=Dialogs.MessageDlg(Format(Fmt,Args),DlgType,Buttons,0);
end; end;
function MessageDlg(Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): Integer; function MessageDlg(Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): Integer;
begin begin
Result:=Dialogs.MessageDlg(Msg,DlgType,Buttons,0); Result:=Dialogs.MessageDlg(Msg,DlgType,Buttons,0);
end; end;
@ -249,8 +248,7 @@ Type
FileName : String; FileName : String;
end; end;
Procedure TMainForm.FileReopen(Sender: TObject); procedure TMainForm.FileReopen(Sender: TObject);
begin begin
OpenFile((Sender as TRecentMenuItem).FileName); OpenFile((Sender as TRecentMenuItem).FileName);
end; end;
@ -296,7 +294,6 @@ end;
procedure TMainForm.ACloseExecute(Sender: TObject); procedure TMainForm.ACloseExecute(Sender: TObject);
begin begin
if Sender=nil then ;
CloseEditor(CurrentEditor); CloseEditor(CurrentEditor);
end; end;
@ -325,6 +322,11 @@ begin
ShowAbout; ShowAbout;
end; end;
procedure TMainForm.ApplicationProperties1Hint(Sender: TObject);
begin
StatusBar1.SimpleText:=Application.Hint;
end;
procedure TMainForm.CanFormat(Sender: TObject); procedure TMainForm.CanFormat(Sender: TObject);
Var Var
B : Boolean; B : Boolean;
@ -424,20 +426,17 @@ begin
end; end;
procedure TMainForm.InsertStructure(Sender: TObject); procedure TMainForm.InsertStructure(Sender: TObject);
begin begin
InsertNode(TNodeType((Sender as TAction).Tag)); InsertNode(TNodeType((Sender as TAction).Tag));
end; end;
procedure TMainForm.MainFormCloseQuery(Sender: TObject; var CanClose: boolean); procedure TMainForm.MainFormCloseQuery(Sender: TObject; var CanClose: boolean);
begin begin
if Sender=nil then ;
CanClose:=AllowClose; CanClose:=AllowClose;
end; end;
procedure TMainForm.MainFormDestroy(Sender: TObject); procedure TMainForm.MainFormDestroy(Sender: TObject);
begin begin
if Sender=nil then ;
SaveOptions; SaveOptions;
SaveRecent; SaveRecent;
FreeAndNil(FRecent); FreeAndNil(FRecent);
@ -447,7 +446,8 @@ procedure TMainForm.QuickLinkClick(Sender: TObject);
var var
Selection : string; Selection : string;
begin begin
if Assigned(CurrentEditor) then begin if Assigned(CurrentEditor) then
begin
Selection := CurrentEditor.CurrentSelection; Selection := CurrentEditor.CurrentSelection;
if Selection <> '' then if Selection <> '' then
CurrentEditor.InsertLink(CurrentEditor.CurrentElement['name'] + '.' + Selection, Selection) CurrentEditor.InsertLink(CurrentEditor.CurrentElement['name'] + '.' + Selection, Selection)
@ -472,7 +472,6 @@ procedure TMainForm.BuildReopenList;
var I : integer; var I : integer;
mi : TRecentMenuItem; mi : TRecentMenuItem;
begin begin
with MIRecent do with MIRecent do
begin begin
@ -486,9 +485,8 @@ begin
end; end;
procedure TMainForm.AddTorecent(FN: String); procedure TMainForm.AddTorecent(FN: String);
Var var
Index : Integer; Index : Integer;
begin begin
FN:=ExpandFileNameUTF8(FN); FN:=ExpandFileNameUTF8(FN);
With FRecent do With FRecent do
@ -604,7 +602,7 @@ end;
procedure TMainForm.OpenFile(FN: String); procedure TMainForm.OpenFile(FN: String);
begin begin
IF (FN<>'') then if (FN<>'') then
begin begin
If FileExistsUTF8(FN) then If FileExistsUTF8(FN) then
With CreatePage do With CreatePage do
@ -616,10 +614,8 @@ begin
end; end;
procedure TMainForm.SaveEditorAs(E: TEditorPage); procedure TMainForm.SaveEditorAs(E: TEditorPage);
var var
Fn : String; Fn : String;
begin begin
with SDMain do with SDMain do
begin begin
@ -667,9 +663,8 @@ begin
end; end;
procedure TMainForm.LoadCommandLine; procedure TMainForm.LoadCommandLine;
Var var
I : Integer; I : Integer;
begin begin
I:=1; I:=1;
While I<=ParamCount do While I<=ParamCount do
@ -681,10 +676,9 @@ begin
end; end;
procedure TMainForm.LoadRecent; procedure TMainForm.LoadRecent;
Var var
I,Count : Integer; I,Count : Integer;
S : String; S : String;
begin begin
FRecent.Clear; FRecent.Clear;
With TInifile.Create(UTF8ToSys(GetoptionFileName)) do begin With TInifile.Create(UTF8ToSys(GetoptionFileName)) do begin
@ -700,7 +694,7 @@ begin
end; end;
procedure TMainForm.SaveRecent; procedure TMainForm.SaveRecent;
Var var
I : Integer; I : Integer;
begin begin
With TInifile.Create(UTF8ToSys(GetoptionFileName)) do With TInifile.Create(UTF8ToSys(GetoptionFileName)) do
@ -735,7 +729,6 @@ begin
end; end;
function TMainForm.AllowClose: Boolean; function TMainForm.AllowClose: Boolean;
begin begin
Result:=True; Result:=True;
While (PCFiles.PageCount>0) and Result do While (PCFiles.PageCount>0) and Result do
@ -758,10 +751,8 @@ Type
Function CreateSkeletonFile(Const S : TSkeletonData) : Boolean; Function CreateSkeletonFile(Const S : TSkeletonData) : Boolean;
var
Var
Cmd : String; Cmd : String;
begin begin
With S do With S do
begin begin
@ -807,11 +798,9 @@ begin
end; end;
Procedure TMainForm.NewFromFile; Procedure TMainForm.NewFromFile;
var
Var
SkeletonData : TSkeletonData; SkeletonData : TSkeletonData;
OK : Boolean; OK : Boolean;
begin begin
With TMakeSkelform.Create(Self) do With TMakeSkelform.Create(Self) do
try try
@ -884,10 +873,9 @@ begin
end; end;
end; end;
Procedure TMainForm.InsertLink; procedure TMainForm.InsertLink;
begin begin
If Assigned(CurrentEditor) then if Assigned(CurrentEditor) then
With TLinkForm.Create(Self) do With TLinkForm.Create(Self) do
Try Try
Caption:=SInsertLink; Caption:=SInsertLink;
@ -906,12 +894,10 @@ begin
end; end;
Procedure TMainForm.InsertTable; Procedure TMainForm.InsertTable;
var
Var
R,C : Integer; R,C : Integer;
begin begin
With TTableForm.Create(Self) do with TTableForm.Create(Self) do
try try
Caption:=SInsertTable; Caption:=SInsertTable;
SERows.Text:=IntToStr(3); SERows.Text:=IntToStr(3);
@ -967,12 +953,10 @@ begin
end; end;
procedure TMainForm.GetCurrentFiles(List: TStrings); procedure TMainForm.GetCurrentFiles(List: TStrings);
var
Var
I : Integer; I : Integer;
begin begin
For I:=0 to PCFiles.PageCount-1 do for I:=0 to PCFiles.PageCount-1 do
List.Add(TEditorPage(PCFiles.Pages[i]).FileName); List.Add(TEditorPage(PCFiles.Pages[i]).FileName);
end; end;