Adonthell  0.4
text_bubble.cc
Go to the documentation of this file.
1 /*
2  $Id: text_bubble.cc,v 1.7 2002/06/28 12:15:21 gnurou Exp $
3 
4  Copyright (C) 2001/2002 Kai Sterker <kaisterker@linuxgames.com>
5  Copyright (C) 2001 Alexandre Courbot <alexandrecourbot@linuxgames.com>
6  Part of the Adonthell Project http://adonthell.linuxgames.com
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 
17 /**
18  * @file text_bubble.cc
19  * @author Kai Sterker <kaisterker@linuxgames.com>
20  * @author Alexandre Courbot <alexandrecourbot@linuxgames.com>
21  *
22  * @brief Defines the text_bubble class.
23  *
24  *
25  */
26 
27 #include "nls.h"
28 #include "text_bubble.h"
29 #include "win_manager.h"
30 
31 text_bubble::text_bubble (const string & text, const string & textcolor,
32  const string & themename, u_int16 len) : win_label ()
33 {
34  remain = 75 + text.length () * 4;
35 
36  win_font * font = win_manager::get_font (textcolor);
37  win_theme * theme = win_manager::get_theme (themename);
38 
39  set_font (*font);
40  set_background (*theme);
41  set_border (*theme, win_border::MINI);
42 
43  label::resize (len, 0);
44  set_form (label::AUTO_HEIGHT);
45  set_text (nls::translate (text));
46  set_visible_border (true);
47  set_visible_background (true);
48  set_trans_background (true);
49  set_visible (true);
50  pack ();
51 }
52 
54 {
55 }
56 
58 {
59  if (win_label::update ())
60  {
61  remain--;
62  if (!remain) return false;
63  }
64  return true;
65 }