Drops and Clicks

<[email protected]> 28 Oct 2013 07:16:04 -0700
Newsgroups gmane.comp.windows.gui4cli
Message-ID <[email protected]>
.G4C To test drops
Drops and Clicks
===========
 Hi Dimitris,
 I wrote this script to explore how works the Drop and Cursor and Click
internal variables.
It seems to run fine, but when run, the instant of exit, the  xOnClose routine
seems to give errors as :
$$CURSOR.Live.sx;sy and $$CURSOR.Live.x;y 
both print the same value for the contents.
  
 Is there a simple explanation for this effect, or have I turned
up an error.
 I was under the impression from the manual entries, that the sx, sy are
measured from the left, top of a pc display{s = screen}
And that the x, y are measured from the left, top of my GUIWINDOW
 In the case of this script, I seem to be wrong.  Can you, please explain this anomaly
Thank you
 Red Dragon
~~~~~~~~~~~~~
 G4C FILEDROPTEST
 /* =============================================
 Author: Red Dragon
 Program: FILEDROPTEST.gui
 Comment:  An Example gui
 Description:To test drops and x, y coords
       when buttons are clicked
     
 ============================================= */
 /* =============================================
 Details:   17-12-10 
BUTTONS have drops detection
"The List" could be used in a 2 column listview array
marking the file for future action.  e.g.  When you
click the erase button it gives you a list made of all those
fpaths marked for deletion.  To make that you would make
script 'walk' the list, copying only those items marked deleted.
 In this example clicking the buttons exits the run and closes the gui.
Closing holds the test of the x, y's.
Comment line 34 to read :
//GCWin clear
to get a full list of x,y over several runs.
 =============================================
============================================= */
 WINDOW 90 426 289 127 "FILEDROPTEST"
 WinAttr style remsize
 xOnLoad
 GCWin Font "Tahoma/14"
GCWin clear
 GCWin open
 GuiOpen #this
xOnDROP Copy
gosub #this print
 xOnDROP Move
 gosub #this print
xOnDROP Delete 
 gosub #this print
 
xroutine print
gcwin show
  say 'Event : $$drop.id, Gui : $$drop.gui'
  say '$$drop.id $$drop.count $$drop.type items'
  say 'Drop made at coordinates: $$drop.x, $$drop.y'
  say '============================='
  for c 0 $$drop.max
    say '$$drop.$c'
  endfor
//guiclose #this
 xOnClose
 GuiQuit #this
 say "Exit by click at x=$$CLICK.x\;y=$$CLICK.y"
 say "GUIWindow click at x=$$CURSOR.Live.x\;y=$$CURSOR.Live.y"
 say "SCREEN click at x=$$CURSOR.Live.sx\;y=$$CURSOR.Live.sy"
//xRoutines and Events follow
 //=============================================
//$$CURSOR.Live.ID
//=============================================
 // *** NEW Gadget
//=============================================
 XBUTTON 5 5 65 105 "Copy"
attr style drop
id Copy
 //######Image create mypic 100 200
//local p
guiclose #this
//=============================================
XBUTTON 0 0 65 105 "Clear"
attr style drop
id Clear
 //######Image create mypic 100 200
//local p
guiclose #this
//=============================================
XBUTTON 75 5 85 105 "Move"
attr style drop
id Move
 //######Image create mypic 100 200
guiclose #this
//=============================================
 XBUTTON 165 5 115 105 "Erase"
attr style drop
id Delete
 //######Image create mypic 100 200
guiclose #this
//=============================================
//%%End of Script FILEDROPTEST%%
~~~~~~~~~~~~~
~~~~~~~~~~~~~