How can I still use wxSmith and control the wxBORDER_NONE style by my variable "bNoBorder"?
Go to the "Resources" tab in the C::B management pane. Navigate to your frame class and click it. Scroll down, find and expand the "Style" setting. wxBORDER_NONE is one of many you can enable/disable.
Hi, I think this method is "manually configure the option", and the style value is fixed(constant) after you tweak the wxSmith setting.
What tigerbeard want is a flexiable way, which means the "bool bNoBorder" should be passed to the "Create()" function call.
I don't find a better way to do that inside the wxSmith. But you can use a hack.
For example,
MyFrame::MyFrame( wxWindow* parent, bool bNoBorder )
{
#define wxDEFAULT_FRAME_STYLE bNoBorder // change the wxDEFAULT_FRAME_STYLE to bNoBorder
...
//(*Initialze(Myframe)
Create( parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE );
...
}
Hopefully you don't use any wxDEFAULT_FRAME_STYLE in the following code in the same cpp file.
Or, you can use a better way, you can just restore the macro definition later, see this post:
Temporarily overwrite a macro in C preprocessor - Stack OverflowHope that helps.