Announcement

Collapse
No announcement yet.

DlgRadioButton.GetProperties and tb.Enabled usage example.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DlgRadioButton.GetProperties and tb.Enabled usage example.

    Hi IndigoRose,

    As a non-programmer I've managed to figure out all of my needs making a few complex installers over the years using Setup Factory's excellent Help file. However I'm stumped on how to use
    DlgRadioButton.GetProperties
    and
    tb.Enabled
    The "Examples" page isn't explicit.

    I want to find out if my radio button was disabled. On Preload I have a condition that disables a radio button and provides a popup message telling the user why its disabled based on what was found on the user's system, if the user clicks Next then Back, I don't want the popup message again I want to prevent that but I can't figure out how to know if the radio control is already disabled.

    Thanks in advance.

  • #2
    If you want to show the popups only once, I suggest that you do it in a different manner.

    Think about this like a cookie in your browser, once it is set, it is used instead of running the code again (or in a browser, ask for credentials or prefeneces again). In this method, you would define a global variable in your On Startup event script to initialize it, like so:
    Code:
    bExplanationsShown = false;
    Then, in your screen where you have the popup messages, at the end of the script, and after all popups were shown, you would set the variable again:
    Code:
    bExplanationsShown = true;
    Finally, before you show any of these popups, you would check the current state of this variable, so they will not be shown more than once. Example:
    Code:
    if not bExplanationsShown then
       Dialog.Message("Setup", "Your explanation here", MB_OK);
    end
    If you want to check the current state of a radio button with id CTRL_RADIO_BUTTON_01, you could do this:
    Code:
    local tProps = DlgRadioButton.GetProperties(CTRL_RADIO_BUTTON_01) ;
    if not tProps.Enabled then
       -- radio button is disabled
    end
    or
    Code:
    if not DlgRadioButton.GetProperties(CTRL_RADIO_BUTTON_01).Enabled then
       -- radio button is disabled
    end
    I hope this helps.

    Comment


    • #3
      Perfect solution thanks so much!

      Comment

      Working...
      X