home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Try controls with focus.... please help me
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="cybrmage" data-source="post: 243698" data-attributes="member: 51680"><p>There are a number of ways you can do this...</p><p></p><p>You can try something like this:</p><p>[code]</p><p>GUIWindow cWindow;</p><p>int cID;</p><p>string ButtonText;</p><p></p><p>cWindow = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindowEx);</p><p>cID = cWindow.GetFocusControlId();</p><p>ButtonText = ((GUIButtonControl)cWindow.controlList[cID]).Label;</p><p>[/code]</p><p></p><p>Keep in mind, however, that each window is composed of a variety of different components, not just button controls. Also, context menus are not of type GUIWindow... so you will need to have some code that will be much more discriminating.</p><p></p><p>The other way to do it, although it doesn't always give acurate data (it depends on the window that is active setting the property), is something like:</p><p></p><p>[code]</p><p>string ButtonText;</p><p>ButtonText = GUIPropertyManager.GetProperty("#highlightedbutton");</p><p>[/code]</p><p></p><p>Both methods work... the second is easier... but you will need to use a variation of the first method to get the focused button for any dialog box or context menu.</p><p></p><p>Hope that get you going in the right direction</p></blockquote><p></p>
[QUOTE="cybrmage, post: 243698, member: 51680"] There are a number of ways you can do this... You can try something like this: [code] GUIWindow cWindow; int cID; string ButtonText; cWindow = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindowEx); cID = cWindow.GetFocusControlId(); ButtonText = ((GUIButtonControl)cWindow.controlList[cID]).Label; [/code] Keep in mind, however, that each window is composed of a variety of different components, not just button controls. Also, context menus are not of type GUIWindow... so you will need to have some code that will be much more discriminating. The other way to do it, although it doesn't always give acurate data (it depends on the window that is active setting the property), is something like: [code] string ButtonText; ButtonText = GUIPropertyManager.GetProperty("#highlightedbutton"); [/code] Both methods work... the second is easier... but you will need to use a variation of the first method to get the focused button for any dialog box or context menu. Hope that get you going in the right direction [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Try controls with focus.... please help me
Contact us
RSS
Top
Bottom