diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-31 12:19:45 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-31 12:19:45 +0100 |
| commit | b8b73bb9ed5678434d82b573bf677785ee57fc69 (patch) | |
| tree | ad1a7911df3b85f97fe5a61a9315d60c724d45bc /src | |
| parent | 0c9ddd2f0a1e8a2c88ed22fde1828c0fe21ff4dd (diff) | |
Improve chess game editor
Diffstat (limited to 'src')
| -rw-r--r-- | src/base_tab/gamebase/PGNGameBase.cpp | 4 | ||||
| -rw-r--r-- | src/game_tab/HalfMove.cpp | 4 | ||||
| -rw-r--r-- | src/game_tab/right_panel/GameTabRightPanel.cpp | 4 | ||||
| -rw-r--r-- | src/game_tab/right_panel/editor/EditorCanvas.cpp | 7 |
4 files changed, 9 insertions, 10 deletions
diff --git a/src/base_tab/gamebase/PGNGameBase.cpp b/src/base_tab/gamebase/PGNGameBase.cpp index 0f1ce14..5bcbfec 100644 --- a/src/base_tab/gamebase/PGNGameBase.cpp +++ b/src/base_tab/gamebase/PGNGameBase.cpp @@ -176,9 +176,9 @@ std::string PGNGameBase::GetMovesPGN(HalfMove *m, bool needDots) { } part += m->move; - if (m->GetNbLineComment() > 0) { + if (m->comment.size() > 0) { part += " {"; - part += m->GetComment(); + part += m->comment; part += "}"; newNeedDots = true; } diff --git a/src/game_tab/HalfMove.cpp b/src/game_tab/HalfMove.cpp index 9a4558c..735f17c 100644 --- a/src/game_tab/HalfMove.cpp +++ b/src/game_tab/HalfMove.cpp @@ -28,7 +28,7 @@ HalfMove::HalfMove(HalfMove *m){ IsBlack = m->IsBlack; Number = m->Number; nag = m->nag; - SetComment(m->GetComment()); + comment=m->comment; if(m->mainline != NULL){ SetMainline(new HalfMove(m->mainline)); } @@ -141,7 +141,7 @@ HalfMove::HalfMove(pgnp::HalfMove *m) : capture(' ') { this->move = m->move; this->nag = m->NAG; this->IsBlack = m->isBlack; - this->SetComment(m->comment); + this->comment=m->comment; this->Number = m->count; if (m->MainLine != NULL) { this->SetMainline(new HalfMove(m->MainLine)); diff --git a/src/game_tab/right_panel/GameTabRightPanel.cpp b/src/game_tab/right_panel/GameTabRightPanel.cpp index b294528..f2694e5 100644 --- a/src/game_tab/right_panel/GameTabRightPanel.cpp +++ b/src/game_tab/right_panel/GameTabRightPanel.cpp @@ -97,7 +97,7 @@ void GameTabRightPanel::OnCommentChange(wxCommandEvent &event) { wxLogDebug("GameTabRightPanel: comment input change"); HalfMove *m = game->GetCurrentMove(); if (m != NULL) { - m->SetComment(event.GetString().ToStdString()); + m->comment=event.GetString().ToStdString(); } editor_canvas->Refresh(); } @@ -166,7 +166,7 @@ void GameTabRightPanel::Notify() { HalfMove *m = game->GetCurrentMove(); if (m != NULL) { comment_input->ChangeValue( - m->GetComment()); // ChangeValue do not raise events + m->comment); // ChangeValue do not raise events } editor_canvas->SetMoves(game->GetMoves(), m); // Put it here for now: diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp index c4d389d..0a32589 100644 --- a/src/game_tab/right_panel/editor/EditorCanvas.cpp +++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp @@ -44,11 +44,13 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) { dc->SetFont(default_font); if (e.prop & cgeditor::Property::Rectangle) { if (e.prop & cgeditor::Property::Scrollbarbg) { - dc->SetBrush(*wxCYAN_BRUSH); + dc->SetBrush(wxColour(243,243,243)); } else if (e.prop & cgeditor::Property::Scrollbar) { dc->SetBrush(*wxGREY_BRUSH); } else if (e.prop & cgeditor::Property::Margin) { dc->SetBrush(wxBrush(wxColour(243,243,243))); + } else if (e.prop & cgeditor::Property::Comment) { + dc->SetBrush(wxBrush(wxColour(255, 255, 204))); } else if (e.prop & cgeditor::Property::Button) { if (e.prop & cgeditor::Property::On) { dc->DrawBitmap(hide_icon, e.x, e.y); @@ -85,9 +87,6 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) { } dc->DrawBitmap(*t.Get(p), e.x, y); } else if (e.prop & cgeditor::Property::Comment) { - wxRect recToDraw(e.x, e.y, e.width, e.height); - dc->SetBrush(wxBrush(wxColour(255, 255, 204))); - dc->DrawRectangle(recToDraw); dc->DrawText(wxString(e.text), wxPoint(e.x, e.y)); } else if (e.prop & cgeditor::Property::Menuitem) { wxRect recToDraw(e.x, e.y, e.width, e.height); |
