Skip to content

Commit

Permalink
#5532: Add MaterialTreeView to the editor window
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Feb 12, 2021
1 parent eb8123c commit 0269d29
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
12 changes: 6 additions & 6 deletions install/ui/materialeditor.fbp
Expand Up @@ -233,20 +233,20 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">12</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">3</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer5</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -281,7 +281,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size">-1,120</property>
<property name="moveable">1</property>
<property name="name">MaterialEditorDefinitionView</property>
<property name="name">MaterialEditorTreeView</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
Expand All @@ -307,7 +307,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">6</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
Expand Down
7 changes: 7 additions & 0 deletions radiant/ui/materials/MaterialEditor.cpp
Expand Up @@ -24,6 +24,11 @@ MaterialEditor::MaterialEditor() :
// Wire up the close button
findNamedObject<wxButton>(this, "MaterialEditorCloseButton")->Bind(wxEVT_BUTTON, &MaterialEditor::_onClose, this);

// Add the treeview
auto* panel = findNamedObject<wxPanel>(this, "MaterialEditorTreeView");
_treeView = new MaterialTreeView(panel);
panel->GetSizer()->Add(_treeView, 1, wxEXPAND);

// Setup the splitter and preview
auto* splitter = findNamedObject<wxSplitterWindow>(this, "MaterialEditorSplitter");
splitter->SetSashPosition(GetSize().GetWidth() * 0.6f);
Expand All @@ -50,6 +55,8 @@ MaterialEditor::MaterialEditor() :
_panedPosition.loadFromPath(RKEY_SPLIT_POS);

CenterOnParent();

_treeView->Populate();
}

int MaterialEditor::ShowModal()
Expand Down
4 changes: 4 additions & 0 deletions radiant/ui/materials/MaterialEditor.h
Expand Up @@ -8,6 +8,8 @@
#include "wxutil/XmlResourceBasedWidget.h"
#include "wxutil/preview/ModelPreview.h"

#include "ui/common/MaterialTreeView.h"

namespace ui
{

Expand All @@ -16,6 +18,8 @@ class MaterialEditor :
private wxutil::XmlResourceBasedWidget
{
private:
MaterialTreeView* _treeView;

wxutil::WindowPosition _windowPosition;
wxutil::PanedPosition _panedPosition;

Expand Down

0 comments on commit 0269d29

Please sign in to comment.