February 12, 200718 yr Alors voila je voudrais créer une toolbar avec des boutons qui sont en format bmp mais lorsque j'execute mon code ma toolbar apparait mais pas les images --> avec un jolie message d'erreur : no bitmap handler for type 1 defined. Je vous donne juste le code de ma méthode qui crée la toolbar : void CMainFrame::CreateMyToolbar() { m_toolbar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL,TOOLBAR_TOOLS); wxBitmap toolBarBitmaps[4]; toolBarBitmaps[0] = wxBitmap(_("new.bmp"),wxBITMAP_TYPE_BMP); toolBarBitmaps[1] = wxBitmap(_("open.bmp"),wxBITMAP_TYPE_BMP); toolBarBitmaps[2] = wxBitmap(_("save.bmp"),wxBITMAP_TYPE_BMP); toolBarBitmaps[3] = wxBitmap(_("draw.bmp"),wxBITMAP_TYPE_BMP); m_toolbar->SetToolBitmapSize(wxSize(toolBarBitmaps[0].GetWidth(),toolBarBitmaps[0].GetHeight())); m_toolbar->AddTool(MENU_NEW, _("Nouveau"), toolBarBitmaps[0]); m_toolbar->AddTool(MENU_OPEN, _("Open"), toolBarBitmaps[1]); m_toolbar->AddTool(MENU_SAVE, _("Save"), toolBarBitmaps[2]); m_toolbar->AddSeparator(); m_toolbar->AddCheckTool(MENU_TRIANGLE,_("Draw"),toolBarBitmaps[3]); SetToolBar(m_toolbar); m_toolbar->Realize(); } Petite image de ce que ca doit donner logiquement -->
February 13, 200718 yr Author Petite précision même si apparement ca parle pas beaucoup... Ce code fonctionne sur le serveur de ma fac qui est sur la version 2.6.3 de wxWidgets alors que je suis sur la version 2.8.0 sur mon MacBook Donc je suppose qu'ils ont du modifier la gestion des images dans cette version mais je vois pas trop comment faire malheureusement.
Archived
This topic is now archived and is closed to further replies.