home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / CHOOSECO.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  65 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   Definition of Choose Color Common Dialog class
  6. //----------------------------------------------------------------------------
  7. #if !defined(OWL_CHOOSECO_H)
  8. #define OWL_CHOOSECO_H
  9.  
  10. #if !defined(OWL_COMMDIAL_H)
  11. # include <owl/commdial.h>
  12. #endif
  13. #if !defined(OWL_COLOR_H)
  14. # include <owl/color.h>
  15. #endif
  16.  
  17. class _OWLCLASS TChooseColorDialog : public TCommonDialog {
  18.   public:
  19.     class _OWLCLASS TData {
  20.       public:
  21.         uint32      Flags;
  22.         uint32      Error;
  23.         TColor      Color;
  24.         TColor*     CustColors;
  25.     };
  26.  
  27.     TChooseColorDialog(TWindow*        parent,
  28.                        TData&          data,
  29.                        TResId          templateId = 0,
  30.                        const char far* title = 0,
  31.                        TModule*        module = 0);
  32.  
  33.     //
  34.     // Set the current RGB color in this dialog
  35.     //
  36.     void    SetRGBColor(TColor color) {SendMessage(SetRGBMsgId,0,color);}
  37.  
  38.   protected:
  39.     CHOOSECOLOR  cc;
  40.     TData&       Data;
  41.  
  42.     int     DoExecute();
  43.     bool    DialogFunction(uint message, WPARAM, LPARAM);
  44.  
  45.     //
  46.     // Registered messages this class sends (to itself)
  47.     //
  48.     static uint SetRGBMsgId;
  49.  
  50.     //
  51.     // Default behavior inline for message response functions
  52.     //
  53.     LPARAM  EvSetRGBColor(WPARAM, LPARAM)      // EV_REGISTERED(SETRGBSTRING,
  54.              {return DefaultProcessing();}
  55.     
  56.   private:
  57.     TChooseColorDialog(const TChooseColorDialog&);
  58.     TChooseColorDialog& operator=(const TChooseColorDialog&);
  59.  
  60.   DECLARE_RESPONSE_TABLE(TChooseColorDialog);
  61.   DECLARE_CASTABLE;
  62. };
  63.  
  64. #endif  // OWL_CHOOSECO_H
  65.