Fecha actual Mar Jul 01, 2025 2:26 pm

Todos los horarios son UTC + 1 hora [ DST ]




Nuevo tema Responder al tema  [ 3 mensajes ] 
Autor Mensaje
NotaPublicado: Vie Jun 17, 2011 4:36 pm 

Registrado: Lun Ene 08, 2007 5:56 pm
Mensajes: 91
Saludos,
He estado revisando los ejemplos me parece que habia visto esto pero ahora no lo encuentro, necesito saber cual es la posición del cursor eje x, eje y en la pantalla , me podrian ayudar
gracias

_________________
Saludos.
German


Arriba
 Perfil  
Responder citando  
 Asunto:
NotaPublicado: Vie Jun 17, 2011 6:13 pm 

Registrado: Lun Ene 08, 2007 5:56 pm
Mensajes: 91
Que esta mal en este codigo, porque no entra al mouse move para actualizar los label?
ayuda por favor !

#include "P:\c3\include\Gui.ch"
#include "P:\c3\include\DBinfo.ch"
#include "P:\c3\include\FileIO.ch"
/*
* Clase TMgetBrw
*/
CLASS TMgetBrw FROM TForm

PUBLIC:
DATA DbGrid, FBitmap,label1,label2,button1

METHOD Create CONSTRUCTOR
METHOD ModuloOnCreate
METHOD ModuloOnShow
METHOD ModuloOnmousemove
METHOD ModuloOndestroy
Method CrearBoton
PUBLIC Modulo

ENDCLASS

/*
* Constructor de la clase.
*/
METHOD Create( oOwner ) CLASS TMgetBrw

Super:Create( oOwner )
::Caption := "MGETBRWP"
::BorderStyle := bsDialog
::ClientWidth := anchowin
::ClientHeight:= altowin-100
::Icon:Name := "DBGRIDNTX"
::Position := poScreenCenter
::OnCreate := { | oSender | ::ModuloOnCreate( oSender ) }
::OnDestroy := { | oSender | ::ModuloOnDestroy( oSender ) }
::OnShow := { | oSender | ::ModuloOnShow( oSender ) }
::OnMouseMove := { | oSender, nX, nY | ::ModuloOnMouseMove( oSender,nX,nY ) }

Request DbfCdx
Imagen="FMTORDEN.BMP"
Image1 := TImage():Create(SELF)
Image1:SetSize( ANCHOWIN, ::ClientHeight)
Image1:Themed := .F.
Image1:AutoSize := .F.
Image1:Center := .F.
Image1:Picture:Bitmap:FileName := imagen
Image1:Stretch := .T.
::ModuloOnCreate( )
return

************************************************
METHOD ModuloOnCreate( ) CLASS TMgetBrw
************************************************
::Label1 := TLabel():Create( Self )
::Label1:SetPos( 16, 8 )
::Label1:Caption := "Eje x"

::Label2 := TLabel():Create( Self )
::Label2:SetPos( 64, 8 )
::Label2:Caption := "Eje y"

return

Method ModuloOnMouseMove( oSender, nX, nY ) Class TMgetBrw
***********************************************************
?"movio"
::Label1:Caption := str(nx)
::Label2:Caption := str(ny)

*******************************************************************************************
METHOD ModuloOnDestroy( oSender ) CLASS TMgetBrw
*******************************************************************************************

return
/*
* Evento OnShow.
*/
*******************************************************************************************
METHOD ModuloOnShow( oSender ) CLASS TMgetBrw
*******************************************************************************************

return

_________________
Saludos.
German


Arriba
 Perfil  
Responder citando  
 Asunto:
NotaPublicado: Mar Jun 21, 2011 4:37 pm 

Registrado: Lun Ene 08, 2007 5:56 pm
Mensajes: 91
Solucion al problema, modulo funcionando.

*****************************************************************************************************************
#include "P:\c3\include\Gui.ch"
#include "P:\c3\include\DBinfo.ch"
#include "P:\c3\include\FileIO.ch"
//***************************************************************************************//

/*
* Clase TMgetBrw
*/
CLASS TMgetBrw FROM TForm

