diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2011-01-10 23:49:53 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-11 09:45:39 +0200 |
commit | 718a6197155cdb0cd48605c2a914cc08f39395be (patch) | |
tree | a657efe54a2ab30257bf3870c6ee0dd533726ce6 /docview | |
parent | aa1bf45f5709d5449e8981aa42899a0830318ad9 (diff) | |
download | fpGUI-718a6197155cdb0cd48605c2a914cc08f39395be.tar.xz |
Splitter handling improvement in main form
* PageControl now has a MinWidth set, so that making it ridiculously
small doesn't scew with the widget anchors.
* Due to above change the default splitter snapping doesn't occur.
So now we worked around that using a new OnDoubleClick event handler,
by simply making the pagecontrol visible or not.
Diffstat (limited to 'docview')
-rw-r--r-- | docview/src/docview.lpi | 7 | ||||
-rw-r--r-- | docview/src/frm_main.pas | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/docview/src/docview.lpi b/docview/src/docview.lpi index 144c1c30..deee6be5 100644 --- a/docview/src/docview.lpi +++ b/docview/src/docview.lpi @@ -11,6 +11,9 @@ <Title Value="docview"/> <UseAppBundle Value="False"/> </General> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -203,8 +206,8 @@ <CompilerOptions> <Version Value="9"/> <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)/"/> - <OtherUnitFiles Value="../components/richtext/"/> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="../components/richtext"/> <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index ee555f62..614c557b 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -98,6 +98,7 @@ type OpenAdditionalFile: boolean; Notes: TList; // Notes in current files. + procedure Splitter1DoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure btnTBNoteAddClick(Sender: TObject); procedure RichViewOverLink(Sender: TRichTextView; Link: string); procedure RichViewNotOverLink(Sender: TRichTextView; Link: string); @@ -274,6 +275,13 @@ begin end end; +procedure TMainForm.Splitter1DoubleClicked(Sender: TObject; + AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); +begin + PageControl1.Visible := not PageControl1.Visible; + bvlBody.Realign; +end; + procedure TMainForm.btnTBNoteAddClick(Sender: TObject); begin AddNote; @@ -2547,6 +2555,7 @@ begin Hint := ''; TabOrder := 0; Align := alLeft; + MinWidth := 120; OnChange := @PageControl1Change; end; @@ -2910,6 +2919,7 @@ begin Name := 'Splitter1'; SetPosition(265, 120, 8, 168); Align := alLeft; + OnDoubleClick :=@Splitter1DoubleClicked; end; RichView := TRichTextView.Create(bvlBody); |