add shortcuts panel
This commit is contained in:
@@ -384,6 +384,7 @@
|
||||
<ClCompile Include="src\node_remote_page.cpp" />
|
||||
<ClCompile Include="src\node_scroll.cpp" />
|
||||
<ClCompile Include="src\node_settings.cpp" />
|
||||
<ClCompile Include="src\node_shorcuts.cpp" />
|
||||
<ClCompile Include="src\node_slider.cpp" />
|
||||
<ClCompile Include="src\node_stroke_preview.cpp" />
|
||||
<ClCompile Include="src\node_text.cpp" />
|
||||
@@ -516,6 +517,7 @@
|
||||
<ClInclude Include="src\node_remote_page.h" />
|
||||
<ClInclude Include="src\node_scroll.h" />
|
||||
<ClInclude Include="src\node_settings.h" />
|
||||
<ClInclude Include="src\node_shorcuts.h" />
|
||||
<ClInclude Include="src\node_slider.h" />
|
||||
<ClInclude Include="src\node_stroke_preview.h" />
|
||||
<ClInclude Include="src\node_text.h" />
|
||||
@@ -573,6 +575,7 @@
|
||||
<Xml Include="data\dialogs\progress-bar.xml" />
|
||||
<Xml Include="data\dialogs\remote-page.xml" />
|
||||
<Xml Include="data\dialogs\settings.xml" />
|
||||
<Xml Include="data\dialogs\shortcuts.xml" />
|
||||
<Xml Include="data\dialogs\usermanual.xml" />
|
||||
<Xml Include="data\layout.xml">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
@@ -16,9 +12,6 @@
|
||||
<Filter Include="Source Files\ui">
|
||||
<UniqueIdentifier>{600b8daa-4234-4c37-b4ba-c22cad7d1dc3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\ui">
|
||||
<UniqueIdentifier>{2c3e7ce5-d3f4-4731-b05f-5e288c7e6e63}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="libs">
|
||||
<UniqueIdentifier>{6d64b115-02d1-43e0-86c8-c8212f51162d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -390,6 +383,9 @@
|
||||
<ClCompile Include="src\node_metadata.cpp">
|
||||
<Filter>Source Files\ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\node_shorcuts.cpp">
|
||||
<Filter>Source Files\ui</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="libs\jpeg\jpgd.h">
|
||||
@@ -641,15 +637,18 @@
|
||||
<ClInclude Include="src\node_panel_animation.h">
|
||||
<Filter>Source Files\ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\mp4enc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\node_remote_page.h">
|
||||
<Filter>Source Files\ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\node_metadata.h">
|
||||
<Filter>Source Files\ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\node_shorcuts.h">
|
||||
<Filter>Source Files\ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\mp4enc.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="PanoPainter.rc">
|
||||
@@ -740,6 +739,9 @@
|
||||
<Xml Include="data\dialogs\remote-page.xml">
|
||||
<Filter>extras\dialogs</Filter>
|
||||
</Xml>
|
||||
<Xml Include="data\dialogs\shortcuts.xml">
|
||||
<Filter>extras\dialogs</Filter>
|
||||
</Xml>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="data\shaders\texture.glsl">
|
||||
|
||||
38
data/dialogs/shortcuts.xml
Normal file
38
data/dialogs/shortcuts.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0"?>
|
||||
<root
|
||||
xmlns="http://panopainter.com/layout.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
>
|
||||
<layout id="item">
|
||||
<border color="1 0 0 1" dir="row">
|
||||
<node grow="1">
|
||||
<text id="descr" font-size="30">New File</text>
|
||||
</node>
|
||||
<node width="100">
|
||||
<text id="shortcut" font-size="30">Ctrl + N</text>
|
||||
</node>
|
||||
</border>
|
||||
</layout>
|
||||
|
||||
<layout id="shortcuts">
|
||||
<border positioning="absolute" position="0 0" color=".4 .4 .4 .8" width="100%" height="100%" align="center" justify="center" mouse-capture="1">
|
||||
<border thickness="1" border-color=".2" pad="3" max-width="650" dir="col" width="80%" height="80%">
|
||||
<border width="100%" height="30" color=".2 .2 .2 .9" dir="row" align="center" justify="center">
|
||||
<text>Shortcuts</text>
|
||||
</border>
|
||||
<border width="100%" height="100%" color="0 0 0 .9" pad="10" dir="col">
|
||||
<!--window content-->
|
||||
<border color=".2" width="100%" height="1" grow="1">
|
||||
<scroll id="content" pad="10" margin="5" color=".3 .3 .3 .4" height="100%" dir="col" wrap="0" shrink="1">
|
||||
</scroll>
|
||||
</border>
|
||||
<!--footer buttons-->
|
||||
<node id="footer" height="60" dir="row" justify="flex-end">
|
||||
<button id="btn-ok" text="Ok" width="100" height="30" margin="5 0 0 0"/>
|
||||
</node>
|
||||
</border>
|
||||
</border>
|
||||
</border>
|
||||
</layout>
|
||||
|
||||
</root>
|
||||
@@ -234,6 +234,10 @@
|
||||
<icon icon="arrow_rotate_clockwise" width="20"/>
|
||||
<text id="menu-label" text="Reset Camera" margin="0 0 0 5"/>
|
||||
</button-custom>
|
||||
<button-custom id="shortcuts" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||
<icon icon="arrow_rotate_clockwise" width="20"/>
|
||||
<text id="menu-label" text="Shortcuts" margin="0 0 0 5"/>
|
||||
</button-custom>
|
||||
<button-custom os="ios" id="sonarpen" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||
<icon icon="pencil" width="20"/>
|
||||
<text id="menu-label" text="Start SonarPen" margin="0 0 0 5"/>
|
||||
|
||||
@@ -263,6 +263,7 @@ public:
|
||||
void dialog_export_mp4();
|
||||
void dialog_timelapse_export();
|
||||
void dialog_whatsnew(bool force_show);
|
||||
void dialog_shortcuts();
|
||||
|
||||
void cloud_upload();
|
||||
void cloud_upload_all();
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "node_usermanual.h"
|
||||
#include "node_dialog_export_ppbr.h"
|
||||
#include "node_remote_page.h"
|
||||
#include "node_shorcuts.h"
|
||||
|
||||
#include <codec_api.h>
|
||||
#define MP4V2_NO_STDINT_DEFS
|
||||
@@ -869,4 +870,9 @@ void App::dialog_whatsnew(bool force_show)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void App::dialog_shortcuts()
|
||||
{
|
||||
layout[main_id]->add_child<NodeShortcuts>();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "serializer.h"
|
||||
#include "font.h"
|
||||
#include "node_remote_page.h"
|
||||
#include "node_shorcuts.h"
|
||||
|
||||
void App::title_update()
|
||||
{
|
||||
@@ -1043,7 +1044,13 @@ void App::init_menu_tools()
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
};
|
||||
|
||||
|
||||
popup_exp->find<NodeButtonCustom>("shortcuts")->on_click = [this, popup_exp](Node*) {
|
||||
dialog_shortcuts();
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
};
|
||||
|
||||
/*
|
||||
popup_exp->find<NodeButtonCustom>("mp4test")->on_click = [this, popup_exp](Node*) {
|
||||
dialog_export_mp4();
|
||||
@@ -1381,13 +1388,13 @@ void App::initLayout()
|
||||
LOG("initializing layout designer xml");
|
||||
layout_designer.on_loaded = [&](bool reloaded) {
|
||||
layout_designer.create();
|
||||
//layout_designer[main_id]->add_child(layout_designer.instantiate("tpl-panel-animation"));
|
||||
auto p = layout_designer[main_id]->add_child<NodePanelFloating>();
|
||||
p->SetPosition(300, 300);
|
||||
p->SetSize(600, 400);
|
||||
p->m_container->add_child<NodePanelAnimation>();
|
||||
//layout_designer[main_id]->add_child(layout_designer.instantiate("shortcuts"));
|
||||
auto p = layout_designer[main_id]->add_child<NodeShortcuts>();
|
||||
//p->SetPosition(300, 300);
|
||||
//p->SetSize(600, 400);
|
||||
//p->m_container->add_child<NodePanelAnimation>();
|
||||
};
|
||||
//layout_designer.load("data/dialogs/panel-animation.xml");
|
||||
//layout_designer.load("data/dialogs/shortcuts.xml");
|
||||
}
|
||||
|
||||
void App::set_ui_scale(float scale)
|
||||
|
||||
62
src/node_shorcuts.cpp
Normal file
62
src/node_shorcuts.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#include "pch.h"
|
||||
#include "node_shorcuts.h"
|
||||
#include "node_button.h"
|
||||
#include "node_text.h"
|
||||
#include "node_scroll.h"
|
||||
|
||||
Node* NodeShortcuts::clone_instantiate() const
|
||||
{
|
||||
return new NodeShortcuts;
|
||||
}
|
||||
|
||||
void NodeShortcuts::init()
|
||||
{
|
||||
init_template_file("data/dialogs/shortcuts.xml", "shortcuts");
|
||||
init_controls();
|
||||
}
|
||||
|
||||
void NodeShortcuts::init_controls()
|
||||
{
|
||||
m_content = find<NodeScroll>("content");
|
||||
m_btn_close = find<NodeButton>("btn-ok");
|
||||
m_btn_close->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
add_shortcut("New File", "Ctrl+N");
|
||||
}
|
||||
|
||||
void NodeShortcuts::add_shortcut(const std::string& descr, const std::string& shortcut) noexcept
|
||||
{
|
||||
auto item = m_content->add_child<NodeShortcutsItem>();
|
||||
item->set_descr(descr);
|
||||
item->set_shortcut(shortcut);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Node* NodeShortcutsItem::clone_instantiate() const
|
||||
{
|
||||
return new NodeShortcutsItem;
|
||||
}
|
||||
|
||||
void NodeShortcutsItem::init()
|
||||
{
|
||||
init_template_file("data/dialogs/shortcuts.xml", "item");
|
||||
init_controls();
|
||||
}
|
||||
|
||||
void NodeShortcutsItem::init_controls()
|
||||
{
|
||||
m_descr = find<NodeText>("descr");
|
||||
m_shortcut = find<NodeText>("shortcut");
|
||||
}
|
||||
|
||||
void NodeShortcutsItem::set_descr(const std::string& str) noexcept
|
||||
{
|
||||
m_descr->set_text(str);
|
||||
}
|
||||
|
||||
void NodeShortcutsItem::set_shortcut(const std::string& str) noexcept
|
||||
{
|
||||
m_shortcut->set_text(str);
|
||||
}
|
||||
25
src/node_shorcuts.h
Normal file
25
src/node_shorcuts.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
#include "node_border.h"
|
||||
|
||||
class NodeShortcutsItem : public NodeBorder
|
||||
{
|
||||
class NodeText* m_descr;
|
||||
class NodeText* m_shortcut;
|
||||
public:
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void init() override;
|
||||
void init_controls();
|
||||
void set_descr(const std::string& str) noexcept;
|
||||
void set_shortcut(const std::string& str) noexcept;
|
||||
};
|
||||
|
||||
class NodeShortcuts : public NodeBorder
|
||||
{
|
||||
class NodeButton* m_btn_close;
|
||||
class NodeScroll* m_content;
|
||||
public:
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void init() override;
|
||||
void init_controls();
|
||||
void add_shortcut(const std::string& descr, const std::string& shortcut) noexcept;
|
||||
};
|
||||
Reference in New Issue
Block a user