TComboBox: KeyDown no longer eats normal keys

git-svn-id: trunk@9756 -
This commit is contained in:
mattias 2006-08-27 16:56:28 +00:00
parent 6a518397b9
commit 12d2ead692
3 changed files with 28 additions and 14 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 }