home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dlgcpp.zip / dialog.cpp < prev    next >
Text File  |  1995-08-30  |  38KB  |  1,047 lines

  1. extern "C" {
  2.   #define INCL_DOS                   /* Include OS/2 PM DOS Interface     */
  3.   #define INCL_GPI                   /* Include OS/2 PM GPI Interface     */
  4.   #define INCL_WIN                   /* Include OS/2 PM Windows Interface */
  5.   #include <os2.h>
  6. }
  7.  
  8. #include <igraphbt.hpp>
  9. #include <ipushbut.hpp>
  10. #include <icheckbx.hpp>
  11. #include <i3statbx.hpp>
  12. #include <iradiobt.hpp>
  13. #include <iscroll.hpp>
  14. #include <ilistbox.hpp>
  15. #include <ientryfd.hpp>
  16. #include <istattxt.hpp>
  17. #include <igroupbx.hpp>
  18. #include <iiconctl.hpp>
  19. #include <ibmpctl.hpp>
  20. #include <icombobx.hpp>
  21. #include <imle.hpp>
  22. #include <ispinnum.hpp>
  23. #include <ispintxt.hpp>
  24. #include <icnrctl.hpp>
  25. #include <islider.hpp>
  26. #include <inotebk.hpp>
  27. #include <icslider.hpp>
  28. #include <ithread.hpp>
  29. #include <iexcept.hpp>
  30.  
  31. #include "dialog.hpp"
  32.  
  33. /************************************************************************/
  34. /************************************************************************/
  35. /************************************************************************/
  36. /* DISCLAIMER OF WARRANTIES:                                            */
  37. /* -------------------------                                            */
  38. /* The following [enclosed] code is sample code created by IBM          */
  39. /* Corporation and Prominare Inc.  This sample code is not part of any  */
  40. /* standard IBM product and is provided to you solely for the purpose   */
  41. /* of assisting you in the development of your applications.  The code  */
  42. /* is provided "AS IS", without warranty of any kind.  Neither IBM nor  */
  43. /* Prominare shall be liable for any damages arising out of your        */
  44. /* use of the sample code, even if they have been advised of the        */
  45. /* possibility of such damages.                                         */
  46. /************************************************************************/
  47. /************************************************************************/
  48. /************************************************************************/
  49. /*                     D I S C L A I M E R                              */
  50. /* This code is provided on an as is basis with no implied support.     */
  51. /* It should be considered freeware that cannot be rebundled as         */
  52. /* part of a larger "*ware" offering without our consent.               */
  53. /************************************************************************/
  54. /************************************************************************/
  55. /************************************************************************/
  56.  
  57. /* Copyright ╕ International Business Machines Corp., 1995.             */
  58. /* Copyright ╕ 1995  Prominare Inc.  All Rights Reserved.               */
  59.  
  60. /* -------------------------------------------------------------------- */
  61.  
  62.  
  63. /* -- Standard Window Classes ----------------------------------------- */
  64.  
  65. #define WINCLASS_FRAME             0x00000001L
  66. #define WINCLASS_COMBOBOX          0x00000002L
  67. #define WINCLASS_BUTTON            0x00000003L
  68. #define WINCLASS_MENU              0x00000004L
  69. #define WINCLASS_STATIC            0x00000005L
  70. #define WINCLASS_ENTRYFIELD        0x00000006L
  71. #define WINCLASS_LISTBOX           0x00000007L
  72. #define WINCLASS_SCROLLBAR         0x00000008L
  73. #define WINCLASS_TITLEBAR          0x00000009L
  74. #define WINCLASS_MLE               0x0000000AL
  75. /* 000B to 000F reserved */
  76. #define WINCLASS_APPSTAT           0x00000010L
  77. #define WINCLASS_KBDSTAT           0x00000011L
  78. #define WINCLASS_PECIC             0x00000012L
  79. #define WINCLASS_DBE_KKPOPUP       0x00000013L
  80. /* 0014 to 001F reserved */
  81. #define WINCLASS_SPINBUTTON        0x00000020L
  82. /* 0021 to 0024 reserved */
  83. #define WINCLASS_CONTAINER         0x00000025L
  84. #define WINCLASS_SLIDER            0x00000026L
  85. #define WINCLASS_VALUESET          0x00000027L
  86. #define WINCLASS_NOTEBOOK          0x00000028L
  87. #define WINCLASS_HWXENTRY          0x00000029L
  88. #define WINCLASS_SKETCH            0x0000002aL
  89. /* 002b to 0030 reserved */
  90. /* 0030 to 003F reserved */
  91. #define WINCLASS_GRAPHICBUTTON     0x00000040L
  92. #define WINCLASS_CIRCULARSLIDER    0x00000041L
  93.  
  94.  
  95. /*------------------------------------------------------------------------------
  96. | Dialog::Dialog                                                               |
  97. ------------------------------------------------------------------------------*/
  98. Dialog :: Dialog( unsigned long ulWindowId,
  99.                   IWindow*      pOwner ) :
  100.    IFrameWindow( deferCreation ),
  101.    ulId( ulWindowId )
  102. {
  103.   IThread::current().initializeGUI();
  104.  
  105.   IResourceId
  106.     resId( ulWindowId );
  107.  
  108.   IResourceLibrary
  109.     resLib( resId.resourceLibrary() );
  110.  
  111.   IWindowHandle
  112.     dialog = resLib.loadDialog( resId.id(),
  113.                                 0,
  114.                                 pOwner,
  115.                                 WinDefDlgProc,
  116.                                 0 );
  117.  
  118.                        /* Dialog was created.  Call IFrameWindow::start */
  119.                        /* to create a new frame handler, add it to this */
  120.                        /* frame window, and initiate message handling   */
  121.                        /* for the window.                               */
  122.   start( dialog );
  123.  
  124. } //Dialog::Dialog
  125.  
  126.  
  127. /*------------------------------------------------------------------------------
  128. | Dialog::~Dialog                                                              |
  129. ------------------------------------------------------------------------------*/
  130. Dialog :: ~Dialog( )
  131. {
  132. }
  133.  
  134.  
  135. /*------------------------------------------------------------------------------
  136. | Dialog::createControlsFromTemplate                                           |
  137. ------------------------------------------------------------------------------*/
  138. Dialog& Dialog :: createControlsFromTemplate( )
  139. {
  140.   PDLGTEMPLATE pdlgt;                /* Dialog Template Pointer         */
  141.   void*        pvStart;              /* Dialog Template Item Pointer    */
  142.   register unsigned long cItems,     /* Dialog Items Counter            */
  143.                          ulRc,       /* Return code                     */
  144.                          i;          /* Loop Counter                    */
  145.  
  146.                        /* Set mouse pointer to "wait" in case template  */
  147.                        /* is large                                      */
  148.   IPointerHandle oldPointer = mousePointer();
  149.   ISystemPointerHandle systemPointer( ISystemPointerHandle::wait );
  150.   setMousePointer( systemPointer );
  151.  
  152.                        /* Try reading in the dialog template for the    */
  153.                        /* given dialog ID                               */
  154.   ulRc = DosGetResource( 0, RT_DIALOG, this->ulId, (void **)&pdlgt );
  155.   if ( ulRc != 0 )
  156.   {
  157.                        /* Dialog template not found;  reset mouse       */
  158.                        /* pointer and throw exception                   */
  159.     setMousePointer( oldPointer );
  160.     ITHROWSYSTEMERROR( ulRc,
  161.                        "DosGetResource",
  162.                        IErrorInfo::accessError,
  163.                        IException::recoverable );
  164.   }
  165.                        /* Save pointer to the start of the dlg template */
  166.   pvStart = (void *)pdlgt;
  167.  
  168.                        /* Save the number of controls found within the  */
  169.                        /* dialog template                               */
  170.   cItems = pdlgt->adlgti[0].cChildren + 1;
  171.  
  172.                        /* Read in and create an Open Class Library C++  */
  173.                        /* object for each of the controls within the    */
  174.                        /* dialog template                               */
  175.   for ( i = 1; i < cItems; i++ )
  176.   {
  177.                        /* Obtain the id of the control                  */
  178.     unsigned long ulId = (unsigned long)(pdlgt->adlgti[i].id & 0xffff);
  179.  
  180.                        /* Skip the control if its id is -1              */
  181.     if ( ulId != 0xffff )
  182.     {
  183.                        /* Check to see if a custom control is specified */
  184.                        /* or if a standard PM control class is being    */
  185.                        /* used                                          */
  186.       if ( pdlgt->adlgti[i].cchClassName )
  187.       {
  188.                        /* Since a length for the class name present,    */
  189.                        /* a custom control class name is being used for */
  190.                        /* the control.  Point to the memory location    */
  191.                        /* where the class name is found within the      */
  192.                        /* dialog template information.                  */
  193.         customControl( ulId,
  194.                        ((char *)pvStart + pdlgt->adlgti[i].offClassName) );
  195.       }
  196.       else
  197.       {
  198.                        /* No class name length given indicating that a  */
  199.                        /* standard PM class is being used.  The class   */
  200.                        /* name is stored as an index value.  For        */
  201.                        /* example, the class for static's is defined as */
  202.                        /*                                               */
  203.                        /* #define WC_STATIC ((PSZ)0xffff0005L)          */
  204.                        /*                                               */
  205.                        /* The values within the dialog template for     */
  206.                        /* the static class would be                     */
  207.                        /*                                               */
  208.                        /* adlgti[i].cchClassName = 0                    */
  209.                        /* adlgti[i].offClassName = 5                    */
  210.                        /*                                               */
  211.                        /* Therefore, the value of offClassName field    */
  212.                        /* must be used as an index that is used to      */
  213.                        /* actually select the class name.               */
  214.  
  215.         switch ( pdlgt->adlgti[i].offClassName )
  216.         {
  217.           case WINCLASS_BUTTON :
  218.             {
  219.               unsigned long ulStyle = pdlgt->adlgti[i].flStyle &
  220.                                       BS_PRIMARYSTYLES;
  221.  
  222.               switch ( ulStyle )
  223.               {
  224.                 case BS_PUSHBUTTON:
  225.                   {
  226.                     if ( pdlgt->adlgti[i].flStyle & (BS_BITMAP | BS_ICON) )
  227.                     {
  228.                       IGraphicPushButton*
  229.                         pGraphicPushButton = new IGraphicPushButton( ulId,
  230.                                                                      this );
  231.                       pGraphicPushButton->setAutoDeleteObject( true );
  232.                       graphicPushButton( pGraphicPushButton );
  233.                     }
  234.                     else
  235.                     {
  236.                       IPushButton*
  237.                         pPushButton = new IPushButton( ulId, this );
  238.                       pPushButton->setAutoDeleteObject( true );
  239.                       this->pushButton( pPushButton );
  240.                     }
  241.                   }
  242.                   break;
  243.  
  244.                 case BS_CHECKBOX:
  245.                 case BS_AUTOCHECKBOX:
  246.                   {
  247.                     ICheckBox*
  248.                       pCheckBox = new ICheckBox( ulId, this );
  249.                     pCheckBox->setAutoDeleteObject( true );
  250.                     checkBox( pCheckBox );
  251.                   }
  252.                   break;
  253.  
  254.                 case BS_RADIOBUTTON:
  255.                 case BS_AUTORADIOBUTTON:
  256.                   {
  257.                     IRadioButton*
  258.                       pRadioButton = new IRadioButton( ulId, this );
  259.                     pRadioButton->setAutoDeleteObject( true );
  260.                     radioButton( pRadioButton );
  261.                   }
  262.                   break;
  263.  
  264.                 case BS_3STATE:
  265.                 case BS_AUTO3STATE:
  266.                   {
  267.                     I3StateCheckBox*
  268.                       p3StateCheckBox = new I3StateCheckBox( ulId, this );
  269.                     p3StateCheckBox->setAutoDeleteObject( true );
  270.                     threeStateCheckBox( p3StateCheckBox );
  271.                   }
  272.                   break;
  273.  
  274.                 case BS_USERBUTTON:
  275.                   {
  276.                     customButton( ulId );
  277.                   }
  278.                   break;
  279.               } //end switch
  280.  
  281.             } //WINCLASS_BUTTON
  282.             break;
  283.  
  284.           case WINCLASS_SCROLLBAR :
  285.             {
  286.               IScrollBar*
  287.                 pScrollBar = new IScrollBar( ulId, this );
  288.               pScrollBar->setAutoDeleteObject( true );
  289.               scrollBar( pScrollBar );
  290.             }
  291.             break;
  292.  
  293.           case WINCLASS_LISTBOX :
  294.             {
  295.               IListBox*
  296.                 pListBox = new IListBox( ulId, this );
  297.               pListBox->setAutoDeleteObject( true );
  298.               listBox( pListBox );
  299.             }
  300.             break;
  301.  
  302.           case WINCLASS_ENTRYFIELD :
  303.             {
  304.               IEntryField*
  305.                 pEntryField = new IEntryField( ulId, this );
  306.               pEntryField->setAutoDeleteObject( true );
  307.               entryField( pEntryField );
  308.             }
  309.             break;
  310.  
  311.           case WINCLASS_STATIC :
  312.             {
  313.               unsigned long ulStyle = pdlgt->adlgti[i].flStyle &
  314.                                 (SS_TEXT | SS_GROUPBOX | SS_ICON | SS_BITMAP);
  315.  
  316.               switch ( ulStyle )
  317.               {
  318.                 case SS_TEXT:
  319.                   {
  320.                     IStaticText*
  321.                       pStaticText = new IStaticText( ulId, this );
  322.                     pStaticText->setAutoDeleteObject( true );
  323.                     staticText( pStaticText );
  324.                   }
  325.                   break;
  326.  
  327.                 case SS_GROUPBOX:
  328.                   {
  329.                     IGroupBox*
  330.                       pGroupBox = new IGroupBox( ulId, this );
  331.                     pGroupBox->setAutoDeleteObject( true );
  332.                     groupBox( pGroupBox );
  333.                   }
  334.                   break;
  335.  
  336.                 case SS_ICON:
  337.                   {
  338.                     IIconControl*
  339.                       pIcon = new IIconControl( ulId, this );
  340.                     pIcon->setAutoDeleteObject( true );
  341.                     iconControl( pIcon );
  342.                   }
  343.                   break;
  344.  
  345.                 case SS_BITMAP:
  346.                   {
  347.                     IBitmapControl*
  348.                       pBitmap = new IBitmapControl( ulId, this );
  349.                     pBitmap->setAutoDeleteObject( true );
  350.                     bitmapControl( pBitmap );
  351.                   }
  352.                   break;
  353.               } //end switch
  354.  
  355.             } //WINCLASS_STATIC
  356.             break;
  357.  
  358.           case WINCLASS_COMBOBOX :
  359.             {
  360.               IComboBox*
  361.                 pComboBox = new IComboBox( ulId, this );
  362.               pComboBox->setAutoDeleteObject( true );
  363.               comboBox( pComboBox );
  364.             }
  365.             break;
  366.  
  367.           case WINCLASS_MLE :
  368.             {
  369.               IMultiLineEdit*
  370.                 pMLE = new IMultiLineEdit( ulId, this );
  371.               pMLE->setAutoDeleteObject( true );
  372.               mle( pMLE );
  373.             }
  374.             break;
  375.  
  376.           case WINCLASS_SPINBUTTON :
  377.             {
  378.               if ( pdlgt->adlgti[i].flStyle & SPBS_NUMERICONLY )
  379.               {
  380.                 INumericSpinButton*
  381.                   pNumericSpinButton = new INumericSpinButton( ulId, this );
  382.                 pNumericSpinButton->setAutoDeleteObject( true );
  383.                 numericSpinButton( pNumericSpinButton );
  384.               }
  385.               else
  386.               {
  387.                 ITextSpinButton*
  388.                   pTextSpinButton = new ITextSpinButton( ulId, this );
  389.                 pTextSpinButton->setAutoDeleteObject( true );
  390.                 textSpinButton( pTextSpinButton );
  391.               }
  392.             }
  393.             break;
  394.  
  395.           case WINCLASS_CONTAINER :
  396.             {
  397.               IContainerControl*
  398.                 pContainer = new IContainerControl( ulId, this );
  399.               pContainer->setAutoDeleteObject( true );
  400.               container( pContainer );
  401.             }
  402.             break;
  403.  
  404.           case WINCLASS_SLIDER :
  405.             {
  406.               if ( pdlgt->adlgti[i].flStyle & SLS_READONLY )
  407.               {
  408.                 IProgressIndicator*
  409.                   pProgressIndicator = new IProgressIndicator( ulId, this );
  410.                 pProgressIndicator->setAutoDeleteObject( true );
  411.                 progressIndicator( pProgressIndicator );
  412.               }
  413.               else
  414.               {
  415.                 ISlider*
  416.                   pSlider = new ISlider( ulId, this );
  417.                 pSlider->setAutoDeleteObject( true );
  418.                 slider( pSlider );
  419.               }
  420.             }
  421.             break;
  422.  
  423.           case WINCLASS_VALUESET :
  424.             //No valueset class - see OS/2 C++ Class Library Power GUI
  425.             //Programming with C Set++ for an implementation of a
  426.             //valueset class.
  427.             break;
  428.  
  429.           case WINCLASS_NOTEBOOK :
  430.             {
  431.               INotebook*
  432.                 pNotebook = new INotebook( ulId, this );
  433.               pNotebook->setAutoDeleteObject( true );
  434.               notebook( pNotebook );
  435.             }
  436.             break;
  437.  
  438.           case WINCLASS_CIRCULARSLIDER :
  439.             {
  440.               ICircularSlider*
  441.                 pCircularSlider = new ICircularSlider( ulId, this );
  442.               pCircularSlider->setAutoDeleteObject( true );
  443.               circularSlider( pCircularSlider );
  444.             }
  445.             break;
  446.         } //end switch
  447.       } //end if
  448.     } //end if - id != -1
  449.  
  450.   } //end for
  451.                        /* Release the memory allocated for the dlg      */
  452.                        /* template before returning                     */
  453.   DosFreeResource( pvStart );
  454.                        /* Reset mouse pointer                           */
  455.   setMousePointer( oldPointer );
  456.   return( *this );
  457. } //Dialog::createControlsFromTemplate
  458.  
  459.  
  460. /*------------------------------------------------------------------------------
  461. | Dialog::customControl                                                        |
  462. ------------------------------------------------------------------------------*/
  463. Dialog& Dialog :: customControl( unsigned long ulId, const IString& className )
  464. {
  465.   return( *this );
  466. }
  467.  
  468.  
  469. /*------------------------------------------------------------------------------
  470. | Dialog::graphicPushButton                                                    |
  471. ------------------------------------------------------------------------------*/
  472. Dialog& Dialog :: graphicPushButton( IGraphicPushButton* pGraphicPushButton )
  473. {
  474.   return( *this );
  475. }
  476.  
  477.  
  478. /*------------------------------------------------------------------------------
  479. | Dialog::graphicPushButtonWithId                                              |
  480. ------------------------------------------------------------------------------*/
  481. IGraphicPushButton* Dialog :: graphicPushButtonWithId( unsigned long ulId )
  482. {
  483.   IGraphicPushButton*
  484.     pGraphicPushButton =
  485.             (IGraphicPushButton *)IWindow::windowWithOwner( ulId, this );
  486.  
  487.   if ( !pGraphicPushButton )
  488.   {
  489.     pGraphicPushButton = new IGraphicPushButton( ulId, this );
  490.     pGraphicPushButton->setAutoDeleteObject( true );
  491.   }
  492.  
  493.   return( pGraphicPushButton );
  494. }
  495.  
  496.  
  497. /*------------------------------------------------------------------------------
  498. | Dialog::pushButton                                                           |
  499. ------------------------------------------------------------------------------*/
  500. Dialog& Dialog :: pushButton( IPushButton* pPushButton )
  501. {
  502.   return( *this );
  503. }
  504.  
  505.  
  506. /*------------------------------------------------------------------------------
  507. | Dialog::pushButtonWithId                                                     |
  508. ------------------------------------------------------------------------------*/
  509. IPushButton* Dialog :: pushButtonWithId( unsigned long ulId )
  510. {
  511.   IPushButton*
  512.     pPushButton = (IPushButton *)IWindow::windowWithOwner( ulId, this );
  513.  
  514.   if ( !pPushButton )
  515.   {
  516.     pPushButton = new IPushButton( ulId, this );
  517.     pPushButton->setAutoDeleteObject( true );
  518.   }
  519.  
  520.   return( pPushButton );
  521. }
  522.  
  523.  
  524. /*------------------------------------------------------------------------------
  525. | Dialog::checkBox                                                             |
  526. ------------------------------------------------------------------------------*/
  527. Dialog& Dialog :: checkBox( ICheckBox* pCheckBox )
  528. {
  529.   return( *this );
  530. }
  531.  
  532.  
  533. /*------------------------------------------------------------------------------
  534. | Dialog::checkBoxWithId                                                       |
  535. ------------------------------------------------------------------------------*/
  536. ICheckBox* Dialog :: checkBoxWithId( unsigned long ulId )
  537. {
  538.   ICheckBox*
  539.     pCheckBox = (ICheckBox *)IWindow::windowWithOwner( ulId, this );
  540.  
  541.   if ( !pCheckBox )
  542.   {
  543.     pCheckBox = new ICheckBox( ulId, this );
  544.     pCheckBox->setAutoDeleteObject( true );
  545.   }
  546.  
  547.   return( pCheckBox );
  548. }
  549.  
  550.  
  551. /*------------------------------------------------------------------------------
  552. | Dialog::threeStateCheckBox                                                   |
  553. ------------------------------------------------------------------------------*/
  554. Dialog& Dialog :: threeStateCheckBox( I3StateCheckBox* p3StateCheckBox )
  555. {
  556.   return( *this );
  557. }
  558.  
  559.  
  560. /*------------------------------------------------------------------------------
  561. | Dialog::threeStateCheckBoxWithId                                             |
  562. ------------------------------------------------------------------------------*/
  563. I3StateCheckBox* Dialog :: threeStateCheckBoxWithId( unsigned long ulId )
  564. {
  565.   I3StateCheckBox*
  566.     p3StateCheckBox = (I3StateCheckBox *)IWindow::windowWithOwner( ulId, this );
  567.  
  568.   if ( !p3StateCheckBox )
  569.   {
  570.     p3StateCheckBox = new I3StateCheckBox( ulId, this );
  571.     p3StateCheckBox->setAutoDeleteObject( true );
  572.   }
  573.  
  574.   return( p3StateCheckBox );
  575. }
  576.  
  577.  
  578. /*------------------------------------------------------------------------------
  579. | Dialog::radioButton                                                          |
  580. ------------------------------------------------------------------------------*/
  581. Dialog& Dialog :: radioButton( IRadioButton* pRadioButton )
  582. {
  583.   return( *this );
  584. }
  585.  
  586.  
  587. /*------------------------------------------------------------------------------
  588. | Dialog::radioButtonWithId                                                    |
  589. ------------------------------------------------------------------------------*/
  590. IRadioButton* Dialog :: radioButtonWithId( unsigned long ulId )
  591. {
  592.   IRadioButton*
  593.     pRadioButton = (IRadioButton *)IWindow::windowWithOwner( ulId, this );
  594.  
  595.   if ( !pRadioButton )
  596.   {
  597.     pRadioButton = new IRadioButton( ulId, this );
  598.     pRadioButton->setAutoDeleteObject( true );
  599.   }
  600.  
  601.   return( pRadioButton );
  602. }
  603.  
  604.  
  605. /*------------------------------------------------------------------------------
  606. | Dialog::customButtom                                                         |
  607. ------------------------------------------------------------------------------*/
  608. Dialog& Dialog :: customButton( unsigned long ulId )
  609. {
  610.   return( *this );
  611. }
  612.  
  613.  
  614. /*------------------------------------------------------------------------------
  615. | Dialog::scrollBar                                                            |
  616. ------------------------------------------------------------------------------*/
  617. Dialog& Dialog :: scrollBar( IScrollBar* pScrollBar )
  618. {
  619.   return( *this );
  620. }
  621.  
  622.  
  623. /*------------------------------------------------------------------------------
  624. | Dialog::scrollBarWithId                                                      |
  625. ------------------------------------------------------------------------------*/
  626. IScrollBar* Dialog :: scrollBarWithId( unsigned long ulId )
  627. {
  628.   IScrollBar*
  629.     pScrollBar = (IScrollBar *)IWindow::windowWithOwner( ulId, this );
  630.  
  631.   if ( !pScrollBar )
  632.   {
  633.     pScrollBar = new IScrollBar( ulId, this );
  634.     pScrollBar->setAutoDeleteObject( true );
  635.   }
  636.  
  637.   return( pScrollBar );
  638. }
  639.  
  640.  
  641. /*------------------------------------------------------------------------------
  642. | Dialog::listBox                                                              |
  643. ------------------------------------------------------------------------------*/
  644. Dialog& Dialog :: listBox( IListBox* pListBox )
  645. {
  646.   return( *this );
  647. }
  648.  
  649.  
  650. /*------------------------------------------------------------------------------
  651. | Dialog::listBoxWithId                                                        |
  652. ------------------------------------------------------------------------------*/
  653. IListBox* Dialog :: listBoxWithId( unsigned long ulId )
  654. {
  655.   IListBox*
  656.     pListBox = (IListBox *)IWindow::windowWithOwner( ulId, this );
  657.  
  658.   if ( !pListBox )
  659.   {
  660.     pListBox = new IListBox( ulId, this );
  661.     pListBox->setAutoDeleteObject( true );
  662.   }
  663.  
  664.   return( pListBox );
  665. }
  666.  
  667.  
  668. /*------------------------------------------------------------------------------
  669. | Dialog::entryField                                                           |
  670. ------------------------------------------------------------------------------*/
  671. Dialog& Dialog :: entryField( IEntryField* pEntryField )
  672. {
  673.   return( *this );
  674. }
  675.  
  676.  
  677. /*------------------------------------------------------------------------------
  678. | Dialog::entryFieldWithId                                                     |
  679. ------------------------------------------------------------------------------*/
  680. IEntryField* Dialog :: entryFieldWithId( unsigned long ulId )
  681. {
  682.   IEntryField*
  683.     pEntryField = (IEntryField *)IWindow::windowWithOwner( ulId, this );
  684.  
  685.   if ( !pEntryField )
  686.   {
  687.     pEntryField = new IEntryField( ulId, this );
  688.     pEntryField->setAutoDeleteObject( true );
  689.   }
  690.  
  691.   return( pEntryField );
  692. }
  693.  
  694.  
  695. /*------------------------------------------------------------------------------
  696. | Dialog::staticText                                                           |
  697. ------------------------------------------------------------------------------*/
  698. Dialog& Dialog :: staticText( IStaticText* pStaticText )
  699. {
  700.   return( *this );
  701. }
  702.  
  703.  
  704. /*------------------------------------------------------------------------------
  705. | Dialog::staticTextWithId                                                     |
  706. ------------------------------------------------------------------------------*/
  707. IStaticText* Dialog :: staticTextWithId( unsigned long ulId )
  708. {
  709.   IStaticText*
  710.     pStaticText = (IStaticText *)IWindow::windowWithOwner( ulId, this );
  711.  
  712.   if ( !pStaticText )
  713.   {
  714.     pStaticText = new IStaticText( ulId, this );
  715.     pStaticText->setAutoDeleteObject( true );
  716.   }
  717.  
  718.   return( pStaticText );
  719. }
  720.  
  721.  
  722. /*------------------------------------------------------------------------------
  723. | Dialog::groupBox                                                             |
  724. ------------------------------------------------------------------------------*/
  725. Dialog& Dialog :: groupBox( IGroupBox* pGroupBox )
  726. {
  727.   return( *this );
  728. }
  729.  
  730.  
  731. /*------------------------------------------------------------------------------
  732. | Dialog::groupBoxWithId                                                       |
  733. ------------------------------------------------------------------------------*/
  734. IGroupBox* Dialog :: groupBoxWithId( unsigned long ulId )
  735. {
  736.   IGroupBox*
  737.     pGroupBox = (IGroupBox *)IWindow::windowWithOwner( ulId, this );
  738.  
  739.   if ( !pGroupBox )
  740.   {
  741.     pGroupBox = new IGroupBox( ulId, this );
  742.     pGroupBox->setAutoDeleteObject( true );
  743.   }
  744.  
  745.   return( pGroupBox );
  746. }
  747.  
  748.  
  749. /*------------------------------------------------------------------------------
  750. | Dialog::iconControl                                                          |
  751. ------------------------------------------------------------------------------*/
  752. Dialog& Dialog :: iconControl( IIconControl* pIcon )
  753. {
  754.   return( *this );
  755. }
  756.  
  757.  
  758. /*------------------------------------------------------------------------------
  759. | Dialog::iconControlWithId                                                    |
  760. ------------------------------------------------------------------------------*/
  761. IIconControl* Dialog :: iconControlWithId( unsigned long ulId )
  762. {
  763.   IIconControl*
  764.     pIconControl = (IIconControl *)IWindow::windowWithOwner( ulId, this );
  765.  
  766.   if ( !pIconControl )
  767.   {
  768.     pIconControl = new IIconControl( ulId, this );
  769.     pIconControl->setAutoDeleteObject( true );
  770.   }
  771.  
  772.   return( pIconControl );
  773. }
  774.  
  775.  
  776. /*------------------------------------------------------------------------------
  777. | Dialog::bitmapControl                                                        |
  778. ------------------------------------------------------------------------------*/
  779. Dialog& Dialog :: bitmapControl( IBitmapControl* pBitmap )
  780. {
  781.   return( *this );
  782. }
  783.  
  784.  
  785. /*------------------------------------------------------------------------------
  786. | Dialog::bitmapControlWithId                                                  |
  787. ------------------------------------------------------------------------------*/
  788. IBitmapControl* Dialog :: bitmapControlWithId( unsigned long ulId )
  789. {
  790.   IBitmapControl*
  791.     pBitmapControl = (IBitmapControl *)IWindow::windowWithOwner( ulId, this );
  792.  
  793.   if ( !pBitmapControl )
  794.   {
  795.     pBitmapControl = new IBitmapControl( ulId, this );
  796.     pBitmapControl->setAutoDeleteObject( true );
  797.   }
  798.  
  799.   return( pBitmapControl );
  800. }
  801.  
  802.  
  803. /*------------------------------------------------------------------------------
  804. | Dialog::comboBox                                                             |
  805. ------------------------------------------------------------------------------*/
  806. Dialog& Dialog :: comboBox( IComboBox* pComboBox )
  807. {
  808.   return( *this );
  809. }
  810.  
  811.  
  812. /*------------------------------------------------------------------------------
  813. | Dialog::comboBoxWithId                                                       |
  814. ------------------------------------------------------------------------------*/
  815. IComboBox* Dialog :: comboBoxWithId( unsigned long ulId )
  816. {
  817.   IComboBox*
  818.     pComboBox = (IComboBox *)IWindow::windowWithOwner( ulId, this );
  819.  
  820.   if ( !pComboBox )
  821.   {
  822.     pComboBox = new IComboBox( ulId, this );
  823.     pComboBox->setAutoDeleteObject( true );
  824.   }
  825.  
  826.   return( pComboBox );
  827. }
  828.  
  829.  
  830. /*------------------------------------------------------------------------------
  831. | Dialog::mle                                                                  |
  832. ------------------------------------------------------------------------------*/
  833. Dialog& Dialog :: mle( IMultiLineEdit* pMLE )
  834. {
  835.   return( *this );
  836. }
  837.  
  838.  
  839. /*------------------------------------------------------------------------------
  840. | Dialog::mleWithId                                                            |
  841. ------------------------------------------------------------------------------*/
  842. IMultiLineEdit* Dialog :: mleWithId( unsigned long ulId )
  843. {
  844.   IMultiLineEdit*
  845.     pMLE = (IMultiLineEdit *)IWindow::windowWithOwner( ulId, this );
  846.  
  847.   if ( !pMLE )
  848.   {
  849.     pMLE = new IMultiLineEdit( ulId, this );
  850.     pMLE->setAutoDeleteObject( true );
  851.   }
  852.  
  853.   return( pMLE );
  854. }
  855.  
  856.  
  857. /*------------------------------------------------------------------------------
  858. | Dialog::numericSpinButton                                                    |
  859. ------------------------------------------------------------------------------*/
  860. Dialog& Dialog :: numericSpinButton( INumericSpinButton* pNumericSpinButton )
  861. {
  862.   return( *this );
  863. }
  864.  
  865.  
  866. /*------------------------------------------------------------------------------
  867. | Dialog::numericSpinButtonWithId                                              |
  868. ------------------------------------------------------------------------------*/
  869. INumericSpinButton* Dialog :: numericSpinButtonWithId( unsigned long ulId )
  870. {
  871.   INumericSpinButton*
  872.     pNumericSpinButton =
  873.             (INumericSpinButton *)IWindow::windowWithOwner( ulId, this );
  874.  
  875.   if ( !pNumericSpinButton )
  876.   {
  877.     pNumericSpinButton = new INumericSpinButton( ulId, this );
  878.     pNumericSpinButton->setAutoDeleteObject( true );
  879.   }
  880.  
  881.   return( pNumericSpinButton );
  882. }
  883.  
  884.  
  885. /*------------------------------------------------------------------------------
  886. | Dialog::textSpinButton                                                       |
  887. ------------------------------------------------------------------------------*/
  888. Dialog& Dialog :: textSpinButton( ITextSpinButton* pTextSpinButton )
  889. {
  890.   return( *this );
  891. }
  892.  
  893.  
  894. /*------------------------------------------------------------------------------
  895. | Dialog::textSpinButtonWithId                                                 |
  896. ------------------------------------------------------------------------------*/
  897. ITextSpinButton* Dialog :: textSpinButtonWithId( unsigned long ulId )
  898. {
  899.   ITextSpinButton*
  900.     pTextSpinButton = (ITextSpinButton *)IWindow::windowWithOwner( ulId, this );
  901.  
  902.   if ( !pTextSpinButton )
  903.   {
  904.     pTextSpinButton = new ITextSpinButton( ulId, this );
  905.     pTextSpinButton->setAutoDeleteObject( true );
  906.   }
  907.  
  908.   return( pTextSpinButton );
  909. }
  910.  
  911.  
  912. /*------------------------------------------------------------------------------
  913. | Dialog::container                                                            |
  914. ------------------------------------------------------------------------------*/
  915. Dialog& Dialog :: container( IContainerControl* pContainer )
  916. {
  917.   return( *this );
  918. }
  919.  
  920.  
  921. /*------------------------------------------------------------------------------
  922. | Dialog::containerWithId                                                      |
  923. ------------------------------------------------------------------------------*/
  924. IContainerControl* Dialog :: containerWithId( unsigned long ulId )
  925. {
  926.   IContainerControl*
  927.     pContainer = (IContainerControl *)IWindow::windowWithOwner( ulId, this );
  928.  
  929.   if ( !pContainer )
  930.   {
  931.     pContainer = new IContainerControl( ulId, this );
  932.     pContainer->setAutoDeleteObject( true );
  933.   }
  934.  
  935.   return( pContainer );
  936. }
  937.  
  938.  
  939. /*------------------------------------------------------------------------------
  940. | Dialog::progressIndicator                                                    |
  941. ------------------------------------------------------------------------------*/
  942. Dialog& Dialog :: progressIndicator( IProgressIndicator* pProgressIndicator )
  943. {
  944.   return( *this );
  945. }
  946.  
  947.  
  948. /*------------------------------------------------------------------------------
  949. | Dialog::progressIndicatorWithId                                              |
  950. ------------------------------------------------------------------------------*/
  951. IProgressIndicator* Dialog :: progressIndicatorWithId( unsigned long ulId )
  952. {
  953.   IProgressIndicator*
  954.     pProgressIndicator =
  955.              (IProgressIndicator *)IWindow::windowWithOwner( ulId, this );
  956.  
  957.   if ( !pProgressIndicator )
  958.   {
  959.     pProgressIndicator = new IProgressIndicator( ulId, this );
  960.     pProgressIndicator->setAutoDeleteObject( true );
  961.   }
  962.  
  963.   return( pProgressIndicator );
  964. }
  965.  
  966.  
  967. /*------------------------------------------------------------------------------
  968. | Dialog::slider                                                               |
  969. ------------------------------------------------------------------------------*/
  970. Dialog& Dialog :: slider( ISlider* pSlider )
  971. {
  972.   return( *this );
  973. }
  974.  
  975.  
  976. /*------------------------------------------------------------------------------
  977. | Dialog::sliderWithId                                                         |
  978. ------------------------------------------------------------------------------*/
  979. ISlider* Dialog :: sliderWithId( unsigned long ulId )
  980. {
  981.   ISlider*
  982.     pSlider = (ISlider *)IWindow::windowWithOwner( ulId, this );
  983.  
  984.   if ( !pSlider )
  985.   {
  986.     pSlider = new ISlider( ulId, this );
  987.     pSlider->setAutoDeleteObject( true );
  988.   }
  989.  
  990.   return( pSlider );
  991. }
  992.  
  993.  
  994. /*------------------------------------------------------------------------------
  995. | Dialog::notebook                                                             |
  996. ------------------------------------------------------------------------------*/
  997. Dialog& Dialog :: notebook( INotebook* pNotebook )
  998. {
  999.   return( *this );
  1000. }
  1001.  
  1002.  
  1003. /*------------------------------------------------------------------------------
  1004. | Dialog::notebookWithId                                                       |
  1005. ------------------------------------------------------------------------------*/
  1006. INotebook* Dialog :: notebookWithId( unsigned long ulId )
  1007. {
  1008.   INotebook*
  1009.     pNotebook = (INotebook *)IWindow::windowWithOwner( ulId, this );
  1010.  
  1011.   if ( !pNotebook )
  1012.   {
  1013.     pNotebook = new INotebook( ulId, this );
  1014.     pNotebook->setAutoDeleteObject( true );
  1015.   }
  1016.  
  1017.   return( pNotebook );
  1018. }
  1019.  
  1020.  
  1021. /*------------------------------------------------------------------------------
  1022. | Dialog::circularSlider                                                       |
  1023. ------------------------------------------------------------------------------*/
  1024. Dialog& Dialog :: circularSlider( ICircularSlider* pCircularSlider )
  1025. {
  1026.   return( *this );
  1027. }
  1028.  
  1029.  
  1030. /*------------------------------------------------------------------------------
  1031. | Dialog::circularSliderWithId                                                 |
  1032. ------------------------------------------------------------------------------*/
  1033. ICircularSlider* Dialog :: circularSliderWithId( unsigned long ulId )
  1034. {
  1035.   ICircularSlider*
  1036.     pCircularSlider = (ICircularSlider *)IWindow::windowWithOwner( ulId, this );
  1037.  
  1038.   if ( !pCircularSlider )
  1039.   {
  1040.     pCircularSlider = new ICircularSlider( ulId, this );
  1041.     pCircularSlider->setAutoDeleteObject( true );
  1042.   }
  1043.  
  1044.   return( pCircularSlider );
  1045. }
  1046.  
  1047.