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
Development
General Development (no feature request here!)
Imagecontrol is not set on Listcontrol focus change
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="edsche" data-source="post: 474484" data-attributes="member: 28762"><p>Hi community,</p><p></p><p>I have some problems to set an image in the OnMessage function. I have a listcontrol and a image control on my window and everytime i change the focus of the list control item, i set a property item with a filename of an image on my hard drive. In my skin file i use the property i set in my code. The problem is that, if i scroll down or up in the listcontrol, the image changes not everytime in the image control. Sometimes the image control changes to the right image and sometimes the image control is empty.</p><p></p><p>I use the following code:</p><p>[CODE]public override bool OnMessage(GUIMessage message)</p><p> {</p><p> switch (message.Message)</p><p> {</p><p></p><p> case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED:</p><p> {</p><p> int iControl = message.SenderControlId;</p><p> if (iControl == 50)</p><p> {</p><p></p><p> GUIListItem item = GUIControl.GetSelectedListItem(GetID, 50);</p><p> if (item != null)</p><p> {</p><p> foreach (Feed feed in FeedService.Feeds)</p><p> {</p><p> if (feed.Active)</p><p> {</p><p> GUIPropertyManager.SetProperty("#image", feed.FeedItems[listcontrol.SelectedListItemIndex].Enclosure);</p><p> break;</p><p> }</p><p> }</p><p> }</p><p> }</p><p> </p><p> }</p><p> break;</p><p> }</p><p> return base.OnMessage(message);</p><p> }[/CODE]</p><p></p><p>Hope someone can help me out :/</p><p></p><p>Greets edsche</p></blockquote><p></p>
[QUOTE="edsche, post: 474484, member: 28762"] Hi community, I have some problems to set an image in the OnMessage function. I have a listcontrol and a image control on my window and everytime i change the focus of the list control item, i set a property item with a filename of an image on my hard drive. In my skin file i use the property i set in my code. The problem is that, if i scroll down or up in the listcontrol, the image changes not everytime in the image control. Sometimes the image control changes to the right image and sometimes the image control is empty. I use the following code: [CODE]public override bool OnMessage(GUIMessage message) { switch (message.Message) { case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: { int iControl = message.SenderControlId; if (iControl == 50) { GUIListItem item = GUIControl.GetSelectedListItem(GetID, 50); if (item != null) { foreach (Feed feed in FeedService.Feeds) { if (feed.Active) { GUIPropertyManager.SetProperty("#image", feed.FeedItems[listcontrol.SelectedListItemIndex].Enclosure); break; } } } } } break; } return base.OnMessage(message); }[/CODE] Hope someone can help me out :/ Greets edsche [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Imagecontrol is not set on Listcontrol focus change
Contact us
RSS
Top
Bottom