HMG 4 Started

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG 4 Started

Post by Rathinagiri »

Great words from a simple man.

Bravo Roberto.
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: HMG 4 Started

Post by esgici »

Roberto Lopez wrote: I've got you access as developer.
Thanks :D

I fully agree your opinions on OOP and especially on dynamism.

Moreover, believe or not, your very short history is almost identical with mine. I remember, "does is possible a computer program without GOTO, if so how)"; how long I struggled under this question :(

Only exception was: I couldn't possibilities to be transferred Windows programming until found your wonderful work :D This is a very very long leeway, from 1980s to 2000s :cry:

So I'm very glad and very happy by being acquainted with you.

So, I'm and I'll together with you, as soon as I can. Stand by your side, at least as a follower.

With my best regards.

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
Roberto Lopez
HMG Founder
Posts: 4012
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

mol wrote:Code changing colors should look like:

Code: Select all

if ValType(::aFontColor) == 'U'
		xForeColor := '#000000;'
	else
		xForeColor := '#'+NtoC(aFontColor[1],16,2)+NtoC(aFontColor[2],16,2)+NtoC(aFontColor[3],16,2)+';'
	endif
	cStyleSheet += 'color:'+xForeColor + ';'
	if ValType(::aBackColor) == 'A'
		cStyleSheet += 'background-color:#'+NtoC(aBackColor[1],16,2)+NtoC(aBackColor[2],16,2)+NtoC(aBackColor[3],16,2)+';'
	endif
	
	if !empty(cStyleSheet)
		::oQTObject:setStyleSheet(cStyleSheet)
	endif
Excepting for NtoC, it is working nicely.

I have only one objection: If the user do not specify a color, we should leave to QT to use the default colors for the control.

So, if a color == NIl we should do nothing for it.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HMG 4 Started

Post by sudip »

Did some housekeeping in Create() method of Spinner. Thank you Roberto. I learned it form Editbox control.

I couldn't find corresponding signals for OnGotFocus and OnLostFocus events. May be they are in disguise of another names ;)

There are FocusIn and FocusOut Qt events, but not signals. There are some examples how to use them, but I don't know how to implement these ideas with HBQT, because they are written with C++.
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG 4 Started

Post by Rathinagiri »

I think ongotfocus and onlostfocus are implemented by Roberto. We have to connect using installevents as in Editbox, I think.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4012
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

esgici wrote: So I'm very glad and very happy by being acquainted with you.

So, I'm and I'll together with you, as soon as I can. Stand by your side, at least as a follower.
i have fever, I can't go out my home and my brain is not in good shape to do programming right now... so I'll encourage you a little more :)

To build a car, you need a diagram.

Even you can build billions of cars using the same diagram, all the cars are different. They could have different color, different upholstered seats, etc.

The 'diagram' in OOP speaking is a 'class' and each individual car is an 'object'.

So in the code:

oButton1 := Button():New()

oButton1 is an object variable containing a button (a car).

If I want to change the button color, I should do:

oButton1:FontColor := 'New Color'

The really important thing here is that you are changing the color of a individual button contained in the oButton1 variable (not all buttons created with the button class).

So, you could read or write any class internal variable without need to make that variable public, via the send operator (:).

ie:

oButton1:xVar

This eliminate all the mess created by public and private variables.

To be continued...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4012
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

rathinagiri wrote:I think ongotfocus and onlostfocus are implemented by Roberto. We have to connect using installevents as in Editbox, I think.
Yes. I've already put in control class and are working for editbox.

You only need to connect them to your control as shown in the create method.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4012
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

sudip wrote:Did some housekeeping in Create() method of Spinner. Thank you Roberto. I learned it form Editbox control.

I couldn't find corresponding signals for OnGotFocus and OnLostFocus events. May be they are in disguise of another names ;)

There are FocusIn and FocusOut Qt events, but not signals. There are some examples how to use them, but I don't know how to implement these ideas with HBQT, because they are written with C++.
Some things works via slots and other via events.

Take a look at OnGotFocus & OnLostFocus in control class and EditBox's create method.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 4 Started

Post by mol »

Roberto Lopez wrote:Excepting for NtoC, it is working nicely.

I have only one objection: If the user do not specify a color, we should leave to QT to use the default colors for the control.

So, if a color == NIl we should do nothing for it.
Of course, I've set it for testing only.

NtoC was copied from harbour distribution. I can work on another conversion method. What do you think?
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HMG 4 Started

Post by sudip »

Roberto Lopez wrote:...
Take a look at OnGotFocus & OnLostFocus in control class and EditBox's create method.
Thanks a lot. I missed it. Now works fine.
With best regards,
Sudip
Post Reply