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

« back to all changes in this revision

Viewing changes to Nux/HSplitter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-08-25 13:42:45 UTC
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20110825134245-kfz5nhs15353wcbl
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    m_SplitConfig.clear();
76
76
  }
77
77
 
78
 
  long HSplitter::ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
79
 
  {
80
 
    long ret = TraverseInfo;
81
 
    long ProcEvInfo = ProcessEventInfo;
82
 
 
83
 
    if (ievent.e_event == NUX_MOUSE_PRESSED)
84
 
    {
85
 
      if (!_geometry.IsPointInside (ievent.e_x, ievent.e_y) )
86
 
      {
87
 
        ProcEvInfo |= eDoNotProcess;
88
 
        //return TraverseInfo;
89
 
      }
90
 
    }
91
 
 
92
 
    //if(traverse)
93
 
    {
94
 
      std::vector<MySplitter *>::iterator it_splitter;
95
 
 
96
 
      for (it_splitter = m_SplitterObject.begin(); it_splitter != m_SplitterObject.end(); it_splitter++)
97
 
      {
98
 
        ret = (*it_splitter)->OnEvent (ievent, ret, ProcEvInfo);
99
 
      }
100
 
 
101
 
      std::vector<Area *>::iterator it;
102
 
 
103
 
      for (it = m_InterfaceObject.begin(),
104
 
           it_splitter = m_SplitterObject.begin();
105
 
           it != m_InterfaceObject.end();
106
 
           it++, it_splitter++)
107
 
      {
108
 
        Geometry clip_geo;
109
 
        clip_geo.SetX ( ( (*it)->GetGeometry().x) );
110
 
        clip_geo.SetY ( ( (*it)->GetGeometry().y) );
111
 
        clip_geo.SetWidth ( (*it)->GetGeometry().GetWidth() );
112
 
        clip_geo.SetHeight ( (*it_splitter)->GetGeometry().y - (*it)->GetGeometry().y);
113
 
 
114
 
        long DoNotProcess = ProcEvInfo;
115
 
 
116
 
        if (clip_geo.IsPointInside (ievent.e_x, ievent.e_y) == false)
117
 
        {
118
 
          DoNotProcess |= eDoNotProcess;
119
 
        }
120
 
 
121
 
        if ( (*it)->Type().IsDerivedFromType (View::StaticObjectType) )
122
 
        {
123
 
          View *ic = static_cast<View *>(*it);
124
 
          ret = ic->BaseProcessEvent (ievent, ret, ProcEvInfo | DoNotProcess);
125
 
        }
126
 
        else if ( (*it)->Type().IsObjectType (InputArea::StaticObjectType) )
127
 
        {
128
 
          InputArea *base_area = static_cast<InputArea *>(*it);
129
 
          ret = base_area->OnEvent (ievent, ret, ProcEvInfo | DoNotProcess);
130
 
        }
131
 
        else if ( (*it)->Type().IsDerivedFromType (Layout::StaticObjectType) )
132
 
        {
133
 
          Layout *layout = static_cast<Layout *>(*it);
134
 
          ret = layout->ProcessEvent (ievent, ret, ProcEvInfo | DoNotProcess);
135
 
        }
136
 
      }
137
 
    }
138
 
 
139
 
    ret = PostProcessEvent2 (ievent, ret, ProcEvInfo);
140
 
 
141
 
    return ret;
142
 
  }
143
 
 
144
78
  void HSplitter::Draw (GraphicsEngine &GfxContext, bool force_draw)
145
79
  {
146
80
    GfxContext.PushClippingRectangle (GetGeometry() );