Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 10:27 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Dec 16, 2010 1:57 pm 
Offline

Joined: Mon Mar 19, 2007 8:56 am
Posts: 21
Is it possible to add the blinking capability found in the LabelV2 component to other components. Specifically I would like to add it to the IconButtonV2.

Thanks.


Top
 Profile  
 
PostPosted: Thu Dec 16, 2010 3:05 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
The easiest way would be to add a timer_v2 object to the same screen as the button, then in the timer's timeout event add code like

Code:
func timeout()
    iconbutton_1.transparent = not iconbuton_1.transparent
endfunc


This will cause the background of the button to appear and disappear. You could also make it flash between two different colors by changing the bgcolor property of the button like

Code:
func timeout()
    if iconButton_1.bgColor == clr_buttonbackground then
        iconbutton_1.bgColor  = 224
    else
        iconbutton_1.bgColor = clr_buttonbackground
    endif
endfunc


There are harder methods that involve actually editing the source code to IconButtonV2 which we can go into if these don't meet your needs, but hopefully this does as it is much simpler to write.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Fri Dec 17, 2010 7:45 am 
Offline

Joined: Mon Mar 19, 2007 8:56 am
Posts: 21
Jeremy wrote:
The easiest way would be to add a timer_v2 object to the same screen as the button, then in the timer's timeout event add code like

Code:
func timeout()
    iconbutton_1.transparent = not iconbuton_1.transparent
endfunc


This will cause the background of the button to appear and disappear. You could also make it flash between two different colors by changing the bgcolor property of the button like

Code:
func timeout()
    if iconButton_1.bgColor == clr_buttonbackground then
        iconbutton_1.bgColor  = 224
    else
        iconbutton_1.bgColor = clr_buttonbackground
    endif
endfunc


There are harder methods that involve actually editing the source code to IconButtonV2 which we can go into if these don't meet your needs, but hopefully this does as it is much simpler to write.




Is one way more processor intensive than the other?


Top
 Profile  
 
PostPosted: Fri Dec 17, 2010 8:00 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Those two that I suggested are nearly identical in processing power, it is more which flavor you like better. I personally would choose the bgcolor version. Neither one should be a significant draw in processing capabilities of the terminal.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group