Go to the source code of this file.
◆ _Class
◆ _ScrollHandle()
| Class * _ScrollHandle |
( |
void |
| ) |
|
Definition at line 102 of file ScrollHandle.c.
102 {
103 static Class *clazz;
104 static Once once;
105
106 do_once(&once, {
107 clazz = _initialize(&(const ClassDef) {
108 .name = "ScrollHandle",
112 .interfaceSize = sizeof(ScrollHandleInterface),
114 });
115 });
116
117 return clazz;
118}
◆ captureEvent()
| static bool captureEvent |
( |
Control * |
self, |
|
|
const SDL_Event * |
event |
|
) |
| |
|
static |
- See also
- Control::captureEvent(Control *, const SDL_Event *)
Definition at line 42 of file ScrollHandle.c.
42 {
43
45
46 if (event->type == SDL_EVENT_MOUSE_BUTTON_DOWN) {
49 return true;
50 }
51 } else if (event->type == SDL_EVENT_MOUSE_MOTION) {
53 if (this->delegate.didDrag) {
54 this->delegate.didDrag(this, event->motion.yrel);
55 }
56 return true;
57 }
58 } else if (event->type == SDL_EVENT_MOUSE_BUTTON_UP) {
60 self->
state &= ~ControlStateHighlighted;
61 return true;
62 }
63 }
64
66}
@ ControlStateHighlighted
static bool didReceiveEvent(const View *self, const SDL_Event *event)
Controls are Views which capture and respond to events.
unsigned int state
The bit mask of ControlState.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
◆ init()
◆ initialize()
| static void initialize |
( |
Class * |
clazz | ) |
|
|
static |
- See also
- Class::initialize(Class *)
Definition at line 89 of file ScrollHandle.c.
89 {
90
91 ((ViewInterface *) clazz->interface)->init =
init;
92
93 ((ControlInterface *) clazz->interface)->captureEvent =
captureEvent;
94
96}
View * initWithFrame(View *self, const SDL_Rect *frame)
Initializes this View with the specified frame.
◆ initWithFrame()
Definition at line 74 of file ScrollHandle.c.
74 {
75
77 if (self) {
79 }
80
81 return self;
82}
static void addClassName(View *self, const char *className)