Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getOptionBox separator refinement #450

Closed
natfast opened this Issue May 3, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@natfast
Copy link

natfast commented May 3, 2018

Hi Again!

Was working with the option box and I had items that started with numbers, including -1. This caused a problem in that the option box code checks for a leading "-".

Could this be extended to leading and trailing "-", so that negative numbers could be supported?

  • Separator item -

Or... pass in an optional Separator Value?!

            val = self.widgetManager.get(self.Widgets.TickOptionBox, title, group=WidgetManager.VARS)
            retVal = {}
            for k, v in val.items():
                retVal[k] = bool(v.get())
            return retVal
        else:
            val = self.widgetManager.get(self.Widgets.OptionBox, title, group=WidgetManager.VARS)
            val = val.get().strip()
            # set to None if it's a divider
            if val.startswith("-") or len(val) == 0:
                val = None
            return val

@jarvisteach jarvisteach added this to the 1.0 milestone May 5, 2018

@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented May 5, 2018

Yes, good point! I think having a - at each end sounds like the simplest fix. This will, however, affect people's existing code, so may need to be done with an option to configure (a boolean flag perhaps)...

@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented May 7, 2018

Actually, to keep it simpler, I will just include a parameter where the user sets the character, and default it to the dash.

jarvisteach added a commit that referenced this issue May 7, 2018

Can now configure the character for disabled options #450
New function: setOptionBoxDisabledChar()
New parameter: disabled

@jarvisteach jarvisteach closed this May 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.