Page 1 of 1

Simple Tutorial - 9 : Getting Dates

Posted: Fri Aug 01, 2008 1:27 am
by esgici
Simple tutorial based upon HMG Offical Tutorial for beginners.

Getting Dates (The DATEPICKER Control)


The easiest way to get dates from user is the DATEPICKER control.

Code: Select all

@ 10,10 DATEPICKER Date_1

Code: Select all

#include <minigui.ch>

Function Main

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

        DEFINE MAIN MENU
           POPUP "First Popup"
             ITEM 'Change DatePicker Value'   ACTION ;
                  Win_1.date_1.Value := Date()
             ITEM 'Retrieve DatePicker Value' ACTION ;
                  MsgInfo ( dtoc(Win_1.Date_1.Value))
           END POPUP
        END MENU

        @ 10,10 DATEPICKER Date_1

    END WINDOW

    CENTER   WINDOW Win_1
    ACTIVATE WINDOW Win_1

Return

Image


DatePicker is very handy, clever and useful control. For it's details look by buildig and running C:\hmg\SAMPLES\DATEPICKER\Demo.prg.

Regards

esgici

Re: Simple Tutorial - 9 : Getting Dates

Posted: Fri Aug 01, 2008 3:52 am
by Rathinagiri
And we are having textbox with date. That is really a simple control I use a lot. That is because in the case of textbox-date you don't need to press tab or go for mouse within the control to advance to year/month/day. Just start typing and the cursor advances itself and saves a key stroke. ;)

Re: Simple Tutorial - 9 : Getting Dates

Posted: Fri Aug 01, 2008 11:13 am
by esgici
rathinagiri wrote:And we are having textbox with date. That is really a simple control I use a lot. That is because in the case of textbox-date you don't need to press tab or go for mouse within the control to advance to year/month/day. Just start typing and the cursor advances itself and saves a key stroke. ;)
Yes, you are right.

TIA

esgici