summaryrefslogtreecommitdiffstats
path: root/Project
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2020-08-01 19:01:45 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2020-08-01 19:01:45 -0300
commit13d6443b10f1f6896c26a48826f782214e708e65 (patch)
treee9a71c92741dbb955b0d193edcecf937b18154aa /Project
parent7be97c31c9b240cd7b320c19ee34f2460e57d537 (diff)
downloadPSP.git-13d6443b10f1f6896c26a48826f782214e708e65.tar.gz
PSP.git-13d6443b10f1f6896c26a48826f782214e708e65.tar.xz
PSP.git-13d6443b10f1f6896c26a48826f782214e708e65.zip
Text bug fix and documentation update
New fancy [PSP-UFU website](https://thales1330.github.io/PSP/) and [changelog](https://thales1330.github.io/PSP/blog) using [docusaurus](https://v2.docusaurus.io/); Text element performance improved for OpenGL render; Major text bug on copy fixed
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;
}