FogControl::FogControl(const Rect & rect, FogControlDelegate *newDelegate)
    :   UIControl(rect)
{
    ControlsFactory::CustomizeDialog(this);
    
    delegate = newDelegate;
    
    
    Rect propertyRect(0, 0, rect.dx, rect.dy - ControlsFactory::BUTTON_HEIGHT);
    fogProperties = new PropertyList(propertyRect, NULL);
    AddControl(fogProperties);
    
    ControlsFactory::AddFogSubsection(fogProperties, true, 0.006f, Color::White());
    
    Rect buttonRect(0, rect.dy - ControlsFactory::BUTTON_HEIGHT, rect.dx / 2, ControlsFactory::BUTTON_HEIGHT);
    UIButton *btnCancel = ControlsFactory::CreateButton(buttonRect, LocalizedString(L"dialog.cancel"));
    btnCancel->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &FogControl::OnCancel));
    AddControl(btnCancel);
    SafeRelease(btnCancel);

    buttonRect.x = rect.dx - buttonRect.dx;
    UIButton *btnCreate = ControlsFactory::CreateButton(buttonRect, LocalizedString(L"dialog.set"));
    btnCreate->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &FogControl::OnSet));
    AddControl(btnCreate);
    SafeRelease(btnCreate);
}
CreateNodesDialog::CreateNodesDialog(const Rect & rect)
    :   DraggableDialog(rect)
{
    ControlsFactory::CustomizeDialog(this);

    sceneNode = NULL;
    scene = NULL;
    
    dialogDelegate = NULL;
	propertyList = 0;
    
    header = new UIStaticText(Rect(0, 0, rect.dx, ControlsFactory::BUTTON_HEIGHT));
    header->SetFont(ControlsFactory::GetFont12());
	header->SetTextColor(ControlsFactory::GetColorLight());
    header->SetAlign(ALIGN_HCENTER | ALIGN_VCENTER);
    AddControl(header);
    
    float32 buttonY = rect.dy - ControlsFactory::BUTTON_HEIGHT;
    float32 buttonX = (rect.dx - ControlsFactory::BUTTON_WIDTH * 2) / 2;
    
    UIButton *btnCancel = ControlsFactory::CreateButton(Vector2(buttonX, buttonY), LocalizedString(L"dialog.cancel"));
    btnCancel->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &CreateNodesDialog::OnCancel));
    AddControl(btnCancel);
    
    buttonX += ControlsFactory::BUTTON_WIDTH;
    UIButton *btnOk = ControlsFactory::CreateButton(Vector2(buttonX, buttonY), LocalizedString(L"dialog.ok"));
    btnOk->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &CreateNodesDialog::OnOk));
    AddControl(btnOk);
    
    propertyRect = Rect(0, ControlsFactory::BUTTON_HEIGHT, rect.dx, buttonY - ControlsFactory::BUTTON_HEIGHT);

    SafeRelease(btnCancel);
    SafeRelease(btnOk);
}
Example #3
0
CreatePropertyControl::CreatePropertyControl(const Rect & rect, CreatePropertyControlDelegate *newDelegate)
    :   UIControl(rect)
{
    ControlsFactory::CustomizeDialog(this);

    delegate = newDelegate;

    Vector<String> types;
    types.push_back("String");
    types.push_back("Integer");
    types.push_back("Float");
    types.push_back("Bool");

    Rect buttonRect(0, rect.dy - ControlsFactory::BUTTON_HEIGHT, rect.dx / 2, ControlsFactory::BUTTON_HEIGHT);
    UIButton *btnCancel = ControlsFactory::CreateButton(buttonRect, LocalizedString(L"dialog.cancel"));
    btnCancel->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &CreatePropertyControl::OnCancel));
    AddControl(btnCancel);
    SafeRelease(btnCancel);

    buttonRect.x = rect.dx - buttonRect.dx;
    UIButton *btnCreate = ControlsFactory::CreateButton(buttonRect, LocalizedString(L"dialog.create"));
    btnCreate->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &CreatePropertyControl::OnCreate));
    AddControl(btnCreate);
    SafeRelease(btnCreate);


    Rect textRect(0, 0, rect.dx / 3, (rect.dy - buttonRect.dy) / 2);
    Rect controlRect(textRect.dx, 0, rect.dx - textRect.dx, textRect.dy);

    UIStaticText *t = new UIStaticText(textRect);
    t->SetText(LocalizedString(L"createproperty.type"));
    t->SetFont(ControlsFactory::GetFontLight());
    AddControl(t);
    SafeRelease(t);

    typeCombo = new ComboBox(controlRect, NULL, types);
    AddControl(typeCombo);

    textRect.y = textRect.dy;
    controlRect.y = controlRect.dy;

    t = new UIStaticText(textRect);
    t->SetText(LocalizedString(L"createproperty.name"));
    t->SetFont(ControlsFactory::GetFontLight());
    AddControl(t);
    SafeRelease(t);

    nameField = new UITextField(controlRect);
    ControlsFactory::CustomizeEditablePropertyCell(nameField);
    nameField->SetDelegate(this);
    nameField->SetFont(ControlsFactory::GetFontLight());
    AddControl(nameField);
}
void OpenGLES30FormatTest::LoadResources()
{
	Font *font = FTFont::Create("~res:/Fonts/korinna.ttf");
    DVASSERT(font);
	font->SetSize(20);

	UIButton *testButton = new UIButton(Rect(0, 0, 300, 30));
	testButton->SetStateFont(0xFF, font);
	testButton->SetStateText(0xFF, L"Finish Test");
 	testButton->SetStateFontColor(0xFF, Color::White);
	testButton->SetDebugDraw(true);
	testButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &OpenGLES30FormatTest::ButtonPressed));
	AddControl(testButton);
    testButton->Release();

    formatName = new UIStaticText(Rect(0, 30, 300, 30));
    formatName->SetFont(font);
    formatName->SetTextColor(Color::White);
    AddControl(formatName);
    
    source = new UIControl(Rect(0, 60, 256, 256));
    AddControl(source);

    decodedSource = new UIControl(Rect(0, 330, 256, 256));
    AddControl(decodedSource);
    
    encodedSource = new UIControl(Rect(300, 330, 256, 256));
    AddControl(encodedSource);
    
    LoadFormat("RG11");
}
SettingsDialog::SettingsDialog(const Rect & rect, SettingsDialogDelegate *newDelegate)
    :   UIControl(rect)
    ,   delegate(newDelegate)
{
    ControlsFactory::CustomizeDialogFreeSpace(this);

    Rect dialogRect(rect.dx/4, rect.dy/8, rect.dx / 2, rect.dy * 3 /4);
    dialogPanel = new DraggableDialog(dialogRect);
    ControlsFactory::CustomizeDialog(dialogPanel);
    AddControl(dialogPanel);

    UIStaticText * header = new UIStaticText(Rect(0, 0, dialogRect.dx, ControlsFactory::BUTTON_HEIGHT));
    header->SetFont(ControlsFactory::GetFontLight());
    header->SetText(LocalizedString(L"settings.header"));
    header->SetAlign(ALIGN_HCENTER | ALIGN_VCENTER);
    dialogPanel->AddControl(header);
    SafeRelease(header);
    
    propertyList = new PropertyList(
                            Rect(0, ControlsFactory::BUTTON_HEIGHT, dialogRect.dx, 
                            dialogRect.dy - ControlsFactory::BUTTON_HEIGHT * 2), this);
    dialogPanel->AddControl(propertyList);
    
    
    float32 buttonY = dialogRect.dy - ControlsFactory::BUTTON_HEIGHT;
    float32 buttonX = (dialogRect.dx - ControlsFactory::BUTTON_WIDTH) / 2.f;
    UIButton *btnClose = ControlsFactory::CreateButton(Vector2(buttonX, buttonY), LocalizedString(L"dialog.close"));
    btnClose->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SettingsDialog::OnClose));
    dialogPanel->AddControl(btnClose);
    SafeRelease(btnClose);
    
    propertyList->AddIntProperty("settingsdialog.screenwidth", PropertyList::PROPERTY_IS_EDITABLE);
    propertyList->AddIntProperty("settingsdialog.screenheight", PropertyList::PROPERTY_IS_EDITABLE);
    propertyList->AddFloatProperty("settingsdialog.autosave", PropertyList::PROPERTY_IS_EDITABLE);
    languages.push_back("en");
    languages.push_back("ru");
    propertyList->AddComboProperty("settingsdialog.language", languages);
    propertyList->AddBoolProperty("settingsdialog.output", PropertyList::PROPERTY_IS_EDITABLE);
    
    
    propertyList->AddFloatProperty("settingsdialog.cameraspeed1", PropertyList::PROPERTY_IS_EDITABLE);
    propertyList->AddFloatProperty("settingsdialog.cameraspeed2", PropertyList::PROPERTY_IS_EDITABLE);
    propertyList->AddFloatProperty("settingsdialog.cameraspeed3", PropertyList::PROPERTY_IS_EDITABLE);
    propertyList->AddFloatProperty("settingsdialog.cameraspeed4", PropertyList::PROPERTY_IS_EDITABLE);
    
    propertyList->AddIntProperty("settingsdialog.leftpanelwidth", PropertyList::PROPERTY_IS_EDITABLE);
    propertyList->AddIntProperty("settingsdialog.rightpanelwidth", PropertyList::PROPERTY_IS_EDITABLE);
    
    propertyList->AddBoolProperty("settingsdialog.drawgrid", PropertyList::PROPERTY_IS_EDITABLE);

	propertyList->AddBoolProperty("settingsdialog.imposters", PropertyList::PROPERTY_IS_EDITABLE);
}
Example #6
0
void DataGraph::CreateGraphPanel(const Rect &rect)
{
    GraphBase::CreateGraphPanel(rect);
    
    Rect graphRect = graphPanel->GetRect();
    graphRect.dy -= (ControlsFactory::BUTTON_HEIGHT);
    graphTree = new UIHierarchy(graphRect);
    ControlsFactory::CusomizeListControl(graphTree);
    ControlsFactory::SetScrollbar(graphTree);
    graphTree->SetCellHeight(ControlsFactory::CELL_HEIGHT);
    graphTree->SetDelegate(this);
    graphTree->SetClipContents(true);
    graphPanel->AddControl(graphTree);

    
    float32 leftSideWidth = (float32)EditorSettings::Instance()->GetLeftPanelWidth();
    UIButton * refreshButton = ControlsFactory::CreateButton(Rect(0, graphRect.dy, 
                                                                  leftSideWidth,ControlsFactory::BUTTON_HEIGHT), 
                                                             LocalizedString(L"panel.refresh"));
    refreshButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &DataGraph::OnRefreshGraph));
    graphPanel->AddControl(refreshButton);
    SafeRelease(refreshButton);
}
Example #7
0
TextureTrianglesDialog::TextureTrianglesDialog()
    :   ExtendedDialog()
{
    workingPolygonGroup = NULL;
    previewSprite = NULL;

    Rect rect = DialogRect();
    draggableDialog->SetRect(rect);

    rect.x = rect.y = 0;
    
    Vector<String> comboboxItems;
    comboboxItems.push_back("0");
    comboboxItems.push_back("1");
    comboboxItems.push_back("2");
    comboboxItems.push_back("3");
    
    Rect comboRect = rect;
    comboRect.dy = ControlsFactory::BUTTON_HEIGHT;
    combobox = new ComboBox(comboRect, this, comboboxItems);
    draggableDialog->AddControl(combobox);
    
    Rect previewRect = rect;
    previewRect.y = ControlsFactory::BUTTON_HEIGHT;
    previewRect.dy -= ControlsFactory::BUTTON_HEIGHT * 2;
    texturePreview = new UIControl(previewRect);
    texturePreview->SetInputEnabled(false);
    draggableDialog->AddControl(texturePreview);
    
    float32 buttonX = (rect.dx - ControlsFactory::BUTTON_WIDTH) / 2;
    float32 buttonY = rect.dy - ControlsFactory::BUTTON_HEIGHT;
    UIButton *btnCancel = ControlsFactory::CreateButton(Vector2(buttonX, buttonY), LocalizedString(L"dialog.close"));
    btnCancel->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &TextureTrianglesDialog::OnClose));
    draggableDialog->AddControl(btnCancel);
    SafeRelease(btnCancel);
}
//*************  ColorPicker  *************
ColorPicker::ColorPicker(ColorPickerDelegate *newDelegate)
    :   ExtendedDialog()
    ,   delegate(newDelegate)
{
    //Temporary fix for loading of UI Interface to avoid reloading of texrures to different formates.
    // 1. Reset default format before loading of UI
    // 2. Restore default format after loading of UI from stored settings.
    Texture::SetDefaultFileFormat(NOT_FILE);

    
    draggableDialog->SetRect(GetDialogRect());
    
    colorMapControl = new ColorMapControl(Rect(ControlsFactory::OFFSET, ControlsFactory::OFFSET, 
                                               ControlsFactory::COLOR_MAP_SIDE, ControlsFactory::COLOR_MAP_SIDE));
    colorMapControl->AddEvent(UIControl::EVENT_VALUE_CHANGED, Message(this, &ColorPicker::OnMapColorChanged));
    draggableDialog->AddControl(colorMapControl);
    
    Rect alphaRect(colorMapControl->GetRect());
    alphaRect.y += alphaRect.dy + ControlsFactory::OFFSET;
    alphaRect.dy = ControlsFactory::BUTTON_HEIGHT;
    alphaValue = new UISlider(alphaRect);
    alphaValue->AddEvent(UIControl::EVENT_VALUE_CHANGED, Message(this, &ColorPicker::OnAlphaChanged));
    alphaValue->SetMinMaxValue(0.f, 1.0f);
    alphaValue->SetValue(1.0f);
    alphaValue->SetMinSprite("~res:/Gfx/LandscapeEditor/Tools/polzunok", 1);
    alphaValue->SetMinDrawType(UIControlBackground::DRAW_STRETCH_HORIZONTAL);
    alphaValue->SetMinLeftRightStretchCap(5);
    alphaValue->SetMaxSprite("~res:/Gfx/LandscapeEditor/Tools/polzunok", 0);
    alphaValue->SetMaxDrawType(UIControlBackground::DRAW_STRETCH_HORIZONTAL);
    alphaValue->SetMaxLeftRightStretchCap(5);
    alphaValue->SetThumbSprite("~res:/Gfx/LandscapeEditor/Tools/polzunokCenter", 0);
    draggableDialog->AddControl(alphaValue);

    Rect selectorRect(colorMapControl->GetRect());
    selectorRect.x += selectorRect.dx + ControlsFactory::OFFSET;
    selectorRect.dx = ControlsFactory::COLOR_SELECTOR_WIDTH;
    colorSelectorControl = new ColorSelectorControl(selectorRect);
    colorSelectorControl->AddEvent(UIControl::EVENT_VALUE_CHANGED, Message(this, &ColorPicker::OnSelectorColorChanged));
    draggableDialog->AddControl(colorSelectorControl);
    
    Rect colorPreviewRect;
    colorPreviewRect.x = selectorRect.x + selectorRect.dx + ControlsFactory::OFFSET;
    colorPreviewRect.y = ControlsFactory::OFFSET;
    colorPreviewRect.dx = ControlsFactory::COLOR_PREVIEW_SIDE;
    colorPreviewRect.dy = ControlsFactory::COLOR_PREVIEW_SIDE/2;
    colorPreviewCurrent = new UIControl(colorPreviewRect);
    colorPreviewCurrent->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
    draggableDialog->AddControl(colorPreviewCurrent);

    Rect prevRect = colorPreviewCurrent->GetRect();
    prevRect.y += prevRect.dy;
    colorPreviewPrev = new UIControl(Rect(prevRect));
    colorPreviewPrev->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
    draggableDialog->AddControl(colorPreviewPrev);
    
    Rect colorListRect;
    colorListRect.x = prevRect.x;
    colorListRect.y = prevRect.y + prevRect.dy + ControlsFactory::OFFSET;
    colorListRect.dx = prevRect.dx;
    colorListRect.dy = 80;
    colorList = new PropertyList(colorListRect, this);
    ControlsFactory::CusomizeTransparentControl(colorList, 0.0f);
    colorList->AddIntProperty("colorpicker.r", PropertyList::PROPERTY_IS_EDITABLE);
    colorList->AddIntProperty("colorpicker.g", PropertyList::PROPERTY_IS_EDITABLE);
    colorList->AddIntProperty("colorpicker.b", PropertyList::PROPERTY_IS_EDITABLE);
    colorList->AddIntProperty("colorpicker.a", PropertyList::PROPERTY_IS_EDITABLE);
    draggableDialog->AddControl(colorList);
    
    Rect rect = GetDialogRect();
    float32 buttonX = rect.dx /2 - ControlsFactory::BUTTON_WIDTH;
    float32 buttonY = rect.dy - ControlsFactory::BUTTON_HEIGHT;
    UIButton *btnCancel = ControlsFactory::CreateButton(Vector2(buttonX, buttonY), LocalizedString(L"dialog.cancel"));
    btnCancel->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &ColorPicker::OnCancel));
    draggableDialog->AddControl(btnCancel);
    SafeRelease(btnCancel);
    
    buttonX += ControlsFactory::BUTTON_WIDTH;
    UIButton *btnOk = ControlsFactory::CreateButton(Vector2(buttonX, buttonY), LocalizedString(L"dialog.ok"));
    btnOk->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &ColorPicker::OnOk));
    draggableDialog->AddControl(btnOk);
    SafeRelease(btnOk);
    
    SetColor(Color(1.0f, 1.0f, 1.0f, 1.0f));
    
    Texture::SetDefaultFileFormat((ImageFileFormat)EditorSettings::Instance()->GetTextureViewFileFormat());
}
Example #9
0
void UIScrollViewTest::LoadResources()
{
	Font *font = FTFont::Create("~res:/Fonts/korinna.ttf");
    DVASSERT(font);
	font->SetSize(14);
    font->SetColor(Color::White());

    UIYamlLoader::Load( this, "~res:/UI/Test/ScrollScreen.yaml" );
	scrollView = DynamicTypeCheck<UIScrollView *>( FindByName( "Scrollview" ) );
	
	UIControl* innerControl = FindByName("UIControl1");
	if (innerControl)
	{
		innerControl->SetSprite("~res:/Gfx/UI/HorizontalScroll", 0);
		innerControl->GetBackground()->SetDrawType(UIControlBackground::DRAW_SCALE_TO_RECT);
	}
	
    UIControl *control = FindByName("HorizontalScrollbar");
    if( control )
    {
        UIScrollBar *horizontalScrollbar = DynamicTypeCheck<UIScrollBar *>( control );
        horizontalScrollbar->GetSlider()->SetSprite("~res:/Gfx/UI/HorizontalScroll", 0);
        horizontalScrollbar->GetSlider()->GetBackground()->SetDrawType(UIControlBackground::DRAW_STRETCH_HORIZONTAL);
		horizontalScrollbar->GetSlider()->GetBackground()->SetLeftRightStretchCap(10);
        horizontalScrollbar->SetOrientation( UIScrollBar::ORIENTATION_HORIZONTAL );
        horizontalScrollbar->SetDelegate(scrollView);
    }
	
    control = FindByName("VerticalScrollbar");
    if( control )
    {
        UIScrollBar *verticalScrollbar = DynamicTypeCheck<UIScrollBar *>( control );
        verticalScrollbar->GetSlider()->SetSprite("~res:/Gfx/UI/VerticalScroll", 0);
        verticalScrollbar->GetSlider()->GetBackground()->SetDrawType(UIControlBackground::DRAW_STRETCH_VERTICAL);
        verticalScrollbar->GetSlider()->GetBackground()->SetTopBottomStretchCap(10);
        verticalScrollbar->SetOrientation( UIScrollBar::ORIENTATION_VERTICAL );
        verticalScrollbar->SetDelegate(scrollView);
    }
	
	UIControl *testControl4 = new UIControl(Rect(1200, 1400, 250, 250));
	testControl4->SetDebugDraw(true);
	testControl4->GetBackground()->SetColor(Color(0.3333, 0.3333, 0.5555, 1.0000));
	testControl4->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
	testControl4->SetName("CONTROL_4");
	testControl4->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &UIScrollViewTest::ButtonPressed));
	scrollView->AddControlToContainer(testControl4);

	UIControl *testControlChild = new UIControl(Rect(100, 100, 150, 150));
	testControlChild->SetDebugDraw(true);
	testControlChild->GetBackground()->SetColor(Color(0.3333, 0.3333, 0.5555, 1.0000));
	testControlChild->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
	testControlChild->SetName("CONTROL_3");
	testControlChild->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &UIScrollViewTest::ButtonPressed));
	
	UIControl *testControl = new UIControl(Rect(50, 0, 150, 150));
	testControl->SetDebugDraw(true);
	testControl->GetBackground()->SetColor(Color(0.3333, 0.6667, 0.4980, 1.0000));
	testControl->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
	testControl->SetName("CONTROL_2");
	testControl->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &UIScrollViewTest::ButtonPressed));
	testControl->AddControl(testControlChild);
	
	UIButton *testButton = new UIButton(Rect(10, 50, 250, 100));
	testButton->SetDebugDraw(true);
	testButton->SetStateFont(STATE_NORMAL, font);
	testButton->SetStateText(STATE_NORMAL, L"First button");
	testButton->GetBackground()->SetColor(Color(0.6667, 0.6667, 0.4980, 1.0000));
	testButton->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
	testButton->SetName("CONTROL_1");
	testButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &UIScrollViewTest::ButtonPressed));
	testButton->AddControl(testControl);
	
	scrollView->AddControlToContainer(testButton);
	
	testMessageText = new UIStaticText(Rect(10, 10, 300, 30));
	testMessageText->SetFont(font);
	testMessageText->SetTextColor(Color(0.0, 1.0, 0.0, 1.0));
	testMessageText->GetBackground()->SetColor(Color(0.5, 0.0, 0.25, 1.0));
	testMessageText->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
	AddControl(testMessageText);
	
	finishTestBtn = new UIButton(Rect(10, 310, 300, 30));
	finishTestBtn->SetStateFont(0xFF, font);
	finishTestBtn->SetStateFontColor(0xFF, Color(1.0, 0.0, 0.0, 0.75));
	finishTestBtn->SetStateText(0xFF, L"Finish test");

	finishTestBtn->SetDebugDraw(true);
	finishTestBtn->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &UIScrollViewTest::ButtonPressed));
	AddControl(finishTestBtn);
}
Example #10
0
void SceneEditorScreenMain::LoadResources()
{
    new ErrorNotifier();
    new HintManager();
    new UNDOManager();
    
    new PropertyControlCreator();
    
    ControlsFactory::CustomizeScreenBack(this);

    font = ControlsFactory::GetFontLight();
    
    //init file system dialog
    fileSystemDialog = new UIFileSystemDialog("~res:/Fonts/MyriadPro-Regular.otf");
    fileSystemDialog->SetDelegate(this);
    
    String path = EditorSettings::Instance()->GetDataSourcePath();
    if(path.length())
    fileSystemDialog->SetCurrentDir(path);
    
    // add line after menu
    Rect fullRect = GetRect();
    AddLineControl(Rect(0, ControlsFactory::BUTTON_HEIGHT, fullRect.dx, LINE_HEIGHT));
    CreateTopMenu();
    
    //
    settingsDialog = new SettingsDialog(fullRect, this);
    UIButton *settingsButton = ControlsFactory::CreateImageButton(Rect(fullRect.dx - ControlsFactory::BUTTON_HEIGHT, 0, ControlsFactory::BUTTON_HEIGHT, ControlsFactory::BUTTON_HEIGHT), "~res:/Gfx/UI/settingsicon");

    settingsButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnSettingsPressed));
    AddControl(settingsButton);
    SafeRelease(settingsButton);
        
    menuPopup = new MenuPopupControl(GetRect(), ControlsFactory::BUTTON_HEIGHT + LINE_HEIGHT);
    menuPopup->SetDelegate(this);
    
    InitializeNodeDialogs();    
    
    textureTrianglesDialog = new TextureTrianglesDialog();
    
    textureConverterDialog = new TextureConverterDialog(fullRect);
    
    materialEditor = new MaterialEditor();
	particlesEditor = new ParticlesEditorControl();
    
    //add line before body
    AddLineControl(Rect(0, BODY_Y_OFFSET, fullRect.dx, LINE_HEIGHT));
    
    //Library
    libraryButton = ControlsFactory::CreateButton(
                                                  Rect(fullRect.dx - ControlsFactory::BUTTON_WIDTH, 
                                                       BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT, 
                                                       ControlsFactory::BUTTON_WIDTH, 
                                                       ControlsFactory::BUTTON_HEIGHT), 
                        LocalizedString(L"panel.library"));
    libraryButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnLibraryPressed));
    AddControl(libraryButton);
    
    int32 libraryWidth = EditorSettings::Instance()->GetRightPanelWidth();
    libraryControl = new LibraryControl(
                            Rect(fullRect.dx - libraryWidth, BODY_Y_OFFSET + 1, libraryWidth, fullRect.dy - BODY_Y_OFFSET - 1)); 
    libraryControl->SetDelegate(this);
    libraryControl->SetPath(path);

    //properties
    propertiesButton = ControlsFactory::CreateButton(
                            Vector2(libraryButton->GetRect().x - ControlsFactory::BUTTON_WIDTH, 
                            BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), 
                        LocalizedString(L"panel.properties"));
    propertiesButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnPropertiesPressed));
    AddControl(propertiesButton);
    
    
    //scene ingo
    sceneInfoButton = ControlsFactory::CreateButton(
                            Vector2(propertiesButton->GetRect().x - ControlsFactory::BUTTON_WIDTH, 
                            BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), 
                            LocalizedString(L"panel.sceneinfo"));
    sceneInfoButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnSceneInfoPressed));
    AddControl(sceneInfoButton);
    
    
    sceneGraphButton = ControlsFactory::CreateButton( Vector2(0, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.graph.scene"));
    sceneGraphButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnSceneGraphPressed));
    AddControl(sceneGraphButton);
    
    dataGraphButton = ControlsFactory::CreateButton(Vector2(ControlsFactory::BUTTON_WIDTH, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.graph.data"));
    dataGraphButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnDataGraphPressed));
    AddControl(dataGraphButton);

	entitiesButton = ControlsFactory::CreateButton(Vector2(ControlsFactory::BUTTON_WIDTH*2, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.graph.entities"));
	entitiesButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnEntitiesPressed));
	AddControl(entitiesButton);
    
    InitializeBodyList();
    
    SetupAnimation();
    
    helpDialog = new HelpDialog();
}