summaryrefslogtreecommitdiffstats
path: root/Project/MainFrame.cpp
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/MainFrame.cpp
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/MainFrame.cpp')
-rw-r--r--Project/MainFrame.cpp20
1 files changed, 18 insertions, 2 deletions
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();
}