diff --git a/lcl/include/customcombobox.inc b/lcl/include/customcombobox.inc index 148dce26e6..d0dcf91375 100644 --- a/lcl/include/customcombobox.inc +++ b/lcl/include/customcombobox.inc @@ -414,16 +414,6 @@ begin end; end; - if Style=csDropDownList then begin - //debugln('TCustomComboBox.KeyDown '); - // DropDownList: allow only navigation keys - if not (Key in [VK_UP,VK_DOWN,VK_END,VK_HOME,VK_PRIOR,VK_NEXT,VK_TAB, - VK_RETURN]) - then begin - Skip := True; - end; - end; - if Skip then Key := VK_UNKNOWN else diff --git a/lcl/ldockctrl.pas b/lcl/ldockctrl.pas index 69dedd1231..2d3c402cd9 100644 --- a/lcl/ldockctrl.pas +++ b/lcl/ldockctrl.pas @@ -76,6 +76,8 @@ const ); type + TAnchorControls = array[TAnchorKind] of TControl; + { TLazDockConfigNode } TLazDockConfigNode = class(TPersistent) @@ -234,6 +236,9 @@ type AddedControl: TControl); procedure ShrinkNeighbourhood(Layout: TLazDockConfigNode; AControl: TControl; Sides: TAnchors); + function FindPageNeighbours(Layout: TLazDockConfigNode; + StartControl: TControl; out AnchorControls: TAnchorControls + ): TFPList; // list of TControls public constructor Create(TheOwner: TComponent); override; procedure ShowDockingEditor; virtual; @@ -732,6 +737,8 @@ var NeighbourControlPageIndex: LongInt; Page: TLazDockPage; PageIndex: LongInt; + NeighbourList: TFPList; + AnchorControls: TAnchorControls; begin Result:=false; DebugLn(['TCustomLazControlDocker.DockAsPage DockerName="',DockerName,'"']); @@ -814,8 +821,13 @@ begin end else begin // NeighbourControl is a child control, but the parent is not yet a page // => collect all neighbour controls for a page - - // TODO + NeighbourList:=FindPageNeighbours(Layout,NeighbourControl,AnchorControls); + try + if AnchorControls[akLeft]=nil then ; + // TODO + finally + NeighbourList.Free; + end; end; Result:=true; @@ -1143,6 +1155,18 @@ begin end; end; +function TCustomLazControlDocker.FindPageNeighbours(Layout: TLazDockConfigNode; + StartControl: TControl; out AnchorControls: TAnchorControls): TFPList; +var + a: TAnchorKind; +begin + Result:=TFPList.Create; + Result.Add(StartControl); + for a:=Low(TAnchorKind) to High(TAnchorKind) do + AnchorControls[a]:=StartControl.AnchorSide[a].Control; + // TODO: extend +end; + function TCustomLazControlDocker.GetControlName(AControl: TControl): string; var i: Integer; diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 4a64bd47dd..0938d478e1 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -227,9 +227,9 @@ type TOwnerDrawState = TBaseOwnerDrawState; TDrawItemEvent = procedure(Control: TWinControl; Index: Integer; - ARect: TRect; State: TOwnerDrawState) of object; + ARect: TRect; State: TOwnerDrawState) of object; TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer; - var Height: Integer) of object; + var Height: Integer) of object; { TCustomComboBox }