【发布时间】:2021-04-23 17:39:13
【问题描述】:
CustomBitmap *bitmapCtrl1 = new CustomBitmap(mainPanel, bitmap1, id+1, rollover_bitmap1, NULL, wxDefaultPosition, wxSize(125, 125));
CustomBitmap 类派生自wxControl。这是我的 OnPaint 函数。
void CustomBitmap::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc((wxWindow *) this);
SetTransparent(0);
if (m_enter)
{
dc.DrawBitmap(m_bmpmouseover, 0, 0, true);
}
else
{
if (m_leftdown || m_rightdown){
dc.DrawBitmap(m_bmpclick, 0, 0, true);
}
else {
dc.DrawBitmap(m_bmpstatic, 0, 0, true);
}
}
#ifdef WX3
//dc.EndDrawing();
#else
// dc.EndDrawing();
#endif
}
【问题讨论】:
标签: c++ user-interface wxwidgets onpaint wxtextctrl