Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 MOUSE_OVER effect on Panoramic objects

View previous topic View next topic Go down 
AuthorMessage
Klaus

avatar

Number of posts : 18
Age : 68
Localisation : France
Registration date : 2013-03-23

PostSubject: MOUSE_OVER effect on Panoramic objects   Fri Mar 29, 2013 3:18 pm

With my KGF.dll, you can obtain amazing effects on Panoramic objects ! You can capture all kind of mose events and fire a Panoramic event routine, just like an ON_CLICK event. This includes MOUSE_WHEEL handling and MOUSE_ENTER and MOUSE_LEAVE events.

The 2 latter events can be used to produce a MOUSE_OVER effect, as in the following program:
Code:
' test_mouse_over_bis.bas

label mouse_enter_memo, mouse_exit_memo
label mouse_enter_list, mouse_exit_list

dim dll$ : dll$ = "KGF.dll"

KGF_initialize(dll$)

memo 1 : top 1,10 : left 1,10
  width 1,300 : height 1,300
 item_add 1,"Hoover the cursor"
 item_add 1,"over the objects"
list 2 : top 2,10 : left 2,350
  width 2,200 : height 2,400
  item_add 2,"and they will"
  item_add 2,"change their aspect"
 
edit 101 : top 101,330 : ' hide 101
button 201 :hide 201 : on_click 201,mouse_enter_memo
button 301 :hide 301 : on_click 301,mouse_exit_memo

edit 102 : top 102,360 : ' hide 102
button 202 :hide 202 : on_click 202,mouse_enter_list
button 302 :hide 302 : on_click 302,mouse_exit_list

ClickSetHook(1,101)
ClickSetLink(201,5)
ClickSetLink(301,6)

ClickSetHook(2,102)
ClickSetLink(202,5)
ClickSetLink(302,6)


end

mouse_enter_memo:
  color 1,255,230,230
  font_color 1,0,0,255
  caption 0,"Enter mémo "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  return

mouse_exit_memo:
  color 1,255,255,255
  font_color 1,0,0,0
  caption 0,"Exit mémo "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  return

mouse_enter_list:
  color 2,230,230,255
  font_color 2,0,0,255
  caption 0,"Enter list "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  return

mouse_exit_list:
  color 2,255,255,255
  font_color 2,0,0,0
  caption 0,"Exit list "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  return



#INCLUDE "KGF_SUB.bas"



Just hoover the mouse over the 2 objects and see the reaction !

To run the program, please go to my WebDav (link in the signature) and download:
DLLs\KGF.dll
DLLs\KGF_SUB\KGF_SUB.bas
DLLs\Documentation CHM\KGF.chm

EDIT

Obviously, the 2 EDIT objects 101 et 102 are normally hidden by the HIDE command. The only reason to display them in the present demo is to show how a fired event changes the content of these objects, thus providing coordonate information for the programmer.
Back to top Go down
View user profile http://klaus.panoramic.voila.net/
Klaus

avatar

Number of posts : 18
Age : 68
Localisation : France
Registration date : 2013-03-23

PostSubject: Re: MOUSE_OVER effect on Panoramic objects   Fri Mar 29, 2013 8:06 pm

And here is a new version of this small demo program. I added a group of 3 buttons, on which I defined a MOUSE_OVER effect.

Panoramic already has such en effect on buttons: it is a color change. I added a change of the button size, keepin Panoramic's standard behavior intact. Here is the result:
Code:
' test_mouse_over_bis.bas

label mouse_enter_memo, mouse_exit_memo
label mouse_enter_list, mouse_exit_list
label mouse_enter_B1, mouse_exit_B1
label mouse_enter_B2, mouse_exit_B2
label mouse_enter_B3, mouse_exit_B3

dim dll$ : dll$ = "KGF.dll"
' dim langage$ : langage$ = "FR"
dim langage$ : langage$ = "EN"

KGF_initialize(dll$)

memo 1 : top 1,10 : left 1,10
  width 1,300 : height 1,300
if langage$="FR
 item_add 1,"Déplacez le curseur"
 item_add 1,"à l'aide de la souris"
else
  item_add 1,"Hoover the cursor"
  item_add 1,"over the objects"
