home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Think Class Libraries / WASTE TCL 2.0b2 / WASTE VA / Source / CAbout.cp < prev    next >
Encoding:
Text File  |  1995-11-08  |  5.5 KB  |  190 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CAbout.cp
  3.  
  4.                 CAbout Dialog Director Class
  5.     
  6.     Copyright Â© 1995 Dan Crevier. All rights reserved.
  7.  
  8.     Generated by Visual Architectâ„¢ 8:23 PM Wed, Nov 8, 1995
  9.  
  10.     This file is only generated once. You can modify it by filling
  11.     in the placeholder functions and adding any new functions you wish.
  12.  
  13.     If you change the name of the dialog class, a fresh version of this
  14.     file will be generated. If you have made any changes to the file
  15.     with the old name, you will have to copy those changes to the new
  16.     file by hand.
  17.  
  18.  ******************************************************************************/
  19.  
  20. #include "CAbout.h"
  21.  
  22. #include "AboutItems.h"
  23. //#include "AppCommands.h"            // Remove comments if DoCommand overridden
  24.  
  25. #include <CIntegerText.h>
  26. #include <CControl.h>
  27. #include <CPopupMenu.h>
  28. #include <CPopupPane.h>
  29. #include <CArrayPane.h>
  30. #include <CIconButton.h>
  31. #include <CPictureButton.h>
  32. #include <CSwissArmyButton.h>
  33.  
  34. #include <CApplication.h>
  35. #include <Constants.h>
  36. #include <CDecorator.h>
  37. #include <CDesktop.h>
  38. #include <CDirectorOwner.h>
  39. #include <CFile.h>
  40. #include <TBUtilities.h>
  41. #include <CWindow.h>
  42.  
  43. extern    CApplication *gApplication;        /* The application                    */
  44. extern CDecorator    *gDecorator;        /* Decorator for arranging windows    */
  45. extern CDesktop        *gDesktop;            /* The visible Desktop                */
  46.  
  47.  
  48. TCL_DEFINE_CLASS_M1(CAbout, x_CAbout);
  49.  
  50. /**** C O N S T R U C T I O N / D E S T R U C T I O N   M E T H O D S ****/
  51.  
  52.  
  53. /******************************************************************************
  54.  ICAbout
  55.  
  56.     Initialize the dialog
  57.  
  58.  ******************************************************************************/
  59.  
  60. void CAbout::ICAbout(CDirectorOwner *aSupervisor)
  61.  
  62. {
  63.         // Initialize data members that must be set up before
  64.         // BeginData is called here.
  65.         
  66.         // Change FALSE to TRUE if you want to call SetData()
  67.         // and GetData() to initialize and fetch final pane values.
  68.         // (This is known as a push-style dialog, rather than the
  69.         // default pull-style.)
  70.  
  71.     x_CAbout::Ix_CAbout(aSupervisor, FALSE);
  72.  
  73.         // Initialize any other data members here
  74.  
  75. }
  76.  
  77.  
  78. /******************************************************************************
  79.  BeginData
  80.  
  81.     Set up initial pane values
  82. ******************************************************************************/
  83.  
  84. void CAbout::BeginData(CAboutData *initial)
  85.  
  86. {
  87.         //    Base class calls BeginData once after the window is created
  88.         //    to gather the initial values for the dialog panes. Note that
  89.         //    BeginData is called *before* Ix_CAbout returns. The
  90.         //    initial struct is cleared to zeros.
  91.  
  92.         //    Calling CollectPaneValues copies the initial values you set
  93.         //    in Visual Architect from the panes. This lets you
  94.         //    use these values as the starting point every time the dialog
  95.         //    is run. If you want to use values determined by your program
  96.         //    instead, omit this call.
  97.  
  98.     CollectPaneValues(*initial);
  99.  
  100.         //    Add code to replace some or all of the initial pane values below.
  101.  
  102. }
  103.  
  104.  
  105. /******************************************************************************
  106.  UpdateData
  107.  
  108.      React to changes by the user (or the program)
  109. ******************************************************************************/
  110.  
  111. void CAbout::UpdateData(CAboutUpdate *update, long itemNo)
  112.  
  113. {
  114.         //    UpdateData is called every time the user or the program
  115.         //    changes the value of a dialog pane. (Changes you make to
  116.         //    panes during a call to UpdateData do not result in
  117.         //    recursive calls to UpdateData.)
  118.  
  119.         //    Override to dynamically update other program objects.
  120.         //    Note that *only* the value corresponding to itemNo is present in
  121.         //    the update record. If you need the values of other panes,
  122.         //    you must ask the panes for them.
  123. }
  124.  
  125.  
  126. /******************************************************************************
  127.  EndData
  128.  
  129.      Receive final values from the dialog
  130. ******************************************************************************/
  131.  
  132. void CAbout::EndData(CAboutData *final)
  133.  
  134. {
  135.         //    The values of all panes are returned by this function,
  136.         //    which is called just before Close for a modeless dialog,
  137.         //    or just before returning from DoModalDialog.
  138.         
  139.         //    If DoModalDialog returns cmdCancel, EndData is called
  140.         //    with the values initially supplied to BeginData, allowing
  141.         //    you to back out any intermediate changes made in response
  142.         //    to UpdateData. If you do not use UpdateData, you can
  143.         //    test the value of dismissCmd to see whether to respond
  144.         //    to EndData.
  145. }
  146.  
  147.  
  148. /******************************************************************************
  149.  ProviderChanged    {OVERRIDE}
  150.      
  151.      A pane changed value
  152. ******************************************************************************/
  153.  
  154. void CAbout::ProviderChanged(CCollaborator *aProvider, long reason, void* info)
  155.  
  156. {
  157.         //    Override this function if you need to respond more directly
  158.         //    to changes in pane values. See the superclass's ProviderChanged
  159.         //    function for an example of how to check for changes.
  160.  
  161.         //    Note that there is a lot of traffic through this function
  162.         //    in addition to change notices. Do not forget to call the
  163.         //    superclass for all changes you do not handle completely.
  164.  
  165.     x_CAbout::ProviderChanged(aProvider, reason, info);
  166. }
  167.  
  168.  
  169. /******************************************************************************
  170.  DoCommand {OVERRIDE}
  171.  
  172.         Dispatch commands
  173.  ******************************************************************************/
  174.  
  175. void CAbout::DoCommand(long theCommand)
  176.  
  177. {
  178.     switch (theCommand)
  179.     {
  180.             // Insert your command handler cases here, e.g.,
  181.             //
  182.             //    case cmdMine:
  183.             //        DoMyCmd();
  184.             //        break;
  185.  
  186.         default:
  187.             x_CAbout::DoCommand(theCommand);
  188.     }
  189. }
  190.