comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: changing colors of widget-buttons
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: changing colors of widget-buttons [message #54144] Fri, 25 May 2007 06:43 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
BavarianMike86 writes:

> Well, You are a professional.
> IDL is the first programming language I ever used ;-)
>
> On my Windows-machine Jackson's routine worked fine.
> But on the Linux PC nothing happened.

Find the WINDOW command in the program and set the RETAIN=2
keyword.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: changing colors of widget-buttons [message #54145 is a reply to message #54144] Fri, 25 May 2007 06:42 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
BavarianMike86 writes:

> Well. You are a professional.
> IDL is the first programming language I ever used ;-)

Well, you are WAY too kind! :-)

But find this line:

Erase, Color=Total(sysColors.Face_3D * [1, 256, 65536L])

And change sysColors.Face_3D to a three-element array, specifying
any color you like. For example, yellow:

Erase, Color=Total([255,255,0]* [1, 256, 65536L])

Or, green:

Erase, Color=Total([0,255,0]* [1, 256, 65536L])

I just created a BGCOLOR keyword so I could specify the
color I wanted when I called the function.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: changing colors of widget-buttons [message #54146 is a reply to message #54145] Fri, 25 May 2007 06:40 Go to previous messageGo to next message
BavarianMike86 is currently offline  BavarianMike86
Messages: 9
Registered: May 2007
Junior Member
David writes:
> Well, I would just modify Dick Jackson's little routine
> BitmapForButtonText that is described in that article to
> allow any background color you like for the button. It took
> me less than 30 seconds to make the change. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Well, You are a professional.
IDL is the first programming language I ever used ;-)

