msgbox.h 957 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef __MESSAGEBOX_H
  2. #define __MESSAGEBOX_H
  3. #include <bfc/string/bfcstring.h>
  4. #include <bfc/string/StringW.h>
  5. #include <bfc/ptrlist.h>
  6. #define MSGBOX_ABORTED 0 // NOT a flag, only a return code
  7. #define MSGBOX_OK 1
  8. #define MSGBOX_CANCEL 2
  9. #define MSGBOX_YES 4
  10. #define MSGBOX_NO 8
  11. #define MSGBOX_ALL 16
  12. #define MSGBOX_NEXT 32
  13. #define MSGBOX_PREVIOUS 64
  14. class GuiObject;
  15. class SkinWnd;
  16. typedef struct {
  17. wchar_t *txt;
  18. int id;
  19. } _btnstruct;
  20. class MsgBox {
  21. public:
  22. MsgBox(const wchar_t *text, const wchar_t *title=L"Alert", int flags=MSGBOX_OK, const wchar_t *notanymore=NULL);
  23. virtual ~MsgBox();
  24. virtual int run();
  25. private:
  26. void createButtons();
  27. int reposButtons();
  28. void addButton(const wchar_t *text, int retcode);
  29. StringW text, title;
  30. int flags;
  31. PtrList<GuiObject> buttons;
  32. GuiObject *checkbox;
  33. SkinWnd *sw;
  34. StringW notanymore_id;
  35. };
  36. #endif