end_if
list 2 : top 2,10 : left 2,350
  width 2,200 : height 2,400
if langage$="FR
  item_add 2,"Les objets vont"
  item_add 2,"changer d'aspect"
else
  item_add 2,"and they will"
  item_add 2,"change their aspect"
end_if
button 3 : top 3,360 : left 3,10 : width 3,30 : caption 3,"B1"
button 4 : top 4,360 : left 4,40 : width 4,30 : caption 4,"B2"
button 5 : top 5,360 : left 5,70 : width 5,30 : caption 5,"B3"

edit 101 : top 101,320 : width 101,60 : left 101,10 : ' hide 101
button 201 :hide 201 : on_click 201,mouse_enter_memo
button 301 :hide 301 : on_click 301,mouse_exit_memo

edit 102 : top 102,320 : width 102,60 : left 102,80: ' hide 102
button 202 :hide 202 : on_click 202,mouse_enter_list
button 302 :hide 302 : on_click 302,mouse_exit_list

edit 103 : hide 103
edit 104 : hide 104
edit 105 : hide 105
button 203 : on_click 203,mouse_enter_B1 : hide 203
button 303 : on_click 303,mouse_exit_B1  : hide 303
button 204 : on_click 204,mouse_enter_B2 : hide 204
button 304 : on_click 304,mouse_exit_B2  : hide 304
button 205 : on_click 205,mouse_enter_B3 : hide 205
button 305 : on_click 305,mouse_exit_B3  : hide 305

ClickSetHook(1,101)
ClickSetLink(201,5)
ClickSetLink(301,6)

ClickSetHook(2,102)
ClickSetLink(202,5)
ClickSetLink(302,6)

ClickSetHook(3,103)
ClickSetLink(203,5)
ClickSetLink(303,6)

ClickSetHook(4,104)
ClickSetLink(204,5)
ClickSetLink(304,6)

ClickSetHook(5,105)
ClickSetLink(205,5)
ClickSetLink(305,6)

end

mouse_enter_memo:
  color 1,255,230,230
  font_color 1,0,0,255
  if langage$="FR
    caption 0,"Entrée mémo "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  else
    caption 0,"Enter mémo "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  end_if
  return

mouse_exit_memo:
  color 1,255,255,255
  font_color 1,0,0,0
  if langage$="FR
    caption 0,"Sortie mémo "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  else
    caption 0,"Exit mémo "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  end_if
  return

mouse_enter_list:
  color 2,230,230,255
  font_color 2,0,0,255
  if langage$="FR
    caption 0,"Entrée list "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  else
    caption 0,"Enter list "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  end_if
  return

mouse_exit_list:
  color 2,255,255,255
  font_color 2,0,0,0
  if langage$="FR
    caption 0,"Sortie list "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  else
    caption 0,"Exit list "+time$+" ("+trim$(text$(101))+") ("+trim$(text$(102))+")"
  end_if
  return

mouse_enter_B1:
  top 3,top(3)-1      : left 3,left(3)-1
  height 3,height(3)+2 : width 3,width(3)+2
  return
 
mouse_exit_B1:
  top 3,top(3)+1      : left 3,left(3)+1
  height 3,height(3)-2 : width 3,width(3)-2
  return

mouse_enter_B2:
  top 4,top(4)-1      : left 4,left(4)-1
  height 4,height(4)+2 : width 4,width(4)+2
  return

mouse_exit_B2:
  top 4,top(4)+1      : left 4,left(4)+1
  height 4,height(4)-2 : width 4,width(4)-2
  return

mouse_enter_B3:
  top 5,top(5)-1      : left 5,left(5)-1
  height 5,height(5)+2 : width 5,width(5)+2
  return

mouse_exit_B3:
  top 5,top(5)+1      : left 5,left(5)+1
  height 5,height(5)-2 : width 5,width(5)-2
  return


#INCLUDE "KGF_SUB.bas"

Back to top Go down
View user profile http://klaus.panoramic.voila.net/
 
MOUSE_OVER effect on Panoramic objects
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop
» How Selenium identify OBIEE objects(Flex Control)
» program to provide total number of objects present / available on the page
» The Bystander effect
» Feeling sorry for inanimate objects?

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: