summaryrefslogtreecommitdiffstats
path: root/Project
diff options
context:
space:
mode:
Diffstat (limited to 'Project')
-rw-r--r--Project/AboutForm.cpp2
-rw-r--r--Project/MainFrame.cpp20
-rw-r--r--Project/OpenGLText.cpp4
3 files changed, 23 insertions, 3 deletions
diff --git a/Project/AboutForm.cpp b/Project/AboutForm.cpp
index 619c6c1..2fea1ec 100644
--- a/Project/AboutForm.cpp
+++ b/Project/AboutForm.cpp
@@ -22,7 +22,7 @@ AboutForm::~AboutForm() {}
void AboutForm::Init()
{
// Set program version. Format: (Alpha/Beta/Release) (YEAR)w(WEEK)(a/b/c/...)
- m_staticTextVersion->SetLabel("2020w28a-beta");
+ m_staticTextVersion->SetLabel("2020w31a-beta");
// Create developers table
m_gridCredits->EnableGridLines(false);
diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp
index 1a9c9a9..178e2eb 100644
--- a/Project/MainFrame.cpp
+++ b/Project/MainFrame.cpp
@@ -387,7 +387,10 @@ void MainFrame::OnOpenClick(wxRibbonButtonBarEvent& event)
}
}
-void MainFrame::OnPSPGuideClick(wxRibbonButtonBarEvent& event) {}
+void MainFrame::OnPSPGuideClick(wxRibbonButtonBarEvent& event)
+{
+ wxLaunchDefaultBrowser("https://thales1330.github.io/PSP/docs/");
+}
void MainFrame::OnPasteClick(wxRibbonButtonBarEvent& event) {}
void MainFrame::OnPowerFlowClick(wxRibbonButtonBarEvent& event)
{
@@ -459,8 +462,10 @@ void MainFrame::OnAddElementsClick(wxCommandEvent& event)
if (workspace) {
if (workspace->GetWorkspaceMode() != Workspace::WorkspaceMode::MODE_INSERT) {
auto elementList = workspace->GetElementList();
+ auto textList = workspace->GetTextList();
wxString statusBarText = "";
bool newElement = false;
+ bool isText = false;
switch (event.GetId()) {
case ID_ADDMENU_BUS: {
@@ -541,10 +546,21 @@ void MainFrame::OnAddElementsClick(wxCommandEvent& event)
statusBarText = _("Insert Synchronous Condenser: Click on a buses, ESC to cancel.");
newElement = true;
} break;
+ case ID_ADDMENU_TEXT: {
+ Text* newText = new Text();
+ textList.push_back(newText);
+ statusBarText = _("Insert Text: Click to insert, ESC to cancel.");
+ newElement = true;
+ isText = true;
+ } break;
}
if (newElement) {
workspace->SetElementList(elementList);
- workspace->SetWorkspaceMode(Workspace::WorkspaceMode::MODE_INSERT);
+ workspace->SetTextList(textList);
+ if(!isText)
+ workspace->SetWorkspaceMode(Workspace::WorkspaceMode::MODE_INSERT);
+ else
+ workspace->SetWorkspaceMode(Workspace::WorkspaceMode::MODE_INSERT_TEXT);
workspace->SetStatusBarText(statusBarText);
workspace->Redraw();
}
diff --git a/Project/OpenGLText.cpp b/Project/OpenGLText.cpp
index f877afa..a72af7f 100644
--- a/Project/OpenGLText.cpp
+++ b/Project/OpenGLText.cpp
@@ -188,9 +188,13 @@ OpenGLText* OpenGLText::GetCopy()
{
OpenGLText* copy = new OpenGLText();
*copy = *this;
+ copy->m_textCoord = nullptr;
+ copy->Init();
+
copy->m_textureID = nullptr;
copy->m_bitmapSize = wxSize(0, 0);
copy->m_bitmap = wxNullBitmap;
+
copy->SetText(copy->m_text);
return copy;
}