Page 10 of 16
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 12:55 pm
by Rathinagiri
Great words from a simple man.
Bravo Roberto.
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 12:58 pm
by esgici
Roberto Lopez wrote:
I've got you access as developer.
Thanks
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

This is a very very long leeway, from 1980s to 2000s
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
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:06 pm
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.
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:10 pm
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++.
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:21 pm
by Rathinagiri
I think ongotfocus and onlostfocus are implemented by Roberto. We have to connect using installevents as in Editbox, I think.
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:28 pm
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...
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:31 pm
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.
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:33 pm
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.
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:36 pm
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?
Re: HMG 4 Started
Posted: Tue Aug 17, 2010 1:47 pm
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.