enable tabstops for controls; implement tabstops in win32 intf

git-svn-id: trunk@5082 -
This commit is contained in:
micha 2004-01-21 10:19:16 +00:00
parent 1ac23788c3
commit 80997fee5d
13 changed files with 163 additions and 90 deletions

View File

@ -94,7 +94,7 @@ type
property Cancel : Boolean read FCancel write FCancel default False;
property Caption;
property Font;
property TabStop;
property TabStop default true;
property TabOrder;
property PopupMenu;
property ShowHint;
@ -158,7 +158,7 @@ type
Procedure SetKind(Value : TBitBtnKind);
Procedure SetLayout(Value : TButtonLayout);
Procedure SetSpacing(Value : Integer);
//Return the caption associed with the akind value.
function GetCaptionOfKind(aKind :TBitBtnKind) : String;
protected
@ -181,10 +181,10 @@ type
property ParentShowHint;
property PopupMenu;
end;
{ TSpeedButton }
TSpeedButton = class(TGraphicControl)
private
FAllowAllUp : Boolean;
@ -261,8 +261,8 @@ type
property ParentShowHint;
property PopupMenu;
end;
procedure Register;
@ -306,6 +306,9 @@ end.
{ =============================================================================
$Log$
Revision 1.54 2004/01/21 10:19:15 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.53 2003/11/15 13:07:09 mattias
added ambigious unit check for IDE

View File

@ -542,6 +542,8 @@ type
procedure BeginUpdate;
procedure EndUpdate;
property Selected: TListItem read GetSelection write SetSelection;
published
property TabStop default true;
end;
@ -1444,7 +1446,7 @@ type
property TopLvlItems[Index: integer]: TTreeNode
read GetTopLvlItems write SetTopLvlItems;
end;
{ TCustomTreeView }
@ -1785,6 +1787,8 @@ type
property SeparatorColor: TColor read fSeparatorColor write SetSeparatorColor default clGray;
property TopItem: TTreeNode read GetTopItem write SetTopItem;
property TreeLineColor: TColor read FTreeLineColor write FTreeLineColor default clWindowFrame;
published
property TabStop default true;
end;
@ -1966,6 +1970,9 @@ end.
{ =============================================================================
$Log$
Revision 1.103 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.102 2004/01/12 13:43:12 mattias
improved and activated new statusbar

View File

@ -199,6 +199,8 @@ type
property OnCloseTabClicked: TNotifyEvent
read FOnCloseTabClicked write FOnCloseTabClicked;
property Options: TNoteBookOptions read FOptions write SetOptions;
published
property TabStop default true;
end;
@ -836,6 +838,9 @@ end.
{
$Log$
Revision 1.90 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.89 2004/01/10 22:34:20 mattias
started double buffering for gtk intf

View File

@ -1,7 +1,7 @@
{******************************************************************************
TButton
******************************************************************************
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
@ -32,6 +32,7 @@ begin
{set the component style to csButton}
fCompStyle := csButton;
ControlStyle:=ControlStyle-[csClickEvents];
TabStop := true;
{set default alignment}
Align := alNone;
{setup default sizes}
@ -90,7 +91,7 @@ End;
Handles the event that the button is clicked
------------------------------------------------------------------------------}
procedure TButton.Click;
procedure TButton.Click;
var
Form : TCustomForm;
Begin
@ -110,12 +111,12 @@ end;
Handles the event when the button is entered
------------------------------------------------------------------------------}
procedure TButton.CMMouseEnter(var Message: TLMessage);
begin
begin
Assert(False,'Trace:[TButton.CMMouseEnter]');
inherited CMMouseEnter(Message);
If assigned(FOnMouseEnter) then
FOnMouseEnter(Self);
end;
end;
{------------------------------------------------------------------------------
Method: TButton.CMMouseLeave
@ -125,12 +126,12 @@ end;
Handles the event when the mouse leaves the button
------------------------------------------------------------------------------}
procedure TButton.CMMouseLeave(var Message: TLMessage);
begin
begin
Assert(False,'Trace:[TButton.CMMouseLeave]');
inherited CMMouseLeave(Message);
If assigned(FOnMouseLeave) then
FOnMouseLeave(Self);
end;
end;
{------------------------------------------------------------------------------
Method: TButton.CMDefaultClicked
@ -165,6 +166,9 @@ end;
{ =============================================================================
$Log$
Revision 1.16 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.15 2003/11/15 13:07:09 mattias
added ambigious unit check for IDE

View File

@ -86,7 +86,8 @@ begin
fCompStyle := csCheckbox;
FState := cbUnchecked;
FAllowGrayed := True;
Height:=20;
TabStop := true;
Height := 20;
end;
{------------------------------------------------------------------------------
@ -194,6 +195,9 @@ end;
{
$Log$
Revision 1.15 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.14 2003/09/16 11:35:14 mattias
started TDBCheckBox

View File

@ -31,7 +31,7 @@ var
NewStrings: TStrings;
begin
inherited CreateWnd;
// get the interface based item list
NewStrings:= TStrings(Pointer(CNSendMessage(LM_GETITEMS, Self, nil)));
// then delete internal list
@ -72,7 +72,7 @@ begin
end;
// and use the internal list
FItems:= NewStrings;
inherited DestroyWnd;
end;
@ -112,7 +112,7 @@ begin
ASelLength:= FSelLength;
SelStart:= ASelStart;
SelLength:= ASelLength;
end;
end;
end;
{------------------------------------------------------------------------------
@ -346,7 +346,7 @@ begin
if (FStyle < csDropDownList) and (Text <> '') then begin
SetSelStart(0);
SetSelLength(Length(Text));
end;
end;
end;
{------------------------------------------------------------------------------
@ -379,7 +379,7 @@ var
skip : Boolean;
begin
Skip := False;
if AutoDropDown or ((Shift *[ssCtrl] = [ssCtrl]) and (Key = VK_DOWN))
or FReturnArrowState then
begin
@ -555,7 +555,7 @@ end;
{------------------------------------------------------------------------------
Method: TCustomComboBox.Create
Params: AOwner - owner of the object
Returns: reference to the newly created object
Returns: reference to the newly created object
Creates the object.
------------------------------------------------------------------------------}
@ -571,6 +571,7 @@ begin
FCanvas := TControlCanvas.Create;
TControlCanvas(FCanvas).Control := Self;
ArrowKeysTraverseList := True;
TabStop := true;
end;
{------------------------------------------------------------------------------
@ -693,7 +694,7 @@ end;
{------------------------------------------------------------------------------
Method: TCustomComboBox.SetItemIndex
Params: Val -
Params: Val -
Returns: nothing
Sets ths index of the currently selected item in the combobox.
@ -798,6 +799,9 @@ end;
{
$Log$
Revision 1.34 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.33 2003/10/16 23:54:27 marc
Implemented new gtk keyevent handling

View File

@ -59,6 +59,7 @@ begin
FCompStyle := csEdit;
FMaxLength:= -1;
ParentColor := false;
TabStop := true;
SetInitialBounds(0,0,80,23);
end;
@ -159,7 +160,7 @@ begin
if Text <> '' then begin
SetSelStart(0);
SetSelLength(Length(Text));
end;
end;
end;
{------------------------------------------------------------------------------
@ -290,7 +291,7 @@ begin
FReadOnly := Value;
if HandleAllocated then
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
end;
end;
{------------------------------------------------------------------------------
@ -347,7 +348,7 @@ begin
ASelLength:= FSelLength;
SelStart:= ASelStart;
SelLength:= ASelLength;
end;
end;
end;
// included by stdctrls.pp
@ -355,6 +356,9 @@ end;
{ =============================================================================
$Log$
Revision 1.20 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.19 2003/11/01 18:58:15 mattias
added clipboard support for TCustomEdit from Colin

View File

@ -387,6 +387,7 @@ begin
FCanvas := TControlCanvas.Create;
TControlCanvas(FCanvas).Control := Self;
ParentColor := false;
TabStop := true;
SetInitialBounds(0, 0, 100, 80);
end;
@ -437,7 +438,7 @@ end;
{------------------------------------------------------------------------------
procedure TCustomListBox.Clear
Delete all items.
------------------------------------------------------------------------------}
procedure TCustomListBox.Clear;
@ -447,7 +448,7 @@ end;
{------------------------------------------------------------------------------
function TCustomListBox.GetIndexAtY(Y: integer): integer;
Returns item index at y coordinate (including scrolling)
------------------------------------------------------------------------------}
function TCustomListBox.GetIndexAtY(Y: integer): integer;
@ -477,7 +478,7 @@ end;
{------------------------------------------------------------------------------
function TCustomListBox.ItemRect(Index: Integer): TRect;
Returns coordinates of an item (including scrolling)
Special: If Index=Count the rectangle is guessed (like VCL).
------------------------------------------------------------------------------}

View File

@ -31,6 +31,7 @@ begin
FImageChangeLink := TChangeLink.Create;
FImageChangeLink.OnChange := @ImageChanged;
FSelected := nil;
TabStop := true;
Setbounds(2,2,100,90);
end;
@ -43,7 +44,7 @@ Begin
Include(FStates,lvUpdateNeeded);
DoUpdate;
end;
{------------------------------------------------------------------------------}
{ TCustomListView Change }
{------------------------------------------------------------------------------}
@ -58,15 +59,15 @@ begin
else
Exit;
end;
if Assigned(FOnChange)
if Assigned(FOnChange)
then FOnChange(Self, AItem, ItemChange);
end;
{------------------------------------------------------------------------------}
{ TCustomListView ColClick }
{------------------------------------------------------------------------------}
procedure TCustomListView.ColClick(AColumn: TListColumn);
begin
procedure TCustomListView.ColClick(AColumn: TListColumn);
begin
if Assigned(FOnColumnClick) then FOnColumnClick(Self, AColumn)
end;
@ -79,11 +80,11 @@ var
Item: TListItem;
begin
nm := PNMListView(AMessage.NMHdr);
case AMessage.NMHdr^.code of
// HDN_TRACK:
// NM_CUSTOMDRAW:
// LVN_BEGINDRAG:
// LVN_BEGINDRAG:
LVN_DELETEITEM: begin
// don't call delete yet,
// there is no solution available when we have deleted the item first
@ -110,7 +111,7 @@ begin
LVN_ITEMCHANGED: begin
Item := Items[nm^.iItem];
Change(Item, nm^.uChanged);
if (nm^.uChanged = LVIF_STATE)
if (nm^.uChanged = LVIF_STATE)
then begin
if (nm^.uOldState and LVIS_SELECTED) <> (nm^.uNewState and LVIS_SELECTED)
then begin
@ -129,8 +130,8 @@ begin
end;
end;
// LVN_GETINFOTIP:
// NM_CLICK:
// NM_RCLICK:
// NM_CLICK:
// NM_RCLICK:
end;
end;
@ -175,8 +176,8 @@ end;
{------------------------------------------------------------------------------}
{ TCustomListView DoSelectItem }
{------------------------------------------------------------------------------}
procedure TCustomListView.DoSelectItem(AItem: TListItem; ASelected: Boolean);
begin
procedure TCustomListView.DoSelectItem(AItem: TListItem; ASelected: Boolean);
begin
AItem.Selected:=ASelected;
if Assigned(FOnSelectItem) then FOnSelectItem(Self, AItem, ASelected);
end;
@ -248,7 +249,7 @@ end;
procedure TCustomListView.InsertItem(Item : TListItem);
begin
end;
{------------------------------------------------------------------------------}
{ TCustomListView SetColumns }
{------------------------------------------------------------------------------}
@ -259,7 +260,7 @@ begin
if ([csDesigning,csLoading,csReading]*ComponentState=[csDesigning]) then
OwnerFormDesignerModified(Self);
end;
{------------------------------------------------------------------------------}
{ TCustomListView SetViewStyle }
{------------------------------------------------------------------------------}
@ -309,7 +310,7 @@ end;
TCustomListView BeginUpdate
Params: None
Result: none
Increases the update count. Use this procedure before any big change, so that
the interface will not show any single step.
------------------------------------------------------------------------------}
@ -445,7 +446,7 @@ var
begin
writeln('TODO: TCustomListView.UpdateScrollbars');
exit;
if not HandleAllocated then exit
else
begin
@ -557,6 +558,9 @@ end;
{ =============================================================================
$Log$
Revision 1.27 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.26 2003/02/28 15:49:43 mattias
fixed initial size
@ -608,5 +612,5 @@ end;
}

View File

@ -323,7 +323,9 @@ begin
fAccess := TNBPages.Create(fPageList, Self);
fPageIndex := -1;
ControlStyle := [csAcceptsControls];
TabPosition := tpTop;
TabStop := true;
ShowTabs := True;
SetInitialBounds(0,0,200,200);
end;
@ -785,6 +787,9 @@ end;}
{ =============================================================================
$Log$
Revision 1.41 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.40 2003/12/23 18:15:37 mattias
fixed TNoteBook.OnPageChanged for user PageIndex

View File

@ -16,7 +16,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
current design flaws:
- I decided to support some gtk-specific properties in this class. This
@ -25,7 +25,7 @@
BTW: When porting to another widget library you can safely ignore
FScalePosition, FScaleDigits
Delphi compatibility:
- the interface is almost like in delphi 4
@ -39,7 +39,7 @@
nice addons for the GTK interface
* ShowScale
* ScalePos (left, top, right, bottom)
TODO:
- implement some more Delphi stuff
@ -74,6 +74,7 @@ begin
FShowScale := false;
FScalePos := trTop;
FScaleDigits := 0;
TabStop := true;
SetInitialBounds(0,0,100,20);
end;
@ -93,7 +94,7 @@ end;
{------------------------------------------------------------------------------
Method: TTrackBar.SetTick
Params: Value : new tick
Params: Value : new tick
Returns: Nothing
------------------------------------------------------------------------------}
@ -105,7 +106,7 @@ end;
{------------------------------------------------------------------------------
Method: TTrackBar.SetOrientation
Params: Value : new orientation
Params: Value : new orientation
Returns: Nothing
Change the orientation of the trackbar.
@ -132,7 +133,7 @@ end;
Method: TTrackBar.SetParams
Params: APosition : new position
AMin : new minimum
AMax : new maximum
AMax : new maximum
Returns: Nothing
Set new parameters for the trackbar.
@ -312,7 +313,7 @@ var
begin
CNSendMessage (LM_GetValue, Self, @tmpPosition);
Assert(True, 'Trace:Trackbar received a message -CHANGE');
FPosition := TmpPosition;
FPosition := TmpPosition;
if Assigned (FOnChange)
then FOnChange (Self);
end;
@ -354,7 +355,7 @@ end;
Returns: Nothing
------------------------------------------------------------------------------
procedure CreateParams(var Params: TCreateParams);
procedure CreateParams(var Params: TCreateParams);
begin
end;
}
@ -374,13 +375,16 @@ end;
Returns: Nothing
------------------------------------------------------------------------------
procedure DestroyWnd;
procedure DestroyWnd;
begin
end;
}
{
$Log$
Revision 1.7 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.6 2003/06/13 21:13:20 mattias
fixed TTrackBar initial size

View File

@ -1128,14 +1128,30 @@ Procedure TWin32Object.HandleEvents;
var
AMessage: TMsg;
AccelTable: HACCEL;
function HandleDialogMessage: Boolean;
var
TopParent, TmpParent: HWnd;
begin
TmpParent := AMessage.HWnd;
repeat
TopParent := TmpParent;
TmpParent := Windows.GetParent(TmpParent);
until TmpParent = HWND(nil);
Result := Windows.IsDialogMessage(TopParent, @AMessage);
end;
Begin
While PeekMessage(AMessage, HWnd(Nil), 0, 0,PM_REMOVE) Do
Begin
AccelTable := HACCEL(Windows.GetProp(AMessage.HWnd, 'Accel'));
If (AccelTable = HACCEL(nil)) or (TranslateAccelerator(AMessage.HWnd, AccelTable, @AMessage) = 0) Then
Begin
TranslateMessage(@AMessage);
DispatchMessage(@AMessage);
if not HandleDialogMessage then
Begin
TranslateMessage(@AMessage);
DispatchMessage(@AMessage);
End;
End;
End;
End;
@ -2969,6 +2985,9 @@ End;
{
$Log$
Revision 1.161 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.160 2004/01/20 22:14:27 micha
REVERTED: "try register globally unique properties"; implemented new WindowFromPoint not returning window if from different process (tip from vincent)

View File

@ -1,12 +1,12 @@
{
/***************************************************************************
/***************************************************************************
stdctrls.pp
-----------
Initial Revision : Tue Oct 19 CST 1999
***************************************************************************/
Initial Revision : Tue Oct 19 CST 1999
***************************************************************************/
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
@ -109,7 +109,7 @@ type
property ShowHint;
property SmallChange: TScrollBarInc read FSmallChange write FSmallChange default 1;
property TabOrder;
property TabStop;
property TabStop default true;
property Visible;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnDragDrop;
@ -133,10 +133,10 @@ type
constructor Create(AOwner : TComponent); Override;
function CanTab: boolean; override;
end;
{ TGroupBox }
TGroupBox = class(TCustomGroupBox)
published
property Align;
@ -247,7 +247,7 @@ type
procedure SetStyle(Val : TComboBoxStyle); virtual;
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
procedure KeyPress(var Key : Char); override;
property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8;
property Items: TStrings read FItems write SetItems;
property ItemHeight: Integer read GetItemHeight write SetItemHeight;
@ -285,9 +285,11 @@ type
property SelStart: integer read GetSelStart write SetSelStart;
property SelText: String read GetSelText write SetSelText;
property Style: TComboBoxStyle read FStyle write SetStyle;
published
property TabStop default true;
end;
{ TComboBox }
TComboBox = class(TCustomComboBox)
@ -331,12 +333,12 @@ type
property Text;
property Visible;
end;
{ TCustomListBox }
TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable);
TCustomListBox = class(TWinControl)
private
FBorderStyle: TBorderStyle;
@ -400,11 +402,13 @@ type
property Sorted: boolean read FSorted write SetSorted;
property Style: TListBoxStyle read FStyle write SetStyle;
property TopIndex: Integer read GetTopIndex write SetTopIndex;
published
property TabStop default true;
end;
{ TListBox }
TListBox = class(TCustomListBox)
published
property Align;
@ -497,13 +501,13 @@ type
property Text;
published
property PopupMenu;
property TabStop;
property TabStop default true;
property TabOrder;
end;
{ TMemoScrollbar }
TMemoScrollbar = class(TControlScrollBar)
protected
function GetHorzScrollBar: TControlScrollBar; override;
@ -517,8 +521,8 @@ type
property Size;
property Visible;
end;
{ TCustomMemo }
TCustomMemo = class(TCustomEdit)
@ -554,8 +558,8 @@ type
property VertScrollBar: TMemoScrollBar
read FVertScrollBar write SetVertScrollBar stored StoreScrollBars;
end;
{ TEdit }
TEdit = class(TCustomEdit)
@ -589,8 +593,8 @@ type
property Text;
property Visible;
end;
{ TMemo }
TMemo = class(TCustomMemo)
@ -723,6 +727,8 @@ type
public
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed;
property State: TCheckBoxState read GetState write SetState;
published
property TabStop default true;
end;
{$IFNDef NewCheckBox}
@ -884,7 +890,7 @@ type
{ TRadioButton }
TRadioButton = class(TCustomCheckBox)
protected
procedure DoAutoSize; override;
@ -923,7 +929,7 @@ type
{ TStaticText }
TStaticBorderStyle = (sbsNone, sbsSingle, sbsSunken);
TCustomStaticText = class(TCustomControl)
@ -985,7 +991,7 @@ type
property OnMouseMove;
property OnMouseUp;
end;
var
DefaultButtonControlUseOnChange: boolean;
@ -1436,14 +1442,14 @@ end;
{$EndIf NewCheckbox}
{$I customgroupbox.inc}
{$I customcombobox.inc}
{$I customcombobox.inc}
{$I customlistbox.inc}
{$I custommemo.inc}
{$I customedit.inc}
{$I customlabel.inc}
{$I customcheckbox.inc}
{$I scrollbar.inc}
{$I scrollbar.inc}
{$I memoscrollbar.inc}
{$I memo.inc}
{$I memostrings.inc}
@ -1468,6 +1474,9 @@ end.
{ =============================================================================
$Log$
Revision 1.117 2004/01/21 10:19:16 micha
enable tabstops for controls; implement tabstops in win32 intf
Revision 1.116 2004/01/12 15:04:41 mattias
implemented TCustomListBox.ItemAtPos