Cuckoo Clock

HMG Samples and Enhancements

Moderator: Rathinagiri

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

Re: Cuckoo Clock

Post by esgici »

Hi Jayadev and Alex

Thanks to you too :)

Regards

--

Esgici
Attachments
LCDN.zip
(27.69 KiB) Downloaded 355 times
Viva INTERNATIONAL HMG :D
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Cuckoo Clock

Post by sudip »

Hello Esgici,

I like it :)
I like your programming style :)
I like your simple way of coding :) (I learned many things from it, eg., I never used Context Menu. Now plan to use it seeing your code)
I like CuckooClock :)
Regards.

Sudip
With best regards,
Sudip
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Cuckoo Clock

Post by mustafa »

Hola en especial al Maestro Esgici
Me he permitido incorporar cada 15 minutos un
Cuckoo a los 30 minutos dos Cuckoo a los 45 minutos tres
Cuckoo y a la hora cuatro Cuckoo hay que cambiar el idioma
Saludos

Hello especially to Master Esgici
I have 15 minutes each incorporating a
Cuckoo two to 30 minutes to 45 minutes Cuckoo.
three and four hours Cuckoo .
We need to change the language
Greetings

Mustafa
Attachments
Clock.zip
(96.64 KiB) Downloaded 345 times
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Cuckoo Clock

Post by esgici »

Thanks a lot my friend Mustafa :D

I'll try to make it multi language.

Regards

http://translate.google.com/translate wrote:Muchas gracias a mi amigo Mustafa: D
Voy a tratar de hacer múltiples idiomas.
Saludos
--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Cuckoo Clock

Post by esgici »

mustafa wrote: We need to change the language
esgici wrote: I'll try to make it multi language.
Added.

Saludos / Regards

--

Esgici
CuckoClock_Src.zip
Cucko Clock Sources
(38.39 KiB) Downloaded 324 times
Viva INTERNATIONAL HMG :D
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Cuckoo Clock

Post by mol »

Nice work Esgici!
I've missed previous version, but this looks great.

Once I found a way to use temporary fonts without installing it (it was on this forum, but, I don't remember authoe, sorry ;) ). I think, you can use it:

Code: Select all

#define FR_PRIVATE 0x10
#define FR_NOT_ENUM 0x20
DECLARE DLL_TYPE_INT AddFontResourceEx( DLL_TYPE_LPCTSTR lpszFileName, DLL_TYPE_DWORD fl, DLL_TYPE_LPVOID pdv) IN GDI32.DLL
function AddFont(cFontName)
local nRet := AddFontResourceEx( cFontName, FR_PRIVATE + FR_NOT_ENUM, 0 )
return NIL
I haven't test it, so you can try in free time.

More about it is on MS pages:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

I've tried to add font, works OK, but I don't know how to use it...
I've tried:

Code: Select all

frm.lbl.FontName := "LCDN"
but without effects...
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Cuckoo Clock

Post by esgici »

Thanks Marek :)

I can't found "temporary fonts" subject into our forum :(

May be you had seen in another place ?

If you find please inform me.

And, if you add your (and / or other ) language to context menu items in Cuckoo Clock also please inform me (only seven short string).

Regards

--

Esgici
Last edited by esgici on Wed Nov 09, 2011 12:28 pm, edited 1 time in total.
Viva INTERNATIONAL HMG :D
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Cuckoo Clock

Post by mol »

It was so simple... It should be name of font, not font filename

Code: Select all

frm.lbl.FontName := "LCDD"
Now, everything works OK :lol:


For ordering...
1. declare function if first lines of main module

Code: Select all

DECLARE DLL_TYPE_INT AddFontResourceEx( DLL_TYPE_LPCTSTR lpszFileName, DLL_TYPE_DWORD fl, DLL_TYPE_LPVOID pdv) IN GDI32.DLL
2. Add font temporarily to your application:

Code: Select all

AddFont('LCDN.TTF')
3. Set FontName property:

Code: Select all

 FOR nDigit := 1 TO 5
            cDigit := "lblClock" + LTRIM( STR( nDigit ) ) 
            nlblWidth := aLMetrcs[ 1, nDigit ] 
            IF nDigit < 5
               @ 5, nlblRow LABEL &cDigit HEIGHT 40 WIDTH nlblWidth FONT "LcdD" SIZE 25 CENTERALIGN  BACKCOLOR { 0, 0, 160 } FONTCOLOR WHITE  FONTNAME "LCDD"  // aColors[ nDigit ]
            ELSE
               @ 5, nlblRow LABEL &cDigit HEIGHT 40 WIDTH nlblWidth FONT "LcdD" SIZE 25 BACKCOLOR { 0, 0, 160 } FONTCOLOR WHITE FONTNAME "LCDD"
            ENDIF
            nlblRow += nlblWidth
         NEXT    
Now, youd don't need to install LCD font to your/your client system to display it on the screen.

You can also install fonts from your application, eg. at first use of app.:

Code: Select all

		if !File(GetWindowsFolder()+"\fonts\LCDN.TTF")
			FileCopy("LCDN.TTF", GetWindowsFolder()+"\fonts\LCDN.TTF")
			RegistryWrite( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\LCDD" , "LCDN.TTF"  )
		endif
Below, I put translation of context menu items:

Code: Select all

 aRVal :=  { "Kolor tła",;              // 1°
                     "Kolor zegara",;            // 2°
                     "Kolor daty",;             // 3°
                     "Dźwięk",;                  // 4°
                     "Sekundy",;                // 5°
                     "Ukryj",;                   // 6°
                     "Zakończ   ( Esc)"}   
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Cuckoo Clock

Post by mol »

You can also remove font:

Code: Select all

DECLARE DLL_TYPE_BOOL RemoveFontResourceEx ( DLL_TYPE_LPCTSTR lpFileName, DLL_TYPE_DWORD fl, DLL_TYPE_LPVOID pdv ) IN GDI32.DLL

 FUNCTION RemoveFont(cFontName)

   #define FR_PRIVATE 0x10
   #define FR_NOT_ENUM 0x20
   local nRet := RemoveFontResourceEx( cFontName,FR_PRIVATE+ FR_NOT_ENUM, 0)

   RETURN Nil

I've found authors of this code:
*-------------------------------------------------------------------------------*
*-- Codigo original Walter TAVERNA de San Francisco, Córdoba, Argentina. *
*-- Codigo Impresion Chelo Pcia. de Buenos Aires, Argentina. *
*-- Modificado y Adaptado Mustafa López de Alicante, Espańa 2010 *
*-------------------------------------------------------------------------------*
best regards, Marek
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Cuckoo Clock

Post by esgici »

mol wrote: I've found authors of this code:
Thanks Marek :)

Me too, I've found the thread and then in my machine :oops:

Thanks to our friend Mustafa :)

And thanks to you again.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply