*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> Vk/VkGenericDialog (3)              
Title
Content
Arch
Section
 

Contents


VkGenericDialog(3x)					   VkGenericDialog(3x)


NAME    [Toc]    [Back]

     VkGenericDialog - An abstract class that supports custom dialog managers

INHERITS FROM    [Toc]    [Back]

     VkDialogManager : VkComponent : VkCallbackObject

HEADER FILE    [Toc]    [Back]

     #include <Vk/VkGenericDialog.h>

PUBLIC PROTOCOL	SUMMARY
   Constructor/Destructor
	   VkGenericDialog(const char* name);
	   virtual void	~VkGenericDialog(void);

CLASS DESCRIPTION    [Toc]    [Back]

	  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.


DERIVING SUBCLASSES    [Toc]    [Back]

	  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

SEE ALSO    [Toc]    [Back]

      
      
     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 ]
 Similar pages
Name OS Title
VkPrefItem IRIX Abstract class that supports preference items
VkDialogManager IRIX An abstract manager class that caches and supports Motif dialogs
VkDoubleBuffer IRIX Abstract class supports classes that draw doublebuffered graphics
VkCallbackObject IRIX An abstract class that supports classes that use C++ member function callbacks
VkModel IRIX An abstract class that supports Model-View-Controller style applications
VkComponent IRIX Abstract base class for all ViewKit components
VkMenuItem IRIX Abstract base class for all ViewKit menu classes
VkMsgComponent IRIX Abstract base class for all ViewKit message components
VkMenu IRIX Abstract base class for all ViewKit menu container objects
DMFXDialog IRIX A dialog class for plugins
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service