cwidget
0.5.17
src
cwidget
widgets
passthrough.h
1
// passthrough.h -*-c++-*-
2
//
3
// A widget that by default passes focus and cursor handling through to
4
// a "currently focussed" widget.
5
6
#ifndef PASSTHROUGH_H
7
#define PASSTHROUGH_H
8
9
#include "container.h"
10
11
namespace
cwidget
12
{
13
namespace
widgets
14
{
15
class
passthrough
:
public
container
16
{
17
void
gained_focus();
18
void
lost_focus();
19
20
protected
:
21
virtual
bool
handle_key
(
const
config::key
&k);
22
23
// These call focussed() and unfocussed() on the result of get_focus().
24
// (convenience methods)
25
//
26
// Provided to make it easier to manage focus simply.
27
void
defocus();
28
void
refocus();
29
30
protected
:
31
passthrough
();
32
33
public
:
34
// Returns the currently focussed widget, if any.
35
virtual
widget_ref
get_focus()=0;
36
37
widget_ref
get_active_widget
();
38
39
virtual
void
dispatch_mouse(
short
id
,
int
x,
int
y,
int
z, mmask_t bstate);
40
41
virtual
bool
focus_me();
42
virtual
bool
get_cursorvisible();
43
virtual
point
get_cursorloc();
44
};
45
46
typedef
util::ref_ptr<passthrough>
passthrough_ref
;
47
}
48
}
49
50
#endif
cwidget::widgets::point
Definition:
widget.h:89
cwidget::util::ref_ptr< widget >
cwidget
The namespace containing everything defined by cwidget.
Definition:
columnify.cc:26
cwidget::widgets::passthrough::get_active_widget
widget_ref get_active_widget()
Return the currently "active" child of this container, or NULL.
Definition:
passthrough.cc:17
cwidget::widgets::container
Definition:
container.h:32
cwidget::config::key
Represents a keystroke as seen by curses.
Definition:
keybindings.h:42
cwidget::widgets::passthrough
Definition:
passthrough.h:15
cwidget::widgets::passthrough::handle_key
virtual bool handle_key(const config::key &k)
Handles a keypress in this widget.
Definition:
passthrough.cc:91
Generated by
1.8.13