~diegosarmentero/nuxplayground/nux-view-html-typos

« back to all changes in this revision

Viewing changes to src/nux-widgets/nux-widgets.cpp

  • Committer: Jay Taoko
  • Date: 2012-07-05 13:45:27 UTC
  • mfrom: (15 nuxplayground)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: jay.taoko@canonical.com-20120705134527-32qoul6zg3fd43w4
* Added nux-widgets sample

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include "Nux/WindowThread.h"
4
4
#include "Nux/RGBValuator.h"
5
5
#include "Nux/RangeValue.h"
6
 
#include "Nux/ComboBoxSimple.h"
 
6
 
7
7
#include "Nux/NumericValuator.h"
8
8
#include "Nux/CheckBox.h"
9
9
#include "Nux/RadioButton.h"
12
12
#include "Nux/GroupBox.h"
13
13
#include "Nux/GroupBox2.h"
14
14
#include "Nux/GridHLayout.h"
15
 
#include "Nux/GridVLayout.h"
16
15
#include "Nux/ClientArea.h"
17
16
#include "Nux/HSplitter.h"
18
17
#include "Nux/VSplitter.h"
78
77
        grid_h_layout->SetScaleFactor(1);
79
78
        scroll_view->SetLayout(grid_h_layout);
80
79
 
81
 
        nux::ComboBoxSimple* combobox = new nux::ComboBoxSimple(NUX_TRACKER_LOCATION);
82
 
        combobox->AddItem ("Hello Unity Team0", 0);
83
 
        combobox->AddItem ("Hello Unity Team11", 1);
84
 
        combobox->AddItem ("Hello Unity Team222", 2);
85
 
        combobox->AddItem ("Hello Unity Team3333", 3);
86
 
        combobox->AddItem ("Hello Unity Team44444", 4);
87
 
        combobox->AddItem ("Bonjour Unity Team", 5);
88
 
        combobox->AddItem ("Hola Unity Team", 6);
89
 
        combobox->AddItem ("Guten Tag Unity Team", 7);
90
 
 
91
 
        //combobox->SetPopupWindowSize(120, 150);
92
 
        combobox->SetMaximumWidth(250);
93
 
 
94
 
        layout->AddView (combobox, 0);
 
80
        // nux::ComboBoxSimple* combobox = new nux::ComboBoxSimple(NUX_TRACKER_LOCATION);
 
81
        // combobox->AddItem ("Hello Unity Team0", 0);
 
82
        // combobox->AddItem ("Hello Unity Team11", 1);
 
83
        // combobox->AddItem ("Hello Unity Team222", 2);
 
84
        // combobox->AddItem ("Hello Unity Team3333", 3);
 
85
        // combobox->AddItem ("Hello Unity Team44444", 4);
 
86
        // combobox->AddItem ("Bonjour Unity Team", 5);
 
87
        // combobox->AddItem ("Hola Unity Team", 6);
 
88
        // combobox->AddItem ("Guten Tag Unity Team", 7);
 
89
 
 
90
        // //combobox->SetPopupWindowSize(120, 150);
 
91
        // combobox->SetMaximumWidth(250);
 
92
 
 
93
        // layout->AddView (combobox, 0);
95
94
        layout->AddView (GetMenuBar (g_proxy), 1);
96
95
        layout->AddView(scroll_view, 1, nux::eCenter, nux::eFull);
97
96
        layout->SetContentDistribution(nux::eStackCenter);
199
198
    MainLayout->SetScaleFactor(1);
200
199
    MainLayout->SetHorizontalExternalMargin(4);
201
200
    MainLayout->SetVerticalExternalMargin(4);
202
 
    static_cast<nux::WindowThread*>(thread)->SetWindowBackgroundPaintLayer(&nux::ColorLayer(nux::Color(0xFF222222)));
 
201
 
 
202
    nux::Color color(0xFF222222);
 
203
    nux::ColorLayer color_layer(color);
 
204
    static_cast<nux::WindowThread*>(thread)->SetWindowBackgroundPaintLayer(&color_layer);
