void _GuiMacScale_destroy (GuiObject widget) { _GuiMac_clipOnParent (widget); EraseRect (& widget -> rect); GuiMac_clipOff (); iam_scale; forget (me); // NOTE: my widget is not destroyed here }
void _GuiMacCheckButton_handleClick (GuiObject widget, EventRecord *macEvent) { iam_checkbutton; _GuiMac_clipOnParent (widget); bool clicked = HandleControlClick (widget -> nat.control.handle, macEvent -> where, macEvent -> modifiers, NULL); GuiMac_clipOff (); if (clicked) { if (my d_valueChangedCallback != NULL) { struct structGuiCheckButtonEvent event = { me }; my d_valueChangedCallback (my d_valueChangedBoss, & event); } } }
void _GuiMacDrawingArea_update (GuiObject widget) { iam_drawingarea; if (my exposeCallback) { struct structGuiDrawingAreaExposeEvent event = { widget }; _GuiMac_clipOnParent (widget); try { my exposeCallback (my exposeBoss, & event); } catch (MelderError) { Melder_flushError ("Redrawing not completed"); } GuiMac_clipOff (); } }
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 _GuiMacRadioButton_handleClick (GuiObject widget, EventRecord *macEvent) { iam_radiobutton; _GuiMac_clipOnParent (widget); bool clicked = HandleControlClick (widget -> nat.control.handle, macEvent -> where, macEvent -> modifiers, NULL); GuiMac_clipOff (); if (clicked) { /* * Deselect the sister buttons. */ for (GuiRadioButton sibling = my d_previous; sibling != NULL; sibling = sibling -> d_previous) { SetControlValue (sibling -> d_widget -> nat.control.handle, 0); } for (GuiRadioButton sibling = my d_next; sibling != NULL; sibling = sibling -> d_next) { SetControlValue (sibling -> d_widget -> nat.control.handle, 0); } if (my d_valueChangedCallback != NULL) { struct structGuiRadioButtonEvent event = { me }; event. position = _GuiRadioButton_getPosition (me); my d_valueChangedCallback (my d_valueChangedBoss, & event); } } }