Program: bbtk
Module: $RCSfile: bbwxCommandButton.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2008/12/12 08:55:23 $
+ Version: $Revision: 1.14 $
=========================================================================*/
/* ---------------------------------------------------------------------
namespace bbwx
{
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,CommandButton);
-
+
+
+ //--------------------------------------------------------------------------
+ class CommandButtonWidget : public wxPanel
+ {
+ public:
+ CommandButtonWidget(CommandButton* box, wxWindow *parent,
+ wxString title);
+ ~CommandButtonWidget();
+ void OnCommandButton( wxEvent& );
+ void SetLabel(wxString title);
+ void SetColour(wxColour color);
+
+ private:
+ CommandButton* mBox;
+ wxButton *mwxCommandButton;
+ };
+
+ //--------------------------------------------------------------------------
+ //--------------------------------------------------------------------------
+
CommandButtonWidget::CommandButtonWidget(CommandButton* box,
wxWindow *parent,
wxString title )
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,CommandButton);
BBTK_BLACK_BOX_IMPLEMENTATION(CommandButton,bbtk::WxBlackBox);
void CommandButton::bbUserConstructor()
lstColour.push_back(0.75);
lstColour.push_back(0.75);
bbSetInputColour(lstColour);
+ bbSetOutputWidget(0);
}
void CommandButton::Process()
{
- UpdateColour();
- UpdateLabel();
+ CommandButtonWidget* w = (CommandButtonWidget*)bbGetOutputWidget();
+ if (w)
+ {
+ UpdateColour();
+ UpdateLabel();
+ }
}
void CommandButton::UpdateColour()
*
*
*/
- void CommandButton::CreateWidget()
+ void CommandButton::CreateWidget(wxWindow* parent)
{
bbSetOutputWidget
- ( new CommandButtonWidget ( this, bbGetWxParent(),
- bbtk::std2wx(bbGetInputLabel()) ) );
+ ( new CommandButtonWidget ( this, //bbGetWxParent(),
+ parent,
+ bbtk::std2wx(bbGetInputLabel()) ) );
UpdateColour();
}