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
GUI_MSG_WINDOW_INIT!
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="waeberd" data-source="post: 3162" data-attributes="member: 10343"><p>Yes, I do!</p><p></p><p>Here's the whole OnAction / OnMessage part - sorry to bug you with this stuff.....</p><p></p><p>[code] public override void OnAction(Action action)</p><p> {</p><p> if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) </p><p> { </p><p> GUIWindowManager.PreviousWindow(); </p><p> return; </p><p> } </p><p> base.OnAction(action); </p><p> }</p><p></p><p> public override bool OnMessage(GUIMessage message)</p><p> {</p><p> switch ( message.Message )</p><p> {</p><p> case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:</p><p> // display application list</p><p> base.OnMessage(message);</p><p> DisplayApplications();</p><p> UpdateButtons();</p><p> return true;</p><p> </p><p> case GUIMessage.MessageType.GUI_MSG_CLICKED:</p><p> int iControl=message.SenderControlId;</p><p> if (iControl==(int)Controls.CONTROL_BTNVIEWASICONS)</p><p> {</p><p> // switch to next view</p><p> switch (currentView)</p><p> {</p><p> case View.VIEW_AS_LIST:</p><p> currentView=View.VIEW_AS_ICONS;</p><p> break;</p><p> case View.VIEW_AS_ICONS:</p><p> currentView=View.VIEW_AS_LARGEICONS;</p><p> break;</p><p> case View.VIEW_AS_LARGEICONS:</p><p> currentView=View.VIEW_AS_LIST;</p><p> break;</p><p> }</p><p> UpdateButtons();</p><p> ShowThumbPanel();</p><p> GUIControl.FocusControl(GetID,iControl);</p><p> }</p><p> else if (iControl==(int)Controls.CONTROL_THUMBS||iControl==(int)Controls.CONTROL_LIST)</p><p> {</p><p> // application or game-item was clicked....</p><p> GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED,GetID,0,iControl,0,0,null);</p><p> GUIGraphicsContext.SendMessage(msg); </p><p> int iItem=(int)msg.Param1;</p><p> int iAction=(int)message.Param1;</p><p> </p><p> if (iAction == (int)Action.ActionType.ACTION_SELECT_ITEM)</p><p> {</p><p> GUIListItem item = GetSelectedItem();</p><p> if( item.IsFolder )</p><p> {</p><p> if( item.Label.Equals( GameUtils.cBackLabel ) )</p><p> {</p><p> // "back" - item was clicked</p><p> if (lastApp != null)</p><p> {</p><p> // in gamescreen....</p><p> lastApp = null;</p><p> DisplayApplications();</p><p> }</p><p> else </p><p> {</p><p> // in appscreen....</p><p> // GUIWindowManager.PreviousWindow(); </p><p> }</p><p> }</p><p> else</p><p> {</p><p> // application-item was clicked</p><p> string strApp = item.Label;</p><p> DisplayGames(strApp);</p><p> }</p><p> }</p><p> else</p><p> {</p><p> // game item was clicked => launch it!</p><p> string strGame = item.Label;</p><p> if (lastApp != null) </p><p> {</p><p> lastApp.LaunchGame(strGame);</p><p> }</p><p> }</p><p> }</p><p> }</p><p> if (iControl==(int)Controls.CONTROL_BTNSORTBY)</p><p> {</p><p> // get next sort method...</p><p> OnSort();</p><p> GUIControl.FocusControl(GetID,iControl);</p><p> }</p><p> break;</p><p> }</p><p> return base.OnMessage( message );</p><p> }[/code]</p><p></p><p>sorry for long post.... & thanks!</p><p></p><p>& CHEERS! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /> </p><p></p><p>Daniel</p></blockquote><p></p>
[QUOTE="waeberd, post: 3162, member: 10343"] Yes, I do! Here's the whole OnAction / OnMessage part - sorry to bug you with this stuff..... [code] public override void OnAction(Action action) { if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) { GUIWindowManager.PreviousWindow(); return; } base.OnAction(action); } public override bool OnMessage(GUIMessage message) { switch ( message.Message ) { case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: // display application list base.OnMessage(message); DisplayApplications(); UpdateButtons(); return true; case GUIMessage.MessageType.GUI_MSG_CLICKED: int iControl=message.SenderControlId; if (iControl==(int)Controls.CONTROL_BTNVIEWASICONS) { // switch to next view switch (currentView) { case View.VIEW_AS_LIST: currentView=View.VIEW_AS_ICONS; break; case View.VIEW_AS_ICONS: currentView=View.VIEW_AS_LARGEICONS; break; case View.VIEW_AS_LARGEICONS: currentView=View.VIEW_AS_LIST; break; } UpdateButtons(); ShowThumbPanel(); GUIControl.FocusControl(GetID,iControl); } else if (iControl==(int)Controls.CONTROL_THUMBS||iControl==(int)Controls.CONTROL_LIST) { // application or game-item was clicked.... GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED,GetID,0,iControl,0,0,null); GUIGraphicsContext.SendMessage(msg); int iItem=(int)msg.Param1; int iAction=(int)message.Param1; if (iAction == (int)Action.ActionType.ACTION_SELECT_ITEM) { GUIListItem item = GetSelectedItem(); if( item.IsFolder ) { if( item.Label.Equals( GameUtils.cBackLabel ) ) { // "back" - item was clicked if (lastApp != null) { // in gamescreen.... lastApp = null; DisplayApplications(); } else { // in appscreen.... // GUIWindowManager.PreviousWindow(); } } else { // application-item was clicked string strApp = item.Label; DisplayGames(strApp); } } else { // game item was clicked => launch it! string strGame = item.Label; if (lastApp != null) { lastApp.LaunchGame(strGame); } } } } if (iControl==(int)Controls.CONTROL_BTNSORTBY) { // get next sort method... OnSort(); GUIControl.FocusControl(GetID,iControl); } break; } return base.OnMessage( message ); }[/code] sorry for long post.... & thanks! & CHEERS! :D Daniel [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
GUI_MSG_WINDOW_INIT!
Contact us
RSS
Top
Bottom