我无法使用wxWidgets(c ++)获取Vista / 7中工具栏的适当主题。出于某种未知的原因,现在我得到灰色的条(如您在这里所看到的)。我想要它看起来更像这个。我已链接到comctl32.lib(=> 5.82),并且UXTHEME也在使用。这里是代码:
#include <wx/wx.h>
class TestAppFrame: public wxFrame
{
public:
TestAppFrame(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString &title = wxT("Test"),
const wxPoint &position = wxDefaultPosition,
const wxSize &size = wxSize(373, 206),
long style = wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL)
: wxFrame(parent, id, title, position, size, style)
{
wxToolBar *tb = CreateToolBar(wxNO_BORDER | wxHORIZONTAL | wxTB_FLAT);
tb->Realize();
SetToolBar(tb);
}
};
class TestApp: public wxApp
{
public:
bool OnInit()
{
if (!wxApp::OnInit())
return false;
wxInitAllImageHandlers();
TestAppFrame *frame = new TestAppFrame(NULL);
frame->Show(true);
return true;
}
};
IMPLEMENT_APP(TestApp)
我在这里做错了什么?
Best regards,
nhaa123