Page 1 of 2

A simple way to modify the cursor ...

Posted: Mon Oct 07, 2013 8:55 am
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

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

Posted: Mon Oct 07, 2013 9:56 am
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"

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

Posted: Mon Oct 07, 2013 12:26 pm
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

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

Posted: Wed Oct 09, 2013 10:18 pm
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

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

Posted: Thu Oct 10, 2013 5:51 am
by bpd2000
Excellent
Thank you Dr. Caludio

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

Posted: Thu Oct 10, 2013 7:53 am
by mustafa
Amigo Claudio
Magnífico
saludos
Mustafa

Claudio Friend
magnificent
regards
Mustafa
:P

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

Posted: Thu Dec 11, 2014 10:48 am
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

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

Posted: Thu Dec 11, 2014 11:52 am
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. :)

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

Posted: Thu Dec 11, 2014 12:08 pm
by serge_girard
Thanks Pablo!

Serge

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

Posted: Thu Dec 11, 2014 12:47 pm
by quartz565
Thank you Pablo!