home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / acdf5 / acdfvw5.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.0 KB  |  91 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //                        SAMPLE CODE
  3. //
  4. // FileName: ACDFVw5.hpp
  5. //
  6. // ClassName: ACompDocFwkView
  7. //
  8. // Description: Compound Document Framework header file for the view class
  9. //                This sample show how to add elements to a collection class
  10. //              and stream the colllection out and in.
  11. //              Basically the screen allows the user to capture Name and Age
  12. //              and add them to a list (collection). The type of list the
  13. //              name is added to depends on which of the radio buttons have 
  14. //              been selected
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #ifndef _COMPDOCFWK_VIEW_
  17. #define _COMPDOCFWK_VIEW_
  18.  
  19. #ifdef IC_TRACE_DEVELOP
  20.     #include <itrace.hpp>
  21. #else
  22.     #define IFUNCTRACE_DEVELOP()
  23.     #define ITRACE_DEVELOP(x)
  24. #endif
  25.  
  26. #include "acdfpsn5.hpp"
  27. #include <iview.hpp>
  28. #include <ientryfd.hpp>
  29. #include <ipushbut.hpp>
  30. #include <icmdhdr.hpp>
  31. #include <icanvas.hpp>
  32. #include <istattxt.hpp>
  33. #include <ilistbox.hpp>
  34. #include <iradiobt.hpp>
  35. #include <itselhdr.hpp>
  36.  
  37. class ACompDocFwkModel;
  38.  
  39. class ACompDocFwkView : public IView
  40. {
  41. public:
  42.                                 ACompDocFwkView(IGUIBundle& );
  43.     virtual                     ~ACompDocFwkView();
  44.  
  45.     virtual void                initialize();
  46.  
  47.     // This is convenience function that downcast the model
  48.     virtual ACompDocFwkModel*   getModelPointer() const;
  49.  
  50.     virtual void                drawContents( IPresSpaceHandle&,
  51.                                               const IRectangle& invalidArea,
  52.                                               Boolean metaFile );
  53.  
  54.     virtual Boolean             handleCommand(ICommandEvent&);
  55.     virtual Boolean             handleSelected(IControlEvent&);
  56.  
  57.     virtual void                handleNotification( const INotificationEvent& );
  58.  
  59.             void                handleSelectAll(Boolean);
  60.             void                handleFileNew();
  61.  
  62.             void                addToSeq();
  63.             void                deleteFromSeq();
  64.  
  65. protected:
  66.                                 ACompDocFwkView(const ACompDocFwkView&);
  67.  
  68. private:
  69.     ACompDocFwkView&            operator=( const ACompDocFwkView& );
  70.  
  71.     TPerson                     fSelectedPerson;
  72.     IEntryField                 fDataName;
  73.     IEntryField                 fDataAge;
  74.     IListBox                    fPersonListBox;
  75.                                                                       
  76.     IStaticText                 fStaticName;
  77.     IStaticText                 fStaticAge;
  78.     IStaticText                 fStaticList;
  79.  
  80.     IPushButton                 fButtonAdd;
  81.     IPushButton                 fButtonDelete;
  82.  
  83.     IRadioButton                fRadioSeq;
  84.     IRadioButton                fRadioKey;
  85.  
  86.     ICommandConnectionTo<ACompDocFwkView>    fCommandHandler;
  87.     ISelectConnectionTo<ACompDocFwkView>    fSelectHandler;
  88. };
  89. #endif
  90.     
  91.