home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / Vk / VkGenericDialog.z / VkGenericDialog
Encoding:
Text File  |  1998-10-20  |  8.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4. VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg((((3333xxxx))))                                        VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      VkGenericDialog - An abstract class that supports custom dialog managers
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      VkDialogManager : VkComponent : VkCallbackObject
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <Vk/VkGenericDialog.h>
  16.  
  17. PPPPUUUUBBBBLLLLIIIICCCC PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
  18.    CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr////DDDDeeeessssttttrrrruuuuccccttttoooorrrr
  19.            VkGenericDialog(const char* name);
  20.            virtual void ~VkGenericDialog(void);
  21.  
  22.  
  23. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.           The VkGenericDialog class is intended to support dialogs that are
  25.           not included as part of the standard Motif dialog set. The class
  26.           uses the caching mechanisms and posting functions of the
  27.           VkDialogManager to manipulate an XmTemplateDialog widget. The
  28.           VkDialogManager class handles adding buttons to the dialog. Derived
  29.           classes are expected to create the contents of the dialog's work
  30.           area.
  31.  
  32.  
  33.  
  34. DDDDEEEERRRRIIIIVVVVIIIINNNNGGGG SSSSUUUUBBBBCCCCLLLLAAAASSSSSSSSEEEESSSS
  35.           Derived classes can define new types of dialogs by overriding the
  36.           _c_r_e_a_t_e_D_i_a_l_o_g() member function. The overriding function must call
  37.           _V_k_G_e_n_e_r_i_c_D_i_a_l_o_g::_c_r_e_a_t_e_D_i_a_l_o_g() first, then add children to the
  38.           widget obtained from that function.
  39.  
  40.           The following class creates an example dialog that displays a pixmap
  41.           of the X logo. The header file could be implemented as follows:
  42.  
  43.  
  44.            /////////////////////////////////////////////////////////////////
  45.            // XLogoDialog.h Sample Pixmap Dialog
  46.            ////////////////////////////////////////////////////////////////
  47.            #include <Vk/VkApp.h>
  48.            #include <Vk/VkSimpleWindow.h>
  49.            #include <Vk/VkGenericDialog.h>
  50.  
  51.            #include <Vk/VkGenericDialog.h>
  52.  
  53.            class XLogoDialog : public VkGenericDialog {
  54.  
  55.             protected:
  56.  
  57.               virtual Widget createDialog(Widget parent);
  58.  
  59.             public:
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg((((3333xxxx))))                                        VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg((((3333xxxx))))
  71.  
  72.  
  73.  
  74.               XLogoDialog(const char *name) :
  75.                            VkGenericDialog(name) { };
  76.            };
  77.  
  78.  
  79.  
  80.           The single non-inline member function, _c_r_e_a_t_e_D_i_a_l_o_g() could be
  81.           written as follows:
  82.  
  83.  
  84.            /////////////////////////////////////////////////////////
  85.            // XLogoDialog.C Sample Pixmap Dialog
  86.            /////////////////////////////////////////////////////////
  87.  
  88.            Widget XLogoDialog::createDialog(Widget parent)
  89.            {
  90.               Pixel fg, bg;
  91.               Widget base, label;
  92.  
  93.               // Call base class to create dialog template
  94.  
  95.               base = VkGenericDialog::createDialog(parent);
  96.  
  97.               // Add a child of our own, a label with a pixmap
  98.  
  99.               label = XmCreateLabel(base, "label",
  100.                                     NULL, 0);
  101.  
  102.               XtVaGetValues(label,
  103.                             XmNforeground, &fg,
  104.                             XmNbackground, &bg,
  105.                             NULL);
  106.  
  107.               /* Create a pixmap */
  108.  
  109.                Pixmap pix =  XmGetPixmap(XtScreen(label),
  110.                                          "xlogo64",
  111.                                           fg, bg);
  112.  
  113.               XtVaSetValues(label,
  114.                             XmNlabelType, XmPIXMAP,
  115.                             XmNlabelPixmap, pix,
  116.                             NULL);
  117.  
  118.               XtManageChild(label);
  119.  
  120.               // return the dialog widget
  121.  
  122.               return base;
  123.            }
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg((((3333xxxx))))                                        VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg((((3333xxxx))))
  137.  
  138.  
  139.  
  140.           The VkDialogManager class takes care of all other details of posting
  141.           the dialog, caching the dialog, etc.
  142.  
  143. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  144.    VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg(((())))
  145.            VkGenericDialog(const char* name);
  146.  
  147.  
  148.           The VkGenericDialog constructor simply calls the VkDialogManager
  149.           constructor.
  150.  
  151.    ~~~~VVVVkkkkGGGGeeeennnneeeerrrriiiiccccDDDDiiiiaaaalllloooogggg(((())))
  152.            virtual void ~VkGenericDialog(void);
  153.  
  154.  
  155.           The VkGenericDialog destructor exists only to quiet the C++
  156.           compiler.  The widgets are destroyed by the VkDialogManager
  157.           destructor.
  158.  
  159. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  160.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkDDDDiiiiaaaallllooooggggMMMMaaaannnnaaaaggggeeeerrrr
  161.           show(), hide(), className(), prepost() ok(), cancel(), apply(),
  162.           setTitle(), setButtonLabels(), unpost(), unpostAll(),
  163.           centerOnScreen(), lastPosted(), post(), postModal(), postBlocked(),
  164.           postAndWait(), _action, _showOK, _showCancel, _showApply,
  165.           _allowMultipleDialogs, _minimizeMultipleDialogs, prepostCallback,
  166.  
  167.  
  168.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCaaaallllllllbbbbaaaacccckkkkOOOObbbbjjjjeeeecccctttt
  169.           callCallbacks(), addCallback(),removeCallback(),
  170.           removeAllCallbacks()
  171.  
  172.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
  173.           installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
  174.           afterRealizeHook(), setDefaultResources(), getResources(), name(),
  175.           baseWidget() okToQuit(), _name, _baseWidget, _w, deleteCallback
  176.  
  177.  
  178. KKKKNNNNOOOOWWWWNNNN DDDDEEEERRRRIIIIVVVVEEEEDDDD CCCCLLLLAAAASSSSSSSSEEEESSSS
  179.      VkPrefDialog
  180.  
  181. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  182.      VkDialogManager, VkComponent,
  183.      _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  184.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
  185.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
  186.      _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.