Re: Table Widget Selection? [message #33419] |
Mon, 06 January 2003 12:50 |
Harvey Rarback
Messages: 24 Registered: September 1998
|
Junior Member |
|
|
Folks,
"Pavel A. Romashkin" <pavel_romashkin@hotmail.com> wrote in message
news:3E19ACED.B7741F64@hotmail.com...
> Dave is right. Nobody here would ever think I'd recommend dumping IDL.
> But many people would agree to the suggestion to dump Table widget :-( I
> have never seen an elegant Widget_Table workaround.
Eightteen months ago, I wrote this fine group:
I have written a widget object which replaces much of the functionality of
the table widget but includes
- multiple rows of column labels
- different color backgrounds and foregrounds per cell
- different alignments per cell
- different fonts for the column labels and table body
- none of the weird sizing problems of the table widget
It uses a draw widget with separate pixmaps for each cell.
That's the good news. The bad news is that I wrote this object for my own
needs and so it is not really documented (yet).
I would be glad to give out the code as is, or if there is enough interest I
could make it available in a more easily usable form.
I got no takers then, and of course I never got around to documenting the
code, but the offer still stands.
--Harvey
|
|
|
Re: Table Widget Selection? [message #33423 is a reply to message #33419] |
Mon, 06 January 2003 12:12  |
dmarino
Messages: 9 Registered: November 2002
|
Junior Member |
|
|
Man, that's clever. (is the IEPA listening?)
Works like a champ for Windows.
UNIX didn't like it as written , but I think the technique will apply!
Thanks to David Burridge and Pavel for their kind input!!!
I LOVE workarounds and hacks like this. It sure beats just not being
able to do it :-)
dmarino
digitalglobe
"David Burridge" <davidb@clogic.f9.co.uk> wrote in message news:<z2fS9.2758$xE1.422110@stones>...
> 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
|
|
|
Re: Table Widget Selection? [message #33428 is a reply to message #33423] |
Mon, 06 January 2003 08:21  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Dave is right. Nobody here would ever think I'd recommend dumping IDL.
But many people would agree to the suggestion to dump Table widget :-( I
have never seen an elegant Widget_Table workaround.
Pavel
dmarino wrote:
>
> Pavel -
>
> I would beg to disagree! IDL and even the cranky Motif world are
> AWESOME for satellite imagery. Nothing touches IDL for doing image
> processing on our giant pixel counts. After a fashion I even like the
> widget programming setup in IDL. It's more than worth it to get the
> sweet
> IDL functionality into our apps, instead of trying to ape this stuff
> in C or another language.
> My thanks to this group, whose collective tutelage and wisdom has
> allowed me to
> begin scratching the surface of this power.( And esp. to Dr Fanning
> for
> IDL Programming Techniques vol2., not to mention Ronn Kling's
> Application book,
> great stuff, that.)
>
> So, for my RSI wish list 2003, add a field to the CellSelection Event
> for clicked:[0,1,2]
>
> Thanks!
>
> dmarino
> digitalglobe
>
> "Pavel A. Romashkin" <pavel_romashkin@hotmail.com> wrote in message news:<3E15B9F2.CA6F2719@hotmail.com>...
>> From all I heard here so far, some other interface would be much
>> prefered by satellite image community. Table widgets (unless they
>> changed drastically in 5.6) were pretty non-intuitive and (in my
>> experience) did not look the same across platforms.
>> Regarding the original question - correct me if I'm wrong, but draw
>> widgets I think are the only ones that distinguish between left, mid and
>> right mouse clicks. It would be nice if they added Shift and Alt
>> clicks... I wouldn't have any other user inputs in my programs, then :-)
>> Cheers,
>> Pavel
>>
>> dmarino wrote:
>>>
>>> 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
|
|
|
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
|
|
|
Re: Table Widget Selection? [message #33433 is a reply to message #33432] |
Mon, 06 January 2003 04:59  |
David Burridge
Messages: 33 Registered: January 1998
|
Member |
|
|
I assume that Pavel was referring to not using Table Widgets rather than
suggesting that you ditch either IDL or Motif?
Dave
"dmarino" <dmarino@digitalglobe.com> wrote in message
news:1c23e5f8.0301040723.21b8872b@posting.google.com...
> Pavel -
>
> I would beg to disagree! IDL and even the cranky Motif world are
> AWESOME for satellite imagery. Nothing touches IDL for doing image
> processing on our giant pixel counts. After a fashion I even like the
> widget programming setup in IDL. It's more than worth it to get the
> sweet
> IDL functionality into our apps, instead of trying to ape this stuff
> in C or another language.
> My thanks to this group, whose collective tutelage and wisdom has
> allowed me to
> begin scratching the surface of this power.( And esp. to Dr Fanning
> for
> IDL Programming Techniques vol2., not to mention Ronn Kling's
> Application book,
> great stuff, that.)
>
> So, for my RSI wish list 2003, add a field to the CellSelection Event
> for clicked:[0,1,2]
>
> Thanks!
>
> dmarino
> digitalglobe
>
>
> "Pavel A. Romashkin" <pavel_romashkin@hotmail.com> wrote in message
news:<3E15B9F2.CA6F2719@hotmail.com>...
>> From all I heard here so far, some other interface would be much
>> prefered by satellite image community. Table widgets (unless they
>> changed drastically in 5.6) were pretty non-intuitive and (in my
>> experience) did not look the same across platforms.
>> Regarding the original question - correct me if I'm wrong, but draw
>> widgets I think are the only ones that distinguish between left, mid and
>> right mouse clicks. It would be nice if they added Shift and Alt
>> clicks... I wouldn't have any other user inputs in my programs, then :-)
>> Cheers,
>> Pavel
>>
>> dmarino wrote:
>>>
>>> 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
--
David Burridge
Burridge Computing, 18 The Green South
Warborough, Oxon, OX10 7DN
England
Tel: +44 (0) 1865 858279, Email: davidb@burridgecomputing.co.uk
---
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
|
|
|
Re: Table Widget Selection? [message #33439 is a reply to message #33432] |
Sat, 04 January 2003 07:23  |
dmarino
Messages: 9 Registered: November 2002
|
Junior Member |
|
|
Pavel -
I would beg to disagree! IDL and even the cranky Motif world are
AWESOME for satellite imagery. Nothing touches IDL for doing image
processing on our giant pixel counts. After a fashion I even like the
widget programming setup in IDL. It's more than worth it to get the
sweet
IDL functionality into our apps, instead of trying to ape this stuff
in C or another language.
My thanks to this group, whose collective tutelage and wisdom has
allowed me to
begin scratching the surface of this power.( And esp. to Dr Fanning
for
IDL Programming Techniques vol2., not to mention Ronn Kling's
Application book,
great stuff, that.)
So, for my RSI wish list 2003, add a field to the CellSelection Event
for clicked:[0,1,2]
Thanks!
dmarino
digitalglobe
"Pavel A. Romashkin" <pavel_romashkin@hotmail.com> wrote in message news:<3E15B9F2.CA6F2719@hotmail.com>...
> From all I heard here so far, some other interface would be much
> prefered by satellite image community. Table widgets (unless they
> changed drastically in 5.6) were pretty non-intuitive and (in my
> experience) did not look the same across platforms.
> Regarding the original question - correct me if I'm wrong, but draw
> widgets I think are the only ones that distinguish between left, mid and
> right mouse clicks. It would be nice if they added Shift and Alt
> clicks... I wouldn't have any other user inputs in my programs, then :-)
> Cheers,
> Pavel
>
> dmarino wrote:
>>
>> 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
|
|
|
Re: Table Widget Selection? [message #33443 is a reply to message #33439] |
Fri, 03 January 2003 08:27  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
From all I heard here so far, some other interface would be much
prefered by satellite image community. Table widgets (unless they
changed drastically in 5.6) were pretty non-intuitive and (in my
experience) did not look the same across platforms.
Regarding the original question - correct me if I'm wrong, but draw
widgets I think are the only ones that distinguish between left, mid and
right mouse clicks. It would be nice if they added Shift and Alt
clicks... I wouldn't have any other user inputs in my programs, then :-)
Cheers,
Pavel
dmarino wrote:
>
> 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
|
|
|