Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Problem on create toolbar.

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problem on create toolbar.
#4672
Posted by: mooncake 2004-06-29 17:53:31
Hi,
   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:

wxSTD_MDIPARENTFRAME    ICON    "mdi.ico"

#include <wx/msw/wx.rc>


My Environment:

win xp home edition
devcpp 1.9.8.10, 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.
Meow~
Message2. Re: Problem on create toolbar.
#4698
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.
#4700
Posted by: mooncake 2004-07-01 21:48:04
Thanks for you advice, but i still failed with that.. :(
Meow~
Message4. Re: Problem on create toolbar.
#4787
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]);
    tool_bar->Realize();
}

i don't konw why i have an error
Message5. Re: Problem on create toolbar.
#4791
Posted by: 2004-07-12 04:10:43
accidently i have found the solution
http://g.yi.org/forum/read.php?13,2982,3936
Message6. Re: Problem on create toolbar.
#4803
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:

myrc.rc
------

wxBITMAP_STD_COLOURS    BITMAP "colours.bmp"


Copy colours.bmp to the project directory.  Dont include the wx.rc
Meow~
Message7. Re: Problem on create toolbar.
#4815
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
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2021-7-28  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0