FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour coordenadas de ventanas (SDI, MDI)
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
coordenadas de ventanas (SDI, MDI)
Posted: Fri Aug 29, 2008 05:18 AM
Amigos,

podr铆an verificar si las coordenadas de las ventanas (anexo ejemplo) se actualizan al mover dicha ventana?

he revisado lo que he podido y nada, al mover la ventana no actualiza las coordenadas, lo cual deber铆a actualizar.

FUNCTION main()
   LOCAL owin, omenu

   MENU omenu
     MENUITEM "Child" ACTION childwin( owin )
   ENDMENU

   DEFINE WINDOW owin MENU omenu MDI
      owin:cTitle( "Izquierda: "+ AllTrim(Str(owin:nLeft)) +"  Derecha: "+ AllTrim(Str(owin:nRight)))
      owin:bMoved := {|| owin:cTitle( "Izquierda: "+ AllTrim(Str(owin:nLeft)) +"  Derecha: "+ AllTrim(Str(owin:nRight)))}
   ACTIVATE WINDOW owin

   RETURN NIL

FUNCTION childwin( oWnd )
   LOCAL ochild

   DEFINE WINDOW ochild MDICHILD OF oWnd
      ochild:cTitle( "Izquierda: "+ AllTrim(Str(ochild:nLeft)) +"  Derecha: "+ AllTrim(Str(ochild:nRight)))
      ochild:bMoved := {|| ochild:cTitle( "Izquierda: "+ AllTrim(Str(ochild:nLeft)) +"  Derecha: "+ AllTrim(Str(ochild:nRight)))}
   ACTIVATE WINDOW ochild

   RETURN NIL


Gracias por anticipadas
William, Morales

Saludos



m茅xico.sureste
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
coordenadas de ventanas (SDI, MDI)
Posted: Fri Aug 29, 2008 07:12 AM
William,

#include "FiveWin.ch"

FUNCTION main() 
   LOCAL owin, omenu 

   MENU omenu 
     MENUITEM "Child" ACTION childwin( owin ) 
   ENDMENU 

   DEFINE WINDOW owin MENU omenu MDI 
      owin:cTitle( "Izquierda: "+ AllTrim(Str(owin:nLeft)) +"  Derecha: "+ AllTrim(Str(owin:nRight))) 
      owin:bMoved := {|| oWin:CoorsUpdate(), owin:cTitle( "Izquierda: "+ AllTrim(Str(owin:nLeft)) +"  Derecha: "+ AllTrim(Str(owin:nRight)))} 
   ACTIVATE WINDOW owin 

   RETURN NIL 

FUNCTION childwin( oWnd ) 
   LOCAL ochild 

   DEFINE WINDOW ochild MDICHILD OF oWnd 
      oChild:CoorsUpdate()
      ochild:cTitle( "Izquierda: "+ AllTrim(Str(ochild:nLeft)) +"  Derecha: "+ AllTrim(Str(ochild:nRight))) 
      ochild:bMoved := {|| oChild:CoorsUpdate(), ochild:cTitle( "Izquierda: "+ AllTrim(Str(ochild:nLeft)) +"  Derecha: "+ AllTrim(Str(ochild:nRight)))} 
   ACTIVATE WINDOW ochild 

   RETURN NIL
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
coordenadas de ventanas (SDI, MDI)
Posted: Fri Aug 29, 2008 07:15 AM
William,

Otra forma de hacerlo sin llamar a CoorsUpdate():

#include "FiveWin.ch"

FUNCTION main() 
   LOCAL owin, omenu 

   MENU omenu 
     MENUITEM "Child" ACTION childwin( owin ) 
   ENDMENU 

   DEFINE WINDOW owin MENU omenu MDI 
      owin:cTitle( "Izquierda: "+ AllTrim(Str( WndLeft( owin:hWnd ))) +"  Derecha: "+ AllTrim(Str(WndTop( owin:hWnd )))) 
      owin:bMoved := {|| owin:cTitle( "Izquierda: "+ AllTrim(Str(WndLeft( owin:hWnd ))) +"  Derecha: "+ AllTrim(Str(WndTop(owin:hWnd))))} 
   ACTIVATE WINDOW owin 

   RETURN NIL 

FUNCTION childwin( oWnd ) 
   LOCAL ochild 

   DEFINE WINDOW ochild MDICHILD OF oWnd 
      ochild:cTitle( "Izquierda: "+ AllTrim(Str(WndLeft( ochild:hWnd ))) +"  Derecha: "+ AllTrim(Str(WndTop( ochild:hWnd )))) 
      ochild:bMoved := {|| ochild:cTitle( "Izquierda: "+ AllTrim(Str(WndLeft( ochild:hWnd ))) +"  Derecha: "+ AllTrim(Str(WndTop( ochild:hWnd ))))} 
   ACTIVATE WINDOW ochild 

   RETURN NIL
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
coordenadas de ventanas (SDI, MDI)
Posted: Fri Aug 29, 2008 10:16 PM

Antonio,

muchas gracias por contestar.

pero todo esto sali贸 por la cuesti贸n de que quer铆a mover a una ubicaci贸n especificada una child, y cuando le daba:

nLeft := oWin:nwdth - 190

nom谩s no hacia caso a la instrucci贸n.

sigo investigando las coordenadas de una win y una child.

William, Morales

Saludos



m茅xico.sureste
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
coordenadas de ventanas (SDI, MDI)
Posted: Fri Aug 29, 2008 10:43 PM

William,

Las funciones WndTop(), WndLeft(), WndWidth() y WndHeight() son de tipo setget, por lo que puedes usarlas para cambiar esos valores:

WndTop( hWnd [, nNewTop ] ) --> nTop
WndLeft( hWnd [, nNewLeft ] ) --> nLeft
WndWidth( hWnd [, nNewWidth ] ) --> nWidth
WndHeight( hWnd [, nNewHeight ] ) --> nHeight

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
coordenadas de ventanas (SDI, MDI)
Posted: Sat Aug 30, 2008 01:21 AM
Antonio Linares wrote:William,

Las funciones WndTop(), WndLeft(), WndWidth() y WndHeight() son de tipo setget, por lo que puedes usarlas para cambiar esos valores:

WndTop( hWnd [, nNewTop ] ) --> nTop
WndLeft( hWnd [, nNewLeft ] ) --> nLeft
WndWidth( hWnd [, nNewWidth ] ) --> nWidth
WndHeight( hWnd [, nNewHeight ] ) --> nHeight


Antonio,

muchas gracias, es lo que necesitaba.
William, Morales

Saludos



m茅xico.sureste

Continue the discussion