aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/wxWidgets/MyHalfMove.cpp8
-rw-r--r--examples/wxWidgets/main.cpp7
2 files changed, 11 insertions, 4 deletions
diff --git a/examples/wxWidgets/MyHalfMove.cpp b/examples/wxWidgets/MyHalfMove.cpp
index c1d1ab3..0e08113 100644
--- a/examples/wxWidgets/MyHalfMove.cpp
+++ b/examples/wxWidgets/MyHalfMove.cpp
@@ -128,7 +128,7 @@ MyHalfMove *BuildExampleGame() {
m2 = new MyHalfMove("Bc4");
m->SetMainline(m2);
- m->SetComment("Italian Opening");
+ m->comment="Italian Opening";
m = m2;
m2 = new MyHalfMove("Bc5");
@@ -136,7 +136,7 @@ MyHalfMove *BuildExampleGame() {
m = m2;
m2 = new MyHalfMove("c3");
- m2->SetComment("Giuoco Pianissimo");
+ m2->comment="Giuoco Pianissimo";
m->SetMainline(m2);
m = m2;
@@ -158,7 +158,7 @@ MyHalfMove *BuildExampleGame() {
{
MyHalfMove *var = new MyHalfMove("Re1");
- var->SetComment("Also possible");
+ var->comment="Also possible";
m->AddVariation(var);
MyHalfMove *var2 = new MyHalfMove("a6");
@@ -185,6 +185,8 @@ MyHalfMove *BuildExampleGame() {
m2 = new MyHalfMove("a6");
m->SetMainline(m2);
+ m->comment="Test for a very long comment, to see how line breaks are handle by the framework.";
+ m->comment+="Test for a very long comment, to see how line breaks are handle by the framework.";
m = m2;
m2 = new MyHalfMove("Bb3");
diff --git a/examples/wxWidgets/main.cpp b/examples/wxWidgets/main.cpp
index 99e8839..6a9cf6c 100644
--- a/examples/wxWidgets/main.cpp
+++ b/examples/wxWidgets/main.cpp
@@ -29,6 +29,9 @@ private:
void OnPaint(wxPaintEvent &event) {
wxPaintDC current_dc(this);
dc = &current_dc;
+ wxSize fontsize=dc->GetTextExtent("a");
+
+ wxLogDebug("width=%d, height=%d",fontsize.x,fontsize.y);
// Refresh canvas size
wxSize sz = GetClientSize();
@@ -105,6 +108,8 @@ private:
dc->SetBrush(*wxLIGHT_GREY_BRUSH);
} else if (e.prop & cgeditor::Property::Button) {
dc->SetBrush(*wxBLACK_BRUSH);
+ } else if (e.prop & cgeditor::Property::Comment) {
+ dc->SetBrush(*wxYELLOW_BRUSH);
}
wxRect recToDraw(e.x, e.y, e.width, e.height);
dc->DrawRectangle(recToDraw);
@@ -118,7 +123,7 @@ private:
dc->DrawText(wxString(e.text), Middle(e));
} else if (e.prop & cgeditor::Property::Comment) {
wxRect recToDraw(e.x, e.y, e.width, e.height);
- dc->SetBrush(*wxYELLOW_BRUSH);
+ dc->SetBrush(*wxBLUE_BRUSH);
dc->DrawRectangle(recToDraw);
dc->DrawText(wxString(e.text), wxPoint(e.x, e.y));
} else if (e.prop & cgeditor::Property::Menuitem) {