Guidance Forums / wxWidgets (wxWindows) in C++ / Problem on create toolbar.

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problem on create toolbar.
Posted by: mooncake 2004-06-29 17:53:31
   When i create the toolbar, and include the xpm, and gonna run no problem,
but it always prompt me this: "Can't load bitmap wxBITMAP_STD_COLOURS
from resources! Check .rc file."

Below is my rs file content:


#include <wx/msw/wx.rc>

My Environment:

win xp home edition
devcpp, wxWidgets 2.5.1, Mingw3.3.1

Another problem, could it be possible that we can set the toolbar background
color?  Can we load another xpm file as the toolbar separator(static)?

Thank you.
Message2. Re: Problem on create toolbar.
Posted by: 2004-07-01 18:08:31
I have this problem before. Open a folder where "wx.rc" lies, the find a bitmap file named colour.bmp, copy the bitmap file to the same folder as your .rc file. Hope this help
Message3. Re: Problem on create toolbar.
Posted by: mooncake 2004-07-01 21:48:04
Thanks for you advice, but i still failed with that.. :(
Message4. Re: Problem on create toolbar.
Posted by: 2004-07-11 03:32:06
I have the same problem. someone could help us ?
DevC++ last version and 2.4.2 wxwindows.
my function to create ma toolbar is very simple:

void MainFrame::Create_ToolBar()
    tool_bar = new wxToolBar;
    tool_bar=CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_3DBUTTONS,0);
    wxBitmap toolBarBitmaps[4];
    toolBarBitmaps[0] = wxBitmap("new.bmp",wxBITMAP_TYPE_BMP);
    tool_bar->AddTool(0, "New", toolBarBitmaps[0]);

i don't konw why i have an error
Message5. Re: Problem on create toolbar.
Posted by: 2004-07-12 04:10:43
accidently i have found the solution,2982,3936
Message6. Re: Problem on create toolbar.
Posted by: mooncake 2004-07-12 21:34:21
Thanks for your sharing, but i still failed with it.. :(

meanwhile, i solved the problem, below is my solution:


wxBITMAP_STD_COLOURS    BITMAP "colours.bmp"

Copy colours.bmp to the project directory.  Dont include the wx.rc
Message7. Re: Problem on create toolbar.
Posted by: 2004-07-14 04:06:46
ok maybe it's the solution of the problem that i have when i want to compile sample>toolbar.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Thu 2024-5-30  Guidance Laboratory Inc. Hits:0