Page 1 of 1

What do I change to include a lib in the build process ?

Posted: Thu Apr 14, 2011 5:33 pm
by concentra
Hi.
I made changes in almost all prgs in order to introduce NEW() methods in all controls in order to instanciate the corresponding QT object sooner.
This pusshed me to also made kind of big changes in the code in order to permit controls to have children.
In the way it was coded, we have a main "parent" that was the "main Window" and this window was the parent of everything else.
If a control is inside another control the container control should be the parent but it was the main Window.
And when this didn´t work the workaround was to set a "container" that, in fact, was the real parent...
Part of the problem was that I had to know the control parent without knowing it name.
And since all source is coded in WITH OBJECT nested structures I extracted the parent from the WITH OBJECT control stack.
One great problem was with tabs and tabpages. Tabpages inherited from tabs when they should inherit from control and tabpages have inner controls that must point to it as parents.
Changing this, letting controls have child controls, I eliminated the need of the weird oCurrentTab, oPriorTab, oCurrentPage, oPriorPage controlling stuff.
Another big one was SplitBox. It inherited from Window and should be from Control.
Also Statusbar.
I took 2 weeks changing the code and testing every sample in order to be sure of the compatibility with older code.
I am ready to up the changings but I need a function in a Harbour lib to be linked in.
The function is HB_QWith() and the lib XHB.LIB
But I do not know where do I set this...

Where should I change to include this lib in the building process ?

I made all the changes passing the lib as a parameter to BUILD.BAT...

Re: What do I change to include a lib in the build process ?

Posted: Thu Apr 14, 2011 8:48 pm
by mrduck
concentra wrote: Where should I change to include this lib in the building process ?
Good work !!!!

You should solve adding the line
libs=hbxhb.hbc
to hmg.hbc

Probably you need the full path, but first try without it

Re: What do I change to include a lib in the build process ?

Posted: Thu Apr 14, 2011 8:51 pm
by mrduck
Mauricio,
please have a look at Layout... layouts should be ALWAYS used in Qt programs... In a book I read on Qt, absolute positioning (x,y coordinates) was NEVER mentioned, only layout was used...

Re: What do I change to include a lib in the build process ?

Posted: Thu Apr 14, 2011 10:57 pm
by concentra
Hi.
mrduck wrote:Mauricio,
please have a look at Layout... layouts should be ALWAYS used in Qt programs... In a book I read on Qt, absolute positioning (x,y coordinates) was NEVER mentioned, only layout was used...
All the code I inspected uses absolute positioning. No mention on layouts...
I read something about this some time ago, and it is related to running the same application on multiple plataforms, and preserving the presentation layout. Not all but most of them.

Re: What do I change to include a lib in the build process ?

Posted: Fri Apr 15, 2011 1:57 am
by Rathinagiri
Fantastic work! Now, can you build the whole thing?

Re: What do I change to include a lib in the build process ?

Posted: Fri Apr 15, 2011 10:45 am
by concentra
Hi.
rathinagiri wrote:can you build the whole thing?
Sorry, I didn´t understand... What is "the whole thing" ? The lib ?

Re: What do I change to include a lib in the build process ?

Posted: Fri Apr 15, 2011 11:32 am
by l3whmg
Hi guys,
I think there is another simple way to manage parent and give inheritance: with one shared array.
Abstract: every object, which acts as a container, has a beginning and an end (eg: define window / end window, define tab / end tab, define page / end page).

I assume "aParentLevel" is the shared array.
With pseudo-code

Code: Select all

At startup aParentLevel := {} (my pov: there is hmgwindows super parent) 
define window MainForm --> AADD( aParentLevel, Self )

  define textbox --> its parent it's the last value in aParentLevel

    define tab --> AADD( aParentLevel, Self ) its parent it's the last value in aParentLevel

      define page1  --> AADD( aParentLevel, Self ) its parent it's the last value in aParentLevel

        define textbox --> its parent it's the last value in aParentLevel

      end page1 --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one

    define page2  --> AADD( aParentLevel, Self ) its parent it's the last value in aParentLevel

      define textbox --> its parent it's the last value in aParentLevel

    end page2 --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one

  end tab --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one

end window --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one
likewise, I could have this situation

At startup aParentLevel := {}

Code: Select all

define window MainForm --> AADD( aParentLevel, Self )

 define window SubForm1 --> AADD( aParentLevel, Self )

  define window SubForm2 --> AADD( aParentLevel, Self )

  end window --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one

 end window --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one

end window --> aParentLevel := ASIZE( aParentLevel, LEN( aParentLevel ) - 1 ) remove the last one
Cheers

Re: What do I change to include a lib in the build process ?

Posted: Fri Apr 15, 2011 12:36 pm
by Rathinagiri
concentra wrote:Hi.
rathinagiri wrote:can you build the whole thing?
Sorry, I didn´t understand... What is "the whole thing" ? The lib ?
Yes. Building the hmg library and successfully compiling all the samples with the required libraries.

Re: What do I change to include a lib in the build process ?

Posted: Fri Apr 15, 2011 1:21 pm
by concentra
Hi.
rathinagiri wrote:Yes. Building the hmg library and successfully compiling all the samples with the required libraries.
Yes, I did.
I commited the code, please take a look.