Return-Values from DESIGN different to Screenlocations ?

Return-Values from DESIGN different to Screenlocations ?

Postby ukoenig » Mon Jun 14, 2010 11:56 am

I want to save the values of painted Control-locations in DESIGN-mode to a Array and show
a new Dialog-Preview with the Results.
I noticed that the saved values are different to the defined Screen-locations.
It is not much, but a difference. Maybe because of Title and Frame ?
To get the identically Dialog-Values I had to do it that way :
aMO[1][1] := "DIALOG "
aMO[1][2] := oDlg:nTop
aMO[1][3] := oDlg:nLeft
aMO[1][4] := oDlg:nWidth + 42
aMO[1][5] := oDlg:nHeight + 22
aMO[1][6] := " "
I changed DIALOG to WINDOW for a Test, with the same Result.

Is it possible, to save the identically Values after placing Controls to a new Location ?

Defined Control-Location :

@ 30, 600 Checkbox oChk1 Var lChk1 PIXEL DESIGN Of oDlg ;
PROMPT "Gradient Horizontal / Vertical" Size 220,22 FONT oFont
oChk1:bRclicked:={|| IIF( lChk1 = .T., lChk1 := .F., lChk1 := .T. ), oChk1:Refresh() }
@ 70,750 GET oGet1 Var nGet1 Of oDlg PIXEL DESIGN Size 70,25 FONT oFont
@ 110,750 GET oGet2 Var nGet2 Of oDlg PIXEL DESIGN Size 70,25 FONT oFont
@ 150,750 GET oGet3 Var nGet3 Of oDlg PIXEL DESIGN Size 70,25 FONT oFont
oGet3:bRclicked:={|| nGet3 := GET_INP(nGet3), oGet3:Refresh() }

The painted Locations ( Return-values ) saved to a Array with wrong Values :

aMO[3][1] := "DIRECTION "
aMO[3][2] := oChk1:nTop ( 24 )
aMO[3][3] := oChk1:nLeft ( 600 )
aMO[3][4] := oChk1:nWidth ( 216 )
aMO[3][5] := oChk1:nHeight ( 16 )
aMO[3][6] := IIF( lChk1 = .T., "HORIZONTAL", "VERTICAL" )

aMO[4][1] := "1. COLOR "
aMO[4][2] := oGet1:nTop ( 64 )
aMO[4][3] := oGet1:nLeft ( 744 )
aMO[4][4] := oGet1:nWidth ( 64 )
aMO[4][5] := oGet1:nHeight ( 24 )
aMO[4][6] := ALLTRIM(STR(nGet1))

aMO[5][1] := "2. COLOR "
aMO[5][2] := oGet2:nTop ( 104 )
aMO[5][3] := oGet2:nLeft ( 744 )
aMO[5][4] := oGet2:nWidth ( 64 )
aMO[5][5] := oGet2:nHeight ( 24 )
aMO[5][6] := ALLTRIM(STR(nGet2))

aMO[6][1] := "POSITION "
aMO[6][2] := oGet3:nTop ( 144 )
aMO[6][3] := oGet3:nLeft ( 744 )
aMO[6][4] := oGet3:nWidth ( 64 )
aMO[6][5] := oGet3:nHeight ( 24 )
aMO[6][6] := ALLTRIM(STR(nGet3))

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Fri Jun 18, 2010 9:10 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to save Control-Values identically to Screenlocations ?

Postby MdaSolution » Fri Jun 18, 2010 7:55 am

U can use Txtfile or INI FILe and save in this type

110=SAY|20|0.5|100|20|"test say"|oDlg|CLR_RED|CLR_BLACK|

JUST AN IDEA ....
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: How to save Control-Values identically to Screenlocations ?

Postby ukoenig » Fri Jun 18, 2010 8:57 am

Thanks for the response.

I changed the post-title for a better Specification of my Problem.

My problem :
some people asked for a quick solution of a Screenpainter in DESIGN-Mode to save testing-time,
because they want to use Dialogs from Source.
The Painter is nearly finished and I can place all needed Controls on any defined Background.
Next I can create a working PRG- and EXE-File.
My problem is not the saving-process itself ( the new Positions are saved inside the created PRG ),
I noticed different Return-Values after changing Control-Positions and Sizes.
All Controls are using ???:nTop, ???:nLeft, ???:nWidth and ???:nHeight.

I tested different Screen-resolutions and changed the Font with the same result .
Screen-Test with : 800 x 600, 1024 x 768 and 1280 x 720 and Font : Arial Size 12 and 16.

A Test at Start :

@ 360,600 SAY oSay1 Var cSay1 Of oDlg PIXEL DESIGN Size 100,25 FONT oFont
@ 395,600 SAY oSay2 Var cSay2 Of oDlg PIXEL DESIGN Size 100,25 FONT oFont

1. Say Shows :
MsgAlert( STR(oSay1:nTop()) + CRLF + ; // Returns 360
STR(oSay1:nleft()) + CRLF + ; // Returns 600
STR(oSay1:nWidth()) + CRLF + ; // Returns 96
STR(oSay1:nHeight()) ) // Returns 24

2. Say Shows :
MsgAlert( STR(oSay1:nTop()) + CRLF + ; // Returns 392
STR(oSay1:nleft()) + CRLF + ; // Returns 600
STR(oSay1:nWidth()) + CRLF + ; // Returns 96
STR(oSay1:nHeight()) ) // Returns 24


I couldn't detect, why the Values are not the same from inside a Preview.
A Design-Painter only makes sense with identically Return-values. Why I get different Values ?

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Return-Values from DESIGN different to Screenlocations ?

Postby mmercado » Sat Jun 19, 2010 1:13 am

Dear Uwe:

That is caused by the dots alignment to grid.

Try by changing the gridsize this way:

SetGridSize( 1, 1 )

Best regards.

Manuel Mercado Gómez.
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: Return-Values from DESIGN different to Screenlocations ?

Postby ukoenig » Sat Jun 19, 2010 10:25 pm

Dear Manuel,

Thank You very much for the Info.
There is a Control-adjustment to the Grid of the Basic-values on Dialog-INIT in DESIGN-mode.
After moving / resizing Controls inside the opend Dialog, the saved Values are OK.
As a Test I deleted DESIGN from the Say and got the Return-Values 360, 600, 100, 25 ( defined positions ).
Adding DESIGN, the Return-Values are 360, 600, 96, 24.

A quick Dialog-design
Moving / resizing Controls, the Preview shows the same Result :
You can define any Background and Fonts.
Returns a PRG- and a working EXE-file.

Image

( The IDE for Your SButtons is also ready for first Tests )

Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

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