Bochs/bochs/gui/wxdialog.h

59 lines
2.1 KiB
C
Raw Normal View History

////////////////////////////////////////////////////////////////////
// $Id: wxdialog.h,v 1.1 2002-08-28 03:20:23 bdenney Exp $
////////////////////////////////////////////////////////////////////
//
// wxWindows dialogs for Bochs
////////////////////////////////////////////////////////////////////
// LogMsgAskDialog is a modal dialog box that shows the user a
// simulation error message and asks if they want to continue or
// not. It looks something like this:
// -------------------------------------------------------------
// Context: Hard Drive
// Message: could not open hard drive image file '30M.sample'
//
// [ ] Don't ask about future messages like this
//
// [Continue] [Die] [Dump Core] [Debugger] [Help]
// -------------------------------------------------------------
// To use this dialog:
// After constructor, use SetContext, SetMessage, EnableButton to
// determine what will be displayed. Then call n = ShowModal(). The return
// value tells which button was pressed (button_t types). Call GetDontAsk()
// to see if they checked "Don't ask about..." or not.
//////////////////////////////////////////////////////////////////////
class LogMsgAskDialog: public wxDialog
{
public:
enum button_t {
CONT=0, DIE, DUMP, DEBUG, HELP,
N_BUTTONS /* number of entries in enum */
};
#define LOG_MSG_ASK_IDS \
{ ID_Continue, ID_Die, ID_DumpCore, ID_Debugger, ID_Help }
#define LOG_MSG_ASK_NAMES \
{ "Continue", "Die", "Dump Core", "Debugger", "Help" }
#define LOG_MSG_DONT_ASK_STRING \
"Don't ask about future messages like this"
private:
wxStaticText *context, *message;
wxCheckBox *dontAsk;
bool enabled[N_BUTTONS];
wxBoxSizer *btnSizer, *vertSizer;
void Init (); // called automatically by ShowModal()
void showHelp ();
public:
LogMsgAskDialog(wxWindow* parent,
wxWindowID id,
const wxString& title);
void EnableButton (button_t btn, bool en) { enabled[(int)btn] = en; }
void SetContext (char *s);
void SetMessage (char *s);
bool GetDontAsk () { return dontAsk->GetValue (); }
void OnEvent (wxCommandEvent& event);
int ShowModal() { Init(); return wxDialog::ShowModal(); }
DECLARE_EVENT_TABLE()
};