mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 19:29:31 +02:00
applied TComboBox fix for grabbing keys from Yoyong
git-svn-id: trunk@4263 -
This commit is contained in:
parent
4bb7bc30be
commit
1f87f8a9bf
@ -364,18 +364,55 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomComboBox.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
procedure TCustomComboBox.SetArrowKeysTraverseList(Value : Boolean);
|
||||
begin
|
||||
inherited KeyDown(Key, Shift);
|
||||
if AutoDropDown then
|
||||
if Value <> FArrowKeysTraverseList then begin
|
||||
FArrowKeysTraverseList := Value;
|
||||
if HandleAllocated and (not (csLoading in ComponentState)) then
|
||||
CNSendMessage(LM_SETPROPERTIES, Self, nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomComboBox.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
var
|
||||
skip : Boolean;
|
||||
begin
|
||||
Skip := False;
|
||||
|
||||
if AutoDropDown or ((Shift *[ssCtrl] = [ssCtrl]) and (Key = VK_DOWN))
|
||||
or FReturnArrowState then
|
||||
begin
|
||||
case Key of
|
||||
VK_TAB,VK_RETURN:
|
||||
begin
|
||||
|
||||
if FReturnArrowState = True then
|
||||
begin
|
||||
SetArrowKeysTraverseList(False); //we need this here, else we cannot traverse popup list
|
||||
FReturnArrowState := False;
|
||||
end;
|
||||
|
||||
DroppedDown := False;
|
||||
else
|
||||
end;
|
||||
else
|
||||
begin
|
||||
if ArrowKeysTraverseList = False then
|
||||
begin
|
||||
SetArrowKeysTraverseList(True); //we need this here, else we cannot traverse popup list
|
||||
FReturnArrowState := True;
|
||||
Skip := True;
|
||||
end;
|
||||
//AutoDropDown := True;
|
||||
DroppedDown := True;
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Skip then
|
||||
Key := 0
|
||||
else
|
||||
inherited KeyDown(Key, Shift);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -523,6 +560,7 @@ begin
|
||||
FDropDownCount:=8;
|
||||
FCanvas := TControlCanvas.Create;
|
||||
TControlCanvas(FCanvas).Control := Self;
|
||||
ArrowKeysTraverseList := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -750,6 +788,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.28 2003/06/12 16:18:23 mattias
|
||||
applied TComboBox fix for grabbing keys from Yoyong
|
||||
|
||||
Revision 1.27 2003/06/10 13:35:54 mattias
|
||||
implemented TComboBox dropdown from Yoyong
|
||||
|
||||
|
@ -202,6 +202,8 @@ type
|
||||
FSelStart: integer;
|
||||
FSorted : boolean;
|
||||
FStyle : TComboBoxStyle;
|
||||
FArrowKeysTraverseList : Boolean;
|
||||
FReturnArrowState : Boolean; //used to return the state of arrow keys from termporary change
|
||||
function GetDroppedDown: Boolean;
|
||||
function GetItemWidth: Integer;
|
||||
procedure SetItemWidth(const AValue: Integer);
|
||||
@ -209,6 +211,7 @@ type
|
||||
procedure LMDrawListItem(var TheMessage : TLMDrawListItem); message LM_DrawListItem;
|
||||
procedure CNCommand(var TheMessage : TLMCommand); message CN_Command;
|
||||
procedure UpdateSorted;
|
||||
procedure SetArrowKeysTraverseList(Value : Boolean);
|
||||
protected
|
||||
procedure CreateWnd; override;
|
||||
procedure DestroyWnd; override;
|
||||
@ -274,6 +277,8 @@ type
|
||||
|
||||
property AutoDropDown: Boolean
|
||||
read FAutoDropDown write FAutoDropDown default False;
|
||||
property ArrowKeysTraverseList : Boolean
|
||||
read FArrowKeysTraverseList write SetArrowKeysTraverseList default True;
|
||||
property Canvas: TCanvas read FCanvas;
|
||||
property SelLength: integer read GetSelLength write SetSelLength;
|
||||
property SelStart: integer read GetSelStart write SetSelStart;
|
||||
@ -289,6 +294,7 @@ type
|
||||
property ItemIndex;
|
||||
published
|
||||
property Anchors;
|
||||
property ArrowKeysTraverseList;
|
||||
property AutoDropDown;
|
||||
property Ctl3D;
|
||||
property DropDownCount;
|
||||
@ -1453,6 +1459,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.96 2003/06/12 16:18:23 mattias
|
||||
applied TComboBox fix for grabbing keys from Yoyong
|
||||
|
||||
Revision 1.95 2003/06/10 17:23:34 mattias
|
||||
implemented tabstop
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user