~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to Nux/ColorArea.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-11-18 19:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101118191732-rn35790vekj6o4my
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3, as
 
6
 * published by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
 
12
 * License for more details.
 
13
 *
 
14
 * You should have received a copy of both the GNU Lesser General Public
 
15
 * License version 3 along with this program.  If not, see
 
16
 * <http://www.gnu.org/licenses/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#include "Nux.h"
 
24
#include "NuxImage/ImageSurface.h"
 
25
#include "ColorArea.h"
 
26
 
 
27
namespace nux
 
28
{
 
29
 
 
30
  ColorArea::ColorArea (Color color, NUX_FILE_LINE_DECL)
 
31
    :   View (NUX_FILE_LINE_PARAM)
 
32
    ,   m_Color (color)
 
33
  {
 
34
    SetMinMaxSize (50, 50);
 
35
  }
 
36
 
 
37
  ColorArea::~ColorArea()
 
38
  {
 
39
  }
 
40
 
 
41
  long ColorArea::ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
 
42
  {
 
43
    return TraverseInfo;
 
44
  }
 
45
 
 
46
  void ColorArea::Draw (GraphicsEngine &GfxContext, bool force_draw)
 
47
  {
 
48
    GetPainter().Paint2DQuadColor (GfxContext, GetGeometry(), m_Color);
 
49
  }
 
50
 
 
51
  void ColorArea::DrawContent (GraphicsEngine &GfxContext, bool force_draw)
 
52
  {
 
53
 
 
54
  }
 
55
 
 
56
  void ColorArea::PostDraw (GraphicsEngine &GfxContext, bool force_draw)
 
57
  {
 
58
 
 
59
  }
 
60
 
 
61
  void ColorArea::SetColor (Color color)
 
62
  {
 
63
    m_Color = color;
 
64
    NeedRedraw();
 
65
  }
 
66
 
 
67
 
 
68
}