Welcome to the Project Developers' Table

Moderator: Rathinagiri

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: Welcome to the Project Developers' Table

Post by Rathinagiri »

I had found this code from a site. Does this help?

Code: Select all

QFont myFont;
QString str("I wonder how wide this is?");

QFontMetrics fm(myFont);
int width=fm.width(str);

East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Welcome to the Project Developers' Table

Post by mol »

rathinagiri wrote:I had found this code from a site. Does this help?

Code: Select all

QFont myFont;
QString str("I wonder how wide this is?");

QFontMetrics fm(myFont);
int width=fm.width(str);

Sorry, I don't know how to implement it in harbour :(

after 5 min.:
I've coded:

Code: Select all

				qfm	:= QFontMetrics(::oQTObject:Font())
				nWidth := qfm:width(::cValue)
but nWidth always become NIL

I'm very tired today :(
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: Welcome to the Project Developers' Table

Post by Rathinagiri »

I think you can use like this...

Code: Select all

#include "..\..\include\hmg.ch"
Set Procedure To ..\..\source\hmg

Function Main
local oFont := QFont():New()
local oFM := QFontMetrics():New(oFont)
local nWidth := 0

nWidth := oFM:width('What would be the Width?')
msginfo(str(nWidth))
return nil
Believe me, it works.
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: Welcome to the Project Developers' Table

Post by Roberto Lopez »

esgici wrote:
Roberto Lopez wrote:Hi Team,

I've found a way to automatically create a Changelog file (using another svn client).

I've found the way to include the changes files list in the changelog generated, so is no required anymore that you manually paste such list in your commit.
Very good news, thanks :)

We also have a way for notify forum members about changes (like Harbour).

May be a single post to forum.

Only a thought.

Best Regards

--

Esgici

Theoretically could be possible to instruct SVN to send a notification mail when a change is made, but It is apparently not working.

I'll keep trying...
Regards/Saludos,

Roberto


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

Re: Welcome to the Project Developers' Table

Post by Roberto Lopez »

dhaine_adp wrote:Hi Roberto,

I'll be implementing GRID from QAbstractItemView to support the images in header for GRID control. I'll reuse the existing Q...View if necessary but for the time being I'll start from this point. I'll post the code in three days perhaps not a complete work but a working sample.
Good news!
dhaine_adp wrote: As I pondering about the implementation, I was planning to extend the GRID to support something like this:

MASTER->CODE, ITEM->DESCRIPTION, ITEM->UNIT and freeze the column 1 & 2. It seems it is possible with QAbstractItemView.

Anyway I will not talk much about it until I get the code up and running. I'm sticking to our goal, to provide the backward compatibility. If what I have said can be included in few lines of code I'll do it otherwise I'll put it in TODO List.

It's just now that I'd be able to run a test file on this so I am still in the experimental stage. I hope that I can post the code as soon as possible. It seems I'm the only one whose less productive. LOL!

Regards,

Danny
Ok.

My advise for you is that our first goal still being to provide backwards compatibility with HMG. If you can to add extensions without conflict with that goal, there is no problem from my part.

Grid is not an easy task, thanks for your efforts.
Regards/Saludos,

Roberto


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

Re: Welcome to the Project Developers' Table

Post by Roberto Lopez »

rathinagiri wrote:Regarding 'enabled' property, it was not mentioned in hmg.ch, however it was already implemented in control.prg. So, shall we include in hmg.ch and all controls?
I've coded enabled property in control class, so, it is already supported for all controls.

There is no need to add special code for it in hmg.ch to support that: it is already working.

This apply to a lot of properties already coded in control class.

ie: I've moved FontColor and BackColor (created by Marek) to control class and they are inherited for all controls.

This is because that controls inherits from QWidget and most of things that we are doing works for QWidget, so they works for all controls.

So, even in this early stage of development, HMG.4 supersedes HMG.3 in a lots of aspects for the controls we are working on (ie: backcolor and fontcolor for buttons).
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: Welcome to the Project Developers' Table

Post by Rathinagiri »

Thanks for the info Roberto. :)
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: Welcome to the Project Developers' Table

Post by Roberto Lopez »

Roberto Lopez wrote:
rathinagiri wrote:Regarding 'enabled' property, it was not mentioned in hmg.ch, however it was already implemented in control.prg. So, shall we include in hmg.ch and all controls?
I've coded enabled property in control class, so, it is already supported for all controls.
<...>

So, even in this early stage of development, HMG.4 supersedes HMG.3 in a lots of aspects for the controls we are working on (ie: backcolor and fontcolor for buttons).
This should be tested, but properties, events and methods like the following should work for all (or most) of the controls we coded:

- BackColor
- FontColor
- DisabledBackColor
- DisabledFontColor
- Enabled
- Show
- Hide
- OnLostFocus
- OnGotFocus
- etc...

To assure that the properties and events works from the control creation, please, do not forget to do the correct work in Create() method, ie:

Code: Select all

	if ValType (::bOnGotFocus)		!= 'U'	; Self:OnGotFocus	:= ::bOnGotFocus	; endif
	if ValType (::bOnLostFocus)		!= 'U'	; Self:OnLostFocus	:= ::bOnLostFocus	; endif
	if ValType (::aBackColor)		!= 'U'	; Self:backColor	:= ::aBackColor		; endif
	if ValType (::aFontColor)		!= 'U'	; Self:FontColor	:= ::aFontColor		; endif
	if ValType (::aDisabledFontColor)	!= 'U'	; Self:DisabledFontColor:= ::aDisabledFontColor	; endif
	if ValType (::aDisabledBackColor)	!= 'U'	; Self:DisabledbackColor:= ::aDisabledBackColor	; endif
	if ValType (::lVisible)			!= 'U'	; Self:Visible		:= ::lVisible		; else	; ::oQTObject:show()	; endif
Please, take a look at the Create() method of the controls I'm working on (EditBox and Button).
Regards/Saludos,

Roberto


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

Re: Welcome to the Project Developers' Table

Post by Roberto Lopez »

Roberto Lopez wrote:There is no need to add special code for it in hmg.ch to support that: it is already working.
The only exception to this, is the case in that we want that new properties can be changed at control creation, so, it could be done, since being optional clauses or properties this will not affect backwards compatibility.
Regards/Saludos,

Roberto


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

Re: Welcome to the Project Developers' Table

Post by mol »

rathinagiri wrote:I think you can use like this...

Code: Select all

#include "..\..\include\hmg.ch"
Set Procedure To ..\..\source\hmg

Function Main
local oFont := QFont():New()
local oFM := QFontMetrics():New(oFont)
local nWidth := 0

nWidth := oFM:width('What would be the Width?')
msginfo(str(nWidth))
return nil
Believe me, it works.
Yes! it works!
Many thanks Rathi!

Please tell me, where can I find some samples of QT...
Marek

After an hour:
I think, LABEL is finished. AUTOSIZE already works OK. I don't know if its optimized, but work! I'll think about it yet.

I've added to hmg.ch three definitions:
LBL_TOP
LBL_VCENTER
LBL_BOTTOM
Last edited by mol on Thu Aug 19, 2010 6:11 pm, edited 1 time in total.
Post Reply