-#include "MyInstructionSet.hpp"\r
-#include "mof/ImageTileWidgetView.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/LayoutManager.hpp"\r
-#include "mof/Deleter.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include <boost/bind.hpp>\r
-#include "mof/EventScheduler.hpp"\r
-#include <list>\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/widgets.hpp"\r
-\r
-struct MyInstructionSet::Impl\r
-{\r
- std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;\r
- mof::EventScheduler scheduler;\r
- std::list<boost::shared_ptr<mof::MessageWidget> > messages;\r
- \r
- Impl()\r
- {\r
- }\r
- \r
- ~Impl()\r
- {\r
- }\r
- \r
- \r
-};\r
-\r
-MyInstructionSet::MyInstructionSet( )\r
-: m_pImpl(new Impl() )\r
-{\r
-}\r
-\r
-\r
-MyInstructionSet::~MyInstructionSet( )\r
-{\r
-}\r
-//{{{ createMessageWidget\r
-boost::shared_ptr<mof::MessageWidget>\r
-MyInstructionSet::createMessageWidget( ) \r
-{\r
- mof::LayoutManager* pLayout = new mof::LayoutManager( mof::LayoutManager::HORIZONTAL , 1);\r
- mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") );\r
- \r
- \r
- boost::shared_ptr<mof::MessageWidget> p\r
- (\r
- new mof::MessageWidget\r
- (\r
- pBackgroundView ,\r
- mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout\r
- )\r
- );\r
- \r
- m_pImpl->messages.push_back(p);\r
- return p;\r
- \r
-}\r
-//}}}\r
-//{{{ addMessageWidgetPage\r
-int\r
-MyInstructionSet::addMessageWidgetPage\r
-( \r
- boost::shared_ptr<mof::MessageWidget>& message , \r
- const mof::tstring &title , \r
- const mof::tstring &text\r
-) \r
-{\r
- mof::PageRequest page(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );\r
- message->addPage( page );\r
- return 30;// TODO \83y\81[\83W\8aJ\82\82Ì\82É\82©\82©\82é\8e\9e\8aÔ \r
-}\r
-//}}}\r
-\r
-void MyInstructionSet::inactive( boost::shared_ptr<mof::MessageWidget>& message ) \r
-{ \r
-\r
- /*mof::Deleter<mof::MessageWidget> del(message);\r
- \r
- m_pImpl->inactiveResources.push_back(del.getWeak());\r
- m_pImpl->scheduler.addEvent( 40 , del );*/\r
- //m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );\r
-}\r
-\r
-void MyInstructionSet::update( )\r
-{\r
- m_pImpl->scheduler.update( );\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->update();\r
- }\r
-}\r
- \r
-void MyInstructionSet::draw() const\r
-{\r
- foreach(boost::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )\r
- {\r
- resource->draw();\r
- }\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->draw();\r
- }\r
-}\r
-\r
- \r
+#include "MyInstructionSet.hpp"
+#include "mof/ImageTileWidgetView.hpp"
+#include "mof/utilities.hpp"
+#include "mof/LayoutManager.hpp"
+#include "mof/Deleter.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include <boost/bind.hpp>
+#include "mof/EventScheduler.hpp"
+#include <list>
+#include "mof/ConsoleIO.hpp"
+#include "mof/widgets.hpp"
+
+struct MyInstructionSet::Impl
+{
+ std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;
+ mof::EventScheduler scheduler;
+ std::list<boost::shared_ptr<mof::MessageWidget> > messages;
+
+ Impl()
+ {
+ }
+
+ ~Impl()
+ {
+ }
+
+
+};
+
+MyInstructionSet::MyInstructionSet( )
+: m_pImpl(new Impl() )
+{
+}
+
+
+MyInstructionSet::~MyInstructionSet( )
+{
+}
+//{{{ createMessageWidget
+boost::shared_ptr<mof::MessageWidget>
+MyInstructionSet::createMessageWidget( )
+{
+ mof::LayoutManager* pLayout = new mof::LayoutManager( mof::LayoutManager::HORIZONTAL , 1);
+ mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") );
+
+
+ boost::shared_ptr<mof::MessageWidget> p
+ (
+ new mof::MessageWidget
+ (
+ pBackgroundView ,
+ mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout
+ )
+ );
+
+ m_pImpl->messages.push_back(p);
+ return p;
+
+}
+//}}}
+//{{{ addMessageWidgetPage
+int
+MyInstructionSet::addMessageWidgetPage
+(
+ boost::shared_ptr<mof::MessageWidget>& message ,
+ const mof::tstring &title ,
+ const mof::tstring &text
+)
+{
+ mof::PageRequest page(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );
+ message->addPage( page );
+ return 30;// TODO \83y\81[\83W\8aJ\82\82Ì\82É\82©\82©\82é\8e\9e\8aÔ
+}
+//}}}
+
+void MyInstructionSet::inactive( boost::shared_ptr<mof::MessageWidget>& message )
+{
+
+ /*mof::Deleter<mof::MessageWidget> del(message);
+
+ m_pImpl->inactiveResources.push_back(del.getWeak());
+ m_pImpl->scheduler.addEvent( 40 , del );*/
+ //m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );
+}
+
+void MyInstructionSet::update( )
+{
+ m_pImpl->scheduler.update( );
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->update();
+ }
+}
+
+void MyInstructionSet::draw() const
+{
+ foreach(boost::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )
+ {
+ resource->draw();
+ }
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->draw();
+ }
+}
+
+