Re: changing colors of widget-buttons [message #54144] |
Fri, 25 May 2007 06:43  |
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   |
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 #54150 is a reply to message #54147] |
Fri, 25 May 2007 02:26   |
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 #54402 is a reply to message #54144] |
Tue, 12 June 2007 03:03  |
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
|
|
|