Announcement

Collapse
No announcement yet.

Packages Question

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

  • Packages Question

    Sorry for the Noob question but I am getting back in to SUF 9.5.1. My packages screen will allow to go "next" without checking a "box". How do I prevent this from happening? My default state is "unchecked"

    thanks!

  • #2
    First, on the Select Packages attributes, uncheck the Enabled option for the Next button, so it shows like this by default:

    Click image for larger version

Name:	SCRN-2017-10-30-01.png
Views:	81
Size:	2.1 KB
ID:	298736

    Now, in the On Ctrl Message event script, make it so that the button becomes enabled when at least one package is selected for installation. If no package is selected, make sure that the button becomes disabled again, as somebody could select and de-select a package, so the button must become enabled, then disabled again.

    Ulrich

    Comment


    • #3
      Originally posted by Ulrich View Post
      First, on the Select Packages attributes, uncheck the Enabled option for the Next button, so it shows like this by default:

      [ATTACH=CONFIG]n298736[/ATTACH]

      Now, in the On Ctrl Message event script, make it so that the button becomes enabled when at least one package is selected for installation. If no package is selected, make sure that the button becomes disabled again, as somebody could select and de-select a package, so the button must become enabled, then disabled again.

      Ulrich
      I will give this a try tonight! thanks Ulrich

      Comment


      • #4
        Originally posted by Ulrich View Post
        First, on the Select Packages attributes, uncheck the Enabled option for the Next button, so it shows like this by default:

        [ATTACH=CONFIG]n298736[/ATTACH]

        Now, in the On Ctrl Message event script, make it so that the button becomes enabled when at least one package is selected for installation. If no package is selected, make sure that the button becomes disabled again, as somebody could select and de-select a package, so the button must become enabled, then disabled again.

        Ulrich

        Currently I have: (On Crtl Message)

        - These actions are triggered by the controls on the screen.

        if(e_CtrlID == CTRL_SELECT_PACKAGE_TREE) then
        -- the control message is from the select packages tree...

        -- if the current selection changed (i.e. a different package was selected),
        -- update the description field
        if(e_MsgID == MSGID_ONSELCHANGED) then

        -- get the selected item's description
        local strText = e_Details.Description;

        -- if the selected item is a package, add its size to the description
        if(e_Details.Type == 1) then
        strText = strText.."\n( "..String.GetFormattedSize(e_Details.Size).." )";
        end

        -- update the description field
        DlgStaticText.SetProperties(CTRL_STATICTEXT_BODY, {Text=strText});
        end


        -- if an item's state changed (i.e. a package was turned on or off),
        -- update the 'Total space required:' message
        if(e_MsgID == MSGID_ONSTATECHANGED) then

        -- calculate the amount of space required for the installation
        _SpaceRequired = SetupData.CalculateRequiredSpace();

        -- set %SpaceRequired% to a string with an appropriate unit of measurement (e.g. "0 bytes")
        SessionVar.Set("%SpaceRequired%", String.GetFormattedSize(_SpaceRequired) );

        -- from _SUF70_Global_Functions.lua:
        -- update the 'Total space required:' message (expands any session variables in it)
        g_UpdateStaticTextCtrl(CTRL_STATICTEXT_SPACEREQUIR ED, "IDS_CTRL_STATICTEXT_SPACEREQUIRED");
        end
        end

        I was looking in the Action list to anything that resembled "enabled" button, but I could not find anything that resembled that.

        thanks,
        Cal

        Comment


        • #5
          You need to use
          Code:
          DlgButton.SetProperties(CTRL_BUTTON_NEXT, {Enabled=true});
          if you want to enable the button via Lua script.

          Ulrich

          Comment

          Working...
          X