A funny sample

HMG Samples and Enhancements

Moderator: Rathinagiri

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

A funny sample

Post by esgici »

Hi All

I'm not sure, this is funny or not, useful or not; only a little experiment on HMG power.

"Warn Lazy User" is a function (procedure) and is embedded in famous HMG sample Main.Demo.

Why Main Demo? Because I like much this sample, in my opinion this is "father" of all HMG sample; almost everything included in and as possible as simple and intuitive way :D

"Warn Lazy User" have some missing points; but surely may complete in the future.

Enjoy !

Regards, saludos

--

Esgici
Attachments
WarnLUser.rar
Warn lazy user
(30.3 KiB) Downloaded 650 times
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: A funny sample

Post by Rathinagiri »

Very interesting. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: A funny sample

Post by esgici »

Hi All

Please change line 1276 from

Code: Select all

   Form_1.Label_3.Value := SECTOTIME( nElapTime ) 
to

Code: Select all

   Form_1.Label_3.Value := SECTOTIME( nWaitIddleInterval - nElapTime ) 
Regards, saludos

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: A funny sample

Post by Rathinagiri »

Also add in Line 724

Code: Select all

    if valtype(color[1]) == "U" .or. valtype(color[2]) == "U" .or. valtype(color[3]) == "U"
       return nil
    endif  
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: A funny sample

Post by Rathinagiri »

It is really a proud that, HMG can do all these things. :)

Just 1306 (most of them are empty lines) lines and a FULL FLEDGED DEMO. HMG is just great man.

Unfortunately Misc->ShellAbout() function gives run time error. :(
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: A funny sample

Post by esgici »

Hi Rathi
Rathi wrote:Also add in Line 724
My suggestion for GetColor_Click() :

Code: Select all

PROC GetColor_Click()
*-----------------------------------------------------------------------------*
LOCAL aColor := GetColor()
    
    IF HB_ISNIL( aColor[ 1 ] )  // It's impossible any element is not-nil when one is nil
       MsgInfo( "Escaped")
    ELSE
       MsgInfo( Str(aColor[1]) , "Red Value")   
       MsgInfo( Str(aColor[2]) , "Green Value") 
       MsgInfo( Str(aColor[3]) , "Blue Value")  
    ENDIF   

RETU // GetColor_Click()

*-----------------------------------------------------------------------------* 
Rathi wrote:Unfortunately Misc->ShellAbout() function gives run time error.
My suggestion for ShelAbout() is :

Code: Select all

                
ITEM 'ShellAbout() Function (Contributed by Manu Exposito' ACTION  ;
         ShellAbout( "About Main Demo" + "#" + ;
                     "HMG Main Demo", ;
                     "GUI Library For Harbour" + CRLF + ;
                     "HMG Power Ready!" ) 
IMHO this is a little older function and something been changed out of HMG ;)

By the way, I have slightly modified SetPict() procedure too; did you noticed ?
Rathi wrote:It is really a proud that, HMG can do all these things.

Just 1306 (most of them are empty lines) lines and a FULL FLEDGED DEMO. HMG is just great man.
You are absolutely right; this causing why I like very much this sample :D and HMG of course :!:

Viva HMG, viva Roberto Lopez !

Regards, saludos

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: A funny sample

Post by Czarny_Pijar »

Unwanted miracles happen ...
In order not to wait too long, please make these changes

Code: Select all

#define nWaitIddleInterval 2  // In seconds,  2= Accelerating. Line 10
*      PLAY WAVE 'Alarm.WAV'    // Mute not to go crazy. Line 1280
and see what happens.
In my case, the application crawls off the screen!
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: A funny sample

Post by esgici »

Czarny_Pijar wrote: In my case, the application crawls off the screen!
For a purpose like "crawling off the screen" may find countless methods :)

Why 2, instead of zero ?

I'm glad by giving you an miraculous toy :mrgreen:

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: A funny sample

Post by Czarny_Pijar »

Symptoms are funny, but the problem is serious.

Looking at the program, I see the intention : The frame should be shaking in one place.
Certainly should not crawl off somewhere, but it does.

This unwanted(?) behavior can be easily removed:

Code: Select all

*-----------------------------------------------------------------------------*
PROC Vibrate()        
*-----------------------------------------------------------------------------*

   LOCA nElapTime := SECONDS() - nLastActTime,;
        nWinRow   := Form_1.Row ,;
        nWinCol   := Form_1.Col        
   
   Form_1.Label_3.Value := SECTOTIME( nWaitIddleInterval - nElapTime ) 
   
   IF nElapTime > nWaitIddleInterval 
   
      PLAY WAVE 'Alarm.WAV' 
             
      FOR y := 1 TO 5
               
         FOR x := 1 TO 3
            Form_1.Row := nWinRow - x 
            Form_1.Col := nWinCol - x   
         NEXT x 
         
         FOR x := 1 TO 3
            Form_1.Row := nWinRow + x * 2
            Form_1.Col := nWinCol + x * 2
         NEXT x 
         
         FOR x := 1 TO 3
            Form_1.Row := nWinRow - x 
            Form_1.Col := nWinCol - x   
         NEXT x 
         
       NEXT y
       
       Form_1.Row := nWinRow            //------------ added
       Form_1.Col := nWinCol            //------------ added
       ResetWarnTime()
   ENDIF
   
RETU
   
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: A funny sample

Post by esgici »

Thanks to your interest and attention :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply