Code::Blocks
SVN r11506
include
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
>
29
typedef
wxPopupWindow
wxInfoWindowBase
;
30
#else
31
#include "
scrollingdialog.h
"
32
typedef
wxScrollingDialog
wxInfoWindowBase
;
33
#endif
34
35
#undef new
36
#include <list>
37
#include <algorithm>
38
39
class
DLLIMPORT
InfoWindow
:
public
wxInfoWindowBase
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
:
51
wxTimer
*
m_timer
;
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
wxMouseEvent
InfoWindow::status
unsigned int status
Definition:
infowindow.h:56
timer.h
wxTimer
string.h
InfoWindow::my_message_iterator
std::list< wxString >::iterator my_message_iterator
Definition:
infowindow.h:59
wxScrollingDialog
Definition:
scrollingdialog.h:163
scrollingdialog.h
event.h
InfoWindow::ks
unsigned int ks
Definition:
infowindow.h:58
InfoWindow::m_delay
unsigned int m_delay
Definition:
infowindow.h:57
InfoWindow::top
int top
Definition:
infowindow.h:53
DLLIMPORT
#define DLLIMPORT
Definition:
settings.h:16
InfoWindow::hMin
int hMin
Definition:
infowindow.h:54
InfoWindow::pos
int pos
Definition:
infowindow.h:55
wxPopupWindow
settings.h
wxString
InfoWindow::m_timer
wxTimer * m_timer
Definition:
infowindow.h:51
popupwin.h
InfoWindow
Definition:
infowindow.h:39
InfoWindow::left
int left
Definition:
infowindow.h:52
wxTimerEvent
wxInfoWindowBase
wxPopupWindow wxInfoWindowBase
Definition:
infowindow.h:29
Generated by
1.8.13