mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-28 05:37:19 +00:00
Added the wantfocus property to JWindows.
This commit is contained in:
parent
c6b2f7e601
commit
48bca23055
@ -1,5 +1,5 @@
|
||||
/* Jinete - a GUI library
|
||||
* Copyright (C) 2003, 2004, 2005, 2007, 2008 David A. Capello.
|
||||
* Copyright (C) 2003-2008 David A. Capello.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -44,6 +44,7 @@ typedef struct Window
|
||||
bool is_moveable : 1;
|
||||
bool is_sizeable : 1;
|
||||
bool is_ontop : 1;
|
||||
bool is_wantfocus : 1;
|
||||
bool is_foreground : 1;
|
||||
bool is_autoremap : 1;
|
||||
} Window;
|
||||
@ -114,6 +115,13 @@ void jwindow_ontop(JWidget widget, bool state)
|
||||
window->is_ontop = state;
|
||||
}
|
||||
|
||||
void jwindow_wantfocus(JWidget widget, bool state)
|
||||
{
|
||||
Window *window = jwidget_get_data(widget, JI_WINDOW);
|
||||
|
||||
window->is_wantfocus = state;
|
||||
}
|
||||
|
||||
void jwindow_remap(JWidget widget)
|
||||
{
|
||||
Window *window = jwidget_get_data(widget, JI_WINDOW);
|
||||
@ -250,6 +258,13 @@ bool jwindow_is_ontop(JWidget widget)
|
||||
return window->is_ontop;
|
||||
}
|
||||
|
||||
bool jwindow_is_wantfocus(JWidget widget)
|
||||
{
|
||||
Window *window = jwidget_get_data(widget, JI_WINDOW);
|
||||
|
||||
return window->is_wantfocus;
|
||||
}
|
||||
|
||||
static JWidget window_new(int desktop, const char *text)
|
||||
{
|
||||
JWidget widget = jwidget_new(JI_WINDOW);
|
||||
@ -260,6 +275,7 @@ static JWidget window_new(int desktop, const char *text)
|
||||
window->is_moveable = !desktop;
|
||||
window->is_sizeable = !desktop;
|
||||
window->is_ontop = FALSE;
|
||||
window->is_wantfocus = TRUE;
|
||||
window->is_foreground = FALSE;
|
||||
window->is_autoremap = TRUE;
|
||||
|
||||
@ -331,6 +347,11 @@ static bool window_msg_proc(JWidget widget, JMessage msg)
|
||||
jwidget_release_mouse(widget);
|
||||
jmouse_set_cursor(JI_CURSOR_NORMAL);
|
||||
|
||||
if (click_pos) {
|
||||
jrect_free(click_pos);
|
||||
click_pos = NULL;
|
||||
}
|
||||
|
||||
window_action = WINDOW_NONE;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Jinete - a GUI library
|
||||
* Copyright (C) 2003, 2004, 2005, 2007, 2008 David A. Capello.
|
||||
* Copyright (C) 2003-2008 David A. Capello.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -44,6 +44,7 @@ JWidget jwindow_get_killer(JWidget window);
|
||||
void jwindow_moveable(JWidget window, bool state);
|
||||
void jwindow_sizeable(JWidget window, bool state);
|
||||
void jwindow_ontop(JWidget window, bool state);
|
||||
void jwindow_wantfocus(JWidget window, bool state);
|
||||
|
||||
void jwindow_remap(JWidget window);
|
||||
void jwindow_center(JWidget window);
|
||||
@ -59,6 +60,7 @@ bool jwindow_is_toplevel(JWidget window);
|
||||
bool jwindow_is_foreground(JWidget window);
|
||||
bool jwindow_is_desktop(JWidget window);
|
||||
bool jwindow_is_ontop(JWidget window);
|
||||
bool jwindow_is_wantfocus(JWidget window);
|
||||
|
||||
JI_END_DECLS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user