ScummVM API documentation
msgbox.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * aint32 with this program; if not, write to the Free Software
19  *
20  *
21  * Based on the original sources
22  * Faery Tale II -- The Halls of the Dead
23  * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24  */
25 
26 #ifndef SAGA2_MSGBOX_H
27 #define SAGA2_MSGBOX_H
28 
29 #include "saga2/grequest.h"
30 
31 namespace Saga2 {
32 
33 struct textPallete;
34 
35 //Modal Mode GameMode Object
36 
37 extern GameMode ModalMode;
38 
39 /* ===================================================================== *
40  ModalWindow --
41  * ===================================================================== */
42 
43 class SimpleWindow : public gWindow {
44 
45  GameMode *_prevModeStackPtr[kMax_Modes];
46  int _prevModeStackCtr;
47 
48 public:
49 
50  SimpleWindow(const Rect16 &r,
51  uint16 ident,
52  const char *title,
53  AppFunc *cmd);
54  ~SimpleWindow();
55 
56  bool isModal();
57  void update(const Rect16 &);
58  void draw(); // redraw the panel.
59  void drawClipped(gPort &port, const Point16 &offset, const Rect16 &r);
60  static void DrawOutlineFrame(gPort &port, const Rect16 &r, int16 fillColor);
61  static void writeWrappedPlaqText(gPort &port,
62  const Rect16 &r,
63  gFont *font,
64  int16 textPos,
65  textPallete &pal,
66  bool hiLite,
67  const char *msg, ...);
68 
69 };
70 
71 class SimpleButton : public gControl {
72  gWindow *_window;
73 public:
74  SimpleButton(gWindow &, const Rect16 &, const char *, uint16, AppFunc *cmd = NULL);
75 
76  void draw(); // redraw the panel.
77  void drawClipped(gPort &port, const Point16 &offset, const Rect16 &r);
78 
79 private:
80  bool activate(gEventType why); // activate the control
81  void deactivate();
82  bool pointerHit(gPanelMessage &msg);
83  void pointerDrag(gPanelMessage &msg);
84  void pointerRelease(gPanelMessage &msg);
85 };
86 
87 class ErrorWindow : public SimpleWindow {
88  static char _mbChs1Text[8];
89  static char _mbChs2Text[8];
90  static uint8 _numBtns;
91 public:
92 
93  static requestInfo _rInfo;
94  ErrorWindow(const char *msg, const char *btnMsg1, const char *btnMsg2);
95  ~ErrorWindow();
96  int16 getResult();
97  static APPFUNC(cmdMessageWindow);
98  static void ErrorModeSetup() {}
99  static void ErrorModeCleanup() {}
100  static void ErrorModeHandleTask() {}
101  static void ErrorModeHandleKey(short key, short);
102 
103 };
104 
105 int16 FTAMessageBox(const char *msg, const char *btnMsg1, const char *btnMsg2);
106 
107 } // end of namespace Saga2
108 
109 #endif
Definition: button.h:54
Definition: actor.h:32
Definition: gdraw.h:178
Definition: msgbox.h:71
Definition: panel.h:315
Definition: rect.h:42
Definition: fta.h:76
Definition: grequest.h:32
Definition: panel.h:218
Definition: gdraw.h:111
Definition: msgbox.h:87
Definition: rect.h:290
Definition: panel.h:406
Definition: msgbox.h:43