mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-19 04:09:41 +00:00
Bind settings of the Editor (still ongoing)
This commit is contained in:
parent
445cc09d01
commit
518edf6f30
8 changed files with 36 additions and 17 deletions
|
@ -31,8 +31,6 @@ void EditorCanvas::OnPaint(wxPaintEvent &event) {
|
|||
wxSize sz = GetClientSize();
|
||||
CGEditor::status.CanvasWidth = sz.GetWidth();
|
||||
CGEditor::status.CanvasHeight = sz.GetHeight();
|
||||
CGEditor::status.UseMoveIcons =
|
||||
true; // Piece image should be drawn before the move ?
|
||||
|
||||
const wxPoint pt = wxGetMousePosition();
|
||||
CGEditor::status.MouseX = pt.x - this->GetScreenPosition().x;
|
||||
|
@ -229,5 +227,15 @@ void EditorCanvas::SetMoves(HalfMove *moves, HalfMove *current) {
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void EditorCanvas::ApplyPreferences(){
|
||||
CONFIG_OPEN(conf);
|
||||
conf->SetPath("editor/");
|
||||
CGEditor::status.MoveHeight=conf->Read("row_size", 50);
|
||||
CGEditor::status.MoveWidth=conf->Read("col_size", 100);
|
||||
CGEditor::status.UseMoveIcons=conf->Read("show_move_icons", true);
|
||||
CONFIG_CLOSE(conf);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
wxBEGIN_EVENT_TABLE(EditorCanvas, wxPanel) EVT_PAINT(EditorCanvas::OnPaint)
|
||||
EVT_MOUSE_EVENTS(EditorCanvas::MouseEvent) wxEND_EVENT_TABLE()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue