Esempio n. 1
0
void Ctrl::ExitWin32()
{
	RenderAllFormats();

	OleUninitialize();

	sFinished = true;
	for(int i = 0; i < Windows().GetCount(); i++) {
		HWND hwnd = Windows().GetKey(i);
		if(hwnd)
			::DestroyWindow(hwnd);
	}
	MSG msg;
	while(PeekMsg(msg))
		if(msg.message != WM_QUIT)
			::PostQuitMessage(0);
#ifndef flagDLL
#ifndef PLATFORM_WINCE
	ELOG("ExitWin32 1");
	OverwatchEndSession.Set();
	ELOG("ExitWin32 2");
	PostMessage(OverwatchHWND, WM_USER, 0, 0);
	ELOG("ExitWin32 3");
	LLOG("Waiting for overwatch thread to finish...");
	WaitForSingleObject(OverwatchThread, INFINITE);
	ELOG("ExitWin32 4");
	LLOG("...overwatch thread finished");
#endif
#endif
}
Esempio n. 2
0
//==============================================================================================
UrpWindowFactory::~UrpWindowFactory() {
	for (int i = 0; i < Windows().GetCount(); i++) {
		UrpConfigWindow *window = Windows()[i];
		for (int j = 0; j < window->ctrls.GetCount(); j++) {
			Ctrl * c = window->ctrls[j];
			delete c;
		}
		delete window;
	}
}
Esempio n. 3
0
//==============================================================================================
UrpConfigWindow * UrpWindowFactory::Open(UrpTopWindow *ptopWindow, String pwindowName) {
	// Use this clumsy method of Get/GetAdd to avoid creating a new window on the heap that just 
	// floats off into space when a match is found on the stack
	UrpConfigWindow *window = Windows().Get(pwindowName, (UrpConfigWindow *)NULL);
	if (!window) {
		window = Windows().GetAdd(pwindowName, new UrpConfigWindow(ptopWindow, pwindowName));
		window->wasCreatedNew = true;
	} else {
		window->wasCreatedNew = false; // Let caller know if we created so they can create controls to add.
	}
	window->Sizeable().Zoomable().NoCenter();
	return window;
}
Esempio n. 4
0
Vector<Ctrl *> Ctrl::GetTopCtrls()
{
	Vector<Ctrl *> v;
	VectorMap< HWND, Ptr<Ctrl> >& w = Windows();
	for(int i = 0; i < w.GetCount(); i++)
		if(w.GetKey(i) && w[i] && !w[i]->parent)
			v.Add(w[i]);
	return v;
}
Esempio n. 5
0
LRESULT CALLBACK Ctrl::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	GuiLock __;
	if(sFinished)
		return DefWindowProc(hWnd, message, wParam, lParam);
#ifdef PLATFORM_WINCE
	if(message == WM_CREATE)
#else
	if(message == WM_NCCREATE)
#endif
	{
		Ctrl *w = (Ctrl *)((LPCREATESTRUCT) lParam)->lpCreateParams;
		if(w) {
			w->NcCreate(hWnd);
			int i = Windows().Find(NULL);
			if(i >= 0) {
				Windows().SetKey(i, hWnd);
				Windows()[i] = w;
			}
			else
				Windows().Add(hWnd) = w;
		}
	}
	Ctrl *w = Windows().Get(hWnd, NULL);
#ifdef PLATFORM_WINCE
	if(message == WM_DESTROY)
#else
	if(message == WM_NCDESTROY)
#endif
	{
		if(w) w->NcDestroy();
		int i = Windows().Find(hWnd);
		if(i >= 0)
			Windows().SetKey(i, NULL);
	}
#if LOGMESSAGES
	bool logblk = false;
	if(message != WM_SETCURSOR && message != WM_CTLCOLORBTN && message != WM_TIMER &&
#ifndef PLATFORM_WINCE
	   message != WM_NCHITTEST  &&  message != WM_ENTERIDLE &&
#endif
	   message != WM_CTLCOLORDLG && message != WM_CTLCOLOREDIT && message != WM_CTLCOLORLISTBOX &&
	   message != WM_CTLCOLORMSGBOX && message != WM_CTLCOLORSCROLLBAR &&
	   message != WM_CTLCOLORSTATIC && message != WM_CANCELMODE &&
	   message != 0x0118)
		for(WinMsg *m = sWinMsg; m->ID; m++)
			if(m->ID == message) {
				RLOG(m->name << ' ' << UPP::Name(w) <<
					Sprintf(", wParam = %d (0x%x), lParam = %d (0x%x)",
					       wParam, wParam, lParam, lParam));
				VppLog() << LOG_BEGIN;
				logblk = true;
				break;
			}
