void DiscreteSlider::setActiveSection(int index) { if (_activeIndex != index) { _activeIndex = index; activateCallback(); } setSelectedSection(index); }
void MSPulldownMenu::activate(void) { if (activateCallback(MSWidgetCallback::activate)==MSFalse) { if (item()!=0) item()->activate(); } done(); }
void _GuiWinButton_handleClick (GuiObject widget) { iam_button; if (my activateCallback != NULL) { struct structGuiButtonEvent event = { widget, 0 }; try { my activateCallback (my activateBoss, & event); } catch (MelderError) { Melder_error_ ("Your click on button \"", widget -> name, "\" was not completely handled."); Melder_flushError (NULL); } } }
static void _GuiGtkButton_activateCallback (GuiObject widget, gpointer void_me) { iam (GuiButton); struct structGuiButtonEvent event = { widget, 0 }; if (my activateCallback != NULL) { try { my activateCallback (my activateBoss, & event); } catch (MelderError) { Melder_error_ ("Your click on button \"", GTK_WIDGET (widget) -> name, "\" was not completely handled."); Melder_flushError (NULL); } } }
// this method makes the widget appear to the toolkit as if it has been // destructed - all that remains to do is destroy the window and // recover the memory for the widget (delete widget). // this method is primarily used from MSWidget::destroy to allow // callback safe destruction of widgets void MSWidget::prepareForDestruction(void) { freeze(); MSWidget *pTopWidget=top(); if (_window!=0) _server->widgetHashTable()->remove(_window); // no more events if (pTopWidget!=0) pTopWidget->removeFromFocusList(this); if (pTopWidget!=0&&pTopWidget->inputFocus()==this) (void)pTopWidget->traverseFocus(0); if (focusWindow()==this) _focusWindow=0; childDestroyNotify(); activateCallback(MSWidgetCallback::destroy); removeAllCallbacks(); }
void MSTableColumn::columnWidth(unsigned cw_) { if (columnWidth()!=cw_) { _columnWidth=cw_; if (table()!=0) { table()->adjustNumVisible(); table()->redraw(); } activateCallback(MSWidgetCallback::columnresize); } }
bool _GuiWinButton_tryToHandleShortcutKey (GuiObject widget) { iam_button; if (my activateCallback != NULL) { struct structGuiButtonEvent event = { widget, 0 }; try { my activateCallback (my activateBoss, & event); } catch (MelderError) { Melder_error_ ("Your click on button \"", widget -> name, "\" was not completely handled."); Melder_flushError (NULL); } return true; } return false; }
MSBoolean AplusPopup::traverseFocus(MSWidget *newFocusWidget_) { static MSSymbol takeFocusSymbol("takefocus"); if (AplusShell::allowNestedTraversal()) { MSBoolean lf=MSTrue; if (focusWidget()!=0&&focusWidget()!=newFocusWidget_) lf=loseFocusNotify(focusWidget()); if (lf==MSTrue) { focusWidget(newFocusWidget_); takeFocusNotify(focusWidget()); activateCallback(focusWidget(),takeFocusSymbol); return MSTrue; } return MSFalse; } else return MSPopup::traverseFocus(newFocusWidget_); }
void _GuiMacButton_handleClick (GuiObject widget, EventRecord *macEvent) { iam_button; _GuiMac_clipOnParent (widget); bool pushed = HandleControlClick (widget -> nat.control.handle, macEvent -> where, macEvent -> modifiers, NULL); GuiMac_clipOff (); if (pushed && my activateCallback != NULL) { struct structGuiButtonEvent event = { widget, 0 }; //enum { cmdKey = 256, shiftKey = 512, optionKey = 2048, controlKey = 4096 }; Melder_assert (macEvent -> what == mouseDown); event. shiftKeyPressed = (macEvent -> modifiers & shiftKey) != 0; event. commandKeyPressed = (macEvent -> modifiers & cmdKey) != 0; event. optionKeyPressed = (macEvent -> modifiers & optionKey) != 0; event. extraControlKeyPressed = (macEvent -> modifiers & controlKey) != 0; try { my activateCallback (my activateBoss, & event); } catch (MelderError) { Melder_error_ ("Your click on button \"", widget -> name, "\" was not completely handled."); Melder_flushError (NULL); } } }
void DiscreteSlider::timerEvent(QTimerEvent *e) { activateCallback(); }
void MSMenuBarItem::menushow() { activateCallback(MSWidgetCallback::menushow); }
void MSArrowButton::activate(void) { if (isProtected()==MSFalse) activateCallback(MSWidgetCallback::activate); }
void MSOptionMenu::activate(void) { activateCallback(MSWidgetCallback::activate); }
void MSWidget::selectionClear(const XEvent *) { _server->copyBuffer("Selection Cleared"); activateCallback(MSWidgetCallback::selectionclear); }
void MSWidget::insertPrimarySelection(void) { activateCallback(MSWidgetCallback::selectionnotify); }