~sil2100/nux/revert_640

« back to all changes in this revision

Viewing changes to Nux/ToolButton.cpp

  • Committer: Jay Taoko
  • Date: 2011-10-09 22:18:34 UTC
  • Revision ID: jay.taoko@canonical.com-20111009221834-9y890qzzj8rlp2r6
* Removing non-core UI views from Nux
* Refactoring in Layout
* Added LinearLayout.h/.cpp as a sub-class for HLayout and VLayout

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    m_Texture->UnReference ();
61
61
  }
62
62
 
63
 
  long ToolButton::ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
64
 
  {
65
 
    long ret = TraverseInfo;
66
 
 
67
 
    ret = PostProcessEvent2 (ievent, ret, ProcessEventInfo);
68
 
    return ret;
69
 
  }
70
 
 
71
 
  void ToolButton::Draw (GraphicsEngine &GfxContext, bool force_draw)
 
63
  void ToolButton::Draw (GraphicsEngine &graphics_engine, bool force_draw)
72
64
  {
73
65
    Geometry base = GetGeometry();
74
66
 
75
67
    if (IsMouseInside() && !IsMouseOwner() )
76
68
    {
77
 
      GetPainter().PaintBackground (GfxContext, base);
78
 
      GetPainter().PaintShape (GfxContext, base, Color (COLOR_BACKGROUND_SECONDARY),  eSHAPE_CORNER_ROUND2);
 
69
      GetPainter().PaintBackground (graphics_engine, base);
 
70
      GetPainter().PaintShape (graphics_engine, base, Color (COLOR_BACKGROUND_SECONDARY),  eSHAPE_CORNER_ROUND2);
79
71
    }
80
72
    else if (IsMouseOwner() )
81
73
    {
82
 
      GetPainter().PaintBackground (GfxContext, base);
83
 
      GetPainter().PaintShape (GfxContext, base, Color (0xFF2A2A2A),  eSHAPE_CORNER_ROUND2);
 
74
      GetPainter().PaintBackground (graphics_engine, base);
 
75
      GetPainter().PaintShape (graphics_engine, base, Color (0xFF2A2A2A),  eSHAPE_CORNER_ROUND2);
84
76
    }
85
77
    else
86
78
    {
87
 
      GetPainter().PaintBackground (GfxContext, base);
88
 
      GetPainter().PaintShape (GfxContext, base, Color (COLOR_BACKGROUND_PRIMARY),  eSHAPE_CORNER_ROUND2);
 
79
      GetPainter().PaintBackground (graphics_engine, base);
 
80
      GetPainter().PaintShape (graphics_engine, base, Color (COLOR_BACKGROUND_PRIMARY),  eSHAPE_CORNER_ROUND2);
89
81
    }
90
82
 
91
83
    if (m_Texture)
92
 
      GetPainter().Draw2DTextureAligned (GfxContext, m_Texture, base, TextureAlignmentStyle (eTACenter, eTACenter) );
 
84
      GetPainter().Draw2DTextureAligned (graphics_engine, m_Texture, base, TextureAlignmentStyle (eTACenter, eTACenter) );
93
85
  }
94
86
 
95
 
  void ToolButton::DrawContent (GraphicsEngine &GfxContext, bool force_draw)
 
87
  void ToolButton::DrawContent (GraphicsEngine &graphics_engine, bool force_draw)
96
88
  {
97
89
 
98
90
  }
99
91
 
100
 
  void ToolButton::PostDraw (GraphicsEngine &GfxContext, bool force_draw)
 
92
  void ToolButton::PostDraw (GraphicsEngine &graphics_engine, bool force_draw)
101
93
  {
102
94
 
103
95
  }