203
205
    static_cast<nux::WindowThread*>(thread)->SetLayout(MainLayout);
204
206
    //delete timegraph;
205
207
    //delete MainLayout;
377
379
 
378
380
  group_box2_0->SetCaption("Group Box 0");
379
381
  {
380
 
    nux::ComboBoxSimple* combobox_ui    = new nux::ComboBoxSimple();
381
 
    combobox_ui->AddItem("A");
382
 
    combobox_ui->AddItem("B");
383
 
    combobox_ui->AddItem("C");
 
382
    // nux::ComboBoxSimple* combobox_ui    = new nux::ComboBoxSimple();
 
383
    // combobox_ui->AddItem("A");
 
384
    // combobox_ui->AddItem("B");
 
385
    // combobox_ui->AddItem("C");
384
386
 
385
387
    nux::VLayout* parameters_layout(new nux::VLayout("", NUX_TRACKER_LOCATION));
386
388
    parameters_layout->SetVerticalInternalMargin(4);
387
389
    parameters_layout->AddView(new nux::SpinBox(), 0, nux::eLeft, nux::eFix);
388
 
    parameters_layout->AddView(combobox_ui, 0, nux::eLeft, nux::eFull);
 
390
    // parameters_layout->AddView(combobox_ui, 0, nux::eLeft, nux::eFull);
389
391
    parameters_layout->AddView(new nux::SpinBox(), 0, nux::eLeft, nux::eFix);
390
392
    parameters_layout->AddView(new nux::SpinBoxDouble(), 0, nux::eLeft, nux::eFix);
391
393
    parameters_layout->AddView(new nux::ColorEditor(), 0, nux::eLeft, nux::eFix);
395
397
 
396
398
  group_box2_1->SetCaption("Group Box 1");
397
399
  {
398
 
    nux::FileSelector* fileselector = new nux::FileSelector();
 
400
    //nux::FileSelector* fileselector = new nux::FileSelector();
399
401
    nux::Button* button = new nux::Button();
400
402
//     button->SetCaption(TEXT(("Button")));
401
403
//     button->SetMinMaxSize(64, 28);
408
410
    nux::RGBValuator* rgbvaluator = new nux::RGBValuator();
409
411
    rgbvaluator->SetMinimumSize(250, 70);
410
412
 
411
 
    nux::ComboBoxSimple* combobox_ui = new nux::ComboBoxSimple();
412
 
    combobox_ui->AddItem("TRUE");
413
 
    combobox_ui->AddItem("FALSE");
414
 
    combobox_ui->AddItem("0");
415
 
    combobox_ui->AddItem("1");
 
413
    // nux::ComboBoxSimple* combobox_ui = new nux::ComboBoxSimple();
 
414
    // combobox_ui->AddItem("TRUE");
 
415
    // combobox_ui->AddItem("FALSE");
 
416
    // combobox_ui->AddItem("0");
 
417
    // combobox_ui->AddItem("1");
416
418
    nux::CheckBox* checkbox = new nux::CheckBox("Option 0");
417
419
    nux::RadioButton* radio_button = new nux::RadioButton("Option 1");
418
420
 
419
421
    nux::VLayout* parameters_layout(new nux::VLayout());
420
422
    parameters_layout->SetVerticalInternalMargin(4);
421
 
    parameters_layout->AddView(fileselector, 1, nux::eLeft, nux::eFull);
422
 
    parameters_layout->AddView(combobox_ui, 0, nux::eLeft, nux::eFix);
 
423
    //parameters_layout->AddView(fileselector, 1, nux::eLeft, nux::eFull);
 
424
    // parameters_layout->AddView(combobox_ui, 0, nux::eLeft, nux::eFix);
423
425
    parameters_layout->AddView(checkbox, 0, nux::eLeft, nux::eFix);
424
426
    parameters_layout->AddView(radio_button, 0, nux::eLeft, nux::eFix);
425
427
    parameters_layout->AddView(button, 0, nux::eLeft, nux::eFull);