Making a Choice

HMG Tutor 6

Making a Choice

Sometimes, you need to get a choice from users, between a small group of options that are known at design time.

The best way to go is such cases is the RadioGroup control.

@ 80, 120 RADIOGROUP Radio_1 OPTIONS {'Option 1','Option 2','Option 3'}

#include "hmg.ch"
Function Main
DEFINE WINDOW Win_1 ;
   AT 0,0 ;
   WIDTH 400 ;
   HEIGHT 200 ;
   TITLE 'Tutor 06 - RadioGroup Test' ;
   MAIN
   DEFINE MAIN MENU
     POPUP "First Popup"
        ITEM 'Change RadioGroup Value' ACTION ;
              Win_1.Radio_1.Value := 2
        ITEM 'Retrieve RadioGroup Value' ACTION ;
              MsgInfo ( Str(Win_1.Radio_1.Value))
     END POPUP
   END MENU
   @ 80, 120 RADIOGROUP Radio_1 OPTIONS {'Option 1','Option 2','Option 3'}
END WINDOW
ACTIVATE WINDOW Win_1
Return

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.