Simple Tutorial - 4: Getting Logical

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4264
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 144 times
Been thanked: 54 times
Contact:

Simple Tutorial - 4: Getting Logical

Post by esgici » Fri Aug 01, 2008 1:04 am

Simple tutorial based upon HMG Offical Tutorial for beginners.

Getting Logical

Sometimes, you need to get logical data from the user. The easiest way to do that, is using a checkbox control.

Code: Select all

@ 180, 120 CHECKBOX Check_1
We add it to the program, along with new menu options to set or retrieve its value

Code: Select all

#include "minigui.ch"

Function Main

    DEFINE WINDOW Win_1 ;
        AT 0,0 ;
        WIDTH 400 ;
        HEIGHT 300 ;
        TITLE 'CheckBox Test' ;
        MAIN

        DEFINE MAIN MENU
           POPUP "First Popup"
             ITEM 'Change CheckBox Value'   ACTION  ;
                  Win_1.Check_1.Value := .T.
             ITEM 'Retrieve CheckBox Value' ACTION  ;
                  MsgInfo ( if(Win_1.Check_1.Value,'.T.','.F.'))
           END POPUP
        END MENU

        @ 100, 120 CHECKBOX Check_1 CAPTION 'Check Me!'

    END WINDOW

    CENTER   WINDOW Win_1
    ACTIVATE WINDOW Win_1

Return
Image

Regards

esgici
Viva INTERNATIONAL HMG :D

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests