diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-31 09:40:39 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-31 09:40:39 +0100 |
| commit | 2bb6730df8094c89af5a07d394fc02c43aea24eb (patch) | |
| tree | b531e2027961db3b15ccf649d6e015d62e8a392f /examples/wxWidgets/main.cpp | |
| parent | f1f638100f4bcd88b31c3412e961dbbb5e12ad0a (diff) | |
Update
Diffstat (limited to 'examples/wxWidgets/main.cpp')
| -rw-r--r-- | examples/wxWidgets/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 = ¤t_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) { |
