![]() |
|
|||||||
| SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Draw image on mouse rollover?
Hey guys,
What is the easiest way to draw a new image when you mouse over a menu item? I am looking at adding some icons to the main menu but I can't seem to get the code quite right. Thanks, |
|
#2
|
||||
|
||||
|
Quote:
Aloha, Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) |
|
#3
|
|||
|
|||
|
And in addition to what Mike said, you can also just use
Code:
- If Focused
+- true
+- Image1
+- false
+- Image2
Dirk |
|
#4
|
||||
|
||||
|
Or even easier if you want to display the image 'outside' of the menu item, with no need for manual focus detection or refreshing:... in each main menu Item widget have an attribute 'IconPath' with the path to the image, and use GetFocusContext() elsewhere to retrieve the icon path of the currently selected Menu item, and display the image. Refreshing is done automagically when focus changes
(my dynamic menus do something similar to this, as do any of the recordings/schedule menus) Code:
GetFocusContext() +-LoadImage(IconPath) +-IMAGE
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki Last edited by nielm; 03-04-2007 at 01:08 PM. |
|
#5
|
||||
|
||||
|
It depends on what you're trying to do. If you want an image to appear in an item when it has focus, use Dirk's solution. If you want an image to appear in a fixed place on the screen, but the image changes depending on which item has focus, use Neil's solution.
Note that all these suggestions assume that you have "Focus follows mouse movement" enabled in the Customize section of Detailed Setup. It's enabled by default (if I recall correctly) but be aware that these solutions don't detect mouseover per se, but rather the change of focus that (normally) follows the mouse.
__________________
-- Greg |
|
#6
|
||||
|
||||
|
Quote:
Aloha, Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) Last edited by MeInMaui; 03-04-2007 at 02:52 PM. |
|
#7
|
||||
|
||||
|
I can't say I've ever noticed any such delay. Redraw on focus changes seems pretty much instantaneous to me, without the need for explicit Refresh() calls. But that's just my subjective impression.
If you do call Refresh() or RefreshArea() from FocusGained or FocusLost hooks, be sure to Fork() first, as per Note 2 on p.7 of the V6 Studio manual.
__________________
-- Greg |
|
#8
|
|||
|
|||
|
Quote:
Interesting... I added an attribute to one of my menu items, Attribute: IconPath Value: images\menu_1_back.png But am getting a 'Syntax Error' on the "Value" field... The rest of it looks like so: Code:
GetFocusContext() +-LoadImage(IconPath) +-IMAGE |
|
#9
|
||||
|
||||
|
Quote:
and in Strings "\", have to be doubled (as they 'escape' other chars, so value should be: "images\\menu_1_back.png"
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
|
#10
|
|||
|
|||
|
Yup. That method works perfectly.
Thanks guys! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SageMC - Limited Mouse Control? | Fountainhead | SageMC Custom Interface | 1 | 02-11-2007 03:30 PM |
| Sage Bug | justindd | SageTV Linux | 5 | 01-30-2007 10:12 AM |
| Scaling Text widget size within image widget area | Morgan111 | SageTV Studio | 2 | 12-04-2006 02:16 PM |
| Use RC as mouse replacement | owilsky | Hardware Support | 2 | 12-03-2006 02:41 AM |
| Any EASY Way to Change The Background Image? | joe123 | SageTV Customizations | 2 | 01-26-2006 09:23 PM |