From c8338ad6008081d55be9e8d1fe0e394dd897564e Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 20 Sep 2003 15:24:54 +0000 Subject: [PATCH] implemented TPageControl and TTabSheet git-svn-id: trunk@4655 - --- .gitattributes | 2 + designer/componenteditors.pas | 40 +++++++------- images/components/tdbgrid.xpm | 32 +++++++++++ images/components/tnotebook.xpm | 71 ++++++++++++------------ images/components/tpagecontrol.xpm | 46 ++++++++++++++++ images/components_images.lrs | 42 +++++++++----- lcl/comctrls.pp | 88 +++++++++--------------------- lcl/extctrls.pp | 6 +- lcl/include/customnotebook.inc | 8 +++ 9 files changed, 200 insertions(+), 135 deletions(-) create mode 100644 images/components/tdbgrid.xpm create mode 100644 images/components/tpagecontrol.xpm diff --git a/.gitattributes b/.gitattributes index 9dbd82b5bf..152964502a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -518,6 +518,7 @@ images/components/tdbcheckbox.xpm -text svneol=native#image/x-xpixmap images/components/tdbcombobox.xpm -text svneol=native#image/x-xpixmap images/components/tdbcontrol.xpm -text svneol=native#image/x-xpixmap images/components/tdbedit.xpm -text svneol=native#image/x-xpixmap +images/components/tdbgrid.xpm -text svneol=native#image/x-xpixmap images/components/tdbgroupbox.xpm -text svneol=native#image/x-xpixmap images/components/tdbimage.xpm -text svneol=native#image/x-xpixmap images/components/tdblistbox.xpm -text svneol=native#image/x-xpixmap @@ -557,6 +558,7 @@ images/components/topendialog.ico -text svneol=unset#image/x-icon images/components/topendialog.xpm -text svneol=native#image/x-xpixmap images/components/topenpicturedialog.ico -text svneol=unset#image/x-icon images/components/topenpicturedialog.xpm -text svneol=native#image/x-xpixmap +images/components/tpagecontrol.xpm -text svneol=native#image/x-xpixmap images/components/tpaintbox.ico -text svneol=unset#image/x-icon images/components/tpaintbox.xpm -text svneol=native#image/x-xpixmap images/components/tpanel.ico -text svneol=unset#image/x-icon diff --git a/designer/componenteditors.pas b/designer/componenteditors.pas index f3344516da..b5c93487cc 100644 --- a/designer/componenteditors.pas +++ b/designer/componenteditors.pas @@ -186,7 +186,7 @@ type end; { TNotebookComponentEditor - The default component editor for TNotebook. } + The default component editor for TCustomNotebook. } TNotebookComponentEditor = class(TDefaultComponentEditor) protected procedure AddNewPageToDesigner(Index: integer); virtual; @@ -203,16 +203,16 @@ type function GetVerb(Index: Integer): string; override; function GetVerbCount: Integer; override; procedure PrepareItem(Index: Integer; const AnItem: TMenuItem); override; - function Notebook: TNotebook; virtual; + function Notebook: TCustomNotebook; virtual; end; { TPageComponentEditor - The default component editor for TPage. } + The default component editor for TCustomPage. } TPageComponentEditor = class(TNotebookComponentEditor) protected public - function Notebook: TNotebook; override; - function Page: TPage; virtual; + function Notebook: TCustomNotebook; override; + function Page: TCustomPage; virtual; end; { Register a component editor to be created when a component derived from @@ -462,19 +462,18 @@ begin NewPageIndex:=AMenuItem.MenuIndex; if (NewPageIndex<0) or (NewPageIndex>=Notebook.PageCount) then exit; NoteBook.PageIndex:=NewPageIndex; - GetDesigner.SelectOnlyThisComponent( - TPage(NoteBook.PageList[NoteBook.PageIndex])); + GetDesigner.SelectOnlyThisComponent(NoteBook.CustomPage(NoteBook.PageIndex)); end; procedure TNotebookComponentEditor.AddNewPageToDesigner(Index: integer); var Hook: TPropertyEditorHook; - NewPage: TPage; + NewPage: TCustomPage; NewName: string; begin Hook:=nil; if not GetHook(Hook) then exit; - NewPage:=NoteBook.Page[Index]; + NewPage:=NoteBook.CustomPage(Index); NewName:=GetDesigner.CreateUniqueComponentName(NewPage.ClassName); NewPage.Caption:=NewName; NewPage.Name:=NewName; @@ -554,8 +553,7 @@ begin for i:=0 to NoteBook.PageCount-1 do begin NewMenuItem:=TMenuItem.Create(ParentMenuItem); NewMenuItem.Name:='ShowPage'+IntToStr(i); - NewMenuItem.Caption:= - TPage(Notebook.PageList[i]).Name+' "'+Notebook.Pages[i]+'"'; + NewMenuItem.Caption:=Notebook.CustomPage(i).Name+' "'+Notebook.Pages[i]+'"'; NewMenuItem.OnClick:=@ShowPageMenuItemClick; ParentMenuItem.Add(NewMenuItem); end; @@ -605,25 +603,25 @@ begin end; end; -function TNotebookComponentEditor.Notebook: TNotebook; +function TNotebookComponentEditor.Notebook: TCustomNotebook; begin - Result:=TNotebook(GetComponent); + Result:=TCustomNotebook(GetComponent); end; { TPageComponentEditor } -function TPageComponentEditor.Notebook: TNotebook; +function TPageComponentEditor.Notebook: TCustomNotebook; var - APage: TPage; + APage: TCustomPage; begin APage:=Page; - if (APage.Parent<>nil) and (APage.Parent is TNoteBook) then - Result:=TNoteBook(APage.Parent); + if (APage.Parent<>nil) and (APage.Parent is TCustomNoteBook) then + Result:=TCustomNoteBook(APage.Parent); end; -function TPageComponentEditor.Page: TPage; +function TPageComponentEditor.Page: TCustomPage; begin - Result:=TPage(GetComponent); + Result:=TCustomPage(GetComponent); end; //------------------------------------------------------------------------------ @@ -644,8 +642,8 @@ end; initialization RegisterComponentEditorProc:=@DefaultRegisterComponentEditorProc; - RegisterComponentEditor(TNotebook,TNotebookComponentEditor); - RegisterComponentEditor(TPage,TPageComponentEditor); + RegisterComponentEditor(TCustomNotebook,TNotebookComponentEditor); + RegisterComponentEditor(TCustomPage,TPageComponentEditor); finalization InternalFinal; diff --git a/images/components/tdbgrid.xpm b/images/components/tdbgrid.xpm new file mode 100644 index 0000000000..72f0344f8b --- /dev/null +++ b/images/components/tdbgrid.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char * tdbgrid_xpm[] = { +"23 23 6 1", +" c None", +". c #828282", +"+ c #FFFFFF", +"@ c #BFBFBF", +"# c #000000", +"$ c #969696", +"................ ", +".++.++@++@++@++. ", +".@@............. ", +".++.++@++@++@++. ", +".@@.@@@@@@@@@@@. ", +".++.++@++@++@++. ", +".@@.@@@@@@@@@@@. ", +".++.++#################", +".@@.@@#$$$#$$$#$$$#$$$#", +".++.++#$$$#$$$#$$$#$$$#", +"......#################", +" #$$$#+++$+++$+++#", +" #$$$#+++$+++$+++#", +" #####$$$$$$$$$$$#", +" #$$$#+++$+++$+++#", +" #$$$#+++$+++$+++#", +" #####$$$$$$$$$$$#", +" #$$$#+++$+++$+++#", +" #$$$#+++$+++$+++#", +" #####$$$$$$$$$$$#", +" #$$$#+++$+++$+++#", +" #$$$#+++$+++$+++#", +" #################"}; diff --git a/images/components/tnotebook.xpm b/images/components/tnotebook.xpm index 4c8fdf52c3..846a01eb2a 100644 --- a/images/components/tnotebook.xpm +++ b/images/components/tnotebook.xpm @@ -1,6 +1,6 @@ /* XPM */ static char * tnotebook_xpm[] = { -"19 14 29 1", +"19 14 26 1", " c None", ". c #FFFFFF", "+ c #080808", @@ -8,39 +8,36 @@ static char * tnotebook_xpm[] = { "# c #C1C1C1", "$ c #F8F8F8", "% c #F0F0F0", -"& c #FCFCFC", -"* c #030303", -"= c #C5C5C5", -"- c #808080", -"; c #F4F4F4", -"> c #C4C4C4", -", c #C0C0C0", -"' c #FEFEFE", -") c #7C7C7C", -"! c #8B8B8B", -"~ c #767676", -"{ c #828282", -"] c #878787", -"^ c #7A7A7A", -"/ c #7F7F7F", -"( c #888888", -"_ c #7D7D7D", -": c #898989", -"< c #020202", -"[ c #050505", -"} c #010101", -"| c #C3C3C3", -" ....+@@@@@@@@ ", -" .###+###@###@ ", -" .###+###@###@ ", -"$.###%..........&.*", -".###=############-@", -";#############>##-@", -".################-@", -"$################-@", -"$#####,##########-@", -".################-@", -";################-@", -".################-@", -"')!~{]^////////(_:@", -"@<@[@}@@@@@@@@@@<@|"}; +"& c #030303", +"* c #F4F4F4", +"= c #808080", +"- c #C0C0C0", +"; c #FEFEFE", +"> c #7C7C7C", +", c #8B8B8B", +"' c #767676", +") c #828282", +"! c #878787", +"~ c #7A7A7A", +"{ c #7F7F7F", +"] c #888888", +"^ c #7D7D7D", +"/ c #898989", +"( c #020202", +"_ c #050505", +": c #010101", +"< c #C3C3C3", +" .....+@@@@@@@@@@ ", +" .####+####@####@ ", +" .####+####@####@ ", +" .####+####@####@ ", +"$.####%...........&", +"*################=@", +".################=@", +"$################=@", +"$#####-##########=@", +".################=@", +"*################=@", +".################=@", +";>,')!~{{{{{{{{]^/@", +"@(@_@:@@@@@@@@@@(@<"}; diff --git a/images/components/tpagecontrol.xpm b/images/components/tpagecontrol.xpm new file mode 100644 index 0000000000..c37ed54ff6 --- /dev/null +++ b/images/components/tpagecontrol.xpm @@ -0,0 +1,46 @@ +/* XPM */ +static char * tpagecontrol_xpm[] = { +"19 14 29 1", +" c None", +". c #FFFFFF", +"+ c #080808", +"@ c #000000", +"# c #C1C1C1", +"$ c #F8F8F8", +"% c #F0F0F0", +"& c #FCFCFC", +"* c #030303", +"= c #C5C5C5", +"- c #808080", +"; c #F4F4F4", +"> c #C4C4C4", +", c #C0C0C0", +"' c #FEFEFE", +") c #7C7C7C", +"! c #8B8B8B", +"~ c #767676", +"{ c #828282", +"] c #878787", +"^ c #7A7A7A", +"/ c #7F7F7F", +"( c #888888", +"_ c #7D7D7D", +": c #898989", +"< c #020202", +"[ c #050505", +"} c #010101", +"| c #C3C3C3", +" ....+@@@@@@@@ ", +" .###+###@###@ ", +" .###+###@###@ ", +"$.###%..........&.*", +".###=############-@", +";#############>##-@", +".################-@", +"$################-@", +"$#####,##########-@", +".################-@", +";################-@", +".################-@", +"')!~{]^////////(_:@", +"@<@[@}@@@@@@@@@@<@|"}; diff --git a/images/components_images.lrs b/images/components_images.lrs index ecdf3dea02..9930ea4d6e 100644 --- a/images/components_images.lrs +++ b/images/components_images.lrs @@ -1488,21 +1488,20 @@ LazarusResources.Add('tmouse','XPM',[ +'"=0 ab c ",'#10'"d e}9f ",'#10'" ghij ",'#10'" kl "};'#10 ]); LazarusResources.Add('tnotebook','XPM',[ - '/* XPM */'#10'static char * tnotebook_xpm[] = {'#10'"19 14 29 1",'#10'" '#9 + '/* XPM */'#10'static char * tnotebook_xpm[] = {'#10'"19 14 26 1",'#10'" '#9 +'c None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #080808",'#10'"@'#9'c #000000",' +#10'"#'#9'c #C1C1C1",'#10'"$'#9'c #F8F8F8",'#10'"%'#9'c #F0F0F0",'#10'"&'#9 - +'c #FCFCFC",'#10'"*'#9'c #030303",'#10'"='#9'c #C5C5C5",'#10'"-'#9'c #808080' - +'",'#10'";'#9'c #F4F4F4",'#10'">'#9'c #C4C4C4",'#10'",'#9'c #C0C0C0",'#10'"' - +''''#9'c #FEFEFE",'#10'")'#9'c #7C7C7C",'#10'"!'#9'c #8B8B8B",'#10'"~'#9'c #' - +'767676",'#10'"{'#9'c #828282",'#10'"]'#9'c #878787",'#10'"^'#9'c #7A7A7A",' - +#10'"/'#9'c #7F7F7F",'#10'"('#9'c #888888",'#10'"_'#9'c #7D7D7D",'#10'":'#9 - +'c #898989",'#10'"<'#9'c #020202",'#10'"['#9'c #050505",'#10'"}'#9'c #010101' - +'",'#10'"|'#9'c #C3C3C3",'#10'" ....+@@@@@@@@ ",'#10'" .###+###@###@ ' - +' ",'#10'" .###+###@###@ ",'#10'"$.###%..........&.*",'#10'".###=#######' - +'#####-@",'#10'";#############>##-@",'#10'".################-@",'#10'"$#####' - +'###########-@",'#10'"$#####,##########-@",'#10'".################-@",'#10'"' - +';################-@",'#10'".################-@",'#10'"'')!~{]^////////(_:@"' - +','#10'"@<@[@}@@@@@@@@@@<@|"};'#10 + +'c #030303",'#10'"*'#9'c #F4F4F4",'#10'"='#9'c #808080",'#10'"-'#9'c #C0C0C0' + +'",'#10'";'#9'c #FEFEFE",'#10'">'#9'c #7C7C7C",'#10'",'#9'c #8B8B8B",'#10'"' + +''''#9'c #767676",'#10'")'#9'c #828282",'#10'"!'#9'c #878787",'#10'"~'#9'c #' + +'7A7A7A",'#10'"{'#9'c #7F7F7F",'#10'"]'#9'c #888888",'#10'"^'#9'c #7D7D7D",' + +#10'"/'#9'c #898989",'#10'"('#9'c #020202",'#10'"_'#9'c #050505",'#10'":'#9 + +'c #010101",'#10'"<'#9'c #C3C3C3",'#10'" .....+@@@@@@@@@@ ",'#10'" .####+##' + +'##@####@ ",'#10'" .####+####@####@ ",'#10'" .####+####@####@ ",'#10'"$.#' + +'###%...........&",'#10'"*################=@",'#10'".################=@",'#10 + +'"$################=@",'#10'"$#####-##########=@",'#10'".################=@"' + +','#10'"*################=@",'#10'".################=@",'#10'";>,'')!~{{{{{{' + +'{{]^/@",'#10'"@(@_@:@@@@@@@@@@(@<"};'#10 ]); LazarusResources.Add('topendialog','XPM',[ '/* XPM */'#10'static char * topendialog_xpm[] = {'#10'"22 20 8 1",'#10'" '#9 @@ -1532,6 +1531,23 @@ LazarusResources.Add('topenpicturedialog','XPM',[ +'&$&$&$&%&$&@+$+$@",'#10'".%+$@@@@@@@@@@@@+$+$+@",'#10'".+$+$+$+$+$+$+$+$+$+' +'$@",'#10'".%+$+$+$+$+$+$+$+$+$+@",'#10'".@@@@@@@@@@@@@@@@@@@@@"};'#10 ]); +LazarusResources.Add('tpagecontrol','XPM',[ + '/* XPM */'#10'static char * tpagecontrol_xpm[] = {'#10'"19 14 29 1",'#10'" ' + +#9'c None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #080808",'#10'"@'#9'c #000000"' + +','#10'"#'#9'c #C1C1C1",'#10'"$'#9'c #F8F8F8",'#10'"%'#9'c #F0F0F0",'#10'"&' + +#9'c #FCFCFC",'#10'"*'#9'c #030303",'#10'"='#9'c #C5C5C5",'#10'"-'#9'c #8080' + +'80",'#10'";'#9'c #F4F4F4",'#10'">'#9'c #C4C4C4",'#10'",'#9'c #C0C0C0",'#10 + +'"'''#9'c #FEFEFE",'#10'")'#9'c #7C7C7C",'#10'"!'#9'c #8B8B8B",'#10'"~'#9'c ' + +'#767676",'#10'"{'#9'c #828282",'#10'"]'#9'c #878787",'#10'"^'#9'c #7A7A7A",' + +#10'"/'#9'c #7F7F7F",'#10'"('#9'c #888888",'#10'"_'#9'c #7D7D7D",'#10'":'#9 + +'c #898989",'#10'"<'#9'c #020202",'#10'"['#9'c #050505",'#10'"}'#9'c #010101' + +'",'#10'"|'#9'c #C3C3C3",'#10'" ....+@@@@@@@@ ",'#10'" .###+###@###@ ' + +' ",'#10'" .###+###@###@ ",'#10'"$.###%..........&.*",'#10'".###=#######' + +'#####-@",'#10'";#############>##-@",'#10'".################-@",'#10'"$#####' + +'###########-@",'#10'"$#####,##########-@",'#10'".################-@",'#10'"' + +';################-@",'#10'".################-@",'#10'"'')!~{]^////////(_:@"' + +','#10'"@<@[@}@@@@@@@@@@<@|"};'#10 +]); LazarusResources.Add('tpaintbox','XPM',[ '/* XPM */'#10'static char * tpaintbox_xpm[] = {'#10'"21 21 8 1",'#10'" '#9'c' +' None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #808080",'#10'"@'#9'c #C0C0C0",' diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 0527b7e293..a7b601a80a 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -130,8 +130,6 @@ type end; - {$IFDEF UsePageControl} - { TTabSheet } TPageControl = class; @@ -264,7 +262,6 @@ type //property OnUnDock; end; - {$ENDIF UsePageControl} { Custom draw } @@ -534,7 +531,7 @@ type property Color; property Columns; // property ColumnClick; -// property Constraints; + property Constraints; property Enabled; property Font; // property HideSelection; @@ -596,40 +593,41 @@ type procedure ApplyChanges; procedure InitializeWnd; override; procedure Loaded; override; -{ procedure SetBarTextFormat; } public constructor Create(AOwner: TComponent); override; procedure StepIt; procedure StepBy(Delta: Integer); published - property Min: Integer read GetMin write SetMin; - property Max: Integer read GetMax write SetMax; - property Position: Integer read GetPosition write SetPosition default 0; - property Step: Integer read FStep write SetStep default 10; - property Smooth : boolean read FSmooth write SetSmooth default false; property Align; - property Visible; - property Orientation: TProgressBarOrientation read FOrientation write SetOrientation default pbHorizontal; - property Enabled; - property OnEnter; - property OnExit; property BorderWidth; + property Constraints; property DragCursor; property DragKind; property DragMode; + property Enabled; property Hint; - property ParentShowHint; - property PopupMenu; - property ShowHint; - property TabOrder; - property TabStop; + property Max: Integer read GetMax write SetMax; + property Min: Integer read GetMin write SetMin; property OnDragDrop; property OnDragOver; property OnEndDrag; + property OnEnter; + property OnExit; property OnMouseDown; property OnMouseMove; property OnMouseUp; + property OnStartDock; property OnStartDrag; + property Orientation: TProgressBarOrientation read FOrientation write SetOrientation default pbHorizontal; + property ParentShowHint; + property PopupMenu; + property Position: Integer read GetPosition write SetPosition default 0; + property ShowHint; + property Smooth : boolean read FSmooth write SetSmooth default false; + property Step: Integer read FStep write SetStep default 10; + property TabOrder; + property TabStop; + property Visible; { ... to be implemented for Delphi compatibility // property Anchors; // property Constraints; @@ -687,7 +685,6 @@ type Procedure AssociateKeyDown(Sender: TObject; var Key: Word; ShiftState : TShiftState); procedure OnAssociateChangeBounds(Sender: TObject); procedure DoOnResize; override; - //procedure ChangeBounds(ALeft, ATop, AWidth, AHeight: Integer); Override; function CanChange: Boolean; dynamic; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Click(Button: TUDBtnType); dynamic; overload; @@ -740,7 +737,7 @@ type end; -{ TToolBar } + { TToolBar } const CN_DROPDOWNCLOSED = LM_USER + $1000; @@ -859,7 +856,6 @@ type FOldHandle: HBitmap; FUpdateCount: Integer; FHeightMargin: Integer; - { Toolbar menu support } FCaptureChangeCancels: Boolean; FInMenuLoop: Boolean; FTempMenu: TPopupMenu; @@ -1014,11 +1010,6 @@ type TTickStyle = (tsNone, tsAuto, tsManual); TTrackBarScalePos = (trLeft, trRight, trTop, trBottom); - { - @abstract(Simple trackbar.) - Introduced by Author Name - Currently maintained by Maintainer Name - } TTrackBar = class(TWinControl) private FOrientation: TTrackBarOrientation; @@ -1203,7 +1194,6 @@ type FHeight: integer; // height in pixels FInTree: Boolean; FImageIndex: integer; - //FItemId: HTreeItem; FItems: TTreeNodeArray; // first level child nodes FNextBrother: TTreeNode; // next sibling FNextMultiSelected: TTreeNode; @@ -1330,7 +1320,6 @@ type property Index: Integer read GetIndex; property IsVisible: Boolean read IsNodeVisible; property Items[ItemIndex: Integer]: TTreeNode read GetItems write SetItems; default; - //property ItemId: HTreeItem read FItemId; property Level: Integer read GetLevel; property MultiSelected: Boolean read GetMultiSelected write SetMultiSelected; property OverlayIndex: Integer read FOverlayIndex write SetOverlayIndex; @@ -1383,12 +1372,9 @@ type procedure WriteData(Stream: TStream); procedure WriteExpandedState(Stream: TStream); protected - //function AddItem(Parent, Target: HTreeItem; const Item: TTVItem; - // AddMode: TAddMode): HTreeItem; function InternalAddObject(Node: TTreeNode; const S: string; Data: Pointer; AddMode: TAddMode): TTreeNode; procedure DefineProperties(Filer: TFiler); override; - //function CreateItem(Node: TTreeNode): TTVItem; function GetCount: Integer; procedure SetItem(Index: Integer; AValue: TTreeNode); procedure SetUpdateState(Updating: Boolean); @@ -1415,7 +1401,6 @@ type procedure Delete(Node: TTreeNode); procedure EndUpdate; function GetFirstNode: TTreeNode; - //function GetNode(ItemId: HTreeItem): TTreeNode; function GetLastNode: TTreeNode; // last top level node function GetLastSubNode: TTreeNode; // absolute last node function GetLastExpandedSubNode: TTreeNode; // absolute last node @@ -1428,7 +1413,6 @@ type function ConsistencyCheck: integer; procedure WriteDebugReport(const Prefix: string; AllNodes: boolean); property Count: Integer read GetCount; - //property Handle: HWND read GetHandle; property Items[Index: Integer]: TTreeNode read GetNodeFromIndex; default; property KeepCollapsedNodes: boolean read FKeepCollapsedNodes write FKeepCollapsedNodes; @@ -1512,7 +1496,6 @@ type FLastVertScrollInfo: TScrollInfo; FMaxLvl: integer; // maximum level of all nodes FMaxRight: integer; // maximum text width of all nodes (needed for horizontal scrolling) - //FMemStream: TMemoryStream; fMouseDownX: integer; fMouseDownY: integer; FOnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent; @@ -1534,9 +1517,7 @@ type FOnSelectionChanged: TNotifyEvent; FOptions: TTreeViewOptions; FRClickNode: TTreeNode; - //FSaveIndex: Integer; FSaveItems: TStringList; - //FSaveTopIndex: Integer; FScrollBars: TScrollStyle; FScrolledLeft: integer; // horizontal scrolled pixels (hidden pixels at left) FScrolledTop: integer; // vertical scrolled pixels (hidden pixels at top) @@ -1552,13 +1533,8 @@ type FTreeLineColor: TColor; FTreeNodes: TTreeNodes; FUpdateCount: integer; - //FWideText: WideString; procedure CanvasChanged(Sender: TObject); - //procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; - //procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; - //procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; procedure CMDrag(var AMessage: TCMDrag); message CM_DRAG; - //procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; procedure EditWndProc(var Message: TLMessage); procedure DoDragOver(Source: TDragObject; X, Y: Integer; CanDrop: Boolean); function GetAutoExpand: boolean; @@ -1568,7 +1544,6 @@ type function GetHideSelection: boolean; function GetHotTrack: boolean; function GetKeepCollapsedNodes: boolean; - //function GetNodeFromItem(const Item: TTVItem): TTreeNode; function GetReadOnly: boolean; function GetRightClickSelect: boolean; function GetRowSelect: boolean; @@ -1591,7 +1566,6 @@ type procedure SetDropTarget(Value: TTreeNode); procedure SetHideSelection(Value: Boolean); procedure SetHotTrack(Value: Boolean); - //procedure SetImageList(Value: HImageList; Flags: Integer); procedure SetIndent(Value: Integer); procedure SetImages(Value: TCustomImageList); procedure SetInsertMarkNode(const AValue: TTreeNode); @@ -1627,12 +1601,9 @@ type procedure WMLButtonDown(var AMessage: TLMLButtonDown); message LM_LBUTTONDOWN; procedure WMNotify(var AMessage: TLMNotify); message LM_NOTIFY; procedure WMSize(var Msg: TLMSize); message LM_SIZE; - //procedure WMContextMenu(var Message: TLMContextMenu); message LM_CONTEXTMENU; - //procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; procedure InternalSelectionChanged; protected FChangeTimer: TTimer; - //procedure Edit(const Item: TTVItem); dynamic; function CanChange(Node: TTreeNode): Boolean; dynamic; function CanCollapse(Node: TTreeNode): Boolean; dynamic; function CanEdit(Node: TTreeNode): Boolean; dynamic; @@ -1841,7 +1812,7 @@ type property OnCollapsed; property OnCollapsing; property OnCompare; - //property OnContextPopup; + property OnContextPopup; property OnCustomDraw; property OnCustomDrawItem; property OnDblClick; @@ -1920,14 +1891,6 @@ const { Toolbar menu support } var - //ToolMenuKeyHook: HHOOK; - //ToolMenuHook: HHOOK; - //InitDone: Boolean; - //MenuToolBar: TToolBar; - //MenuToolBar2: TToolBar; - //MenuButtonIndex: Integer; - //LastMenuItem: TMenuItem; - //LastMousePos: TPoint; StillModal: Boolean; @@ -1944,19 +1907,15 @@ end; procedure Register; begin RegisterComponents('Common Controls',[TTrackbar,TProgressBar,TTreeView, - TListView,TStatusBar,TToolBar,TUpDown]); - RegisterNoIcon([TToolButton]); + TListView,TStatusBar,TToolBar,TUpDown,TPageControl]); + RegisterNoIcon([TToolButton,TTabSheet]); end; {$I statusbar.inc} {$I statuspanel.inc} {$I statuspanels.inc} - -{$IFDEF UsePageControl} {$I tabsheet.inc} {$I pagecontrol.inc} -{$ENDIF UsePageControl} - { $I alignment.inc} {$I listcolumns.inc} {$I listcolumn.inc} @@ -1976,6 +1935,9 @@ end. { ============================================================================= $Log$ + Revision 1.89 2003/09/20 15:24:54 mattias + implemented TPageControl and TTabSheet + Revision 1.88 2003/09/20 13:27:49 mattias varois improvements for ParentColor from Micha diff --git a/lcl/extctrls.pp b/lcl/extctrls.pp index c2135b4ed2..d6ebf12ff4 100644 --- a/lcl/extctrls.pp +++ b/lcl/extctrls.pp @@ -171,7 +171,6 @@ type procedure ShowControl(APage: TControl); override; procedure UpdateTabProperties; virtual; property Page[Index: Integer]: TCustomPage read GetPage; - property Pages: TStrings read fAccess write SetPages; property ActivePageComponent: TCustomPage read GetActivePageComponent write SetActivePageComponent; property ActivePage: String read GetActivePage write SetActivePage @@ -183,9 +182,11 @@ type function CanTab: boolean; override; function GetImageIndex(ThePageIndex: Integer): Integer; virtual; function IndexOf(APage: TCustomPage): integer; + function CustomPage(Index: integer): TCustomPage; public //property MultiLine: boolean read fMultiLine write SetMultiLine default false; property PageCount: integer read GetPageCount; + property Pages: TStrings read fAccess write SetPages; property PageIndex: Integer read GetPageIndex write SetPageIndex default -1; property PageList: TList read fPageList; property OnPageChanged: TNotifyEvent read fOnPageChanged write fOnPageChanged; @@ -824,6 +825,9 @@ end. { $Log$ + Revision 1.79 2003/09/20 15:24:54 mattias + implemented TPageControl and TTabSheet + Revision 1.78 2003/09/20 13:27:49 mattias varois improvements for ParentColor from Micha diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index 67ca0fb388..8ccda838bd 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -431,6 +431,11 @@ begin Result:=FPageList.IndexOf(APage); end; +function TCustomNotebook.CustomPage(Index: integer): TCustomPage; +begin + Result:=GetPage(Index); +end; + {------------------------------------------------------------------------------ method TCustomNotebook DoCloseTabClicked Params: APage: TCustomPage @@ -773,6 +778,9 @@ end;} { ============================================================================= $Log$ + Revision 1.36 2003/09/20 15:24:54 mattias + implemented TPageControl and TTabSheet + Revision 1.35 2003/09/20 13:27:49 mattias varois improvements for ParentColor from Micha