Simple Tutorial - 8 : CheckButton

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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

Simple Tutorial - 8 : CheckButton

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

Simple tutorial based upon HMG Offical Tutorial for beginners.

CheckButton = Button + CheckBox

The CheckButton control, acts like a checkbox, but looks like a button. Like buttons, It comes in two flavors: Text and Graphical.

Code: Select all

@ 10,10 CHECKBUTTON CheckButton_1 ;
        CAPTION 'CheckButton' ;
        VALUE .F.

Code: Select all

@ 50,10 CHECKBUTTON CheckButton_2 ;
        PICTURE 'Open.Bmp' ;
        WIDTH 27 ;
        HEIGHT 27 ;
        VALUE .F. ;
        TOOLTIP 'Graphical CheckButton'

Code: Select all

#include "minigui.ch"

Function Main

    DEFINE WINDOW Win_1 ;
        AT 0,0 ;
        WIDTH 400 ;
        HEIGHT 200 ;
        TITLE 'CheckButton Test' ;
        MAIN

        DEFINE MAIN MENU
           POPUP "First Popup"
             ITEM 'Change Text CheckButton Value'      ACTION  ;
                  Win_1.CheckButton_1.Value := .T.
             ITEM 'Retrieve Text CheckButton Value'    ACTION  ;
                  MsgInfo ( if(Win_1.CheckButton_1.Value,'.T.','.F.'))
             SEPARATOR
             ITEM 'Change Picture CheckButton Value'   ACTION  ;
                  Win_1.CheckButton_2.Value := .T.
             ITEM 'Retrieve Picture CheckButton Value' ACTION  ;
                  MsgInfo ( if(Win_1.CheckButton_2.Value,'.T.','.F.'))
           END POPUP
        END MENU

            @ 10,10 CHECKBUTTON CheckButton_1 ;
                CAPTION 'CheckButton' ;
                VALUE .F.

            @ 50,10 CHECKBUTTON CheckButton_2 ;
                PICTURE 'Open.Bmp' ;
                WIDTH 27 ;
                HEIGHT 27 ;
                VALUE .F. ;
                TOOLTIP 'Graphical CheckButton'

    END WINDOW
   
    CENTER   WINDOW Win_1
    ACTIVATE WINDOW Win_1

Return
Image

Regards

esgici
Viva INTERNATIONAL HMG :D

Post Reply