From 468921bcc742dff540a5becedc6c045c26651f99 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 25 Apr 2018 15:40:21 +0200 Subject: [PATCH] #3191 BBTK Feature New Normal - HtmlWindow Box --- packages/wx/src/bbwxHtmlWindow.cxx | 71 ++++++++++++++++++++++++++++++ packages/wx/src/bbwxHtmlWindow.h | 46 +++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 packages/wx/src/bbwxHtmlWindow.cxx create mode 100644 packages/wx/src/bbwxHtmlWindow.h diff --git a/packages/wx/src/bbwxHtmlWindow.cxx b/packages/wx/src/bbwxHtmlWindow.cxx new file mode 100644 index 0000000..befc400 --- /dev/null +++ b/packages/wx/src/bbwxHtmlWindow.cxx @@ -0,0 +1,71 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbwxHtmlWindow.h" +#include "bbwxPackage.h" +#include + +namespace bbwx +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,HtmlWindow) +BBTK_BLACK_BOX_IMPLEMENTATION(HtmlWindow,bbtk::WxBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) + +//===== + + +void HtmlWindow::Process() +{ +/* + std::string msg; + if (bbGetInputTitle()!="") + { + msg = bbGetInputTitle()+": " + bbGetInputIn(); + } + else + { + msg = bbGetInputIn(); + } + ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); + */ + + wxHtmlWindow* html = (wxHtmlWindow*)bbGetOutputWidget(); + html->LoadPage( bbtk::std2wx( bbGetInputFileName() )); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HtmlWindow::CreateWidget(wxWindow* parent) +{ + +// bbSetOutputWidget( new wxStaticText ( parent , -1 , _T("") ) ); + bbSetOutputWidget( new wxHtmlWindow(parent, -1, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER) ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HtmlWindow::bbUserSetDefaultValues() +{ + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HtmlWindow::bbUserInitializeProcessing() +{ + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HtmlWindow::bbUserFinalizeProcessing() +{ + +} +} +// EO namespace bbwx + + diff --git a/packages/wx/src/bbwxHtmlWindow.h b/packages/wx/src/bbwxHtmlWindow.h new file mode 100644 index 0000000..3707c9c --- /dev/null +++ b/packages/wx/src/bbwxHtmlWindow.h @@ -0,0 +1,46 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifdef _USE_WXWIDGETS_ +#ifndef __bbwxHtmlWindow_h_INCLUDED__ +#define __bbwxHtmlWindow_h_INCLUDED__ +#include "bbwx_EXPORT.h" +#include "bbtkWxBlackBox.h" + +namespace bbwx +{ + +class bbwx_EXPORT HtmlWindow + : + public bbtk::WxBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(HtmlWindow,bbtk::WxBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_PROCESS(Process); + void Process(); + BBTK_CREATE_WIDGET(CreateWidget); + void CreateWidget(wxWindow*); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(HtmlWindow,bbtk::WxBlackBox); + BBTK_NAME("HtmlWindow"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("__CategoryBlackBox__"); + BBTK_INPUT(HtmlWindow,FileName,"Web page (.html)",std::string,""); +BBTK_END_DESCRIBE_BLACK_BOX(HtmlWindow); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbwx + +#endif // __bbwxHtmlWindow_h_INCLUDED__ +#endif // _USE_WXWIDGETS_ + -- 2.44.0