Simple Tutorial - 5 : Choices

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Simple Tutorial - 5 : Choices

Post by esgici »

Simple tutorial based upon HMG Offical Tutorial for beginners.

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.

Code: Select all

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

Code: Select all

#include "minigui.ch"

Function Main

    DEFINE WINDOW Win_1 ;
        AT 0,0 ;
        WIDTH 400 ;
        HEIGHT 300 ;
        TITLE '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

    CENTER   WINDOW Win_1
    ACTIVATE WINDOW Win_1

Return
Image

Regards

esgici
Viva INTERNATIONAL HMG :D
Post Reply