Coordinate di una Dialog

Moderator: Enrico Maria Giordano

Coordinate di una Dialog

Postby Romeo » Thu Jun 04, 2009 9:02 am

Salve,
avrei bisogno di sapere le coordinate di una dialog quando si clicca sul tasto <FINE>.

Sembra banale ma l'esempietto stupido che vi mando non funziona.

Lancio il programma, muovo la finestra e in chiusura mi faccio dire le coordinate (nLeft,nTop) ma mi risponde sempre quelle iniziali !?

Grazie a tutti

Romeo


** esempio

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

local oDlg

DEFINE DIALOG oDlg FROM 10,15 TO 200,300 TITLE "Test coordinate" pixel


@50,30 BUTTON oBtn PROMPT "&Coordinate" OF oDlg action ;
(msginfo(str(oDlg:nleft)+" "+str(oDlg:ntop))) pixel

ACTIVATE DIALOG oDlg

return nil
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Coordinate di una Dialog

Postby pymsoft » Thu Jun 04, 2009 10:14 am

Romeo,


@50,30 BUTTON oBtn PROMPT "&Coordinate" OF oDlg action ;
(oDlg:CoorsUpdate(), msginfo(str(oDlg:nleft)+" "+str(oDlg:ntop))) pixel
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Re: Coordinate di una Dialog

Postby Romeo » Thu Jun 04, 2009 11:36 am

Funziona bene con l'esempietto, ma se lo calo all'interno del mio programma, un po piu' complesso, mi da spesso numeri negativi del tipo odlg:nleft = -31, cosa vuol dire ?

Bye
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Coordinate di una Dialog

Postby pymsoft » Fri Jun 05, 2009 9:20 am

Romeo,

Vuol dire che questi valori fanno riferimento alla finestra dove si "appoggia" il tuo dialog.

define dialog oDlg .... OF oWnd

un nLeft negativo, vuol dire che si trova piu a sinistra della finestra madre.


Ciao.
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Re: Coordinate di una Dialog

Postby Romeo » Fri Jun 05, 2009 1:41 pm

oooops !!!
Provo a ricsvare quelle corrette !
Grazie 10000

Romeo
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Coordinate di una Dialog

Postby Romeo » Fri Jun 05, 2009 2:17 pm

Sai che non riesco a ricavare la posizione ?
C'e' una regola o formula ?

ROmeo
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Coordinate di una Dialog

Postby pymsoft » Fri Jun 05, 2009 2:56 pm

Romeo,

penso che ti servono le coordinate para salvare la dimensione del dialogo e la posizione


nel aiuto di FW c'e scritto questo:

    Function:

    The Move() method will move the current window to a new position and change its size. If the window is a top level window, the coordinates are relative to the top left of the screen. If the window is a child window the coordinates ar relative to the top left corner of the parent window.

    Note:

    If <nRight> is 0 (ie zero), the current width and height of the window are used.


magari e questo il tuo problema.
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia


Return to All products support

Who is online

Users browsing this forum: No registered users and 5 guests