00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "nls.h"
00028 #include "text_bubble.h"
00029 #include "win_manager.h"
00030
00031 text_bubble::text_bubble (const string & text, const string & textcolor,
00032 const string & themename, u_int16 len) : win_label ()
00033 {
00034 remain = 75 + text.length () * 4;
00035
00036 win_font * font = win_manager::get_font (textcolor);
00037 win_theme * theme = win_manager::get_theme (themename);
00038
00039 set_font (*font);
00040 set_background (*theme);
00041 set_border (*theme, win_border::MINI);
00042
00043 label::resize (len, 0);
00044 set_form (label::AUTO_HEIGHT);
00045 set_text (nls::translate (text));
00046 set_visible_border (true);
00047 set_visible_background (true);
00048 set_trans_background (true);
00049 set_visible (true);
00050 pack ();
00051 }
00052
00053 text_bubble::~text_bubble ()
00054 {
00055 }
00056
00057 bool text_bubble::update ()
00058 {
00059 if (win_label::update ())
00060 {
00061 remain--;
00062 if (!remain) return false;
00063 }
00064 return true;
00065 }