示例#1
0
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);
		}
	}
}
示例#2
0
文件: Menu.c 项目: awmaker/awmaker
static void dataChanged(void *self, WMNotification * notif)
{
	_Panel *panel = (_Panel *) self;
	WEditMenuItem *item = panel->currentItem;
	WMWidget *w = (WMWidget *) WMGetNotificationObject(notif);

	updateMenuItem(panel, item, w);
}
示例#3
0
文件: wtest.c 项目: awmaker/awmaker
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);
}
示例#4
0
文件: wview.c 项目: cneira/wmaker-crm
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));
}
示例#5
0
文件: Docks.c 项目: jafd/wmaker
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;
	}
}
示例#6
0
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;
}