Event for moving a window

Moderator: Rathinagiri

Post Reply
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

Event for moving a window

Post by hmgchang »

Hola Masters,

i can use ON SIZE event when i size a window,
but how about moving a window... any ON MOVE ?

or how can i catch the move event ?
windowsEvents.JPG
windowsEvents.JPG (50.7 KiB) Viewed 1427 times
Thks n rgds
Chang
Just Hmg It !
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Event for moving a window

Post by andyglezl »

Maybe...

OnMouseDrag Event
Occurs when the user drag in a Window


Syntax:

OnMouseDrag <ActionProcedure>
The following data are available at ‘OnMouseClick’ procedure:

_HMG_SYSDATA [ 191 ] -> Mouse Row

_HMG_SYSDATA [ 192 ] -> Mouse Col
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

Re: Event for moving a window

Post by hmgchang »

Hola and thanks Andy,

it happen if the mouse pointer is inside the window that wont cause the window
to move.

When we move window the mouse is at the title bar of the window,
that what can move the whole window across the screen,
unfortunately i don't know what event to check ( ON MOVE ?)

Thks n Rgds
Chang
HMG -
Happy Make Good
Just Hmg It !
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Event for moving a window

Post by AUGE_OHR »

hi,

do you you wat to move hole Window :?:

Code: Select all

   MoveWindow( hWnd, col, row, width, height, .T. )
Source is in x:\hmg.3.4.4\SOURCE\c_windows.c
have fun
Jimmy
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

Re: Event for moving a window

Post by hmgchang »

Hi Auge_OHR,
thks for the info.
Pls be kind to give a ssw ( small simple working) example
with hmg since I never learn C.

Thks n Rgds
Chang
Just Hmg It !
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Event for moving a window

Post by Claudio Ricardo »

Hi... Maybe:

Code: Select all

#include <hmg.ch>

Function Main

PRIVATE nRow, nCol

	Load Window Main
	Main. Center

		nRow := GetProperty ("Main" , "Row")
		nCol := GetProperty ("Main" , "Col")

	Main. Activate

Return
// -------------------------------------------------------------------------------------------------------- //

Function OnMove

	If nRow <> GetProperty ("Main" , "Row") .OR. nCol <> GetProperty ("Main" , "Col")
	
		MsgInfo ("La ventana se ha movido !" , "Aviso !")

		nRow := GetProperty ("Main" , "Row")
		nCol := GetProperty ("Main" , "Col")

	EndIf
	
Return Nil
In Main.fmg set:
OnMouseMove OnMove ()
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
edk
Posts: 914
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Event for moving a window

Post by edk »

Post Reply