#endif
	LRESULT l = 0;
	if(w) {
#if defined(_DEBUG) && LOGTIMING
			int ticks = msecs();
			String wname = w->Name();
#endif
			Ptr<Ctrl> pw = w;
			l = w->WindowProc(message, wParam, lParam);
			if(pw)
				pw->SyncMoves();
#if defined(_DEBUG) && LOGTIMING
			String msgname;
			for(WinMsg *m = sWinMsg; m->ID; m++)
				if(m->ID == message) {
					msgname = m->name;
					break;
				}
			if(IsNull(msgname))
				msgname = NFormat("0x%04x", (int)message);
			LLOG(NFormat("T+%d %s 0x%08x 0x%08x -> %s", msecs(ticks), msgname, (int)wParam, (int)lParam, wname));
#endif
	}
	else
		l = DefWindowProc(hWnd, message, wParam, lParam);
#if LOGMESSAGES
	if(logblk)
		VppLog() << LOG_END;
#endif
	return l;
}
Esempio n. 6
0
Ctrl *Ctrl::CtrlFromHWND(HWND hwnd)
{
	GuiLock __;
	return hwnd ? Windows().Get(hwnd, NULL) : NULL;
}
Esempio n. 7
0
void Ctrl::InitWin32(HINSTANCE hInstance)
{
	GuiLock __;
	LLOG("InitWin32");

	InstallPanicMessageBox(&Win32PanicMessageBox);
//	RLOGBLOCK("Ctrl::InitWin32");
	sMainThreadId = GetCurrentThreadId();
#define ILOG(x) // RLOG(x)
	Ctrl::hInstance = hInstance;
	ILOG("RegisterClassW");
#ifndef PLATFORM_WINCE
	if(IsWinNT())
#endif
	{
		WNDCLASSW  wc;
		Zero(wc);
		wc.style         = CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
		wc.lpfnWndProc   = (WNDPROC)Ctrl::WndProc;
		wc.hInstance     = hInstance;
		wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
		wc.hbrBackground = IsWinVista() ? (HBRUSH)(COLOR_WINDOW+1) : (HBRUSH)NULL;
		wc.lpszClassName = L"UPP-CLASS-W";
		RegisterClassW(&wc);
		wc.style         = 0x20000|CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
		wc.lpszClassName = L"UPP-CLASS-DS-W";
		RegisterClassW(&wc);
		wc.style         = CS_SAVEBITS|CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
		wc.lpszClassName = L"UPP-CLASS-SB-W";
		RegisterClassW(&wc);
		wc.style         = 0x20000|CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW|CS_SAVEBITS;
		wc.lpszClassName = L"UPP-CLASS-SB-DS-W";
		RegisterClassW(&wc);
	}

	ILOG("RegisterClassA");
	WNDCLASS  wc;
	Zero(wc);
	wc.style         = CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
	wc.lpfnWndProc   = (WNDPROC)Ctrl::WndProc;
	wc.hInstance     = hInstance;
	wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = IsWinVista() ? (HBRUSH)(COLOR_WINDOW+1) : (HBRUSH)NULL;
	wc.lpszClassName = L_("UPP-CLASS-A");
	RegisterClass(&wc);
	if(IsWinXP()) {
		wc.style         = 0x20000|CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
		wc.lpszClassName = L_("UPP-CLASS-DS-A");
		RegisterClass(&wc);
	}
	wc.style         = CS_SAVEBITS|CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
	wc.lpszClassName = L_("UPP-CLASS-SB-A");
	RegisterClass(&wc);
	if(IsWinXP()) {
		wc.style         = 0x20000|CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW|CS_SAVEBITS;
		wc.lpszClassName = L_("UPP-CLASS-SB-DS-A");
		RegisterClass(&wc);
	}
	wc.style         = 0;
	wc.lpszClassName = L_("UPP-TIMER");
	wc.hCursor       = NULL;
	wc.lpfnWndProc   = &Ctrl::UtilityProc;
	RegisterClass(&wc);

	ILOG("InitTimer");
	InitTimer();
	ILOG("SetTimer");
	utilityHWND = CreateWindow(L_("UPP-TIMER"), L_(""), WS_OVERLAPPED,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
		NULL, NULL, hInstance, NULL);
	SetTimer(utilityHWND, 1, 10, NULL);
	ILOG("Windows");
	Windows(); //?? TRC: what's the use of this?

	ReSkin();

	OleInitialize(NULL);

/* TRC 05/11/14: moved to GuiSleep to avoid thread creation in OCX DllMain
	DWORD dummy;
	OverwatchThread = CreateThread(NULL, 0x100000, Win32OverwatchThread, NULL, 0, &dummy);
	ExitLoopEvent().Wait();
*/

// TRC 05/11/18: pSetLayeredWindowAttributes moved to GLOBAL_VAR (see below) to make OCX initialization simpler

	Csizeinit();
#undef ILOG

	if(IsWin7())
		GlobalBackPaint();
}
Esempio n. 8
0
/*
 * Create the form hierarchy of widgets.
 */
