FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Information on .RC Files
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Information on .RC Files
Posted: Tue Feb 24, 2009 08:06 PM
Antonio,

The positions of screen and size of the controls are where unit?

Why
CONTROL "&Ok", 102, "Button", WS_TABSTOP, 327, 217, 55, 18
and
@ 217,327 BUTTON "&Ok" SIZE 55,18 PIXEL

They generate different controls completely? Exists some resource that has adjusted the values of files .RC for values in pixels?

Code (fw): Select all Collapse
SAL120F DIALOG FIXED IMPURE 15, 21, 385, 259
STYLE WS_POPUP|WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "DIALOG_1"
FONT 8, "MS Sans Serif"
BEGIN
  CONTROL "", 101, "SysTabControl32", WS_TABSTOP, 1, 2, 324, 252
  CONTROL "&Ok", 102, "Button", WS_TABSTOP, 327, 217, 55, 18
  CONTROL "    &Cancela", 103, "Button", WS_TABSTOP, 327, 236, 55, 18
END
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Information on .RC Files
Posted: Tue Feb 24, 2009 11:23 PM

Antonio,

You understood? Some Idea?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 12:30 AM
Vilian,

Windows API uses "logical units" for dialogboxes, and "pixels" for windows, thats why you get that dimensions difference.

You can read about "logical units" here:
http://msdn.microsoft.com/en-us/library/ms645475(VS.85).aspx
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 03:17 AM
Antonio,

Thanks the information. I made thus:

Code (fw): Select all Collapse
 //CONTROL "&Ok", 102, "Button", WS_TABSTOP, 327, 217, 55, 18
 nLeft =  ( 217 * GetDialogBaseUnits()[ 1 ] ) / 4  
 nTop = ( 327 * GetDialogBaseUnits()[ 2 ] ) / 8  

@ nTop,nLeft  BUTTON "&Ok" SIZE 55,18 PIXEL


But it continues showing different of the definite one in the RC. What I am making made a mistake?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 08:05 AM

Try to size the controls during ON INIT event.

EMG

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 08:57 AM
Antonio,

Antonio Linares wrote:
Windows API uses "logical units" for dialogboxes, and "pixels" for windows, thats why you get that dimensions difference.


is the dialog itself also using "logical units" (when it is created with define dialog .. from .. to ..) or only the controls inside the dialog ?
kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 09:40 AM

Stefan,

> is the dialog itself also using "logical units"

Yes

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 12:00 PM

Enrico,

Already I made in ON INIT, but the problem persists.

I believe that the problem is in the conversion of the positions. The values generated in the calculation to follow are minors who the values of .RC file.

nLeft = ( 217 * GetDialogBaseUnits()[ 1 ] ) / 4
nTop = ( 327 * GetDialogBaseUnits()[ 2 ] ) / 8

GetDialogBaseUnits() is returning 2 in the two positions. The equation is this same?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 12:22 PM

Vilian,

> I believe that the problem is in the conversion of the positions

We have never been able to find the right conversion :(

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 12:57 PM

Antonio,

When you see a dialog with resources is not done this conversion?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 02:06 PM

Vilian,

We let Windows to do it automatically.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 06:22 PM

Antonio,

How to ask Windows to display a dialogbox resource with all its controls?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Information on .RC Files
Posted: Wed Feb 25, 2009 08:12 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Information on .RC Files
Posted: Thu Feb 26, 2009 08:39 AM
Antonio,

Antonio Linares wrote:Stefan,
> is the dialog itself also using "logical units"
Yes


Thanks for the info, that explains some curious results I got in the past
kind regards

Stefan

Continue the discussion