[Lazarus] Docking state question

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Dec 13 15:27:16 CET 2010


Hans-Peter Diettrich schrieb:

>> The DragManager gets no 
>> keys, i.e. docking cannot be aborted with Esc.

Found the bug near rev. 26309/12: the new DockWindow in win32lclintf.inc
does not send key messages to the DragManager. Here a workaround:

function DockWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
     LParam: Windows.LParam): LResult; stdcall;
var
   CharCode: word;
   ss: TShiftState;
begin
   case Msg of
   WM_KEYDOWN:
     if DragManager.IsDragging then begin
       CharCode := word(WParam);
       DragManager.KeyDown(CharCode, ss);
     end;
   WM_KEYUP:
     if DragManager.IsDragging then begin
       CharCode := word(WParam);
       DragManager.KeyUp(CharCode, ss);
     end;
   end;
//this was the original code
    Result := Windows.DefWindowProc(Window, Msg, WParam, LParam);
end;

The Linux code may suffer from similar lack of propagating messages...


After some more tests I found a general problem with Win7: docked 
windows cannot be undocked any more, by dragging the DockHeader - even 
in very old Lazarus revisions. It looks to me as if something is 
seriously broken in the LCL :-(

The above DockWindow may be an attempt to cure some of these problems, 
but it does not address the real trouble source.

DoDi





More information about the Lazarus mailing list