home *** CD-ROM | disk | FTP | other *** search
- #include "xw.h"
-
- /*-----
- */
-
- #include "xk.h"
- #include "xo.h"
- #include "xx.h"
-
- /*-----
- XWinMgr::msg
- affiche une boite de message
- */
-
- class MsgWin : public XWin
- {
- public :
- MsgWin (int wdt, int hgh, const char *hdr, const char *msg);
- };
-
- MsgWin::MsgWin (int wdt, int hgh, const char *hdr, const char *msg)
-
- : XWin(wdt + 8, hgh + 6)
-
- {
- XText * obj;
-
- if (hdr == 0)
- defw(xw_STDWIN & ~xw_HEADER);
- else
- head(hdr);
-
- link(new XBox(1, 1, 1, wdt + 4, hgh + 2, 0, 1));
- obj = (XText *)link(new XText(2, 2, 3, wdt, hgh, 0, 0));
- obj->defs(0, msg);
- }
-
- XWin * XWinMgr::msg (const char *hdr, const char *msg)
- {
- int wdt, hgh;
- MsgWin * win;
-
- if ((wdt = _smax(msg, '\n') + 2) > 70)
- wdt = 70;
- else if (wdt < 26)
- wdt = 26;
-
- if ((hgh = _scnt(msg, '\n') + 2) > 20)
- hgh = 20;
- else if (hgh < 3)
- hgh = 3;
-
- win = new MsgWin(wdt, hgh, hdr, msg);
- win->topw();
-
- return (win);
- }
-
-