mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[qwaq] Add support for invisible buttons
Useful for window controls.
This commit is contained in:
parent
afda214487
commit
19a4efed16
3 changed files with 23 additions and 4 deletions
|
@ -22,6 +22,7 @@
|
|||
}
|
||||
-initWithPos: (Point) pos releasedIcon: (DrawBuffer *) released
|
||||
pressedIcon: (DrawBuffer *) pressed;
|
||||
-initWithRect: (Rect) rect; // invisible button
|
||||
-(ListenerGroup *) onPress;
|
||||
-(ListenerGroup *) onRelease;
|
||||
-(ListenerGroup *) onClick;
|
||||
|
|
|
@ -21,12 +21,30 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
-initWithRect: (Rect) rect
|
||||
{
|
||||
if (!(self = [super initWithRect: rect])) {
|
||||
return nil;
|
||||
}
|
||||
icon[0] = nil;
|
||||
icon[1] = nil;
|
||||
onPress = [[ListenerGroup alloc] init];
|
||||
onRelease = [[ListenerGroup alloc] init];
|
||||
onClick = [[ListenerGroup alloc] init];
|
||||
onDrag = [[ListenerGroup alloc] init];
|
||||
onAuto = [[ListenerGroup alloc] init];
|
||||
onHover = [[ListenerGroup alloc] init];
|
||||
return self;
|
||||
}
|
||||
|
||||
-draw
|
||||
{
|
||||
[super draw];
|
||||
[textContext blitFromBuffer: icon[pressed]
|
||||
to: pos
|
||||
from: [icon[pressed] rect]];
|
||||
if (icon[pressed]) {
|
||||
[textContext blitFromBuffer: icon[pressed]
|
||||
to: pos
|
||||
from: [icon[pressed] rect]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ cmd_resizeterm (qwaq_resources_t *res)
|
|||
static void
|
||||
dump_command (qwaq_resources_t *res, int len)
|
||||
{
|
||||
if (1) {
|
||||
if (0) {
|
||||
qwaq_commands cmd = RB_PEEK_DATA (res->command_queue, 0);
|
||||
Sys_Printf ("%s[%d]", qwaq_command_names[cmd], len);
|
||||
for (int i = 2; i < len; i++) {
|
||||
|
|
Loading…
Reference in a new issue