Open sergSVK opened 2 months ago
Try this, open TB2Dock.pas and add this:
TTBDock = class(TCustomControl)
private
...
procedure CMSysCommand(var Message: TWMKeyDown); message CM_SYSCOMMAND;
...
procedure TTBDock.CMSysCommand(var Message: TWMKeyDown);
begin
inherited;
// Robert: fix alignment bug when maximizing/restoring form.
// To reproduce:
// Place a dock with 2 toolbars on 1 row, add some toolbar items
// Set ShrinkMode to tbsmNone on the 2 toolbars
// Place a Button on the form with Align set to alClient
// Run the app
// Reduce the width of the form so there are 2 rows of toolbars
// Maximize, the dock is resized but the Button is not aligned correctly
// Restore, the dock is resized but the Button is not aligned correctly
if (Message.CharCode = SC_MAXIMIZE) or (Message.CharCode = SC_RESTORE) then
if Assigned(Parent) then
Parent.Realign;
end;
Hello, Robert. There is a problem. The CM_SYSCOMMAND message does not exist. Method WMSysCommand already exists with a different parameter.
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
procedure TTBDock.WMSysCommand(var Message: TWMSysCommand);
begin
{ Relay WM_SYSCOMMAND messages to floating toolbars which were formerly
docked. That way, items on floating menu bars can be accessed with Alt. }
if Message.CmdType and $FFF0 = SC_KEYMENU then
RelayMsgToFloatingBars({$IFNDEF CLR} TMessage(Message) {$ELSE} Message.OriginalMessage {$ENDIF});
end;
Hello, Robert. There is a problem. The CM_SYSCOMMAND message does not exist.
You have to add it
I discovered an unpleasant alignment of elements when switching between child windows. The bug is reproduced in the following sequence.
I'm using Delphi 10.4 Sydney. I don't know if this bug can be reproduced on other versions. A test example is attached. The executable file is also attached.
Test.zip