src/widget/window_events.hpp
author KUDr
Thu, 01 Mar 2007 22:48:46 +0000
branchcpp_gui
changeset 6271 0ad100a98853
parent 6264 9fc3b5467396
child 6278 c09f5e53af9b
permissions -rw-r--r--
(svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
-Codechange: Button now releases itself and generates EvtClick event when mouse button is released
6264
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     1
/* $Id$ */
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     2
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     3
#ifndef WINDOW_EVENT_H
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     4
#define WINDOW_EVENT_H
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     5
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     6
namespace gui {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     7
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     8
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
     9
template <> struct EventT<EVT_CREATE> : public EventBaseT<EVT_CREATE, &Widget::OnCreate> {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    10
};
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    11
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    12
template <> struct EventT<EVT_DESTROY> : public EventBaseT<EVT_DESTROY, &Widget::OnDestroy> {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    13
};
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    14
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    15
template <> struct EventT<EVT_PAINT> : public EventBaseT<EVT_PAINT, &Widget::OnPaint> {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    16
};
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    17
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    18
template <> struct EventT<EVT_KEYPRESS> : public EventBaseT<EVT_KEYPRESS, &Widget::OnKeyPress> {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    19
	bool   m_cont;     // continue the search? (default true)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    20
	uint16 m_key;      // 16-bit Unicode value of the key
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    21
	uint16 m_keycode;  // untranslated key (including shift-state)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    22
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    23
	EventT(bool cont, uint16 key, uint16 keycode)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    24
		: m_cont(cont)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    25
		, m_key(key)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    26
		, m_keycode(keycode)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    27
	{}
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    28
};
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    29
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    30
template <> struct EventT<EVT_CLICK> : public EventBaseT<EVT_CLICK, &Widget::OnLeftClick> {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    31
	Point m_pt;
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    32
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    33
	EventT(const PointRaw &pt)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    34
		: m_pt(pt)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    35
	{}
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    36
};
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    37
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    38
template <> struct EventT<EVT_RCLICK> : public EventBaseT<EVT_RCLICK, &Widget::OnRightClick> {
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    39
	Point m_pt;
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    40
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    41
	EventT(const PointRaw &pt)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    42
		: m_pt(pt)
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    43
	{}
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    44
};
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    45
6271
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    46
template <> struct EventT<EVT_MOUSEOVER> : public EventBaseT<EVT_MOUSEOVER, &Widget::OnMouseOver> {
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    47
	Point m_pt;
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    48
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    49
	EventT(const PointRaw &pt)
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    50
		: m_pt(pt)
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    51
	{}
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    52
};
0ad100a98853 (svn r8958) [cpp_gui] -Add: Widget can now capture specified gui events
KUDr
parents: 6264
diff changeset
    53
6264
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    54
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    55
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    56
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    57
}; // namespace gui
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    58
9fc3b5467396 (svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
diff changeset
    59
#endif /* WINDOW_EVENT_H */