Code::Blocks  SVN r11506
infowindow.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 /*
7  * Objects of type InfoWindow are autonomous and must therefore always be instantiated using operator new.
8  * In addition to this, InfoWindow does not have any non-static public class members.
9  *
10  * Since a (technically 100% correct) statement like
11  * new InfoWindow("foo", "bar");
12  * is unintuitive, confusing or even objective to some people, this class uses a variation of the "Named Constructor Idiom".
13  *
14  * InfoWindow::Display("foo", "bar");
15  * does the exact same thing as the above statement but looks a lot nicer.
16  */
17 
18 #ifndef INFOWINDOW_H
19 #define INFOWINDOW_H
20 
21 #include <wx/event.h>
22 #include <wx/timer.h>
23 #include <wx/string.h>
24 
25 #include "settings.h" // DLLIMPORT
26 
27 #if wxUSE_POPUPWIN
28  #include <wx/popupwin.h>
30 #else
31  #include "scrollingdialog.h"
33 #endif
34 
35 #undef new
36 #include <list>
37 #include <algorithm>
38 
40 {
41  InfoWindow(const wxString& title, const wxString& message, unsigned int delay, unsigned int hysteresis);
42  ~InfoWindow() override;
43  void OnTimer(wxTimerEvent& e);
44  void OnMove(wxMouseEvent& e);
45  void OnClick(wxMouseEvent& e);
46 
47  public:
48  static void Display(const wxString& title, const wxString& message,
49  unsigned int delay = 5000, unsigned int hysteresis = 1);
50  private:
52  int left;
53  int top;
54  int hMin;
55  int pos;
56  unsigned int status;
57  unsigned int m_delay;
58  unsigned int ks;
59  std::list<wxString>::iterator my_message_iterator;
60  private:
61  DECLARE_EVENT_TABLE()
62 };
63 
64 #endif
unsigned int status
Definition: infowindow.h:56
std::list< wxString >::iterator my_message_iterator
Definition: infowindow.h:59
unsigned int ks
Definition: infowindow.h:58
unsigned int m_delay
Definition: infowindow.h:57
#define DLLIMPORT
Definition: settings.h:16
wxTimer * m_timer
Definition: infowindow.h:51
wxPopupWindow wxInfoWindowBase
Definition: infowindow.h:29