diff options
-rw-r--r-- | examples/gui/tabtest/tabtest.lpr | 18 | ||||
-rw-r--r-- | src/gui/gui_tab.pas | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/examples/gui/tabtest/tabtest.lpr b/examples/gui/tabtest/tabtest.lpr index 6ff800a7..c52e011f 100644 --- a/examples/gui/tabtest/tabtest.lpr +++ b/examples/gui/tabtest/tabtest.lpr @@ -18,9 +18,11 @@ type tsTwo: TfpgTabSheet; tsThree: TfpgTabSheet; lbl1, lbl2, lbl3: TfpgLabel; - btn1: TfpgButton; + btn1, btn2, btn3: TfpgButton; edit1: TfpgEdit; procedure btnQuitClick(Sender: TObject); + procedure btn2Click(Sender: TObject); + procedure btn3Click(Sender: TObject); public constructor Create(AOwner: TComponent); override; end; @@ -32,6 +34,16 @@ begin Close; end; +procedure TMainForm.btn2Click(Sender: TObject); +begin + pcMain.ActivePage := tsOne; +end; + +procedure TMainForm.btn3Click(Sender: TObject); +begin + pcMain.ActivePage := tsTwo; +end; + constructor TMainForm.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -73,6 +85,10 @@ begin lbl3 := CreateLabel(tsThree, 50, 50, 'TabSheet Three'); + + btn2 := CreateButton(self, 10, 320, 80, 'Page 1', @btn2Click); + btn3 := CreateButton(self, 100, 320, 80, 'Page 2', @btn3Click); + end; procedure MainProc; diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas index 316608e9..54aa26ae 100644 --- a/src/gui/gui_tab.pas +++ b/src/gui/gui_tab.pas @@ -224,6 +224,7 @@ begin FActiveSheet := AValue; ActiveWidget := AValue; RePaint; + fpgSendMessage(self, ActiveWidget, FPGM_PAINT) end; function TfpgPageControl.MaxButtonWidthSum: integer; |