mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-07 02:26:29 +02:00
Improve chess game editor
This commit is contained in:
parent
0c9ddd2f0a
commit
b8b73bb9ed
6 changed files with 10 additions and 11 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit f1f638100f4bcd88b31c3412e961dbbb5e12ad0a
|
Subproject commit 3271972f9eef3069bf80de8be4c057102fff1138
|
|
@ -176,9 +176,9 @@ std::string PGNGameBase::GetMovesPGN(HalfMove *m, bool needDots) {
|
||||||
}
|
}
|
||||||
part += m->move;
|
part += m->move;
|
||||||
|
|
||||||
if (m->GetNbLineComment() > 0) {
|
if (m->comment.size() > 0) {
|
||||||
part += " {";
|
part += " {";
|
||||||
part += m->GetComment();
|
part += m->comment;
|
||||||
part += "}";
|
part += "}";
|
||||||
newNeedDots = true;
|
newNeedDots = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ HalfMove::HalfMove(HalfMove *m){
|
||||||
IsBlack = m->IsBlack;
|
IsBlack = m->IsBlack;
|
||||||
Number = m->Number;
|
Number = m->Number;
|
||||||
nag = m->nag;
|
nag = m->nag;
|
||||||
SetComment(m->GetComment());
|
comment=m->comment;
|
||||||
if(m->mainline != NULL){
|
if(m->mainline != NULL){
|
||||||
SetMainline(new HalfMove(m->mainline));
|
SetMainline(new HalfMove(m->mainline));
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ HalfMove::HalfMove(pgnp::HalfMove *m) : capture(' ') {
|
||||||
this->move = m->move;
|
this->move = m->move;
|
||||||
this->nag = m->NAG;
|
this->nag = m->NAG;
|
||||||
this->IsBlack = m->isBlack;
|
this->IsBlack = m->isBlack;
|
||||||
this->SetComment(m->comment);
|
this->comment=m->comment;
|
||||||
this->Number = m->count;
|
this->Number = m->count;
|
||||||
if (m->MainLine != NULL) {
|
if (m->MainLine != NULL) {
|
||||||
this->SetMainline(new HalfMove(m->MainLine));
|
this->SetMainline(new HalfMove(m->MainLine));
|
||||||
|
|
|
@ -97,7 +97,7 @@ void GameTabRightPanel::OnCommentChange(wxCommandEvent &event) {
|
||||||
wxLogDebug("GameTabRightPanel: comment input change");
|
wxLogDebug("GameTabRightPanel: comment input change");
|
||||||
HalfMove *m = game->GetCurrentMove();
|
HalfMove *m = game->GetCurrentMove();
|
||||||
if (m != NULL) {
|
if (m != NULL) {
|
||||||
m->SetComment(event.GetString().ToStdString());
|
m->comment=event.GetString().ToStdString();
|
||||||
}
|
}
|
||||||
editor_canvas->Refresh();
|
editor_canvas->Refresh();
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ void GameTabRightPanel::Notify() {
|
||||||
HalfMove *m = game->GetCurrentMove();
|
HalfMove *m = game->GetCurrentMove();
|
||||||
if (m != NULL) {
|
if (m != NULL) {
|
||||||
comment_input->ChangeValue(
|
comment_input->ChangeValue(
|
||||||
m->GetComment()); // ChangeValue do not raise events
|
m->comment); // ChangeValue do not raise events
|
||||||
}
|
}
|
||||||
editor_canvas->SetMoves(game->GetMoves(), m);
|
editor_canvas->SetMoves(game->GetMoves(), m);
|
||||||
// Put it here for now:
|
// Put it here for now:
|
||||||
|
|
|
@ -44,11 +44,13 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) {
|
||||||
dc->SetFont(default_font);
|
dc->SetFont(default_font);
|
||||||
if (e.prop & cgeditor::Property::Rectangle) {
|
if (e.prop & cgeditor::Property::Rectangle) {
|
||||||
if (e.prop & cgeditor::Property::Scrollbarbg) {
|
if (e.prop & cgeditor::Property::Scrollbarbg) {
|
||||||
dc->SetBrush(*wxCYAN_BRUSH);
|
dc->SetBrush(wxColour(243,243,243));
|
||||||
} else if (e.prop & cgeditor::Property::Scrollbar) {
|
} else if (e.prop & cgeditor::Property::Scrollbar) {
|
||||||
dc->SetBrush(*wxGREY_BRUSH);
|
dc->SetBrush(*wxGREY_BRUSH);
|
||||||
} else if (e.prop & cgeditor::Property::Margin) {
|
} else if (e.prop & cgeditor::Property::Margin) {
|
||||||
dc->SetBrush(wxBrush(wxColour(243,243,243)));
|
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) {
|
} else if (e.prop & cgeditor::Property::Button) {
|
||||||
if (e.prop & cgeditor::Property::On) {
|
if (e.prop & cgeditor::Property::On) {
|
||||||
dc->DrawBitmap(hide_icon, e.x, e.y);
|
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);
|
dc->DrawBitmap(*t.Get(p), e.x, y);
|
||||||
} else if (e.prop & cgeditor::Property::Comment) {
|
} 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));
|
dc->DrawText(wxString(e.text), wxPoint(e.x, e.y));
|
||||||
} else if (e.prop & cgeditor::Property::Menuitem) {
|
} else if (e.prop & cgeditor::Property::Menuitem) {
|
||||||
wxRect recToDraw(e.x, e.y, e.width, e.height);
|
wxRect recToDraw(e.x, e.y, e.width, e.height);
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 261 KiB |
Loading…
Add table
Reference in a new issue