예제 #1
0
파일: wsplitview.c 프로젝트: crmafra/wmaker
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;
}