On my Windows-machine Jackson's routine worked fine.
But on the Linux PC nothing happened.
Re: changing colors of widget-buttons [message #54147 is a reply to message #54146] Fri, 25 May 2007 06:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
BavarianMike86 writes:

> Obviously I wasn't able to explain my problem accurately. Sorry. I
> still have problems writing in English.
> These "buttons" must not to be sensitive. These "buttons" shall be
> some kind of status bar showing which functions were already executed.
> There are just two sensitive buttons: "start" and "quit". The other
> ones just show what was done.

Well, I would just modify Dick Jackson's little routine
BitmapForButtonText that is described in that article to
allow any background color you like for the button. It took
me less than 30 seconds to make the change. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: changing colors of widget-buttons [message #54150 is a reply to message #54147] Fri, 25 May 2007 02:26 Go to previous messageGo to next message
BavarianMike86 is currently offline  BavarianMike86
Messages: 9
Registered: May 2007
Junior Member
David writes:
> I typically use a draw widget that is made to look and act
> like a button. That is to say, it is a compound widget with
> a function event handler. I take the draw widget event into
> the event handler, and repackage it as a button event, so
> the end-user can treat it as a button and not a draw widget.
>
> When the button is "selected", I either change the colors
> I draw the button with, or I reverse the edge/shadow/normal
> colors so that it has a "depressed" look to it.
>
> http://www.dfanning.com/widget_tips/depressed.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")


Obviously I wasn't able to explain my problem accurately. Sorry. I
still have problems writing in English.
These "buttons" must not to be sensitive. These "buttons" shall be
some kind of status bar showing which functions were already executed.
There are just two sensitive buttons: "start" and "quit". The other
ones just show what was done.
I hope my problem is clearer now.

Greetings,
Michael
Re: changing colors of widget-buttons [message #54153 is a reply to message #54150] Thu, 24 May 2007 23:40 Go to previous messageGo to next message
Robbie is currently offline  Robbie
Messages: 165
Registered: February 2006
Senior Member
Is there an implementation of a button using widget_draw lying around
or is that left as an exercise for the reader?

Robbie

P.S. Code available at http://barnett.id.au/idl/ (But that would be
cheating)
Re: changing colors of widget-buttons [message #54177 is a reply to message #54153] Thu, 24 May 2007 07:59 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
BavarianMike86 writes:

> We have written several programs which analyse image files. E.g.
> "Saturation Check" or "Aux. Data Check".
> The main program executes these analyses consecutively.
>
> Now I want to create a widget showing the current analysis status.
> The requirements demand a yellow (non-sensitive) button for each
> check. After one check is completed this button has to turn into light-
> colored yellow.
>
> Any suggestions how i can accomplish this?

I typically use a draw widget that is made to look and act
like a button. That is to say, it is a compound widget with
a function event handler. I take the draw widget event into
the event handler, and repackage it as a button event, so
the end-user can treat it as a button and not a draw widget.

When the button is "selected", I either change the colors
I draw the button with, or I reverse the edge/shadow/normal
colors so that it has a "depressed" look to it.

http://www.dfanning.com/widget_tips/depressed.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: changing colors of widget-buttons [message #54239 is a reply to message #54144] Fri, 25 May 2007 08:37 Go to previous messageGo to next message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
"David Fanning" <news@dfanning.com> wrote in message
news:MPG.20c095f72eae5677989fbe@news.frii.com...
> BavarianMike86 writes:
>
>> Well, You are a professional.
>> IDL is the first programming language I ever used ;-)
>>
>> On my Windows-machine Jackson's routine worked fine.
>> But on the Linux PC nothing happened.
>
> Find the WINDOW command in the program and set the RETAIN=2
> keyword.



These threads make me real happy I do (almost) all my gui programming
in labview. :)

Cheers,
bob

PS Sorry for the non-useful post.
Re: changing colors of widget-buttons [message #54402 is a reply to message #54144] Tue, 12 June 2007 03:03 Go to previous message
BavarianMike86 is currently offline  BavarianMike86
Messages: 9
Registered: May 2007
Junior Member
Finally I'm back from vacation. So we can go on working on this
program.
I have written a completly new one and approach the task in an other
way because I was not satisfied with the coloured buttons.
Pressing the "START"-button the program below executes consecutively
several programs:
FITS integrity ckeck
SNR estimation
Saturation check
Aux. data check

After a check was done the corresponding label initally printing
"----" shall print "DONE"

My question:
How can I change the values of the widgetLabels "check1-8"
consecutively from "----" to "DONE" ?
I have already tried for example:
WIDGET_CONTROL, "uservalue", SET_VALUE="DONE"
But apparently it isn't that easy. Is it?
Read the comments of QUICKLOOK_EVENT to see my problem

Greetings,
Michael



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

PRO quicklook_event, event

WIDGET_CONTROL, event.ID, GET_UVALUE=uval
IF (uval EQ 'start') THEN BEGIN

; run FITS integrity ckeck
; How to address Widget_Label "check1" and set value
from "----" to "DONE"

; run SNR estimation
; How to address Widget_Label "check2" and set value
from "----" to "DONE"

; run Saturation check
; How to address Widget_Label "check3" and set value
from "----" to "DONE"

; run Aux. data check
; How to address Widget_Label "check4" and set value
from "----" to "DONE"
ENDIF

IF (uval EQ 'quit') THEN BEGIN
WIDGET_CONTROL, event.TOP, /DESTROY
ENDIF

END






PRO QUICKLOOK

tlb = WIDGET_BASE(/COLUMN, TITLE='IQLAC Quicklook Standalone')
start = WIDGET_BUTTON(tlb, UVALUE='start', VALUE='Start', FRAME=4, /
ALIGN_CENTER)

SCA = WIDGET_BASE(tlb, /ROW)

SCA_A_title = WIDGET_BASE(SCA, /COLUMN, FRAME=4)
title_A = WIDGET_LABEL(SCA_A_title, VALUE='SCA-A', /ALIGN_CENTER)
SCA_A_base = WIDGET_BASE(SCA_A_title, /ROW, FRAME=1)
SCA_A_base1 = WIDGET_BASE(SCA_A_base, /COLUMN)
SCA_A_base2 = WIDGET_BASE(SCA_A_base, /COLUMN)

SCA_B_title = WIDGET_BASE(SCA, /COLUMN, FRAME=4)
title_B = WIDGET_LABEL(SCA_B_title, VALUE='SCA-B', /ALIGN_CENTER)
SCA_B_base = WIDGET_BASE(SCA_B_title, /ROW, FRAME=1)
SCA_B_base1 = WIDGET_BASE(SCA_B_base, /COLUMN)
SCA_B_base2 = WIDGET_BASE(SCA_B_base, /COLUMN)

wBtn1 = WIDGET_LABEL(SCA_A_base1, UVALUE='wBtn1', FRAME=1,
SCR_XSIZE=150, VALUE='FITS integrity ckeck')
wBtn2 = WIDGET_LABEL(SCA_A_base1, UVALUE='wBtn2', FRAME=1,
SCR_XSIZE=150, VALUE='SNR estimation')
wBtn3 = WIDGET_LABEL(SCA_A_base1, UVALUE='wBtn3', FRAME=1,
SCR_XSIZE=150, VALUE='Saturation check')
wBtn4 = WIDGET_LABEL(SCA_A_base1, UVALUE='wBtn4', FRAME=1,
SCR_XSIZE=150, VALUE='Aux. data check')
check1 = WIDGET_LABEL(SCA_A_base2, UVALUE='check1', FRAME=1,
VALUE='----')
check2 = WIDGET_LABEL(SCA_A_base2, UVALUE='check2', FRAME=1,
VALUE='----')
check3 = WIDGET_LABEL(SCA_A_base2, UVALUE='check3', FRAME=1,
VALUE='----')
check4 = WIDGET_LABEL(SCA_A_base2, UVALUE='check4', FRAME=1,
VALUE='----')

wBtn5 = WIDGET_LABEL(SCA_B_base1, UVALUE='wBtn5', FRAME=1,
SCR_XSIZE=150, VALUE='FITS integrity ckeck')
wBtn6 = WIDGET_LABEL(SCA_B_base1, UVALUE='wBtn6', FRAME=1,
SCR_XSIZE=150, VALUE='SNR estimation')
wBtn7 = WIDGET_LABEL(SCA_B_base1, UVALUE='wBtn7', FRAME=1,
SCR_XSIZE=150, VALUE='Saturation check')
wBtn8 = WIDGET_LABEL(SCA_B_base1, UVALUE='wBtn8', FRAME=1,
SCR_XSIZE=150, VALUE='Aux. data check')
check5 = WIDGET_LABEL(SCA_B_base2, UVALUE='check5', FRAME=1,
VALUE='----')
check6 = WIDGET_LABEL(SCA_B_base2, UVALUE='check6', FRAME=1,
VALUE='----')
check7 = WIDGET_LABEL(SCA_B_base2, UVALUE='check7', FRAME=1,
VALUE='----')
check8 = WIDGET_LABEL(SCA_B_base2, UVALUE='check8', FRAME=1,
VALUE='----')

quit = WIDGET_BUTTON(tlb, UVALUE='quit', VALUE='Quit', /ALIGN_CENTER)

WIDGET_CONTROL, tlb, /REALIZE
XMANAGER, 'quicklook', tlb

END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Color Tools Update for 24-bit Z-Buffer
Next Topic: Re: Need hint to use FOR loops using 3-D arrays

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:16:36 PDT 2025

Total time taken to generate the page: 0.00628 seconds