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

« back to all changes in this revision

Viewing changes to Nux/MenuPage.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:
217
217
 
218
218
  void MenuSeparator::Draw (GraphicsEngine &GfxContext, bool force_draw)
219
219
  {
220
 
    Geometry base = GetGeometry ();
221
 
    int y0 = base.y + base.GetHeight () / 2;
222
 
    GetPainter ().Draw2DLine (GfxContext, base.x, y0, base.x + base.GetWidth(), y0, Color (0xFF222222));
223
 
    GetPainter ().Draw2DLine (GfxContext, base.x, y0 + 1, base.x + base.GetWidth(), y0 + 1, Color (0xFFAAAAAA) );
 
220
    Geometry base = GetGeometry();
 
221
    int y0 = base.y + base.GetHeight() / 2;
 
222
    GetPainter().Draw2DLine (GfxContext, base.x, y0, base.x + base.GetWidth(), y0, Color(0xFF222222));
 
223
    GetPainter().Draw2DLine (GfxContext, base.x, y0 + 1, base.x + base.GetWidth(), y0 + 1, Color(0xFFAAAAAA));
224
224
  }
225
225
 
226
 
  MenuPage::MenuPage (const TCHAR *title, NUX_FILE_LINE_DECL)
227
 
    :   View (NUX_FILE_LINE_PARAM)
 
226
  MenuPage::MenuPage(const TCHAR *title, NUX_FILE_LINE_DECL)
 
227
  : View (NUX_FILE_LINE_PARAM)
228
228
  {
229
229
    m_Parent = 0;
230
230
    m_item_width = MENU_ITEM_MIN_WIDTH;
233
233
    m_MenuWindow = 0;
234
234
    m_Name = title;
235
235
    m_IsTopOfMenuChain = false;
236
 
    _font_name = g_strdup ("Ubuntu 12");
 
236
    _font_name = g_strdup("Ubuntu 12");
 
237
 
 
238
    on_closure_continue_with_event_ = false;
237
239
 
238
240
    // Set Original State
239
241
 
240
242
    // Set Signals
241
 
    mouse_move.connect (sigc::mem_fun (this, &MenuPage::EmitMouseMove));
242
 
    mouse_drag.connect (sigc::mem_fun (this, &MenuPage::EmitMouseDrag));
243
 
    mouse_down.connect (sigc::mem_fun (this, &MenuPage::EmitMouseDown));
244
 
    mouse_up.connect (sigc::mem_fun (this, &MenuPage::EmitMouseUp));
245
 
    mouse_leave.connect (sigc::mem_fun (this, &MenuPage::RecvMouseLeave));
246
 
    mouse_down_outside_pointer_grab_area.connect (sigc::mem_fun (this, &MenuPage::Terminate));
 
243
    mouse_move.connect(sigc::mem_fun(this, &MenuPage::EmitMouseMove));
 
244
    mouse_drag.connect(sigc::mem_fun(this, &MenuPage::EmitMouseDrag));
 
245
    mouse_down.connect(sigc::mem_fun(this, &MenuPage::EmitMouseDown));
 
246
    mouse_up.connect(sigc::mem_fun(this, &MenuPage::EmitMouseUp));
 
247
    mouse_leave.connect(sigc::mem_fun(this, &MenuPage::RecvMouseLeave));
 
248
    mouse_down_outside_pointer_grab_area.connect(sigc::mem_fun (this, &MenuPage::Terminate));
247
249
 
248
250
    // Set Geometry
249
 
    SetGeometry (Geometry (0, 0, DEFAULT_WIDGET_WIDTH, DEFAULT_WIDGET_HEIGHT));
 
251
    SetGeometry(Geometry (0, 0, DEFAULT_WIDGET_WIDTH, DEFAULT_WIDGET_HEIGHT));
250
252
 
251
253
    // Set layout
252
254
 
1222
1224
  {
1223
1225
    return GetGeometry();
1224
1226
  }
 
1227
 
 
1228
  void MenuPage::SetOnClosureContinueEventCycle(bool on_closure_continue_with_event)
 
1229
  {
 
1230
    on_closure_continue_with_event_ = on_closure_continue_with_event;
 
1231
  }
 
1232
 
 
1233
  bool MenuPage::OnClosureContinueEventCycle() const
 
1234
  {
 
1235
    return on_closure_continue_with_event_;
 
1236
  }
1225
1237
}