summaryrefslogtreecommitdiff
path: root/src/gui/gui_tab.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-09-28 12:29:32 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-09-28 12:29:32 +0000
commit6cc7d747a3c1f7acef2484a90cb7b36ca81a1c19 (patch)
tree1dfb4b8b17cc89e2dfa390b9192c974953cc2f67 /src/gui/gui_tab.pas
parenta71fd7ccb9e849b95a96eda4c836bc07d61abe80 (diff)
downloadfpGUI-6cc7d747a3c1f7acef2484a90cb7b36ca81a1c19.tar.xz
* Implemented Pages[] property for TfpgPageControl
* Fixed bug where PageControl.AppendTabSheet did not add the new TabSheet to the internal FPages list. * Removed many compiler hints and warnings from the TfpgListview component. * Removed compiler warning from the TfpgMRU component.
Diffstat (limited to 'src/gui/gui_tab.pas')
-rw-r--r--src/gui/gui_tab.pas30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas
index 8b6ad21e..0996f13c 100644
--- a/src/gui/gui_tab.pas
+++ b/src/gui/gui_tab.pas
@@ -89,6 +89,7 @@ type
FStyle: TfpgTabStyle;
FTabPosition: TfpgTabPosition;
function GetActivePageIndex: integer;
+ function GetPage(AIndex: integer): TfpgTabSheet;
function GetPageCount: Integer;
procedure InsertPage(const APage: TfpgTabSheet);
procedure RemovePage(const APage: TfpgTabSheet);
@@ -121,6 +122,7 @@ type
function AppendTabSheet(ATitle: string): TfpgTabSheet;
property PageCount: Integer read GetPageCount;
property ActivePage: TfpgTabSheet read FActivePage write SetActivePage;
+ property Pages[AIndex: integer]: TfpgTabSheet read GetPage;
property OnChange: TTabSheetChange read FOnChange write FOnChange;
published
property ActivePageIndex: integer read GetActivePageIndex write SetActivePageIndex;
@@ -231,6 +233,13 @@ begin
Result := FActivePageIndex;
end;
+function TfpgPageControl.GetPage(AIndex: integer): TfpgTabSheet;
+begin
+ Result := nil;
+ if (AIndex >= 0) and (AIndex < FPages.Count) then
+ Result := TfpgTabSheet(FPages[AIndex]);
+end;
+
function TfpgPageControl.GetPageCount: Integer;
begin
Result := FPages.Count;
@@ -720,23 +729,10 @@ begin
end;
function TfpgPageControl.AppendTabSheet(ATitle: string): TfpgTabSheet;
-var
-// h: PTabSheetList;
- nt: TfpgTabSheet;
-begin
-// h := FFirstTabSheet;
- nt := TfpgTabSheet.Create(self);
- nt.Text := ATitle;
- //if h = nil then
- //FFirstTabSheet := nl
- //else
- //begin
- //while h^.next <> nil do
- //h := h^.next;
- //h^.next := nl;
- //nl^.prev := h;
- //end;
- result := nt;
+begin
+ Result := TfpgTabSheet.Create(self);
+ Result.Text := ATitle;
+ InsertPage(Result);
end;
end.