82 " X@5*#&>0ww0,&#*5@X ",
83 " +4*#-qppppppq:#*4+ ",
84 "X3:#:eppp##pppe:#:3X",
85 "+6#&qpppp##ppppq+",
86 "<,#,ppppp##ppppp,#,@",
87 "1=#9ppppp##ppppp0#=1",
88 "2&#wppppp##pppppw#&2",
89 "i&#wppppp##pppppw#&u",
90 "i=#9ppppp##ppppp0#=u",
91 "u,#>pppppppppppp>#,y",
92 "y8#&qpppp##ppppq$#8y",
93 "yr:#:eppp##pppe:#:rt",
94 "yy9*#:qppppppq:#*9yt",
95 "yyy7*#$>0ww0>&#*7ytt",
96 "ttyy9:########:9yytt",
97 "ttttyr8,=&&=,8ryyttt",
98 "ttttyyyyiuuuuyyyyttt" 105 std::list<int> widths;
109 int StackMe(
int mySize)
115 pos = *(std::max_element(widths.begin(), widths.end()));
117 widths.push_back(pos + mySize);
121 void ReleaseMe(
int myPos)
123 std::list<int>::iterator it = std::find(widths.begin(), widths.end(), myPos);
124 if(it != widths.end())
129 static Stacker stacker;
131 static std::list<wxString> active_messages;
132 static unsigned lastDisplay = std::numeric_limits<unsigned>::max();
133 static wxRect displayGeometry;
142 static const int scroll_millis = platform::windows ? 1 : 5;
148 DECLARE_EVENT_TABLE();
150 ForwardingTextControl(
wxWindow* parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0) :
wxStaticText(parent, id, label, pos, size, style){};
164 m_timer(
new wxTimer(
this, 0)), status(0), m_delay(delay), ks(2)
166 my_message_iterator = active_messages.insert(active_messages.begin(), message);
192 titleC->SetForegroundColour(*
wxWHITE);
211 GetClientSize(&w, &h);
213 pos = stacker.StackMe(w);
217 if (displayNo != lastDisplay)
222 displayGeometry = displayGeometry.
Intersect(area);
223 lastDisplay = displayNo;
226 left = displayGeometry.
x + displayGeometry.width - pos;
227 hMin = displayGeometry.GetBottom() - h;
228 top = displayGeometry.GetBottom();
233 m_timer->Start(hysteresis,
false);
240 stacker.ReleaseMe(pos);
242 active_messages.erase(my_message_iterator);
251 m_timer->Start(scroll_millis,
false);
259 m_timer->Start(m_delay,
true);
264 m_timer->Start(scroll_millis,
false);
269 if(top > displayGeometry.GetBottom())
283 m_timer->Start(m_delay,
true);
290 m_timer->Start(scroll_millis,
false);
296 if (std::find(active_messages.begin(), active_messages.end(), message) != active_messages.end())
298 const wxString dups =
_T(
"Multiple information windows with the same\nmessage have been suppressed.");
299 if (std::find(active_messages.begin(), active_messages.end(), dups) == active_messages.end())
300 Display(
_T(
"Info"), dups, delay);
303 new InfoWindow(title, message, delay, hysteresis);
static void Display(const wxString &title, const wxString &message, unsigned int delay=5000, unsigned int hysteresis=1)
const wxColour textForeground(0, 0, 0)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
void OnTimer(wxTimerEvent &e)
const wxColour textBackground(255, 255, 160)
const wxColour titleBackground(96, 96, 96)
void OnClick(wxMouseEvent &e)
wxRect GetClientArea() const
void OnMove(wxMouseEvent &e)
void OnEvent(wxMouseEvent &e)
wxRect GetGeometry() const
wxSizerItem * Add(wxWindow *window, const wxSizerFlags &flags)
#define wxWS_EX_TRANSIENT
const wxSize wxDefaultSize
const wxPoint wxDefaultPosition
ForwardingTextControl(wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
static int GetFromWindow(const wxWindow *win)
void SetSizeHints(wxWindow *window)
wxRect & Intersect(const wxRect &rect)