Widget
Createform(Widget parent)
{
    Arg      args[256];
    Cardinal ac=0;
    Boolean  argok=False;
    Widget   form;
    Widget   tabStack;
    Widget   scrolledWindow;
    Widget   text;
    Widget   form1;
    Widget   frame;
    Widget   form2;
    Widget   radioBox1;
    Widget   toggleButton4;
    Widget   toggleButton5;
    Widget   toggleButton6;
    Widget   label4;
    Widget   radioBox;
    Widget   toggleButton;
    Widget   toggleButton1;
    Widget   toggleButton2;
    Widget   toggleButton3;
    Widget   label3;
    Widget   tabStack1;
    Widget   label;
    Widget   label1;
    Widget   label2;
    Widget   separator;
    Widget   pushButton;

    /*
     * Register the converters for the widgets.
     */
    RegisterBxConverters(XtWidgetToApplicationContext(parent));
    XtInitializeWidgetClass(xmFormWidgetClass);
    XtInitializeWidgetClass(xmTabStackWidgetClass);
    XtInitializeWidgetClass(xmScrolledWindowWidgetClass);
    XtInitializeWidgetClass(xmTextWidgetClass);
    XtInitializeWidgetClass(xmFrameWidgetClass);
    XtInitializeWidgetClass(xmRowColumnWidgetClass);
    XtInitializeWidgetClass(xmToggleButtonWidgetClass);
    XtInitializeWidgetClass(xmLabelWidgetClass);
    XtInitializeWidgetClass(xmSeparatorWidgetClass);
    XtInitializeWidgetClass(xmPushButtonWidgetClass);

    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW);
    ac++;
    XtSetArg(args[ac], XmNdialogTitle,
             CONVERT(parent, "EnhancementPak TabStack Demo",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, 333);
    ac++;
    XtSetArg(args[ac], XmNy, 277);
    ac++;
    XtSetArg(args[ac], XmNwidth, 839);
    ac++;
    XtSetArg(args[ac], XmNheight, 508);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    form = XmCreateForm(parent,
                        "form",
                        args,
                        ac);

    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW);
    ac++;
    XtSetArg(args[ac], XmNx, 10);
    ac++;
    XtSetArg(args[ac], XmNy, 10);
    ac++;
    XtSetArg(args[ac], XmNwidth, 818);
    ac++;
    XtSetArg(args[ac], XmNheight, 436);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    tabStack = XmCreateTabStack(form,
                                "tabStack",
                                args,
                                ac);
    XtManageChild(tabStack);

    ac = 0;
    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED);
    ac++;
    XtSetArg(args[ac], XmNx, -794);
    ac++;
    XtSetArg(args[ac], XmNy, 56);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    scrolledWindow = XmCreateScrolledWindow(tabStack,
                                            "scrolledWindow",
                                            args,
                                            ac);
    XtManageChild(scrolledWindow);

    ac = 0;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "LightBlue",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNvalue, "The XmTabStack widget manages a group of widgets such that only one widget\n\
in the group is visible at a time. Each child is associated with a \"tab\"\n\
that displays a text label and/or a pixmap. By selecting the \"tab\" the user\n\
interactively determines which child is displayed. This widget exhibits\n\
behavior similar to the Microsoft Windows(TM) Tab Control.\n\
\n\
The tabs can be configured to appear above, below, to the right, and to the\n\
left of a work area with the text oriented in any of the four cardinal\n\
directions.\n\
\n\
The TabStack allows the user to select, either by pointer or keyboard\n\
traversal, tabs.  When a tab is selected it changes appearance so that it\n\
appears to be raised above the other tabs.  When a tab is selected the\n\
child associated with the tab is made visible. One tab is selected at all\n\
times."); 
    ac++;
    XtSetArg(args[ac], XmNeditMode, XmMULTI_LINE_EDIT);
    ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    text = XmCreateText(scrolledWindow,
                        "text",
                        args,
                        ac);
    XtManageChild(text);

    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW);
    ac++;
    XtSetArg(args[ac], XmNx, 12);
    ac++;
    XtSetArg(args[ac], XmNy, 56);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    form1 = XmCreateForm(tabStack,
                         "form1",
                         args,
                         ac);
    XtManageChild(form1);

    ac = 0;
    XtSetArg(args[ac], XmNshadowType, XmSHADOW_IN);
    ac++;
    XtSetArg(args[ac], XmNx, 484);
    ac++;
    XtSetArg(args[ac], XmNy, 10);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    frame = XmCreateFrame(form1,
                          "frame",
                          args,
                          ac);
    XtManageChild(frame);

    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW);
    ac++;
    XtSetArg(args[ac], XmNx, 2);
    ac++;
    XtSetArg(args[ac], XmNy, 2);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    form2 = XmCreateForm(frame,
                         "form2",
                         args,
                         ac);
    XtManageChild(form2);

    ac = 0;
    XtSetArg(args[ac], XmNisHomogeneous, False);
    ac++;
    XtSetArg(args[ac], XmNnumColumns, 2);
    ac++;
    XtSetArg(args[ac], XmNx, 89);
    ac++;
    XtSetArg(args[ac], XmNy, 89);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    radioBox1 = XmCreateRadioBox(form2,
                                 "radioBox1",
                                 args,
                                 ac);
    XtManageChild(radioBox1);

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Round",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton4 = XmCreateToggleButton(radioBox1,
                                         "toggleButton4",
                                         args,
                                         ac);
    XtManageChild(toggleButton4);
    XtAddCallback(toggleButton4, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabStyle=rounded");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Beveled",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNset, True);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton5 = XmCreateToggleButton(radioBox1,
                                         "toggleButton5",
                                         args,
                                         ac);
    XtManageChild(toggleButton5);
    XtAddCallback(toggleButton5, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabStyle=beveled");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Square",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton6 = XmCreateToggleButton(radioBox1,
                                         "toggleButton6",
                                         args,
                                         ac);
    XtManageChild(toggleButton6);
    XtAddCallback(toggleButton6, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabStyle=squared");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Corners:",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, 10);
    ac++;
    XtSetArg(args[ac], XmNy, 89);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    label4 = XmCreateLabel(form2,
                           "label4",
                           args,
                           ac);
    XtManageChild(label4);

    ac = 0;
    XtSetArg(args[ac], XmNisHomogeneous, False);
    ac++;
    XtSetArg(args[ac], XmNnumColumns, 2);
    ac++;
    XtSetArg(args[ac], XmNx, 92);
    ac++;
    XtSetArg(args[ac], XmNy, 10);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    radioBox = XmCreateRadioBox(form2,
                                "radioBox",
                                args,
                                ac);
    XtManageChild(radioBox);

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Top",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNset, True);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton = XmCreateToggleButton(radioBox,
                                        "toggleButton",
                                        args,
                                        ac);
    XtManageChild(toggleButton);
    XtAddCallback(toggleButton, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=top");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Bottom",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton1 = XmCreateToggleButton(radioBox,
                                         "toggleButton1",
                                         args,
                                         ac);
    XtManageChild(toggleButton1);
    XtAddCallback(toggleButton1, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=bottom");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Right",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton2 = XmCreateToggleButton(radioBox,
                                         "toggleButton2",
                                         args,
                                         ac);
    XtManageChild(toggleButton2);
    XtAddCallback(toggleButton2, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=right");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Left",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    toggleButton3 = XmCreateToggleButton(radioBox,
                                         "toggleButton3",
                                         args,
                                         ac);
    XtManageChild(toggleButton3);
    XtAddCallback(toggleButton3, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=left");

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Tabs On:",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, 10);
    ac++;
    XtSetArg(args[ac], XmNy, 10);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    label3 = XmCreateLabel(form2,
                           "label3",
                           args,
                           ac);
    XtManageChild(label3);

    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW);
    ac++;
    XtSetArg(args[ac], XmNheight, 276);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    tabStack1 = XmCreateTabStack(form1,
                                 "tabStack1",
                                 args,
                                 ac);
    XtManageChild(tabStack1);

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, ":::t\"Sample TabStack\"\"Label One\"",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, 12);
    ac++;
    XtSetArg(args[ac], XmNy, 50);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    label = XmCreateLabel(tabStack1,
                          "label",
                          args,
                          ac);
    XtManageChild(label);

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, ":::t\"Sample TabStack\"\"Label Two\"",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, -441);
    ac++;
    XtSetArg(args[ac], XmNy, 50);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    label1 = XmCreateLabel(tabStack1,
                           "label1",
                           args,
                           ac);
    XtManageChild(label1);

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, ":::t\"Sample TabStack\"\"Label Three\"",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, -441);
    ac++;
    XtSetArg(args[ac], XmNy, 50);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    label2 = XmCreateLabel(tabStack1,
                           "label2",
                           args,
                           ac);
    XtManageChild(label2);

    ac = 0;
    XtSetArg(args[ac], XmNx, 9);
    ac++;
    XtSetArg(args[ac], XmNy, 456);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    separator = XmCreateSeparator(form,
                                  "separator",
                                  args,
                                  ac);
    XtManageChild(separator);

    ac = 0;
    XtSetArg(args[ac], XmNlabelString,
             CONVERT(parent, "Quit",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNx, 784);
    ac++;
    XtSetArg(args[ac], XmNy, 468);
    ac++;
    XtSetArg(args[ac], XmNbackground,
             CONVERT(parent, "#ccc",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNfontList,
             CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
                     XmRFontList, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNforeground,
             CONVERT(parent, "Black",
                     XmRPixel, 0, &argok));
    if (argok) ac++;
    pushButton = XmCreatePushButton(form,
                                    "pushButton",
                                    args,
                                    ac);
    XtManageChild(pushButton);
    XtAddCallback(pushButton, XmNactivateCallback, BxExitCB, (XtPointer)0);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNbottomWidget, separator);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNleftOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 11);
    ac++;
    XtSetValues(tabStack, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtabLabelString,
             CONVERT(parent, "Description",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetValues(scrolledWindow, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtabLabelString,
             CONVERT(parent, "Resources",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetArg(args[ac], XmNtabLabelPixmap, XPM_PIXMAP(parent, allviewpix_icon));
    ac++;
    XtSetValues(form1, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 10);
    ac++;
    XtSetValues(frame, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_POSITION);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNtopWidget, radioBox);
    ac++;
    XtSetArg(args[ac], XmNleftPosition, 30);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 10);
    ac++;
    XtSetValues(radioBox1, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNtopWidget, radioBox1);
    ac++;
    XtSetArg(args[ac], XmNbottomWidget, radioBox1);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 0);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0);
    ac++;
    XtSetArg(args[ac], XmNleftOffset, 10);
    ac++;
    XtSetValues(label4, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_POSITION);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNleftPosition, 31);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 10);
    ac++;
    XtSetValues(radioBox, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNtopWidget, radioBox);
    ac++;
    XtSetArg(args[ac], XmNbottomWidget, radioBox);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 0);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0);
    ac++;
    XtSetArg(args[ac], XmNleftOffset, 10);
    ac++;
    XtSetValues(label3, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNrightWidget, frame);
    ac++;
    XtSetArg(args[ac], XmNtopOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 82);
    ac++;
    XtSetArg(args[ac], XmNleftOffset, 9);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 10);
    ac++;
    XtSetValues(tabStack1, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtabLabelString,
             CONVERT(parent, "One",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetValues(label, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtabLabelString,
             CONVERT(parent, "Two",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetValues(label1, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtabLabelString,
             CONVERT(parent, "Three",
                     XmRXmString, 0, &argok));
    if (argok) ac++;
    XtSetValues(label2, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNbottomWidget, pushButton);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNleftOffset, 9);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 10);
    ac++;
    XtSetValues(separator, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE);
    ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE);
    ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
    ac++;
    XtSetArg(args[ac], XmNbottomOffset, 10);
    ac++;
    XtSetArg(args[ac], XmNrightOffset, 10);
    ac++;
    XtSetValues(pushButton, args, ac);

    return( form );
}