PUBLIC:
DATA DbGrid, FBitmap,label1,label2,saywin,posicion,x,y

METHOD Create CONSTRUCTOR
METHOD ModuloOnCreate
METHOD ModuloOnShow
METHOD ModuloOnmousemove
METHOD ModuloOnclickmouse
METHOD ModuloOndestroy
PUBLIC Modulo

ENDCLASS

/*
* Constructor de la clase.
*/
METHOD Create( oOwner ) CLASS TMgetBrw

Super:Create( oOwner )
::Caption := "MGETBRWP"
::BorderStyle := bsDialog
::ClientWidth := anchowin
::ClientHeight:= altowin-100
::Icon:Name := "DBGRIDNTX"
::Position := poScreenCenter
::OnCreate := { | oSender | ::ModuloOnCreate( oSender ) }
::OnDestroy := { | oSender | ::ModuloOnDestroy( oSender ) }
::OnShow := { | oSender | ::ModuloOnShow( oSender ) }

Request DbfCdx
Imagen="FMTORDEN.BMP"

::Saywin:= TPanel():Create(self)
::Saywin:SetPos(1,1)
::Saywin:width := ::ClientWidth
::Saywin:height := ::ClientHeight
::Saywin:Visible := .T.
::Saywin:OnMouseMove := { | oSender, nX, nY | ::ModuloOnMouseMove( oSender,nX,nY ) }
::Saywin:OnClick := { | oSender | ::ModuloOnclickMouse( oSender) }


Image1 := TImage():Create(::saywin)
Image1:SetPos(1,1)
Image1:SetSize( ::ClientWidth-2, ::ClientHeight-2)
Image1:Themed := .F.
Image1:AutoSize := .F.
Image1:Center := .F.
Image1:Picture:Bitmap:FileName := imagen
Image1:Stretch := .T.

::ModuloOnCreate( )
return

************************************************
METHOD ModuloOnCreate( ) CLASS TMgetBrw
************************************************
::Label1 := TLabel():Create( ::Saywin )
::Label1:SetPos( 16, 8 )
::Label1:Caption := "Eje x"

::Label2 := TLabel():Create( ::Saywin )
::Label2:SetPos( 64, 8 )
::Label2:Caption := "Eje y"
::x=0
::y=0
::posicion := TRadioButton():Create( ::Saywin )
::posicion:AutoSize := .F.
::posicion:SetPos( ::x,::y)
::posicion:width :=13
::posicion:height :=14
::posicion:Font:Size := 6
::posicion:caption:="."
::posicion:checked:=.T.
::posicion:Brush:Color := clWhite
::posicion:WordWrap := .T.
/*
::RadioButton1 := TRadioButton():Create( Self )
::RadioButton1:AutoSize := .F.
::RadioButton1:SetBounds( 80, 24, 13, 14 )
::RadioButton1:Caption := "."
::RadioButton1:Brush:Color := cl3DDkShadow
::RadioButton1:WordWrap := .T.
*/
return

Method ModuloOnclickMouse( oSender, nX, nY ) Class TMgetBrw

Method ModuloOnMouseMove( oSender, nX, nY ) Class TMgetBrw
***********************************************************
if nx<>0
::Label1:Caption := str(nx)
::x=nx
endif
if ny<>0
::Label2:Caption := str(ny)
::y=ny
endif

::posicion:SetPos( ::x,::y)

*******************************************************************************************
METHOD ModuloOnDestroy( oSender ) CLASS TMgetBrw
*******************************************************************************************

return
/*
* Evento OnShow.
*/
*******************************************************************************************
METHOD ModuloOnShow( oSender ) CLASS TMgetBrw
*******************************************************************************************

return

_________________
Saludos.
German


Arriba
 Perfil  
Responder citando  
Mostrar mensajes previos:  Ordenar por  
Nuevo tema Responder al tema  [ 3 mensajes ] 

Todos los horarios son UTC + 1 hora [ DST ]


No puede abrir nuevos temas en este Foro
No puede responder a temas en este Foro
No puede editar sus mensajes en este Foro
No puede borrar sus mensajes en este Foro
No puede enviar adjuntos en este Foro

Buscar:
Saltar a:  
cron