Ejemplo n.º 1
0
int main(int argc, char **argv)
{
	Display *dpy;
	WMWindow *win;
	WMScreen *scr;
	WMButton *lab, *l0 = NULL;
	WMLabel *pos;
	int x, y, c;
	char buf[20];

	WMInitializeApplication("FontView", &argc, argv);

	dpy = XOpenDisplay("");
	if (!dpy) {
		wfatal("cant open display");
		exit(0);
	}

	scr = WMCreateSimpleApplicationScreen(dpy);

	win = WMCreateWindow(scr, "main");
	WMResizeWidget(win, 20 * 33, 20 + 20 * 9);
	WMSetWindowTitle(win, "Font Chars");
	WMSetWindowCloseAction(win, quit, NULL);
	pos = WMCreateLabel(win);
	WMResizeWidget(pos, 20 * 33, 20);
	WMMoveWidget(pos, 10, 5);

	c = 0;
	for (y = 0; y < 8; y++) {
		for (x = 0; x < 32; x++, c++) {
			lab = WMCreateCustomButton(win, WBBStateLightMask);
			WMResizeWidget(lab, 20, 20);
			WMMoveWidget(lab, 10 + x * 20, 30 + y * 20);
			sprintf(buf, "%c", c);
			WMSetButtonText(lab, buf);
			WMSetButtonAction(lab, show, pos);
			WMHangData(lab, (void *)(uintptr_t) c);
			if (c > 0) {
				WMGroupButtons(l0, lab);
			} else {
				l0 = lab;
			}
		}
	}
	WMRealizeWidget(win);
	WMMapSubwidgets(win);
	WMMapWidget(win);
	WMScreenMainLoop(scr);
	return 0;
}
Ejemplo n.º 2
0
Archivo: Docks.c Proyecto: jafd/wmaker
static void createPanel(Panel *p)
{
	_Panel *panel = (_Panel *) p;
	WMScreen *scr = WMWidgetScreen(panel->parent);
	WMPixmap *icon1, *icon2;
	RImage *xis = NULL;
	RContext *rc = WMScreenRContext(scr);
	char *path;
	int i, j, k;
	char *buf1, *buf2;

	path = LocateImage(ARQUIVO_XIS);
	if (path) {
		xis = RLoadImage(rc, path, 0);
		if (!xis) {
			wwarning(_("could not load image file %s"), path);
		}
		wfree(path);
	}

	panel->box = WMCreateBox(panel->parent);
	WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);

	/***************** Auto-delays *****************/
	buf1 = wmalloc(strlen(DELAY_ICON) + 1);
	buf2 = wmalloc(strlen(DELAY_ICON_S) + 1);

	for (k = 0; k < 2; k++)
	{
		panel->autoDelayF[k] = WMCreateFrame(panel->box);
		WMResizeWidget(panel->autoDelayF[k], 365, 100);
		WMMoveWidget(panel->autoDelayF[k], 15, 10 + k * 110);
		if (k == 0)
			WMSetFrameTitle(panel->autoDelayF[k], _("Delays in milliseconds for autocollapsing clips"));
		else
			WMSetFrameTitle(panel->autoDelayF[k], _("Delays in milliseconds for autoraising clips"));

		for (i = 0; i < 2; i++)
		{
			panel->autoDelayL[i + k * 2] = WMCreateLabel(panel->autoDelayF[k]);
			WMResizeWidget(panel->autoDelayL[i + k * 2], 165, 20);
			WMMoveWidget(panel->autoDelayL[i + k * 2], 10, 27 + 40 * i);
			WMSetLabelText(panel->autoDelayL[i + k * 2], _(auto_delay[i + k * 2].string));
			WMSetLabelTextAlignment(panel->autoDelayL[i + k * 2], WARight);

			for (j = 0; j < 5; j++)
			{
				panel->autoDelayB[i + k * 2][j] = WMCreateCustomButton(panel->autoDelayF[k], WBBStateChangeMask);
				WMResizeWidget(panel->autoDelayB[i + k * 2][j], 25, 25);
				WMMoveWidget(panel->autoDelayB[i + k * 2][j], 175 + (25 * j), 25 + 40 * i);
				WMSetButtonBordered(panel->autoDelayB[i + k * 2][j], False);
				WMSetButtonImagePosition(panel->autoDelayB[i + k * 2][j], WIPImageOnly);
				WMSetButtonAction(panel->autoDelayB[i + k * 2][j], pushAutoDelayButton, panel);
				if (j > 0)
					WMGroupButtons(panel->autoDelayB[i + k * 2][0], panel->autoDelayB[i + k * 2][j]);
				sprintf(buf1, DELAY_ICON, j);
				CreateImages(scr, rc, NULL, buf1, &icon1, NULL);
				if (icon1) {
					WMSetButtonImage(panel->autoDelayB[i + k * 2][j], icon1);
					WMReleasePixmap(icon1);
				} else {
					wwarning(_("could not load icon file %s"), buf1);
				}
				sprintf(buf2, DELAY_ICON_S, j);
				CreateImages(scr, rc, NULL, buf2, &icon2, NULL);
				if (icon2) {
					WMSetButtonAltImage(panel->autoDelayB[i + k * 2][j], icon2);
					WMReleasePixmap(icon2);
				} else {
					wwarning(_("could not load icon file %s"), buf2);
				}
			}

			panel->autoDelayT[i + k * 2] = WMCreateTextField(panel->autoDelayF[k]);
			WMResizeWidget(panel->autoDelayT[i + k * 2], 36, 20);
			WMMoveWidget(panel->autoDelayT[i + k * 2], 310, 27 + 40 * i);
			WMAddNotificationObserver(autoDelayChanged, panel, WMTextDidChangeNotification, panel->autoDelayT[i + k * 2]);
		}

		WMMapSubwidgets(panel->autoDelayF[k]);
	}
	wfree(buf1);
	wfree(buf2);

	/***************** Enable/disable clip/dock/drawers *****************/
	panel->dockF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->dockF, 115, 210);
	WMMoveWidget(panel->dockF, 390, 10);
	WMSetFrameTitle(panel->dockF, _("Dock/Clip/Drawer"));

	for (i = 0; i < 3; i++)
	{
		panel->docksB[i] = WMCreateButton(panel->dockF, WBTToggle);
		WMResizeWidget(panel->docksB[i], 56, 56);
		WMMoveWidget(panel->docksB[i], 30, 20 + 62 * i);
		WMSetButtonImagePosition(panel->docksB[i], WIPImageOnly);
		CreateImages(scr, rc, xis, dock_config[i].icon_file, &icon1, &icon2);
		if (icon2) {
			WMSetButtonImage(panel->docksB[i], icon2);
			WMReleasePixmap(icon2);
		}
		if (icon1) {
			WMSetButtonAltImage(panel->docksB[i], icon1);
			WMReleasePixmap(icon1);
		}
		switch(i)
		{
		case 0:
			WMSetBalloonTextForView(_("Disable/enable the application Dock (the\n"
						  "vertical icon bar in the side of the screen)."), WMWidgetView(panel->docksB[i]));
			break;
		case 1:
			WMSetBalloonTextForView(_("Disable/enable the Clip (that thing with\n"
						  "a paper clip icon)."), WMWidgetView(panel->docksB[i]));
			break;
		case 2:
			WMSetBalloonTextForView(_("Disable/enable Drawers (a dock that stores\n"
						  "application icons horizontally). The dock is required."), WMWidgetView(panel->docksB[i]));
			break;
		}
		WMSetButtonAction(panel->docksB[i], pushDockButton, panel);
	}
	
	WMMapSubwidgets(panel->dockF);

	if (xis)
		RReleaseImage(xis);

	WMRealizeWidget(panel->box);
	WMMapSubwidgets(panel->box);

	showData(panel);
}
Ejemplo n.º 3
0
static void createPanel(Panel * p)
{
	_Panel *panel = (_Panel *) p;
	WMScreen *scr = WMWidgetScreen(panel->parent);
	WMPixmap *icon;
	char *buf1, *buf2;
	int i;
	RColor color;
	char *path;

	color.red = 0xae;
	color.green = 0xaa;
	color.blue = 0xae;

	panel->box = WMCreateBox(panel->parent);
	WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);

    /**************** Mouse Speed ****************/
	panel->speedF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->speedF, 219, 85);
	WMMoveWidget(panel->speedF, 9, 54);
	WMSetFrameTitle(panel->speedF, _("Mouse Speed"));

	panel->speedL = WMCreateLabel(panel->speedF);
	WMResizeWidget(panel->speedL, 40, 46);
	WMMoveWidget(panel->speedL, 8, 10);
	WMSetLabelImagePosition(panel->speedL, WIPImageOnly);
	path = LocateImage(SPEED_ICON_FILE);
	if (path) {
		icon = WMCreateBlendedPixmapFromFile(scr, path, &color);
		if (icon) {
			WMSetLabelImage(panel->speedL, icon);
			WMReleasePixmap(icon);
		} else {
			wwarning(_("could not load icon %s"), path);
		}
		wfree(path);
	}

	panel->speedS = WMCreateSlider(panel->speedF);
	WMResizeWidget(panel->speedS, 150, 15);
	WMMoveWidget(panel->speedS, 58, 30);
	WMSetSliderMinValue(panel->speedS, 0);
	WMSetSliderMaxValue(panel->speedS, 40);
	WMSetSliderContinuous(panel->speedS, False);
	WMSetSliderAction(panel->speedS, speedChange, panel);

	panel->acceL = WMCreateLabel(panel->speedF);
	WMResizeWidget(panel->acceL, 50, 16);
	WMMoveWidget(panel->acceL, 8, 58);
	WMSetLabelTextAlignment(panel->acceL, WARight);
	WMSetLabelText(panel->acceL, _("Accel.:"));

	panel->acceT = WMCreateTextField(panel->speedF);
	WMResizeWidget(panel->acceT, 40, 20);
	WMMoveWidget(panel->acceT, 58, 56);
	WMAddNotificationObserver(returnPressed, panel, WMTextDidEndEditingNotification, panel->acceT);

	panel->threL = WMCreateLabel(panel->speedF);
	WMResizeWidget(panel->threL, 80, 16);
	WMMoveWidget(panel->threL, 98, 58);
	WMSetLabelTextAlignment(panel->threL, WARight);
	WMSetLabelText(panel->threL, _("Threshold:"));

	panel->threT = WMCreateTextField(panel->speedF);
	WMResizeWidget(panel->threT, 30, 20);
	WMMoveWidget(panel->threT, 178, 56);
	WMAddNotificationObserver(returnPressed, panel, WMTextDidEndEditingNotification, panel->threT);

	WMMapSubwidgets(panel->speedF);

	/* ************** Grab Modifier **************** */
	panel->grabF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->grabF, 219, 46);
	WMMoveWidget(panel->grabF, 9, 5);
	WMSetFrameTitle(panel->grabF, _("Mouse Grab Modifier"));

	WMSetBalloonTextForView(_("Keyboard modifier to use for actions that\n"
				  "involve dragging windows with the mouse,\n"
				  "clicking inside the window."), WMWidgetView(panel->grabF));

	panel->grabP = WMCreatePopUpButton(panel->grabF);
	WMResizeWidget(panel->grabP, 178, 20);
	WMMoveWidget(panel->grabP, 20, 17);

	fillModifierPopUp(panel->grabP);
	WMMapSubwidgets(panel->grabF);

	/***************** Doubleclick Delay ****************/

	panel->ddelaF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->ddelaF, 219, 80);
	WMMoveWidget(panel->ddelaF, 9, 142);
	WMSetFrameTitle(panel->ddelaF, _("Double-Click Delay"));

	buf1 = wmalloc(strlen(DELAY_ICON) + 2);
	buf2 = wmalloc(strlen(DELAY_ICON_S) + 2);

	for (i = 0; i < wlengthof(panel->ddelaB); i++) {
		panel->ddelaB[i] = WMCreateCustomButton(panel->ddelaF, WBBStateChangeMask);
		WMResizeWidget(panel->ddelaB[i], 25, 25);
		WMMoveWidget(panel->ddelaB[i], 18 + (40 * i), 18);
		WMSetButtonBordered(panel->ddelaB[i], False);
		WMSetButtonImagePosition(panel->ddelaB[i], WIPImageOnly);
		WMSetButtonAction(panel->ddelaB[i], doubleClick, panel);
		if (i > 0) {
			WMGroupButtons(panel->ddelaB[0], panel->ddelaB[i]);
		}
		sprintf(buf1, DELAY_ICON, i + 1);
		sprintf(buf2, DELAY_ICON_S, i + 1);
		path = LocateImage(buf1);
		if (path) {
			icon = WMCreatePixmapFromFile(scr, path);
			if (icon) {
				WMSetButtonImage(panel->ddelaB[i], icon);
				WMReleasePixmap(icon);
			} else {
				wwarning(_("could not load icon file %s"), path);
			}
			wfree(path);
		}
		path = LocateImage(buf2);
		if (path) {
			icon = WMCreatePixmapFromFile(scr, path);
			if (icon) {
				WMSetButtonAltImage(panel->ddelaB[i], icon);
				WMReleasePixmap(icon);
			} else {
				wwarning(_("could not load icon file %s"), path);
			}
			wfree(path);
		}
	}
	wfree(buf1);
	wfree(buf2);

	panel->tester = CreateDoubleTest(panel->ddelaF, _("Test"));
	WMResizeWidget(panel->tester, 84, 24);
	WMMoveWidget(panel->tester, 20, 48);

	panel->ddelaT = WMCreateTextField(panel->ddelaF);
	WMResizeWidget(panel->ddelaT, 40, 20);
	WMMoveWidget(panel->ddelaT, 130, 50);

	panel->ddelaL = WMCreateLabel(panel->ddelaF);
	WMResizeWidget(panel->ddelaL, 40, 16);
	WMMoveWidget(panel->ddelaL, 173, 54);
	{
		WMFont *font;
		WMColor *color;

		font = WMSystemFontOfSize(scr, 10);
		color = WMDarkGrayColor(scr);
		WMSetLabelTextColor(panel->ddelaL, color);
		WMSetLabelFont(panel->ddelaL, font);
		WMReleaseFont(font);
		WMReleaseColor(color);
	}
	WMSetLabelText(panel->ddelaL, _("ms"));

	WMMapSubwidgets(panel->ddelaF);

	/* ************** Workspace Action Buttons **************** */

	panel->menuF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->menuF, 276, 217);
	WMMoveWidget(panel->menuF, 236, 5);
	WMSetFrameTitle(panel->menuF, _("Workspace Mouse Actions"));

	panel->disaB = WMCreateSwitchButton(panel->menuF);
	WMResizeWidget(panel->disaB, 254, 18);
	WMMoveWidget(panel->disaB, 10, 15);
	WMSetButtonText(panel->disaB, _("Disable mouse actions"));
	WMSetButtonAction(panel->disaB, toggle_disabling_of_mouse_actions, panel);

	for (i = 0; i < wlengthof(button_list); i++) {
		int j;

		panel->mouse_action[i].label = WMCreateLabel(panel->menuF);
		WMResizeWidget(panel->mouse_action[i].label, 115, 20);
		WMMoveWidget(panel->mouse_action[i].label, 4, 37 + 25 * i);
		WMSetLabelTextAlignment(panel->mouse_action[i].label, WARight);
		WMSetLabelText(panel->mouse_action[i].label, _(button_list[i].display_label));

		panel->mouse_action[i].popup = WMCreatePopUpButton(panel->menuF);
		WMResizeWidget(panel->mouse_action[i].popup, 145, 20);
		WMMoveWidget(panel->mouse_action[i].popup, 121, 37 + 25 * i);

		if (button_list[i].type == T_BUTTON) {
			for (j = 0; j < wlengthof(button_actions); j++)
				WMAddPopUpButtonItem(panel->mouse_action[i].popup, _(button_actions[j].label));
		} else {
			for (j = 0; j < wlengthof(wheel_actions); j++)
				WMAddPopUpButtonItem(panel->mouse_action[i].popup, _(wheel_actions[j].label));
		}
	}
	WMMapSubwidgets(panel->menuF);

	WMRealizeWidget(panel->box);
	WMMapSubwidgets(panel->box);

	showData(panel);
}
Ejemplo n.º 4
0
static void createPanel(Panel *p)
{
	_Panel *panel = (_Panel *) p;
	WMScreen *scr = WMWidgetScreen(panel->parent);
	char *buf1, *buf2;
	WMPixmap *icon, *altIcon;
	RImage *xis = NULL;
	int i;
	RContext *rc = WMScreenRContext(scr);
	WMFont *font = WMSystemFontOfSize(scr, 10);
	char *path;

	path = LocateImage(ARQUIVO_XIS);
	if (path) {
		xis = RLoadImage(rc, path, 0);
		if (!xis)
			wwarning(_("could not load image file %s"), path);
		wfree(path);
	}

	panel->box = WMCreateBox(panel->parent);
	WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);

    /*********** Icon Slide Speed **********/
	panel->icoF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->icoF, 212, 45);
	WMMoveWidget(panel->icoF, 15, 10);
	WMSetFrameTitle(panel->icoF, _("Icon Slide Speed"));

    /*********** Shade Animation Speed **********/
	panel->shaF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->shaF, 212, 45);
	WMMoveWidget(panel->shaF, 15, 65);
	WMSetFrameTitle(panel->shaF, _("Shade Animation Speed"));

	buf1 = wmalloc(strlen(SPEED_IMAGE) + 1);
	buf2 = wmalloc(strlen(SPEED_IMAGE_S) + 1);

	for (i = 0; i < 5; i++) {
		panel->icoB[i] = WMCreateCustomButton(panel->icoF, WBBStateChangeMask);
		panel->shaB[i] = WMCreateCustomButton(panel->shaF, WBBStateChangeMask);
		WMResizeWidget(panel->icoB[i], 40, 24);
		WMMoveWidget(panel->icoB[i], 2 + (40 * i), 15);
		WMResizeWidget(panel->shaB[i], 40, 24);
		WMMoveWidget(panel->shaB[i], 2 + (40 * i), 15);
		WMSetButtonBordered(panel->icoB[i], False);
		WMSetButtonImagePosition(panel->icoB[i], WIPImageOnly);
		if (i > 0) {
			WMGroupButtons(panel->icoB[0], panel->icoB[i]);
		}
		WMSetButtonBordered(panel->shaB[i], False);
		WMSetButtonImagePosition(panel->shaB[i], WIPImageOnly);
		if (i > 0) {
			WMGroupButtons(panel->shaB[0], panel->shaB[i]);
		}
		sprintf(buf1, SPEED_IMAGE, i);
		sprintf(buf2, SPEED_IMAGE_S, i);
		path = LocateImage(buf1);
		if (path) {
			icon = WMCreatePixmapFromFile(scr, path);
			if (icon) {
				WMSetButtonImage(panel->icoB[i], icon);
				WMSetButtonImage(panel->shaB[i], icon);
				WMReleasePixmap(icon);
			} else {
				wwarning(_("could not load icon file %s"), path);
			}
			wfree(path);
		}
		path = LocateImage(buf2);
		if (path) {
			icon = WMCreatePixmapFromFile(scr, path);
			if (icon) {
				WMSetButtonAltImage(panel->icoB[i], icon);
				WMSetButtonAltImage(panel->shaB[i], icon);
				WMReleasePixmap(icon);
			} else {
				wwarning(_("could not load icon file %s"), path);
			}
			wfree(path);
		}
	}
	wfree(buf1);
	wfree(buf2);

	WMMapSubwidgets(panel->icoF);
	WMMapSubwidgets(panel->shaF);

    /***************** Smoothed Scaling *****************/
	panel->smoF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->smoF, 94, 100);
	WMMoveWidget(panel->smoF, 420, 10);
	WMSetFrameTitle(panel->smoF, _("Smooth Scaling"));

	panel->smoB = WMCreateButton(panel->smoF, WBTToggle);
	WMResizeWidget(panel->smoB, 64, 64);
	WMMoveWidget(panel->smoB, 15, 23);
	WMSetButtonImagePosition(panel->smoB, WIPImageOnly);
	path = LocateImage(SMOOTH_IMAGE);
	if (path) {
		RImage *image, *scaled;

		image = RLoadImage(WMScreenRContext(scr), path, 0);
		wfree(path);

		scaled = RScaleImage(image, 61, 61);
		icon = WMCreatePixmapFromRImage(scr, scaled, 128);
		RReleaseImage(scaled);
		if (icon) {
			WMSetButtonImage(panel->smoB, icon);
			WMReleasePixmap(icon);
		}

		scaled = RSmoothScaleImage(image, 61, 61);
		icon = WMCreatePixmapFromRImage(scr, scaled, 128);
		RReleaseImage(scaled);
		if (icon) {
			WMSetButtonAltImage(panel->smoB, icon);
			WMReleasePixmap(icon);
		}

		RReleaseImage(image);
	}
	WMSetBalloonTextForView(_("Smooth scaled background images, neutralizing\n"
				  "the `pixelization' effect. This will slow\n"
				  "down loading of background images considerably."), WMWidgetView(panel->smoB));

	WMMapSubwidgets(panel->smoF);

    /***************** Titlebar Style Size ****************/
	panel->titlF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->titlF, 212, 97);
	WMMoveWidget(panel->titlF, 15, 120);
	WMSetFrameTitle(panel->titlF, _("Titlebar Style"));

	panel->oldsB = WMCreateButton(panel->titlF, WBTOnOff);
	WMResizeWidget(panel->oldsB, 60, 40);
	WMMoveWidget(panel->oldsB, 16, 32);
	WMSetButtonImagePosition(panel->oldsB, WIPImageOnly);
	path = LocateImage(OLDS_IMAGE);
	if (path) {
		icon = WMCreatePixmapFromFile(scr, path);
		if (icon) {
			WMSetButtonImage(panel->oldsB, icon);
			WMReleasePixmap(icon);
		}
		wfree(path);
	}

	panel->newsB = WMCreateButton(panel->titlF, WBTOnOff);
	WMResizeWidget(panel->newsB, 60, 40);
	WMMoveWidget(panel->newsB, 76, 32);
	WMSetButtonImagePosition(panel->newsB, WIPImageOnly);
	path = LocateImage(NEWS_IMAGE);
	if (path) {
		icon = WMCreatePixmapFromFile(scr, path);
		if (icon) {
			WMSetButtonImage(panel->newsB, icon);
			WMReleasePixmap(icon);
		}
		wfree(path);
	}

	panel->nextB = WMCreateButton(panel->titlF, WBTOnOff);
	WMResizeWidget(panel->nextB, 60, 40);
	WMMoveWidget(panel->nextB, 136, 32);
	WMSetButtonImagePosition(panel->nextB, WIPImageOnly);
	path = LocateImage(NEXT_IMAGE);
	if (path) {
		icon = WMCreatePixmapFromFile(scr, path);
		if (icon) {
			WMSetButtonImage(panel->nextB, icon);
			WMReleasePixmap(icon);
		}
		wfree(path);
	}

	WMGroupButtons(panel->newsB, panel->oldsB);
	WMGroupButtons(panel->newsB, panel->nextB);

	WMMapSubwidgets(panel->titlF);

    /**************** Features ******************/
	panel->animF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->animF, 173, 100);
	WMMoveWidget(panel->animF, 237, 10);
	WMSetFrameTitle(panel->animF, _("Animations"));

	panel->animB = WMCreateButton(panel->animF, WBTToggle);
	WMResizeWidget(panel->animB, 64, 64);
	WMMoveWidget(panel->animB, 15, 23);
	WMSetButtonFont(panel->animB, font);
	WMSetButtonText(panel->animB, _("Animations"));
	WMSetButtonImagePosition(panel->animB, WIPAbove);
	CreateImages(scr, rc, xis, ANIM_IMAGE, &altIcon, &icon);
	if (icon) {
		WMSetButtonImage(panel->animB, icon);
		WMReleasePixmap(icon);
	}
	if (altIcon) {
		WMSetButtonAltImage(panel->animB, altIcon);
		WMReleasePixmap(altIcon);
	}
	WMSetBalloonTextForView(_("Disable/enable animations such as those shown\n"
				  "for window miniaturization, shading etc."), WMWidgetView(panel->animB));

	panel->supB = WMCreateButton(panel->animF, WBTToggle);
	WMResizeWidget(panel->supB, 64, 64);
	WMMoveWidget(panel->supB, 94, 23);
	WMSetButtonFont(panel->supB, font);
	WMSetButtonText(panel->supB, _("Superfluous"));
	WMSetButtonImagePosition(panel->supB, WIPAbove);
	CreateImages(scr, rc, xis, SUPERF_IMAGE, &altIcon, &icon);
	if (icon) {
		WMSetButtonImage(panel->supB, icon);
		WMReleasePixmap(icon);
	}
	if (altIcon) {
		WMSetButtonAltImage(panel->supB, altIcon);
		WMReleasePixmap(altIcon);
	}
	WMSetBalloonTextForView(_("Disable/enable `superfluous' features and\n"
				  "animations. These include the `ghosting' of the\n"
				  "dock when it's being moved to another side and\n"
				  "the explosion animation when undocking icons."), WMWidgetView(panel->supB));

	WMMapSubwidgets(panel->animF);

    /*********** Dithering **********/
	panel->cmapSize = 4;

	panel->dithF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->dithF, 277, 97);
	WMMoveWidget(panel->dithF, 237, 120);
	WMSetFrameTitle(panel->dithF, _("Dithering colormap for 8bpp"));

	WMSetBalloonTextForView(_("Number of colors to reserve for Window Maker\n"
				  "on displays that support only 8bpp (PseudoColor)."),
				WMWidgetView(panel->dithF));

	panel->dithB = WMCreateSwitchButton(panel->dithF);
	WMResizeWidget(panel->dithB, 235, 32);
	WMMoveWidget(panel->dithB, 15, 15);
	WMSetButtonText(panel->dithB, _("Disable dithering in any visual/depth"));

	panel->dithL = WMCreateLabel(panel->dithF);
	WMResizeWidget(panel->dithL, 75, 16);
	WMMoveWidget(panel->dithL, 98, 50);
	WMSetLabelTextAlignment(panel->dithL, WACenter);
	WMSetLabelText(panel->dithL, "64");

	panel->dithS = WMCreateSlider(panel->dithF);
	WMResizeWidget(panel->dithS, 95, 16);
	WMMoveWidget(panel->dithS, 90, 65);
	WMSetSliderMinValue(panel->dithS, 2);
	WMSetSliderMaxValue(panel->dithS, 6);
	WMSetSliderContinuous(panel->dithS, True);
	WMSetSliderAction(panel->dithS, updateLabel, panel);

	panel->dith1L = WMCreateLabel(panel->dithF);
	WMResizeWidget(panel->dith1L, 80, 35);
	WMMoveWidget(panel->dith1L, 5, 50);
	WMSetLabelTextAlignment(panel->dith1L, WACenter);
	WMSetLabelFont(panel->dith1L, font);
	WMSetLabelText(panel->dith1L, _("More colors for\napplications"));

	panel->dith2L = WMCreateLabel(panel->dithF);
	WMResizeWidget(panel->dith2L, 80, 35);
	WMMoveWidget(panel->dith2L, 190, 50);
	WMSetLabelTextAlignment(panel->dith2L, WACenter);
	WMSetLabelFont(panel->dith2L, font);
	WMSetLabelText(panel->dith2L, _("More colors for\nWindow Maker"));

	WMMapSubwidgets(panel->dithF);

	WMRealizeWidget(panel->box);
	WMMapSubwidgets(panel->box);

	if (xis)
		RReleaseImage(xis);
	WMReleaseFont(font);
	showData(panel);
}
Ejemplo n.º 5
0
static void
createPanel(Panel *p)
{
    _Panel *panel = (_Panel*)p;
    WMScreen *scr = WMWidgetScreen(panel->parent);
    WMPixmap *icon;
    int i;
    char *buf1, *buf2;
    char *path;

    panel->box = WMCreateBox(panel->parent);
    WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);

    /***************** Menu Scroll Speed ****************/
    panel->scrF = WMCreateFrame(panel->box);
    WMResizeWidget(panel->scrF, 235, 90);
    WMMoveWidget(panel->scrF, 25, 20);
    WMSetFrameTitle(panel->scrF, _("Menu Scrolling Speed"));


    buf1 = wmalloc(strlen(SPEED_IMAGE)+1);
    buf2 = wmalloc(strlen(SPEED_IMAGE_S)+1);
    for (i = 0; i < 5; i++) {
        panel->scrB[i] = WMCreateCustomButton(panel->scrF, WBBStateChangeMask);
        WMResizeWidget(panel->scrB[i], 40, 40);
        WMMoveWidget(panel->scrB[i], 15+(40*i), 30);
        WMSetButtonBordered(panel->scrB[i], False);
        WMSetButtonImagePosition(panel->scrB[i], WIPImageOnly);
        if (i > 0) {
            WMGroupButtons(panel->scrB[0], panel->scrB[i]);
        }
        sprintf(buf1, SPEED_IMAGE, i);
        sprintf(buf2, SPEED_IMAGE_S, i);
        path = LocateImage(buf1);
        if (path) {
            icon = WMCreatePixmapFromFile(scr, path);
            if (icon) {
                WMSetButtonImage(panel->scrB[i], icon);
                WMReleasePixmap(icon);
            } else {
                wwarning(_("could not load icon file %s"), path);
            }
            wfree(path);
        }
        path = LocateImage(buf2);
        if (path) {
            icon = WMCreatePixmapFromFile(scr, path);
            if (icon) {
                WMSetButtonAltImage(panel->scrB[i], icon);
                WMReleasePixmap(icon);
            } else {
                wwarning(_("could not load icon file %s"), path);
            }
            wfree(path);
        }
    }
    wfree(buf1);
    wfree(buf2);

    WMMapSubwidgets(panel->scrF);

    /***************** Submenu Alignment ****************/

    panel->aliF = WMCreateFrame(panel->box);
    WMResizeWidget(panel->aliF, 220, 90);
    WMMoveWidget(panel->aliF, 280, 20);
    WMSetFrameTitle(panel->aliF, _("Submenu Alignment"));

    panel->alinB = WMCreateButton(panel->aliF, WBTOnOff);
    WMResizeWidget(panel->alinB, 48, 48);
    WMMoveWidget(panel->alinB, 56, 25);
    WMSetButtonImagePosition(panel->alinB, WIPImageOnly);
    path = LocateImage(MENU_ALIGN1);
    if (path) {
        icon = WMCreatePixmapFromFile(scr, path);
        if (icon) {
            WMSetButtonImage(panel->alinB, icon);
            WMReleasePixmap(icon);
        } else {
            wwarning(_("could not load icon file %s"), path);
        }
        wfree(path);
    }
    panel->aliyB = WMCreateButton(panel->aliF, WBTOnOff);
    WMResizeWidget(panel->aliyB, 48, 48);
    WMMoveWidget(panel->aliyB, 120, 25);
    WMSetButtonImagePosition(panel->aliyB, WIPImageOnly);
    path = LocateImage(MENU_ALIGN2);
    if (path) {
        icon = WMCreatePixmapFromFile(scr, path);
        if (icon) {
            WMSetButtonImage(panel->aliyB, icon);
            WMReleasePixmap(icon);
        } else {
            wwarning(_("could not load icon file %s"), path);
        }
        wfree(path);
    }
    WMGroupButtons(panel->alinB, panel->aliyB);

    WMMapSubwidgets(panel->aliF);

    /***************** Options ****************/
    panel->optF = WMCreateFrame(panel->box);
    WMResizeWidget(panel->optF, 475, 80);
    WMMoveWidget(panel->optF, 25, 130);

    panel->wrapB = WMCreateSwitchButton(panel->optF);
    WMResizeWidget(panel->wrapB, 440, 32);
    WMMoveWidget(panel->wrapB, 25, 8);
    WMSetButtonText(panel->wrapB, _("Always open submenus inside the screen, instead of scrolling.\nNote: this is annoying."));

    panel->autoB = WMCreateSwitchButton(panel->optF);
    WMResizeWidget(panel->autoB, 440, 32);
    WMMoveWidget(panel->autoB, 25, 45);
    WMSetButtonText(panel->autoB, _("Scroll off-screen menus when pointer is moved over them."));

    WMMapSubwidgets(panel->optF);

    WMRealizeWidget(panel->box);
    WMMapSubwidgets(panel->box);

    showData(panel);
}
Ejemplo n.º 6
0
static void createPanel(Panel * p)
{
	_Panel *panel = (_Panel *) p;
	WMScreen *scr = WMWidgetScreen(panel->parent);
	int i;
	WMColor *color;
	WMFont *font;

	color = WMDarkGrayColor(scr);
	font = WMSystemFontOfSize(scr, 10);

	panel->box = WMCreateBox(panel->parent);
	WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);

    /**************** Initial Key Repeat ***************/
	panel->delaF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->delaF, 495, 60);
	WMMoveWidget(panel->delaF, 15, 10);
	WMSetFrameTitle(panel->delaF, _("Initial Key Repeat"));

	for (i = 0; i < 4; i++) {
		panel->delaB[i] = WMCreateButton(panel->delaF, WBTOnOff);
		WMResizeWidget(panel->delaB[i], 60, 20);
		WMMoveWidget(panel->delaB[i], 70 + i * 60, 25);
		if (i > 0)
			WMGroupButtons(panel->delaB[0], panel->delaB[i]);
		switch (i) {
		case 0:
			WMSetButtonText(panel->delaB[i], "....a");
			break;
		case 1:
			WMSetButtonText(panel->delaB[i], "...a");
			break;
		case 2:
			WMSetButtonText(panel->delaB[i], "..a");
			break;
		case 3:
			WMSetButtonText(panel->delaB[i], ".a");
			break;
		}
	}
	panel->dmsT = WMCreateTextField(panel->delaF);
	WMResizeWidget(panel->dmsT, 50, 20);
	WMMoveWidget(panel->dmsT, 345, 25);
	/*    WMSetTextFieldAlignment(panel->dmsT, WARight); */

	panel->dmsL = WMCreateLabel(panel->delaF);
	WMResizeWidget(panel->dmsL, 30, 16);
	WMMoveWidget(panel->dmsL, 400, 30);
	WMSetLabelTextColor(panel->dmsL, color);
	WMSetLabelFont(panel->dmsL, font);
	WMSetLabelText(panel->dmsL, "msec");

	WMMapSubwidgets(panel->delaF);

    /**************** Key Repeat Rate ***************/
	panel->rateF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->rateF, 495, 60);
	WMMoveWidget(panel->rateF, 15, 95);
	WMSetFrameTitle(panel->rateF, _("Key Repeat Rate"));

	for (i = 0; i < 4; i++) {
		panel->rateB[i] = WMCreateButton(panel->rateF, WBTOnOff);
		WMResizeWidget(panel->rateB[i], 60, 20);
		WMMoveWidget(panel->rateB[i], 70 + i * 60, 25);
		if (i > 0)
			WMGroupButtons(panel->rateB[0], panel->rateB[i]);
		switch (i) {
		case 0:
			WMSetButtonText(panel->rateB[i], "a....a");
			break;
		case 1:
			WMSetButtonText(panel->rateB[i], "a...a");
			break;
		case 2:
			WMSetButtonText(panel->rateB[i], "a..a");
			break;
		case 3:
			WMSetButtonText(panel->rateB[i], "a.a");
			break;
		}
	}
	panel->rmsT = WMCreateTextField(panel->rateF);
	WMResizeWidget(panel->rmsT, 50, 20);
	WMMoveWidget(panel->rmsT, 345, 25);
	/*    WMSetTextFieldAlignment(panel->rmsT, WARight); */

	panel->rmsL = WMCreateLabel(panel->rateF);
	WMResizeWidget(panel->rmsL, 30, 16);
	WMMoveWidget(panel->rmsL, 400, 30);
	WMSetLabelTextColor(panel->rmsL, color);
	WMSetLabelFont(panel->rmsL, font);
	WMSetLabelText(panel->rmsL, "msec");

	WMMapSubwidgets(panel->rateF);

	panel->testT = WMCreateTextField(panel->box);
	WMResizeWidget(panel->testT, 480, 20);
	WMMoveWidget(panel->testT, 20, 180);
	WMSetTextFieldText(panel->testT, _("Type here to test"));

	WMReleaseColor(color);
	WMReleaseFont(font);

	WMRealizeWidget(panel->box);
	WMMapSubwidgets(panel->box);
}
Ejemplo n.º 7
0
static InspectorPanel *createInspectorForWindow(WWindow *wwin, int xpos, int ypos, Bool showSelectPanel)
{
	WScreen *scr = wwin->screen_ptr;
	InspectorPanel *panel;
	Window parent;
	char *str = NULL, *tmp = NULL;
	int x, y, btn_width, frame_width;
	WMButton *selectedBtn = NULL;

	spec_text = _("The configuration will apply to all\n"
		      "windows that have their WM_CLASS\n"
		      "property set to the above selected\n" "name, when saved.");

	panel = wmalloc(sizeof(InspectorPanel));
	memset(panel, 0, sizeof(InspectorPanel));

	panel->destroyed = 0;
	panel->inspected = wwin;
	panel->nextPtr = panelList;
	panelList = panel;
	panel->win = WMCreateWindow(scr->wmscreen, "windowInspector");
	WMResizeWidget(panel->win, PWIDTH, PHEIGHT);

	/**** create common stuff ****/
	/* command buttons */
	btn_width = (PWIDTH - (2 * 15) - (2 * 10)) / 3;
	panel->saveBtn = WMCreateCommandButton(panel->win);
	WMSetButtonAction(panel->saveBtn, saveSettings, panel);
	WMMoveWidget(panel->saveBtn, (2 * (btn_width + 10)) + 15, PHEIGHT - 40);
	WMSetButtonText(panel->saveBtn, _("Save"));
	WMResizeWidget(panel->saveBtn, btn_width, 28);
	if (wPreferences.flags.noupdates || !(wwin->wm_class || wwin->wm_instance))
		WMSetButtonEnabled(panel->saveBtn, False);

	panel->applyBtn = WMCreateCommandButton(panel->win);
	WMSetButtonAction(panel->applyBtn, applySettings, panel);
	WMMoveWidget(panel->applyBtn, btn_width + 10 + 15, PHEIGHT - 40);
	WMSetButtonText(panel->applyBtn, _("Apply"));
	WMResizeWidget(panel->applyBtn, btn_width, 28);

	panel->revertBtn = WMCreateCommandButton(panel->win);
	WMSetButtonAction(panel->revertBtn, revertSettings, panel);
	WMMoveWidget(panel->revertBtn, 15, PHEIGHT - 40);
	WMSetButtonText(panel->revertBtn, _("Reload"));
	WMResizeWidget(panel->revertBtn, btn_width, 28);

	/* page selection popup button */
	panel->pagePopUp = WMCreatePopUpButton(panel->win);
	WMSetPopUpButtonAction(panel->pagePopUp, changePage, panel);
	WMMoveWidget(panel->pagePopUp, 25, 15);
	WMResizeWidget(panel->pagePopUp, PWIDTH - 50, 20);

	WMAddPopUpButtonItem(panel->pagePopUp, _("Window Specification"));
	WMAddPopUpButtonItem(panel->pagePopUp, _("Window Attributes"));
	WMAddPopUpButtonItem(panel->pagePopUp, _("Advanced Options"));
	WMAddPopUpButtonItem(panel->pagePopUp, _("Icon and Initial Workspace"));
	WMAddPopUpButtonItem(panel->pagePopUp, _("Application Specific"));

	/**** window spec ****/
	frame_width = PWIDTH - (2 * 15);

	panel->specFrm = WMCreateFrame(panel->win);
	WMSetFrameTitle(panel->specFrm, _("Window Specification"));
	WMMoveWidget(panel->specFrm, 15, 65);
	WMResizeWidget(panel->specFrm, frame_width, 145);

	panel->defaultRb = WMCreateRadioButton(panel->specFrm);
	WMMoveWidget(panel->defaultRb, 10, 78);
	WMResizeWidget(panel->defaultRb, frame_width - (2 * 10), 20);
	WMSetButtonText(panel->defaultRb, _("Defaults for all windows"));
	WMSetButtonSelected(panel->defaultRb, False);
	WMSetButtonAction(panel->defaultRb, selectSpecification, panel);

	if (wwin->wm_class && wwin->wm_instance) {
		tmp = wstrconcat(wwin->wm_instance, ".");
		str = wstrconcat(tmp, wwin->wm_class);

		panel->bothRb = WMCreateRadioButton(panel->specFrm);
		WMMoveWidget(panel->bothRb, 10, 18);
		WMResizeWidget(panel->bothRb, frame_width - (2 * 10), 20);
		WMSetButtonText(panel->bothRb, str);
		wfree(tmp);
		wfree(str);
		WMGroupButtons(panel->defaultRb, panel->bothRb);

		if (!selectedBtn)
			selectedBtn = panel->bothRb;

		WMSetButtonAction(panel->bothRb, selectSpecification, panel);
	}

	if (wwin->wm_instance) {
		panel->instRb = WMCreateRadioButton(panel->specFrm);
		WMMoveWidget(panel->instRb, 10, 38);
		WMResizeWidget(panel->instRb, frame_width - (2 * 10), 20);
		WMSetButtonText(panel->instRb, wwin->wm_instance);
		WMGroupButtons(panel->defaultRb, panel->instRb);

		if (!selectedBtn)
			selectedBtn = panel->instRb;

		WMSetButtonAction(panel->instRb, selectSpecification, panel);
	}

	if (wwin->wm_class) {
		panel->clsRb = WMCreateRadioButton(panel->specFrm);
		WMMoveWidget(panel->clsRb, 10, 58);
		WMResizeWidget(panel->clsRb, frame_width - (2 * 10), 20);
		WMSetButtonText(panel->clsRb, wwin->wm_class);
		WMGroupButtons(panel->defaultRb, panel->clsRb);

		if (!selectedBtn)
			selectedBtn = panel->clsRb;

		WMSetButtonAction(panel->clsRb, selectSpecification, panel);
	}

	panel->selWinB = WMCreateCommandButton(panel->specFrm);
	WMMoveWidget(panel->selWinB, 20, 145 - 24 - 10);
	WMResizeWidget(panel->selWinB, frame_width - 2 * 10 - 20, 24);
	WMSetButtonText(panel->selWinB, _("Select window"));
	WMSetButtonAction(panel->selWinB, selectWindow, panel);

	panel->specLbl = WMCreateLabel(panel->win);
	WMMoveWidget(panel->specLbl, 15, 210);
	WMResizeWidget(panel->specLbl, frame_width, 100);
	WMSetLabelText(panel->specLbl, spec_text);
	WMSetLabelWraps(panel->specLbl, True);

	WMSetLabelTextAlignment(panel->specLbl, WALeft);

	/**** attributes ****/
	create_tab_window_attributes(wwin, panel, frame_width);
	create_tab_window_advanced(wwin, panel, frame_width);
	create_tab_icon_workspace(wwin, panel);
	create_tab_app_specific(wwin, panel, frame_width);

	/* if the window is a transient, don't let it have a miniaturize button */
	if (wwin->transient_for != None && wwin->transient_for != scr->root_win)
		WMSetButtonEnabled(panel->attrChk[3], False);
	else
		WMSetButtonEnabled(panel->attrChk[3], True);

	if (!wwin->wm_class && !wwin->wm_instance)
		WMSetPopUpButtonItemEnabled(panel->pagePopUp, 0, False);

	WMRealizeWidget(panel->win);

	WMMapSubwidgets(panel->win);
	WMMapSubwidgets(panel->specFrm);
	WMMapSubwidgets(panel->attrFrm);
	WMMapSubwidgets(panel->moreFrm);
	WMMapSubwidgets(panel->iconFrm);
	WMMapSubwidgets(panel->wsFrm);
	if (panel->appFrm)
		WMMapSubwidgets(panel->appFrm);

	if (showSelectPanel) {
		WMSetPopUpButtonSelectedItem(panel->pagePopUp, 0);
		changePage(panel->pagePopUp, panel);
	} else {
		WMSetPopUpButtonSelectedItem(panel->pagePopUp, 1);
		changePage(panel->pagePopUp, panel);
	}

	parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, PWIDTH, PHEIGHT, 0, 0, 0);
	XSelectInput(dpy, parent, KeyPressMask | KeyReleaseMask);
	panel->parent = parent;
	XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);

	WMMapWidget(panel->win);

	XSetTransientForHint(dpy, parent, wwin->client_win);

	if (xpos == UNDEFINED_POS) {
		x = wwin->frame_x + wwin->frame->core->width / 2;
		y = wwin->frame_y + wwin->frame->top_width * 2;
		if (y + PHEIGHT > scr->scr_height)
			y = scr->scr_height - PHEIGHT - 30;
		if (x + PWIDTH > scr->scr_width)
			x = scr->scr_width - PWIDTH;
	} else {
		x = xpos;
		y = ypos;
	}

	panel->frame = wManageInternalWindow(scr, parent, wwin->client_win, "Inspector", x, y, PWIDTH, PHEIGHT);

	if (!selectedBtn)
		selectedBtn = panel->defaultRb;

	WMSetButtonSelected(selectedBtn, True);
	selectSpecification(selectedBtn, panel);

	/* kluge to know who should get the key events */
	panel->frame->client_leader = WMWidgetXID(panel->win);

	WSETUFLAG(panel->frame, no_closable, 0);
	WSETUFLAG(panel->frame, no_close_button, 0);
	wWindowUpdateButtonImages(panel->frame);
	wFrameWindowShowButton(panel->frame->frame, WFF_RIGHT_BUTTON);
	panel->frame->frame->on_click_right = destroyInspector;

	wWindowMap(panel->frame);

	showIconFor(WMWidgetScreen(panel->alwChk), panel, wwin->wm_instance, wwin->wm_class, UPDATE_TEXT_FIELD);

	return panel;
}
Ejemplo n.º 8
0
Archivo: Focus.c Proyecto: jafd/wmaker
static void createPanel(Panel * p)
{
	_Panel *panel = (_Panel *) p;
	WMScreen *scr = WMWidgetScreen(panel->parent);
	int i;
	char *buf1, *buf2;
	WMPixmap *icon;
	WMColor *color;
	WMFont *font;

	panel->box = WMCreateBox(panel->parent);
	WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);

    /***************** Input Focus Mode *****************/
	panel->kfocF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->kfocF, 240, 125);
	WMMoveWidget(panel->kfocF, 15, 10);
	WMSetFrameTitle(panel->kfocF, _("Input Focus Mode"));

	{
		WMBox *box = WMCreateBox(panel->kfocF);
		WMSetViewExpandsToParent(WMWidgetView(box), 10, 15, 10, 10);
		WMSetBoxHorizontal(box, False);

		panel->kfocB[0] = WMCreateRadioButton(box);
		WMSetButtonText(panel->kfocB[0], _("Manual:  Click on the window to set "
						   "keyboard input focus."));
		WMAddBoxSubview(box, WMWidgetView(panel->kfocB[0]), True, True, 20, 0, 0);

		panel->kfocB[1] = WMCreateRadioButton(box);
		WMGroupButtons(panel->kfocB[0], panel->kfocB[1]);
		WMSetButtonText(panel->kfocB[1], _("Auto:  Set keyboard input focus to "
						   "the window under the mouse pointer."));
		WMAddBoxSubview(box, WMWidgetView(panel->kfocB[1]), True, True, 20, 0, 0);

		WMMapSubwidgets(box);
		WMMapWidget(box);
	}

    /***************** Colormap Installation Mode ****************/

	panel->cfocF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->cfocF, 240, 77);
	WMMoveWidget(panel->cfocF, 15, 143);
	WMSetFrameTitle(panel->cfocF, _("Install colormap in the window..."));

	panel->manB = WMCreateRadioButton(panel->cfocF);
	WMResizeWidget(panel->manB, 225, 20);
	WMMoveWidget(panel->manB, 10, 20);
	WMSetButtonText(panel->manB, _("...that has the input focus."));

	panel->autB = WMCreateRadioButton(panel->cfocF);
	WMResizeWidget(panel->autB, 225, 20);
	WMMoveWidget(panel->autB, 10, 45);
	WMSetButtonText(panel->autB, _("...that's under the mouse pointer."));
	WMGroupButtons(panel->manB, panel->autB);

	WMMapSubwidgets(panel->cfocF);

    /***************** Automatic window raise delay *****************/
	panel->raisF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->raisF, 245, 68);
	WMMoveWidget(panel->raisF, 265, 10);
	WMSetFrameTitle(panel->raisF, _("Automatic Window Raise Delay"));

	buf1 = wmalloc(strlen(DELAY_ICON) + 1);
	buf2 = wmalloc(strlen(DELAY_ICON_S) + 1);

	for (i = 0; i < 5; i++) {
		char *path;

		panel->raisB[i] = WMCreateCustomButton(panel->raisF, WBBStateChangeMask);
		WMResizeWidget(panel->raisB[i], 25, 25);
		WMMoveWidget(panel->raisB[i], 12 + (30 * i), 25);
		WMSetButtonBordered(panel->raisB[i], False);
		WMSetButtonImagePosition(panel->raisB[i], WIPImageOnly);
		WMSetButtonAction(panel->raisB[i], pushDelayButton, panel);
		if (i > 0)
			WMGroupButtons(panel->raisB[0], panel->raisB[i]);
		sprintf(buf1, DELAY_ICON, i);
		sprintf(buf2, DELAY_ICON_S, i);
		path = LocateImage(buf1);
		if (path) {
			icon = WMCreatePixmapFromFile(scr, path);
			if (icon) {
				WMSetButtonImage(panel->raisB[i], icon);
				WMReleasePixmap(icon);
			} else {
				wwarning(_("could not load icon file %s"), path);
			}
			wfree(path);
		}
		path = LocateImage(buf2);
		if (path) {
			icon = WMCreatePixmapFromFile(scr, path);
			if (icon) {
				WMSetButtonAltImage(panel->raisB[i], icon);
				WMReleasePixmap(icon);
			} else {
				wwarning(_("could not load icon file %s"), path);
			}
			wfree(path);
		}
	}
	wfree(buf1);
	wfree(buf2);

	panel->raisT = WMCreateTextField(panel->raisF);
	WMResizeWidget(panel->raisT, 36, 20);
	WMMoveWidget(panel->raisT, 165, 28);
	WMAddNotificationObserver(raiseTextChanged, panel, WMTextDidChangeNotification, panel->raisT);

	color = WMDarkGrayColor(scr);
	font = WMSystemFontOfSize(scr, 10);

	panel->raisL = WMCreateLabel(panel->raisF);
	WMResizeWidget(panel->raisL, 36, 16);
	WMMoveWidget(panel->raisL, 205, 32);
	WMSetLabelText(panel->raisL, _("msec"));
	WMSetLabelTextColor(panel->raisL, color);
	WMSetLabelFont(panel->raisL, font);

	WMReleaseColor(color);
	WMReleaseFont(font);

	WMMapSubwidgets(panel->raisF);

    /***************** Options ****************/
	panel->optF = WMCreateFrame(panel->box);
	WMResizeWidget(panel->optF, 245, 132);
	WMMoveWidget(panel->optF, 265, 88);

	panel->ignB = WMCreateSwitchButton(panel->optF);
	WMResizeWidget(panel->ignB, 225, 50);
	WMMoveWidget(panel->ignB, 10, 4);
	WMSetButtonText(panel->ignB, _("Do not let applications receive " "the click used to focus windows."));

	panel->newB = WMCreateSwitchButton(panel->optF);
	WMResizeWidget(panel->newB, 225, 35);
	WMMoveWidget(panel->newB, 10, 49);
	WMSetButtonText(panel->newB, _("Automatically focus new windows."));

	panel->craisB = WMCreateSwitchButton(panel->optF);
	WMResizeWidget(panel->craisB, 225, 36);
	WMMoveWidget(panel->craisB, 10, 85);
	WMSetButtonText(panel->craisB, _("Raise window when switching\nfocus with keyboard."));

	WMMapSubwidgets(panel->optF);

	WMRealizeWidget(panel->box);
	WMMapSubwidgets(panel->box);

	showData(panel);
}