if (mIsWidget)
{
mFile << " BBTK_CREATE_WIDGET(CreateWidget);\n" ;
- mFile << " void CreateWidget();\n";
+ mFile << " void CreateWidget(wxWindow*);\n";
}
// CreateWidget
if (mIsWidget)
{
- mFile << "void "<<mName<<"::CreateWidget()\n{\n";
+ mFile << "void "<<mName<<"::CreateWidget(wxWindow* parent)\n{\n";
mFile << mCreateWidget << "\n";
mFile << "}\n";
}
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/11/17 10:00:24 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2008/11/24 15:45:48 $
+ Version: $Revision: 1.30 $
=========================================================================*/
/* ---------------------------------------------------------------------
<<title<<",size)"<<std::endl);
// Insert the widget into the window
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ // LG 22/11/08 : new widget pipeline
+ bbGetBlackBox()->bbCreateWidgetAndEventHandler(this);
wxWindow* widget = bbGetBlackBox()->bbGetOutputWidget();
- widget->Reparent(this);
+// old : widget->Reparent(this);
sizer->Add( widget, 1, wxALL|wxEXPAND, 2);
//SetAutoLayout(true);
SetSizer(sizer);
<<title<<",size)"<<std::endl);
// Insert the widget into the window
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ // LG 22/11/08 : new widget pipeline
+ bbGetBlackBox()->bbCreateWidgetAndEventHandler(this);
wxWindow* widget = bbGetBlackBox()->bbGetOutputWidget();
wxFrame* frame = (wxFrame*)this;
- widget->Reparent(frame);
+// old : widget->Reparent(frame);
sizer->Add( widget, 1, wxALL|wxGROW, 2);
// frame->SetAutoLayout(true);
frame->SetSizer(sizer);
//=========================================================================
void WxBlackBox::bbProcess()
{
- if (bbGetOutputWidget()==0) this->bbUserCreateWidget();
+/*
+ if (bbGetOutputWidget()==0) this->bbUserCreateWidget();
this->bbUserProcess();
bbShowWindow();
// this->bbUserOnShow();
+*/
+ // LG 22/11/08 : new widget pipeline
+ // If output widget not connected :
+ if ( (*bbGetOutputConnectorMap().find("Widget")).second
+ ->GetConnectionVector().size() == 0 )
+ {
+ Window* show = 0;
+ // If the window already exists : no need creating it
+ if (bbGetWindow()!=0)
+ {
+ bbtkDebugMessage("wx",2,
+ "-> Window already exists"
+ <<std::endl);
+ show = bbGetWindow();
+ }
+ // Else create window
+ else
+ {
+ bbtkDebugMessage("wx",2,
+ "-> Creating the window"
+ <<std::endl);
+
+
+ // Input WinDialog set to true : creating a Dialog
+ if (bbGetInputWinDialog())
+ {
+ bbtkDebugMessage("wx",2,
+ " Input WinDialog set to true : creating a Dialog"
+ <<std::endl);
+ show = (Window*) new WxBlackBoxDialog( GetThisPointer<WxBlackBox>(),
+ // bbGetWxParent(),
+ // LG 24/11/08 : New widget pipeline
+ Wx::GetTopWindow(),
+ std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN"),
+ wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
+ }
+ // Input WinDialog set to false : creating a Frame
+ else
+ {
+ bbtkDebugMessage("process",2,
+ " Input WinDialog set to false : creating a Frame"
+ <<std::endl);
+ show = (Window*) new WxBlackBoxFrame( GetThisPointer<WxBlackBox>(),
+ // bbGetWxParent(),
+ // LG 24/11/08 : New widget pipeline
+ Wx::GetTopWindow(),
+ std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN"),
+ wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
+ }
+
+ }
+
+ // Show the window
+ show->bbShow();
+
+
+ }
+ this->bbUserProcess();
+
}
//=========================================================================
-
+
+
+
+ // LG 24/11/08 : New widget pipeline
+ void WxBlackBox::bbCreateWidgetAndEventHandler(wxWindow* parent)
+ {
+ if (bbGetOutputWidget()==0)
+ {
+ this->bbUserCreateWidget(parent);
+ }
+ // If Event Handler for the widget does not exist or is obsolete : create it
+ if (bbGetOutputWidget()!=0)
+ {
+ if (bbGetWidgetEventHandler()==0)
+ {
+ bbtkDebugMessage("wx",3,
+ "-> No widget event handler : creating one"
+ <<std::endl);
+ new WxBlackBoxWidgetEventHandler(GetThisPointer<WxBlackBox>(),
+ bbGetOutputWidget());
+ }
+ else if ( ! bbGetWidgetEventHandler()->IsHandlerOf
+ ( bbGetOutputWidget() ) )
+ {
+ bbtkDebugMessage("wx",3,
+ "-> Obsolete widget event handler : re-creating one"
+ <<std::endl);
+ delete bbGetWidgetEventHandler();
+ new WxBlackBoxWidgetEventHandler(GetThisPointer<WxBlackBox>(),
+ bbGetOutputWidget());
+ }
+ // Sets the name of the wxWindow to the input WinTitle
+ bbGetOutputWidget()->SetName(bbtk::std2wx(bbGetInputWinTitle()));
+ }
+
+
+ }
+
+
+
+ wxWindow* WxBlackBox::bbCreateWidgetOfInput(const std::string& in, wxWindow* parent)
+ {
+ wxWindow* w = 0;
+ // If input is connected
+ BlackBoxInputConnector* c = bbGetInputConnectorMap().find(in)->second ;
+ if ( c->IsConnected() )
+ {
+ // Get black box from
+ BlackBox::Pointer from =
+ c->GetConnection()->GetBlackBoxFrom();
+ // Cast it into a WxBlackBox
+ WxBlackBox::Pointer wfrom = boost::dynamic_pointer_cast<WxBlackBox>(from);
+ // Call bbCreateWidgetAndEventHandler
+ wfrom->bbCreateWidgetAndEventHandler(parent);
+ // Get the widget created
+ w = wfrom->bbGetOutputWidget();
+ }
+ return w;
+ }
+
+ /*
//==================================================================
/// Specific methods for window creation during pipeline execution
/// Shows the window associated to the box
" Input WinDialog set to true : creating a Dialog"
<<std::endl);
show = (Window*) new WxBlackBoxDialog( GetThisPointer<WxBlackBox>(),
- bbGetWxParent(),
+ // bbGetWxParent(),
+ // LG 24/11/08 : New widget pipeline
+ Wx::GetTopWindow(),
std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN"),
wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
}
" Input WinDialog set to false : creating a Frame"
<<std::endl);
show = (Window*) new WxBlackBoxFrame( GetThisPointer<WxBlackBox>(),
- bbGetWxParent(),
+ // bbGetWxParent(),
+ // LG 24/11/08 : New widget pipeline
+ Wx::GetTopWindow(),
std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN"),
wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
}
}
//==================================================================
-
+*/
//==================================================================
- wxWindow* WxBlackBox::bbGetWxParent() { return Wx::GetTopWindow(); }
+ // LG 24/11/08 : New widget pipeline
+ // wxWindow* WxBlackBox::bbGetWxParent() { return Wx::GetTopWindow(); }
//==================================================================
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:43 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2008/11/24 15:45:48 $
+ Version: $Revision: 1.20 $
========================================================================*/
class BBTK_EXPORT WxBlackBox : public bbtk::AtomicBlackBox
{
BBTK_BLACK_BOX_INTERFACE(WxBlackBox,bbtk::AtomicBlackBox);
- // BBTK_DECLARE_INPUT(WinParent,WxParentToChildData*);
BBTK_DECLARE_INPUT(WinTitle,std::string);
BBTK_DECLARE_INPUT(WinWidth,int);
BBTK_DECLARE_INPUT(WinHeight,int);
BBTK_DECLARE_INPUT(WinDialog,bool);
BBTK_DECLARE_INPUT(WinHide,Void);
BBTK_DECLARE_INPUT(WinClose,Void);
- BBTK_DECLARE_OUTPUT(Widget, wxWindow*);//WxBlackBoxWidget*);
+ BBTK_DECLARE_OUTPUT(Widget, wxWindow*);
public:
/// Main processing method of the box. Overloaded to handle windows inclusion : if the output Widget is connected then the execution is transfered to the box to which it is connected (as the container window must be created and displayed - this box will be executed by the normal pipeline recursion mechanism)
Window* bbGetContainingWindow();
/// Returns the parent wxWindow that must be used to create the widget
- wxWindow* bbGetWxParent();
+ //
+ // LG 24/11/08 : New widget pipeline
+ // wxWindow* bbGetWxParent();
/// Returns true iff the 'containing window' exists and is shown
/// (see bbGetContainingWindow).
virtual void bbUserOnHide() {}
//==================================================================
+ // LG 24/11/08 : New widget pipeline
+ void bbCreateWidgetAndEventHandler(wxWindow* parent);
+
+
protected:
//==================================================================
/// User callback for creating the widget associated to the box
/// ** Must be defined **
- virtual void bbUserCreateWidget()
+ // LG 24/11/08 : New widget pipeline
+ virtual void bbUserCreateWidget(wxWindow* parent)
{
bbtkError(bbGetTypeName()<<" is a WxBlackBox whose bbUserCreateWidget methods is not overloaded : is it a feature or a bug ?!?");
}
//==================================================================
-
+ wxWindow* bbCreateWidgetOfInput(const std::string& in, wxWindow* parent);
+
//==================================================================
/// Main processing method of the box.
/// Defines the bbUserCreateWidget method
#define BBTK_CREATE_WIDGET(CALLBACK) \
public: \
- inline void bbUserCreateWidget() \
+ inline void bbUserCreateWidget(wxWindow* parent) \
{ \
bbtkDebugMessageInc("wx",1,"**> Creating widget for [" \
<<bbGetFullName()<<"]"<<std::endl); \
- CALLBACK(); \
+ CALLBACK(parent); \
bbtkDebugMessageInc("wx",1,"<** Creating widget for [" \
<<bbGetFullName()<<"]"<<std::endl); \
}
Program: bbtk
Module: $RCSfile: bbtkWxGUIHtmlBrowser.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:15 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2008/11/24 15:45:48 $
+ Version: $Revision: 1.11 $
=========================================================================*/
/* ---------------------------------------------------------------------
reload_id,
include_id,
url_id ,
- html_id
+ html_id = 10100
};
-/*EED
+/*
//========================================================================
void WxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& e)
{
std::cout << "WxHtmlWindow::OnLink"<<std::endl;
// std::cout << e.GetHref()<<std::endl;
- LoadPage(e.GetHref());
- if ( ! GetOpenedAnchor().IsEmpty() )
- {
- // std::cout << "#" << GetOpenedAnchor() << std::endl;
- LoadPage(_T("#"+GetOpenedAnchor()));
- }
- mBrowser->UpdateURL();
+ mBrowser->OnLinkClicked2(e);
}
- //========================================================================
*/
-
//EED2 BEGIN_EVENT_TABLE(WxHtmlWindow, wxPanel)
//EED2 EVT_SIZE(WxHtmlWindow::OnSize)
//EED2 END_EVENT_TABLE()
EVT_BUTTON(reload_id, WxGUIHtmlBrowser::OnReloadButton )
// EVT_BUTTON(include_id, WxGUIHtmlBrowser::OnIncludeFileButton )
EVT_TEXT_ENTER(url_id, WxGUIHtmlBrowser::OnURLEnter )
- EVT_HTML_LINK_CLICKED(html_id, WxGUIHtmlBrowser::OnLinkClicked)
+ EVT_HTML_LINK_CLICKED(html_id, WxGUIHtmlBrowser::OnLinkClicked)
EVT_SIZE(WxGUIHtmlBrowser::OnSize)
END_EVENT_TABLE()
bsizer->Add(mwxURL, 1, wxEXPAND);
-// mwxHtmlWindow = new WxHtmlWindow(parent,html_id,this,size);
- mwxHtmlWindow = new WxHtmlWindow(this,html_id,this,size);
+// mwxHtmlWindow = new WxHtmlWindow(this,html_id,this,size);
+
+ mwxHtmlWindow = new wxHtmlWindow(this,html_id,
+ wxDefaultPosition,
+ size,
+ wxHW_SCROLLBAR_AUTO,
+ _T("bbtk::WxGUIHtmlBrowser"));
/*
wxDefaultPosition,
size ),
wxVERTICAL );
-//EED hw->Add ( mwxHtmlWindow, 1, wxGROW );
- hw->Add ( mwxHtmlWindow, 1, wxEXPAND );
-
-
-
-
- //sizer->Add ( mwxHtmlWindow, 1, wxGROW );
-//EED sizer->Add ( hw, 1, wxGROW ); // | wxLEFT | wxRIGHT | wxBOTTOM, 10 );
+ hw->Add ( mwxHtmlWindow, 1, wxEXPAND );
sizer->Add ( bsizer , 0, wxEXPAND );
sizer->Add ( hw, 1, wxGROW ); // | wxLEFT | wxRIGHT | wxBOTTOM, 10 );
-
-
panel -> SetSizer(sizer);
panel -> SetAutoLayout(true);
panel -> Layout();
}
//========================================================================
-
+ //========================================================================
+ void WxGUIHtmlBrowser::OnLinkClicked2(const wxHtmlLinkInfo& info)
+ {
+ std::cout << "OLK2"<<std::endl;
+ bool go = true;
+ if (mUser)
+ {
+ wxString file = info.GetHref();
+ go = mUser->WxGUIHtmlBrowserUserOnLinkClicked( wx2std( file ) );
+ }
+ if (go)
+ {
+ mwxHtmlWindow->LoadPage( info.GetHref() );
+ UpdateURL();
+ }
+
+
+ }
+
//========================================================================
void WxGUIHtmlBrowser::OnLinkClicked(wxHtmlLinkEvent& e)
{
-
+ std::cout << "OLK"<<std::endl;
bool go = true;
if (mUser)
{
Program: bbtk
Module: $RCSfile: bbtkWxGUIHtmlBrowser.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:15 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:48 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
class WxGUIHtmlBrowser;
+
class WxHtmlWindow : public virtual wxHtmlWindow
{
public:
_T("bbtk::WxGUIHtmlBrowser")),
mBrowser(browser)
{
+ std::cout << "ctor"<<std::endl;
SetBorders(30);
};
// wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,const wxString& url, wxString *redirect);
-//EED virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
+// virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
//EED2 void OnSize( wxSizeEvent&);
};
+// typedef wxHtmlWindow WxHtmlWindow;
+
+#define THE_HTML_WINDOW_CLASS wxHtmlWindow
+
/// Abstract class which defines the callbacks invoked by WxGUIHtmlBrowser
class WxGUIHtmlBrowserUser
{
void OnReloadButton(wxCommandEvent& );
// void OnRunButton(wxCommandEvent& );
void OnLinkClicked(wxHtmlLinkEvent& );
+ void OnLinkClicked2(const wxHtmlLinkInfo& );
void OnURLEnter( wxCommandEvent&);
void OnSize( wxSizeEvent&);
std::string GetCurrentPage();
private:
- WxHtmlWindow* mwxHtmlWindow;
+ THE_HTML_WINDOW_CLASS * mwxHtmlWindow;
wxTextCtrl* mwxURL;
wxButton* mwxBackButton;
wxButton* mwxForwardButton;
Program: bbtk
Module: $RCSfile: bbwxColourSelectorButton.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
*
*
*/
- void ColourSelectorButton::CreateWidget()
+ void ColourSelectorButton::CreateWidget(wxWindow* parent)
{
bbtkDebugMessage("Process",9,"=> ColourSelectorButton::CreateWidget()"<<std::endl);
cg = (unsigned char)(255.*g);
cb = (unsigned char)(255.*b);
- pickerWidget = new wxColourPickerCtrlWidget(this, bbGetWxParent() , cr , cg , cb );
+ pickerWidget = new wxColourPickerCtrlWidget(this, //bbGetWxParent() ,
+ parent,
+ cr , cg , cb );
bbtkDebugMessage("Process",9,"<= ColourSelectorButton::CreateWidget()"<<std::endl);
Program: bbtk
Module: $RCSfile: bbwxColourSelectorButton.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxCommandButton.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.12 $
=========================================================================*/
/* ---------------------------------------------------------------------
*
*
*/
- 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();
}
Program: bbtk
Module: $RCSfile: bbwxCommandButton.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
- void CreateWidget();
+ void CreateWidget(wxWindow*);
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxInputText.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.4 $
=========================================================================*/
/* ---------------------------------------------------------------------
{
bbSetInputTitle("");
bbSetInputIn("");
+ bbSetOutputWidget(0);
}
void InputText::Process()
{
InputTextWidget *w=(InputTextWidget *)bbGetOutputWidget();
- bbSetInputIn( w->GetValue() );
- bbSetOutputOut( w->GetValue() );
- w->SetTitle( bbtk::std2wx ( bbGetInputTitle() ) );
+ if (w)
+ {
+ bbSetInputIn( w->GetValue() );
+ w->SetTitle( bbtk::std2wx ( bbGetInputTitle() ) );
+ }
+ bbSetOutputOut( bbGetInputIn() );
}
- void InputText::CreateWidget()
+ void InputText::CreateWidget(wxWindow* parent)
{
bbSetOutputWidget
- ( (wxWindow*) new InputTextWidget(this, bbGetWxParent(),
- bbtk::std2wx ( bbGetInputIn() ) ,
- bbtk::std2wx ( bbGetInputTitle() ) ) );
+ ( (wxWindow*) new InputTextWidget(this, //bbGetWxParent(),
+ parent,
+ bbtk::std2wx ( bbGetInputIn() ) ,
+ bbtk::std2wx ( bbGetInputTitle() ) ) );
}
Program: bbtk
Module: $RCSfile: bbwxInputText.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.5 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
- void CreateWidget();
+ void CreateWidget(wxWindow*);
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.cxx,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:46 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
{
}
+
+/*
void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
{
if (w!=NULL)
sizer->Add(w, 1, wxEXPAND, 0);
}
}
-
- void LayoutLine::CreateWidget()
+ */
+
+ void LayoutLine::CreateWidget(wxWindow* parent)
{
wxBoxSizer *sizer;
- wxPanel *w=new wxPanel(bbGetWxParent(), -1);
+ wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
+ -1);
w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
int style=0;
{ style=wxVERTICAL; }
sizer = new wxBoxSizer(style);
-
+
+ wxWindow* cw;
+ if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+ /*
TryInsertWindow(w,bbGetInputWidget1(),sizer);
TryInsertWindow(w,bbGetInputWidget2(),sizer);
TryInsertWindow(w,bbGetInputWidget3(),sizer);
TryInsertWindow(w,bbGetInputWidget7(),sizer);
TryInsertWindow(w,bbGetInputWidget8(),sizer);
TryInsertWindow(w,bbGetInputWidget9(),sizer);
-
+ */
w -> SetSizer(sizer);
bbSetOutputWidget( w );
}
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:46 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ON_SHOW_WIDGET(OnShowWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
void OnShowWidget();
protected:
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:46 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
{
}
- void LayoutSplit::CreateWidget()
+ void LayoutSplit::CreateWidget(wxWindow* parent)
{
- wxSplitterWindow* w = new wxSplitterWindow(bbGetWxParent(),
+ wxSplitterWindow* w = new wxSplitterWindow(parent, //bbGetWxParent(),
-1,
wxDefaultPosition,
wxDefaultSize,
wxSP_3D |
wxSP_LIVE_UPDATE );
w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
- wxWindow* w1 = bbGetInputWidget1();
+/*
+ wxWindow* w1 = bbGetInputWidget1();
wxWindow* w2 = bbGetInputWidget2();
if (w1==NULL) { w1=new wxPanel(bbGetWxParent()); }
if (w2==NULL) { w2=new wxPanel(bbGetWxParent()); }
w1->Reparent(w);
w2->Reparent(w);
- int orientation=0;
+ */
+
+ wxWindow* w1 = bbCreateWidgetOfInput("Widget1",w);
+ wxWindow* w2 = bbCreateWidgetOfInput("Widget2",w);
+ if (w1==NULL) { w1=new wxPanel(parent); }
+ if (w2==NULL) { w2=new wxPanel(parent); }
+
+ int orientation=0;
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { orientation=0; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; }
- if (orientation==1) { w->SplitHorizontally( w1, w2, 100); }
+
+ if (orientation==1) { w->SplitHorizontally( w1, w2, 100); }
else { w->SplitVertically( w1, w2, 100); }
-
+
bbSetOutputWidget( w );
}
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:46 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ON_SHOW_WIDGET(OnShowWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
void OnShowWidget();
protected:
Program: bbtk
Module: $RCSfile: bbwxLayoutTab.cxx,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:46 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbSetInputWidget8(NULL);
bbSetInputWidget9(NULL);
}
-
+/*
void LayoutTab::TryInsertWindow(wxNotebook *book, wxWindow *widgetchild )
{
if (widgetchild!=NULL)
widgetchild->Show();
}
}
-
+*/
void LayoutTab::Process()
{
}
- void LayoutTab::CreateWidget()
+ void LayoutTab::CreateWidget(wxWindow* parent)
{
long style = wxNB_TOP;
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true) { style=wxNB_TOP; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true) { style=wxNB_RIGHT; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true) { style=wxNB_BOTTOM; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true) { style=wxNB_LEFT; }
- wxNotebook *w = new wxNotebook(bbGetWxParent(), -1, wxDefaultPosition,wxDefaultSize,style );
+ wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
+ -1, wxDefaultPosition,wxDefaultSize,style );
w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-
+ /*
TryInsertWindow(w,bbGetInputWidget1());
TryInsertWindow(w,bbGetInputWidget2());
TryInsertWindow(w,bbGetInputWidget3());
TryInsertWindow(w,bbGetInputWidget7());
TryInsertWindow(w,bbGetInputWidget8());
TryInsertWindow(w,bbGetInputWidget9());
-
+*/
bbSetOutputWidget( w );
}
Program: bbtk
Module: $RCSfile: bbwxLayoutTab.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:46 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ON_SHOW_WIDGET(OnShowWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
void OnShowWidget();
protected:
<input name="In" type="std::string" description="Text"/>
<createwidget><PRE>
- bbSetOutputWidget( new wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
+ bbSetOutputWidget( new wxStaticText ( parent, /*bbGetWxParent(),*/ -1 , _T("") ) );
Process();
</PRE></createwidget>
<process><PRE>
- std::string msg;
- if (bbGetInputTitle()!="")
- {
- msg = bbGetInputTitle()+": " + bbGetInputIn();
- }
- else
- {
- msg = bbGetInputIn();
- }
- ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) );
+ wxStaticText* w = (wxStaticText*)bbGetOutputWidget();
+ if (w)
+ {
+ std::string msg;
+ if (bbGetInputTitle()!="")
+ {
+ msg = bbGetInputTitle()+": " + bbGetInputIn();
+ }
+ else
+ {
+ msg = bbGetInputIn();
+ }
+ w->SetLabel( bbtk::std2wx( msg ) );
+ }
</PRE></process>
<constructor><PRE>
bbSetInputIn("");
bbSetInputTitle("");
+ bbSetOutputWidget(0);
</PRE></constructor>
Program: bbtk
Module: $RCSfile: bbwxRadioButton.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
*
*
*/
- void RadioButton::CreateWidget()
+ void RadioButton::CreateWidget(wxWindow* parent)
{
std::vector<wxString> lstIn;
RadioButtonWidget *w = new RadioButtonWidget(
this,
- bbGetWxParent(),
+// bbGetWxParent(),
+ parent,
bbGetInputIn() ,
bbtk::std2wx(bbGetInputTitle()),
lstIn );
Program: bbtk
Module: $RCSfile: bbwxRadioButton.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_CREATE_WIDGET(CreateWidget);
BBTK_PROCESS(Process);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxSlider.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.15 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbSetOutputOut( bbGetInputIn() );
}
- void Slider::CreateWidget()
+ void Slider::CreateWidget(wxWindow* parent)
{
int orientation=0;
// std::cout << "bbGetWxParent = "<<bbGetWxParent()<<std::endl;
SliderWidget *w = new SliderWidget(this,
- bbGetWxParent(),
+ parent, //bbGetWxParent(),
orientation ,
bbGetInputChangeResolution(),
bbGetInputLabel(),
Program: bbtk
Module: $RCSfile: bbwxSlider.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:33 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2008/11/24 15:45:51 $
+ Version: $Revision: 1.14 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/11/20 16:32:41 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2008/11/24 15:45:53 $
+ Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// (see wxvtk/bbs/appli/ExampleSimpleSlicer)
// I think there is a problem with rendering before window
// has been reparented ... we have to check this
-
- ((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
- bbSetOutputOut( bbGetInputSlice() );
- bbSetOutputRenderer( ((Viewer2DWidget*)bbGetOutputWidget())->GetRenderer() );
-
+ Viewer2DWidget* w = (Viewer2DWidget*)bbGetOutputWidget();
+ if (w)
+ {
+ w->UpdateView();
+ bbSetOutputRenderer( ((Viewer2DWidget*)bbGetOutputWidget())->GetRenderer() );
+ }
+ bbSetOutputOut( bbGetInputSlice() );
+
}
{
bbSetInputIn(NULL);
bbSetInputSlice(0);
+ bbSetOutputWidget(0);
bbSetInputOrientation(0);
}
*
*
*/
- void Viewer2D::CreateWidget()
+ void Viewer2D::CreateWidget(wxWindow* parent)
{
bbtkDebugMessageInc("Core",9,"Viewer2D::CreateWidget()"<<std::endl);
- Viewer2DWidget* w = new Viewer2DWidget(this,bbGetWxParent());
+ Viewer2DWidget* w = new Viewer2DWidget(this,parent);//bbGetWxParent());
bbSetOutputWidget(w);
bbtkDebugDecTab("Core",9);
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:48 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2008/11/24 15:45:54 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
BBTK_ON_SHOW_WIDGET(OnShowWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
void OnShowWidget();
void bbUserConstructor();
};
Program: bbtk
Module: $RCSfile: bbwxvtkViewer3D.cxx,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:48 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2008/11/24 15:45:54 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*
*
*/
- void Viewer3D::CreateWidget()
+ void Viewer3D::CreateWidget(wxWindow* parent)
{
bbtkDebugMessageInc("Core",9,"Viewer3D::CreateWidget()"<<std::endl);
- Viewer3DWidget* w = new Viewer3DWidget(this,bbGetWxParent(),bbGetInputStereo());
+ Viewer3DWidget* w = new Viewer3DWidget(this,parent,
+ //bbGetWxParent(),
+ bbGetInputStereo());
w->Update();
Program: bbtk
Module: $RCSfile: bbwxvtkViewer3D.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:48 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2008/11/24 15:45:54 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
BBTK_ON_SHOW_WIDGET(OnShowWidget);
void Process();
- void CreateWidget();
+ void CreateWidget(wxWindow*);
void OnShowWidget();
protected: