Re: (Lisp-HUG) Push Button Background Color...
At 03:08 AM 1/7/2010, you wrote:
>Jack Harper wrote on Wed, 06 Jan 2010 16:37:34 -0700 02:37:
>
>| Amazing to me that MicroSoft would leave out such a fundamental thing.
....and then Dmitriy said:
>This thing is not such a fundamental IMHO. Button color different from
>standard/theme-imposed is a kind poor style and violates general GUI design
>principles.
>
>Though, with the advert of lots of ugly designed websites that seems to
>become more and more tolerable :-(
>--
>Sincerely,
>Dmitriy Ivanov
>lisp.ystok.ru
Sorry for the delay in responding to people that commented on my
question "Push Button Background Color".
I had abdominal surgery this past Friday which really knocked me down
a bit. The Good News is that the Docs used a laproscopic technique
that minimized the chopping and hacking. But, I still feel like I
was shot in the gut :( Hooray for the narcotic/pain-killer
"Vicodin" :)))
Dmitriy - You are clearly correct in your statement. However, I use
Lisp to build embedded soft-realtime systems where I don't want the
system to look like MicroSoft Windows at all - more like an iPhone in
this case. My application is controlled with a built-in touchscreen
and so I need active things other than Windows-styled buttons (I use
"Windows XP Embedded" booting out of flash memory rather than
straight "Windows XP").
Please see http://www.secureoutcomes.net/livescan-products.html for
the embedded system - written completely in LW Common Lisp (along
with CLOS, CAPI & Friends).
"Laughing Water" suggested (Thank You!) that I use :image buttons to
do what I need to do - which is when a text "button" is pressed on
the touchscreen, that the button-thing flash a different color (Blue)
for, say, 100-milliseconds so the user knows that the button really activated.
I have tried that and it works well with one exception - I do not see
the "flash" :image button unless I inject a (capi:display-message
"XXX") while the flash button is active. I can replace the
(capi:display-message) with a (sleep 5) and I *still* do not see the
flash image button (the Sleep should allow the various processes
associated with the other buttons etc to run - just as does the
(capi:display-message) - but "something" is *very* different between the two).
I have defined two buttons - one is :text that normally shows. The
:callback for the :text button (capi:hide-pane )'s itself and then
(capi:show-pane)'s the "flash" button through its process which is
the same size and has the exact same (X, Y) coordinates on the
layout/interface. It then waits 100-milliseconds and then reverses
the sequence to bring the :text button back up and to hide the
"Flash" button...
I have taken the relevant code out of the production code and
produced the following simple snippet:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(defun test-button()
(let* ((solid-blue-button (make-instance
'capi:push-button ; Solid-Blue
:Image Button for the "flash". It lives "under" the :text button.
:x 50 :y 50
:text nil
:image "d:/ls1100
runtime/bilder/solid-blue-image.bmp" ; This is a 50x60 pixel blue .bmp file
:external-min-width 50
:external-max-width 50
:external-min-height 60
:external-max-height 60))
(button (make-instance
'capi:push-button
; Text Button "Q" - It usually lives on top of the Hidden :image button...
:x 50 :y
50
; Coordinates are the same as for the Flash button above...
:text "Q"
:image nil
:external-min-width 50
:external-max-width 50
:external-min-height 60
:external-max-height 60
:font (gp:make-font-description
:family "Eurostyle Regular/Black"
:size 36
:weight
:medium
:slant :roman)
:callback-type :item
:selection-callback
; On Button Press...
#'(lambda( self )
(capi:hide-pane
self) ; Text
Button Hides Itself...
(capi:apply-in-pane-process
solid-blue-button ; ...then Shows the Flash button...
'capi:show-pane
solid-blue-button)
(capi:display-message
"Barf");;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;COMMENT
OUT TO FAIL....... WILL SEE NO BLUE FLASH...
(sleep
0.100)
; Hangs around for awhile...
(capi:apply-in-pane-process
solid-blue-button ; Hides the Blue Flash Button...
'capi:hide-pane
solid-blue-button)
(capi:show-pane
self)))) ; Re-Shows
the Text Button... ...and all is as it was...
(layout (make-instance 'capi:pinboard-layout
:width 100
:height 100
:description
(list button
solid-blue-button)))
(interface (make-instance 'capi:interface
:best-width 100
:best-height 100
:layout layout)))
(capi:display
interface)))
; Activate the button...
-----------------------------------------------------------------------------------------------------------------------------
The interesting thing - and hangup - is that if you run the above
code (you will need that 50x60 pixel blue .bmp file), you will see
the blue "flash" when you press the button. But, if you comment out
the (capi:display-message) and rely solely on the (sleep 0.100), you
do NOT see the blue "flash".
Thoughts???
What am I doing wrong in my narcotic-induced haze??
I appreciate any feedback.
Regards to the List,
Jack Harper
Secure Outcomes Inc
http://www.secureoutcomes.net
ps - If you know someone looking for a Lisp development position,
please ask them to look at
http://www.secureoutcomes.net/employment.html - direct hire or contract...