summaryrefslogtreecommitdiffstats
path: root/Project/MainFrame.cpp
diff options
context:
space:
mode:
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();
}