NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 25 26 27 28 29 … 93 Next »
PopupMessageBox usage

 
  • 0 Vote(s) - 0 Average
PopupMessageBox usage
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#1
2009-01-20, 01:43 PM
How are you guys using the PopupMessageBox class? In a number of areas in my new plugin I need to ask a "Are you sure?" question. The response to this is that the handlePopupCallback method is called with the button caption eg "Yes". How are you guys determining what the orgional question was?

An example: Thre are 2 places the message box is used - one for delete one for copy - both have Yes/No options. When the handlePopupCallback is called with "Yes" as the button caption how do you know if this is the Delete popup or the Copy popup...?

I have a ideas but I just wanted to know what others are doing, avoid reinventing the wheel and all that... Smile
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
bgowland
Offline

Posting Freak

Posts: 4,535
Threads: 376
Joined: Dec 2004
#2
2009-01-20, 03:29 PM
I define my own classes based on PopupMessageBox, e.g.,
Code:
public class ScanChannelsPopup : GBPVRX2.Popups.PopupMessageBox
{
    public ScanChannelsPopup(IUiPopupCallback popupCallback, string message, string button1Command, string button2Command)
        : base(popupCallback, message, button1Command, button2Command)
    {
    }
}
In handlePopupCallback I test for popup type and act accordingly, e.g.,
Code:
if (popup is ScanChannelsPopup)
{
    setPopup(null);
    if (command == "Yes")
    {
        // Do whatever
        return;
    }
}
Cheers,
Brian
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#3
2009-01-20, 06:06 PM
That's how I use it as well.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Tuner status & disk usage mikaelgu 2 2,307 2017-04-10, 04:51 PM
Last Post: mikaelgu
  Derive class from PopupMessageBox? bgowland 2 1,043 2008-03-01, 04:39 AM
Last Post: bgowland
  tracking down high memory usage in skiptool pastro 32 5,638 2007-12-16, 10:40 PM
Last Post: JavaWiz
  popupmessagebox id pastro 3 1,320 2007-09-13, 08:09 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode