Re: Table Widget Selection? [message #33432 is a reply to message #33428] |
Mon, 06 January 2003 04:56   |
David Burridge
Messages: 33 Registered: January 1998
|
Member |
|
|
I couldn't resist a a gross hack for this!-)
If you create an unmapped draw widget, you can call cursor with /nowait and
grab the mouse state from !Mouse. Not pretty, but it works ... kinda:-p I've
attached the test program at the foot of this post. You'll have to diddle
with it to respond to more than the first click on a table cell.
Suffice to say, I would *never* do this in a serious program, but you got my
interest piqued!!!
Cheers,
Dave
--
David Burridge
Burridge Computing, 18 The Green South
Warborough, Oxon, OX10 7DN
England
Tel: +44 (0) 1865 858279, Email: davidb@burridgecomputing.co.uk
"dmarino" <dmarino@digitalglobe.com> wrote in message
news:1c23e5f8.0301022008.66081572@posting.google.com...
> Happy New Year!
>
> Is there any way to tell which button the user selected a table widget
> cell selection with? Nothing obvious in the docs, unless I'm missing
> something. A quick search of the threads for this group didn't really
> return anything.
> It would be cool if I could tell if the user right-clicked a cell.
>
> Thanks in advance,
> dmarino
> digitalglobe
;*** PROGRAM HERE ***
pro tabletest_event, ev
; Here's an event
Print, "Event!"
; Find out which mouse button was pressed (yuck!) and report
cursor, x, y, /nowait
Case !mouse.button OF
1 : Print, 'Left button'
2 : Print, 'Middle button'
3 : Print, 'Left & middle buttons'
4 : Print, 'Right button'
5 : Print, 'Right & left buttons'
6 : Print, 'Right & middle buttons'
7 : Print, 'Right, middle & left buttons'
Else : ; do nothing
Endcase
end
pro tabletest
; Create an interface
tlb = widget_base (title='Table Test')
t = widget_table (tlb, /edit, /all_events)
; Create an unmapped widget base so that cursor can be called
; to establish which mouse button was pressed (yuck!)
db = widget_base (tlb, Map=0)
d = widget_draw (db)
; Display and manage the interface
widget_control, tlb, /realize
xmanager, 'tabletest', tlb, event_handler='tabletest_event'
end
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.404 / Virus Database: 228 - Release Date: 15/10/2002
|
|
|