uiControl: add uiControlSetFocus to gtk part

This commit is contained in:
Rustam Gamidov 2020-04-08 17:58:57 +03:00
parent b4461a342f
commit da7d1eab57
No known key found for this signature in database
GPG Key ID: 093B162FB3DE6996
2 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,11 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
{ \ { \
gtk_widget_set_sensitive(type(c)->widget, FALSE); \ gtk_widget_set_sensitive(type(c)->widget, FALSE); \
} }
#define uiUnixControlDefaultSetFocus(type) \
static void type ## SetFocus(uiControl *c) \
{ \
gtk_widget_grab_focus(type(c)->widget); \
}
// TODO this whole addedBefore stuff is a MASSIVE HACK. // TODO this whole addedBefore stuff is a MASSIVE HACK.
#define uiUnixControlDefaultSetContainer(type) \ #define uiUnixControlDefaultSetContainer(type) \
static void type ## SetContainer(uiUnixControl *c, GtkContainer *container, gboolean remove) \ static void type ## SetContainer(uiUnixControl *c, GtkContainer *container, gboolean remove) \
@ -110,6 +115,7 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
uiUnixControlDefaultEnabled(type) \ uiUnixControlDefaultEnabled(type) \
uiUnixControlDefaultEnable(type) \ uiUnixControlDefaultEnable(type) \
uiUnixControlDefaultDisable(type) \ uiUnixControlDefaultDisable(type) \
uiUnixControlDefaultSetFocus(type) \
uiUnixControlDefaultSetContainer(type) uiUnixControlDefaultSetContainer(type)
#define uiUnixControlAllDefaults(type) \ #define uiUnixControlAllDefaults(type) \
@ -130,6 +136,7 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
uiControl(var)->Enabled = type ## Enabled; \ uiControl(var)->Enabled = type ## Enabled; \
uiControl(var)->Enable = type ## Enable; \ uiControl(var)->Enable = type ## Enable; \
uiControl(var)->Disable = type ## Disable; \ uiControl(var)->Disable = type ## Disable; \
uiControl(var)->SetFocus = type ## SetFocus; \
uiUnixControl(var)->SetContainer = type ## SetContainer; uiUnixControl(var)->SetContainer = type ## SetContainer;
// TODO document // TODO document
_UI_EXTERN uiUnixControl *uiUnixAllocControl(size_t n, uint32_t typesig, const char *typenamestr); _UI_EXTERN uiUnixControl *uiUnixAllocControl(size_t n, uint32_t typesig, const char *typenamestr);

View File

@ -112,6 +112,7 @@ uiUnixControlDefaultHide(uiWindow)
uiUnixControlDefaultEnabled(uiWindow) uiUnixControlDefaultEnabled(uiWindow)
uiUnixControlDefaultEnable(uiWindow) uiUnixControlDefaultEnable(uiWindow)
uiUnixControlDefaultDisable(uiWindow) uiUnixControlDefaultDisable(uiWindow)
uiUnixControlDefaultSetFocus(uiWindow)
// TODO? // TODO?
uiUnixControlDefaultSetContainer(uiWindow) uiUnixControlDefaultSetContainer(uiWindow)