View Issue Details

IDProjectCategoryView StatusLast Update
0004656JEDI VCL00 JVCL Componentspublic2009-06-01 19:43
Reporterlomo74Assigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.34 
Target VersionFixed in Version3.37 
Summary0004656: TJvTabBar with PageListTabLink=true shows wrong page after closing tab
DescriptionIf a TJvTabBar is linked with a TJvPageList and PageListTabLink is true, after closing a tab the TabBar is supposed to show either:
- the *next* page, if the closed tab index < pagecount - 1;
- the *previous* page, in the other case, but
- *no* page if pagecount = 1 (no pages left after closing this one)
A "shift by one" bug in TJvCustomPageList.RemovePage and TJvCustomPageList.FindNextPage prevents this from working correctly.
Proposed solution:
in TJvCustomPageList.RemovePage the first line should be
  NextPage := FindNextPage(APage, {True}(FPages.IndexOf(APage) < PageCount - 1), not (csDesigning in ComponentState));

in TJvCustomPageList.FindNextPage:
...
    repeat
      if GoForward then
      begin
        Inc(I);
{ if I >= FPages.Count - 1 then }
        if I > FPages.Count - 1 then
          I := 0;
      end
      else
      begin
{ if I <= 0 then }
        if I < 0 then
          I := FPages.Count - 1;
        Dec(I);
      end;
      Result := Pages[I];
      if IncludeDisabled or Result.Enabled then
        Exit;
    until I = StartIndex;
...

Regards
- Lorenzo -
TagsNo tags attached.

Activities

lomo74

2009-01-10 04:45

reporter   ~0015233

..OOOPS!!!...
The code attached previously did crash the IDE, sorry. This is fixed:

in TJvCustomPageList.FindNextPage:
...
    repeat
      if GoForward then
      begin
        Inc(I);
{ if I >= FPages.Count - 1 then }
        if I > FPages.Count - 1 then
          I := 0;
      end
      else
      begin
{ if I <= 0 then }
        Dec(I);
        if I < 0 then
          I := FPages.Count - 1;
      end;
      Result := Pages[I];
      if IncludeDisabled or Result.Enabled then
        Exit;
    until I = StartIndex;
...

obones

2009-04-29 11:42

administrator   ~0015445

Please provide the zipped sources of a sample application showing this.

2009-04-29 17:42

 

issue4656.zip (238,479 bytes)

lomo74

2009-04-29 17:46

reporter   ~0015496

issue4656.zip uploaded.
ciao - Lorenzo -

AHUser

2009-06-01 19:43

developer   ~0015592

Fixed in SVN.

Issue History

Date Modified Username Field Change
2009-01-10 02:32 lomo74 New Issue
2009-01-10 04:45 lomo74 Note Added: 0015233
2009-02-02 01:21 obones Status new => acknowledged
2009-04-29 11:42 obones Note Added: 0015445
2009-04-29 11:42 obones Status acknowledged => feedback
2009-04-29 17:42 lomo74 File Added: issue4656.zip
2009-04-29 17:46 lomo74 Note Added: 0015496
2009-06-01 19:43 AHUser Note Added: 0015592
2009-06-01 19:43 AHUser Status feedback => resolved
2009-06-01 19:43 AHUser Fixed in Version => Daily / SVN
2009-06-01 19:43 AHUser Resolution open => fixed
2009-06-01 19:43 AHUser Assigned To => AHUser