Re: widget_tab: prevent switching? [message #63979] |
Wed, 26 November 2008 04:23 |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Nov 26, 9:16 am, Justus Skorps <ju...@gmx.de> wrote:
> Hi all,
>
> in my GUI I have an widget_tab with different tabs, each containing
> only a widget_base with a widget_draw. I need a possibility to
> temporary prevent to switch to another tab without disabling the
> widget_draw on the current tab. Disabling the whole widget_tab
> prevents switching but also disables button_events from the
> widget_draw of the current tab. The only workaround I found so far
> (switch back to the current tab when a tab event occurs) leads to some
> other problems and a lot of code work...
>
> I also tried to disable the bases of each tabs or set the tab_mode to
> 0, nothing works...
>
> Anyone knows a way to prevent the switching?
>
> thanx,
> Justus
Hi Justus,
a workaround would be to set sensitive=0 on all the other child bases
of the widget_tab. This won't prevent you from tabbing to those tabs,
it just prevents you from doing anything once you get there. It's a
clumsy workaround, especially if you want to let the user know why
they're not allowed to do anything in the other tabs - maybe a tooltip
on desensitized buttons ('Finish work in Tab0 first!') would work. I
agree it makes both the code and the GUI messy.
One other thing you might think of is to create a new modal tlb whose
group_leader is the relevant child base of the widget_tab. I don't
really like the "2-GUI" effect this gives, but it would also work.
If there's a better way of doing it, I'd love to hear it!
Regards,
Chris
|
|
|