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!)
Create new Custom Dialog
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="mrinaljaiswal" data-source="post: 773612" data-attributes="member: 114781"><p>Hi,</p><p></p><p>Thanks for reply.</p><p></p><p>I did tried that, but what happens is that, it will work properly for first 2 times after that the dialog won't work or after the dialog is shown it will freez the mediaportal all toghter <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />.</p><p></p><p>Here is the code of my dialog</p><p>____________________________________________________________________________</p><p>using MediaPortal.Dialogs;</p><p>using MediaPortal.GUI.Library;</p><p></p><p>namespace Plugin1</p><p>{</p><p> /// <summary></p><p> /// </p><p> /// </summary></p><p> public class MyDlg : GUIDialogWindow</p><p> {</p><p> public enum ResultCode</p><p> {</p><p> Close,</p><p> Next,</p><p> Previous</p><p> } ;</p><p></p><p> [SkinControl(2)]</p><p> protected GUILabelControl lblHeading = null;</p><p> [SkinControl(4)]</p><p> protected GUILabelControl lblName = null;</p><p> [SkinControl(10)]</p><p> protected GUIButtonControl btnPlus = null;</p><p> [SkinControl(11)]</p><p> protected GUIButtonControl btnMin = null;</p><p> [SkinControl(12)]</p><p> protected GUIButtonControl btnOk = null;</p><p> [SkinControl(13)]</p><p> protected GUIButtonControl btnNextItem = null;</p><p> [SkinControl(14)]</p><p> protected GUIButtonControl btnPlay = null;</p><p> [SkinControl(15)]</p><p> protected GUIButtonControl btnPreviousItem = null;</p><p> [SkinControl(100)]</p><p> protected GUIImage imgStar1 = null;</p><p> [SkinControl(101)]</p><p> protected GUIImage imgStar2 = null;</p><p> [SkinControl(102)]</p><p> protected GUIImage imgStar3 = null;</p><p> [SkinControl(103)]</p><p> protected GUIImage imgStar4 = null;</p><p> [SkinControl(104)]</p><p> protected GUIImage imgStar5 = null;</p><p></p><p> private int rating = 1;</p><p> private string fileName;</p><p> private ResultCode resultCode;</p><p></p><p> public MyDlg()</p><p> {</p><p> GetID = 6789;</p><p> }</p><p></p><p> public override bool Init()</p><p> {</p><p> return Load(GUIGraphicsContext.Skin + @"\dialogRating.xml");</p><p> }</p><p></p><p> protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)</p><p> {</p><p> base.OnClicked(controlId, control, actionType);</p><p> if (control == btnOk)</p><p> {</p><p> PageDestroy();</p><p> resultCode = ResultCode.Close;</p><p> return;</p><p> }</p><p> if (control == btnNextItem)</p><p> {</p><p> PageDestroy();</p><p> resultCode = ResultCode.Next;</p><p> return;</p><p> }</p><p> if (control == btnPreviousItem)</p><p> {</p><p> PageDestroy();</p><p> resultCode = ResultCode.Previous;</p><p> return;</p><p> }</p><p> if (control == btnMin)</p><p> {</p><p> if (rating >= 1)</p><p> {</p><p> rating--;</p><p> }</p><p> UpdateRating();</p><p> return;</p><p> }</p><p> if (control == btnPlus)</p><p> {</p><p> if (rating < 5)</p><p> {</p><p> rating++;</p><p> }</p><p> UpdateRating();</p><p> return;</p><p> }</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> {</p><p> resultCode = ResultCode.Close;</p><p> base.OnMessage(message);</p><p> UpdateRating();</p><p> }</p><p> return true;</p><p> }</p><p></p><p> return base.OnMessage(message);</p><p> }</p><p></p><p> public void SetHeading(string strLine)</p><p> {</p><p> //LoadSkin();</p><p> AllocResources();</p><p> InitControls();</p><p></p><p> lblHeading.Label = strLine;</p><p> }</p><p></p><p> public void SetHeading(int iString)</p><p> {</p><p> if (iString == 0)</p><p> {</p><p> SetHeading(string.Empty);</p><p> }</p><p> else</p><p> {</p><p> SetHeading(GUILocalizeStrings.Get(iString));</p><p> }</p><p> }</p><p></p><p> public void SetTitle(string title)</p><p> {</p><p> //LoadSkin();</p><p> AllocResources();</p><p> InitControls();</p><p> lblName.Label = title;</p><p> }</p><p></p><p> }</p><p>}</p><p></p><p>Here is the code from where i am calling this dialog</p><p>__________________________________________________________________________</p><p></p><p> MyDlg obj = (MyDlg)GUIWindowManager.GetWindow(6789);</p><p> if (obj == null) return;</p><p> obj.Reset();</p><p> obj.SetHeading("Test"); </p><p> obj.DoModal(GetID);</p><p></p><p></p><p>Do you have any sample from where i get some help</p><p></p><p></p><p>Thanks,</p><p>Mrinal Jaiswal</p></blockquote><p></p>
[QUOTE="mrinaljaiswal, post: 773612, member: 114781"] Hi, Thanks for reply. I did tried that, but what happens is that, it will work properly for first 2 times after that the dialog won't work or after the dialog is shown it will freez the mediaportal all toghter :(. Here is the code of my dialog ____________________________________________________________________________ using MediaPortal.Dialogs; using MediaPortal.GUI.Library; namespace Plugin1 { /// <summary> /// /// </summary> public class MyDlg : GUIDialogWindow { public enum ResultCode { Close, Next, Previous } ; [SkinControl(2)] protected GUILabelControl lblHeading = null; [SkinControl(4)] protected GUILabelControl lblName = null; [SkinControl(10)] protected GUIButtonControl btnPlus = null; [SkinControl(11)] protected GUIButtonControl btnMin = null; [SkinControl(12)] protected GUIButtonControl btnOk = null; [SkinControl(13)] protected GUIButtonControl btnNextItem = null; [SkinControl(14)] protected GUIButtonControl btnPlay = null; [SkinControl(15)] protected GUIButtonControl btnPreviousItem = null; [SkinControl(100)] protected GUIImage imgStar1 = null; [SkinControl(101)] protected GUIImage imgStar2 = null; [SkinControl(102)] protected GUIImage imgStar3 = null; [SkinControl(103)] protected GUIImage imgStar4 = null; [SkinControl(104)] protected GUIImage imgStar5 = null; private int rating = 1; private string fileName; private ResultCode resultCode; public MyDlg() { GetID = 6789; } public override bool Init() { return Load(GUIGraphicsContext.Skin + @"\dialogRating.xml"); } protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { base.OnClicked(controlId, control, actionType); if (control == btnOk) { PageDestroy(); resultCode = ResultCode.Close; return; } if (control == btnNextItem) { PageDestroy(); resultCode = ResultCode.Next; return; } if (control == btnPreviousItem) { PageDestroy(); resultCode = ResultCode.Previous; return; } if (control == btnMin) { if (rating >= 1) { rating--; } UpdateRating(); return; } if (control == btnPlus) { if (rating < 5) { rating++; } UpdateRating(); return; } } public override bool OnMessage(GUIMessage message) { switch (message.Message) { case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: { resultCode = ResultCode.Close; base.OnMessage(message); UpdateRating(); } return true; } return base.OnMessage(message); } public void SetHeading(string strLine) { //LoadSkin(); AllocResources(); InitControls(); lblHeading.Label = strLine; } public void SetHeading(int iString) { if (iString == 0) { SetHeading(string.Empty); } else { SetHeading(GUILocalizeStrings.Get(iString)); } } public void SetTitle(string title) { //LoadSkin(); AllocResources(); InitControls(); lblName.Label = title; } } } Here is the code from where i am calling this dialog __________________________________________________________________________ MyDlg obj = (MyDlg)GUIWindowManager.GetWindow(6789); if (obj == null) return; obj.Reset(); obj.SetHeading("Test"); obj.DoModal(GetID); Do you have any sample from where i get some help Thanks, Mrinal Jaiswal [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Create new Custom Dialog
Contact us
RSS
Top
Bottom