home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Samples / NextHand / Source / NextHand.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  4KB  |  192 lines

  1. // NextHand.hpp
  2. // Next like toolbar
  3.  
  4. // $Header: W:/Projects/OCL/Samples/NextHand/Source/rcs/NextHand.hpp 1.50 1996/08/11 23:48:44 B.STEIN Release $
  5.  
  6. #define OINCL_BASE
  7. #include <ocl.hpp>
  8.  
  9. #include <OString.hpp>
  10. #include <OPMinit.hpp>
  11. #include <OCommand.hpp>
  12. #include <OXApp.hpp>
  13. #include <OWindow.hpp>
  14. #include <OFrame.hpp>
  15. #include <OProfile.hpp>
  16. #include <ODialog.hpp>
  17. #include <OMSGS.hpp>
  18. #include <OButtonBar.hpp>
  19. #include <OHelp.hpp>
  20. #include <OXcptPM.hpp>
  21. #include <OMLE.hpp>
  22. #include <OEntryField.hpp>
  23. #include <OTimer.hpp>
  24.  
  25. #include "..\Source\NextHand.h"
  26.  
  27. #include <ctype.h>
  28.  
  29. #define USERITEMFIRST NHX_FIRST_BUTTON
  30. #define USERITEMLAST  NHX_FIRST_BUTTON+50
  31.  
  32. #define WM_TOOLBAR_RESET  WM_USER+1
  33. #define WM_CFG_CANCELED   WM_USER+2
  34. #define WM_SAVE_BUTTONS   WM_USER+3
  35. #define NHX_FLOAT_TIMER   TID_USERMAX-1
  36. #define FLOAT_TIMER       3000
  37.  
  38. #define SSF_TYPE_WPSOBJECT 21
  39. #define FAPPTYP_WINDOWSPROT31 0x1000
  40.  
  41. #ifdef __BORLANDC__
  42.   #define PROG_31_ENH  (PROGCATEGORY)19
  43. #endif
  44.  
  45. extern "C" 
  46. {
  47.   VOID EXPENTRY closeFolders(BOOL close);
  48.   BOOL EXPENTRY initHooks(HAB hab);
  49.  
  50. typedef struct NextInfo *pNextInfo;
  51.  
  52. struct NextInfo
  53. {
  54.  ULONG  style;
  55.  ULONG  large;
  56.  SWP    position;
  57.  BOOL   floating;
  58.  CHAR   bubbleFont[50]; 
  59. };
  60.  
  61. typedef class NextBarEvent *pNextBarEvent;
  62.  
  63. class NextBarEvent
  64. {
  65.  public:
  66.    OString   title;
  67.    OString   name;
  68.    OString   dir;
  69.    OString   inputs;
  70.    OString   icon;
  71.    OString   settings;
  72.    USHORT    session;
  73.    USHORT    control;
  74.    USHORT    Bkgr;
  75.  
  76.    NextBarEvent();
  77.    virtual ~NextBarEvent();
  78.    void startEvent();
  79. };
  80.  
  81. typedef class OList<NextBarEvent> EventList;
  82. typedef EventList *pEventList;
  83.  
  84. typedef class NextBarDlg *pNextBarDlg;
  85.  
  86. class NextBarDlg : public ODialog
  87. {
  88.  private:
  89.    pNextBarEvent   event;
  90.    OGraphicsButton *actualButton;
  91.    BOOL            isCreation;
  92.    OEntryField     Title;
  93.    OEntryField     Program;
  94.    OEntryField     Path;
  95.    OEntryField     Parms;
  96.    OEntryField     Icon;
  97.    OMLE            Settings;
  98.  
  99.  public:
  100.    NextBarDlg(pNextBarEvent  pevt, pOGraphicsButton button, BOOL newItem);
  101.    virtual ~NextBarDlg() {}
  102.    virtual PSZ isOfType() const; 
  103.  
  104.    void handleButtons(MPARAM mp1);
  105.    void setButtons();
  106.    void setProgram2Dialog();
  107.    void setDialog2Program();
  108.    void install2Dialog(PSZ FileName, BOOL bObject);
  109.    void loadProgram();
  110.  
  111. // Command Handler
  112.    BOOL OCommand(ULONG msg, MPARAM mp1, MPARAM mp2);
  113. };
  114.  
  115.  
  116. typedef class NextBarInfoDlg *pNextBarInfoDlg;
  117.  
  118. class NextBarInfoDlg : public ODialog
  119. {
  120.  public:
  121.     NextBarInfoDlg() : ODialog(NHX_INFO_DLG) {}
  122.     virtual ~NextBarInfoDlg() {}
  123.     virtual PSZ isOfType() const; 
  124.  
  125.     BOOL OCommand(ULONG msg, MPARAM mp1, MPARAM mp2);
  126. };
  127.  
  128.  
  129. #define SWITCH_TO_DEFAULT  1
  130. #define SWITCH_TO_PROGRAM  2
  131. #define SWITCH_TO_SORT       3
  132.  
  133. typedef class NextBar *pNextBar;
  134.  
  135. class NextBar
  136.    : virtual public OHelp, 
  137.      virtual public OMsgs,
  138.      virtual public OFrame
  139. {
  140.  private:
  141.      pOButtonBar  nxButtons;
  142.      OList<OIcon> iconList;
  143.      pOProfile    ini;
  144.      OString      Profile;
  145.      NextInfo     setup;
  146.      HWND         menu;
  147.      ULONG        selectedButton;
  148.      ULONG        buttonSize;
  149.      OTimer       floatTimer;     
  150.  
  151.  public:
  152.      EventList    events;
  153.  
  154.      NextBar();
  155.      virtual ~NextBar();
  156.      virtual PSZ isOfType() const; 
  157.  
  158.      BOOL init();
  159.      BOOL loadProfile();
  160.      BOOL saveProfile();
  161.      void setNewStyle(ULONG flag);
  162.      void trackButtons();
  163.      void resetToolBar();
  164.      void closeFolders(BOOL close);
  165.  
  166.      BOOL OCommand(ULONG msg, MPARAM mp1, MPARAM mp2);
  167. };
  168.  
  169.  
  170. typedef class NextHand *pNextHand;
  171.  
  172. class NextHand 
  173. {
  174.  protected:
  175.     OXApp    app;
  176.  
  177.  public:
  178.     pNextBar toolbar;
  179.  
  180.     NextHand() {}
  181.     ~NextHand() {}
  182.     virtual PSZ isOfType() const; 
  183.  
  184.     BOOL ShutdownPosted();
  185. };
  186.  
  187.  
  188. extern pNextHand nxh;
  189.  
  190. // end
  191.