home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / spmio10.zip / gcc2 / stdwin / stdwin.h < prev    next >
C/C++ Source or Header  |  1994-06-09  |  3KB  |  102 lines

  1. #ifndef include_stdwin_h
  2. #define include_stdwin_h
  3.  
  4. #define INCL_PM
  5. #include <os2.h>
  6.  
  7. class StdWinUtils;
  8.  
  9. class StdWin
  10. {
  11.   friend StdWinUtils;
  12. public:
  13.   static HAB hab;
  14.   static HMQ hmq;
  15.   StdWin ();
  16.   virtual ~StdWin ();
  17.   void activate_window ();
  18.   void destroy_window ();
  19.   static void StdMessageLoop ();
  20.  
  21.   HWND window;
  22.   HWND frame;
  23. protected:
  24.   int window_is_active;
  25.   unsigned resource_id;
  26.   unsigned msg;
  27.   MPARAM mp1, mp2;
  28.   virtual MRESULT message (HWND, unsigned, MPARAM, MPARAM);
  29.   virtual MRESULT default_message ();
  30.  
  31.   virtual MRESULT msg_create ();
  32.   virtual MRESULT msg_activate (int, HWND);
  33.   virtual MRESULT msg_adjustwindowpos (SWP *);
  34.   virtual MRESULT msg_char (unsigned short flags, unsigned char repeat_count,
  35.                 unsigned char scancode, unsigned short charcode,
  36.                 unsigned short virtualkeycode);
  37.   virtual MRESULT msg_close ();
  38.   virtual MRESULT msg_controlpointer (unsigned short, HPOINTER);
  39.   virtual MRESULT msg_destroy ();
  40.   virtual MRESULT msg_erasebackground (HPS, RECTL *);
  41.   virtual MRESULT msg_focuschange (HWND, unsigned short, unsigned short);
  42.   virtual MRESULT msg_formatframe (SWP *, RECTL *);
  43.   virtual MRESULT msg_mousemove (short x, short y,
  44.                  unsigned short, unsigned short);
  45.   virtual MRESULT msg_paint ();
  46.   virtual MRESULT msg_realizepalette ();
  47.   virtual MRESULT msg_saveapplication ();
  48.   virtual MRESULT msg_setfocus (HWND, unsigned short);
  49.   virtual MRESULT msg_setselection (unsigned short);
  50.   virtual MRESULT msg_show (unsigned short);
  51.   virtual MRESULT msg_size (short old_width, short old_height,
  52.                 short new_width, short new_heigth);
  53.   virtual MRESULT msg_windowposchanged (SWP *, unsigned);
  54.   // Messages with user-defined meanings
  55.   virtual MRESULT msg_user1 (MPARAM mp1, MPARAM mp2);
  56.   virtual MRESULT msg_user2 (MPARAM mp2, MPARAM mp2);
  57.   virtual MRESULT msg_user3 (MPARAM mp2, MPARAM mp2);
  58.   virtual MRESULT msg_user4 (MPARAM mp2, MPARAM mp2);
  59.   // Arguments of the following are not yet decoded
  60.   virtual MRESULT msg_querydlgcode ();
  61.   virtual MRESULT msg_queryfocuschain ();
  62.  
  63.   // Sending user defined messages
  64.   MRESULT send_msg (unsigned msg, MPARAM mp1, MPARAM mp2);
  65.   MRESULT send_close ();
  66.   MRESULT send_user1 (MPARAM mp1, MPARAM mp2);
  67.   MRESULT send_user2 (MPARAM mp1, MPARAM mp2);
  68.   MRESULT send_user3 (MPARAM mp1, MPARAM mp2);
  69.   MRESULT send_user4 (MPARAM mp1, MPARAM mp2);
  70.   
  71.  
  72.   // Configuring the look of the frame before the window is created.
  73.   unsigned long style_flags;
  74.   void enable_acceltable ();
  75.   void enable_icon ();
  76.   void enable_maxbutton ();
  77.   void enable_menu ();
  78.   void enable_minbutton ();
  79.   void enable_minmax ();
  80.   void enable_shellposition ();
  81.   void enable_sizeborder ();
  82.   void enable_sysmenu ();
  83.   void enable_tasklist ();
  84.   void enable_titlebar ();
  85.   void disable_acceltable ();
  86.   void disable_icon ();
  87.   void disable_maxbutton ();
  88.   void disable_menu ();
  89.   void disable_minbutton ();
  90.   void disable_minmax ();
  91.   void disable_shellposition ();
  92.   void disable_sizeborder ();
  93.   void disable_sysmenu ();
  94.   void disable_tasklist ();
  95.   void disable_titlebar ();
  96.  
  97.   // Configuring resource id to be used
  98.   void set_resource_id (unsigned id) { resource_id = id; }
  99. };
  100.  
  101. #endif /* include_stdwin_h */
  102.