home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / Multi-Panel Dialogs 1.1 / MPD Sources / UMPDialogHandler.h < prev    next >
Encoding:
Text File  |  1996-09-09  |  3.0 KB  |  90 lines  |  [TEXT/R*ch]

  1. // ===========================================================================
  2. //    File:                        UMPDialogHandler.h
  3. // Version:                    1.0 - Feb 1, 1996
  4. //    Author:                    Mike Shields (mshields@inconnect.com)
  5. //                            
  6. //    Copyright ©1996 Mike Shields. All rights reserved.
  7. // ===========================================================================
  8. //    UMPDialogHandler.cp        <- double-click + Command-D to see class definition
  9. //
  10. // StDialogHandler subclass which is the manager of a multipanel dialog. It is
  11. // responsible for handling the creation, deletetion and all messages generated
  12. // by the main dialog controls.
  13.  
  14. #pragma once
  15.  
  16. #include <UModalDialogs.h>
  17. #include "UResourcePlus.h"
  18.  
  19. #include "MPDTypes.h"
  20.  
  21. enum
  22. {
  23.     MPD_DefaultMPDialog        = 10000,
  24.     MPD_TabbedMPDialog        = 10001,
  25.     MPD_UseDefaultsButton    = 'UseD',
  26.     MPD_RevertButton            = 'Rvrt',
  27.     MPD_CancelButton            = 'Canc',
  28.     MPD_OKButton                = 'OK  ',
  29.     MPD_PanelSelectControl    = 'MPDc',
  30.     MPD_IncludeView            = 'MPDi',
  31.     
  32.     msg_MPDUseDefaults            = MPD_UseDefaultsButton,
  33.     msg_MPDRevert                    = MPD_RevertButton
  34. };
  35.  
  36. class CMPDIncludeView;
  37. class CMPDPanelSelectControl;
  38. class LTabGroup;
  39. class LArray;
  40.  
  41. class    StMPDialogHandler : public StDialogHandler
  42. {
  43. friend class CMPDPanelSelectControl;
  44.  
  45. public:
  46.                         StMPDialogHandler(ResIDT inDialogResID, LCommander *inSuper,
  47.                                                 PanelIDIndexT inInitialPaneIndex, 
  48.                                                 ResIDT inMPDResID);
  49.     virtual            ~StMPDialogHandler();
  50.                                 
  51.     virtual void    ListenToMessage(MessageT inMessage, void *ioParam);
  52.     virtual PanelIDIndexT
  53.                         GetCurrentPanelIndex(void) const { return mCurrentPanelIndex; };
  54.                             
  55.     virtual void    FinishCreate();
  56.  
  57. protected:
  58.     // The two GetPanelXXXData functions you MUST overide. They are the way 
  59.     // your application passes to the MPD framework the data needed to display
  60.     // the initial or factory default data in the requested panel. The handles 
  61.     // passed back from these methods become the property of this class, so 
  62.     // don't forget to detatch them or copy them or whatever before you pass
  63.     // them back.
  64.     virtual Handle    GetInitialPanelData(PanelIDIndexT inPanelIndex) = 0;
  65.     virtual Handle    GetPanelDefaultData(PanelIDIndexT inPanelIndex) = 0;
  66.  
  67.     // This method gets the panel data stored in the internal storage for the panel
  68.     // in question. If the handle returned is nil, then the panel was never visited
  69.     // no change was made to the panel data.
  70.     virtual Handle    RetrievePanelData(PanelIDIndexT inPanelIndex);
  71.     
  72.     // Here're the methods which handle the different messages we catch by default.
  73.     // you can overide them to provide your own twist on things.
  74.     virtual void    HandlePanelChange(Int16 inNewPanelIndex);
  75.     virtual void    HandleRevert(void);
  76.     virtual void    HandleUseDefaults(void);
  77.     virtual void    HandleOK(void);
  78.     virtual void    HandleCancel(void);
  79.     virtual void    SwitchToPanel(Int16 inNewPanelIndex);
  80.     
  81.     PanelIDIndexT            mCurrentPanelIndex;
  82.     CMPDIncludeView*        mIncludeView;
  83.     CMPDPanelSelectControl*    
  84.                                 mPanelSelectControl;
  85.     TResource<MPDHandle>    mMPDData;
  86.     LTabGroup*                mTabGroup;
  87.     LArray                    mPanelDataHandles;
  88. };
  89.  
  90.