HMG 4 Started

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

mol wrote:
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?
I'll try to find a way for that hbmk2 pick it from its library... I'll keep you posted.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
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
but, while compiling, I get an error about not found function NTOC
I need simple conversion from numbers to hex to paste color in #RRGGBB format.
You must add -lhbct to your HBMK2 line in build.bat

HBMK2 %1 -Lc:\HMG.4\qt\lib -lhbct
Regards/Saludos,

Roberto


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

Re: HMG 4 Started

Post by Roberto Lopez »

Roberto Lopez wrote: You must add -lhbct to your HBMK2 line in build.bat

HBMK2 %1 -Lc:\HMG.4\qt\lib -lhbct
The library is correctly linked, but apparently there is a problem with your code.

I've got working typing the color directly (ie: #00ff00 for green).

Appears to be that the color string is not correctly built.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
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: ... so I'll encourage you a little more :)
Thanks a lot :)

Now I understand better object - class relationship.
Roberto Lopez wrote: To be continued...
I'll wait eagerly.

Best regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HMG 4 Started

Post by sudip »

Hello Esgici,

I am also learning with you :)

Thank you and Roberto :)
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

esgici wrote: I'll wait eagerly.
Well...

oButton := Button:Create()

'Create' in OOP slang is a 'method' but, just between us, you can think about it just like a function (or procedure).

The advantage of a method is that it is 'inside' a class, so...

Button:Create()

is different that

TextBox:Create()

You are invoking methods (procedures) called the same but they are different ones, coded in different classes.

One of the big things about OOP is inheritance.

All control classes are defined to 'inherit' from control class.

This is written as follows (ie: button class):

CLASS BUTTON FROM CONTROL

Meaning that button control can use properties event and methods defined in control class.

So, you must code (ie) Row property once and it is automatically available for all other controls.

You must write new code only for controls that need a special treatment for the same property, event or method.

Really nice... :)

As I've said, it looks hard at the beginning, but it can be extremely useful when you are handling a complex situation...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
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: HMG 4 Started

Post by Rathinagiri »

Yes, Roberto.

It is only a starting trouble. :)

Now, shall I start working on another control or the missing common properties of checkbox?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 4 Started

Post by Roberto Lopez »

rathinagiri wrote:Yes, Roberto.

It is only a starting trouble. :)

Now, shall I start working on another control or the missing common properties of checkbox?
IMHO, the best way to go is that we finish 'our' controls before to start working in another one, but coordinating the work to not overlap us in the case of shared properties (located at Control class).
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
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: HMG 4 Started

Post by Rathinagiri »

Yes. So, shall I co-ordinate with the shared properties?

I think color is taken by Marek. The only property unattended in checkbox which is common is transparent. Shall I take that one and try on?
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: Really nice... :)
As I've said, it looks hard at the beginning, but it can be extremely useful when you are handling a complex situation...
Thanks, please continue :D

Best regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply