Disable a Tab?

  1. 6 years ago

    Brian B

    11 Sep 2013 Brunswick, Maine, USA

    Is it possible to disable a single tab within a tabpanel?

    I have some tabs defined, but they are not functioning yet, and I don't want to confuse testers by allowing access to things they can't test.
    I was hoping to disable the tabs without having to remove them completely. Possible?

  2. Paul L

    11 Sep 2013 Xojo Inc http://docs.xojo.com

    No, you cannot disable a tab with Xojo, although there may be declares or 3rd party plugins that can do it.

    If the controls on the tab are on a ContainerControl (always a good practice), then you can just disable the container instead to disable all the controls on the tab.

    Or you could use the Change event handler to and prevent the tab from being switched to.

  3. Paul B

    13 Sep 2013 Pre-Release Testers, Xojo Pro Europe (UK, Somerset)

    Not the best solution but could you check which panel is selected in the change event and select a different panel instead. I.e. Remove the names off the inactive panels to make less confusing.

    if tab panel=3 then select panel 2 - not real code btw.

    This would have the effect of not allowing access to the panels.

  4. 2 years ago
    Edited 2 years ago

    We did something close to desable a tab in our toolkit on GitHub . It's a bit outdated (we need to cleanup few thing before we continue to support it)

    Note : it doesn't work on Linux

  5. Christian S

    27 Jul 2017 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    We have something in MBS Plugins:
    http://www.monkeybreadsoftware.net/class-tabpanel.shtml

  6. Christian S

    27 Jul 2017 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Ah, I need to update that for cocoa.
    Until that use NSTabViewMBS class directly:

    http://www.monkeybreadsoftware.net/class-nstabviewmbs.shtml

  7. 3 months ago

    James B

    Dec 20 Pre-Release Testers, Xojo Pro

    i know this is a very old discussion, but I am stuck on it. my tab panel is all tab and no panel: just 33 pixels tall. i want to disable the tabs themselves, not any controls on the panel because there are none. to see the issue, it is easy to make a little window, create a little container control, put a tab panel in it, then set the container to disabled. the tabs still respond. is this the expected behavior?

  8. Jason P

    Dec 20 Xojo Inc Texas

    @James B i know this is a very old discussion, but I am stuck on it. my tab panel is all tab and no panel: just 33 pixels tall. i want to disable the tabs themselves, not any controls on the panel because there are none. to see the issue, it is easy to make a little window, create a little container control, put a tab panel in it, then set the container to disabled. the tabs still respond. is this the expected behavior?

    Sounds like you should be using a segmented control.

  9. Tim P

    Dec 20 Pre-Release Testers feedback://46303

    @James B the tabs still respond. is this the expected behavior?

    Disabled tabs aren't really a user friendly thing. Here's from the Apple HIG about iOS tab bars (I was looking for desktop information, but I think the idea still applies).

    Don’t remove or disable a tab when its function is unavailable.
    If tabs are available in some cases but not in others, your app’s interface becomes unstable and unpredictable. Ensure that all tabs are always enabled, and explain why a tab’s content is unavailable. For example, if there are no songs on an iOS device, the My Music tab in the Music app explains how to download songs.

    Even if you're not trying to explain how to download songs, the tab should still be selectable with the interface indicating there is nothing to do. This allows an app to be explored and understood prior to actual usage, which helps ease learning curves and improves user experience.

  10. Amy B

    Dec 25 Marietta, Georgia, USA.

    Use a PagePanel and a set of buttons up top.

    Each button can function in the place of tabs and can be enabled / disabled at will.

  11. Amy B

    Dec 25 Marietta, Georgia, USA.

    It would also make sense to have all the controls and tabs in place, and simply enable buttons for features AS they become usable - I know, a bit confusing, but you can communicate to testers what features are being implemented and need testing.

  12. Bob K

    Dec 26 Pre-Release Testers, Xojo Pro Kansas City

    If you're looking for tabs that can have icons, close buttons, be disabled, and face any direction you could take a look at our Tab Control https://www.bkeeney.com/allproducts/bks-tab-control/ We spent a lot of time making sure they looked good on HiDPI monitors too.

or Sign Up to reply!