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

Moderator: Rathinagiri

Post Reply
User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

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

Post by concentra » Thu Apr 14, 2011 5:33 pm

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...
[[]] Mauricio Ventura Faria

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Thu Apr 14, 2011 8:48 pm

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

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Thu Apr 14, 2011 8:51 pm

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...

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Thu Apr 14, 2011 10:57 pm

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.
[[]] Mauricio Ventura Faria

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Fri Apr 15, 2011 1:57 am

Fantastic work! Now, can you build the whole thing?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Fri Apr 15, 2011 10:45 am

Hi.
rathinagiri wrote:can you build the whole thing?
Sorry, I didn´t understand... What is "the whole thing" ? The lib ?
[[]] Mauricio Ventura Faria

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Post by l3whmg » Fri Apr 15, 2011 11:32 am

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
Luigi from Italy
www.L3W.it

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Fri Apr 15, 2011 12:36 pm

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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Post by concentra » Fri Apr 15, 2011 1:21 pm

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.
[[]] Mauricio Ventura Faria

Post Reply