Page 1 of 2

Setting Graphical Cursor

Posted: Tue Oct 08, 2013 2:20 am
by esgici
Hi All

An essay to add settings some built-in Win-API cursors to standard "load from file" cursor feature of HMG.

Low-level modules and methods borrowed from MiniGUI EE; thanks to authors Jacek Kubica and Grigory Filatov.

And special thanks to my brother Mustafa for remark and recall.

Sorry Mustafa, not control specific, again form-based setting :(
Screen shoot
Screen shoot
SetGCursor.jpg (13.44 KiB) Viewed 6311 times
SetGCursor.zip
Source and sample files
(2.99 KiB) Downloaded 341 times
Happy HMG'ing :D

Re: Setting Graphical Cursor

Posted: Tue Oct 08, 2013 4:08 am
by bpd2000
Nice
Thank you, Esgici

Re: Setting Graphical Cursor

Posted: Tue Oct 08, 2013 9:36 am
by Richard_Schmidt
Perfect !

Thanks a lot for your effort - this also answers my last question.

Best Regards
Richard

Re: Setting Graphical Cursor

Posted: Tue Oct 08, 2013 9:42 am
by esgici
Hi Richard

Thanks to your interest and nice words :)
Richard_Schmidt wrote:... - this also answers my last question....
Yes, "starter" is you this time ;)

Viva HMG :D

Re: Setting Graphical Cursor

Posted: Tue Oct 08, 2013 6:41 pm
by mustafa
Hola amigos y al hermano Esgici
As Salamu Alaikum
Felicidades por tus programas tan amenos y didacticos
Mi pregunta es ?
El cursor normal dentro de la ventana y cuando hay algun
boton por pulsar, entonces cuando pasas el cursor por
encima del Boton es cuando aparec el cambio de cursor
a finger.
Como ejemplo en esta página web el cursor está normal
pero cuando llega el cursor sobre a Post Reply , vemos que
sale el cursor en forma de "finger", esto seria interesante
si se pudiera conseguir cuando se quiere pulsar un Boton.
Los Compañeros de Minigui_Extended lo han conseguido
con esta sentencia

SetHandCursor( GetControlHandle("Button_01", "Form_1"), "Resource\Finger.cur" ) // <----Minigui Extended

Nombre Button --> Button_01
nombre Winndow -->Form_1
carpeta donde está "finger.cur"

saludos
Mustafa
*--------------------------------------------------------------------------------------*
Hello friends and brother Esgici
As Salamu Alaikum
Congratulations on your programs as entertaining and didactic
My question is?
The normal cursor inside the window and when there is some
button by pressing, then when you hover
Pin up is when A appears cursor changea finger.
As an example on this website is normally the cursor
  but when the cursor over to Post Reply, we see that
leaves the cursor in a "finger", that would be interesting
if you could get when you want to press a Button.
The Partners have succeeded Minigui_Extended
with this sentence

  SetHandCursor (GetControlHandle ("Button_01", "Form_1"), "Resource\Finger.cur") / / <---- MiniGUI Extended

Name Button -> Button_01
Window name -> Form_1
folder where "finger.cur"

regards
Mustafa

Re: Setting Graphical Cursor

Posted: Wed Oct 09, 2013 8:45 am
by mustafa
Hola
sobre el tema anterior sobre "Finger.cur" al pulsar un "Button",
les mando un antiguo ejemplo con MiniguiExtended
que documenta dicho ejemplo.
Ya se hablo en su dia de este tema con el Maestro Roberto

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;

saludos
Mustafa
:mrgreen:
*-----------------------------------------------------------*
Hello
On the previous topic on "Finger.cur" when you press a "Button",
I send an old example with MiniguiExtended
documenting this example.
Already in his day talking about this with the Master Roberto

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;

regards
Mustafa
:mrgreen:

Re: Setting Graphical Cursor

Posted: Wed Oct 09, 2013 9:27 am
by esgici
mustafa wrote: ...
The normal cursor inside the window and when there is some
button by pressing, then when you hover
Pin up is when A appears cursor changea finger.
...
Hola Mustafa

Aleykum salam :)

Thanks to your nice words :)

I know, in addition to "form level", we need also "control specific" mouse shape.

The keyword is : hover !

MiniGUI EE has the OnMouseHover event for this purpose :
OnMouseHover

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

Action to be performed when the mouse pointer hovers over the control

SYNTAX

ON MOUSEHOVER <aOnMouseHoverProcedure> | <abBlock>
Sadly, in HMG official we don't have this nice feature :(

I'm sure our genius Dr. Soto would add it, and I hope he will do this :arrow:

Happy HMG'ing :D

Re: Setting Graphical Cursor

Posted: Wed Oct 09, 2013 10:21 pm
by esgici
Hi All

Some little rectifications, cosmetics :arrow:

Happy HMG'ing :D

Re: Setting Graphical Cursor

Posted: Thu Oct 10, 2013 8:12 am
by mustafa
Hola
Sobre el tema de "Finger.cur" solo sobre los Buttons
lo ha solucionado el amigo Dr.Claudio

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

aqui dejo un ejemplo, sobre el tema Buttons basado en el
ejemplo Dr.Claudio


Ímportante
incluir en compilación fichero "finger.cur"

Saludos
Mustafa
*----------------------------------------------------------------*

Hello
On the subject of "Finger.cur" only on Buttons
Fixed it Dr.Claudio friend

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

here is a example on the theme based Buttons
Dr. Claudio example


important
compilation include file "finger.cur"

regards
Mustafa

#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-1" ACTION MsgInfo ()

@ 50, 230 BUTTON Button_2 CAPTION "Hello-2" ACTION MsgInfo ()

END WINDOW

* Win_1.Cursor := "finger.cur"

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

CENTER WINDOW Win_1
ACTIVATE WINDOW Win_1

Return

Re: Setting Graphical Cursor

Posted: Fri Oct 11, 2013 4:44 am
by bpd2000
Same cursor apply to all the buttons even after defined as

Code: Select all

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