Skip to content

Commit 0923caf

Browse files
author
Sebastian Pape
committed
Adjusting to changes in 3D_rendering branch
1 parent 2d909be commit 0923caf

File tree

9 files changed

+25
-28
lines changed

9 files changed

+25
-28
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ add_subdirectory("Thirdparty/nativefiledialog-extended")
6060

6161
IF (WIN32)
6262
# Hide console window
63-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
63+
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
6464
ENDIF()
6565

6666
ADD_Executable(DasherUI

DasherCore

src/DasherController.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ void DasherController::editDelete(const std::string& strText, Dasher::CDasherNod
3030
CDasherInterfaceBase::editDelete(strText, pNode);
3131
}
3232

33-
unsigned DasherController::ctrlMove(bool bForwards, Dasher::CControlManager::EditDistance dist)
33+
unsigned DasherController::ctrlMove(bool bForwards, Dasher::EditDistance dist)
3434
{
35-
if (dist == Dasher::CControlManager::EditDistance::EDIT_CHAR) {
35+
if (dist == Dasher::EditDistance::EDIT_CHAR) {
3636
if (bForwards) Cursor++;
3737
else Cursor--;
3838
}
3939
return Cursor;
4040
}
4141

42-
unsigned DasherController::ctrlDelete(bool bForwards, Dasher::CControlManager::EditDistance dist)
42+
unsigned DasherController::ctrlDelete(bool bForwards, Dasher::EditDistance dist)
4343
{
44-
if(dist == Dasher::CControlManager::EditDistance::EDIT_CHAR) {
44+
if(dist == Dasher::EditDistance::EDIT_CHAR) {
4545

4646
Buffer.erase(Cursor - (bForwards ? 0 : 1), 1);
4747
}
@@ -61,9 +61,9 @@ std::string DasherController::GetAllContext()
6161
return CurrentBuffer;
6262
}
6363

64-
std::string DasherController::GetTextAroundCursor(Dasher::CControlManager::EditDistance iDist) {
64+
std::string DasherController::GetTextAroundCursor(Dasher::EditDistance iDist) {
6565
if (Buffer.length() > Cursor && Buffer.length() >= 2) {
66-
if (iDist == Dasher::CControlManager::EditDistance::EDIT_CHAR) {
66+
if (iDist == Dasher::EditDistance::EDIT_CHAR) {
6767
return Buffer.substr(Cursor - 1, 2);
6868
}
6969

@@ -90,13 +90,13 @@ void DasherController::CreateModules()
9090
{
9191
CDashIntfScreenMsgs::CreateModules();
9292

93-
RegisterModule(ScreenModule.get());
93+
GetModuleManager()->RegisterInputDeviceModule(ScreenModule.get());
9494

95-
SocketInputModule = std::make_shared<SocketInput>(static_cast<CSettingsUser*>(this), this, m_pFramerate);
96-
RegisterModule(static_cast<Dasher::CInputFilter*>(SocketInputModule.get()));
95+
SocketInputModule = std::make_shared<SocketInput>(m_pSettingsStore, this, m_pFramerate);
96+
GetModuleManager()->RegisterInputDeviceModule(SocketInputModule.get());
9797
SocketInputModule->startListen();
9898

99-
SetDefaultInputDevice(SocketInputModule.get());
99+
GetModuleManager()->SetDefaultInputDevice(SocketInputModule.get());
100100
}
101101

102102
void DasherController::CopyToClipboard(const std::string& text)

src/DasherController.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class DasherController : public Dasher::CDashIntfScreenMsgs
1717

1818
void editOutput(const std::string& strText, Dasher::CDasherNode* pNode) override;
1919
void editDelete(const std::string& strText, Dasher::CDasherNode* pNode) override;
20-
unsigned ctrlMove(bool bForwards, Dasher::CControlManager::EditDistance dist) override;
21-
unsigned ctrlDelete(bool bForwards, Dasher::CControlManager::EditDistance dist) override;
20+
unsigned ctrlMove(bool bForwards, Dasher::EditDistance dist) override;
21+
unsigned ctrlDelete(bool bForwards, Dasher::EditDistance dist) override;
2222
std::string GetContext(unsigned iStart, unsigned iLength) override;
2323
std::string GetAllContext() override;
24-
std::string GetTextAroundCursor(Dasher::CControlManager::EditDistance iDist) override;
24+
std::string GetTextAroundCursor(Dasher::EditDistance iDist) override;
2525
int GetAllContextLenght() override;
2626

2727
void Initialize();

src/DasherUIScreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "MainWindow.h"
44
#include "imgui/imgui_internal.h"
55

6-
DasherUIScreen::DasherUIScreen(): Dasher::CDasherScreen(100,100), CScreenCoordInput(0, _("Mouse Input"))
6+
DasherUIScreen::DasherUIScreen(): Dasher::CDasherScreen(100,100), CScreenCoordInput(_("Mouse Input"))
77
{
88
Font = MainWindow::LoadFonts(50.0f);
99
}
@@ -48,7 +48,7 @@ void DasherUIScreen::DrawCircle(Dasher::screenint iCX, Dasher::screenint iCY, Da
4848
{
4949
const ImVec4 ImOutlineColor = { static_cast<float>(LineColor.Red) / 255.0f, static_cast<float>(LineColor.Green) / 255.0f, static_cast<float>(LineColor.Blue) / 255.0f, static_cast<float>(LineColor.Alpha) / 255.0f };
5050

51-
ImGui::GetWindowDrawList()->AddCircle(CanvasPos + ImVec2(static_cast<float>(iCX), static_cast<float>(iCY)), static_cast<float>(iR), ImGui::ColorConvertFloat4ToU32(ImFillColor),0, static_cast<float>(iLineWidth));
51+
ImGui::GetWindowDrawList()->AddCircle(CanvasPos + ImVec2(static_cast<float>(iCX), static_cast<float>(iCY)), static_cast<float>(iR), ImGui::ColorConvertFloat4ToU32(ImOutlineColor),0, static_cast<float>(iLineWidth));
5252
}
5353
}
5454

src/DasherUIScreen.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ class DasherUIScreen : public Dasher::CDasherScreen, public Dasher::CScreenCoord
1818
void Polygon(point* Points, int Number, const Dasher::ColorPalette::Color& fillColour, const Dasher::ColorPalette::Color& outlineColour, int lineWidth) override;
1919
void Display() override;
2020
bool IsPointVisible(Dasher::screenint x, Dasher::screenint y) override;
21-
22-
bool MultiSizeFonts() override { return true; }
23-
21+
2422
bool SetCanvasSize(ImVec2 CanvasPos, ImVec2 CanvasSize);
2523

2624
bool GetScreenCoords(Dasher::screenint& iX, Dasher::screenint& iY, Dasher::CDasherView* pView) override;

src/MainWindow.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
MainWindow::MainWindow()
1010
{
11-
ImGui::SetCurrentFont(LoadFonts(14.0f));
11+
ImGui::SetCurrentFont(LoadFonts(22.0f));
1212

1313
Settings = std::make_unique<Dasher::XmlSettingsStore>("Settings.xml", this);
1414
Settings->Load();
@@ -18,7 +18,6 @@ MainWindow::MainWindow()
1818
Controller->Initialize();
1919

2020
Controller->GetPermittedValues(Dasher::SP_ALPHABET_ID, Alphabets);
21-
2221
}
2322

2423
#define FORWARD_KEY(ImGui_Key, DasherKey) { \

src/SocketInput.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#include "DasherInterfaceBase.h"
77
#include "DasherModel.h"
88

9-
SocketInput::SocketInput(CSettingsUser* Creator, Dasher::CDasherInterfaceBase* Controller, Dasher::CFrameRate* pFramerate): CScreenCoordInput(0, _("Socket Input")),
10-
CDefaultFilter(Creator, Controller, pFramerate, 2, "Socket Mode")
9+
SocketInput::SocketInput(Dasher::CSettingsStore* pSettingsStore, Dasher::CDasherInterfaceBase* Controller, Dasher::CFrameRate* pFramerate): CScreenCoordInput(_("Socket Input")),
10+
CDefaultFilter(pSettingsStore, Controller, pFramerate, "Socket Mode")
1111
{
12-
xLabel = GetStringParameter(Dasher::Parameter::SP_SOCKET_INPUT_X_LABEL);
13-
yLabel = GetStringParameter(Dasher::Parameter::SP_SOCKET_INPUT_Y_LABEL);
12+
xLabel = m_pSettingsStore->GetStringParameter(Dasher::Parameter::SP_SOCKET_INPUT_X_LABEL);
13+
yLabel = m_pSettingsStore->GetStringParameter(Dasher::Parameter::SP_SOCKET_INPUT_Y_LABEL);
1414
}
1515

1616
SocketInput::~SocketInput()
@@ -35,7 +35,7 @@ bool SocketInput::GetScreenCoords(Dasher::screenint& iX, Dasher::screenint& iY,
3535

3636
void SocketInput::startListen()
3737
{
38-
session_acceptor = std::make_unique<asio::ip::tcp::acceptor>(io_service, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), static_cast<short>(GetLongParameter(Dasher::LP_SOCKET_PORT))));
38+
session_acceptor = std::make_unique<asio::ip::tcp::acceptor>(io_service, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), static_cast<short>(m_pSettingsStore->GetLongParameter(Dasher::LP_SOCKET_PORT))));
3939

4040
receiveThread = std::thread([this](){
4141

src/SocketInput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class SocketInput : public Dasher::CScreenCoordInput, public Dasher::CDefaultFilter
99
{
1010
public:
11-
SocketInput(CSettingsUser* Creator, Dasher::CDasherInterfaceBase* Controller, Dasher::CFrameRate* pFramerate);
11+
SocketInput(Dasher::CSettingsStore* pSettingsStore, Dasher::CDasherInterfaceBase* Controller, Dasher::CFrameRate* pFramerate);
1212
virtual ~SocketInput();
1313

1414
bool GetScreenCoords(Dasher::screenint& iX, Dasher::screenint& iY, Dasher::CDasherView* pView) override;

0 commit comments

Comments
 (0)