Information on .RC Files

Information on .RC Files

Postby vilian » Tue Feb 24, 2009 8: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: Select all  Expand view

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
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Information on .RC Files

Postby vilian » Tue Feb 24, 2009 11:23 pm

Antonio,

You understood? Some Idea?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Information on .RC Files

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Information on .RC Files

Postby vilian » Wed Feb 25, 2009 3:17 am

Antonio,

Thanks the information. I made thus:

Code: Select all  Expand view

 //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
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Information on .RC Files

Postby Enrico Maria Giordano » Wed Feb 25, 2009 8:05 am

Try to size the controls during ON INIT event.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Information on .RC Files

Postby StefanHaupt » Wed Feb 25, 2009 8: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Information on .RC Files

Postby Antonio Linares » Wed Feb 25, 2009 9:40 am

Stefan,

> is the dialog itself also using "logical units"

Yes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Information on .RC Files

Postby vilian » 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
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Information on .RC Files

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Information on .RC Files

Postby vilian » 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
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Information on .RC Files

Postby Antonio Linares » Wed Feb 25, 2009 2:06 pm

Vilian,

We let Windows to do it automatically.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Information on .RC Files

Postby vilian » Wed Feb 25, 2009 6: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
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Information on .RC Files

Postby Antonio Linares » Wed Feb 25, 2009 8:12 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Information on .RC Files

Postby StefanHaupt » Thu Feb 26, 2009 8: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests