FG Spreadshirt Swag
  1. #1

    Combobox's and setVisibile(false)

    I started using a couple combo boxes for selections that just don't make sense in a cycler and noticed that setVisible() doesn't seem to work entirely on them.

    The way I've set things up is the player can use a cycler to select a "type" that type hides/shows specific options to select. Some of those options are comboboxes, some aren't.

    When setting those combos to setVisibile(false) you'll still see the pull down for the box as a tiny sliver (you can't actually see the items when you click it but just a long line down).

    Is there some trick to getting the combo boxes to actually hide every piece?

    Here is what I'm seeing. This section has no drop downs, just cyclers.



    When you click on the pull down this is how it looks (note the scroll bar now also).

    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    I worked with comboboxes recently; I actually rewrote the code to make a visually different one that functioned slightly differently. But if I remember correctly, there are two controls, well three technically. The combobox entry, the button, and the window that is created. The window is made progmatically and stored as a variable in the combobox control. I removed the button on my version, but I think it is also a control made in the combobox code and stored in a variable. Check the generic lua files for a variable at the top that would hold the control and try to add a setVisible(false) for that control as well.
    I never claimed to be sane. Besides, it's more fun this way.

  3. #3
    Quote Originally Posted by Nickademus View Post
    I worked with comboboxes recently; I actually rewrote the code to make a visually different one that functioned slightly differently. But if I remember correctly, there are two controls, well three technically. The combobox entry, the button, and the window that is created. The window is made progmatically and stored as a variable in the combobox control. I removed the button on my version, but I think it is also a control made in the combobox code and stored in a variable. Check the generic lua files for a variable at the top that would hold the control and try to add a setVisible(false) for that control as well.
    Crap, yeah I had to add a new "setCustomVisibility()" to replace setVisible() that actually worked. It would hide/show the ctrlButton as it was suppose to then.

    This seems more like a bug in the combobox template/code.

    Code:
    function setCustomVisibility(bVisible)
        
        self.setVisible(bVisible);
        
        if ctrlList then 
            ctrlList.setVisible(bVisible);
        end
        if ctrlButton then
            ctrlButton.setVisible(bVisible);
        end
    end
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  4. #4
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    There is function "setComponentVisibility" or "setComboboxVisibility" or something like that (check CoreRPG codes) which will hide combobox controls.
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

  5. #5
    I skimmed right over that, blind!

    setComboBoxVisible() is the one that works, thanks for the tip! Saves me having to replace it with another
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  6. #6
    Since, the combo box is a generic control template that manages multiple fields and the API doesn't have callbacks for visibility and read only state changes, there are two special functions within the combo box template to handle these.

    setComboBoxReadOnly(bool)
    setComboBoxVisible(bool)

    Cheers,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in