static void handleSubviewResized(void *self, WMNotification * notif) { WMSplitView *sPtr = (WMSplitView *) self; CHECK_CLASS(sPtr, WC_SplitView); if (WMGetNotificationName(notif) == WMViewSizeDidChangeNotification) { W_SplitViewSubview *p; int i, count, done; WMView *view = WMGetNotificationObject(notif); count = _GetSubviewsCount(); done = 0; for (i = 0; i < count; i++) { p = _GetPSubviewStructAt(i); if (p->view == view) { done = 1; break; } } if (done) { /* TODO !!! */ resizeView(sPtr, p->view, p->size); moveView(sPtr, p->view, p->pos); } } }
static void dataChanged(void *self, WMNotification * notif) { _Panel *panel = (_Panel *) self; WEditMenuItem *item = panel->currentItem; WMWidget *w = (WMWidget *) WMGetNotificationObject(notif); updateMenuItem(panel, item, w); }
static void listSelectionObserver(void *observer, WMNotification * notification) { WMLabel *label = (WMLabel *) observer; WMList *lPtr = (WMList *) WMGetNotificationObject(notification); char buf[255]; sprintf(buf, "Selected items: %d", WMGetArrayItemCount(WMGetListSelectedItems(lPtr))); WMSetLabelText(label, buf); }
static void resizedParent(void *self, WMNotification * notif) { WMSize size = WMGetViewSize((WMView *) WMGetNotificationObject(notif)); WMView *view = (WMView *) self; W_MoveView(view, view->leftOffs, view->topOffs); W_ResizeView(view, size.width - (view->leftOffs + view->rightOffs), size.height - (view->topOffs + view->bottomOffs)); }
static void autoDelayChanged(void *observerData, WMNotification *notification) { _Panel *panel = (_Panel *) observerData; int row; WMTextField *anAutoDelayT = (WMTextField *) WMGetNotificationObject(notification); for (row = 0; row < 4; row++) { if (anAutoDelayT != panel->autoDelayT[row]) { continue; } char *value = WMGetTextFieldText(anAutoDelayT); adjustButtonSelectionBasedOnValue(panel, row, value); return; } }
static void listSelectionObserver(void *observerData, WMNotification * notification) { WMBrowser *bPtr = (WMBrowser *) observerData; int column; WMList *lPtr = (WMList *) WMGetNotificationObject(notification); for (column = 0; column < bPtr->usedColumnCount; column++) if (bPtr->columns[column] == lPtr) break; /* this can happen when a list is being cleared with WMClearList * after the column was removed */ if (column >= bPtr->usedColumnCount) { return; } if (WMGetArrayItemCount(WMGetListSelectedItems(lPtr)) == 0) column--; bPtr->selectedColumn = column; }