VkGenericDialog(3x) VkGenericDialog(3x)
VkGenericDialog - An abstract class that supports custom dialog managers
VkDialogManager : VkComponent : VkCallbackObject
#include <Vk/VkGenericDialog.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkGenericDialog(const char* name);
virtual void ~VkGenericDialog(void);
The VkGenericDialog class is intended to support dialogs that are
not included as part of the standard Motif dialog set. The class
uses the caching mechanisms and posting functions of the
VkDialogManager to manipulate an XmTemplateDialog widget. The
VkDialogManager class handles adding buttons to the dialog. Derived
classes are expected to create the contents of the dialog's work
area.
Derived classes can define new types of dialogs by overriding the
createDialog() member function. The overriding function must call
VkGenericDialog::createDialog() first, then add children to the
widget obtained from that function.
The following class creates an example dialog that displays a pixmap
of the X logo. The header file could be implemented as follows:
/////////////////////////////////////////////////////////////////
// XLogoDialog.h Sample Pixmap Dialog
////////////////////////////////////////////////////////////////
#include <Vk/VkApp.h>
#include <Vk/VkSimpleWindow.h>
#include <Vk/VkGenericDialog.h>
#include <Vk/VkGenericDialog.h>
class XLogoDialog : public VkGenericDialog {
protected:
virtual Widget createDialog(Widget parent);
public:
Page 1
VkGenericDialog(3x) VkGenericDialog(3x)
XLogoDialog(const char *name) :
VkGenericDialog(name) { };
};
The single non-inline member function, createDialog() could be
written as follows:
/////////////////////////////////////////////////////////
// XLogoDialog.C Sample Pixmap Dialog
/////////////////////////////////////////////////////////
Widget XLogoDialog::createDialog(Widget parent)
{
Pixel fg, bg;
Widget base, label;
// Call base class to create dialog template
base = VkGenericDialog::createDialog(parent);
// Add a child of our own, a label with a pixmap
label = XmCreateLabel(base, "label",
NULL, 0);
XtVaGetValues(label,
XmNforeground, &fg,
XmNbackground, &bg,
NULL);
/* Create a pixmap */
Pixmap pix = XmGetPixmap(XtScreen(label),
"xlogo64",
fg, bg);
XtVaSetValues(label,
XmNlabelType, XmPIXMAP,
XmNlabelPixmap, pix,
NULL);
XtManageChild(label);
// return the dialog widget
return base;
}
Page 2
VkGenericDialog(3x) VkGenericDialog(3x)
The VkDialogManager class takes care of all other details of posting
the dialog, caching the dialog, etc.
FUNCTION DESCRIPTIONS [Toc] [Back] VkGenericDialog()
VkGenericDialog(const char* name);
The VkGenericDialog constructor simply calls the VkDialogManager
constructor.
~VkGenericDialog()
virtual void ~VkGenericDialog(void);
The VkGenericDialog destructor exists only to quiet the C++
compiler. The widgets are destroyed by the VkDialogManager
destructor.
INHERITED MEMBER FUNCTIONS [Toc] [Back] Inherited from VkDialogManager
show(), hide(), className(), prepost() ok(), cancel(), apply(),
setTitle(), setButtonLabels(), unpost(), unpostAll(),
centerOnScreen(), lastPosted(), post(), postModal(), postBlocked(),
postAndWait(), _action, _showOK, _showCancel, _showApply,
_allowMultipleDialogs, _minimizeMultipleDialogs, prepostCallback,
Inherited from VkCallbackObject [Toc] [Back]
callCallbacks(), addCallback(),removeCallback(),
removeAllCallbacks()
Inherited from VkComponent [Toc] [Back]
installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
afterRealizeHook(), setDefaultResources(), getResources(), name(),
baseWidget() okToQuit(), _name, _baseWidget, _w, deleteCallback
KNOWN DERIVED CLASSES [Toc] [Back] VkPrefDialog
VkDialogManager, VkComponent,
ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
PPPPaaaaggggeeee 3333 [ Back ]
|