Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

# background_wnd/painters/color_painter.hpp

    00001 // color_painter.hpp
    00002
    00003 // Copyright (C) 2004 Steven Weiß (steven11@gmx.de)
    00004 //
    00005 // Permission to copy, use, sell and distribute this software is granted
    00006 // provided this copyright notice appears in all copies.
    00007 // Permission to modify the code and to distribute modified code is granted
    00008 // provided this copyright notice appears in all copies, and a notice
    00009 // that the code was modified is included with the copyright notice.
    00010 //
    00011 // This software is provided "as is" without express or implied warranty,
    00012 // and with no claim as to its suitability for any purpose.
    00013
    00014
    00015 #pragma once
    00016 #include <background_wnd/detail/include.hpp>
    00017 #include <background_wnd/painter_base.hpp>
    00018
    00019
    00020 namespace win32 { namespace gui {
    00021
    00022 class color_painter : public painter_base
    00023 {
    00024      LOGPEN pen_;
    00025      LOGBRUSH br_;
    00026
    00027 public:
    00028      typedef LOGBRUSH param0;
    00029      typedef LOGPEN param1;
    00030
    00031      // c'tor
    00032      color_painter();
    00033      color_painter(LOGBRUSH brush);
    00034      color_painter(LOGBRUSH brush, LOGPEN pen);
    00035
    00036      // virtual functions of painter_base
    00037      color_painter* clone() const;
    00038      void draw(HDC hDC, int cx, int cy);
    00039      bool is_opaque(int cx, int cy) const;
    00040
    00041      // own functions
    00042      void brush(LOGBRUSH brush);
    00043      LOGBRUSH brush() const;
    00044      void pen(LOGPEN pen);
    00045      LOGPEN pen() const;
    00046
    00047      static LOGBRUSH make_brush(COLORREF cr = GetSysColor(COLOR_WINDOW), unsigned style = BS_SOLID, long hatch = 0);
    00048      static LOGPEN  make_pen(COLORREF cr = GetSysColor(COLOR_WINDOWTEXT), unsigned style = PS_SOLID, unsigned width = 1);
    00049 };
    00050
    00051 } }  // namespace win32::gui