A simple way to modify the cursor ...

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Richard_Schmidt
Posts: 21
Joined: Wed Jul 31, 2013 3:23 pm
Location: Germany

A simple way to modify the cursor ...

Post by Richard_Schmidt »

Hallo folks,

I want to temporarily change the standard cursor shape (arrow) to the hourglass shape and back to show that the programm needs some time for calculations.

With dBFast ther was a command "SET CURSOR TO ARROW" resp. "SET CURSOR TO ARROW" to do this.

How can this be done with HMG ?

Best Regards
Richard

-----------------------------------------------------

Hola amigos,

Quiero cambiar temporalmente la forma del cursor estándar (flecha) a la forma de reloj de arena y volver a demostrar que el program necesita un poco de tiempo para los cálculos.

Con DBFAST allí era un comando "SET CURSOR TO ARROW" resp. "SET CURSOR TO ARROW" para cambiar el imagen.

¿Cómo se puede hacer esto con HMG?

Recuerdos
Richard
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: A simple way to modify the cursor ...

Post by esgici »

Richard_Schmidt wrote: I want to temporarily change the standard cursor shape (arrow) to the hourglass shape and back to show that the programm needs some time for calculations.
<hmg>\SAMPLES\Controls\Cursor\CURSOR.2

You need also a cursor file like "wait.cur"
Viva INTERNATIONAL HMG :D
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: A simple way to modify the cursor ...

Post by mustafa »

Hola amigos
Este tema ya se planteo hace tiempo al Maestro
Con Win_1.Cursor := "finger", el "finger" sale por toda la ventana
pero si creas Botones, cuando los pulsas se convierte el cursor
otra vez en punta de flecha.

http://hmgforum.com/viewtopic.php?f=5&t=1182" onclick="window.open(this.href);return false;

investigue hace tiempo y en MinGUi Extended
se logra con :

SetHandCursor( GetControlHandle("Button_D01", "Form_1X"), "Bmp\Finger.cur" ) // <-MiniguiExtended

Creo que nosotros no tenemos -------> SetHandCur,sor
tenemos parecido -----------> HandCursor pero no hace nada

HandCursor( GetControlHandle("Button_D01", "Form_1X"), "Bmp\Finger.cur" ) // <----- en HMG does nothing

saludos
Mustafa

*------------------------------------------------------------------------------*
Hello friends

This subject was raised while the Master

With Win_1.Cursor: = "finger", the "finger" goes for the whole window
but if you create buttons, when you click becomes the cursor
again arrowhead.

http://hmgforum.com/viewtopic.php?f=5&t=1182" onclick="window.open(this.href);return false;
http://hmgforum.com/viewtopic.php?f=9&t=1170&start=10" onclick="window.open(this.href);return false;

investigate long and Mingui Extended
is achieved by:

  SetHandCursor( GetControlHandle("Button_D01", "Form_1X"), "Bmp\Finger.cur" ) // <-MiniguiExtended

I think that we have no -------> SetHandCursor

we like ------------> Handcursor but does nothing

  Handcursor (GetControlHandle ("Button_D01", "Form_1X"), "bmp \ Finger.cur") / / <----- in HMG does nothing

regards
Mustafa
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: A simple way to modify the cursor ...

Post by srvet_claudio »

See this sample:

Code: Select all

#include "hmg.ch"

Function Main

	DEFINE WINDOW Win_1 ;
		AT 0,0 ;
		WIDTH 400 ;
		HEIGHT 400 ;
		TITLE 'Hello World!' ;
		MAIN 
 
 @ 50, 50 BUTTON Button_1 CAPTION "Hello"  ACTION MsgInfo ()
  
	END WINDOW

 Win_1.Cursor := "finger"

SETWINDOWCURSOR (Win_1.Button_1.Handle, "finger")

CENTER WINDOW Win_1
ACTIVATE WINDOW Win_1

Return
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: A simple way to modify the cursor ...

Post by bpd2000 »

Excellent
Thank you Dr. Caludio
BPD
Convert Dream into Reality through HMG
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: A simple way to modify the cursor ...

Post by mustafa »

Amigo Claudio
Magnífico
saludos
Mustafa

Claudio Friend
magnificent
regards
Mustafa
:P
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: A simple way to modify the cursor ...

Post by serge_girard »

Claudio,

How to change cursor from default arrow to a spinning hourglass and back to default arrow?

I need this between some time consuming process.
Something like the WAIT WINDOW but only the cursor.

Thanks, Serge
There's nothing you can do that can't be done...
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: A simple way to modify the cursor ...

Post by Pablo César »

Hi Serge,

See if is this what you are needing:

Code: Select all

#include "hmg.ch"

Function Main
DEFINE WINDOW Win_1 TITLE 'WAIT WINDOW DEMO 1' MAIN CURSOR Nil

    @ 70,70 BUTTON Button_1 CAPTION 'WAIT WINDOW "Processing..." NOWAIT' ACTION Test1() WIDTH 250
    @ 100,70 BUTTON Button_2 CAPTION 'WAIT CLEAR' ACTION Test2() WIDTH 250

END WINDOW
SetWindowCursor( Win_1.Button_1.Handle, "HMG_FINGER" )
SetWindowCursor( Win_1.Button_2.Handle, "HMG_FINGER" )
ACTIVATE WINDOW Win_1 
Return Nil

Function Test1()
SetWindowCursor( Win_1.Handle, IDC_WAIT )
SetWindowCursor( Win_1.Button_1.Handle, IDC_WAIT )
SetWindowCursor( Win_1.Button_2.Handle, "HMG_FINGER" )
WAIT WINDOW "Processing..."  NOWAIT
Return Nil

Function Test2()
SetWindowCursor( Win_1.Handle, IDC_ARROW )
SetWindowCursor( Win_1.Button_1.Handle, IDC_ARROW )
SetWindowCursor( Win_1.Button_2.Handle, "HMG_FINGER" )
WAIT CLEAR
Return Nil
IDC_WAIT is the CONSTANT declared at C:\hmg.3.3.1\INCLUDE\i_controlmisc.ch corresponding to hourglass.

You will see at buttons a finger cursor and according WAIT WINDOW (start/stop) will be changed.

I hope be useful. :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: A simple way to modify the cursor ...

Post by serge_girard »

Thanks Pablo!

Serge
There's nothing you can do that can't be done...
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: A simple way to modify the cursor ...

Post by quartz565 »

Thank you Pablo!
Best Regards,
Nikos.

os: Windows Server 2019 - 64
Post Reply