wxSmith uses/supports the wxWidgets' standard ways of including images in your programs. I 'll describe the way to achieve your goal without hand editing anything. It's the way I do it so feel free to take it or leave it
.
If you have noticed, in the wxSmith image dialog (for toolbars, bitmap buttons, etc), there's an option named "Image from wxArtProvider". Also note that the "Art Id" field is editable (i.e. you can type whatever you want in there). That's the key to what you want to achieve.
Now, I could give you the link to
wxArtProvider's documentation and let you figure it out from there but I 'll go on and describe what you can do.
Create a file (or break it up in header/source) like this:
#ifndef MY_ARTPROVIDER_H
#define MY_ARTPROVIDER_H
#include <wx/artprov.h>
// include *your* xpm icons here:
#include "icons/xxx.xpm"
#include "icons/yyy.xpm"
#include "icons/zzz.xpm"
class MyArtProvider : public wxArtProvider
{
public:
MyArtProvider() {}
virtual ~MyArtProvider() {}
protected:
wxBitmap CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
{
if (id == _T("MY_ART_ID_XXX"))
{
return wxBitmap(xxx_xpm);
}
else if (id == _T("MY_ART_ID_YYY"))
{
return wxBitmap(yyy_xpm);
}
else if (id == _T("MY_ART_ID_ZZZ"))
{
return wxBitmap(zzz_xpm);
}
// possibly more Art Ids follow
}
};
#endif // MY_ARTPROVIDER_H
I hope it's clear enough and you can already see where this is going
.
Anyway, there's only one thing still missing. Somewhere in your app's initialization (wxApp or your main frame/dialog constructor) just add this line:
wxArtProvider::Push(new MyArtProvider);
That's it. Now you can use your own Art Ids (e.g. MY_ART_ID_ZZZ) with wxSmith. The only down side is that you won't be able to actually see your bitmaps in the wxSmith editor but that's a small price to pay
.
Hope this helps.