00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
00032
00033 #include "G4OpenGLXmViewer.hh"
00034 #include "G4OpenGLXmTopLevelShell.hh"
00035 #include "G4OpenGLXmVWidgetContainer.hh"
00036
00037 #include <Xm/Frame.h>
00038 #include <Xm/RowColumn.h>
00039
00040 G4OpenGLXmTopLevelShell::G4OpenGLXmTopLevelShell (G4OpenGLXmViewer* v,
00041 char* n)
00042 {
00043 pView = v;
00044 ProcesspView ();
00045 name = n;
00046 toplevel = XtVaCreatePopupShell
00047 (name,
00048 topLevelShellWidgetClass,
00049 top,
00050
00051 XtNiconName, name,
00052 XtNtitle, name,
00053 XmNdeleteResponse, XmDO_NOTHING,
00054 XmNisHomogeneous, False,
00055
00056 XtNvisual, visual,
00057 XtNdepth, depth,
00058 XtNcolormap, cmap,
00059 XtNborderColor, borcol,
00060 XtNbackground, bgnd,
00061 NULL);
00062
00063 frame = XtVaCreateManagedWidget (name,
00064 xmFrameWidgetClass,
00065 toplevel,
00066
00067 XtNvisual, visual,
00068 XtNdepth, depth,
00069 XtNcolormap, cmap,
00070 XtNborderColor, borcol,
00071 XtNbackground, bgnd,
00072
00073 NULL);
00074
00075
00076
00077 top_box = XtVaCreateManagedWidget (name,
00078 xmRowColumnWidgetClass,
00079 frame,
00080
00081 XmNadjustMargin, True,
00082 XmNisHomogeneous, False,
00083
00084 XtNvisual, visual,
00085 XtNdepth, depth,
00086 XtNcolormap, cmap,
00087 XtNborderColor, borcol,
00088 XtNbackground, bgnd,
00089
00090 NULL);
00091
00092 }
00093
00094 G4OpenGLXmTopLevelShell::~G4OpenGLXmTopLevelShell ()
00095 {
00096 XtDestroyWidget (toplevel);
00097 }
00098
00099 void G4OpenGLXmTopLevelShell::AddChild (G4OpenGLXmVWidgetContainer* container)
00100 {
00101 container->AddYourselfTo (this);
00102 }
00103
00104 void G4OpenGLXmTopLevelShell::Realize ()
00105 {
00106 Cardinal num_children;
00107 XtVaGetValues (toplevel,
00108 XmNnumChildren, &num_children,
00109 NULL);
00110
00111 XtManageChild (toplevel);
00112 XtRealizeWidget (toplevel);
00113 XtPopup (toplevel, XtGrabNonexclusive);
00114 }
00115
00116 Widget* G4OpenGLXmTopLevelShell::GetPointerToWidget ()
00117 {
00118 return &top_box;
00119 }
00120
00121 char* G4OpenGLXmTopLevelShell::GetName ()
00122 {
00123 return name;
00124 }
00125
00126 #endif