|
|
|
Rank: Advanced Member
Joined: 10/3/2008 Posts: 35 Points: 105
|
I have to update this myself everytime you guys release a new version. I submitted this once before. Can you please include this.
Here is the code. It allows you to click on a tab that is already clicked. It basically allows you to trigger a refresh, reset, or reload the page. I added the AllowSelectedTabClick property and then just modified the if statement on TabViewHeaderClicked(int idx).
/// <summary>
/// If set to true, the tab control allows you to click on the current tab even if it's selected.
/// </summary>
[DefaultValue(false)]
public bool AllowSelectedTabClick
{
get {return StateUtil.Get<bool>(ViewState, "AllowSelectedTabClick", false);}
set { StateUtil.Set(ViewState, "AllowSelectedTabClick", value, false); }
}
#endregion
#region [ -- Overridden base class methods -- ]
[Method]
internal void TabViewHeaderClicked(int idx)
{
// do nothing if the clicked TabView is disabled or the same TabView was clicked
if (!TabViews[idx].Enabled || ((idx == ActiveTabViewIndex) && !AllowSelectedTabClick))
return;
// update the tabViewIndex, it should be updated accordingly in the SetPreRenderDefaults();
ActiveTabViewIndex = idx;
// throw the selected index changed event
if (ActiveTabViewIndexChanged != null)
ActiveTabViewIndexChanged(this, new EventArgs());
}
|
|
|
|
Rank: Advanced Member
Joined: 10/3/2008 Posts: 35 Points: 105
|
FYI, I mimiced your other properties... it seems to work as planned.
|
|
|
Rank: Titan  Joined: 8/21/2008 Posts: 338 Points: 2,017
|
Great stuff that you are able to fine-tune Gaia to your needs. Our product philosophy advocates the introduction of additional properties where they make sense. I see your need here and I think there are other ways of solving this. For example by providing access to each TabHeader as a control you could register AspectClickable to it to achieve the same functionality. Next time the TabControl goes through a face-lift, I'll look into solving your needs. Gaiaware Core Developer Follow us at Twitter : http://twitter.com/janblomquist
|
|
|
|
Rank: Advanced Member
Joined: 10/3/2008 Posts: 35 Points: 105
|
I think I see what you're saying with the aspect clickable. What other additional functionality would that add? Seems like overkill just to allow you to click a tab that has already been selected.
Just out of curiousity, why wouldn't you just throw it in as is? Is there a downside that I'm unaware of?
|
|
|
Rank: Titan  Joined: 8/21/2008 Posts: 338 Points: 2,017
|
Adding support for Aspects increases the flexibility of the TabControl. Though it might seem unlikely, another developer might ask for TabView reordering via Drag&Drop. Adding an Aspects collection to TabViews could accommodate this scenario, whereas adding another property to the TabControl doesn't. Also we will try to leverage the "power of sameness" in as trying to have the same concepts apply to all widgets. Also we could perhaps done a better job in making our widgets "inheritance-ready" so that you could inject your changes in a derived control. That way you wouldn't have to merge your code changes back in all the time. I haven't studied your particular problem, but perhaps it's feasible to do it via inheritance? Anyway, I find your question and desired functionality highly valuable so it will get into our future product somehow. Gaiaware Core Developer Follow us at Twitter : http://twitter.com/janblomquist
|
|
|
|
Rank: Advanced Member
Joined: 10/3/2008 Posts: 35 Points: 105
|
Sounds good. I didn't try inheritance actually. That seems logical, but I guess I had to track down where it was in the source to begin with, so it just seemed as easy to add it there. Maybe I'll try the inheritance route next time.
|
|
|