Skip to content

Commit

Permalink
Traktor: Moved "sources" panel to below properties in input editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Apr 11, 2024
1 parent be622b1 commit 3b7f0cd
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 132 deletions.
35 changes: 17 additions & 18 deletions code/Input/Editor/InputMappingEditor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -62,7 +62,6 @@
#include "Ui/EditList.h"
#include "Ui/EditListEditEvent.h"
#include "Ui/InputDialog.h"
#include "Ui/Splitter.h"
#include "Ui/Graph/DefaultNodeShape.h"
#include "Ui/Graph/Edge.h"
#include "Ui/Graph/EdgeConnectEvent.h"
Expand Down Expand Up @@ -203,16 +202,8 @@ bool InputMappingEditor::create(ui::Container* parent)
m_toolBarGraph->addItem(new ui::ToolBarButton(i18n::Text(L"INPUT_EDITOR_EVEN_HORIZONTALLY"), 5, ui::Command(L"Input.Editor.EventSpaceHorizontally")));
m_toolBarGraph->addEventHandler< ui::ToolBarButtonClickEvent >(this, &InputMappingEditor::eventToolBarGraphClick);

Ref< ui::Splitter > splitter = new ui::Splitter();
splitter->create(container, true, 20_ut, true);

m_listValueSources = new ui::EditList();
m_listValueSources->create(splitter, ui::ListBox::WsSingle | ui::EditList::WsAutoAdd | ui::EditList::WsAutoRemove);
m_listValueSources->addEventHandler< ui::SelectionChangeEvent >(this, &InputMappingEditor::eventListValueSourceSelect);
m_listValueSources->addEventHandler< ui::EditListEditEvent >(this, &InputMappingEditor::eventListValueEdit);

m_graph = new ui::GraphControl();
m_graph->create(splitter);
m_graph->create(container);
m_graph->setText(L"INPUT");
m_graph->addEventHandler< ui::MouseButtonDownEvent >(this, &InputMappingEditor::eventButtonDown);
m_graph->addEventHandler< ui::SelectEvent >(this, &InputMappingEditor::eventNodeSelect);
Expand All @@ -221,20 +212,28 @@ bool InputMappingEditor::create(ui::Container* parent)
m_graph->addEventHandler< ui::EdgeConnectEvent >(this, &InputMappingEditor::eventEdgeConnected);
m_graph->addEventHandler< ui::EdgeDisconnectEvent >(this, &InputMappingEditor::eventEdgeDisconnected);

// Create properties view.
m_propertiesView = m_site->createPropertiesView(parent);
m_propertiesView->addEventHandler< ui::ContentChangingEvent >(this, &InputMappingEditor::eventPropertiesChanging);
m_propertiesView->addEventHandler< ui::ContentChangeEvent >(this, &InputMappingEditor::eventPropertiesChanged);
m_site->createAdditionalPanel(m_propertiesView, 400_ut, false);

// Create "sources" view.
m_listValueSources = new ui::EditList();
m_listValueSources->create(parent, ui::ListBox::WsSingle | ui::EditList::WsAutoAdd | ui::EditList::WsAutoRemove);
m_listValueSources->setText(i18n::Text(L"INPUT_EDITOR_SOURCES"));
m_listValueSources->addEventHandler< ui::SelectionChangeEvent >(this, &InputMappingEditor::eventListValueSourceSelect);
m_listValueSources->addEventHandler< ui::EditListEditEvent >(this, &InputMappingEditor::eventListValueEdit);
m_site->createAdditionalPanel(m_listValueSources, 400_ut, false);

InputMappingSourceData* sourceData = m_mappingAsset->getSourceData();
if (sourceData)
{
for (const auto& it : sourceData->getSourceData())
m_listValueSources->add(it.first, it.second);
}

// Create properties view.
m_propertiesView = m_site->createPropertiesView(parent);
m_propertiesView->addEventHandler< ui::ContentChangingEvent >(this, &InputMappingEditor::eventPropertiesChanging);
m_propertiesView->addEventHandler< ui::ContentChangeEvent >(this, &InputMappingEditor::eventPropertiesChanged);
m_site->createAdditionalPanel(m_propertiesView, 400_ut, false);

// Build popup menu.
// Build pop-up menu.
m_menuPopup = new ui::Menu();

