View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002864||JEDI VCL||00 JVCL Components||public||2005-04-12 02:24||2005-05-18 09:15|
|Target Version||Fixed in Version||3.10|
|Summary||0002864: JvTabBar doesn't preserve the currently selected tab item|
|Description||When attempting to change the currently selected tab at *design time* by setting the Selected property of that particular TJvTabBarItem to True, this change is not persistent, i.e. the changed value of the Selected property doesn't get written into DFM because it was told not to do so - see the 'stored False' specifier at the end of Selected property. Andreas, is there any reason for this?|
|Steps To Reproduce||1) Create a new project.|
2) Drop TJvTabBar onto the form.
3) Create some tab items.
4) Activate some tab item other than the first one.
5) Set its Selected property to True.
6) Run this app and you'll see that the selected item is always the first tab item no matter what you set at design time.
|Additional Information||Although this might look like a banality, it leads to a serious problems when TJvTabBar is used in conjunction with TJvPageList (selected tab item and active page properties could easily get out of sync).|
|Tags||No tags attached.|
I've taken a quick look at the code and believe that the following modifications can fix the current situation (not tested though):
(1) Remove the 'stored False' specifier from the declaration of Selected property of TJvTabItem. Instead, some 'default False' specifier would be more appropriate, IMO.
(2) In TJvCustomTabBar introduce an overridden Loaded method whose implementation would look like this one:
SelectedTab := FindSelectableTab(nil);
What do you think?
||Do you have a sample application for this?|
Although this bug is quite reproducible, I'm afraid it's not feasible for me to prepare a test case. You have to do it yourself, it's very simple - just please follow those 6 steps I mentioned in 'Steps to reproduce' section.
I try to explain why the test case can't be prepared. The problem is that when I set Selected property of some TJvTabBarItem to True, this change isn't propagated to the DFM file *because* this property has 'stored False' in its declaration. If I prepare a test case for this bug on my machine and send it to you, you will simply see nothing wrong with the test case.
Hope I made it clear.
I haven't stored the Item.Selected property because it was "calculated" from the TabBar. But while designing the component I must missed the fact that I do not have a published property that stores the selected tab index in the whole component.
This is fixed in CVS by replacing "stored False" by "default False" and the Loaded method is added.
|2005-04-12 02:24||ivobauer||New Issue|
|2005-04-12 04:59||ivobauer||Note Added: 0006933|
|2005-05-18 06:13||obones||Note Added: 0007192|
|2005-05-18 06:13||obones||Status||new => feedback|
|2005-05-18 06:59||ivobauer||Note Added: 0007205|
|2005-05-18 09:15||AHUser||Status||feedback => resolved|
|2005-05-18 09:15||AHUser||Resolution||open => fixed|
|2005-05-18 09:15||AHUser||Assigned To||=> AHUser|
|2005-05-18 09:15||AHUser||Note Added: 0007216|