40 #ifndef _uiuimanager_cpp
41 #define _uiuimanager_cpp
43 #include "UI/uimanager.h"
44 #include "UI/textureatlashandler.h"
45 #include "UI/textureatlas.h"
46 #include "UI/hotkeyhandler.h"
47 #include "UI/actionhandler.h"
48 #include "UI/screen.h"
49 #include "UI/button.h"
50 #include "UI/widget.h"
54 #include "UI/defaultmarkupparser.h"
56 #include "Graphics/cameramanager.h"
57 #include "Graphics/graphicsmanager.h"
58 #include "Graphics/viewport.h"
59 #include "Input/inputmanager.h"
60 #include "Input/mouse.h"
61 #include "eventmanager.h"
72 template<> UI::UIManager* Singleton<UI::UIManager>::SingletonPtr = NULL;
86 TargetManager(Target) { }
104 WidgetUpdateWork(NULL),
105 ThreadResources(NULL),
107 ButtonAutoRegister(false),
127 WidgetUpdateWork(NULL),
128 ThreadResources(NULL),
130 ButtonAutoRegister(false),
290 Screen* MezzScreen =
new Screen(ScreenName,Atlas,WindowViewport,
this);
291 this->
Screens.push_back(MezzScreen);
299 if ( Name == (*it)->GetName() ) {
300 Screen* MezzScreen = (*it);
321 if( Screen == (*it) ) {
342 if( (*ScreenIt)->GetViewport() == WindowViewport ) {
360 if( (*ScreenIt)->GetViewport() == WindowViewport ) {
378 if( (*ScreenIt)->GetViewport() == WindowViewport && (*ScreenIt)->IsVisible() ) {
451 this->
MarkupParsers.insert( std::pair<String,UI::MarkupParser*>(ParserName,ToAdd) );
464 if( MarkupIt != this->
MarkupParsers.end() )
return (*MarkupIt).second;
484 delete (*MarkupIt).second;
493 delete (*MarkupIt).second;
517 case Input::MOUSEHORIZONTAL:
518 case Input::MOUSEVERTICAL:
532 if( VisScreen != NULL ) {
551 TextureAtlas::FontDataContainer& Fonts = TheAtlas->
GetFonts();
552 String LargerMatch, SmallerMatch;
553 Real LargerHeight = 0;
554 Real SmallerHeight = 0;
555 Real LargerMatchDiff = 1000000.0;
556 Real SmallerMatchDiff = 1000000.0;
557 Real RequestedHeight = (
Real)Height;
559 for( TextureAtlas::FontDataIterator it = Fonts.begin() ; it != Fonts.end() ; it++ )
562 if((*it).second->GetLineHeight() > RequestedHeight)
564 Diff = (*it).second->GetLineHeight() - RequestedHeight;
565 if(Diff < LargerMatchDiff)
567 LargerMatch = (*it).first;
568 LargerHeight = (*it).second->GetLineHeight();
569 LargerMatchDiff = Diff;
573 Diff = RequestedHeight - (*it).second->GetLineHeight();
574 if(Diff < SmallerMatchDiff)
576 SmallerMatch = (*it).first;
577 SmallerHeight = (*it).second->GetLineHeight();
578 SmallerMatchDiff = Diff;
585 if(!LargerMatch.empty())
587 Scale = RequestedHeight / LargerHeight;
590 Scale = RequestedHeight / SmallerHeight;
601 (*ScIt)->CheckViewportSize();
606 for( ConstMetaCodeIterator MCIt = Inputs.begin() ; MCIt != Inputs.end() ; ++MCIt )
688 {
return ManagerBase::MT_UIManager; }
691 {
return "DefaultUIManager"; }
703 {
return "DefaultUIManager"; }
722 {
delete ToBeDestroyed; }