Ref< ui::MenuItem > menuItemCreate = new ui::MenuItem(i18n::Text(L"INPUT_EDITOR_CREATE_NODE"));
Expand Down
232 changes: 118 additions & 114 deletions resources/runtime/editor/locale/english/Traktor.Input.Editor.dictionary
Original file line number Diff line number Diff line change
@@ -1,117 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="traktor.i18n.Dictionary">
<map>
<item>
<first>INPUT_EDITOR_ALIGN_LEFT</first>
<second>Align left</second>
</item>
<item>
<first>INPUT_EDITOR_ALIGN_RIGHT</first>
<second>Align right</second>
</item>
<item>
<first>INPUT_EDITOR_ALIGN_TOP</first>
<second>Align top</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE</first>
<second>Create</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_STATE</first>
<second>State</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INBOOLEAN</first>
<second>Boolean</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INCLAMP</first>
<second>Clamp</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INCOMBINE</first>
<second>Combine</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INCONST</first>
<second>Constant</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INGESTUREPINCH</first>
<second>Gesture Pinch</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INGESTURESWIPE</first>
<second>Gesture Swipe</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INGESTURETAP</first>
<second>Gesture Tap</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INHYSTERESIS</first>
<second>Hysteresis</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INPULSE</first>
<second>Pulse</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INREADVALUE</first>
<second>Read Value</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INREMAPAXIS</first>
<second>Remap Axis</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INTHRESHOLD</first>
<second>Threshold</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INTRIGGER</first>
<second>Trigger</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INDELAY</first>
<second>Delay</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INENVELOPE</first>
<second>Envelope</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INLOWPASS</first>
<second>Low Pass</second>
</item>
<item>
<first>INPUT_EDITOR_DELETE_NODE</first>
<second>Delete</second>
</item>
<item>
<first>INPUT_EDITOR_EVEN_HORIZONTALLY</first>
<second>Even horizontally</second>
</item>
<item>
<first>INPUT_EDITOR_EVEN_VERTICALLY</first>
<second>Even vertically</second>
</item>
<item>
<first>INPUT_EDITOR_STATE_NAME</first>
<second>Name</second>
</item>
<item>
<first>INPUT_EDITOR_STATE_NAME_MESSAGE</first>
<second>Enter state name</second>
</item>
<item>
<first>INPUT_EDITOR_STATE_NAME_TITLE</first>
<second>Change name</second>
</item>
<item>
<first>INPUT_EDITOR_ALIGN_BOTTOM</first>
<second>Align bottom</second>
</item>
</map>
<map>
<item>
<first>INPUT_EDITOR_ALIGN_LEFT</first>
<second>Align left</second>
</item>
<item>
<first>INPUT_EDITOR_ALIGN_RIGHT</first>
<second>Align right</second>
</item>
<item>
<first>INPUT_EDITOR_ALIGN_TOP</first>
<second>Align top</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE</first>
<second>Create</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_STATE</first>
<second>State</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INBOOLEAN</first>
<second>Boolean</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INCLAMP</first>
<second>Clamp</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INCOMBINE</first>
<second>Combine</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INCONST</first>
<second>Constant</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INGESTUREPINCH</first>
<second>Gesture Pinch</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INGESTURESWIPE</first>
<second>Gesture Swipe</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INGESTURETAP</first>
<second>Gesture Tap</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INHYSTERESIS</first>
<second>Hysteresis</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INPULSE</first>
<second>Pulse</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INREADVALUE</first>
<second>Read Value</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INREMAPAXIS</first>
<second>Remap Axis</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INTHRESHOLD</first>
<second>Threshold</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INTRIGGER</first>
<second>Trigger</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INDELAY</first>
<second>Delay</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INENVELOPE</first>
<second>Envelope</second>
</item>
<item>
<first>INPUT_EDITOR_CREATE_NODE_TRAKTOR_INPUT_INLOWPASS</first>
<second>Low Pass</second>
</item>
<item>
<first>INPUT_EDITOR_DELETE_NODE</first>
<second>Delete</second>
</item>
<item>
<first>INPUT_EDITOR_EVEN_HORIZONTALLY</first>
<second>Even horizontally</second>
</item>
<item>
<first>INPUT_EDITOR_EVEN_VERTICALLY</first>
<second>Even vertically</second>
</item>
<item>
<first>INPUT_EDITOR_SOURCES</first>
<second>Sources</second>
</item>
<item>
<first>INPUT_EDITOR_STATE_NAME</first>
<second>Name</second>
</item>
<item>
<first>INPUT_EDITOR_STATE_NAME_MESSAGE</first>
<second>Enter state name</second>
</item>
<item>
<first>INPUT_EDITOR_STATE_NAME_TITLE</first>
<second>Change name</second>
</item>
<item>
<first>INPUT_EDITOR_ALIGN_BOTTOM</first>
<second>Align bottom</second>
</item>
</map>
</object>

0 comments on commit 3b7f0cd

Please sign in to comment.