summaryrefslogtreecommitdiff
path: root/src/gui/fpg_tab.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-08-20 23:39:02 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-08-20 23:39:02 +0100
commitadf4fa9961122333a7699972213a7d37967079f8 (patch)
tree99f8ae70069827affb513f73caceaf22997ee515 /src/gui/fpg_tab.pas
parent1abbcc014af1a0e42d6c37bbb4a9e73c2501472f (diff)
downloadfpGUI-adf4fa9961122333a7699972213a7d37967079f8.tar.xz
Fix PageControl bug where left or right tabs are unresponsive to clicks
PageControl tabs were on the left or right, and you went over a certain number of tabs, then you couldn't change tabs by clicking with the mouse. The TabSheetAtPos() never took into account the TabPosition, and it always used MaxButtonWidthSum, which is only meant for Top or Bottom postitions.
Diffstat (limited to 'src/gui/fpg_tab.pas')
-rw-r--r--src/gui/fpg_tab.pas11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/fpg_tab.pas b/src/gui/fpg_tab.pas
index 29addb12..5ef516bb 100644
--- a/src/gui/fpg_tab.pas
+++ b/src/gui/fpg_tab.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2012 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -1291,10 +1291,7 @@ var
begin
Result := nil;
h := TfpgTabSheet(FPages.First);
-
lp := FMargin;
- if MaxButtonWidthSum > (Width-(FMargin*2)) then
- h := FFirstTabButton;
case TabPosition of
tpTop:
@@ -1324,6 +1321,8 @@ begin
if TabPosition in [tpTop, tpBottom] then
begin
+ if MaxButtonWidthSum > (Width-(FMargin*2)) then
+ h := FFirstTabButton;
if (y > p1) and (y < p2) then
begin
while h <> nil do
@@ -1346,11 +1345,13 @@ begin
if TabPosition in [tpLeft, tpRight] then
begin
+ bh := ButtonHeight; // initialize button height
+ if MaxButtonHeightSum > (Height-(FMargin*2)) then
+ h := FFirstTabButton;
if (x > p1) and (x < p2) then
begin
while h <> nil do
begin
- bh := ButtonHeight; // initialize button height
if (y > lp) and (y < lp + bh) then
begin
if h <> ActivePage then