Beispiel #1
0
WMTabViewItem *WMAddTabViewItemWithView(WMTabView * tPtr, WMView * view, int identifier, const char *label)
{
	WMTabViewItem *item;

	item = WMCreateTabViewItemWithIdentifier(identifier);
	WMSetTabViewItemView(item, view);
	WMAddItemInTabView(tPtr, item);
	WMSetTabViewItemLabel(item, label);

	return item;
}
Beispiel #2
0
void testTabView(WMScreen * scr)
{
	WMWindow *win;
	WMTabView *tabv;
	WMTabViewItem *tab;
	WMFrame *frame;
	WMLabel *label;

	windowCount++;

	win = WMCreateWindow(scr, "testTabs");
	WMResizeWidget(win, 400, 300);

	WMSetWindowCloseAction(win, closeAction, NULL);

	tabv = WMCreateTabView(win);
	WMMoveWidget(tabv, 50, 50);
	WMResizeWidget(tabv, 300, 200);

	frame = WMCreateFrame(win);
	WMSetFrameRelief(frame, WRFlat);
	label = WMCreateLabel(frame);
	WMResizeWidget(label, 100, 100);
	WMSetLabelText(label, "Label 1");
	WMMapWidget(label);

	tab = WMCreateTabViewItemWithIdentifier(0);
	WMSetTabViewItemView(tab, WMWidgetView(frame));
	WMAddItemInTabView(tabv, tab);
	WMSetTabViewItemLabel(tab, "Instances");

	frame = WMCreateFrame(win);
	WMSetFrameRelief(frame, WRFlat);
	label = WMCreateLabel(frame);
	WMResizeWidget(label, 40, 50);
	WMSetLabelText(label, "Label 2");
	WMMapWidget(label);

	tab = WMCreateTabViewItemWithIdentifier(0);
	WMSetTabViewItemView(tab, WMWidgetView(frame));
	WMAddItemInTabView(tabv, tab);
	WMSetTabViewItemLabel(tab, "Classes");

	frame = WMCreateFrame(win);
	WMSetFrameRelief(frame, WRFlat);
	label = WMCreateLabel(frame);
	WMResizeWidget(label, 100, 100);
	WMMoveWidget(label, 60, 40);
	WMSetLabelText(label, "Label 3");
	WMMapWidget(label);

	tab = WMCreateTabViewItemWithIdentifier(0);
	WMSetTabViewItemView(tab, WMWidgetView(frame));
	WMAddItemInTabView(tabv, tab);
	WMSetTabViewItemLabel(tab, "Something");

	frame = WMCreateFrame(win);
	WMSetFrameRelief(frame, WRFlat);
	label = WMCreateLabel(frame);
	WMResizeWidget(label, 100, 100);
	WMMoveWidget(label, 160, 40);
	WMSetLabelText(label, "Label 4");
	WMMapWidget(label);

	tab = WMCreateTabViewItemWithIdentifier(0);
	WMSetTabViewItemView(tab, WMWidgetView(frame));
	WMAddItemInTabView(tabv, tab);
	WMSetTabViewItemLabel(tab, "Bla!");

	frame = WMCreateFrame(win);
	WMSetFrameRelief(frame, WRFlat);
	label = WMCreateLabel(frame);
	WMResizeWidget(label, 100, 100);
	WMMoveWidget(label, 160, 40);
	WMSetLabelText(label, "Label fjweqklrj qwl");
	WMMapWidget(label);
	tab = WMCreateTabViewItemWithIdentifier(0);
	WMSetTabViewItemView(tab, WMWidgetView(frame));
	WMAddItemInTabView(tabv, tab);
	WMSetTabViewItemLabel(tab, "Weee!");

	WMRealizeWidget(win);
	WMMapSubwidgets(win);
	WMMapWidget(win);
}
Beispiel #3
0
static void
createPanel(Panel *p)
{
    _Panel *panel = (_Panel*)p;
    WMScreen *scr = WMWidgetScreen(panel->parent);
    WMTabViewItem *tab;

    panel->white = WMWhiteColor(scr);
    panel->black = WMBlackColor(scr);
    panel->gray = WMGrayColor(scr);
    panel->red = WMCreateRGBColor(scr, 0xffff, 0, 0, True);
    panel->font = WMSystemFontOfSize(scr, 12);

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


    panel->tabv = WMCreateTabView(panel->box);
    WMMoveWidget(panel->tabv, 12, 10);
    WMResizeWidget(panel->tabv, 500, 215);



    /* icon path */
    panel->icoF = WMCreateFrame(panel->box);
    WMSetFrameRelief(panel->icoF, WRFlat);
    WMResizeWidget(panel->icoF, 230, 210);

    tab = WMCreateTabViewItemWithIdentifier(0);
    WMSetTabViewItemView(tab, WMWidgetView(panel->icoF));
    WMAddItemInTabView(panel->tabv, tab);
    WMSetTabViewItemLabel(tab, _("Icon Search Paths"));

    panel->icoL = WMCreateList(panel->icoF);
    WMResizeWidget(panel->icoL, 480, 147);
    WMMoveWidget(panel->icoL, 10, 10);
    WMSetListUserDrawProc(panel->icoL, paintItem);
    WMHangData(panel->icoL, panel);

    panel->icoaB = WMCreateCommandButton(panel->icoF);
    WMResizeWidget(panel->icoaB, 95, 24);
    WMMoveWidget(panel->icoaB, 293, 165);
    WMSetButtonText(panel->icoaB, _("Add"));
    WMSetButtonAction(panel->icoaB, browseForFile, panel);
    WMSetButtonImagePosition(panel->icoaB, WIPRight);

    panel->icorB = WMCreateCommandButton(panel->icoF);
    WMResizeWidget(panel->icorB, 95, 24);
    WMMoveWidget(panel->icorB, 395, 165);
    WMSetButtonText(panel->icorB, _("Remove"));
    WMSetButtonAction(panel->icorB, pushButton, panel);

    WMMapSubwidgets(panel->icoF);

    /* pixmap path */
    panel->pixF = WMCreateFrame(panel->box);
    WMSetFrameRelief(panel->pixF, WRFlat);
    WMResizeWidget(panel->pixF, 230, 210);

    tab = WMCreateTabViewItemWithIdentifier(0);
    WMSetTabViewItemView(tab, WMWidgetView(panel->pixF));
    WMAddItemInTabView(panel->tabv, tab);
    WMSetTabViewItemLabel(tab, _("Pixmap Search Paths"));

    panel->pixL = WMCreateList(panel->pixF);
    WMResizeWidget(panel->pixL, 480, 147);
    WMMoveWidget(panel->pixL, 10, 10);
    WMSetListUserDrawProc(panel->pixL, paintItem);
    WMHangData(panel->pixL, panel);

    panel->pixaB = WMCreateCommandButton(panel->pixF);
    WMResizeWidget(panel->pixaB, 95, 24);
    WMMoveWidget(panel->pixaB, 293, 165);
    WMSetButtonText(panel->pixaB, _("Add"));
    WMSetButtonAction(panel->pixaB, browseForFile, panel);
    WMSetButtonImagePosition(panel->pixaB, WIPRight);

    panel->pixrB = WMCreateCommandButton(panel->pixF);
    WMResizeWidget(panel->pixrB, 95, 24);
    WMMoveWidget(panel->pixrB, 395, 165);
    WMSetButtonText(panel->pixrB, _("Remove"));
    WMSetButtonAction(panel->pixrB, pushButton, panel);


    WMMapSubwidgets(panel->pixF);

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

    showData(panel);
}