summaryrefslogtreecommitdiff
path: root/src/gui/gui_tab.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-15 10:30:46 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-15 10:30:46 +0000
commit9e89b98db6b5c885da8c2b67782faf9c9b93a0f2 (patch)
treeb786db572bae448c54421c64133de92a405c0ba2 /src/gui/gui_tab.pas
parente86fedd9b4bdd139e06d59952ddaa65e1cbd6a11 (diff)
downloadfpGUI-9e89b98db6b5c885da8c2b67782faf9c9b93a0f2.tar.xz
* Published BackgroundColor and OnPaint for TfpgForm
* TfpgWidget.HandleShow now always sets Visible = True. This fixes issue with the fpGUI-LCL interface as well. * Added a few more safety checks into the PageControl widget. * The OnPaint event is now wrapped with BeginDraw/EndDraw calls so that a event handler for OnPaint doesn't need to call it explicitly.
Diffstat (limited to 'src/gui/gui_tab.pas')
-rw-r--r--src/gui/gui_tab.pas16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas
index e85cebb8..5351ae46 100644
--- a/src/gui/gui_tab.pas
+++ b/src/gui/gui_tab.pas
@@ -89,7 +89,7 @@ type
FStyle: TfpgTabStyle;
FTabPosition: TfpgTabPosition;
function GetActivePageIndex: integer;
- function GetPage(AIndex: integer): TfpgTabSheet;
+ function GetPage(AIndex: integer): TfpgTabSheet;
function GetPageCount: Integer;
procedure InsertPage(const APage: TfpgTabSheet);
procedure RemovePage(const APage: TfpgTabSheet);
@@ -258,8 +258,13 @@ begin
FPages.Remove(APage);
{$Note This still needs to be fixed.}
if APage = FActivePage then
+ begin
// FActivePage := FindNextPage(APage, True);
- ActivePage := TfpgTabSheet(FPages.First);
+// if FPages.Count > 0 then
+ ActivePage := TfpgTabSheet(FPages.First);
+// else
+// ActivePage := nil;
+ end;
end;
procedure TfpgPageControl.SetActivePageIndex(const AValue: integer);
@@ -454,6 +459,8 @@ begin
Exit; //==>
h := TfpgTabSheet(FPages.First);
+ if h = nil then
+ Exit;
Canvas.BeginDraw;
Canvas.SetTextColor(clText1);
@@ -712,6 +719,9 @@ destructor TfpgPageControl.Destroy;
var
ts: TfpgTabSheet;
begin
+ FOnChange := nil;
+ FActivePage := TfpgTabSheet(FPages[0]);
+ ActiveWidget := nil;
while FPages.Count > 0 do
begin
ts := TfpgTabSheet(FPages.Last);
@@ -719,9 +729,7 @@ begin
ts.Free;
end;
FPages.Free;
-
FFirstTabButton := nil;
- FOnChange := nil;
inherited Destroy;
end;