No announcement yet.

Set Default Button in Screen?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Set Default Button in Screen?

    If I create a Screen I notice that the Next button always seems to be the default. Is there a way to set the default button to something else, such as the Back button or Cancel button? I can't seem to find a way. Is this possible?

    Using SUF 9.


  • #2
    In preload, use Screen.SetFocus() to set the button to whatever you want.


    • #3
      Thanks for the tip. It does not appear to be reliable. In the OnNext logic I call Screen.SetFocus(CTRL_BUTTON_CANCEL). I see that the Cancel button is now selected. However when I press Enter the OnNext logic is still being fired. I have to press Enter twice to get the OnCancel logic to fire. Any idea what might be going on?


      • #4
        Nope -- but setting a default button in "OnNext" makes no sense.
        By the time OnNext is fired, the button has been clicked. set it on preload.
        If you're aborting "Screen.Next()" in OnNext, setfocus should work.


        • #5
          I have the Cancel button text set as "Continue". After I process the OnNext logic, I want the next Enter key to process the OnCancel logic (Continue). It seems to work but I need to press Enter twice. The strange thing is that the Cancel button *is* selected, but pressing Enter does not trigger the OnCancel logic - at least not the first time.


          • #6
            so when you press "next" you want it to do stuff and then continue? Just issue Screen.Next()
            if you want to show the user some result or something, have a results screen that shows it; don't beat yourself up by trying to make a screen do multiple things - the overhead isn't worth it.