1 #include "widget/createMenuView.hpp"
2 #include <mof/widgets.hpp>
3 #include "widget/HighlightButtonView.hpp"
4 #include <mof/FactoryMethod.hpp>
5 #include <mof/Font.hpp>
6 #include <mof/utilities.hpp>
7 #include "configure.hpp"
8 #include "resource.hpp"
9 #include <mof/widget/TextCompiler.hpp>
11 using mof::widget::WidgetView;
12 using mof::widget::ImageView;
16 std::shared_ptr<mof::widget::AbstractTextCompiler> text_compiler;
19 mof::FactoryMethod<WidgetView> createMenuView(const mof::tstring& text, bool is_disable_item)
21 //using namespace mof::widget;
23 if (text_compiler.get() == NULL) {
24 text_compiler = std::make_shared<mof::widget::TextCompiler>
26 mof::Font(FONT_NAME_UME, FONT_SIZE_STANDARD),
27 [] (const mof::tstring& path) { return ::getTextureResourceManager(::SYSTEM)->getResource(path);}
30 text_compiler->setBehaviorOnColor
32 mof::widget::AbstractTextCompiler::PAGE_OPEN,
33 mof::makeConstantHandler(mof::Color4f(1, 1, 1, 1)),
37 text_compiler->setBehaviorOnColor
39 mof::widget::AbstractTextCompiler::PAGE_CLOSE,
40 mof::makeConstantHandler(mof::Color4f(1, 1, 1, 1)),
45 return mof::makeFactoryMethod<HighlightButtonView>
47 [text]() {return text_compiler->compile_d(text).release();},