home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- *
- * xdbx - X Window System interface to dbx
- *
- * Copyright 1989 The University of Texas at Austin
- *
- * Author: Po Cheung
- * Date: March 10, 1989
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation. The University of Texas at Austin makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- ******************************************************************************/
-
-
- #include "global.h"
-
- /*
- * Private routines for creating various subwindows for xdbx.
- */
-
- static void CreateTitleBar(parent)
- Widget parent;
- {
- Arg args[MAXARGS];
- Cardinal n;
-
- n = 0;
- XtSetArg(args[n], XtNlabel, (XtArgVal) TITLE); n++;
- XtSetArg(args[n], XtNwidth, (XtArgVal) app_resources.shellWidth); n++;
- XtSetArg(args[n], XtNjustify, (XtArgVal) XtJustifyCenter); n++;
- XtSetArg(args[n], XtNresize, (XtArgVal) False); n++;
- titleBar = XtCreateManagedWidget("titleBar", labelWidgetClass, parent,
- args, n);
- }
-
- static void CreateFileLabel(parent)
- Widget parent;
- {
- Arg args[MAXARGS];
- Cardinal n;
-
- n = 0;
- XtSetArg(args[n], XtNlabel, (XtArgVal) "No Source File"); n++;
- XtSetArg(args[n], XtNwidth, (XtArgVal) app_resources.shellWidth); n++;
- XtSetArg(args[n], XtNborderWidth, (XtArgVal) 0); n++;
- XtSetArg(args[n], XtNjustify, (XtArgVal) XtJustifyCenter); n++;
- XtSetArg(args[n], XtNresizable, (XtArgVal) False); n++;
- fileLabel = XtCreateManagedWidget("fileLabel", labelWidgetClass,
- parent, args, n);
- }
-
- static void CreateLineLabel(parent)
- Widget parent;
- {
- Arg args[MAXARGS];
- Cardinal n;
- int horizDistance;
-
- horizDistance = app_resources.shellWidth - app_resources.lineLabelWidth;
- n = 0;
- XtSetArg(args[n], XtNlabel, (XtArgVal) ""); n++;
- XtSetArg(args[n], XtNwidth, (XtArgVal) app_resources.lineLabelWidth); n++;
- XtSetArg(args[n], XtNborderWidth, (XtArgVal) 0); n++;
- XtSetArg(args[n], XtNresizable, (XtArgVal) False); n++;
- XtSetArg(args[n], XtNhorizDistance, (XtArgVal) horizDistance); n++;
- lineLabel = XtCreateManagedWidget("lineLabel", labelWidgetClass,
- parent, args, n);
- }
-
- static void CreateFileWindow(parent)
- Widget parent;
- {
- Arg args[MAXARGS];
- Cardinal n;
-
- n = 0;
- XtSetArg(args[n], XtNdefaultDistance, 0); n++;
- fileWindow = XtCreateManagedWidget("fileWindow", formWidgetClass,
- parent, args, n);
- CreateLineLabel(fileWindow);
- CreateFileLabel(fileWindow);
- }
-
- static void CreateMessageWindow(parent)
- Widget parent;
- {
- Arg args[MAXARGS];
- Cardinal n;
-
- n = 0;
- XtSetArg(args[n], XtNlabel, (XtArgVal) ""); n++;
- XtSetArg(args[n], XtNwidth, (XtArgVal) app_resources.shellWidth); n++;
- XtSetArg(args[n], XtNjustify, (XtArgVal) XtJustifyLeft); n++;
- XtSetArg(args[n], XtNresize, (XtArgVal) False); n++;
- XtSetArg(args[n], XtNmin, (XtArgVal) app_resources.messageHeight); n++;
- XtSetArg(args[n], XtNmax, (XtArgVal) app_resources.messageHeight); n++;
- XtSetArg(args[n], XtNallowResize, (XtArgVal) False); n++;
- messageWindow = XtCreateManagedWidget("messageWindow", labelWidgetClass,
- parent, args, n);
- }
-
- /*
- * Top level function for creating all the xdbx subwindows.
- */
- void CreateSubWindows(parent)
- Widget parent;
- {
- Arg args[MAXARGS];
- Cardinal n;
-
- n = 0;
- XtSetArg(args[n], XtNwidth, (XtArgVal) app_resources.shellWidth); n++;
- vpane = XtCreateManagedWidget("vpane", vPanedWidgetClass, parent, args, n);
-
- if (!app_resources.noTitleBar) CreateTitleBar(vpane);
- CreateFileWindow(vpane);
- CreateSourceWindow(vpane);
- CreateMessageWindow(vpane);
- CreateCommandPanel(vpane);
- CreateDialogWindow(vpane);
- }
-
- /*
- * Public routines for updating fields for the filename and line number
- * in the file window, and the execution status in the message window.
- */
-
- void UpdateFileLabel(string)
- char *string;
- {
- Arg args[MAXARGS];
- Cardinal n;
-
- n = 0;
- XtSetArg(args[n], XtNlabel, (XtArgVal) string); n++;
- XtSetValues(fileLabel, args, n);
- }
-
- void UpdateLineLabel(line)
- Cardinal line;
- {
- Arg args[MAXARGS];
- Cardinal n;
- char string[10];
-
- n = 0;
- if (line > 0)
- sprintf(string, "%d", line);
- else
- strcpy(string, "");
- XtSetArg(args[n], XtNlabel, (XtArgVal) string); n++;
- XtSetValues(lineLabel, args, n);
- }
-
- void UpdateMessageWindow(message)
- char *message;
- {
- char string[LINESIZ];
- Arg args[MAXARGS];
- Cardinal n;
-
- strcpy(string, " ");
- strcat(string, message);
- n = 0;
- XtSetArg(args[n], XtNlabel, (XtArgVal) string); n++;
- XtSetValues(messageWindow, args, n);
- }
-