FDOSTUI
FreeDOS Text User Interface
group.hpp
Go to the documentation of this file.
1 /*
2  GROUP.HPP
3 
4  License CC0 PUBLIC DOMAIN
5 
6  To the extent possible under law, Mark J. Olesen has waived all copyright
7  and related or neighboring rights to FDOSTUI Library. This work is published
8  from: United States.
9 */
10 #ifndef __group_hpp__
11 
12 #include "array.h"
13 #include "widget.hpp"
14 
15 class group : public widget
16 {
17 
18 public:
19 
20  group(
21  int const i_pos_x,
22  int const i_pos_y,
23  unsigned int const i_len_x,
24  unsigned int const i_len_y);
25 
26  virtual
27  ~group();
28 
29  virtual void
30  set_damage(
31  unsigned int const i_damage=DAMAGE_NONE);
32 
33  virtual int
34  add(
35  widget*const i_widget);
36 
37  virtual void
38  draw() const;
39 
40  virtual enum event_response
42  enum scancodes const i_scan);
43 
44  virtual enum event_response
45  event_key(
46  struct event_key const& i_event);
47 
48  virtual enum event_response
50  struct event_mouse const& i_event);
51 
52  virtual void
53  focus_enter();
54 
55  virtual void
56  focus_leave();
57 
58  void
59  set_focus(
60  widget& i_widget);
61 
62 protected:
63 
65  size_t m_slot;
66  struct array m_array;
67 
68 private:
69 
70  group();
71 
72  group(
73  const group&);
74 
75  group&
76  operator=(group const&);
77 
78  void
79  focus_next();
80 
81  void
83 
84 };
85 
86 #define __group_hpp__
87 #endif
Definition: widget.hpp:26
scancodes
ASCII Scan Codes.
Definition: keyboard.h:26
struct array m_array
widget container
Definition: group.hpp:66
virtual void set_damage(unsigned int const i_damage=DAMAGE_NONE)
sets damage mask
Definition: group.cpp:56
contains widget class
virtual void focus_enter()
handle entering focus
Definition: group.cpp:155
base class for all derived widgets
Definition: widget.hpp:19
virtual enum event_response event_mouse(struct event_mouse const &i_event)
handle mouse event
Definition: group.cpp:389
A dynamic array that holds pointers to objects.
container to hold a collection of widgets
Definition: group.hpp:15
virtual enum event_response event_key_default(enum scancodes const i_scan)
default scan code event handler
Definition: group.cpp:326
virtual ~group()
destructor
Definition: group.cpp:33
container to hold objects
Definition: array.h:14
virtual enum event_response event_key(struct event_key const &i_event)
handle key event
Definition: group.cpp:352
void focus_previous()
focuses previous widget
Definition: group.cpp:260
widget * m_focused
widget that has focus
Definition: group.hpp:64
event_response
response
Definition: event.h:14
size_t m_slot
focused widget slot (index into array)
Definition: group.hpp:65
virtual int add(widget *const i_widget)
add child widget
Definition: group.cpp:72
void focus_next()
focuses next widget
Definition: group.cpp:202
virtual void focus_leave()
handle leaving focus
Definition: group.cpp:188
void set_focus(widget &i_widget)
set widget focus
Definition: group.cpp:461
virtual void draw() const
draws it's child widgets
Definition: group.cpp:121
container for a mouse event
Definition: event.h:37
container for a keyboard event
Definition: event.h:23