View Issue Details

IDProjectCategoryView StatusLast Update
0038839LazarusPackagespublic2021-05-03 09:29
ReporterAndrey Zubarev Assigned ToMichl  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status assignedResolutionopen 
Product Version2.0.13 (SVN) 
Summary0038839: AnchorDocking option to disable standard form header, leave only AnchorDockHeader for undocked forms
DescriptionAnchorDocking option to disable standard form header, leave only AnchorDockHeader for undocked forms.
I think this should be done, often users do not understand and try dock with the standard header.
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

Michl

2021-05-01 13:06

developer   ~0130701

Just loud thinking. We already have option "Show header", what does the same thing but revert. Maybe we can improve AnchorDocking to make forms dockable with TitleBar. And maybe, if there is just one AnchorDockHostSite in a form, then the header needn't be show even with ShowHeader enabled - the same info is already be shown in TitleBar. What do you think?

Andrey Zubarev

2021-05-02 01:24

reporter   ~0130712

>>to make forms dockable with TitleBar
Yes that would be very good

With "Show header" we can manage AnchorDocking headers. Standart TitleBar we have remain unmanageable
I mean something like this:

Index: components/anchordocking/anchordocking.pas
===================================================================
--- components/anchordocking/anchordocking.pas (revision 65078)
+++ components/anchordocking/anchordocking.pas (working copy)
@@ -144,8 +144,10 @@
         adlhpLeft, // akRight,
         adlhpTop // akBottom
         );
+ NotShowTitleBar=true;
 
 
+
 type
   TAnchorDockHostSite = class;
 
@@ -438,6 +440,7 @@
                          LayoutNode: TAnchorDockLayoutTreeNode);
     property DockRestoreBounds: TRect read FDockRestoreBounds write FDockRestoreBounds;
     function GetDockEdge(const MousePos: TPoint): TAlign; override;
+ procedure RemoveTitleBar;
 
     property HeaderSide: TAnchorKind read FHeaderSide write SetHeaderSide;
     property Header: TAnchorDockHeader read FHeader;
@@ -5415,9 +5418,11 @@
     //debugln(['TAnchorDockHostSite.SetParent freeing splitter: ',DbgSName(BoundSplitter)]);
     FreeAndNil(FBoundSplitter);
   end;
- if Parent=nil then
- BorderStyle:=bsSizeable
- else
+ if Parent=nil then begin
+ BorderStyle:=bsSizeable;
+ if NotShowTitleBar then
+ RemoveTitleBar;
+ end else
     BorderStyle:=bsNone;
 end;
 
@@ -6349,9 +6354,19 @@
   LayoutNode.PixelsPerInch:=Screen.PixelsPerInch;
 end;
 
+procedure TAnchorDockHostSite.RemoveTitleBar;
+begin
+// windows only((
+ SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_Style) and not WS_Caption);
+ Height:=Height-GetSystemMetrics(SM_CYCAPTION);
+ SetWindowPos(Handle, HWND_TOP, Left, Top, Width, Height, SWP_FRAMECHANGED);
+end;
+
 constructor TAnchorDockHostSite.CreateNew(AOwner: TComponent; Num: Integer);
 begin
   inherited CreateNew(AOwner,Num);
+ if NotShowTitleBar then
+ RemoveTitleBar;
   FMinimizedControl:=Nil;
   Visible:=false;
   FHeaderSide:=akTop;


Is there a simple cross-platform way to remove the TitleBar in the LCL?

Anton Kavalenka

2021-05-02 07:23

reporter   ~0130713

Last edited: 2021-05-02 07:50

View 2 revisions

>Is there a simple cross-platform way to remove the TitleBar in the LCL?
BorderStyle:=bsNone;

Currently SetBorderStyle is a disaster in many widgetsets (0029141)
It just recreates the window. AFAIK Win32 and GTK2/3 can just change border style calling the function.

Andrey Zubarev

2021-05-02 11:13

reporter   ~0130715

>>BorderStyle:=bsNone
At the same time, the ability to change the size disappears, and most importantly-the shadow under the window disappears

Sven Barth

2021-05-02 14:33

manager   ~0130721

Last edited: 2021-05-02 14:34

View 2 revisions

(fixed the typo of "standart" in the title and description which was really bothering me and which might also impede future searches)

Andrey Zubarev

2021-05-02 20:59

reporter   ~0130726

I russian, in russian this is the стандарт=standart, When I don't use google.translate there may be errors. Sorry!

Sven Barth

2021-05-03 09:29

manager   ~0130734

No harm done. There are many people who write "standart" (in both German and English), but the correct writing in English (and German) is "standard".

Issue History

Date Modified Username Field Change
2021-05-01 04:12 Andrey Zubarev New Issue
2021-05-01 12:45 Michl Assigned To => Michl
2021-05-01 12:45 Michl Status new => assigned
2021-05-01 13:06 Michl Note Added: 0130701
2021-05-02 01:24 Andrey Zubarev Note Added: 0130712
2021-05-02 07:23 Anton Kavalenka Note Added: 0130713
2021-05-02 07:50 Anton Kavalenka Note Edited: 0130713 View Revisions
2021-05-02 11:13 Andrey Zubarev Note Added: 0130715
2021-05-02 14:33 Sven Barth Summary AnchorDocking option to disable standart form header, leave only AnchorDockHeader for undocked forms => AnchorDocking option to disable standard form header, leave only AnchorDockHeader for undocked forms
2021-05-02 14:33 Sven Barth Description Updated View Revisions
2021-05-02 14:33 Sven Barth LazTarget => -
2021-05-02 14:33 Sven Barth Note Added: 0130721
2021-05-02 14:34 Sven Barth Note Edited: 0130721 View Revisions
2021-05-02 20:59 Andrey Zubarev Note Added: 0130726
2021-05-03 09:29 Sven Barth Note Added: 0130734