From 2bb6730df8094c89af5a07d394fc02c43aea24eb Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sat, 31 Dec 2022 09:40:39 +0100 Subject: Update --- examples/wxWidgets/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples/wxWidgets/main.cpp') 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) { -- cgit v1.2.3