gcontrol.cpp (gambas-3.16.2.tar.bz2) | : | gcontrol.cpp (gambas-3.16.3.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 1034 | skipping to change at line 1034 | |||
return; | return; | |||
} | } | |||
curs=new gCursor(vl); | curs=new gCursor(vl); | |||
setMouse(CURSOR_CUSTOM); | setMouse(CURSOR_CUSTOM); | |||
} | } | |||
void gControl::updateCursor(GdkCursor *cursor) | void gControl::updateCursor(GdkCursor *cursor) | |||
{ | { | |||
if (GDK_IS_WINDOW(gtk_widget_get_window(border)) && _inside) | if (GDK_IS_WINDOW(gtk_widget_get_window(border)) && _inside) | |||
{ | { | |||
#if DEBUG_ENTER_LEAVE | if (cursor || isWindow()) | |||
fprintf(stderr, "updateCursor: %s %p\n", name(), cursor); | ||||
#endif | ||||
if (!cursor && parent() && gtk_widget_get_window(parent()->border | ||||
) == gtk_widget_get_window(border)) | ||||
parent()->updateCursor(parent()->getGdkCursor()); | ||||
else | ||||
{ | ||||
#if DEBUG_ENTER_LEAVE | ||||
fprintf(stderr, "updateCursor: gdk_window_set_cursor: win | ||||
dow = %p\n", gtk_widget_get_window(border)); | ||||
#endif | ||||
gdk_window_set_cursor(gtk_widget_get_window(border), curs or); | gdk_window_set_cursor(gtk_widget_get_window(border), curs or); | |||
} | ||||
if (!cursor && parent()) | ||||
parent()->updateCursor(parent()->getGdkCursor()); | ||||
} | } | |||
} | } | |||
GdkCursor *gControl::getGdkCursor() | GdkCursor *gControl::getGdkCursor() | |||
{ | { | |||
const char *name; | const char *name; | |||
GdkCursor *cr = NULL; | GdkCursor *cr = NULL; | |||
int m = _mouse; | int m = _mouse; | |||
if (gApplication::isBusy()) | if (gApplication::isBusy()) | |||
skipping to change at line 1287 | skipping to change at line 1280 | |||
return gtk_widget_get_can_focus(widget); | return gtk_widget_get_can_focus(widget); | |||
#else | #else | |||
return GTK_WIDGET_CAN_FOCUS(widget); | return GTK_WIDGET_CAN_FOCUS(widget); | |||
#endif | #endif | |||
} | } | |||
bool gControl::canFocusOnClick() const | bool gControl::canFocusOnClick() const | |||
{ | { | |||
/*if (_proxy) | /*if (_proxy) | |||
return _proxy->canFocusOnClick();*/ | return _proxy->canFocusOnClick();*/ | |||
if (isWindow()) | ||||
return false; | ||||
if (!GTK_IS_BUTTON(widget)) | if (!GTK_IS_BUTTON(widget)) | |||
return true; | return true; | |||
return gt_get_focus_on_click(widget); | return gt_get_focus_on_click(widget); | |||
} | } | |||
void gControl::setCanFocus(bool vl) | void gControl::setCanFocus(bool vl) | |||
{ | { | |||
#if DEBUG_FOCUS | #if DEBUG_FOCUS | |||
fprintf(stderr, "setCanFocus: %s %d ?\n", name(), vl); | fprintf(stderr, "setCanFocus: %s %d ?\n", name(), vl); | |||
#endif | #endif | |||
skipping to change at line 2873 | skipping to change at line 2868 | |||
#endif | #endif | |||
GtkIMContext *gControl::getInputMethod() | GtkIMContext *gControl::getInputMethod() | |||
{ | { | |||
return _input_method; | return _input_method; | |||
} | } | |||
gControl *gControl::nextFocus() | gControl *gControl::nextFocus() | |||
{ | { | |||
gControl *ctrl; | gControl *ctrl; | |||
gControl *next_ctrl; | ||||
//fprintf(stderr, "next: %s\n", name()); | //fprintf(stderr, "next: %s\n", name()); | |||
if (isContainer()) | if (isContainer()) | |||
{ | { | |||
ctrl = ((gContainer *)this)->firstChild(); | ctrl = ((gContainer *)this)->firstChild(); | |||
if (ctrl) | if (ctrl) | |||
{ | { | |||
//fprintf(stderr, "==> %s\n", ctrl->name()); | //fprintf(stderr, "==> %s\n", ctrl->name()); | |||
return ctrl; | return ctrl; | |||
} | } | |||
} | } | |||
ctrl = this; | ctrl = this; | |||
while (!ctrl->next()) | for(;;) | |||
{ | { | |||
next_ctrl = ctrl->next(); | ||||
if (next_ctrl) | ||||
return next_ctrl; | ||||
ctrl = ctrl->parent(); | ctrl = ctrl->parent(); | |||
//fprintf(stderr, "... %s\n", ctrl->name()); | if (!ctrl) | |||
if (ctrl->isTopLevel()) | return NULL; | |||
{ | /*if (!ctrl->parent()) | |||
ctrl = ctrl->nextFocus(); | return ctrl->nextFocus();*/ | |||
//fprintf(stderr, "==> %s\n", ctrl->name()); | ||||
return ctrl; | ||||
} | ||||
} | } | |||
ctrl = ctrl->next(); | ||||
//fprintf(stderr, "==> %s\n", ctrl->name()); | ||||
return ctrl; | ||||
} | } | |||
gControl *gControl::previousFocus() | gControl *gControl::previousFocus() | |||
{ | { | |||
gControl *ctrl = previous(); | gControl *ctrl = previous(); | |||
if (!ctrl) | if (!ctrl) | |||
{ | { | |||
if (!isTopLevel()) | if (!isTopLevel()) | |||
return parent()->previousFocus(); | return parent()->previousFocus(); | |||
End of changes. 8 change blocks. | ||||
25 lines changed or deleted | 16 lines changed or added |