mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 13:09:42 +00:00
Merge remote branch 'scrawl/mygui' into mygui
This commit is contained in:
commit
47bcbdef17
355 changed files with 1090 additions and 50011 deletions
|
@ -177,7 +177,6 @@ include_directories(${UUID_INCLUDE_DIR})
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
if (MSVC10)
|
if (MSVC10)
|
||||||
set(PLATFORM_INCLUDE_DIR "")
|
set(PLATFORM_INCLUDE_DIR "")
|
||||||
add_definitions(-DMYGUI_DONT_REPLACE_NULLPTR)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -192,6 +191,7 @@ find_package (Threads)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(OGRE REQUIRED)
|
find_package(OGRE REQUIRED)
|
||||||
|
find_package(MyGUI REQUIRED)
|
||||||
find_package(Boost REQUIRED COMPONENTS system filesystem program_options thread)
|
find_package(Boost REQUIRED COMPONENTS system filesystem program_options thread)
|
||||||
find_package(OIS REQUIRED)
|
find_package(OIS REQUIRED)
|
||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
|
@ -208,14 +208,14 @@ include_directories("."
|
||||||
${OGRE_INCLUDE_DIR} ${OGRE_INCLUDE_DIR}/Ogre ${OGRE_INCLUDE_DIR}/OGRE ${OGRE_PLUGIN_INCLUDE_DIRS}
|
${OGRE_INCLUDE_DIR} ${OGRE_INCLUDE_DIR}/Ogre ${OGRE_INCLUDE_DIR}/OGRE ${OGRE_PLUGIN_INCLUDE_DIRS}
|
||||||
${OIS_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}
|
${OIS_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}
|
||||||
${PLATFORM_INCLUDE_DIR}
|
${PLATFORM_INCLUDE_DIR}
|
||||||
${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/MyGUIEngine/include
|
${MYGUI_INCLUDE_DIRS}
|
||||||
${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/OgrePlatform/include
|
${MYGUI_PLATFORM_INCLUDE_DIRS}
|
||||||
${OPENAL_INCLUDE_DIR}
|
${OPENAL_INCLUDE_DIR}
|
||||||
${UUID_INCLUDE_DIR}
|
${UUID_INCLUDE_DIR}
|
||||||
${LIBDIR}
|
${LIBDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
|
link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR} ${MYGUI_LIB_DIR})
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# List used Ogre plugins
|
# List used Ogre plugins
|
||||||
|
@ -225,14 +225,7 @@ if(APPLE)
|
||||||
"Plugin_ParticleFX")
|
"Plugin_ParticleFX")
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
add_subdirectory( extern/mygui_3.0.1 )
|
add_subdirectory( files/mygui )
|
||||||
|
|
||||||
# Make sure that certain libraries are used as static libraries
|
|
||||||
# This is in effect turns off __declspec (dllexport) for windows
|
|
||||||
# Each library will also need to be configured to build as a static lib
|
|
||||||
|
|
||||||
# MyGUI: extern/mygui_3.0.0/
|
|
||||||
add_definitions(-DMYGUI_STATIC)
|
|
||||||
|
|
||||||
# Specify build paths
|
# Specify build paths
|
||||||
|
|
||||||
|
|
|
@ -87,9 +87,9 @@ target_link_libraries(openmw
|
||||||
${OPENAL_LIBRARY}
|
${OPENAL_LIBRARY}
|
||||||
${SOUND_INPUT_LIBRARY}
|
${SOUND_INPUT_LIBRARY}
|
||||||
${BULLET_LIBRARIES}
|
${BULLET_LIBRARIES}
|
||||||
|
${MYGUI_LIBRARIES}
|
||||||
|
MyGUI.OgrePlatform #TODO MyGUI ogre platform is not added by the find script
|
||||||
components
|
components
|
||||||
MyGUIEngine
|
|
||||||
MyGUIOgrePlatform
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Fix for not visible pthreads functions for linker with glibc 2.15
|
# Fix for not visible pthreads functions for linker with glibc 2.15
|
||||||
|
|
|
@ -21,18 +21,18 @@ BirthDialog::BirthDialog(WindowManager& parWindowManager)
|
||||||
|
|
||||||
getWidget(birthList, "BirthsignList");
|
getWidget(birthList, "BirthsignList");
|
||||||
birthList->setScrollVisible(true);
|
birthList->setScrollVisible(true);
|
||||||
birthList->eventListSelectAccept = MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
|
birthList->eventListSelectAccept += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
|
||||||
birthList->eventListMouseItemActivate = MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
|
birthList->eventListMouseItemActivate += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
|
||||||
birthList->eventListChangePosition = MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
|
birthList->eventListChangePosition += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr backButton;
|
MyGUI::ButtonPtr backButton;
|
||||||
getWidget(backButton, "BackButton");
|
getWidget(backButton, "BackButton");
|
||||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &BirthDialog::onBackClicked);
|
backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onBackClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
|
||||||
|
|
||||||
updateBirths();
|
updateBirths();
|
||||||
updateSpells();
|
updateSpells();
|
||||||
|
@ -100,7 +100,7 @@ void BirthDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||||
eventBack();
|
eventBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BirthDialog::onSelectBirth(MyGUI::List* _sender, size_t _index)
|
void BirthDialog::onSelectBirth(MyGUI::ListBox* _sender, size_t _index)
|
||||||
{
|
{
|
||||||
if (_index == MyGUI::ITEM_NONE)
|
if (_index == MyGUI::ITEM_NONE)
|
||||||
return;
|
return;
|
||||||
|
@ -188,7 +188,7 @@ void BirthDialog::updateSpells()
|
||||||
{
|
{
|
||||||
if (!categories[category].spells.empty())
|
if (!categories[category].spells.empty())
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr label = spellArea->createWidget<MyGUI::StaticText>("SandBrightText", coord, MyGUI::Align::Default, std::string("Label"));
|
MyGUI::TextBox* label = spellArea->createWidget<MyGUI::TextBox>("SandBrightText", coord, MyGUI::Align::Default, std::string("Label"));
|
||||||
label->setCaption(mWindowManager.getGameSettingString(categories[category].label, ""));
|
label->setCaption(mWindowManager.getGameSettingString(categories[category].label, ""));
|
||||||
spellItems.push_back(label);
|
spellItems.push_back(label);
|
||||||
coord.top += lineHeight;
|
coord.top += lineHeight;
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -40,7 +40,7 @@ namespace MWGui
|
||||||
EventHandle_Void eventBack;
|
EventHandle_Void eventBack;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onSelectBirth(MyGUI::List* _sender, size_t _index);
|
void onSelectBirth(MyGUI::ListBox* _sender, size_t _index);
|
||||||
|
|
||||||
void onOkClicked(MyGUI::Widget* _sender);
|
void onOkClicked(MyGUI::Widget* _sender);
|
||||||
void onBackClicked(MyGUI::Widget* _sender);
|
void onBackClicked(MyGUI::Widget* _sender);
|
||||||
|
@ -49,9 +49,9 @@ namespace MWGui
|
||||||
void updateBirths();
|
void updateBirths();
|
||||||
void updateSpells();
|
void updateSpells();
|
||||||
|
|
||||||
MyGUI::ListPtr birthList;
|
MyGUI::ListBox* birthList;
|
||||||
MyGUI::WidgetPtr spellArea;
|
MyGUI::WidgetPtr spellArea;
|
||||||
MyGUI::StaticImagePtr birthImage;
|
MyGUI::ImageBox* birthImage;
|
||||||
std::vector<MyGUI::WidgetPtr> spellItems;
|
std::vector<MyGUI::WidgetPtr> spellItems;
|
||||||
|
|
||||||
std::string currentBirthId;
|
std::string currentBirthId;
|
||||||
|
|
|
@ -121,7 +121,7 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
|
mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
|
||||||
mNameDialog->setTextInput(mPlayerName);
|
mNameDialog->setTextInput(mPlayerName);
|
||||||
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
||||||
mNameDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
||||||
mNameDialog->open();
|
mNameDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -131,8 +131,8 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mRaceDialog = new RaceDialog(*mWM);
|
mRaceDialog = new RaceDialog(*mWM);
|
||||||
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
||||||
mRaceDialog->setRaceId(mPlayerRaceId);
|
mRaceDialog->setRaceId(mPlayerRaceId);
|
||||||
mRaceDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
||||||
mRaceDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
|
mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
|
||||||
mRaceDialog->open();
|
mRaceDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
if (mClassChoiceDialog)
|
if (mClassChoiceDialog)
|
||||||
mWM->removeDialog(mClassChoiceDialog);
|
mWM->removeDialog(mClassChoiceDialog);
|
||||||
mClassChoiceDialog = new ClassChoiceDialog(*mWM);
|
mClassChoiceDialog = new ClassChoiceDialog(*mWM);
|
||||||
mClassChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
||||||
mClassChoiceDialog->open();
|
mClassChoiceDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -150,8 +150,8 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mPickClassDialog = new PickClassDialog(*mWM);
|
mPickClassDialog = new PickClassDialog(*mWM);
|
||||||
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
||||||
mPickClassDialog->setClassId(mPlayerClass.name);
|
mPickClassDialog->setClassId(mPlayerClass.name);
|
||||||
mPickClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
||||||
mPickClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
|
mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
|
||||||
mPickClassDialog->open();
|
mPickClassDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -161,8 +161,8 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mBirthSignDialog = new BirthDialog(*mWM);
|
mBirthSignDialog = new BirthDialog(*mWM);
|
||||||
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
||||||
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
||||||
mBirthSignDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
||||||
mBirthSignDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
|
mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
|
||||||
mBirthSignDialog->open();
|
mBirthSignDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -170,8 +170,8 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
if (mCreateClassDialog)
|
if (mCreateClassDialog)
|
||||||
mWM->removeDialog(mCreateClassDialog);
|
mWM->removeDialog(mCreateClassDialog);
|
||||||
mCreateClassDialog = new CreateClassDialog(*mWM);
|
mCreateClassDialog = new CreateClassDialog(*mWM);
|
||||||
mCreateClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
||||||
mCreateClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
||||||
mCreateClassDialog->open();
|
mCreateClassDialog->open();
|
||||||
break;
|
break;
|
||||||
case GM_ClassGenerate:
|
case GM_ClassGenerate:
|
||||||
|
@ -212,9 +212,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mReviewDialog->configureSkills(mPlayerMajorSkills, mPlayerMinorSkills);
|
mReviewDialog->configureSkills(mPlayerMajorSkills, mPlayerMinorSkills);
|
||||||
}
|
}
|
||||||
|
|
||||||
mReviewDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
||||||
mReviewDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
|
mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
|
||||||
mReviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
|
mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
|
||||||
mReviewDialog->open();
|
mReviewDialog->open();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -559,8 +559,8 @@ void CharacterCreation::showClassQuestionDialog()
|
||||||
mWM->removeDialog(mGenerateClassResultDialog);
|
mWM->removeDialog(mGenerateClassResultDialog);
|
||||||
mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
|
mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
|
||||||
mGenerateClassResultDialog->setClassId(mGenerateClass);
|
mGenerateClassResultDialog->setClassId(mGenerateClass);
|
||||||
mGenerateClassResultDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
|
mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
|
||||||
mGenerateClassResultDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
|
mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
|
||||||
mGenerateClassResultDialog->open();
|
mGenerateClassResultDialog->open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -581,7 +581,7 @@ void CharacterCreation::showClassQuestionDialog()
|
||||||
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[1]);
|
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[1]);
|
||||||
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]);
|
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]);
|
||||||
mGenerateClassQuestionDialog->setButtons(buttons);
|
mGenerateClassQuestionDialog->setButtons(buttons);
|
||||||
mGenerateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
|
mGenerateClassQuestionDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
|
||||||
mGenerateClassQuestionDialog->open();
|
mGenerateClassQuestionDialog->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,11 @@ GenerateClassResultDialog::GenerateClassResultDialog(WindowManager& parWindowMan
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr backButton;
|
MyGUI::ButtonPtr backButton;
|
||||||
getWidget(backButton, "BackButton");
|
getWidget(backButton, "BackButton");
|
||||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &GenerateClassResultDialog::onBackClicked);
|
backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onBackClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateClassResultDialog::open()
|
void GenerateClassResultDialog::open()
|
||||||
|
@ -96,20 +96,20 @@ PickClassDialog::PickClassDialog(WindowManager& parWindowManager)
|
||||||
|
|
||||||
getWidget(classList, "ClassList");
|
getWidget(classList, "ClassList");
|
||||||
classList->setScrollVisible(true);
|
classList->setScrollVisible(true);
|
||||||
classList->eventListSelectAccept = MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
|
classList->eventListSelectAccept += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
|
||||||
classList->eventListMouseItemActivate = MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
|
classList->eventListMouseItemActivate += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
|
||||||
classList->eventListChangePosition = MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
|
classList->eventListChangePosition += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
|
||||||
|
|
||||||
getWidget(classImage, "ClassImage");
|
getWidget(classImage, "ClassImage");
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr backButton;
|
MyGUI::ButtonPtr backButton;
|
||||||
getWidget(backButton, "BackButton");
|
getWidget(backButton, "BackButton");
|
||||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &PickClassDialog::onBackClicked);
|
backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PickClassDialog::onBackClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &PickClassDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PickClassDialog::onOkClicked);
|
||||||
|
|
||||||
updateClasses();
|
updateClasses();
|
||||||
updateStats();
|
updateStats();
|
||||||
|
@ -177,7 +177,7 @@ void PickClassDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||||
eventBack();
|
eventBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickClassDialog::onSelectClass(MyGUI::List* _sender, size_t _index)
|
void PickClassDialog::onSelectClass(MyGUI::ListBox* _sender, size_t _index)
|
||||||
{
|
{
|
||||||
if (_index == MyGUI::ITEM_NONE)
|
if (_index == MyGUI::ITEM_NONE)
|
||||||
return;
|
return;
|
||||||
|
@ -248,7 +248,7 @@ void PickClassDialog::updateStats()
|
||||||
|
|
||||||
/* InfoBoxDialog */
|
/* InfoBoxDialog */
|
||||||
|
|
||||||
void InfoBoxDialog::fitToText(MyGUI::StaticTextPtr widget)
|
void InfoBoxDialog::fitToText(MyGUI::TextBox* widget)
|
||||||
{
|
{
|
||||||
MyGUI::IntCoord inner = widget->getTextRegion();
|
MyGUI::IntCoord inner = widget->getTextRegion();
|
||||||
MyGUI::IntCoord outer = widget->getCoord();
|
MyGUI::IntCoord outer = widget->getCoord();
|
||||||
|
@ -267,7 +267,7 @@ void InfoBoxDialog::layoutVertically(MyGUI::WidgetPtr widget, int margin)
|
||||||
for (unsigned i = 0; i < count; ++i)
|
for (unsigned i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
MyGUI::WidgetPtr child = widget->getChildAt(i);
|
MyGUI::WidgetPtr child = widget->getChildAt(i);
|
||||||
if (!child->isVisible())
|
if (!child->getVisible())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
child->setPosition(child->getLeft(), pos);
|
child->setPosition(child->getLeft(), pos);
|
||||||
|
@ -322,7 +322,7 @@ void InfoBoxDialog::setButtons(ButtonList &buttons)
|
||||||
button->getSubWidgetText()->setWordWrap(true);
|
button->getSubWidgetText()->setWordWrap(true);
|
||||||
button->setCaption(text);
|
button->setCaption(text);
|
||||||
fitToText(button);
|
fitToText(button);
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &InfoBoxDialog::onButtonClicked);
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &InfoBoxDialog::onButtonClicked);
|
||||||
coord.top += button->getHeight();
|
coord.top += button->getHeight();
|
||||||
this->buttons.push_back(button);
|
this->buttons.push_back(button);
|
||||||
}
|
}
|
||||||
|
@ -389,15 +389,15 @@ CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
|
||||||
setText("SpecializationT", mWindowManager.getGameSettingString("sChooseClassMenu1", "Specialization"));
|
setText("SpecializationT", mWindowManager.getGameSettingString("sChooseClassMenu1", "Specialization"));
|
||||||
getWidget(specializationName, "SpecializationName");
|
getWidget(specializationName, "SpecializationName");
|
||||||
specializationName->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
|
specializationName->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
|
||||||
specializationName->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
|
specializationName->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
|
||||||
|
|
||||||
setText("FavoriteAttributesT", mWindowManager.getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
|
setText("FavoriteAttributesT", mWindowManager.getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
|
||||||
getWidget(favoriteAttribute0, "FavoriteAttribute0");
|
getWidget(favoriteAttribute0, "FavoriteAttribute0");
|
||||||
getWidget(favoriteAttribute1, "FavoriteAttribute1");
|
getWidget(favoriteAttribute1, "FavoriteAttribute1");
|
||||||
favoriteAttribute0->setWindowManager(&mWindowManager);
|
favoriteAttribute0->setWindowManager(&mWindowManager);
|
||||||
favoriteAttribute1->setWindowManager(&mWindowManager);
|
favoriteAttribute1->setWindowManager(&mWindowManager);
|
||||||
favoriteAttribute0->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
favoriteAttribute0->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
||||||
favoriteAttribute1->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
favoriteAttribute1->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
||||||
|
|
||||||
setText("MajorSkillT", mWindowManager.getGameSettingString("sSkillClassMajor", ""));
|
setText("MajorSkillT", mWindowManager.getGameSettingString("sSkillClassMajor", ""));
|
||||||
setText("MinorSkillT", mWindowManager.getGameSettingString("sSkillClassMinor", ""));
|
setText("MinorSkillT", mWindowManager.getGameSettingString("sSkillClassMinor", ""));
|
||||||
|
@ -414,7 +414,7 @@ CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
|
||||||
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = skills.begin(); it != end; ++it)
|
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = skills.begin(); it != end; ++it)
|
||||||
{
|
{
|
||||||
(*it)->setWindowManager(&mWindowManager);
|
(*it)->setWindowManager(&mWindowManager);
|
||||||
(*it)->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
|
(*it)->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
setText("LabelT", mWindowManager.getGameSettingString("sName", ""));
|
setText("LabelT", mWindowManager.getGameSettingString("sName", ""));
|
||||||
|
@ -426,15 +426,15 @@ CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr descriptionButton;
|
MyGUI::ButtonPtr descriptionButton;
|
||||||
getWidget(descriptionButton, "DescriptionButton");
|
getWidget(descriptionButton, "DescriptionButton");
|
||||||
descriptionButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionClicked);
|
descriptionButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr backButton;
|
MyGUI::ButtonPtr backButton;
|
||||||
getWidget(backButton, "BackButton");
|
getWidget(backButton, "BackButton");
|
||||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onBackClicked);
|
backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onBackClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onOkClicked);
|
||||||
|
|
||||||
// Set default skills, attributes
|
// Set default skills, attributes
|
||||||
|
|
||||||
|
@ -560,8 +560,8 @@ void CreateClassDialog::onSpecializationClicked(MyGUI::WidgetPtr _sender)
|
||||||
if (specDialog)
|
if (specDialog)
|
||||||
delete specDialog;
|
delete specDialog;
|
||||||
specDialog = new SelectSpecializationDialog(mWindowManager);
|
specDialog = new SelectSpecializationDialog(mWindowManager);
|
||||||
specDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
specDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||||
specDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
|
specDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
|
||||||
specDialog->setVisible(true);
|
specDialog->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -578,8 +578,8 @@ void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
|
||||||
delete attribDialog;
|
delete attribDialog;
|
||||||
attribDialog = new SelectAttributeDialog(mWindowManager);
|
attribDialog = new SelectAttributeDialog(mWindowManager);
|
||||||
attribDialog->setAffectedWidget(_sender);
|
attribDialog->setAffectedWidget(_sender);
|
||||||
attribDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
attribDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||||
attribDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
|
attribDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
|
||||||
attribDialog->setVisible(true);
|
attribDialog->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,8 +607,8 @@ void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
|
||||||
delete skillDialog;
|
delete skillDialog;
|
||||||
skillDialog = new SelectSkillDialog(mWindowManager);
|
skillDialog = new SelectSkillDialog(mWindowManager);
|
||||||
skillDialog->setAffectedWidget(_sender);
|
skillDialog->setAffectedWidget(_sender);
|
||||||
skillDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
skillDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||||
skillDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
|
skillDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
|
||||||
skillDialog->setVisible(true);
|
skillDialog->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
descDialog = new DescriptionDialog(mWindowManager);
|
descDialog = new DescriptionDialog(mWindowManager);
|
||||||
descDialog->setTextInput(description);
|
descDialog->setTextInput(description);
|
||||||
descDialog->eventDone = MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
|
descDialog->eventDone += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
|
||||||
descDialog->setVisible(true);
|
descDialog->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,18 +672,18 @@ SelectSpecializationDialog::SelectSpecializationDialog(WindowManager& parWindowM
|
||||||
getWidget(specialization1, "Specialization1");
|
getWidget(specialization1, "Specialization1");
|
||||||
getWidget(specialization2, "Specialization2");
|
getWidget(specialization2, "Specialization2");
|
||||||
specialization0->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
|
specialization0->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
|
||||||
specialization0->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
specialization0->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||||
specialization1->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Magic], ""));
|
specialization1->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Magic], ""));
|
||||||
specialization1->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
specialization1->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||||
specialization2->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Stealth], ""));
|
specialization2->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Stealth], ""));
|
||||||
specialization2->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
specialization2->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||||
specializationId = ESM::Class::Combat;
|
specializationId = ESM::Class::Combat;
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr cancelButton;
|
MyGUI::ButtonPtr cancelButton;
|
||||||
getWidget(cancelButton, "CancelButton");
|
getWidget(cancelButton, "CancelButton");
|
||||||
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
||||||
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
// widget controls
|
// widget controls
|
||||||
|
@ -725,14 +725,14 @@ SelectAttributeDialog::SelectAttributeDialog(WindowManager& parWindowManager)
|
||||||
getWidget(attribute, std::string("Attribute").append(1, theIndex));
|
getWidget(attribute, std::string("Attribute").append(1, theIndex));
|
||||||
attribute->setWindowManager(&parWindowManager);
|
attribute->setWindowManager(&parWindowManager);
|
||||||
attribute->setAttributeId(ESM::Attribute::attributeIds[i]);
|
attribute->setAttributeId(ESM::Attribute::attributeIds[i]);
|
||||||
attribute->eventClicked = MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
|
attribute->eventClicked += MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr cancelButton;
|
MyGUI::ButtonPtr cancelButton;
|
||||||
getWidget(cancelButton, "CancelButton");
|
getWidget(cancelButton, "CancelButton");
|
||||||
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
||||||
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
// widget controls
|
// widget controls
|
||||||
|
@ -813,7 +813,7 @@ SelectSkillDialog::SelectSkillDialog(WindowManager& parWindowManager)
|
||||||
{
|
{
|
||||||
skills[spec][i].widget->setWindowManager(&mWindowManager);
|
skills[spec][i].widget->setWindowManager(&mWindowManager);
|
||||||
skills[spec][i].widget->setSkillId(skills[spec][i].skillId);
|
skills[spec][i].widget->setSkillId(skills[spec][i].skillId);
|
||||||
skills[spec][i].widget->eventClicked = MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
|
skills[spec][i].widget->eventClicked += MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ SelectSkillDialog::SelectSkillDialog(WindowManager& parWindowManager)
|
||||||
MyGUI::ButtonPtr cancelButton;
|
MyGUI::ButtonPtr cancelButton;
|
||||||
getWidget(cancelButton, "CancelButton");
|
getWidget(cancelButton, "CancelButton");
|
||||||
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
||||||
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
// widget controls
|
// widget controls
|
||||||
|
@ -850,7 +850,7 @@ DescriptionDialog::DescriptionDialog(WindowManager& parWindowManager)
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sInputMenu1", ""));
|
okButton->setCaption(mWindowManager.getGameSettingString("sInputMenu1", ""));
|
||||||
|
|
||||||
// Make sure the edit box has focus
|
// Make sure the edit box has focus
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace MWGui
|
||||||
int getChosenButton() const;
|
int getChosenButton() const;
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate1<int> EventHandle_Int;
|
typedef delegates::CMultiDelegate1<int> EventHandle_Int;
|
||||||
|
|
||||||
/** Event : Button was clicked.\n
|
/** Event : Button was clicked.\n
|
||||||
signature : void method(MyGUI::WidgetPtr widget, int index)\n
|
signature : void method(MyGUI::WidgetPtr widget, int index)\n
|
||||||
|
@ -43,11 +43,11 @@ namespace MWGui
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void fitToText(MyGUI::StaticTextPtr widget);
|
void fitToText(MyGUI::TextBox* widget);
|
||||||
void layoutVertically(MyGUI::WidgetPtr widget, int margin);
|
void layoutVertically(MyGUI::WidgetPtr widget, int margin);
|
||||||
int currentButton;
|
int currentButton;
|
||||||
MyGUI::WidgetPtr textBox;
|
MyGUI::WidgetPtr textBox;
|
||||||
MyGUI::StaticTextPtr text;
|
MyGUI::TextBox* text;
|
||||||
MyGUI::WidgetPtr buttonBar;
|
MyGUI::WidgetPtr buttonBar;
|
||||||
std::vector<MyGUI::ButtonPtr> buttons;
|
std::vector<MyGUI::ButtonPtr> buttons;
|
||||||
};
|
};
|
||||||
|
@ -78,7 +78,7 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -90,8 +90,8 @@ namespace MWGui
|
||||||
void onBackClicked(MyGUI::Widget* _sender);
|
void onBackClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::StaticImagePtr classImage;
|
MyGUI::ImageBox* classImage;
|
||||||
MyGUI::StaticTextPtr className;
|
MyGUI::TextBox* className;
|
||||||
|
|
||||||
std::string currentClassId;
|
std::string currentClassId;
|
||||||
};
|
};
|
||||||
|
@ -108,7 +108,7 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -116,7 +116,7 @@ namespace MWGui
|
||||||
EventHandle_Void eventBack;
|
EventHandle_Void eventBack;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onSelectClass(MyGUI::List* _sender, size_t _index);
|
void onSelectClass(MyGUI::ListBox* _sender, size_t _index);
|
||||||
|
|
||||||
void onOkClicked(MyGUI::Widget* _sender);
|
void onOkClicked(MyGUI::Widget* _sender);
|
||||||
void onBackClicked(MyGUI::Widget* _sender);
|
void onBackClicked(MyGUI::Widget* _sender);
|
||||||
|
@ -125,9 +125,9 @@ namespace MWGui
|
||||||
void updateClasses();
|
void updateClasses();
|
||||||
void updateStats();
|
void updateStats();
|
||||||
|
|
||||||
MyGUI::StaticImagePtr classImage;
|
MyGUI::ImageBox* classImage;
|
||||||
MyGUI::ListPtr classList;
|
MyGUI::ListBox* classList;
|
||||||
MyGUI::StaticTextPtr specializationName;
|
MyGUI::TextBox* specializationName;
|
||||||
Widgets::MWAttributePtr favoriteAttribute[2];
|
Widgets::MWAttributePtr favoriteAttribute[2];
|
||||||
Widgets::MWSkillPtr majorSkill[5];
|
Widgets::MWSkillPtr majorSkill[5];
|
||||||
Widgets::MWSkillPtr minorSkill[5];
|
Widgets::MWSkillPtr minorSkill[5];
|
||||||
|
@ -143,7 +143,7 @@ namespace MWGui
|
||||||
ESM::Class::Specialization getSpecializationId() const { return specializationId; }
|
ESM::Class::Specialization getSpecializationId() const { return specializationId; }
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Cancel button clicked.\n
|
/** Event : Cancel button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -160,7 +160,7 @@ namespace MWGui
|
||||||
void onCancelClicked(MyGUI::Widget* _sender);
|
void onCancelClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::WidgetPtr specialization0, specialization1, specialization2;
|
MyGUI::TextBox *specialization0, *specialization1, *specialization2;
|
||||||
|
|
||||||
ESM::Class::Specialization specializationId;
|
ESM::Class::Specialization specializationId;
|
||||||
};
|
};
|
||||||
|
@ -175,7 +175,7 @@ namespace MWGui
|
||||||
void setAffectedWidget(Widgets::MWAttributePtr widget) { affectedWidget = widget; }
|
void setAffectedWidget(Widgets::MWAttributePtr widget) { affectedWidget = widget; }
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Cancel button clicked.\n
|
/** Event : Cancel button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -207,7 +207,7 @@ namespace MWGui
|
||||||
void setAffectedWidget(Widgets::MWSkillPtr widget) { affectedWidget = widget; }
|
void setAffectedWidget(Widgets::MWSkillPtr widget) { affectedWidget = widget; }
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Cancel button clicked.\n
|
/** Event : Cancel button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -264,7 +264,7 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -287,7 +287,7 @@ namespace MWGui
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::EditPtr editName;
|
MyGUI::EditPtr editName;
|
||||||
MyGUI::WidgetPtr specializationName;
|
MyGUI::TextBox* specializationName;
|
||||||
Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1;
|
Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1;
|
||||||
Widgets::MWSkillPtr majorSkill[5];
|
Widgets::MWSkillPtr majorSkill[5];
|
||||||
Widgets::MWSkillPtr minorSkill[5];
|
Widgets::MWSkillPtr minorSkill[5];
|
||||||
|
|
|
@ -113,9 +113,9 @@ namespace MWGui
|
||||||
getWidget(history, "list_History");
|
getWidget(history, "list_History");
|
||||||
|
|
||||||
// Set up the command line box
|
// Set up the command line box
|
||||||
command->eventEditSelectAccept =
|
command->eventEditSelectAccept +=
|
||||||
newDelegate(this, &Console::acceptCommand);
|
newDelegate(this, &Console::acceptCommand);
|
||||||
command->eventKeyButtonPressed =
|
command->eventKeyButtonPressed +=
|
||||||
newDelegate(this, &Console::keyPress);
|
newDelegate(this, &Console::keyPress);
|
||||||
|
|
||||||
// Set up the log window
|
// Set up the log window
|
||||||
|
|
|
@ -49,18 +49,25 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environm
|
||||||
//History view
|
//History view
|
||||||
getWidget(history, "History");
|
getWidget(history, "History");
|
||||||
history->setOverflowToTheLeft(true);
|
history->setOverflowToTheLeft(true);
|
||||||
history->getClient()->eventMouseButtonClick = MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
|
|
||||||
history->setMaxTextLength(1000000);
|
history->setMaxTextLength(1000000);
|
||||||
|
Widget* eventbox;
|
||||||
|
|
||||||
|
//An EditBox cannot receive mouse click events, so we use an
|
||||||
|
//invisible widget on top of the editbox to receive them
|
||||||
|
/// \todo scrolling the dialogue history with the mouse wheel doesn't work using this solution
|
||||||
|
getWidget(eventbox, "EventBox");
|
||||||
|
eventbox->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
|
||||||
|
|
||||||
//Topics list
|
//Topics list
|
||||||
getWidget(topicsList, "TopicsList");
|
getWidget(topicsList, "TopicsList");
|
||||||
topicsList->setScrollVisible(true);
|
topicsList->setScrollVisible(true);
|
||||||
//topicsList->eventListSelectAccept = MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
|
//topicsList->eventListSelectAccept += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
|
||||||
topicsList->eventListMouseItemActivate = MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
|
topicsList->eventListMouseItemActivate += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
|
||||||
//topicsList->eventListChangePosition = MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
|
//topicsList->eventListChangePosition += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
|
||||||
|
|
||||||
MyGUI::ButtonPtr byeButton;
|
MyGUI::ButtonPtr byeButton;
|
||||||
getWidget(byeButton, "ByeButton");
|
getWidget(byeButton, "ByeButton");
|
||||||
byeButton->eventMouseButtonClick = MyGUI::newDelegate(this, &DialogueWindow::onByeClicked);
|
byeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onByeClicked);
|
||||||
|
|
||||||
getWidget(pDispositionBar, "Disposition");
|
getWidget(pDispositionBar, "Disposition");
|
||||||
getWidget(pDispositionText,"DispositionText");
|
getWidget(pDispositionText,"DispositionText");
|
||||||
|
@ -68,11 +75,11 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environm
|
||||||
|
|
||||||
void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
ISubWidgetText* t = history->getSubWidgetText();
|
ISubWidgetText* t = history->getClient()->getSubWidgetText();
|
||||||
if(t == nullptr)
|
if(t == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const IntPoint& lastPressed = InputManager::getInstance().getLastLeftPressed();
|
const IntPoint& lastPressed = InputManager::getInstance().getLastPressedPosition(MyGUI::MouseButton::Left);
|
||||||
|
|
||||||
size_t cursorPosition = t->getCursorPosition(lastPressed);
|
size_t cursorPosition = t->getCursorPosition(lastPressed);
|
||||||
MyGUI::UString color = history->getColorAtPos(cursorPosition);
|
MyGUI::UString color = history->getColorAtPos(cursorPosition);
|
||||||
|
@ -99,7 +106,7 @@ void DialogueWindow::onByeClicked(MyGUI::Widget* _sender)
|
||||||
mEnvironment.mDialogueManager->goodbyeSelected();
|
mEnvironment.mDialogueManager->goodbyeSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::onSelectTopic(MyGUI::List* _sender, size_t _index)
|
void DialogueWindow::onSelectTopic(MyGUI::ListBox* _sender, size_t _index)
|
||||||
{
|
{
|
||||||
if (_index == MyGUI::ITEM_NONE)
|
if (_index == MyGUI::ITEM_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace MWWorld
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class DialogeHistory;
|
class DialogueHistory;
|
||||||
|
|
||||||
using namespace MyGUI;
|
using namespace MyGUI;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Dialog finished, OK button clicked.\n
|
/** Event : Dialog finished, OK button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -49,7 +49,7 @@ namespace MWGui
|
||||||
void askQuestion(std::string question);
|
void askQuestion(std::string question);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onSelectTopic(MyGUI::List* _sender, size_t _index);
|
void onSelectTopic(MyGUI::ListBox* _sender, size_t _index);
|
||||||
void onByeClicked(MyGUI::Widget* _sender);
|
void onByeClicked(MyGUI::Widget* _sender);
|
||||||
void onHistoryClicked(MyGUI::Widget* _sender);
|
void onHistoryClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ namespace MWGui
|
||||||
*/
|
*/
|
||||||
std::string parseText(std::string text);
|
std::string parseText(std::string text);
|
||||||
|
|
||||||
DialogeHistory* history;
|
DialogueHistory* history;
|
||||||
MyGUI::ListPtr topicsList;
|
MyGUI::ListBox* topicsList;
|
||||||
MyGUI::ProgressPtr pDispositionBar;
|
MyGUI::ProgressPtr pDispositionBar;
|
||||||
MyGUI::EditPtr pDispositionText;
|
MyGUI::EditPtr pDispositionText;
|
||||||
std::map<std::string,std::string> pTopicsText;// this map links keyword and "real" text.
|
std::map<std::string,std::string> pTopicsText;// this map links keyword and "real" text.
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
using namespace Widgets;
|
using namespace Widgets;
|
||||||
|
|
||||||
UString DialogeHistory::getColorAtPos(size_t _pos)
|
UString DialogueHistory::getColorAtPos(size_t _pos)
|
||||||
{
|
{
|
||||||
UString colour = TextIterator::convertTagColour(mText->getTextColour());
|
UString colour = TextIterator::convertTagColour(getTextColour());
|
||||||
TextIterator iterator(mText->getCaption());
|
TextIterator iterator(getCaption());
|
||||||
while(iterator.moveNext())
|
while(iterator.moveNext())
|
||||||
{
|
{
|
||||||
size_t pos = iterator.getPosition();
|
size_t pos = iterator.getPosition();
|
||||||
|
@ -29,12 +29,12 @@ UString DialogeHistory::getColorAtPos(size_t _pos)
|
||||||
return colour;
|
return colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
UString DialogeHistory::getColorTextAt(size_t _pos)
|
UString DialogueHistory::getColorTextAt(size_t _pos)
|
||||||
{
|
{
|
||||||
bool breakOnNext = false;
|
bool breakOnNext = false;
|
||||||
UString colour = TextIterator::convertTagColour(mText->getTextColour());
|
UString colour = TextIterator::convertTagColour(getTextColour());
|
||||||
UString colour2 = colour;
|
UString colour2 = colour;
|
||||||
TextIterator iterator(mText->getCaption());
|
TextIterator iterator(getCaption());
|
||||||
TextIterator col_start = iterator;
|
TextIterator col_start = iterator;
|
||||||
while(iterator.moveNext())
|
while(iterator.moveNext())
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ UString DialogeHistory::getColorTextAt(size_t _pos)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogeHistory::addDialogHeading(const UString& parText)
|
void DialogueHistory::addDialogHeading(const UString& parText)
|
||||||
{
|
{
|
||||||
UString head("\n#D8C09A");
|
UString head("\n#D8C09A");
|
||||||
head.append(parText);
|
head.append(parText);
|
||||||
|
@ -67,7 +67,7 @@ void DialogeHistory::addDialogHeading(const UString& parText)
|
||||||
addText(head);
|
addText(head);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogeHistory::addDialogText(const UString& parText)
|
void DialogueHistory::addDialogText(const UString& parText)
|
||||||
{
|
{
|
||||||
addText(parText);
|
addText(parText);
|
||||||
addText("\n");
|
addText("\n");
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
using namespace MyGUI;
|
using namespace MyGUI;
|
||||||
class DialogeHistory : public MyGUI::Edit
|
class DialogueHistory : public MyGUI::EditBox
|
||||||
{
|
{
|
||||||
MYGUI_RTTI_DERIVED( DialogeHistory )
|
MYGUI_RTTI_DERIVED( DialogueHistory )
|
||||||
public:
|
public:
|
||||||
Widget* getClient() { return mClient; }
|
Widget* getClient() { return mClient; }
|
||||||
UString getColorAtPos(size_t _pos);
|
UString getColorAtPos(size_t _pos);
|
||||||
|
|
|
@ -89,9 +89,9 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
|
||||||
getWidget(mLeftTextWidget, "LeftText");
|
getWidget(mLeftTextWidget, "LeftText");
|
||||||
getWidget(mRightTextWidget, "RightText");
|
getWidget(mRightTextWidget, "RightText");
|
||||||
getWidget(mPrevBtn, "PrevPageBTN");
|
getWidget(mPrevBtn, "PrevPageBTN");
|
||||||
mPrevBtn->eventMouseButtonClick = MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyPrevPage);
|
mPrevBtn->eventMouseButtonClick += MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyPrevPage);
|
||||||
getWidget(mNextBtn, "NextPageBTN");
|
getWidget(mNextBtn, "NextPageBTN");
|
||||||
mNextBtn->eventMouseButtonClick = MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyNextPage);
|
mNextBtn->eventMouseButtonClick += MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyNextPage);
|
||||||
//MyGUI::ItemBox* list = new MyGUI::ItemBox();
|
//MyGUI::ItemBox* list = new MyGUI::ItemBox();
|
||||||
//list->addItem("qaq","aqzazaz");
|
//list->addItem("qaq","aqzazaz");
|
||||||
//mScrollerWidget->addChildItem(list);
|
//mScrollerWidget->addChildItem(list);
|
||||||
|
@ -111,7 +111,7 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
|
||||||
//displayLeftText(list.front());
|
//displayLeftText(list.front());
|
||||||
|
|
||||||
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
|
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
|
||||||
t->eventWindowChangeCoord = MyGUI::newDelegate(this, &JournalWindow::onWindowResize);
|
t->eventWindowChangeCoord += MyGUI::newDelegate(this, &JournalWindow::onWindowResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWGui::JournalWindow::open()
|
void MWGui::JournalWindow::open()
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace MWGui
|
||||||
static const int lineHeight;
|
static const int lineHeight;
|
||||||
|
|
||||||
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
||||||
MyGUI::VScrollPtr skillScrollerWidget;
|
MyGUI::ScrollBar* skillScrollerWidget;
|
||||||
int lastPos, clientHeight;
|
int lastPos, clientHeight;
|
||||||
MyGUI::EditPtr mLeftTextWidget;
|
MyGUI::EditPtr mLeftTextWidget;
|
||||||
MyGUI::EditPtr mRightTextWidget;
|
MyGUI::EditPtr mRightTextWidget;
|
||||||
|
|
|
@ -45,18 +45,18 @@ namespace MWGui
|
||||||
void setBatchCount(size_t count);
|
void setBatchCount(size_t count);
|
||||||
|
|
||||||
MyGUI::ProgressPtr health, magicka, stamina;
|
MyGUI::ProgressPtr health, magicka, stamina;
|
||||||
MyGUI::StaticImagePtr weapImage, spellImage;
|
MyGUI::ImageBox *weapImage, *spellImage;
|
||||||
MyGUI::ProgressPtr weapStatus, spellStatus;
|
MyGUI::ProgressPtr weapStatus, spellStatus;
|
||||||
MyGUI::WidgetPtr effectBox;
|
MyGUI::WidgetPtr effectBox;
|
||||||
MyGUI::StaticImagePtr effect1;
|
MyGUI::ImageBox* effect1;
|
||||||
MyGUI::StaticImagePtr minimap;
|
MyGUI::ImageBox* minimap;
|
||||||
MyGUI::StaticImagePtr compass;
|
MyGUI::ImageBox* compass;
|
||||||
MyGUI::StaticImagePtr crosshair;
|
MyGUI::ImageBox* crosshair;
|
||||||
|
|
||||||
MyGUI::WidgetPtr fpsbox;
|
MyGUI::WidgetPtr fpsbox;
|
||||||
MyGUI::StaticTextPtr fpscounter;
|
MyGUI::TextBox* fpscounter;
|
||||||
MyGUI::StaticTextPtr trianglecounter;
|
MyGUI::TextBox* trianglecounter;
|
||||||
MyGUI::StaticTextPtr batchcounter;
|
MyGUI::TextBox* batchcounter;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MapWindow : public OEngine::GUI::Layout
|
class MapWindow : public OEngine::GUI::Layout
|
||||||
|
@ -75,7 +75,7 @@ namespace MWGui
|
||||||
|
|
||||||
void setCellName(const std::string& cellName)
|
void setCellName(const std::string& cellName)
|
||||||
{
|
{
|
||||||
mMainWidget->setCaption(cellName);
|
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(cellName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ namespace MWGui
|
||||||
getWidget(avatar, "Avatar");
|
getWidget(avatar, "Avatar");
|
||||||
|
|
||||||
// Adjust armor rating text to bottom of avatar widget
|
// Adjust armor rating text to bottom of avatar widget
|
||||||
MyGUI::StaticTextPtr armor_rating;
|
MyGUI::TextBox* armor_rating;
|
||||||
getWidget(armor_rating, "ArmorRating");
|
getWidget(armor_rating, "ArmorRating");
|
||||||
armor_rating->setCaption("Armor: 11");
|
armor_rating->setCaption("Armor: 11");
|
||||||
MyGUI::IntCoord coord = armor_rating->getCoord();
|
MyGUI::IntCoord coord = armor_rating->getCoord();
|
||||||
|
@ -165,7 +165,7 @@ namespace MWGui
|
||||||
last_x += coord.width + margin;
|
last_x += coord.width + margin;
|
||||||
button_pt->setCoord(coord);
|
button_pt->setCoord(coord);
|
||||||
|
|
||||||
button_pt->eventMouseButtonClick = MyGUI::newDelegate(this, &InventoryWindow::onCategorySelected);
|
button_pt->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryWindow::onCategorySelected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,8 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin
|
||||||
|
|
||||||
mMessageWidget->setSize(size);
|
mMessageWidget->setSize(size);
|
||||||
|
|
||||||
MyGUI::IntSize textSize = mMessageWidget->_getTextSize();
|
MyGUI::IntSize textSize = mMessageWidget->getTextSize();
|
||||||
|
|
||||||
size.height = mHeight = textSize.height + 20; // this is the padding between the text and the box
|
size.height = mHeight = textSize.height + 20; // this is the padding between the text and the box
|
||||||
|
|
||||||
mMainWidget->setSize(size);
|
mMainWidget->setSize(size);
|
||||||
|
@ -176,7 +177,7 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin
|
||||||
|
|
||||||
void MessageBox::update (int height)
|
void MessageBox::update (int height)
|
||||||
{
|
{
|
||||||
MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
|
MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
MyGUI::IntCoord coord;
|
MyGUI::IntCoord coord;
|
||||||
coord.left = (gameWindowSize.width - mFixedWidth)/2;
|
coord.left = (gameWindowSize.width - mFixedWidth)/2;
|
||||||
coord.top = (gameWindowSize.height - mHeight - height - mBottomPadding);
|
coord.top = (gameWindowSize.height - mHeight - height - mBottomPadding);
|
||||||
|
@ -219,9 +220,9 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
||||||
mMessageWidget->setOverflowToTheLeft(true);
|
mMessageWidget->setOverflowToTheLeft(true);
|
||||||
mMessageWidget->addText(message);
|
mMessageWidget->addText(message);
|
||||||
|
|
||||||
MyGUI::IntSize textSize = mMessageWidget->_getTextSize();
|
MyGUI::IntSize textSize = mMessageWidget->getTextSize();
|
||||||
|
|
||||||
MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
|
MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
|
|
||||||
int biggestButtonWidth = 0;
|
int biggestButtonWidth = 0;
|
||||||
int buttonWidth = 0;
|
int buttonWidth = 0;
|
||||||
|
@ -239,13 +240,13 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
||||||
MyGUI::Align::Default);
|
MyGUI::Align::Default);
|
||||||
button->setCaption(*it);
|
button->setCaption(*it);
|
||||||
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed);
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed);
|
||||||
|
|
||||||
mButtons.push_back(button);
|
mButtons.push_back(button);
|
||||||
|
|
||||||
buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding;
|
buttonWidth = button->getTextSize().width + 2*buttonPadding + buttonLeftPadding;
|
||||||
buttonsWidth += buttonWidth;
|
buttonsWidth += buttonWidth;
|
||||||
buttonHeight = button->_getTextSize().height + 2*buttonPadding + buttonTopPadding;
|
buttonHeight = button->getTextSize().height + 2*buttonPadding + buttonTopPadding;
|
||||||
|
|
||||||
if(buttonWidth > biggestButtonWidth)
|
if(buttonWidth > biggestButtonWidth)
|
||||||
{
|
{
|
||||||
|
@ -299,8 +300,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
||||||
buttonCord.left = left;
|
buttonCord.left = left;
|
||||||
buttonCord.top = textSize.height + textButtonPadding;
|
buttonCord.top = textSize.height + textButtonPadding;
|
||||||
|
|
||||||
buttonSize.width = (*button)->_getTextSize().width + 2*buttonPadding;
|
buttonSize.width = (*button)->getTextSize().width + 2*buttonPadding;
|
||||||
buttonSize.height = (*button)->_getTextSize().height + 2*buttonPadding;
|
buttonSize.height = (*button)->getTextSize().height + 2*buttonPadding;
|
||||||
|
|
||||||
(*button)->setCoord(buttonCord);
|
(*button)->setCoord(buttonCord);
|
||||||
(*button)->setSize(buttonSize);
|
(*button)->setSize(buttonSize);
|
||||||
|
@ -347,8 +348,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
||||||
std::vector<MyGUI::ButtonPtr>::const_iterator button;
|
std::vector<MyGUI::ButtonPtr>::const_iterator button;
|
||||||
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
||||||
{
|
{
|
||||||
buttonSize.width = (*button)->_getTextSize().width + buttonPadding*2;
|
buttonSize.width = (*button)->getTextSize().width + buttonPadding*2;
|
||||||
buttonSize.height = (*button)->_getTextSize().height + buttonPadding*2;
|
buttonSize.height = (*button)->getTextSize().height + buttonPadding*2;
|
||||||
|
|
||||||
buttonCord.top = top;
|
buttonCord.top = top;
|
||||||
buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/
|
buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/
|
||||||
|
|
|
@ -34,7 +34,7 @@ RaceDialog::RaceDialog(WindowManager& parWindowManager)
|
||||||
headRotate->setScrollRange(50);
|
headRotate->setScrollRange(50);
|
||||||
headRotate->setScrollPosition(20);
|
headRotate->setScrollPosition(20);
|
||||||
headRotate->setScrollViewPage(10);
|
headRotate->setScrollViewPage(10);
|
||||||
headRotate->eventScrollChangePosition = MyGUI::newDelegate(this, &RaceDialog::onHeadRotate);
|
headRotate->eventScrollChangePosition += MyGUI::newDelegate(this, &RaceDialog::onHeadRotate);
|
||||||
|
|
||||||
// Set up next/previous buttons
|
// Set up next/previous buttons
|
||||||
MyGUI::ButtonPtr prevButton, nextButton;
|
MyGUI::ButtonPtr prevButton, nextButton;
|
||||||
|
@ -42,27 +42,27 @@ RaceDialog::RaceDialog(WindowManager& parWindowManager)
|
||||||
setText("GenderChoiceT", mWindowManager.getGameSettingString("sRaceMenu2", "Change Sex"));
|
setText("GenderChoiceT", mWindowManager.getGameSettingString("sRaceMenu2", "Change Sex"));
|
||||||
getWidget(prevButton, "PrevGenderButton");
|
getWidget(prevButton, "PrevGenderButton");
|
||||||
getWidget(nextButton, "NextGenderButton");
|
getWidget(nextButton, "NextGenderButton");
|
||||||
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
|
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
|
||||||
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
|
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
|
||||||
|
|
||||||
setText("FaceChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Face"));
|
setText("FaceChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Face"));
|
||||||
getWidget(prevButton, "PrevFaceButton");
|
getWidget(prevButton, "PrevFaceButton");
|
||||||
getWidget(nextButton, "NextFaceButton");
|
getWidget(nextButton, "NextFaceButton");
|
||||||
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
|
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
|
||||||
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
|
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
|
||||||
|
|
||||||
setText("HairChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Hair"));
|
setText("HairChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Hair"));
|
||||||
getWidget(prevButton, "PrevHairButton");
|
getWidget(prevButton, "PrevHairButton");
|
||||||
getWidget(nextButton, "NextHairButton");
|
getWidget(nextButton, "NextHairButton");
|
||||||
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
|
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
|
||||||
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
|
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
|
||||||
|
|
||||||
setText("RaceT", mWindowManager.getGameSettingString("sRaceMenu4", "Race"));
|
setText("RaceT", mWindowManager.getGameSettingString("sRaceMenu4", "Race"));
|
||||||
getWidget(raceList, "RaceList");
|
getWidget(raceList, "RaceList");
|
||||||
raceList->setScrollVisible(true);
|
raceList->setScrollVisible(true);
|
||||||
raceList->eventListSelectAccept = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
raceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
raceList->eventListMouseItemActivate = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
raceList->eventListMouseItemActivate += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
raceList->eventListChangePosition = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
raceList->eventListChangePosition += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
|
|
||||||
setText("SkillsT", mWindowManager.getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
|
setText("SkillsT", mWindowManager.getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
|
||||||
getWidget(skillList, "SkillList");
|
getWidget(skillList, "SkillList");
|
||||||
|
@ -72,11 +72,11 @@ RaceDialog::RaceDialog(WindowManager& parWindowManager)
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr backButton;
|
MyGUI::ButtonPtr backButton;
|
||||||
getWidget(backButton, "BackButton");
|
getWidget(backButton, "BackButton");
|
||||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onBackClicked);
|
backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onBackClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
|
||||||
|
|
||||||
updateRaces();
|
updateRaces();
|
||||||
updateSkills();
|
updateSkills();
|
||||||
|
@ -157,7 +157,7 @@ void RaceDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||||
eventBack();
|
eventBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RaceDialog::onHeadRotate(MyGUI::VScroll*, size_t _position)
|
void RaceDialog::onHeadRotate(MyGUI::ScrollBar*, size_t _position)
|
||||||
{
|
{
|
||||||
// TODO: Rotate head
|
// TODO: Rotate head
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ void RaceDialog::onSelectNextHair(MyGUI::Widget*)
|
||||||
hairIndex = wrap(hairIndex - 1, hairCount);
|
hairIndex = wrap(hairIndex - 1, hairCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RaceDialog::onSelectRace(MyGUI::List* _sender, size_t _index)
|
void RaceDialog::onSelectRace(MyGUI::ListBox* _sender, size_t _index)
|
||||||
{
|
{
|
||||||
if (_index == MyGUI::ITEM_NONE)
|
if (_index == MyGUI::ITEM_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -54,7 +54,7 @@ namespace MWGui
|
||||||
EventHandle_Void eventBack;
|
EventHandle_Void eventBack;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onHeadRotate(MyGUI::VScroll* _sender, size_t _position);
|
void onHeadRotate(MyGUI::ScrollBar* _sender, size_t _position);
|
||||||
|
|
||||||
void onSelectPreviousGender(MyGUI::Widget* _sender);
|
void onSelectPreviousGender(MyGUI::Widget* _sender);
|
||||||
void onSelectNextGender(MyGUI::Widget* _sender);
|
void onSelectNextGender(MyGUI::Widget* _sender);
|
||||||
|
@ -65,7 +65,7 @@ namespace MWGui
|
||||||
void onSelectPreviousHair(MyGUI::Widget* _sender);
|
void onSelectPreviousHair(MyGUI::Widget* _sender);
|
||||||
void onSelectNextHair(MyGUI::Widget* _sender);
|
void onSelectNextHair(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
void onSelectRace(MyGUI::List* _sender, size_t _index);
|
void onSelectRace(MyGUI::ListBox* _sender, size_t _index);
|
||||||
|
|
||||||
void onOkClicked(MyGUI::Widget* _sender);
|
void onOkClicked(MyGUI::Widget* _sender);
|
||||||
void onBackClicked(MyGUI::Widget* _sender);
|
void onBackClicked(MyGUI::Widget* _sender);
|
||||||
|
@ -76,8 +76,8 @@ namespace MWGui
|
||||||
void updateSpellPowers();
|
void updateSpellPowers();
|
||||||
|
|
||||||
MyGUI::CanvasPtr appearanceBox;
|
MyGUI::CanvasPtr appearanceBox;
|
||||||
MyGUI::ListPtr raceList;
|
MyGUI::ListBox* raceList;
|
||||||
MyGUI::HScrollPtr headRotate;
|
MyGUI::ScrollBar* headRotate;
|
||||||
|
|
||||||
MyGUI::WidgetPtr skillList;
|
MyGUI::WidgetPtr skillList;
|
||||||
std::vector<MyGUI::WidgetPtr> skillItems;
|
std::vector<MyGUI::WidgetPtr> skillItems;
|
||||||
|
|
|
@ -28,22 +28,22 @@ ReviewDialog::ReviewDialog(WindowManager& parWindowManager)
|
||||||
getWidget(nameWidget, "NameText");
|
getWidget(nameWidget, "NameText");
|
||||||
getWidget(button, "NameButton");
|
getWidget(button, "NameButton");
|
||||||
button->setCaption(mWindowManager.getGameSettingString("sName", ""));
|
button->setCaption(mWindowManager.getGameSettingString("sName", ""));
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onNameClicked);;
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onNameClicked);;
|
||||||
|
|
||||||
getWidget(raceWidget, "RaceText");
|
getWidget(raceWidget, "RaceText");
|
||||||
getWidget(button, "RaceButton");
|
getWidget(button, "RaceButton");
|
||||||
button->setCaption(mWindowManager.getGameSettingString("sRace", ""));
|
button->setCaption(mWindowManager.getGameSettingString("sRace", ""));
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onRaceClicked);;
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onRaceClicked);;
|
||||||
|
|
||||||
getWidget(classWidget, "ClassText");
|
getWidget(classWidget, "ClassText");
|
||||||
getWidget(button, "ClassButton");
|
getWidget(button, "ClassButton");
|
||||||
button->setCaption(mWindowManager.getGameSettingString("sClass", ""));
|
button->setCaption(mWindowManager.getGameSettingString("sClass", ""));
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onClassClicked);;
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onClassClicked);;
|
||||||
|
|
||||||
getWidget(birthSignWidget, "SignText");
|
getWidget(birthSignWidget, "SignText");
|
||||||
getWidget(button, "SignButton");
|
getWidget(button, "SignButton");
|
||||||
button->setCaption(mWindowManager.getGameSettingString("sBirthSign", ""));
|
button->setCaption(mWindowManager.getGameSettingString("sBirthSign", ""));
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onBirthSignClicked);;
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onBirthSignClicked);;
|
||||||
|
|
||||||
// Setup dynamic stats
|
// Setup dynamic stats
|
||||||
getWidget(health, "Health");
|
getWidget(health, "Health");
|
||||||
|
@ -75,25 +75,25 @@ ReviewDialog::ReviewDialog(WindowManager& parWindowManager)
|
||||||
getWidget(skillClientWidget, "SkillClient");
|
getWidget(skillClientWidget, "SkillClient");
|
||||||
getWidget(skillScrollerWidget, "SkillScroller");
|
getWidget(skillScrollerWidget, "SkillScroller");
|
||||||
|
|
||||||
skillScrollerWidget->eventScrollChangePosition = MyGUI::newDelegate(this, &ReviewDialog::onScrollChangePosition);
|
skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &ReviewDialog::onScrollChangePosition);
|
||||||
updateScroller();
|
updateScroller();
|
||||||
|
|
||||||
for (int i = 0; i < ESM::Skill::Length; ++i)
|
for (int i = 0; i < ESM::Skill::Length; ++i)
|
||||||
{
|
{
|
||||||
skillValues.insert(std::make_pair(i, MWMechanics::Stat<float>()));
|
skillValues.insert(std::make_pair(i, MWMechanics::Stat<float>()));
|
||||||
skillWidgetMap.insert(std::make_pair(i, static_cast<MyGUI::StaticText*> (0)));
|
skillWidgetMap.insert(std::make_pair(i, static_cast<MyGUI::TextBox*> (0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static_cast<MyGUI::WindowPtr>(mMainWidget)->eventWindowChangeCoord = MyGUI::newDelegate(this, &ReviewDialog::onWindowResize);
|
static_cast<MyGUI::WindowPtr>(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &ReviewDialog::onWindowResize);
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr backButton;
|
MyGUI::ButtonPtr backButton;
|
||||||
getWidget(backButton, "BackButton");
|
getWidget(backButton, "BackButton");
|
||||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onBackClicked);
|
backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onBackClicked);
|
||||||
|
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onOkClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReviewDialog::open()
|
void ReviewDialog::open()
|
||||||
|
@ -102,7 +102,7 @@ void ReviewDialog::open()
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReviewDialog::onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos)
|
void ReviewDialog::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos)
|
||||||
{
|
{
|
||||||
int diff = lastPos - pos;
|
int diff = lastPos - pos;
|
||||||
// Adjust position of all widget according to difference
|
// Adjust position of all widget according to difference
|
||||||
|
@ -176,7 +176,7 @@ void ReviewDialog::setAttribute(ESM::Attribute::AttributeID attributeId, const M
|
||||||
void ReviewDialog::setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::Stat<float>& value)
|
void ReviewDialog::setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::Stat<float>& value)
|
||||||
{
|
{
|
||||||
skillValues[skillId] = value;
|
skillValues[skillId] = value;
|
||||||
MyGUI::StaticTextPtr widget = skillWidgetMap[skillId];
|
MyGUI::TextBox* widget = skillWidgetMap[skillId];
|
||||||
if (widget)
|
if (widget)
|
||||||
{
|
{
|
||||||
float modified = value.getModified(), base = value.getBase();
|
float modified = value.getModified(), base = value.getBase();
|
||||||
|
@ -210,7 +210,7 @@ void ReviewDialog::configureSkills(const std::vector<int>& major, const std::vec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReviewDialog::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value)
|
void ReviewDialog::setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value)
|
||||||
{
|
{
|
||||||
widget->setCaption(value);
|
widget->setCaption(value);
|
||||||
if (style == CS_Super)
|
if (style == CS_Super)
|
||||||
|
@ -223,7 +223,7 @@ void ReviewDialog::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style,
|
||||||
|
|
||||||
void ReviewDialog::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void ReviewDialog::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticImagePtr separator = skillClientWidget->createWidget<MyGUI::StaticImage>("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
|
MyGUI::ImageBox* separator = skillClientWidget->createWidget<MyGUI::ImageBox>("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
|
||||||
skillWidgets.push_back(separator);
|
skillWidgets.push_back(separator);
|
||||||
|
|
||||||
coord1.top += separator->getHeight();
|
coord1.top += separator->getHeight();
|
||||||
|
@ -232,7 +232,7 @@ void ReviewDialog::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2
|
||||||
|
|
||||||
void ReviewDialog::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void ReviewDialog::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr groupWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
|
MyGUI::TextBox* groupWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
|
||||||
groupWidget->setCaption(label);
|
groupWidget->setCaption(label);
|
||||||
skillWidgets.push_back(groupWidget);
|
skillWidgets.push_back(groupWidget);
|
||||||
|
|
||||||
|
@ -240,14 +240,15 @@ void ReviewDialog::addGroup(const std::string &label, MyGUI::IntCoord &coord1, M
|
||||||
coord2.top += lineHeight;
|
coord2.top += lineHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGUI::StaticTextPtr ReviewDialog::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
MyGUI::TextBox* ReviewDialog::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr skillNameWidget, skillValueWidget;
|
MyGUI::TextBox* skillNameWidget;
|
||||||
|
MyGUI::TextBox* skillValueWidget;
|
||||||
|
|
||||||
skillNameWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default);
|
skillNameWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandText", coord1, MyGUI::Align::Default);
|
||||||
skillNameWidget->setCaption(text);
|
skillNameWidget->setCaption(text);
|
||||||
|
|
||||||
skillValueWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandTextRight", coord2, MyGUI::Align::Default);
|
skillValueWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Default);
|
||||||
setStyledText(skillValueWidget, style, value);
|
setStyledText(skillValueWidget, style, value);
|
||||||
|
|
||||||
skillWidgets.push_back(skillNameWidget);
|
skillWidgets.push_back(skillNameWidget);
|
||||||
|
@ -261,9 +262,9 @@ MyGUI::StaticTextPtr ReviewDialog::addValueItem(const std::string text, const st
|
||||||
|
|
||||||
void ReviewDialog::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void ReviewDialog::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr skillNameWidget;
|
MyGUI::TextBox* skillNameWidget;
|
||||||
|
|
||||||
skillNameWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
|
skillNameWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
|
||||||
skillNameWidget->setCaption(text);
|
skillNameWidget->setCaption(text);
|
||||||
|
|
||||||
skillWidgets.push_back(skillNameWidget);
|
skillWidgets.push_back(skillNameWidget);
|
||||||
|
@ -299,7 +300,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId
|
||||||
style = CS_Super;
|
style = CS_Super;
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
style = CS_Sub;
|
style = CS_Sub;
|
||||||
MyGUI::StaticTextPtr widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), style, coord1, coord2);
|
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), style, coord1, coord2);
|
||||||
skillWidgetMap[skillId] = widget;
|
skillWidgetMap[skillId] = widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ namespace MWGui
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
typedef delegates::CDelegate1<int> EventHandle_Int;
|
typedef delegates::CMultiDelegate1<int> EventHandle_Int;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -75,23 +75,23 @@ namespace MWGui
|
||||||
CS_Normal,
|
CS_Normal,
|
||||||
CS_Super
|
CS_Super
|
||||||
};
|
};
|
||||||
void setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value);
|
void setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value);
|
||||||
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
MyGUI::StaticTextPtr addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
MyGUI::TextBox* addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void updateScroller();
|
void updateScroller();
|
||||||
void updateSkillArea();
|
void updateSkillArea();
|
||||||
|
|
||||||
void onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos);
|
void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
|
||||||
void onWindowResize(MyGUI::Window* window);
|
void onWindowResize(MyGUI::Window* window);
|
||||||
|
|
||||||
static const int lineHeight;
|
static const int lineHeight;
|
||||||
|
|
||||||
MyGUI::StaticTextPtr nameWidget, raceWidget, classWidget, birthSignWidget;
|
MyGUI::TextBox *nameWidget, *raceWidget, *classWidget, *birthSignWidget;
|
||||||
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
||||||
MyGUI::VScrollPtr skillScrollerWidget;
|
MyGUI::ScrollBar* skillScrollerWidget;
|
||||||
int lastPos, clientHeight;
|
int lastPos, clientHeight;
|
||||||
|
|
||||||
Widgets::MWDynamicStatPtr health, magicka, fatigue;
|
Widgets::MWDynamicStatPtr health, magicka, fatigue;
|
||||||
|
@ -100,7 +100,7 @@ namespace MWGui
|
||||||
|
|
||||||
SkillList majorSkills, minorSkills, miscSkills;
|
SkillList majorSkills, minorSkills, miscSkills;
|
||||||
std::map<int, MWMechanics::Stat<float> > skillValues;
|
std::map<int, MWMechanics::Stat<float> > skillValues;
|
||||||
std::map<int, MyGUI::StaticTextPtr> skillWidgetMap;
|
std::map<int, MyGUI::TextBox*> skillWidgetMap;
|
||||||
std::string name, raceId, birthSignId;
|
std::string name, raceId, birthSignId;
|
||||||
ESM::Class klass;
|
ESM::Class klass;
|
||||||
std::vector<MyGUI::WidgetPtr> skillWidgets; //< Skills and other information
|
std::vector<MyGUI::WidgetPtr> skillWidgets; //< Skills and other information
|
||||||
|
|
|
@ -48,20 +48,20 @@ StatsWindow::StatsWindow (WindowManager& parWindowManager)
|
||||||
getWidget(skillClientWidget, "SkillClient");
|
getWidget(skillClientWidget, "SkillClient");
|
||||||
getWidget(skillScrollerWidget, "SkillScroller");
|
getWidget(skillScrollerWidget, "SkillScroller");
|
||||||
|
|
||||||
skillScrollerWidget->eventScrollChangePosition = MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition);
|
skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition);
|
||||||
updateScroller();
|
updateScroller();
|
||||||
|
|
||||||
for (int i = 0; i < ESM::Skill::Length; ++i)
|
for (int i = 0; i < ESM::Skill::Length; ++i)
|
||||||
{
|
{
|
||||||
skillValues.insert(std::pair<int, MWMechanics::Stat<float> >(i, MWMechanics::Stat<float>()));
|
skillValues.insert(std::pair<int, MWMechanics::Stat<float> >(i, MWMechanics::Stat<float>()));
|
||||||
skillWidgetMap.insert(std::pair<int, MyGUI::StaticTextPtr>(i, nullptr));
|
skillWidgetMap.insert(std::pair<int, MyGUI::TextBox*>(i, nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
|
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
|
||||||
t->eventWindowChangeCoord = MyGUI::newDelegate(this, &StatsWindow::onWindowResize);
|
t->eventWindowChangeCoord += MyGUI::newDelegate(this, &StatsWindow::onWindowResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatsWindow::onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos)
|
void StatsWindow::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos)
|
||||||
{
|
{
|
||||||
int diff = lastPos - pos;
|
int diff = lastPos - pos;
|
||||||
// Adjust position of all widget according to difference
|
// Adjust position of all widget according to difference
|
||||||
|
@ -95,10 +95,10 @@ void StatsWindow::setBar(const std::string& name, const std::string& tname, int
|
||||||
|
|
||||||
void StatsWindow::setPlayerName(const std::string& playerName)
|
void StatsWindow::setPlayerName(const std::string& playerName)
|
||||||
{
|
{
|
||||||
mMainWidget->setCaption(playerName);
|
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(playerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatsWindow::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value)
|
void StatsWindow::setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value)
|
||||||
{
|
{
|
||||||
widget->setCaption(value);
|
widget->setCaption(value);
|
||||||
if (style == CS_Super)
|
if (style == CS_Super)
|
||||||
|
@ -175,7 +175,7 @@ void StatsWindow::setValue (const std::string& id, int value)
|
||||||
void StatsWindow::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value)
|
void StatsWindow::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value)
|
||||||
{
|
{
|
||||||
skillValues[parSkill] = value;
|
skillValues[parSkill] = value;
|
||||||
MyGUI::StaticTextPtr widget = skillWidgetMap[(int)parSkill];
|
MyGUI::TextBox* widget = skillWidgetMap[(int)parSkill];
|
||||||
if (widget)
|
if (widget)
|
||||||
{
|
{
|
||||||
float modified = value.getModified(), base = value.getBase();
|
float modified = value.getModified(), base = value.getBase();
|
||||||
|
@ -221,7 +221,7 @@ void StatsWindow::setBirthSign (const std::string& signId)
|
||||||
|
|
||||||
void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticImagePtr separator = skillClientWidget->createWidget<MyGUI::StaticImage>("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
|
MyGUI::ImageBox* separator = skillClientWidget->createWidget<MyGUI::ImageBox>("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
|
||||||
skillWidgets.push_back(separator);
|
skillWidgets.push_back(separator);
|
||||||
|
|
||||||
coord1.top += separator->getHeight();
|
coord1.top += separator->getHeight();
|
||||||
|
@ -230,7 +230,7 @@ void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
|
|
||||||
void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr groupWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
|
MyGUI::TextBox* groupWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
|
||||||
groupWidget->setCaption(label);
|
groupWidget->setCaption(label);
|
||||||
skillWidgets.push_back(groupWidget);
|
skillWidgets.push_back(groupWidget);
|
||||||
|
|
||||||
|
@ -238,14 +238,14 @@ void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, My
|
||||||
coord2.top += lineHeight;
|
coord2.top += lineHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGUI::StaticTextPtr StatsWindow::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
MyGUI::TextBox* StatsWindow::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr skillNameWidget, skillValueWidget;
|
MyGUI::TextBox *skillNameWidget, *skillValueWidget;
|
||||||
|
|
||||||
skillNameWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default);
|
skillNameWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandText", coord1, MyGUI::Align::Default);
|
||||||
skillNameWidget->setCaption(text);
|
skillNameWidget->setCaption(text);
|
||||||
|
|
||||||
skillValueWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandTextRight", coord2, MyGUI::Align::Default);
|
skillValueWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Default);
|
||||||
setStyledText(skillValueWidget, style, value);
|
setStyledText(skillValueWidget, style, value);
|
||||||
|
|
||||||
skillWidgets.push_back(skillNameWidget);
|
skillWidgets.push_back(skillNameWidget);
|
||||||
|
@ -259,9 +259,9 @@ MyGUI::StaticTextPtr StatsWindow::addValueItem(const std::string text, const std
|
||||||
|
|
||||||
void StatsWindow::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void StatsWindow::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
{
|
{
|
||||||
MyGUI::StaticTextPtr skillNameWidget;
|
MyGUI::TextBox* skillNameWidget;
|
||||||
|
|
||||||
skillNameWidget = skillClientWidget->createWidget<MyGUI::StaticText>("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
|
skillNameWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
|
||||||
skillNameWidget->setCaption(text);
|
skillNameWidget->setCaption(text);
|
||||||
|
|
||||||
skillWidgets.push_back(skillNameWidget);
|
skillWidgets.push_back(skillNameWidget);
|
||||||
|
@ -297,7 +297,7 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
|
||||||
style = CS_Super;
|
style = CS_Super;
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
style = CS_Sub;
|
style = CS_Sub;
|
||||||
MyGUI::StaticTextPtr widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), style, coord1, coord2);
|
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), style, coord1, coord2);
|
||||||
skillWidgetMap[skillId] = widget;
|
skillWidgetMap[skillId] = widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,26 +49,26 @@ namespace MWGui
|
||||||
CS_Normal,
|
CS_Normal,
|
||||||
CS_Super
|
CS_Super
|
||||||
};
|
};
|
||||||
void setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value);
|
void setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value);
|
||||||
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
MyGUI::StaticTextPtr addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
MyGUI::TextBox* addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void updateScroller();
|
void updateScroller();
|
||||||
|
|
||||||
void onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos);
|
void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
|
||||||
void onWindowResize(MyGUI::Window* window);
|
void onWindowResize(MyGUI::Window* window);
|
||||||
|
|
||||||
static const int lineHeight;
|
static const int lineHeight;
|
||||||
|
|
||||||
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
||||||
MyGUI::VScrollPtr skillScrollerWidget;
|
MyGUI::ScrollBar* skillScrollerWidget;
|
||||||
int lastPos, clientHeight;
|
int lastPos, clientHeight;
|
||||||
|
|
||||||
SkillList majorSkills, minorSkills, miscSkills;
|
SkillList majorSkills, minorSkills, miscSkills;
|
||||||
std::map<int, MWMechanics::Stat<float> > skillValues;
|
std::map<int, MWMechanics::Stat<float> > skillValues;
|
||||||
std::map<int, MyGUI::StaticTextPtr> skillWidgetMap;
|
std::map<int, MyGUI::TextBox*> skillWidgetMap;
|
||||||
std::map<std::string, MyGUI::WidgetPtr> factionWidgetMap;
|
std::map<std::string, MyGUI::WidgetPtr> factionWidgetMap;
|
||||||
FactionList factions; ///< Stores a list of factions and the current rank
|
FactionList factions; ///< Stores a list of factions and the current rank
|
||||||
std::string birthSignId;
|
std::string birthSignId;
|
||||||
|
|
|
@ -10,12 +10,12 @@ TextInputDialog::TextInputDialog(WindowManager& parWindowManager)
|
||||||
center();
|
center();
|
||||||
|
|
||||||
getWidget(textEdit, "TextEdit");
|
getWidget(textEdit, "TextEdit");
|
||||||
textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted);
|
textEdit->eventEditSelectAccept += newDelegate(this, &TextInputDialog::onTextAccepted);
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
|
||||||
|
|
||||||
// Make sure the edit box has focus
|
// Make sure the edit box has focus
|
||||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
|
MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
|
||||||
|
|
|
@ -62,24 +62,24 @@ void MWSkill::updateWidgets()
|
||||||
{
|
{
|
||||||
if (skillId == ESM::Skill::Length)
|
if (skillId == ESM::Skill::Length)
|
||||||
{
|
{
|
||||||
skillNameWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(skillNameWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const std::string &name = manager->getGameSettingString(ESM::Skill::sSkillNameIds[skillId], "");
|
const std::string &name = manager->getGameSettingString(ESM::Skill::sSkillNameIds[skillId], "");
|
||||||
skillNameWidget->setCaption(name);
|
static_cast<MyGUI::TextBox*>(skillNameWidget)->setCaption(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skillValueWidget)
|
if (skillValueWidget)
|
||||||
{
|
{
|
||||||
SkillValue::Type modified = value.getModified(), base = value.getBase();
|
SkillValue::Type modified = value.getModified(), base = value.getBase();
|
||||||
skillValueWidget->setCaption(boost::lexical_cast<std::string>(modified));
|
static_cast<MyGUI::TextBox*>(skillValueWidget)->setCaption(boost::lexical_cast<std::string>(modified));
|
||||||
if (modified > base)
|
if (modified > base)
|
||||||
skillValueWidget->setState("increased");
|
skillValueWidget->_setWidgetState("increased");
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
skillValueWidget->setState("decreased");
|
skillValueWidget->_setWidgetState("decreased");
|
||||||
else
|
else
|
||||||
skillValueWidget->setState("normal");
|
skillValueWidget->_setWidgetState("normal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,59 +88,32 @@ void MWSkill::onClicked(MyGUI::Widget* _sender)
|
||||||
eventClicked(this);
|
eventClicked(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSkill::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
MWSkill::~MWSkill()
|
MWSkill::~MWSkill()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSkill::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWSkill::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSkill::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(skillNameWidget, "StatName");
|
||||||
|
assignWidget(skillValueWidget, "StatValue");
|
||||||
|
|
||||||
|
MyGUI::ButtonPtr button;
|
||||||
|
assignWidget(button, "StatNameButton");
|
||||||
|
if (button)
|
||||||
{
|
{
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "StatName")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
|
|
||||||
skillNameWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatValue")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
|
|
||||||
skillValueWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatNameButton")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
skillNameWidget = button;
|
skillNameWidget = button;
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWSkill::onClicked);
|
||||||
}
|
|
||||||
else if (name == "StatValueButton")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
skillNameWidget = button;
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSkill::shutdownWidgetSkin()
|
button = 0;
|
||||||
|
assignWidget(button, "StatValueButton");
|
||||||
|
if (button)
|
||||||
{
|
{
|
||||||
|
skillNameWidget = button;
|
||||||
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWSkill::onClicked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MWAttribute */
|
/* MWAttribute */
|
||||||
|
@ -176,7 +149,7 @@ void MWAttribute::updateWidgets()
|
||||||
{
|
{
|
||||||
if (id < 0 || id >= 8)
|
if (id < 0 || id >= 8)
|
||||||
{
|
{
|
||||||
attributeNameWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(attributeNameWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -191,75 +164,48 @@ void MWAttribute::updateWidgets()
|
||||||
"sAttributeLuck"
|
"sAttributeLuck"
|
||||||
};
|
};
|
||||||
const std::string &name = manager->getGameSettingString(attributes[id], "");
|
const std::string &name = manager->getGameSettingString(attributes[id], "");
|
||||||
attributeNameWidget->setCaption(name);
|
static_cast<MyGUI::TextBox*>(attributeNameWidget)->setCaption(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attributeValueWidget)
|
if (attributeValueWidget)
|
||||||
{
|
{
|
||||||
AttributeValue::Type modified = value.getModified(), base = value.getBase();
|
AttributeValue::Type modified = value.getModified(), base = value.getBase();
|
||||||
attributeValueWidget->setCaption(boost::lexical_cast<std::string>(modified));
|
static_cast<MyGUI::TextBox*>(attributeValueWidget)->setCaption(boost::lexical_cast<std::string>(modified));
|
||||||
if (modified > base)
|
if (modified > base)
|
||||||
attributeValueWidget->setState("increased");
|
attributeValueWidget->_setWidgetState("increased");
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
attributeValueWidget->setState("decreased");
|
attributeValueWidget->_setWidgetState("decreased");
|
||||||
else
|
else
|
||||||
attributeValueWidget->setState("normal");
|
attributeValueWidget->_setWidgetState("normal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWAttribute::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
MWAttribute::~MWAttribute()
|
MWAttribute::~MWAttribute()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWAttribute::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWAttribute::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWAttribute::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(attributeNameWidget, "StatName");
|
||||||
|
assignWidget(attributeValueWidget, "StatValue");
|
||||||
|
|
||||||
|
MyGUI::ButtonPtr button;
|
||||||
|
assignWidget(button, "StatNameButton");
|
||||||
|
if (button)
|
||||||
{
|
{
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "StatName")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
|
|
||||||
attributeNameWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatValue")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
|
|
||||||
attributeValueWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatNameButton")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
attributeNameWidget = button;
|
attributeNameWidget = button;
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
||||||
}
|
|
||||||
else if (name == "StatValue")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
attributeNameWidget = button;
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWAttribute::shutdownWidgetSkin()
|
button = 0;
|
||||||
|
assignWidget(button, "StatValueButton");
|
||||||
|
if (button)
|
||||||
{
|
{
|
||||||
|
attributeValueWidget = button;
|
||||||
|
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MWSpell */
|
/* MWSpell */
|
||||||
|
@ -301,45 +247,20 @@ void MWSpell::updateWidgets()
|
||||||
const ESMS::ESMStore &store = mWindowManager->getStore();
|
const ESMS::ESMStore &store = mWindowManager->getStore();
|
||||||
const ESM::Spell *spell = store.spells.search(id);
|
const ESM::Spell *spell = store.spells.search(id);
|
||||||
if (spell)
|
if (spell)
|
||||||
spellNameWidget->setCaption(spell->name);
|
static_cast<MyGUI::TextBox*>(spellNameWidget)->setCaption(spell->name);
|
||||||
else
|
else
|
||||||
spellNameWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(spellNameWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSpell::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
void MWSpell::initialiseOverride()
|
||||||
{
|
{
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
Base::initialiseOverride();
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
assignWidget(spellNameWidget, "StatName");
|
||||||
}
|
}
|
||||||
|
|
||||||
MWSpell::~MWSpell()
|
MWSpell::~MWSpell()
|
||||||
{
|
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpell::baseChangeWidgetSkin(ResourceSkin* _info)
|
|
||||||
{
|
|
||||||
shutdownWidgetSkin();
|
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpell::initialiseWidgetSkin(ResourceSkin* _info)
|
|
||||||
{
|
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "StatName")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! spellNameWidget, "widget already assigned");
|
|
||||||
spellNameWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpell::shutdownWidgetSkin()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,10 +329,10 @@ void MWSpellEffect::updateWidgets()
|
||||||
spellLine += " on Touch";
|
spellLine += " on Touch";
|
||||||
else if (effect.range == ESM::RT_Target)
|
else if (effect.range == ESM::RT_Target)
|
||||||
spellLine += " on Target";
|
spellLine += " on Target";
|
||||||
textWidget->setCaption(spellLine);
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption(spellLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
textWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
if (imageWidget)
|
if (imageWidget)
|
||||||
{
|
{
|
||||||
|
@ -421,45 +342,16 @@ void MWSpellEffect::updateWidgets()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSpellEffect::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
MWSpellEffect::~MWSpellEffect()
|
MWSpellEffect::~MWSpellEffect()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSpellEffect::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWSpellEffect::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpellEffect::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(textWidget, "Text");
|
||||||
{
|
assignWidget(imageWidget, "Image");
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "Text")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! textWidget, "widget already assigned");
|
|
||||||
textWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "Image")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! imageWidget, "widget already assigned");
|
|
||||||
imageWidget = (*iter)->castType<StaticImage>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpellEffect::shutdownWidgetSkin()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MWDynamicStat */
|
/* MWDynamicStat */
|
||||||
|
@ -491,60 +383,27 @@ void MWDynamicStat::setValue(int cur, int max_)
|
||||||
{
|
{
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
out << value << "/" << max;
|
out << value << "/" << max;
|
||||||
barTextWidget->setCaption(out.str().c_str());
|
static_cast<MyGUI::TextBox*>(barTextWidget)->setCaption(out.str().c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
barTextWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(barTextWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MWDynamicStat::setTitle(const std::string text)
|
void MWDynamicStat::setTitle(const std::string text)
|
||||||
{
|
{
|
||||||
if (textWidget)
|
if (textWidget)
|
||||||
textWidget->setCaption(text);
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption(text);
|
||||||
}
|
|
||||||
|
|
||||||
void MWDynamicStat::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MWDynamicStat::~MWDynamicStat()
|
MWDynamicStat::~MWDynamicStat()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWDynamicStat::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWDynamicStat::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWDynamicStat::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(textWidget, "Text");
|
||||||
{
|
assignWidget(barWidget, "Bar");
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
assignWidget(barTextWidget, "BarText");
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "Text")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! textWidget, "widget already assigned");
|
|
||||||
textWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "Bar")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! barWidget, "widget already assigned");
|
|
||||||
barWidget = (*iter)->castType<Progress>();
|
|
||||||
}
|
|
||||||
else if (name == "BarText")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! barTextWidget, "widget already assigned");
|
|
||||||
barTextWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWDynamicStat::shutdownWidgetSkin()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,26 +38,21 @@ namespace MWGui
|
||||||
const SkillValue& getSkillValue() const { return value; }
|
const SkillValue& getSkillValue() const { return value; }
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate1<MWSkill*> EventHandle_SkillVoid;
|
typedef delegates::CMultiDelegate1<MWSkill*> EventHandle_SkillVoid;
|
||||||
|
|
||||||
/** Event : Skill clicked.\n
|
/** Event : Skill clicked.\n
|
||||||
signature : void method(MWSkill* _sender)\n
|
signature : void method(MWSkill* _sender)\n
|
||||||
*/
|
*/
|
||||||
EventHandle_SkillVoid eventClicked;
|
EventHandle_SkillVoid eventClicked;
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSkill();
|
virtual ~MWSkill();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
void onClicked(MyGUI::Widget* _sender);
|
void onClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
|
@ -85,26 +80,21 @@ namespace MWGui
|
||||||
const AttributeValue& getAttributeValue() const { return value; }
|
const AttributeValue& getAttributeValue() const { return value; }
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate1<MWAttribute*> EventHandle_AttributeVoid;
|
typedef delegates::CMultiDelegate1<MWAttribute*> EventHandle_AttributeVoid;
|
||||||
|
|
||||||
/** Event : Attribute clicked.\n
|
/** Event : Attribute clicked.\n
|
||||||
signature : void method(MWAttribute* _sender)\n
|
signature : void method(MWAttribute* _sender)\n
|
||||||
*/
|
*/
|
||||||
EventHandle_AttributeVoid eventClicked;
|
EventHandle_AttributeVoid eventClicked;
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWAttribute();
|
virtual ~MWAttribute();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
void onClicked(MyGUI::Widget* _sender);
|
void onClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
|
@ -130,23 +120,17 @@ namespace MWGui
|
||||||
|
|
||||||
const std::string &getSpellId() const { return id; }
|
const std::string &getSpellId() const { return id; }
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSpell();
|
virtual ~MWSpell();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
WindowManager* mWindowManager;
|
WindowManager* mWindowManager;
|
||||||
std::string id;
|
std::string id;
|
||||||
MyGUI::StaticTextPtr spellNameWidget;
|
MyGUI::TextBox* spellNameWidget;
|
||||||
};
|
};
|
||||||
typedef MWSpell* MWSpellPtr;
|
typedef MWSpell* MWSpellPtr;
|
||||||
|
|
||||||
|
@ -163,24 +147,19 @@ namespace MWGui
|
||||||
|
|
||||||
const SpellEffectValue &getSpellEffect() const { return effect; }
|
const SpellEffectValue &getSpellEffect() const { return effect; }
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSpellEffect();
|
virtual ~MWSpellEffect();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
WindowManager* mWindowManager;
|
WindowManager* mWindowManager;
|
||||||
SpellEffectValue effect;
|
SpellEffectValue effect;
|
||||||
MyGUI::StaticImagePtr imageWidget;
|
MyGUI::ImageBox* imageWidget;
|
||||||
MyGUI::StaticTextPtr textWidget;
|
MyGUI::TextBox* textWidget;
|
||||||
};
|
};
|
||||||
typedef MWSpellEffect* MWSpellEffectPtr;
|
typedef MWSpellEffect* MWSpellEffectPtr;
|
||||||
|
|
||||||
|
@ -196,22 +175,17 @@ namespace MWGui
|
||||||
int getValue() const { return value; }
|
int getValue() const { return value; }
|
||||||
int getMax() const { return max; }
|
int getMax() const { return max; }
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWDynamicStat();
|
virtual ~MWDynamicStat();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
int value, max;
|
int value, max;
|
||||||
MyGUI::StaticTextPtr textWidget;
|
MyGUI::TextBox* textWidget;
|
||||||
MyGUI::ProgressPtr barWidget;
|
MyGUI::ProgressPtr barWidget;
|
||||||
MyGUI::StaticTextPtr barTextWidget;
|
MyGUI::TextBox* barTextWidget;
|
||||||
};
|
};
|
||||||
typedef MWDynamicStat* MWDynamicStatPtr;
|
typedef MWDynamicStat* MWDynamicStatPtr;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ void WindowBase::open()
|
||||||
void WindowBase::center()
|
void WindowBase::center()
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
MyGUI::IntSize gameWindowSize = mWindowManager.getGui()->getViewSize();
|
MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace MWGui
|
||||||
WindowBase(const std::string& parLayout, WindowManager& parWindowManager);
|
WindowBase(const std::string& parLayout, WindowManager& parWindowManager);
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef MyGUI::delegates::CDelegate1<WindowBase*> EventHandle_WindowBase;
|
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
void center();
|
void center();
|
||||||
|
|
|
@ -37,12 +37,12 @@ WindowManager::WindowManager(MWWorld::Environment& environment,
|
||||||
gui = mGuiManager->getGui();
|
gui = mGuiManager->getGui();
|
||||||
|
|
||||||
//Register own widgets with MyGUI
|
//Register own widgets with MyGUI
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<DialogeHistory>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<DialogueHistory>("Widget");
|
||||||
|
|
||||||
// Get size info from the Gui object
|
// Get size info from the Gui object
|
||||||
assert(gui);
|
assert(gui);
|
||||||
int w = gui->getViewSize().width;
|
int w = MyGUI::RenderManager::getInstance().getViewSize().width;
|
||||||
int h = gui->getViewSize().height;
|
int h = MyGUI::RenderManager::getInstance().getViewSize().height;
|
||||||
|
|
||||||
hud = new HUD(w,h, showFPSLevel);
|
hud = new HUD(w,h, showFPSLevel);
|
||||||
menu = new MainMenu(w,h);
|
menu = new MainMenu(w,h);
|
||||||
|
@ -153,7 +153,7 @@ void WindowManager::updateVisible()
|
||||||
dialogueWindow->setVisible(false);
|
dialogueWindow->setVisible(false);
|
||||||
|
|
||||||
// Mouse is visible whenever we're not in game mode
|
// Mouse is visible whenever we're not in game mode
|
||||||
gui->setVisiblePointer(isGuiMode());
|
MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
|
||||||
|
|
||||||
// If in game mode, don't show anything.
|
// If in game mode, don't show anything.
|
||||||
if(mode == GM_Game) //Use a switch/case structure
|
if(mode == GM_Game) //Use a switch/case structure
|
||||||
|
|
125
cmake/FindMyGUI.cmake
Normal file
125
cmake/FindMyGUI.cmake
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
# - Find MyGUI includes and library
|
||||||
|
#
|
||||||
|
# This module defines
|
||||||
|
# MYGUI_INCLUDE_DIRS
|
||||||
|
# MYGUI_LIBRARIES, the libraries to link against to use MYGUI.
|
||||||
|
# MYGUI_LIB_DIR, the location of the libraries
|
||||||
|
# MYGUI_FOUND, If false, do not try to use MYGUI
|
||||||
|
#
|
||||||
|
# Copyright © 2007, Matt Williams
|
||||||
|
#
|
||||||
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
CMAKE_POLICY(PUSH)
|
||||||
|
include(FindPkgMacros)
|
||||||
|
|
||||||
|
# IF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS)
|
||||||
|
# SET(MYGUI_FIND_QUIETLY TRUE)
|
||||||
|
# ENDIF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
IF (WIN32) #Windows
|
||||||
|
MESSAGE(STATUS "Looking for MyGUI")
|
||||||
|
SET(MYGUISDK $ENV{MYGUI_HOME})
|
||||||
|
IF (MYGUISDK)
|
||||||
|
findpkg_begin ( "MYGUI" )
|
||||||
|
MESSAGE(STATUS "Using MyGUI in OGRE SDK")
|
||||||
|
STRING(REGEX REPLACE "[\\]" "/" MYGUISDK "${MYGUISDK}" )
|
||||||
|
|
||||||
|
find_path ( MYGUI_INCLUDE_DIRS
|
||||||
|
MyGUI.h
|
||||||
|
"${MYGUISDK}/MyGUIEngine/include"
|
||||||
|
NO_DEFAULT_PATH )
|
||||||
|
|
||||||
|
find_path ( MYGUI_PLATFORM_INCLUDE_DIRS
|
||||||
|
MyGUI_OgrePlatform.h
|
||||||
|
"${MYGUISDK}/Platforms/Ogre/OgrePlatform/include"
|
||||||
|
NO_DEFAULT_PATH )
|
||||||
|
|
||||||
|
SET ( MYGUI_LIB_DIR ${MYGUISDK}/*/lib )
|
||||||
|
|
||||||
|
find_library ( MYGUI_LIBRARIES_REL NAMES
|
||||||
|
MyGUIEngine.lib
|
||||||
|
MyGUI.OgrePlatform.lib
|
||||||
|
HINTS
|
||||||
|
${MYGUI_LIB_DIR}
|
||||||
|
PATH_SUFFIXES "" release relwithdebinfo minsizerel )
|
||||||
|
|
||||||
|
find_library ( MYGUI_LIBRARIES_DBG NAMES
|
||||||
|
MyGUIEngine_d.lib
|
||||||
|
MyGUI.OgrePlatform_d.lib
|
||||||
|
HINTS
|
||||||
|
${MYGUI_LIB_DIR}
|
||||||
|
PATH_SUFFIXES "" debug )
|
||||||
|
|
||||||
|
find_library ( MYGUI_PLATFORM_LIBRARIES_REL NAMES
|
||||||
|
MyGUI.OgrePlatform.lib
|
||||||
|
HINTS
|
||||||
|
${MYGUI_LIB_DIR}
|
||||||
|
PATH_SUFFIXES "" release relwithdebinfo minsizerel )
|
||||||
|
|
||||||
|
find_library ( MYGUI_PLATFORM_LIBRARIES_DBG NAMES
|
||||||
|
MyGUI.OgrePlatform_d.lib
|
||||||
|
HINTS
|
||||||
|
${MYGUI_LIB_DIR}
|
||||||
|
PATH_SUFFIXES "" debug )
|
||||||
|
|
||||||
|
make_library_set ( MYGUI_LIBRARIES )
|
||||||
|
make_library_set ( MYGUI_PLATFORM_LIBRARIES )
|
||||||
|
|
||||||
|
MESSAGE ("${MYGUI_LIBRARIES}")
|
||||||
|
MESSAGE ("${MYGUI_PLATFORM_LIBRARIES}")
|
||||||
|
|
||||||
|
findpkg_finish ( "MYGUI" )
|
||||||
|
|
||||||
|
ENDIF (MYGUISDK)
|
||||||
|
IF (OGRESOURCE)
|
||||||
|
MESSAGE(STATUS "Using MyGUI in OGRE dependencies")
|
||||||
|
STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESOURCE}" )
|
||||||
|
SET(MYGUI_INCLUDE_DIRS ${OGRESOURCE}/OgreMain/include/MYGUI)
|
||||||
|
SET(MYGUI_LIB_DIR ${OGRESOURCE}/lib)
|
||||||
|
SET(MYGUI_LIBRARIES debug Debug/MyGUIEngine_d optimized Release/MyGUIEngine)
|
||||||
|
ENDIF (OGRESOURCE)
|
||||||
|
ELSE (WIN32) #Unix
|
||||||
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
|
||||||
|
FIND_PACKAGE(PkgConfig)
|
||||||
|
PKG_SEARCH_MODULE(MYGUI MYGUI MyGUI)
|
||||||
|
IF (MYGUI_INCLUDE_DIRS)
|
||||||
|
SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS})
|
||||||
|
SET(MYGUI_LIB_DIR ${MYGUI_LIBDIR})
|
||||||
|
SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "")
|
||||||
|
ELSE (MYGUI_INCLUDE_DIRS)
|
||||||
|
FIND_PATH(MYGUI_INCLUDE_DIRS MyGUI.h PATHS /usr/local/include /usr/include PATH_SUFFIXES MyGUI MYGUI)
|
||||||
|
FIND_LIBRARY(MYGUI_LIBRARIES mygui PATHS /usr/lib /usr/local/lib)
|
||||||
|
SET(MYGUI_LIB_DIR ${MYGUI_LIBRARIES})
|
||||||
|
STRING(REGEX REPLACE "(.*)/.*" "\\1" MYGUI_LIB_DIR "${MYGUI_LIB_DIR}")
|
||||||
|
STRING(REGEX REPLACE ".*/" "" MYGUI_LIBRARIES "${MYGUI_LIBRARIES}")
|
||||||
|
ENDIF (MYGUI_INCLUDE_DIRS)
|
||||||
|
ENDIF (WIN32)
|
||||||
|
|
||||||
|
#Do some preparation
|
||||||
|
SEPARATE_ARGUMENTS(MYGUI_INCLUDE_DIRS)
|
||||||
|
SEPARATE_ARGUMENTS(MYGUI_LIBRARIES)
|
||||||
|
SEPARATE_ARGUMENTS(MYGUI_PLATFORM_LIBRARIES)
|
||||||
|
|
||||||
|
SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS} CACHE PATH "")
|
||||||
|
SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "")
|
||||||
|
SET(MYGUI_LIBRARIES ${MYGUI_PLATFORM_LIBRARIES} CACHE STRING "")
|
||||||
|
SET(MYGUI_LIB_DIR ${MYGUI_LIB_DIR} CACHE PATH "")
|
||||||
|
|
||||||
|
IF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES)
|
||||||
|
SET(MYGUI_FOUND TRUE)
|
||||||
|
ENDIF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES)
|
||||||
|
|
||||||
|
IF (MYGUI_FOUND)
|
||||||
|
MARK_AS_ADVANCED(MYGUI_LIB_DIR)
|
||||||
|
IF (NOT MYGUI_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS " libraries : ${MYGUI_LIBRARIES} from ${MYGUI_LIB_DIR}")
|
||||||
|
MESSAGE(STATUS " includes : ${MYGUI_INCLUDE_DIRS}")
|
||||||
|
ENDIF (NOT MYGUI_FIND_QUIETLY)
|
||||||
|
ELSE (MYGUI_FOUND)
|
||||||
|
IF (MYGUI_FIND_REQUIRED)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find MYGUI")
|
||||||
|
ENDIF (MYGUI_FIND_REQUIRED)
|
||||||
|
ENDIF (MYGUI_FOUND)
|
||||||
|
|
||||||
|
CMAKE_POLICY(POP)
|
165
extern/mygui_3.0.1/COPYING.LESSER
vendored
165
extern/mygui_3.0.1/COPYING.LESSER
vendored
|
@ -1,165 +0,0 @@
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
|
|
||||||
This version of the GNU Lesser General Public License incorporates
|
|
||||||
the terms and conditions of version 3 of the GNU General Public
|
|
||||||
License, supplemented by the additional permissions listed below.
|
|
||||||
|
|
||||||
0. Additional Definitions.
|
|
||||||
|
|
||||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
||||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
||||||
General Public License.
|
|
||||||
|
|
||||||
"The Library" refers to a covered work governed by this License,
|
|
||||||
other than an Application or a Combined Work as defined below.
|
|
||||||
|
|
||||||
An "Application" is any work that makes use of an interface provided
|
|
||||||
by the Library, but which is not otherwise based on the Library.
|
|
||||||
Defining a subclass of a class defined by the Library is deemed a mode
|
|
||||||
of using an interface provided by the Library.
|
|
||||||
|
|
||||||
A "Combined Work" is a work produced by combining or linking an
|
|
||||||
Application with the Library. The particular version of the Library
|
|
||||||
with which the Combined Work was made is also called the "Linked
|
|
||||||
Version".
|
|
||||||
|
|
||||||
The "Minimal Corresponding Source" for a Combined Work means the
|
|
||||||
Corresponding Source for the Combined Work, excluding any source code
|
|
||||||
for portions of the Combined Work that, considered in isolation, are
|
|
||||||
based on the Application, and not on the Linked Version.
|
|
||||||
|
|
||||||
The "Corresponding Application Code" for a Combined Work means the
|
|
||||||
object code and/or source code for the Application, including any data
|
|
||||||
and utility programs needed for reproducing the Combined Work from the
|
|
||||||
Application, but excluding the System Libraries of the Combined Work.
|
|
||||||
|
|
||||||
1. Exception to Section 3 of the GNU GPL.
|
|
||||||
|
|
||||||
You may convey a covered work under sections 3 and 4 of this License
|
|
||||||
without being bound by section 3 of the GNU GPL.
|
|
||||||
|
|
||||||
2. Conveying Modified Versions.
|
|
||||||
|
|
||||||
If you modify a copy of the Library, and, in your modifications, a
|
|
||||||
facility refers to a function or data to be supplied by an Application
|
|
||||||
that uses the facility (other than as an argument passed when the
|
|
||||||
facility is invoked), then you may convey a copy of the modified
|
|
||||||
version:
|
|
||||||
|
|
||||||
a) under this License, provided that you make a good faith effort to
|
|
||||||
ensure that, in the event an Application does not supply the
|
|
||||||
function or data, the facility still operates, and performs
|
|
||||||
whatever part of its purpose remains meaningful, or
|
|
||||||
|
|
||||||
b) under the GNU GPL, with none of the additional permissions of
|
|
||||||
this License applicable to that copy.
|
|
||||||
|
|
||||||
3. Object Code Incorporating Material from Library Header Files.
|
|
||||||
|
|
||||||
The object code form of an Application may incorporate material from
|
|
||||||
a header file that is part of the Library. You may convey such object
|
|
||||||
code under terms of your choice, provided that, if the incorporated
|
|
||||||
material is not limited to numerical parameters, data structure
|
|
||||||
layouts and accessors, or small macros, inline functions and templates
|
|
||||||
(ten or fewer lines in length), you do both of the following:
|
|
||||||
|
|
||||||
a) Give prominent notice with each copy of the object code that the
|
|
||||||
Library is used in it and that the Library and its use are
|
|
||||||
covered by this License.
|
|
||||||
|
|
||||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
||||||
document.
|
|
||||||
|
|
||||||
4. Combined Works.
|
|
||||||
|
|
||||||
You may convey a Combined Work under terms of your choice that,
|
|
||||||
taken together, effectively do not restrict modification of the
|
|
||||||
portions of the Library contained in the Combined Work and reverse
|
|
||||||
engineering for debugging such modifications, if you also do each of
|
|
||||||
the following:
|
|
||||||
|
|
||||||
a) Give prominent notice with each copy of the Combined Work that
|
|
||||||
the Library is used in it and that the Library and its use are
|
|
||||||
covered by this License.
|
|
||||||
|
|
||||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
||||||
document.
|
|
||||||
|
|
||||||
c) For a Combined Work that displays copyright notices during
|
|
||||||
execution, include the copyright notice for the Library among
|
|
||||||
these notices, as well as a reference directing the user to the
|
|
||||||
copies of the GNU GPL and this license document.
|
|
||||||
|
|
||||||
d) Do one of the following:
|
|
||||||
|
|
||||||
0) Convey the Minimal Corresponding Source under the terms of this
|
|
||||||
License, and the Corresponding Application Code in a form
|
|
||||||
suitable for, and under terms that permit, the user to
|
|
||||||
recombine or relink the Application with a modified version of
|
|
||||||
the Linked Version to produce a modified Combined Work, in the
|
|
||||||
manner specified by section 6 of the GNU GPL for conveying
|
|
||||||
Corresponding Source.
|
|
||||||
|
|
||||||
1) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (a) uses at run time
|
|
||||||
a copy of the Library already present on the user's computer
|
|
||||||
system, and (b) will operate properly with a modified version
|
|
||||||
of the Library that is interface-compatible with the Linked
|
|
||||||
Version.
|
|
||||||
|
|
||||||
e) Provide Installation Information, but only if you would otherwise
|
|
||||||
be required to provide such information under section 6 of the
|
|
||||||
GNU GPL, and only to the extent that such information is
|
|
||||||
necessary to install and execute a modified version of the
|
|
||||||
Combined Work produced by recombining or relinking the
|
|
||||||
Application with a modified version of the Linked Version. (If
|
|
||||||
you use option 4d0, the Installation Information must accompany
|
|
||||||
the Minimal Corresponding Source and Corresponding Application
|
|
||||||
Code. If you use option 4d1, you must provide the Installation
|
|
||||||
Information in the manner specified by section 6 of the GNU GPL
|
|
||||||
for conveying Corresponding Source.)
|
|
||||||
|
|
||||||
5. Combined Libraries.
|
|
||||||
|
|
||||||
You may place library facilities that are a work based on the
|
|
||||||
Library side by side in a single library together with other library
|
|
||||||
facilities that are not Applications and are not covered by this
|
|
||||||
License, and convey such a combined library under terms of your
|
|
||||||
choice, if you do both of the following:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work based
|
|
||||||
on the Library, uncombined with any other library facilities,
|
|
||||||
conveyed under the terms of this License.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library that part of it
|
|
||||||
is a work based on the Library, and explaining where to find the
|
|
||||||
accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
6. Revised Versions of the GNU Lesser General Public License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the GNU Lesser General Public License from time to time. Such new
|
|
||||||
versions will be similar in spirit to the present version, but may
|
|
||||||
differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Library as you received it specifies that a certain numbered version
|
|
||||||
of the GNU Lesser General Public License "or any later version"
|
|
||||||
applies to it, you have the option of following the terms and
|
|
||||||
conditions either of that published version or of any later version
|
|
||||||
published by the Free Software Foundation. If the Library as you
|
|
||||||
received it does not specify a version number of the GNU Lesser
|
|
||||||
General Public License, you may choose any version of the GNU Lesser
|
|
||||||
General Public License ever published by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Library as you received it specifies that a proxy can decide
|
|
||||||
whether future versions of the GNU Lesser General Public License shall
|
|
||||||
apply, that proxy's public statement of acceptance of any version is
|
|
||||||
permanent authorization for you to choose that version for the
|
|
||||||
Library.
|
|
35
extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt
vendored
35
extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt
vendored
|
@ -1,35 +0,0 @@
|
||||||
set (PROJECT_NAME MyGUIEngine)
|
|
||||||
|
|
||||||
project( ${PROJECT_NAME} )
|
|
||||||
|
|
||||||
include(${PROJECT_NAME}.list)
|
|
||||||
|
|
||||||
include_directories(include)
|
|
||||||
if (MYGUI_USE_FREETYPE)
|
|
||||||
include_directories(
|
|
||||||
${FREETYPE_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
add_definitions(-DMYGUI_USE_FREETYPE)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_definitions(-DMYGUI_BUILD)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
add_definitions(-DNOMINMAX)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} ${MYGUI_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES})
|
|
||||||
if (MYGUI_USE_FREETYPE)
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
|
||||||
${FREETYPE_LIBRARIES}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# We don't need this lib in OS X. uuid functions is in libc here.
|
|
||||||
if (NOT APPLE)
|
|
||||||
target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS} uuid)
|
|
||||||
endif(NOT APPLE)
|
|
||||||
|
|
||||||
if (MINGW)
|
|
||||||
target_link_libraries(${PROJECT_NAME} libwinmm.a)
|
|
||||||
endif (MINGW)
|
|
561
extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list
vendored
561
extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list
vendored
|
@ -1,561 +0,0 @@
|
||||||
set (HEADER_FILES
|
|
||||||
include/MyGUI_Allocator.h
|
|
||||||
include/MyGUI_CustomAllocator.h
|
|
||||||
include/MyGUI_DDItemInfo.h
|
|
||||||
include/MyGUI_IBItemInfo.h
|
|
||||||
include/MyGUI_MenuItemType.h
|
|
||||||
include/MyGUI_MessageStyle.h
|
|
||||||
include/MyGUI_WidgetToolTip.h
|
|
||||||
include/MyGUI_Button.h
|
|
||||||
include/MyGUI_Canvas.h
|
|
||||||
include/MyGUI_ComboBox.h
|
|
||||||
include/MyGUI_DDContainer.h
|
|
||||||
include/MyGUI_Edit.h
|
|
||||||
include/MyGUI_HScroll.h
|
|
||||||
include/MyGUI_ItemBox.h
|
|
||||||
include/MyGUI_List.h
|
|
||||||
include/MyGUI_ListBox.h
|
|
||||||
include/MyGUI_ListCtrl.h
|
|
||||||
include/MyGUI_MenuBar.h
|
|
||||||
include/MyGUI_MenuCtrl.h
|
|
||||||
include/MyGUI_MenuItem.h
|
|
||||||
include/MyGUI_Message.h
|
|
||||||
include/MyGUI_MultiList.h
|
|
||||||
include/MyGUI_PopupMenu.h
|
|
||||||
include/MyGUI_Progress.h
|
|
||||||
include/MyGUI_ScrollView.h
|
|
||||||
include/MyGUI_StaticImage.h
|
|
||||||
include/MyGUI_StaticText.h
|
|
||||||
include/MyGUI_Tab.h
|
|
||||||
include/MyGUI_TabItem.h
|
|
||||||
include/MyGUI_VScroll.h
|
|
||||||
include/MyGUI_Widget.h
|
|
||||||
include/MyGUI_Window.h
|
|
||||||
include/MyGUI_IWidgetFactory.h
|
|
||||||
include/MyGUI_Bitwise.h
|
|
||||||
include/MyGUI_CoordConverter.h
|
|
||||||
include/MyGUI_DataFileStream.h
|
|
||||||
include/MyGUI_DataStream.h
|
|
||||||
include/MyGUI_Delegate.h
|
|
||||||
include/MyGUI_DelegateImplement.h
|
|
||||||
include/MyGUI_DynLib.h
|
|
||||||
include/MyGUI_Enumerator.h
|
|
||||||
include/MyGUI_EventPair.h
|
|
||||||
include/MyGUI_Guid.h
|
|
||||||
include/MyGUI_RenderOut.h
|
|
||||||
include/MyGUI_TextChangeHistory.h
|
|
||||||
include/MyGUI_TextIterator.h
|
|
||||||
include/MyGUI_TextureUtility.h
|
|
||||||
include/MyGUI_TextView.h
|
|
||||||
include/MyGUI_Timer.h
|
|
||||||
include/MyGUI_UString.h
|
|
||||||
include/MyGUI_Utility.h
|
|
||||||
include/MyGUI_WidgetTranslate.h
|
|
||||||
include/MyGUI_XmlDocument.h
|
|
||||||
include/MyGUI_LogManager.h
|
|
||||||
include/MyGUI_LogStream.h
|
|
||||||
include/MyGUI.h
|
|
||||||
include/MyGUI_CastWidget.h
|
|
||||||
include/MyGUI_Common.h
|
|
||||||
include/MyGUI_Diagnostic.h
|
|
||||||
include/MyGUI_Exception.h
|
|
||||||
include/MyGUI_GenericFactory.h
|
|
||||||
include/MyGUI_Macros.h
|
|
||||||
include/MyGUI_Platform.h
|
|
||||||
include/MyGUI_Precompiled.h
|
|
||||||
include/MyGUI_Prerequest.h
|
|
||||||
include/MyGUI_RenderFormat.h
|
|
||||||
include/MyGUI_ResourceHolder.h
|
|
||||||
include/MyGUI_WidgetDefines.h
|
|
||||||
include/MyGUI_ICroppedRectangle.h
|
|
||||||
include/MyGUI_IDataStream.h
|
|
||||||
include/MyGUI_Instance.h
|
|
||||||
include/MyGUI_IObject.h
|
|
||||||
include/MyGUI_ISerializable.h
|
|
||||||
include/MyGUI_ITexture.h
|
|
||||||
include/MyGUI_IUnlinkWidget.h
|
|
||||||
include/MyGUI_IVertexBuffer.h
|
|
||||||
include/MyGUI_IWidgetCreator.h
|
|
||||||
include/MyGUI_Plugin.h
|
|
||||||
include/MyGUI_RTTI.h
|
|
||||||
include/MyGUI_BiIndexBase.h
|
|
||||||
include/MyGUI_ScrollViewBase.h
|
|
||||||
include/MyGUI_WidgetEvent.h
|
|
||||||
include/MyGUI_WidgetUserData.h
|
|
||||||
include/MyGUI_EditText.h
|
|
||||||
include/MyGUI_MainSkin.h
|
|
||||||
include/MyGUI_RawRect.h
|
|
||||||
include/MyGUI_RotatingSkin.h
|
|
||||||
include/MyGUI_SimpleText.h
|
|
||||||
include/MyGUI_SubSkin.h
|
|
||||||
include/MyGUI_TileRect.h
|
|
||||||
include/MyGUI_IStateInfo.h
|
|
||||||
include/MyGUI_ISubWidget.h
|
|
||||||
include/MyGUI_ISubWidgetRect.h
|
|
||||||
include/MyGUI_ISubWidgetText.h
|
|
||||||
include/MyGUI_LayerItem.h
|
|
||||||
include/MyGUI_LayerNode.h
|
|
||||||
include/MyGUI_OverlappedLayer.h
|
|
||||||
include/MyGUI_RenderItem.h
|
|
||||||
include/MyGUI_SharedLayer.h
|
|
||||||
include/MyGUI_SharedLayerNode.h
|
|
||||||
include/MyGUI_ILayer.h
|
|
||||||
include/MyGUI_ILayerItem.h
|
|
||||||
include/MyGUI_ILayerNode.h
|
|
||||||
include/MyGUI_IRenderTarget.h
|
|
||||||
include/MyGUI_ActionController.h
|
|
||||||
include/MyGUI_ControllerEdgeHide.h
|
|
||||||
include/MyGUI_ControllerFadeAlpha.h
|
|
||||||
include/MyGUI_ControllerItem.h
|
|
||||||
include/MyGUI_ControllerPosition.h
|
|
||||||
include/MyGUI_ResourceImageSet.h
|
|
||||||
include/MyGUI_ResourceImageSetPointer.h
|
|
||||||
include/MyGUI_ResourceManualFont.h
|
|
||||||
include/MyGUI_ResourceManualPointer.h
|
|
||||||
include/MyGUI_ResourceSkin.h
|
|
||||||
include/MyGUI_ResourceTrueTypeFont.h
|
|
||||||
include/MyGUI_IFont.h
|
|
||||||
include/MyGUI_IPointer.h
|
|
||||||
include/MyGUI_IResource.h
|
|
||||||
include/MyGUI_ChildSkinInfo.h
|
|
||||||
include/MyGUI_FontData.h
|
|
||||||
include/MyGUI_MaskPickInfo.h
|
|
||||||
include/MyGUI_SubWidgetBinding.h
|
|
||||||
include/MyGUI_SubWidgetInfo.h
|
|
||||||
include/MyGUI_Align.h
|
|
||||||
include/MyGUI_Any.h
|
|
||||||
include/MyGUI_Colour.h
|
|
||||||
include/MyGUI_CommonStateInfo.h
|
|
||||||
include/MyGUI_ImageInfo.h
|
|
||||||
include/MyGUI_InputDefine.h
|
|
||||||
include/MyGUI_RenderTargetInfo.h
|
|
||||||
include/MyGUI_TCoord.h
|
|
||||||
include/MyGUI_TPoint.h
|
|
||||||
include/MyGUI_TRect.h
|
|
||||||
include/MyGUI_TSize.h
|
|
||||||
include/MyGUI_Types.h
|
|
||||||
include/MyGUI_Version.h
|
|
||||||
include/MyGUI_VertexData.h
|
|
||||||
include/MyGUI_WidgetStyle.h
|
|
||||||
include/MyGUI_ClipboardManager.h
|
|
||||||
include/MyGUI_ControllerManager.h
|
|
||||||
include/MyGUI_DataManager.h
|
|
||||||
include/MyGUI_DynLibManager.h
|
|
||||||
include/MyGUI_FactoryManager.h
|
|
||||||
include/MyGUI_FontManager.h
|
|
||||||
include/MyGUI_Gui.h
|
|
||||||
include/MyGUI_InputManager.h
|
|
||||||
include/MyGUI_LanguageManager.h
|
|
||||||
include/MyGUI_LayerManager.h
|
|
||||||
include/MyGUI_LayoutManager.h
|
|
||||||
include/MyGUI_PluginManager.h
|
|
||||||
include/MyGUI_PointerManager.h
|
|
||||||
include/MyGUI_RenderManager.h
|
|
||||||
include/MyGUI_ResourceManager.h
|
|
||||||
include/MyGUI_SkinManager.h
|
|
||||||
include/MyGUI_SubWidgetManager.h
|
|
||||||
include/MyGUI_WidgetManager.h
|
|
||||||
)
|
|
||||||
set (SOURCE_FILES
|
|
||||||
src/MyGUI_Button.cpp
|
|
||||||
src/MyGUI_Canvas.cpp
|
|
||||||
src/MyGUI_ComboBox.cpp
|
|
||||||
src/MyGUI_DDContainer.cpp
|
|
||||||
src/MyGUI_Edit.cpp
|
|
||||||
src/MyGUI_HScroll.cpp
|
|
||||||
src/MyGUI_ItemBox.cpp
|
|
||||||
src/MyGUI_List.cpp
|
|
||||||
src/MyGUI_ListBox.cpp
|
|
||||||
src/MyGUI_ListCtrl.cpp
|
|
||||||
src/MyGUI_MenuBar.cpp
|
|
||||||
src/MyGUI_MenuCtrl.cpp
|
|
||||||
src/MyGUI_MenuItem.cpp
|
|
||||||
src/MyGUI_Message.cpp
|
|
||||||
src/MyGUI_MultiList.cpp
|
|
||||||
src/MyGUI_PopupMenu.cpp
|
|
||||||
src/MyGUI_Progress.cpp
|
|
||||||
src/MyGUI_ScrollView.cpp
|
|
||||||
src/MyGUI_StaticImage.cpp
|
|
||||||
src/MyGUI_StaticText.cpp
|
|
||||||
src/MyGUI_Tab.cpp
|
|
||||||
src/MyGUI_TabItem.cpp
|
|
||||||
src/MyGUI_VScroll.cpp
|
|
||||||
src/MyGUI_Widget.cpp
|
|
||||||
src/MyGUI_Window.cpp
|
|
||||||
src/MyGUI_EditText.cpp
|
|
||||||
src/MyGUI_MainSkin.cpp
|
|
||||||
src/MyGUI_RawRect.cpp
|
|
||||||
src/MyGUI_RotatingSkin.cpp
|
|
||||||
src/MyGUI_SimpleText.cpp
|
|
||||||
src/MyGUI_SubSkin.cpp
|
|
||||||
src/MyGUI_TileRect.cpp
|
|
||||||
src/MyGUI_LayerItem.cpp
|
|
||||||
src/MyGUI_LayerNode.cpp
|
|
||||||
src/MyGUI_OverlappedLayer.cpp
|
|
||||||
src/MyGUI_RenderItem.cpp
|
|
||||||
src/MyGUI_SharedLayer.cpp
|
|
||||||
src/MyGUI_SharedLayerNode.cpp
|
|
||||||
src/MyGUI_ActionController.cpp
|
|
||||||
src/MyGUI_ControllerEdgeHide.cpp
|
|
||||||
src/MyGUI_ControllerFadeAlpha.cpp
|
|
||||||
src/MyGUI_ControllerPosition.cpp
|
|
||||||
src/MyGUI_Exception.cpp
|
|
||||||
src/MyGUI_Precompiled.cpp
|
|
||||||
src/MyGUI_IWidgetCreator.cpp
|
|
||||||
src/MyGUI_ScrollViewBase.cpp
|
|
||||||
src/MyGUI_ResourceImageSet.cpp
|
|
||||||
src/MyGUI_ResourceImageSetPointer.cpp
|
|
||||||
src/MyGUI_ResourceManualFont.cpp
|
|
||||||
src/MyGUI_ResourceManualPointer.cpp
|
|
||||||
src/MyGUI_ResourceSkin.cpp
|
|
||||||
src/MyGUI_ResourceTrueTypeFont.cpp
|
|
||||||
src/MyGUI_MaskPickInfo.cpp
|
|
||||||
src/MyGUI_Any.cpp
|
|
||||||
src/MyGUI_Colour.cpp
|
|
||||||
src/MyGUI_ClipboardManager.cpp
|
|
||||||
src/MyGUI_ControllerManager.cpp
|
|
||||||
src/MyGUI_DataManager.cpp
|
|
||||||
src/MyGUI_DynLibManager.cpp
|
|
||||||
src/MyGUI_FactoryManager.cpp
|
|
||||||
src/MyGUI_FontManager.cpp
|
|
||||||
src/MyGUI_Gui.cpp
|
|
||||||
src/MyGUI_InputManager.cpp
|
|
||||||
src/MyGUI_LanguageManager.cpp
|
|
||||||
src/MyGUI_LayerManager.cpp
|
|
||||||
src/MyGUI_LayoutManager.cpp
|
|
||||||
src/MyGUI_PluginManager.cpp
|
|
||||||
src/MyGUI_PointerManager.cpp
|
|
||||||
src/MyGUI_RenderManager.cpp
|
|
||||||
src/MyGUI_ResourceManager.cpp
|
|
||||||
src/MyGUI_SkinManager.cpp
|
|
||||||
src/MyGUI_SubWidgetManager.cpp
|
|
||||||
src/MyGUI_WidgetManager.cpp
|
|
||||||
src/MyGUI_DataFileStream.cpp
|
|
||||||
src/MyGUI_DataStream.cpp
|
|
||||||
src/MyGUI_DynLib.cpp
|
|
||||||
src/MyGUI_Guid.cpp
|
|
||||||
src/MyGUI_RenderOut.cpp
|
|
||||||
src/MyGUI_TextIterator.cpp
|
|
||||||
src/MyGUI_TextureUtility.cpp
|
|
||||||
src/MyGUI_Timer.cpp
|
|
||||||
src/MyGUI_XmlDocument.cpp
|
|
||||||
src/MyGUI_LogManager.cpp
|
|
||||||
src/MyGUI_LogStream.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Widget\\Widget" FILES
|
|
||||||
src/MyGUI_Button.cpp
|
|
||||||
src/MyGUI_Canvas.cpp
|
|
||||||
src/MyGUI_ComboBox.cpp
|
|
||||||
src/MyGUI_DDContainer.cpp
|
|
||||||
src/MyGUI_Edit.cpp
|
|
||||||
src/MyGUI_HScroll.cpp
|
|
||||||
src/MyGUI_ItemBox.cpp
|
|
||||||
src/MyGUI_List.cpp
|
|
||||||
src/MyGUI_ListBox.cpp
|
|
||||||
src/MyGUI_ListCtrl.cpp
|
|
||||||
src/MyGUI_MenuBar.cpp
|
|
||||||
src/MyGUI_MenuCtrl.cpp
|
|
||||||
src/MyGUI_MenuItem.cpp
|
|
||||||
src/MyGUI_Message.cpp
|
|
||||||
src/MyGUI_MultiList.cpp
|
|
||||||
src/MyGUI_PopupMenu.cpp
|
|
||||||
src/MyGUI_Progress.cpp
|
|
||||||
src/MyGUI_ScrollView.cpp
|
|
||||||
src/MyGUI_StaticImage.cpp
|
|
||||||
src/MyGUI_StaticText.cpp
|
|
||||||
src/MyGUI_Tab.cpp
|
|
||||||
src/MyGUI_TabItem.cpp
|
|
||||||
src/MyGUI_VScroll.cpp
|
|
||||||
src/MyGUI_Widget.cpp
|
|
||||||
src/MyGUI_Window.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Widget" FILES
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\SubWidget" FILES
|
|
||||||
src/MyGUI_EditText.cpp
|
|
||||||
src/MyGUI_MainSkin.cpp
|
|
||||||
src/MyGUI_RawRect.cpp
|
|
||||||
src/MyGUI_RotatingSkin.cpp
|
|
||||||
src/MyGUI_SimpleText.cpp
|
|
||||||
src/MyGUI_SubSkin.cpp
|
|
||||||
src/MyGUI_TileRect.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\LayerItem" FILES
|
|
||||||
src/MyGUI_LayerItem.cpp
|
|
||||||
src/MyGUI_LayerNode.cpp
|
|
||||||
src/MyGUI_OverlappedLayer.cpp
|
|
||||||
src/MyGUI_RenderItem.cpp
|
|
||||||
src/MyGUI_SharedLayer.cpp
|
|
||||||
src/MyGUI_SharedLayerNode.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Controller" FILES
|
|
||||||
src/MyGUI_ActionController.cpp
|
|
||||||
src/MyGUI_ControllerEdgeHide.cpp
|
|
||||||
src/MyGUI_ControllerFadeAlpha.cpp
|
|
||||||
src/MyGUI_ControllerPosition.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Common\\Interfaces" FILES
|
|
||||||
src/MyGUI_IWidgetCreator.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Common\\Base" FILES
|
|
||||||
src/MyGUI_ScrollViewBase.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Common" FILES
|
|
||||||
src/MyGUI_Exception.cpp
|
|
||||||
src/MyGUI_Precompiled.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Resource\\Data" FILES
|
|
||||||
src/MyGUI_MaskPickInfo.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Resource" FILES
|
|
||||||
src/MyGUI_ResourceImageSet.cpp
|
|
||||||
src/MyGUI_ResourceImageSetPointer.cpp
|
|
||||||
src/MyGUI_ResourceManualFont.cpp
|
|
||||||
src/MyGUI_ResourceManualPointer.cpp
|
|
||||||
src/MyGUI_ResourceSkin.cpp
|
|
||||||
src/MyGUI_ResourceTrueTypeFont.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Types" FILES
|
|
||||||
src/MyGUI_Any.cpp
|
|
||||||
src/MyGUI_Colour.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core\\Manager" FILES
|
|
||||||
src/MyGUI_ClipboardManager.cpp
|
|
||||||
src/MyGUI_ControllerManager.cpp
|
|
||||||
src/MyGUI_DataManager.cpp
|
|
||||||
src/MyGUI_DynLibManager.cpp
|
|
||||||
src/MyGUI_FactoryManager.cpp
|
|
||||||
src/MyGUI_FontManager.cpp
|
|
||||||
src/MyGUI_Gui.cpp
|
|
||||||
src/MyGUI_InputManager.cpp
|
|
||||||
src/MyGUI_LanguageManager.cpp
|
|
||||||
src/MyGUI_LayerManager.cpp
|
|
||||||
src/MyGUI_LayoutManager.cpp
|
|
||||||
src/MyGUI_PluginManager.cpp
|
|
||||||
src/MyGUI_PointerManager.cpp
|
|
||||||
src/MyGUI_RenderManager.cpp
|
|
||||||
src/MyGUI_ResourceManager.cpp
|
|
||||||
src/MyGUI_SkinManager.cpp
|
|
||||||
src/MyGUI_SubWidgetManager.cpp
|
|
||||||
src/MyGUI_WidgetManager.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Core" FILES
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Utility\\Logging" FILES
|
|
||||||
src/MyGUI_LogManager.cpp
|
|
||||||
src/MyGUI_LogStream.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files\\Utility" FILES
|
|
||||||
src/MyGUI_DataFileStream.cpp
|
|
||||||
src/MyGUI_DataStream.cpp
|
|
||||||
src/MyGUI_DynLib.cpp
|
|
||||||
src/MyGUI_Guid.cpp
|
|
||||||
src/MyGUI_RenderOut.cpp
|
|
||||||
src/MyGUI_TextIterator.cpp
|
|
||||||
src/MyGUI_TextureUtility.cpp
|
|
||||||
src/MyGUI_Timer.cpp
|
|
||||||
src/MyGUI_XmlDocument.cpp
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Source Files" FILES
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Widget\\Types" FILES
|
|
||||||
include/MyGUI_DDItemInfo.h
|
|
||||||
include/MyGUI_IBItemInfo.h
|
|
||||||
include/MyGUI_MenuItemType.h
|
|
||||||
include/MyGUI_MessageStyle.h
|
|
||||||
include/MyGUI_WidgetToolTip.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Widget\\Widget" FILES
|
|
||||||
include/MyGUI_Button.h
|
|
||||||
include/MyGUI_Canvas.h
|
|
||||||
include/MyGUI_ComboBox.h
|
|
||||||
include/MyGUI_DDContainer.h
|
|
||||||
include/MyGUI_Edit.h
|
|
||||||
include/MyGUI_HScroll.h
|
|
||||||
include/MyGUI_ItemBox.h
|
|
||||||
include/MyGUI_List.h
|
|
||||||
include/MyGUI_ListBox.h
|
|
||||||
include/MyGUI_ListCtrl.h
|
|
||||||
include/MyGUI_MenuBar.h
|
|
||||||
include/MyGUI_MenuCtrl.h
|
|
||||||
include/MyGUI_MenuItem.h
|
|
||||||
include/MyGUI_Message.h
|
|
||||||
include/MyGUI_MultiList.h
|
|
||||||
include/MyGUI_PopupMenu.h
|
|
||||||
include/MyGUI_Progress.h
|
|
||||||
include/MyGUI_ScrollView.h
|
|
||||||
include/MyGUI_StaticImage.h
|
|
||||||
include/MyGUI_StaticText.h
|
|
||||||
include/MyGUI_Tab.h
|
|
||||||
include/MyGUI_TabItem.h
|
|
||||||
include/MyGUI_VScroll.h
|
|
||||||
include/MyGUI_Widget.h
|
|
||||||
include/MyGUI_Window.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Widget\\Interfaces" FILES
|
|
||||||
include/MyGUI_IWidgetFactory.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Widget" FILES
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Utility\\Logging" FILES
|
|
||||||
include/MyGUI_LogManager.h
|
|
||||||
include/MyGUI_LogStream.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Utility" FILES
|
|
||||||
include/MyGUI_Bitwise.h
|
|
||||||
include/MyGUI_CoordConverter.h
|
|
||||||
include/MyGUI_DataFileStream.h
|
|
||||||
include/MyGUI_DataStream.h
|
|
||||||
include/MyGUI_Delegate.h
|
|
||||||
include/MyGUI_DelegateImplement.h
|
|
||||||
include/MyGUI_DynLib.h
|
|
||||||
include/MyGUI_Enumerator.h
|
|
||||||
include/MyGUI_EventPair.h
|
|
||||||
include/MyGUI_Guid.h
|
|
||||||
include/MyGUI_RenderOut.h
|
|
||||||
include/MyGUI_TextChangeHistory.h
|
|
||||||
include/MyGUI_TextIterator.h
|
|
||||||
include/MyGUI_TextureUtility.h
|
|
||||||
include/MyGUI_TextView.h
|
|
||||||
include/MyGUI_Timer.h
|
|
||||||
include/MyGUI_UString.h
|
|
||||||
include/MyGUI_Utility.h
|
|
||||||
include/MyGUI_WidgetTranslate.h
|
|
||||||
include/MyGUI_XmlDocument.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Common\\Interfaces" FILES
|
|
||||||
include/MyGUI_ICroppedRectangle.h
|
|
||||||
include/MyGUI_IDataStream.h
|
|
||||||
include/MyGUI_Instance.h
|
|
||||||
include/MyGUI_IObject.h
|
|
||||||
include/MyGUI_ISerializable.h
|
|
||||||
include/MyGUI_ITexture.h
|
|
||||||
include/MyGUI_IUnlinkWidget.h
|
|
||||||
include/MyGUI_IVertexBuffer.h
|
|
||||||
include/MyGUI_IWidgetCreator.h
|
|
||||||
include/MyGUI_Plugin.h
|
|
||||||
include/MyGUI_RTTI.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Common\\Base" FILES
|
|
||||||
include/MyGUI_BiIndexBase.h
|
|
||||||
include/MyGUI_ScrollViewBase.h
|
|
||||||
include/MyGUI_WidgetEvent.h
|
|
||||||
include/MyGUI_WidgetUserData.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Common" FILES
|
|
||||||
include/MyGUI.h
|
|
||||||
include/MyGUI_CastWidget.h
|
|
||||||
include/MyGUI_Common.h
|
|
||||||
include/MyGUI_Diagnostic.h
|
|
||||||
include/MyGUI_Exception.h
|
|
||||||
include/MyGUI_GenericFactory.h
|
|
||||||
include/MyGUI_Macros.h
|
|
||||||
include/MyGUI_Platform.h
|
|
||||||
include/MyGUI_Precompiled.h
|
|
||||||
include/MyGUI_Prerequest.h
|
|
||||||
include/MyGUI_RenderFormat.h
|
|
||||||
include/MyGUI_ResourceHolder.h
|
|
||||||
include/MyGUI_WidgetDefines.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\SubWidget\\Interfaces" FILES
|
|
||||||
include/MyGUI_IStateInfo.h
|
|
||||||
include/MyGUI_ISubWidget.h
|
|
||||||
include/MyGUI_ISubWidgetRect.h
|
|
||||||
include/MyGUI_ISubWidgetText.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\SubWidget" FILES
|
|
||||||
include/MyGUI_EditText.h
|
|
||||||
include/MyGUI_MainSkin.h
|
|
||||||
include/MyGUI_RawRect.h
|
|
||||||
include/MyGUI_RotatingSkin.h
|
|
||||||
include/MyGUI_SimpleText.h
|
|
||||||
include/MyGUI_SubSkin.h
|
|
||||||
include/MyGUI_TileRect.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\LayerItem\\Interfaces" FILES
|
|
||||||
include/MyGUI_ILayer.h
|
|
||||||
include/MyGUI_ILayerItem.h
|
|
||||||
include/MyGUI_ILayerNode.h
|
|
||||||
include/MyGUI_IRenderTarget.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\LayerItem" FILES
|
|
||||||
include/MyGUI_LayerItem.h
|
|
||||||
include/MyGUI_LayerNode.h
|
|
||||||
include/MyGUI_OverlappedLayer.h
|
|
||||||
include/MyGUI_RenderItem.h
|
|
||||||
include/MyGUI_SharedLayer.h
|
|
||||||
include/MyGUI_SharedLayerNode.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Controller" FILES
|
|
||||||
include/MyGUI_ActionController.h
|
|
||||||
include/MyGUI_ControllerEdgeHide.h
|
|
||||||
include/MyGUI_ControllerFadeAlpha.h
|
|
||||||
include/MyGUI_ControllerItem.h
|
|
||||||
include/MyGUI_ControllerPosition.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Resource\\Interface" FILES
|
|
||||||
include/MyGUI_IFont.h
|
|
||||||
include/MyGUI_IPointer.h
|
|
||||||
include/MyGUI_IResource.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Resource\\Data" FILES
|
|
||||||
include/MyGUI_ChildSkinInfo.h
|
|
||||||
include/MyGUI_FontData.h
|
|
||||||
include/MyGUI_MaskPickInfo.h
|
|
||||||
include/MyGUI_SubWidgetBinding.h
|
|
||||||
include/MyGUI_SubWidgetInfo.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Resource" FILES
|
|
||||||
include/MyGUI_ResourceImageSet.h
|
|
||||||
include/MyGUI_ResourceImageSetPointer.h
|
|
||||||
include/MyGUI_ResourceManualFont.h
|
|
||||||
include/MyGUI_ResourceManualPointer.h
|
|
||||||
include/MyGUI_ResourceSkin.h
|
|
||||||
include/MyGUI_ResourceTrueTypeFont.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Types" FILES
|
|
||||||
include/MyGUI_Align.h
|
|
||||||
include/MyGUI_Any.h
|
|
||||||
include/MyGUI_Colour.h
|
|
||||||
include/MyGUI_CommonStateInfo.h
|
|
||||||
include/MyGUI_ImageInfo.h
|
|
||||||
include/MyGUI_InputDefine.h
|
|
||||||
include/MyGUI_RenderTargetInfo.h
|
|
||||||
include/MyGUI_TCoord.h
|
|
||||||
include/MyGUI_TPoint.h
|
|
||||||
include/MyGUI_TRect.h
|
|
||||||
include/MyGUI_TSize.h
|
|
||||||
include/MyGUI_Types.h
|
|
||||||
include/MyGUI_Version.h
|
|
||||||
include/MyGUI_VertexData.h
|
|
||||||
include/MyGUI_WidgetStyle.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core\\Manager" FILES
|
|
||||||
include/MyGUI_ClipboardManager.h
|
|
||||||
include/MyGUI_ControllerManager.h
|
|
||||||
include/MyGUI_DataManager.h
|
|
||||||
include/MyGUI_DynLibManager.h
|
|
||||||
include/MyGUI_FactoryManager.h
|
|
||||||
include/MyGUI_FontManager.h
|
|
||||||
include/MyGUI_Gui.h
|
|
||||||
include/MyGUI_InputManager.h
|
|
||||||
include/MyGUI_LanguageManager.h
|
|
||||||
include/MyGUI_LayerManager.h
|
|
||||||
include/MyGUI_LayoutManager.h
|
|
||||||
include/MyGUI_PluginManager.h
|
|
||||||
include/MyGUI_PointerManager.h
|
|
||||||
include/MyGUI_RenderManager.h
|
|
||||||
include/MyGUI_ResourceManager.h
|
|
||||||
include/MyGUI_SkinManager.h
|
|
||||||
include/MyGUI_SubWidgetManager.h
|
|
||||||
include/MyGUI_WidgetManager.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files\\Core" FILES
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("Header Files" FILES
|
|
||||||
include/MyGUI_Allocator.h
|
|
||||||
include/MyGUI_CustomAllocator.h
|
|
||||||
)
|
|
||||||
SOURCE_GROUP("" FILES
|
|
||||||
CMakeLists.txt
|
|
||||||
)
|
|
92
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h
vendored
92
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h
vendored
|
@ -1,92 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Georgiy Evmenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_H__
|
|
||||||
#define __MYGUI_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Gui.h"
|
|
||||||
|
|
||||||
#include "MyGUI_Button.h"
|
|
||||||
#include "MyGUI_ComboBox.h"
|
|
||||||
#include "MyGUI_Edit.h"
|
|
||||||
#include "MyGUI_HScroll.h"
|
|
||||||
#include "MyGUI_List.h"
|
|
||||||
#include "MyGUI_StaticText.h"
|
|
||||||
#include "MyGUI_StaticImage.h"
|
|
||||||
#include "MyGUI_Tab.h"
|
|
||||||
#include "MyGUI_TabItem.h"
|
|
||||||
#include "MyGUI_VScroll.h"
|
|
||||||
#include "MyGUI_Window.h"
|
|
||||||
#include "MyGUI_Progress.h"
|
|
||||||
#include "MyGUI_Message.h"
|
|
||||||
#include "MyGUI_ItemBox.h"
|
|
||||||
#include "MyGUI_MultiList.h"
|
|
||||||
#include "MyGUI_MenuCtrl.h"
|
|
||||||
#include "MyGUI_MenuItem.h"
|
|
||||||
#include "MyGUI_PopupMenu.h"
|
|
||||||
#include "MyGUI_MenuBar.h"
|
|
||||||
#include "MyGUI_ScrollView.h"
|
|
||||||
#include "MyGUI_DDContainer.h"
|
|
||||||
#include "MyGUI_Canvas.h"
|
|
||||||
#include "MyGUI_ListCtrl.h"
|
|
||||||
#include "MyGUI_ListBox.h"
|
|
||||||
|
|
||||||
#include "MyGUI_InputManager.h"
|
|
||||||
#include "MyGUI_SubWidgetManager.h"
|
|
||||||
#include "MyGUI_ClipboardManager.h"
|
|
||||||
#include "MyGUI_LayerManager.h"
|
|
||||||
#include "MyGUI_LogManager.h"
|
|
||||||
#include "MyGUI_SkinManager.h"
|
|
||||||
#include "MyGUI_WidgetManager.h"
|
|
||||||
#include "MyGUI_LayoutManager.h"
|
|
||||||
#include "MyGUI_FontManager.h"
|
|
||||||
#include "MyGUI_PointerManager.h"
|
|
||||||
#include "MyGUI_PluginManager.h"
|
|
||||||
#include "MyGUI_DynLibManager.h"
|
|
||||||
#include "MyGUI_ControllerManager.h"
|
|
||||||
#include "MyGUI_LanguageManager.h"
|
|
||||||
#include "MyGUI_ResourceManager.h"
|
|
||||||
#include "MyGUI_RenderManager.h"
|
|
||||||
#include "MyGUI_DataManager.h"
|
|
||||||
#include "MyGUI_FactoryManager.h"
|
|
||||||
|
|
||||||
#include "MyGUI_ActionController.h"
|
|
||||||
#include "MyGUI_ControllerEdgeHide.h"
|
|
||||||
#include "MyGUI_ControllerFadeAlpha.h"
|
|
||||||
#include "MyGUI_ControllerPosition.h"
|
|
||||||
#include "MyGUI_CoordConverter.h"
|
|
||||||
#include "MyGUI_IResource.h"
|
|
||||||
#include "MyGUI_CastWidget.h"
|
|
||||||
#include "MyGUI_Any.h"
|
|
||||||
#include "MyGUI_MenuItemType.h"
|
|
||||||
#include "MyGUI_Version.h"
|
|
||||||
#include "MyGUI_XmlDocument.h"
|
|
||||||
#include "MyGUI_WidgetStyle.h"
|
|
||||||
#include "MyGUI_IObject.h"
|
|
||||||
#include "MyGUI_ISerializable.h"
|
|
||||||
#include "MyGUI_RenderOut.h"
|
|
||||||
|
|
||||||
#include "MyGUI_RawRect.h"
|
|
||||||
#include "MyGUI_RotatingSkin.h"
|
|
||||||
#include "MyGUI_TextureUtility.h"
|
|
||||||
|
|
||||||
#endif // __MYGUI_H__
|
|
|
@ -1,75 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_ACTION_CONTROLLER_H__
|
|
||||||
#define __MYGUI_ACTION_CONTROLLER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace action
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Function used for hiding widget with one of controller event */
|
|
||||||
void MYGUI_EXPORT actionWidgetHide(Widget* _widget);
|
|
||||||
|
|
||||||
/** Function used for showing widget with one of controller event */
|
|
||||||
void MYGUI_EXPORT actionWidgetShow(Widget* _widget);
|
|
||||||
|
|
||||||
/** Function used for destroying widget with one of controller event */
|
|
||||||
void MYGUI_EXPORT actionWidgetDestroy(Widget* _widget);
|
|
||||||
|
|
||||||
/** Function for ControllerPosition per frame action : Move with constant speed */
|
|
||||||
void MYGUI_EXPORT linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k);
|
|
||||||
|
|
||||||
/** Function for ControllerPosition per frame action : Move with accelerated speed
|
|
||||||
if N == 10 then this function is same as linearMoveFunction
|
|
||||||
if N > 10 speed will be increasing
|
|
||||||
if N < 10 speed will be decreasing
|
|
||||||
*/
|
|
||||||
template <int N>
|
|
||||||
inline void acceleratedMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
|
|
||||||
{
|
|
||||||
float k = (float)pow (_current_time, N/10.f /*3 by default as Accelerated and 0.4 by default as Slowed*/);
|
|
||||||
linearMoveFunction(_startRect, _destRect, _result, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Function for ControllerPosition per frame action : Move with accelerated speed a bit farther than necessary and then return it back */
|
|
||||||
template <int N>
|
|
||||||
inline void jumpMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
|
|
||||||
{
|
|
||||||
float k = pow (_current_time, 2) * (-2 - N/10.f) + _current_time * (3 + N/10.f);
|
|
||||||
linearMoveFunction(_startRect, _destRect, _result, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Function for ControllerPosition per frame action : Start with zero speed increasing half time and then decreasing to zero */
|
|
||||||
void MYGUI_EXPORT inertionalMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time);
|
|
||||||
|
|
||||||
} // namespace action
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ACTION_CONTROLLER_H__
|
|
202
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h
vendored
202
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h
vendored
|
@ -1,202 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 08/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_ALIGN_H__
|
|
||||||
#define __MYGUI_ALIGN_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Macros.h"
|
|
||||||
#include "MyGUI_Diagnostic.h"
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT Align
|
|
||||||
{
|
|
||||||
enum Enum
|
|
||||||
{
|
|
||||||
HCenter = MYGUI_FLAG_NONE, /**< center horizontally */
|
|
||||||
VCenter = MYGUI_FLAG_NONE, /**< center vertically */
|
|
||||||
Center = HCenter | VCenter, /**< center in the dead center */
|
|
||||||
|
|
||||||
Left = MYGUI_FLAG(1), /**< value from the left (and center vertically) */
|
|
||||||
Right = MYGUI_FLAG(2), /**< value from the right (and center vertically) */
|
|
||||||
HStretch = Left | Right, /**< stretch horizontally proportionate to parent window (and center vertically) */
|
|
||||||
|
|
||||||
Top = MYGUI_FLAG(3), /**< value from the top (and center horizontally) */
|
|
||||||
Bottom = MYGUI_FLAG(4), /**< value from the bottom (and center horizontally) */
|
|
||||||
VStretch = Top | Bottom, /**< stretch vertically proportionate to parent window (and center horizontally) */
|
|
||||||
|
|
||||||
Stretch = HStretch | VStretch, /**< stretch proportionate to parent window */
|
|
||||||
Default = Left | Top, /**< default value (value from left and top) */
|
|
||||||
|
|
||||||
HRelative = MYGUI_FLAG(5),
|
|
||||||
VRelative = MYGUI_FLAG(6),
|
|
||||||
Relative = HRelative | VRelative
|
|
||||||
};
|
|
||||||
|
|
||||||
Align(Enum _value = Default) : value(_value) { }
|
|
||||||
|
|
||||||
bool isHCenter() const { return HCenter == (value & ((int)HStretch | (int)HRelative)); }
|
|
||||||
bool isVCenter() const { return VCenter == (value & ((int)VStretch | (int)VRelative)); }
|
|
||||||
bool isCenter() const { return Center == (value & ((int)Stretch | (int)Relative)); }
|
|
||||||
|
|
||||||
bool isLeft() const { return Left == (value & ((int)HStretch | (int)HRelative)); }
|
|
||||||
bool isRight() const { return Right == (value & ((int)HStretch | (int)HRelative)); }
|
|
||||||
bool isHStretch() const { return HStretch == (value & ((int)HStretch | (int)HRelative)); }
|
|
||||||
|
|
||||||
bool isTop() const { return Top == (value & ((int)VStretch | (int)VRelative)); }
|
|
||||||
bool isBottom() const { return (Bottom == (value & ((int)VStretch | (int)VRelative))); }
|
|
||||||
bool isVStretch() const { return (VStretch == (value & ((int)VStretch | (int)VRelative))); }
|
|
||||||
|
|
||||||
bool isStretch() const { return (Stretch == (value & ((int)Stretch | (int)Relative))); }
|
|
||||||
bool isDefault() const { return (Default == (value & ((int)Stretch | (int)Relative))); }
|
|
||||||
|
|
||||||
bool isHRelative() const { return HRelative == (value & (int)HRelative); }
|
|
||||||
bool isVRelative() const { return VRelative == (value & (int)VRelative); }
|
|
||||||
bool isRelative() const { return Relative == (value & (int)Relative); }
|
|
||||||
|
|
||||||
Align& operator |= (Align const& _other) { value = Enum(int(value) | int(_other.value)); return *this; }
|
|
||||||
friend Align operator | (Enum const& a, Enum const& b) { return Align(Enum(int(a) | int(b))); }
|
|
||||||
friend Align operator | (Align const& a, Align const& b) { return Align(Enum(int(a.value) | int(b.value))); }
|
|
||||||
|
|
||||||
friend bool operator == (Align const& a, Align const& b) { return a.value == b.value; }
|
|
||||||
friend bool operator != (Align const& a, Align const& b) { return a.value != b.value; }
|
|
||||||
|
|
||||||
typedef std::map<std::string, int> MapAlign;
|
|
||||||
|
|
||||||
static Align parse(const std::string& _value)
|
|
||||||
{
|
|
||||||
Align result(Enum(0));
|
|
||||||
const MapAlign& map_names = result.getValueNames();
|
|
||||||
const std::vector<std::string>& vec = utility::split(_value);
|
|
||||||
for (size_t pos=0; pos<vec.size(); pos++)
|
|
||||||
{
|
|
||||||
MapAlign::const_iterator iter = map_names.find(vec[pos]);
|
|
||||||
if (iter != map_names.end())
|
|
||||||
{
|
|
||||||
result.value = Enum(int(result.value) | int(iter->second));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string print() const
|
|
||||||
{
|
|
||||||
std::string result;
|
|
||||||
|
|
||||||
if (value & Left)
|
|
||||||
{
|
|
||||||
if (value & Right) result = "HStretch";
|
|
||||||
else result = "Left";
|
|
||||||
}
|
|
||||||
else if (value & Right) result = "Right";
|
|
||||||
else result = "HCenter";
|
|
||||||
|
|
||||||
if (value & Top)
|
|
||||||
{
|
|
||||||
if (value & Bottom) result += " VStretch";
|
|
||||||
else result += " Top";
|
|
||||||
}
|
|
||||||
else if (value & Bottom) result += " Bottom";
|
|
||||||
else result += " VCenter";
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::ostream& operator << ( std::ostream& _stream, const Align& _value )
|
|
||||||
{
|
|
||||||
_stream << _value.print();
|
|
||||||
return _stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::istream& operator >> ( std::istream& _stream, Align& _value )
|
|
||||||
{
|
|
||||||
_value.value = Enum(0);
|
|
||||||
std::string value;
|
|
||||||
_stream >> value;
|
|
||||||
|
|
||||||
const MapAlign& map_names = _value.getValueNames();
|
|
||||||
MapAlign::const_iterator iter = map_names.find(value);
|
|
||||||
if (iter != map_names.end())
|
|
||||||
_value.value = Enum(int(_value.value) | int(iter->second));
|
|
||||||
|
|
||||||
|
|
||||||
if (!_stream.eof())
|
|
||||||
{
|
|
||||||
std::string value2;
|
|
||||||
_stream >> value2;
|
|
||||||
iter = map_names.find(value2);
|
|
||||||
if (iter != map_names.end())
|
|
||||||
_value.value = Enum(int(_value.value) | int(iter->second));
|
|
||||||
}
|
|
||||||
|
|
||||||
return _stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
const MapAlign& getValueNames() const
|
|
||||||
{
|
|
||||||
static MapAlign map_names;
|
|
||||||
|
|
||||||
if (map_names.empty())
|
|
||||||
{
|
|
||||||
// OBSOLETE
|
|
||||||
map_names["ALIGN_HCENTER"] = HCenter;
|
|
||||||
map_names["ALIGN_VCENTER"] = VCenter;
|
|
||||||
map_names["ALIGN_CENTER"] = Center;
|
|
||||||
map_names["ALIGN_LEFT"] = Left;
|
|
||||||
map_names["ALIGN_RIGHT"] = Right;
|
|
||||||
map_names["ALIGN_HSTRETCH"] = HStretch;
|
|
||||||
map_names["ALIGN_TOP"] = Top;
|
|
||||||
map_names["ALIGN_BOTTOM"] = Bottom;
|
|
||||||
map_names["ALIGN_VSTRETCH"] = VStretch;
|
|
||||||
map_names["ALIGN_STRETCH"] = Stretch;
|
|
||||||
map_names["ALIGN_DEFAULT"] = Default;
|
|
||||||
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, HCenter);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, VCenter);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Center);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Left);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Right);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, HStretch);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Top);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Bottom);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, VStretch);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Stretch);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Default);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, HRelative);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, VRelative);
|
|
||||||
MYGUI_REGISTER_VALUE(map_names, Relative);
|
|
||||||
}
|
|
||||||
|
|
||||||
return map_names;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
Enum value;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ALIGN_H__
|
|
|
@ -1,89 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 05/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_ALLOCATOR_H__
|
|
||||||
#define __MYGUI_ALLOCATOR_H__
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class Allocator
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// typedefs
|
|
||||||
typedef T value_type;
|
|
||||||
typedef value_type* pointer;
|
|
||||||
typedef const value_type* const_pointer;
|
|
||||||
typedef value_type& reference;
|
|
||||||
typedef const value_type& const_reference;
|
|
||||||
typedef std::size_t size_type;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
|
|
||||||
public:
|
|
||||||
// convert an allocator<T> to allocator<U>
|
|
||||||
template<typename U>
|
|
||||||
struct rebind
|
|
||||||
{
|
|
||||||
typedef Allocator<U> other;
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
inline explicit Allocator() { }
|
|
||||||
inline ~Allocator() { }
|
|
||||||
template<typename U>
|
|
||||||
inline explicit Allocator(Allocator<U> const&) { }
|
|
||||||
|
|
||||||
// address
|
|
||||||
inline pointer address(reference r) { return &r; }
|
|
||||||
inline const_pointer address(const_reference r) { return &r; }
|
|
||||||
|
|
||||||
// memory allocation
|
|
||||||
inline pointer allocate(size_type cnt, typename std::allocator<void>::const_pointer = 0)
|
|
||||||
{
|
|
||||||
return reinterpret_cast<pointer>(::operator new (cnt * sizeof (T)));
|
|
||||||
}
|
|
||||||
inline void deallocate(pointer p, size_type)
|
|
||||||
{
|
|
||||||
::operator delete (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
// size
|
|
||||||
inline size_type max_size() const
|
|
||||||
{
|
|
||||||
return std::numeric_limits<size_type>::max() / sizeof(T);
|
|
||||||
}
|
|
||||||
|
|
||||||
// construction/destruction
|
|
||||||
inline void construct(pointer p, const T& t) { new (p) T(t); }
|
|
||||||
inline void destroy(pointer p) { p->~T(); }
|
|
||||||
|
|
||||||
inline bool operator==(Allocator const&) { return true; }
|
|
||||||
inline bool operator!=(Allocator const& a) { return !operator==(a); }
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ALLOCATOR_H__
|
|
213
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Any.h
vendored
213
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Any.h
vendored
|
@ -1,213 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 10/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// -- Based on boost::any, original copyright information follows --
|
|
||||||
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
|
||||||
// (See at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
// -- End original copyright --
|
|
||||||
|
|
||||||
#ifndef __MYGUI_ANY_H__
|
|
||||||
#define __MYGUI_ANY_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Diagnostic.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <typeinfo>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/** @example "Class Any usage"
|
|
||||||
@code
|
|
||||||
void f()
|
|
||||||
{
|
|
||||||
// RU: тестовый класс, с простыми типами все аналогично
|
|
||||||
// EN: test class, with simple types all is similar
|
|
||||||
struct Data { int value; };
|
|
||||||
|
|
||||||
// RU: экземпляр и инициализация
|
|
||||||
// EN: instance and initialization
|
|
||||||
Data data;
|
|
||||||
data.value = 0xDEAD;
|
|
||||||
|
|
||||||
// RU: создастся копия класса Data
|
|
||||||
// EN: copy of class Data will be created
|
|
||||||
MyGUI::Any any = data;
|
|
||||||
// RU: копия класса Data
|
|
||||||
// EN: copy of class Data
|
|
||||||
Data copy_data = *any.castType<Data>();
|
|
||||||
// RU: теперь value == 0xDEAD
|
|
||||||
// EN: now value == 0xDEAD
|
|
||||||
int value = copy_data.value;
|
|
||||||
|
|
||||||
|
|
||||||
// RU: создастся копия указателя на класс Data
|
|
||||||
// EN: copy of pointer on class Data will be created
|
|
||||||
any = &data;
|
|
||||||
// RU: копия указателя на класс Data и конкретно на объект data
|
|
||||||
// EN: copy of pointer on class Data and on object data
|
|
||||||
Data * copy_ptr = *any.castType<Data*>();
|
|
||||||
// RU: теперь data.value == 0
|
|
||||||
// EN: now value == 0
|
|
||||||
copy_ptr->value = 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
@endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
class MYGUI_EXPORT Any
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
struct AnyEmpty { };
|
|
||||||
|
|
||||||
public:
|
|
||||||
static AnyEmpty Null;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Any() :
|
|
||||||
mContent(nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType> Any(const ValueType& value) :
|
|
||||||
mContent(new Holder<ValueType>(value))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Any(const Any::AnyEmpty& value) :
|
|
||||||
mContent(nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Any(const Any& other) :
|
|
||||||
mContent(other.mContent ? other.mContent->clone() : nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~Any()
|
|
||||||
{
|
|
||||||
delete mContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
Any& swap(Any& rhs)
|
|
||||||
{
|
|
||||||
std::swap(mContent, rhs.mContent);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType> Any& operator = (const ValueType& rhs)
|
|
||||||
{
|
|
||||||
Any(rhs).swap(*this);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Any& operator = (const Any::AnyEmpty& rhs)
|
|
||||||
{
|
|
||||||
delete mContent;
|
|
||||||
mContent = nullptr;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Any& operator = (const Any& rhs)
|
|
||||||
{
|
|
||||||
Any(rhs).swap(*this);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool empty() const
|
|
||||||
{
|
|
||||||
return !mContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::type_info& getType() const
|
|
||||||
{
|
|
||||||
return mContent ? mContent->getType() : typeid(void);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
ValueType * castType(bool _throw = true) const
|
|
||||||
{
|
|
||||||
if (this->getType() == typeid(ValueType))
|
|
||||||
{
|
|
||||||
return &static_cast<Any::Holder<ValueType> *>(this->mContent)->held;
|
|
||||||
}
|
|
||||||
MYGUI_ASSERT(!_throw, "Bad cast from type '" << getType().name() << "' to '" << typeid(ValueType).name() << "'");
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void * castUnsafe() const
|
|
||||||
{
|
|
||||||
return mContent ? static_cast<Any::Holder<void *> *>(this->mContent)->held : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
class Placeholder
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~Placeholder() { }
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual const std::type_info& getType() const = 0;
|
|
||||||
virtual Placeholder * clone() const = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename ValueType> class Holder : public Placeholder
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Holder(const ValueType& value) :
|
|
||||||
held(value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual const std::type_info& getType() const
|
|
||||||
{
|
|
||||||
return typeid(ValueType);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual Placeholder * clone() const
|
|
||||||
{
|
|
||||||
return new Holder(held);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
ValueType held;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Holder& operator=(const Holder &);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private: // representation
|
|
||||||
Placeholder * mContent;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ANY_H__
|
|
|
@ -1,216 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 10/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_BIINDEX_BASE_H__
|
|
||||||
#define __MYGUI_BIINDEX_BASE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class BiIndexBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~BiIndexBase() { }
|
|
||||||
protected:
|
|
||||||
|
|
||||||
size_t getIndexCount() { return mIndexFace.size(); }
|
|
||||||
|
|
||||||
size_t insertItemAt(size_t _index)
|
|
||||||
{
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
MYGUI_ASSERT_RANGE_INSERT(_index, mIndexFace.size(), "BiIndexBase::insertItemAt");
|
|
||||||
checkIndexes();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_index == MyGUI::ITEM_NONE) _index = mIndexFace.size();
|
|
||||||
|
|
||||||
size_t index;
|
|
||||||
|
|
||||||
if (_index == mIndexFace.size())
|
|
||||||
{
|
|
||||||
// для вставки айтема
|
|
||||||
index = mIndexFace.size();
|
|
||||||
|
|
||||||
mIndexFace.push_back(_index);
|
|
||||||
mIndexBack.push_back(_index);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// для вставки айтема
|
|
||||||
index = mIndexFace[_index];
|
|
||||||
|
|
||||||
size_t count = mIndexFace.size();
|
|
||||||
for (size_t pos=0; pos<count; ++pos)
|
|
||||||
{
|
|
||||||
if (mIndexFace[pos] >= index) mIndexFace[pos]++;
|
|
||||||
}
|
|
||||||
mIndexFace.insert(mIndexFace.begin() + _index, index);
|
|
||||||
|
|
||||||
count ++;
|
|
||||||
mIndexBack.push_back(0);
|
|
||||||
for (size_t pos=0; pos<count; ++pos)
|
|
||||||
{
|
|
||||||
mIndexBack[mIndexFace[pos]] = pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
checkIndexes();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t removeItemAt(size_t _index)
|
|
||||||
{
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
MYGUI_ASSERT_RANGE(_index, mIndexFace.size(), "BiIndexBase::removeItemAt");
|
|
||||||
checkIndexes();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// для удаления айтема
|
|
||||||
size_t index = mIndexFace[_index];
|
|
||||||
|
|
||||||
mIndexFace.erase(mIndexFace.begin() + _index);
|
|
||||||
mIndexBack.pop_back();
|
|
||||||
|
|
||||||
size_t count = mIndexFace.size();
|
|
||||||
for (size_t pos=0; pos<count; ++pos)
|
|
||||||
{
|
|
||||||
if (mIndexFace[pos] > index) mIndexFace[pos]--;
|
|
||||||
mIndexBack[mIndexFace[pos]] = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
checkIndexes();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeAllItems()
|
|
||||||
{
|
|
||||||
mIndexFace.clear();
|
|
||||||
mIndexBack.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
// на входе индексы пользователя, на выходе реальные индексы
|
|
||||||
size_t convertToBack(size_t _index) const
|
|
||||||
{
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
MYGUI_ASSERT_RANGE_AND_NONE(_index, mIndexFace.size(), "BiIndexBase::convertToBack");
|
|
||||||
#endif
|
|
||||||
return _index == ITEM_NONE ? ITEM_NONE : mIndexFace[_index];
|
|
||||||
}
|
|
||||||
|
|
||||||
// на входе индексы реальные, на выходе, то что видит пользователь
|
|
||||||
size_t convertToFace(size_t _index) const
|
|
||||||
{
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
MYGUI_ASSERT_RANGE_AND_NONE(_index, mIndexFace.size(), "BiIndexBase::convertToFace");
|
|
||||||
#endif
|
|
||||||
return _index == ITEM_NONE ? ITEM_NONE : mIndexBack[_index];
|
|
||||||
}
|
|
||||||
|
|
||||||
// меняет местами два индекса, индексы со стороны пользователя
|
|
||||||
void swapItemsFaceAt(size_t _index1, size_t _index2)
|
|
||||||
{
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
MYGUI_ASSERT_RANGE(_index1, mIndexFace.size(), "BiIndexBase::swapItemsFaceAt");
|
|
||||||
MYGUI_ASSERT_RANGE(_index2, mIndexFace.size(), "BiIndexBase::swapItemsFaceAt");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::swap(mIndexFace[_index1], mIndexFace[_index2]);
|
|
||||||
std::swap(mIndexBack[mIndexFace[_index1]], mIndexBack[mIndexFace[_index2]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// меняет местами два индекса, индексы со сторонны данных
|
|
||||||
void swapItemsBackAt(size_t _index1, size_t _index2)
|
|
||||||
{
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
MYGUI_ASSERT_RANGE(_index1, mIndexFace.size(), "BiIndexBase::swapItemsBackAt");
|
|
||||||
MYGUI_ASSERT_RANGE(_index2, mIndexFace.size(), "BiIndexBase::swapItemsBackAt");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::swap(mIndexBack[_index1], mIndexBack[_index2]);
|
|
||||||
std::swap(mIndexFace[mIndexBack[_index1]], mIndexFace[mIndexBack[_index2]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
|
|
||||||
void checkIndexes()
|
|
||||||
{
|
|
||||||
assert(mIndexFace.size() == mIndexBack.size());
|
|
||||||
|
|
||||||
// проверяем на уникальность каждого индекса в маппинге
|
|
||||||
std::vector<bool> vec;
|
|
||||||
size_t count = mIndexFace.size();
|
|
||||||
|
|
||||||
vec.reserve(count);
|
|
||||||
for (size_t pos=0; pos<count; ++pos) vec.push_back(false);
|
|
||||||
|
|
||||||
for (size_t pos=0; pos<count; ++pos)
|
|
||||||
{
|
|
||||||
// максимум
|
|
||||||
size_t index = mIndexBack[pos];
|
|
||||||
if (index >= count) throw new std::exception();
|
|
||||||
|
|
||||||
// максимум
|
|
||||||
index = mIndexFace[pos];
|
|
||||||
if (index >= count) throw new std::exception();
|
|
||||||
|
|
||||||
if (vec[index]) throw new std::exception();
|
|
||||||
vec[index] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t pos=0; pos<count; ++pos)
|
|
||||||
{
|
|
||||||
if (!vec[pos]) throw new std::exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
// проверяем на взаимоссылаемость индексов
|
|
||||||
for (size_t pos=0; pos<count; ++pos)
|
|
||||||
{
|
|
||||||
size_t index = mIndexFace[pos];
|
|
||||||
if (mIndexBack[index] != pos) throw new std::exception();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef std::vector<size_t> VectorSizeT;
|
|
||||||
|
|
||||||
// маппинг с индексов, которые видны наружу
|
|
||||||
// на индексы которые реально используются данными
|
|
||||||
VectorSizeT mIndexFace;
|
|
||||||
|
|
||||||
// маппинг с индексов, которые используют данные
|
|
||||||
// на индексы которые виндны наружу
|
|
||||||
VectorSizeT mIndexBack;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_BIINDEX_BASE_H__
|
|
|
@ -1,78 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_BITWISE_H__
|
|
||||||
#define __MYGUI_BITWISE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class Bitwise
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/** Returns the closest power-of-two number greater or equal to value.
|
|
||||||
*/
|
|
||||||
template<typename Type>
|
|
||||||
static MYGUI_FORCEINLINE Type firstPO2From(Type _value)
|
|
||||||
{
|
|
||||||
--_value;
|
|
||||||
_value |= _value >> 16;
|
|
||||||
_value |= _value >> 8;
|
|
||||||
_value |= _value >> 4;
|
|
||||||
_value |= _value >> 2;
|
|
||||||
_value |= _value >> 1;
|
|
||||||
++_value;
|
|
||||||
return _value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Determines whether the number is power-of-two or not. */
|
|
||||||
template<typename Type>
|
|
||||||
static MYGUI_FORCEINLINE bool isPO2(Type _value)
|
|
||||||
{
|
|
||||||
return (_value & (_value-1)) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns the number of bits a pattern must be shifted right by to
|
|
||||||
remove right-hand zeros.
|
|
||||||
*/
|
|
||||||
template<typename Type>
|
|
||||||
static MYGUI_FORCEINLINE size_t getBitShift(Type _mask)
|
|
||||||
{
|
|
||||||
if (_mask == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
size_t result = 0;
|
|
||||||
while ((_mask & 1) == 0)
|
|
||||||
{
|
|
||||||
++result;
|
|
||||||
_mask >>= 1;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_BITWISE_H__
|
|
|
@ -1,111 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_BUTTON_H__
|
|
||||||
#define __MYGUI_BUTTON_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_StaticText.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT Button :
|
|
||||||
public StaticText
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( Button )
|
|
||||||
|
|
||||||
public:
|
|
||||||
Button();
|
|
||||||
|
|
||||||
//! OLD Set button check state
|
|
||||||
void setButtonPressed(bool _value) { setStateCheck(_value); }
|
|
||||||
//! OLD Get buton check
|
|
||||||
bool getButtonPressed() { return getStateCheck(); }
|
|
||||||
|
|
||||||
//! Set button check state
|
|
||||||
void setStateCheck(bool _value);
|
|
||||||
|
|
||||||
//! Get buton check
|
|
||||||
bool getStateCheck() { return mIsStateCheck; }
|
|
||||||
|
|
||||||
//! Set image index (image should be defined in skin)
|
|
||||||
void setImageIndex(size_t _value);
|
|
||||||
//! Get image index
|
|
||||||
size_t getImageIndex();
|
|
||||||
|
|
||||||
/** Enable or disable Image mode\n
|
|
||||||
Image mode: when button state changed Image on button also change it's picture.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setModeImage(bool _value);
|
|
||||||
/** Get Image mode flag */
|
|
||||||
bool getModeImage() { return mModeImage; }
|
|
||||||
|
|
||||||
/** Get pointer to glyph image for this button (if it exist in button skin) */
|
|
||||||
StaticImage* getStaticImage() { return mImage; }
|
|
||||||
|
|
||||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
void _setMouseFocus(bool _focus);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~Button();
|
|
||||||
|
|
||||||
virtual void baseChangeWidgetSkin(ResourceSkin* _info);
|
|
||||||
|
|
||||||
virtual void onMouseLostFocus(Widget* _new);
|
|
||||||
virtual void onMouseSetFocus(Widget* _old);
|
|
||||||
virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
|
|
||||||
virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
|
|
||||||
|
|
||||||
virtual void baseUpdateEnable();
|
|
||||||
|
|
||||||
bool _setState(const std::string& _value);
|
|
||||||
void setImageResource(const std::string& _name);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateButtonState();
|
|
||||||
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// нажата ли кнопка
|
|
||||||
bool mIsMousePressed;
|
|
||||||
// в фокусе ли кнопка
|
|
||||||
bool mIsMouseFocus;
|
|
||||||
// статус кнопки нажата или нет
|
|
||||||
bool mIsStateCheck;
|
|
||||||
|
|
||||||
StaticImage* mImage;
|
|
||||||
bool mModeImage;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_BUTTON_H__
|
|
|
@ -1,246 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Alexander Ptakhin
|
|
||||||
@date 01/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CANVAS_H__
|
|
||||||
#define __MYGUI_CANVAS_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Widget.h"
|
|
||||||
#include "MyGUI_ITexture.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget wrapper over Texture - shows the texture.
|
|
||||||
* Implemented: resizing of texture (see TextureResizeMode); recovery after lossing device;
|
|
||||||
*/
|
|
||||||
class MYGUI_EXPORT Canvas :
|
|
||||||
public Widget,
|
|
||||||
public ITextureInvalidateListener
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( Canvas )
|
|
||||||
|
|
||||||
public:
|
|
||||||
Canvas();
|
|
||||||
|
|
||||||
struct Event
|
|
||||||
{
|
|
||||||
Event( bool _textureChanged, bool _widgetResized, bool _requested ) :
|
|
||||||
textureChanged( _textureChanged ),
|
|
||||||
widgetResized( _widgetResized ),
|
|
||||||
requested( _requested )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool textureChanged;
|
|
||||||
bool widgetResized;
|
|
||||||
|
|
||||||
/// This update was caused by calling updateTexture();
|
|
||||||
bool requested;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef delegates::CDelegate1<Canvas*> EventInfo_Canvas;
|
|
||||||
typedef delegates::CDelegate2<Canvas*, Event> EventInfo_CanvasEvent;
|
|
||||||
|
|
||||||
//FIXME
|
|
||||||
/**
|
|
||||||
Available resize and view modes of texture
|
|
||||||
@remarks PT - Power of Two (size)
|
|
||||||
*/
|
|
||||||
enum TextureResizeMode
|
|
||||||
{
|
|
||||||
//
|
|
||||||
TRM_PT_CONST_SIZE, /// Texture doesn't resizes and fills all widget space
|
|
||||||
TRM_PT_VIEW_REQUESTED, /// You can view all pixels of texture, texture cropped by sizes of widget
|
|
||||||
TRM_PT_VIEW_ALL /// Texture resizes and fills all widget space
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// Creates texture
|
|
||||||
void createTexture( TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() );
|
|
||||||
|
|
||||||
/// Creates texture
|
|
||||||
void createTexture( int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() );
|
|
||||||
|
|
||||||
/// Creates texture
|
|
||||||
void createTexture( const IntSize& _size, TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() );
|
|
||||||
|
|
||||||
/// Destroys texture
|
|
||||||
void destroyTexture();
|
|
||||||
|
|
||||||
/// Call user delegate update and removes old texture if it isn't original.
|
|
||||||
void updateTexture();
|
|
||||||
|
|
||||||
/// Locks hardware pixel buffer.
|
|
||||||
void* lock(TextureUsage _usage = TextureUsage::Write);
|
|
||||||
|
|
||||||
/// Unlocks hardware pixel buffer.
|
|
||||||
void unlock();
|
|
||||||
|
|
||||||
/// Checks lockness of hardware _pixel buffer.
|
|
||||||
bool isLocked() const { return mTexture->isLocked(); }
|
|
||||||
|
|
||||||
/// Returns real width of texture.
|
|
||||||
int getTextureRealWidth() const { return (int) mTexture->getWidth(); }
|
|
||||||
|
|
||||||
/// Returns real height of texture.
|
|
||||||
int getTextureRealHeight() const { return (int) mTexture->getHeight(); }
|
|
||||||
|
|
||||||
/// Returns real _size of texture.
|
|
||||||
IntSize getTextureRealSize() const { return IntSize( getTextureRealWidth(), getTextureRealHeight() ); }
|
|
||||||
|
|
||||||
/// Returns needed width while creating texture.
|
|
||||||
int getTextureSrcWidth() const { return mReqTexSize.width; }
|
|
||||||
|
|
||||||
/// Returns needed height while creating texture.
|
|
||||||
int getTextureSrcHeight() const { return mReqTexSize.height; }
|
|
||||||
|
|
||||||
/// Returns needed sizes while creating texture.
|
|
||||||
IntSize getTextureSrcSize() const { return mReqTexSize; }
|
|
||||||
|
|
||||||
/// Returns needed sizes while creating texture.
|
|
||||||
PixelFormat getTextureFormat() const { return mTexture->getFormat(); }
|
|
||||||
|
|
||||||
/// Returns name of the current texture.
|
|
||||||
const std::string& getTextureName() const { return mTexture->getName(); }
|
|
||||||
|
|
||||||
//! @copydoc Widget::setSize(const IntSize& _value)
|
|
||||||
virtual void setSize(const IntSize& _value);
|
|
||||||
//! @copydoc Widget::setCoord(const IntCoord& _value)
|
|
||||||
virtual void setCoord(const IntCoord& _value);
|
|
||||||
|
|
||||||
/** @copydoc Widget::setSize(int _width, int _height) */
|
|
||||||
void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); }
|
|
||||||
/** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */
|
|
||||||
void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); }
|
|
||||||
|
|
||||||
/// Returns resize mode
|
|
||||||
TextureResizeMode getResizeMode() const { return mTexResizeMode; }
|
|
||||||
|
|
||||||
/// Sets resize mode of texture \sa TextureResizeMode
|
|
||||||
void setResizeMode( TextureResizeMode _set ) { mTexResizeMode = _set; }
|
|
||||||
|
|
||||||
/// Checks if the texture has the source (required by user) size, otherwise real texture size are bigger.
|
|
||||||
bool isTextureSrcSize() const;
|
|
||||||
|
|
||||||
/// Returns true if the texture was created (and exists), otherwise false
|
|
||||||
bool isTextureCreated() const { return mTexture != nullptr; }
|
|
||||||
|
|
||||||
/// Returns true if we own the texture, otherwise false. \sa mManaged
|
|
||||||
bool isTextureManaged() const { return mTexManaged; }
|
|
||||||
|
|
||||||
/// Reurns interface texture.
|
|
||||||
ITexture* getTexture() { return mTexture; }
|
|
||||||
|
|
||||||
/// Sets the texture managed @remarks Be careful with assigning managed status to texture, which wasn't created in Canvas! \sa mManaged
|
|
||||||
void setTextureManaged( bool _value ) { mTexManaged = _value; }
|
|
||||||
|
|
||||||
/// Returns default GUI texture usage
|
|
||||||
static TextureUsage getDefaultTextureUsage() { return TextureUsage::Stream | TextureUsage::Write; }
|
|
||||||
|
|
||||||
/// Returns default GUI texture format
|
|
||||||
static PixelFormat getDefaultTextureFormat() { return PixelFormat::R8G8B8A8; }
|
|
||||||
|
|
||||||
/*event:*/
|
|
||||||
/** Event : Notify user texture instance will be changed \sa requestUpdateCanvas\n
|
|
||||||
signature : void method(MyGUI::Canvas* _canvas)\n
|
|
||||||
@param _canvas, which will be updated
|
|
||||||
*/
|
|
||||||
EventInfo_Canvas eventPreTextureChanges;
|
|
||||||
|
|
||||||
/** Event : Texture instance was changed (May be caused by resizing texture or lossing device). User have to update all references to new instance of texture.\n
|
|
||||||
signature : void method(MyGUI::Canvas* _canvas, MyGUI::Canvas::Event _event)\n
|
|
||||||
@param _canvas, which needs to update
|
|
||||||
@param _event
|
|
||||||
*/
|
|
||||||
EventInfo_CanvasEvent requestUpdateCanvas;
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~Canvas();
|
|
||||||
|
|
||||||
/// Destroys texture
|
|
||||||
void _destroyTexture( bool _sendEvent );
|
|
||||||
|
|
||||||
/// Update entered parameters according to current texture resize mode(size) and restore (if can) parameters of usage and format from texture
|
|
||||||
void validate( int& _width, int& _height, TextureUsage& _usage, PixelFormat& _format ) const;
|
|
||||||
|
|
||||||
/// Creates the texture itself
|
|
||||||
void createExactTexture( int _width, int _height, TextureUsage _usage, PixelFormat _format );
|
|
||||||
|
|
||||||
/// Checks if we need to create a texture with such sizes.
|
|
||||||
bool checkCreate( int _width, int _height ) const;
|
|
||||||
|
|
||||||
/// Calls when resize widget
|
|
||||||
void resize( const IntSize& _size );
|
|
||||||
|
|
||||||
/// Correct texture uv-coordinates
|
|
||||||
void correctUV();
|
|
||||||
|
|
||||||
//! @copydoc Widget::baseChangeWidgetSkin(ResourceSkin* _info)
|
|
||||||
void baseChangeWidgetSkin( ResourceSkin* _info );
|
|
||||||
|
|
||||||
//! @copydoc Widget::initialiseWidgetSkin(ResourceSkin* _info)
|
|
||||||
void initialiseWidgetSkin( ResourceSkin* _info );
|
|
||||||
|
|
||||||
//! @copydoc Widget::shutdownWidgetSkin()
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
/// For updating once per frame.
|
|
||||||
void frameAdvise( bool _advise );
|
|
||||||
|
|
||||||
/// For updating once per frame.
|
|
||||||
void frameEntered( float _time );
|
|
||||||
|
|
||||||
virtual void textureInvalidate(ITexture* _texture);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/// Current texture
|
|
||||||
ITexture* mTexture;
|
|
||||||
|
|
||||||
/// Requested bu user sizes
|
|
||||||
IntSize mReqTexSize;
|
|
||||||
|
|
||||||
/// Generated texture name
|
|
||||||
std::string mGenTexName;
|
|
||||||
|
|
||||||
/// Texture resize mode \sa TextureResizeMode
|
|
||||||
TextureResizeMode mTexResizeMode;
|
|
||||||
|
|
||||||
/// Saved pointer from last calling lock. \sa lock
|
|
||||||
uint8* mTexData;
|
|
||||||
|
|
||||||
/// true if we own the texture (can delete it or replace by another instance), otherwise false
|
|
||||||
bool mTexManaged;
|
|
||||||
|
|
||||||
/// For updating once per frame. True state means updating before next frame starts.
|
|
||||||
bool mFrameAdvise;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_CANVAS_H__
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 12/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CAST_WIDGET_H__
|
|
||||||
#define __MYGUI_CAST_WIDGET_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Widget.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
// шаблонный класс для проверки типа виджета
|
|
||||||
template <typename T>
|
|
||||||
MYGUI_OBSOLETE("use : template<typename Type> Type* Widget::castType(bool _throw)")
|
|
||||||
T* castWidget(Widget * _widget)
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT(nullptr != _widget, "Error static cast, widget == nullptr");
|
|
||||||
return _widget->castType<T>();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_CAST_WIDGET_H__
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 12/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CHILD_SKIN_INFO_H__
|
|
||||||
#define __MYGUI_CHILD_SKIN_INFO_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_WidgetStyle.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT ChildSkinInfo
|
|
||||||
{
|
|
||||||
ChildSkinInfo() : style(WidgetStyle::Child), align(Align::Default) { }
|
|
||||||
|
|
||||||
ChildSkinInfo(const std::string& _type, const WidgetStyle& _style, const std::string& _skin, const IntCoord& _coord, const Align& _align, const std::string& _layer, const std::string& _name) :
|
|
||||||
type(_type),
|
|
||||||
skin(_skin),
|
|
||||||
name(_name),
|
|
||||||
layer(_layer),
|
|
||||||
style(_style),
|
|
||||||
coord(_coord),
|
|
||||||
align(_align)
|
|
||||||
{
|
|
||||||
// set Child style by default
|
|
||||||
if (style == WidgetStyle::MAX) style = WidgetStyle::Child;
|
|
||||||
}
|
|
||||||
|
|
||||||
void addParam(const std::string& _key, const std::string& _value)
|
|
||||||
{
|
|
||||||
params[_key] = _value;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string findValue(const std::string& _key) const
|
|
||||||
{
|
|
||||||
MapString::const_iterator iter = params.find(_key);
|
|
||||||
if (iter != params.end()) return iter->second;
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string type, skin, name, layer;
|
|
||||||
WidgetStyle style;
|
|
||||||
IntCoord coord;
|
|
||||||
Align align;
|
|
||||||
MapString params;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<ChildSkinInfo> VectorChildSkinInfo;
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __MYGUI_CHILD_SKIN_INFO_H__
|
|
|
@ -1,70 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CLIPBOARD_MANAGER_H__
|
|
||||||
#define __MYGUI_CLIPBOARD_MANAGER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_UString.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ClipboardManager
|
|
||||||
{
|
|
||||||
MYGUI_INSTANCE_HEADER( ClipboardManager )
|
|
||||||
|
|
||||||
public:
|
|
||||||
void initialise();
|
|
||||||
void shutdown();
|
|
||||||
|
|
||||||
/** Set current data in clipboard
|
|
||||||
@param _type of data (for example "Text")
|
|
||||||
@param _data
|
|
||||||
*/
|
|
||||||
void setClipboardData(const std::string& _type, const std::string& _data);
|
|
||||||
/** Clear specific type data
|
|
||||||
@param _type of data to delete (for example "Text")
|
|
||||||
*/
|
|
||||||
void clearClipboardData(const std::string& _type);
|
|
||||||
/** Get specific type data
|
|
||||||
@param _type of data to get (for example "Text")
|
|
||||||
*/
|
|
||||||
std::string getClipboardData(const std::string& _type);
|
|
||||||
|
|
||||||
private:
|
|
||||||
MapString mClipboardData;
|
|
||||||
|
|
||||||
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
|
|
||||||
// дискриптор нашего главного окна
|
|
||||||
size_t mHwnd;
|
|
||||||
// строка, которую мы положили в буфер обмена винды
|
|
||||||
UString mPutTextInClipboard;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_CLIPBOARD_MANAGER_H__
|
|
|
@ -1,163 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 12/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_COLOUR_H__
|
|
||||||
#define __MYGUI_COLOUR_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT Colour
|
|
||||||
{
|
|
||||||
float red, green, blue, alpha;
|
|
||||||
|
|
||||||
static const Colour Zero;
|
|
||||||
static const Colour Black;
|
|
||||||
static const Colour White;
|
|
||||||
static const Colour Red;
|
|
||||||
static const Colour Green;
|
|
||||||
static const Colour Blue;
|
|
||||||
|
|
||||||
Colour() : red( 1 ), green( 1 ), blue( 1 ), alpha( 1 ) { }
|
|
||||||
Colour( float _red, float _green, float _blue, float _alpha = 1 ) : red( _red ), green( _green ), blue( _blue ), alpha( _alpha ) { }
|
|
||||||
explicit Colour(const std::string& _value) { *this = parse(_value); }
|
|
||||||
|
|
||||||
|
|
||||||
Colour& operator=( Colour const& _value )
|
|
||||||
{
|
|
||||||
red = _value.red;
|
|
||||||
green = _value.green;
|
|
||||||
blue = _value.blue;
|
|
||||||
alpha = _value.alpha;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==( Colour const& _value ) const
|
|
||||||
{
|
|
||||||
return ((red == _value.red) && (green == _value.green) && (blue == _value.blue) && (alpha == _value.alpha));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=( Colour const& _value ) const
|
|
||||||
{
|
|
||||||
return ! (*this == _value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set( float _red, float _green, float _blue, float _alpha = 1 )
|
|
||||||
{
|
|
||||||
red = _red;
|
|
||||||
green = _green;
|
|
||||||
blue = _blue;
|
|
||||||
alpha = _alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
red = green = blue = alpha = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string print() const
|
|
||||||
{
|
|
||||||
std::ostringstream stream;
|
|
||||||
stream << *this;
|
|
||||||
return stream.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
static Colour parse(const std::string& _value)
|
|
||||||
{
|
|
||||||
if (!_value.empty())
|
|
||||||
{
|
|
||||||
if (_value[0] == '#')
|
|
||||||
{
|
|
||||||
std::istringstream stream(_value.substr(1));
|
|
||||||
int result = 0;
|
|
||||||
stream >> std::hex >> result;
|
|
||||||
if (!stream.fail())
|
|
||||||
{
|
|
||||||
return Colour( (unsigned char)( result >> 16 ) / 256.0f, (unsigned char)( result >> 8 ) / 256.0f, (unsigned char)( result ) / 256.0f );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float red, green, blue, alpha = 1;
|
|
||||||
std::istringstream stream(_value);
|
|
||||||
stream >> red >> green >> blue;
|
|
||||||
if (!stream.fail())
|
|
||||||
{
|
|
||||||
if (!stream.eof())
|
|
||||||
stream >> alpha;
|
|
||||||
return Colour(red, green, blue, alpha);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Colour::Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::ostream& operator << ( std::ostream& _stream, const Colour& _value )
|
|
||||||
{
|
|
||||||
_stream << _value.red << " " << _value.green << " " << _value.blue << " " << _value.alpha;
|
|
||||||
return _stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::istream& operator >> ( std::istream& _stream, Colour& _value )
|
|
||||||
{
|
|
||||||
_value.clear();
|
|
||||||
|
|
||||||
std::string value;
|
|
||||||
_stream >> value;
|
|
||||||
|
|
||||||
if (value.empty())
|
|
||||||
return _stream;
|
|
||||||
|
|
||||||
if (value[0] == '#')
|
|
||||||
{
|
|
||||||
_value = Colour::parse(value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::istringstream stream(value);
|
|
||||||
stream >> _value.red;
|
|
||||||
if (stream.fail())
|
|
||||||
_value.clear();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_stream >> _value.green >> _value.blue;
|
|
||||||
if (!_stream.eof())
|
|
||||||
_stream >> _value.alpha;
|
|
||||||
else
|
|
||||||
_value.alpha = 1;
|
|
||||||
|
|
||||||
if (_stream.fail())
|
|
||||||
_value.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return _stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_COLOUR_H__
|
|
|
@ -1,237 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 12/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_COMBO_BOX_H__
|
|
||||||
#define __MYGUI_COMBO_BOX_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Edit.h"
|
|
||||||
#include "MyGUI_List.h"
|
|
||||||
#include "MyGUI_Any.h"
|
|
||||||
#include "MyGUI_EventPair.h"
|
|
||||||
#include "MyGUI_ControllerFadeAlpha.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef delegates::CDelegate2<ComboBox*, size_t> EventHandle_ComboBoxPtrSizeT;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ComboBox :
|
|
||||||
public Edit
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ComboBox )
|
|
||||||
|
|
||||||
public:
|
|
||||||
ComboBox();
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------//
|
|
||||||
// манипуляции айтемами
|
|
||||||
|
|
||||||
//! Get number of items
|
|
||||||
size_t getItemCount() const { return mList->getItemCount(); }
|
|
||||||
|
|
||||||
//! Insert an item into a array at a specified position
|
|
||||||
void insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null);
|
|
||||||
|
|
||||||
//! Add an item to the end of a array
|
|
||||||
void addItem(const UString& _name, Any _data = Any::Null) { return insertItemAt(ITEM_NONE, _name, _data); }
|
|
||||||
|
|
||||||
//! Remove item at a specified position
|
|
||||||
void removeItemAt(size_t _index);
|
|
||||||
|
|
||||||
//! Remove all items
|
|
||||||
void removeAllItems();
|
|
||||||
|
|
||||||
|
|
||||||
//! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found
|
|
||||||
size_t findItemIndexWith(const UString& _name);
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------//
|
|
||||||
// манипуляции выделениями
|
|
||||||
|
|
||||||
//! Get index of selected item (ITEM_NONE if none selected)
|
|
||||||
size_t getIndexSelected() { return mItemIndex; }
|
|
||||||
|
|
||||||
//! Select specified _index
|
|
||||||
void setIndexSelected(size_t _index);
|
|
||||||
|
|
||||||
//! Clear item selection
|
|
||||||
void clearIndexSelected() { setIndexSelected(ITEM_NONE); }
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------//
|
|
||||||
// манипуляции данными
|
|
||||||
|
|
||||||
//! Replace an item data at a specified position
|
|
||||||
void setItemDataAt(size_t _index, Any _data);
|
|
||||||
|
|
||||||
//! Clear an item data at a specified position
|
|
||||||
void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); }
|
|
||||||
|
|
||||||
//! Get item data from specified position
|
|
||||||
template <typename ValueType>
|
|
||||||
ValueType * getItemDataAt(size_t _index, bool _throw = true)
|
|
||||||
{
|
|
||||||
return mList->getItemDataAt<ValueType>(_index, _throw);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------//
|
|
||||||
// манипуляции отображением
|
|
||||||
|
|
||||||
//! Replace an item name at a specified position
|
|
||||||
void setItemNameAt(size_t _index, const UString& _name);
|
|
||||||
|
|
||||||
//! Get item name from specified position
|
|
||||||
const UString& getItemNameAt(size_t _index) { return mList->getItemNameAt(_index); }
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------//
|
|
||||||
// манипуляции выдимостью
|
|
||||||
|
|
||||||
//! Move all elements so specified becomes visible
|
|
||||||
void beginToItemAt(size_t _index) { mList->beginToItemAt(_index); }
|
|
||||||
|
|
||||||
//! Move all elements so first becomes visible
|
|
||||||
void beginToItemFirst() { if (getItemCount()) beginToItemAt(0); }
|
|
||||||
|
|
||||||
//! Move all elements so last becomes visible
|
|
||||||
void beginToItemLast() { if (getItemCount()) beginToItemAt(getItemCount() - 1); }
|
|
||||||
|
|
||||||
//! Move all elements so selected becomes visible
|
|
||||||
void beginToItemSelected() { if (getIndexSelected() != ITEM_NONE) beginToItemAt(getIndexSelected()); }
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------//
|
|
||||||
// методы для управления отображением
|
|
||||||
|
|
||||||
//! Set drop list mode (text can not be edited)
|
|
||||||
void setComboModeDrop(bool _value);
|
|
||||||
//! Get drop list mode flag
|
|
||||||
bool getComboModeDrop() { return mModeDrop; }
|
|
||||||
|
|
||||||
//! Set smooth show of list
|
|
||||||
void setSmoothShow(bool _value) { mShowSmooth = _value; }
|
|
||||||
//! Get smooth show of list flag
|
|
||||||
bool getSmoothShow() { return mShowSmooth; }
|
|
||||||
|
|
||||||
//! Get max list height
|
|
||||||
void setMaxListHeight(int _value) { mMaxHeight = _value; }
|
|
||||||
//! Set max list height
|
|
||||||
int getMaxListHeight() { return mMaxHeight; }
|
|
||||||
|
|
||||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
/*event:*/
|
|
||||||
/** Event : Enter pressed in combo mode or item selected in drop.\n
|
|
||||||
signature : void method(MyGUI::ComboBox* _sender, size_t _index)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _index item
|
|
||||||
*/
|
|
||||||
EventPair<EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT> eventComboAccept;
|
|
||||||
|
|
||||||
/** Event : Position changed.\n
|
|
||||||
signature : void method(MyGUI::ComboBox* _sender, size_t _index)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _index of new position
|
|
||||||
*/
|
|
||||||
EventPair<EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT> eventComboChangePosition;
|
|
||||||
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
/*obsolete:*/
|
|
||||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : size_t ComboBox::getIndexSelected()")
|
|
||||||
size_t getItemIndexSelected() { return getIndexSelected(); }
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::setIndexSelected(size_t _index)")
|
|
||||||
void setItemSelectedAt(size_t _index) { setIndexSelected(_index); }
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::clearIndexSelected()")
|
|
||||||
void clearItemSelected() { clearIndexSelected(); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::insertItemAt(size_t _index, const UString& _name)")
|
|
||||||
void insertItem(size_t _index, const UString& _name) { insertItemAt(_index, _name); }
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::setItemNameAt(size_t _index, const UString& _name)")
|
|
||||||
void setItem(size_t _index, const UString& _item) { setItemNameAt(_index, _item); }
|
|
||||||
MYGUI_OBSOLETE("use : const UString& ComboBox::getItemNameAt(size_t _index)")
|
|
||||||
const UString& getItem(size_t _index) { return getItemNameAt(_index); }
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::removeItemAt(size_t _index)")
|
|
||||||
void deleteItem(size_t _index) { removeItemAt(_index); }
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::removeAllItems()")
|
|
||||||
void deleteAllItems() { removeAllItems(); }
|
|
||||||
MYGUI_OBSOLETE("use : size_t ComboBox::getIndexSelected()")
|
|
||||||
size_t getItemSelect() { return getIndexSelected(); }
|
|
||||||
MYGUI_OBSOLETE("use : void void ComboBox::clearIndexSelected()")
|
|
||||||
void resetItemSelect() { clearIndexSelected(); }
|
|
||||||
MYGUI_OBSOLETE("use : void ComboBox::setIndexSelected(size_t _index)")
|
|
||||||
void setItemSelect(size_t _index) { setIndexSelected(_index); }
|
|
||||||
|
|
||||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~ComboBox();
|
|
||||||
|
|
||||||
virtual void onKeyButtonPressed(KeyCode _key, Char _char);
|
|
||||||
|
|
||||||
virtual void baseChangeWidgetSkin(ResourceSkin* _info);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void notifyButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id);
|
|
||||||
void notifyListLostFocus(Widget* _sender, MyGUI::Widget* _new);
|
|
||||||
void notifyListSelectAccept(List* _widget, size_t _position);
|
|
||||||
void notifyListMouseItemActivate(List* _widget, size_t _position);
|
|
||||||
void notifyListChangePosition(List* _widget, size_t _position);
|
|
||||||
void notifyMouseWheel(Widget* _sender, int _rel);
|
|
||||||
void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
|
|
||||||
void notifyEditTextChange(Edit* _sender);
|
|
||||||
|
|
||||||
void showList();
|
|
||||||
void hideList();
|
|
||||||
|
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void actionWidgetHide(Widget* _widget);
|
|
||||||
|
|
||||||
ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Button* mButton;
|
|
||||||
List* mList;
|
|
||||||
|
|
||||||
bool mListShow;
|
|
||||||
int mMaxHeight;
|
|
||||||
size_t mItemIndex;
|
|
||||||
bool mModeDrop;
|
|
||||||
bool mDropMouse;
|
|
||||||
bool mShowSmooth;
|
|
||||||
bool mManualList;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_COMBO_BOX_H__
|
|
|
@ -1,57 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@author baho_is
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_COMMON_H__
|
|
||||||
#define __MYGUI_COMMON_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
#include <set>
|
|
||||||
#include <map>
|
|
||||||
#include <vector>
|
|
||||||
#include <deque>
|
|
||||||
#include <exception>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#ifdef MYGUI_CUSTOM_ALLOCATOR
|
|
||||||
# include "MyGUI_CustomAllocator.h"
|
|
||||||
#else // MYGUI_CUSTOM_ALLOCATOR
|
|
||||||
# include "MyGUI_Allocator.h"
|
|
||||||
#endif // MYGUI_CUSTOM_ALLOCATOR
|
|
||||||
|
|
||||||
#include "MyGUI_Macros.h"
|
|
||||||
#include "MyGUI_Diagnostic.h"
|
|
||||||
#include "MyGUI_LogManager.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_RenderOut.h"
|
|
||||||
#include "MyGUI_Utility.h"
|
|
||||||
#include "MyGUI_InputDefine.h"
|
|
||||||
#include "MyGUI_Version.h"
|
|
||||||
#include "MyGUI_WidgetStyle.h"
|
|
||||||
#include "MyGUI_UString.h"
|
|
||||||
#include "MyGUI_Delegate.h"
|
|
||||||
|
|
||||||
#endif // __MYGUI_COMMON_H__
|
|
|
@ -1,145 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_COMMON_STATE_INFO_H__
|
|
||||||
#define __MYGUI_COMMON_STATE_INFO_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_IStateInfo.h"
|
|
||||||
#include "MyGUI_CoordConverter.h"
|
|
||||||
#include "MyGUI_LanguageManager.h"
|
|
||||||
#include "MyGUI_TextureUtility.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT SubSkinStateInfo :
|
|
||||||
public IStateInfo
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( SubSkinStateInfo )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~SubSkinStateInfo() { }
|
|
||||||
|
|
||||||
const FloatRect& getRect() { return mRect; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
|
||||||
{
|
|
||||||
std::string texture = _node->getParent()->getParent()->findAttribute("texture");
|
|
||||||
|
|
||||||
// ïîääåðæêà çàìåíû òåãîâ â ñêèíàõ
|
|
||||||
if (_version >= Version(1, 1))
|
|
||||||
{
|
|
||||||
texture = LanguageManager::getInstance().replaceTags(texture);
|
|
||||||
}
|
|
||||||
|
|
||||||
const IntSize& size = texture_utility::getTextureSize(texture);
|
|
||||||
const IntCoord& coord = IntCoord::parse(_node->findAttribute("offset"));
|
|
||||||
mRect = CoordConverter::convertTextureCoord(coord, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
FloatRect mRect;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MYGUI_EXPORT TileRectStateInfo :
|
|
||||||
public IStateInfo
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( TileRectStateInfo )
|
|
||||||
|
|
||||||
public:
|
|
||||||
TileRectStateInfo() : mTileH(true), mTileV(true) { }
|
|
||||||
virtual ~TileRectStateInfo() { }
|
|
||||||
|
|
||||||
const FloatRect& getRect() { return mRect; }
|
|
||||||
const IntSize& getTileSize() { return mTileSize; }
|
|
||||||
bool getTileH() { return mTileH; }
|
|
||||||
bool getTileV() { return mTileV; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
|
||||||
{
|
|
||||||
std::string texture = _node->getParent()->getParent()->findAttribute("texture");
|
|
||||||
|
|
||||||
// ïîääåðæêà çàìåíû òåãîâ â ñêèíàõ
|
|
||||||
if (_version >= Version(1, 1))
|
|
||||||
{
|
|
||||||
texture = LanguageManager::getInstance().replaceTags(texture);
|
|
||||||
}
|
|
||||||
|
|
||||||
const IntSize& size = texture_utility::getTextureSize(texture);
|
|
||||||
const IntCoord& coord = IntCoord::parse(_node->findAttribute("offset"));
|
|
||||||
mRect = CoordConverter::convertTextureCoord(coord, size);
|
|
||||||
|
|
||||||
xml::ElementEnumerator prop = _node->getElementEnumerator();
|
|
||||||
while (prop.next("Property"))
|
|
||||||
{
|
|
||||||
const std::string& key = prop->findAttribute("key");
|
|
||||||
const std::string& value = prop->findAttribute("value");
|
|
||||||
if (key == "TileH") mTileH = utility::parseBool(value);
|
|
||||||
else if (key == "TileV") mTileV = utility::parseBool(value);
|
|
||||||
else if (key == "TileSize") mTileSize = IntSize::parse(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
FloatRect mRect;
|
|
||||||
IntSize mTileSize;
|
|
||||||
bool mTileH;
|
|
||||||
bool mTileV;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MYGUI_EXPORT EditTextStateInfo :
|
|
||||||
public IStateInfo
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( EditTextStateInfo )
|
|
||||||
|
|
||||||
public:
|
|
||||||
EditTextStateInfo() : mColour(Colour::White), mShift(false) { }
|
|
||||||
virtual ~EditTextStateInfo() { }
|
|
||||||
|
|
||||||
const Colour& getColour() { return mColour; }
|
|
||||||
bool getShift() { return mShift; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
|
||||||
{
|
|
||||||
mShift = utility::parseBool(_node->findAttribute("shift"));
|
|
||||||
|
|
||||||
std::string colour = _node->findAttribute("colour");
|
|
||||||
if (_version >= Version(1, 1))
|
|
||||||
{
|
|
||||||
colour = LanguageManager::getInstance().replaceTags(colour);
|
|
||||||
}
|
|
||||||
|
|
||||||
mColour = Colour::parse(colour);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
Colour mColour;
|
|
||||||
bool mShift;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_COMMON_STATE_INFO_H__
|
|
|
@ -1,84 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Evmenov Georgiy
|
|
||||||
@date 04/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CONTROLLER_EDGE_HIDE_H__
|
|
||||||
#define __MYGUI_CONTROLLER_EDGE_HIDE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
#include "MyGUI_ControllerItem.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/** This controller used for hiding widgets near screen edges.
|
|
||||||
Widget will start hiding(move out of screen) if it's near
|
|
||||||
border and it and it's childrens don't have any focus. Hiding
|
|
||||||
till only small part of widget be visible. Widget will move
|
|
||||||
inside screen if it have any focus.
|
|
||||||
*/
|
|
||||||
class MYGUI_EXPORT ControllerEdgeHide :
|
|
||||||
public ControllerItem
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ControllerEdgeHide )
|
|
||||||
|
|
||||||
public:
|
|
||||||
ControllerEdgeHide();
|
|
||||||
virtual ~ControllerEdgeHide() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _value in which widget will be hidden or shown
|
|
||||||
*/
|
|
||||||
void setTime(float _value) { mTime = _value; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _remainPixels how many pixels you will see afterr full hide
|
|
||||||
*/
|
|
||||||
void setRemainPixels(int _value) { mRemainPixels = _value; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _shadowSize adds to _remainPixels when hiding left or top (for example used for windows with shadows)
|
|
||||||
*/
|
|
||||||
void setShadowSize(int _value) { mShadowSize = _value; }
|
|
||||||
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool addTime(Widget* _widget, float _time);
|
|
||||||
void prepareItem(Widget* _widget);
|
|
||||||
|
|
||||||
void recalculateTime(Widget* _widget);
|
|
||||||
|
|
||||||
delegates::CDelegate1<Widget*> eventPostAction;
|
|
||||||
|
|
||||||
float mTime;
|
|
||||||
int mRemainPixels;
|
|
||||||
int mShadowSize;
|
|
||||||
float mElapsedTime;
|
|
||||||
// for checking if widget was moved
|
|
||||||
MyGUI::IntCoord mLastCoord;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_CONTROLLER_EDGE_HIDE_H__
|
|
|
@ -1,78 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CONTROLLER_FADE_ALPHA_H__
|
|
||||||
#define __MYGUI_CONTROLLER_FADE_ALPHA_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
#include "MyGUI_ControllerItem.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/** This controller used for smooth changing alpha of widget in time */
|
|
||||||
class MYGUI_EXPORT ControllerFadeAlpha :
|
|
||||||
public ControllerItem
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ControllerFadeAlpha )
|
|
||||||
|
|
||||||
public:
|
|
||||||
ControllerFadeAlpha();
|
|
||||||
virtual ~ControllerFadeAlpha() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _alpha that will be as result of changing
|
|
||||||
*/
|
|
||||||
void setAlpha(float _value) { mAlpha = _value; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _coef of alpha changing speed (1. mean that alpha will change from 0 to 1 at 1 second)
|
|
||||||
*/
|
|
||||||
void setCoef(float _value) { mCoef = _value; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _enabled if true then widget will be inactive after start of alpha changing
|
|
||||||
*/
|
|
||||||
void setEnabled(bool _value) { mEnabled = _value; }
|
|
||||||
|
|
||||||
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool addTime(Widget* _widget, float _time);
|
|
||||||
void prepareItem(Widget* _widget);
|
|
||||||
|
|
||||||
bool getEnabled() { return mEnabled; }
|
|
||||||
float getAlpha() { return mAlpha; }
|
|
||||||
float getCoef() { return mCoef; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
float mAlpha;
|
|
||||||
float mCoef;
|
|
||||||
bool mEnabled;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_CONTROLLER_FADE_ALPHA_H__
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CONTROLLER_ITEM_H__
|
|
||||||
#define __MYGUI_CONTROLLER_ITEM_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
#include "MyGUI_IObject.h"
|
|
||||||
#include "MyGUI_Delegate.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Base interface for controllers */
|
|
||||||
class MYGUI_EXPORT ControllerItem :
|
|
||||||
public IObject
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ControllerItem )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~ControllerItem() { }
|
|
||||||
|
|
||||||
virtual void prepareItem(Widget* _widget) = 0;
|
|
||||||
virtual bool addTime(Widget* _widget, float _time) = 0;
|
|
||||||
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value) { }
|
|
||||||
|
|
||||||
/** Event : Before controller started working.\n
|
|
||||||
signature : void method(MyGUI::Widget* _sender)\n
|
|
||||||
@param _sender widget under control
|
|
||||||
*/
|
|
||||||
delegates::CDelegate1<Widget*>
|
|
||||||
eventPreAction;
|
|
||||||
|
|
||||||
/** Event : Controller updated (called every frame).\n
|
|
||||||
signature : void method(MyGUI::Widget* _sender)\n
|
|
||||||
@param _sender widget under control
|
|
||||||
*/
|
|
||||||
delegates::CDelegate1<Widget*>
|
|
||||||
eventUpdateAction;
|
|
||||||
|
|
||||||
/** Event : After controller finished working.\n
|
|
||||||
signature : void method(MyGUI::Widget* _sender)\n
|
|
||||||
@param _sender widget under control
|
|
||||||
*/
|
|
||||||
delegates::CDelegate1<Widget*>
|
|
||||||
eventPostAction;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_CONTROLLER_ITEM_H__
|
|
|
@ -1,74 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CONTROLLER_MANAGER_H__
|
|
||||||
#define __MYGUI_CONTROLLER_MANAGER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_ControllerItem.h"
|
|
||||||
#include "MyGUI_IUnlinkWidget.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
#include "MyGUI_ActionController.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ControllerManager : public IUnlinkWidget
|
|
||||||
{
|
|
||||||
MYGUI_INSTANCE_HEADER( ControllerManager )
|
|
||||||
|
|
||||||
public:
|
|
||||||
void initialise();
|
|
||||||
void shutdown();
|
|
||||||
|
|
||||||
// ñîçäàåò êîíòðîëëåð
|
|
||||||
ControllerItem* createItem(const std::string& _type);
|
|
||||||
|
|
||||||
/** Add controlled widget
|
|
||||||
@param _widget to be controlled
|
|
||||||
@param _item controller with some actions (for example ControllerFadeAlpha or your own)
|
|
||||||
@note _item will be deleted automatically at end of controller lifetime
|
|
||||||
(if not removed by removeItem(Widget* _widget) before)
|
|
||||||
*/
|
|
||||||
void addItem(Widget* _widget, ControllerItem * _item);
|
|
||||||
|
|
||||||
/** Stop the control over a widget
|
|
||||||
@param _widget to be removed
|
|
||||||
*/
|
|
||||||
void removeItem(Widget* _widget);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void _unlinkWidget(Widget* _widget);
|
|
||||||
void frameEntered(float _time);
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef std::pair<Widget*, ControllerItem *> PairControllerItem;
|
|
||||||
typedef std::list<PairControllerItem> ListControllerItem;
|
|
||||||
ListControllerItem mListItem;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_CONTROLLER_MANAGER_H__
|
|
|
@ -1,95 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Evmenov Georgiy
|
|
||||||
@date 03/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CONTROLLER_POSITION_H__
|
|
||||||
#define __MYGUI_CONTROLLER_POSITION_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Delegate.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
#include "MyGUI_ControllerItem.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/** This controller used for smooth changing position of widget in time */
|
|
||||||
class MYGUI_EXPORT ControllerPosition :
|
|
||||||
public ControllerItem
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ControllerPosition )
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef delegates::CDelegate4<const IntCoord&, const IntCoord&, IntCoord&, float> FrameAction;
|
|
||||||
|
|
||||||
ControllerPosition();
|
|
||||||
virtual ~ControllerPosition() { }
|
|
||||||
|
|
||||||
void setCoord(const IntCoord& _value);
|
|
||||||
|
|
||||||
void setSize(const IntSize& _value);
|
|
||||||
|
|
||||||
void setPosition(const IntPoint& _value);
|
|
||||||
|
|
||||||
void setFunction(const std::string& _value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _value seconds in which widget planned to reach destination coordinate
|
|
||||||
*/
|
|
||||||
void setTime(float _value) { mTime = _value; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param _action applied to widget every frame (see ControllerPosition::eventFrameAction)
|
|
||||||
*/
|
|
||||||
void setAction(FrameAction::IDelegate* _value) { eventFrameAction = _value; }
|
|
||||||
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool addTime(Widget* _widget, float _time);
|
|
||||||
void prepareItem(Widget* _widget);
|
|
||||||
|
|
||||||
float getElapsedTime() { return mElapsedTime; }
|
|
||||||
|
|
||||||
IntCoord mStartCoord;
|
|
||||||
IntCoord mDestCoord;
|
|
||||||
float mTime;
|
|
||||||
float mElapsedTime;
|
|
||||||
|
|
||||||
// controller changing position
|
|
||||||
bool mCalcPosition;
|
|
||||||
// controller changing size
|
|
||||||
bool mCalcSize;
|
|
||||||
|
|
||||||
/** Event : Every frame action while controller exist.\n
|
|
||||||
signature : void method(const IntRect& _startRect, const IntRect& _destRect, IntRect& _result, float _current_time)\n
|
|
||||||
@param _startRect start coordinate of widget
|
|
||||||
@param _destRect destination coordinate
|
|
||||||
@param _result resultRect
|
|
||||||
@param _current_time elapsed time (_current_time is real elapsed time divided by _time(see constructor) so _current_time == 1 mean that _time seconds elapsed)
|
|
||||||
*/
|
|
||||||
FrameAction eventFrameAction;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_CONTROLLER_POSITION_H__
|
|
|
@ -1,92 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_COORD_CONVERTER_H__
|
|
||||||
#define __MYGUI_COORD_CONVERTER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT CoordConverter
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/** Convert pixel coordinates to texture UV coordinates */
|
|
||||||
static FloatRect convertTextureCoord(const IntCoord& _coord, const IntSize& _textureSize)
|
|
||||||
{
|
|
||||||
if (!_textureSize.width || !_textureSize.height) return FloatRect();
|
|
||||||
return FloatRect(
|
|
||||||
(float)_coord.left / (float)_textureSize.width,
|
|
||||||
(float)_coord.top / (float)_textureSize.height,
|
|
||||||
(float)_coord.right() / (float)_textureSize.width,
|
|
||||||
(float)_coord.bottom() / (float)_textureSize.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert from relative to pixel coordinates.
|
|
||||||
@param _coord relative coordinates.
|
|
||||||
*/
|
|
||||||
static IntCoord convertFromRelative(const FloatCoord& _coord, const IntSize& _view)
|
|
||||||
{
|
|
||||||
return IntCoord(int(_coord.left * _view.width), int(_coord.top * _view.height), int(_coord.width * _view.width), int(_coord.height * _view.height));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert from relative to pixel coordinates.
|
|
||||||
@param _coord relative coordinates.
|
|
||||||
*/
|
|
||||||
static IntSize convertFromRelative(const FloatSize& _size, const IntSize& _view)
|
|
||||||
{
|
|
||||||
return IntSize(int(_size.width * _view.width), int(_size.height * _view.height));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert from relative to pixel coordinates.
|
|
||||||
@param _coord relative coordinates.
|
|
||||||
*/
|
|
||||||
static IntPoint convertFromRelative(const FloatPoint& _point, const IntSize& _view)
|
|
||||||
{
|
|
||||||
return IntPoint(int(_point.left * _view.width), int(_point.top * _view.height));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert from pixel to relative coordinates.
|
|
||||||
@param _coord pixel coordinates.
|
|
||||||
*/
|
|
||||||
static FloatCoord convertToRelative(const IntCoord& _coord, const IntSize& _view)
|
|
||||||
{
|
|
||||||
return FloatCoord(_coord.left / (float)_view.width, _coord.top / (float)_view.height, _coord.width / (float)_view.width, _coord.height / (float)_view.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
static FloatSize convertToRelative(const IntSize& _size, const IntSize& _view)
|
|
||||||
{
|
|
||||||
return FloatSize(_size.width / (float)_view.width, _size.height / (float)_view.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
static FloatPoint convertToRelative(const IntPoint& _point, const IntSize& _view)
|
|
||||||
{
|
|
||||||
return FloatPoint(_point.left / (float)_view.width, _point.top / (float)_view.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_COORD_CONVERTER_H__
|
|
|
@ -1,101 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 05/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_CUSTOM_ALLOCATOR_H__
|
|
||||||
#define __MYGUI_CUSTOM_ALLOCATOR_H__
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
// for Ogre version
|
|
||||||
#include <OgrePrerequisites.h>
|
|
||||||
|
|
||||||
#if OGRE_VERSION < MYGUI_DEFINE_VERSION(1, 6, 0)
|
|
||||||
#include <OgreMemoryManager.h>
|
|
||||||
#include <OgreNoMemoryMacros.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class Allocator
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// typedefs
|
|
||||||
typedef T value_type;
|
|
||||||
typedef value_type* pointer;
|
|
||||||
typedef const value_type* const_pointer;
|
|
||||||
typedef value_type& reference;
|
|
||||||
typedef const value_type& const_reference;
|
|
||||||
typedef std::size_t size_type;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
|
|
||||||
public:
|
|
||||||
// convert an allocator<T> to allocator<U>
|
|
||||||
template<typename U>
|
|
||||||
struct rebind
|
|
||||||
{
|
|
||||||
typedef Allocator<U> other;
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
inline explicit Allocator() { }
|
|
||||||
inline ~Allocator() { }
|
|
||||||
template<typename U>
|
|
||||||
inline explicit Allocator(Allocator<U> const&) { }
|
|
||||||
|
|
||||||
// address
|
|
||||||
inline pointer address(reference r) { return &r; }
|
|
||||||
inline const_pointer address(const_reference r) { return &r; }
|
|
||||||
|
|
||||||
// memory allocation
|
|
||||||
inline pointer allocate(size_type cnt, typename std::allocator<void>::const_pointer = 0)
|
|
||||||
{
|
|
||||||
return reinterpret_cast<pointer>(::operator new (cnt * sizeof (T)));
|
|
||||||
}
|
|
||||||
inline void deallocate(pointer p, size_type)
|
|
||||||
{
|
|
||||||
::operator delete (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
// size
|
|
||||||
inline size_type max_size() const
|
|
||||||
{
|
|
||||||
return std::numeric_limits<size_type>::max() / sizeof(T);
|
|
||||||
}
|
|
||||||
|
|
||||||
// construction/destruction
|
|
||||||
inline void construct(pointer p, const T& t) { new (p) T(t); }
|
|
||||||
inline void destroy(pointer p) { p->~T(); }
|
|
||||||
|
|
||||||
inline bool operator==(Allocator const&) { return true; }
|
|
||||||
inline bool operator!=(Allocator const& a) { return !operator==(a); }
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#if OGRE_VERSION < MYGUI_DEFINE_VERSION(1, 6, 0)
|
|
||||||
#include <OgreMemoryMacros.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __MYGUI_CUSTOM_ALLOCATOR_H__
|
|
|
@ -1,175 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 10/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DDCONTAINER_H__
|
|
||||||
#define __MYGUI_DDCONTAINER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Widget.h"
|
|
||||||
#include "MyGUI_DDItemInfo.h"
|
|
||||||
#include "MyGUI_EventPair.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef delegates::CDelegate3<DDContainer*, const DDItemInfo&, bool&> EventHandle_DDContainerPtrCDDItemInfoRefBoolRef;
|
|
||||||
typedef delegates::CDelegate3<DDContainer*, const DDItemInfo&, bool> EventHandle_DDContainerPtrCDDItemInfoRefBool;
|
|
||||||
typedef delegates::CDelegate2<DDContainer*, DDItemState> EventHandle_EventHandle_DDContainerPtrDDItemState;
|
|
||||||
typedef delegates::CDelegate3<DDContainer*, WidgetPtr&, IntCoord&> EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef;
|
|
||||||
|
|
||||||
|
|
||||||
class MYGUI_EXPORT DDContainer :
|
|
||||||
public Widget
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( DDContainer )
|
|
||||||
|
|
||||||
public:
|
|
||||||
DDContainer();
|
|
||||||
|
|
||||||
/** Set drag'n'drop mode flag.
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setNeedDragDrop(bool _value) { mNeedDragDrop = _value; }
|
|
||||||
/** Get drag'n'drop mode flag */
|
|
||||||
bool getNeedDragDrop() { return mNeedDragDrop; }
|
|
||||||
|
|
||||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
/*event:*/
|
|
||||||
/** Event : request for start drag
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool& _result)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _info information about DDContainers
|
|
||||||
@param _result write here true if container can be draggedor false if it can't
|
|
||||||
*/
|
|
||||||
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag;
|
|
||||||
|
|
||||||
/** Event : request for start drag (moving mouse over container, but not dropped yet)
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool& _result)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _info information about DDContainers
|
|
||||||
@param _result write here true if container accept dragged widget or false if it isn't
|
|
||||||
*/
|
|
||||||
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop;
|
|
||||||
|
|
||||||
/** Event : end drag (drop)
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool _result)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _info information about DDContainers
|
|
||||||
@param _result if true then drop was successfull
|
|
||||||
*/
|
|
||||||
EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult;
|
|
||||||
|
|
||||||
/** Event : drag'n'drop state changed
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender, MyGUI::DDItemState _state)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _state new state
|
|
||||||
*/
|
|
||||||
EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState;
|
|
||||||
|
|
||||||
/** Event : [not used] request widget for dragging
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender, MyGUI::Widget*& _item, MyGUI::IntCoord& _dimension)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _item write widget pointer here
|
|
||||||
@param _dimension write widget coordinate here
|
|
||||||
*/
|
|
||||||
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo;
|
|
||||||
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
// метод для установления стейта айтема
|
|
||||||
virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept) { }
|
|
||||||
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
/** Event : внутреннее событие, невалидна информация для контейнера
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
*/
|
|
||||||
EventPair<EventHandle_WidgetVoid, delegates::CDelegate1<DDContainer*> >
|
|
||||||
_eventInvalideContainer;
|
|
||||||
|
|
||||||
/** Event : !!обновить виджеты дропа DD_FIXME наверное internal
|
|
||||||
signature : void method(MyGUI::DDContainer* _sender, MyGUI::Widget* _item, const MyGUI::DDWidgetState& _state)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
@param _items
|
|
||||||
@param _state
|
|
||||||
*/
|
|
||||||
delegates::CDelegate3<DDContainer*, Widget*, const DDWidgetState&>
|
|
||||||
eventUpdateDropState;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~DDContainer();
|
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
|
||||||
|
|
||||||
virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
|
|
||||||
virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
|
|
||||||
virtual void onMouseDrag(int _left, int _top);
|
|
||||||
|
|
||||||
virtual void notifyInvalideDrop(DDContainer* _sender);
|
|
||||||
|
|
||||||
virtual void _getContainer(Widget*& _container, size_t& _index);
|
|
||||||
|
|
||||||
virtual void removeDropItems();
|
|
||||||
virtual void updateDropItems();
|
|
||||||
virtual void updateDropItemsState(const DDWidgetState& _state);
|
|
||||||
|
|
||||||
void mouseDrag();
|
|
||||||
void mouseButtonReleased(MouseButton _id);
|
|
||||||
void mouseButtonPressed(MouseButton _id);
|
|
||||||
|
|
||||||
void endDrop(bool _reset);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool mDropResult;
|
|
||||||
bool mNeedDrop;
|
|
||||||
bool mStartDrop;
|
|
||||||
|
|
||||||
Widget* mOldDrop;
|
|
||||||
Widget* mCurrentSender;
|
|
||||||
|
|
||||||
DDItemInfo mDropInfo;
|
|
||||||
|
|
||||||
size_t mDropSenderIndex;
|
|
||||||
|
|
||||||
// список виджетов для дропа
|
|
||||||
Widget* mDropItem;
|
|
||||||
IntCoord mDropDimension;
|
|
||||||
|
|
||||||
IntPoint mClickInWidget;
|
|
||||||
|
|
||||||
// нужно и виджету поддержка драг энд дропа
|
|
||||||
bool mNeedDragDrop;
|
|
||||||
|
|
||||||
DDContainer* mReseiverContainer;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_DDCONTAINER_H__
|
|
|
@ -1,120 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_ITEM_DROP_INFO_H__
|
|
||||||
#define __MYGUI_ITEM_DROP_INFO_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT DDItemState
|
|
||||||
{
|
|
||||||
enum Enum
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
Start, /**< start drag */
|
|
||||||
End, /**< end drag (drop) */
|
|
||||||
Miss, /**< drag DDContainer over empty space or widgets that don't have drag'n'drop */
|
|
||||||
Accept, /**< drag DDContainer over another DDContainer that accept dropping on it */
|
|
||||||
Refuse /**< drag DDContainer over another DDContainer that refuse dropping on it */
|
|
||||||
};
|
|
||||||
|
|
||||||
DDItemState(Enum _value = None) : value(_value) { }
|
|
||||||
|
|
||||||
friend bool operator == (DDItemState const& a, DDItemState const& b) { return a.value == b.value; }
|
|
||||||
friend bool operator != (DDItemState const& a, DDItemState const& b) { return a.value != b.value; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Enum value;
|
|
||||||
};
|
|
||||||
|
|
||||||
// структура информации об индексах дропа
|
|
||||||
/** Inormation about drag'n'drop indexes */
|
|
||||||
struct MYGUI_EXPORT DDItemInfo
|
|
||||||
{
|
|
||||||
DDItemInfo() :
|
|
||||||
sender(nullptr),
|
|
||||||
sender_index(ITEM_NONE),
|
|
||||||
receiver(nullptr),
|
|
||||||
receiver_index(ITEM_NONE)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) :
|
|
||||||
sender(_sender),
|
|
||||||
sender_index(_sender_index),
|
|
||||||
receiver(_receiver),
|
|
||||||
receiver_index(_receiver_index)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index)
|
|
||||||
{
|
|
||||||
sender = _sender;
|
|
||||||
sender_index = _sender_index;
|
|
||||||
receiver = _receiver;
|
|
||||||
receiver_index = _receiver_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset()
|
|
||||||
{
|
|
||||||
sender = nullptr;
|
|
||||||
sender_index = ITEM_NONE;
|
|
||||||
receiver = nullptr;
|
|
||||||
receiver_index = ITEM_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** DDContainer that send this event (container from which we started drag) */
|
|
||||||
DDContainer* sender;
|
|
||||||
/** Index of sender container */
|
|
||||||
size_t sender_index;
|
|
||||||
|
|
||||||
/** DDContainer that receive dragged widget (container to which we want to drop) */
|
|
||||||
DDContainer* receiver;
|
|
||||||
/** Index of receiver container */
|
|
||||||
size_t receiver_index;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT DDWidgetState
|
|
||||||
{
|
|
||||||
DDWidgetState(size_t _index) :
|
|
||||||
index(_index),
|
|
||||||
update(true),
|
|
||||||
accept(false),
|
|
||||||
refuse(false)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
/** Index of element */
|
|
||||||
size_t index;
|
|
||||||
/** State and internal data changed */
|
|
||||||
bool update;
|
|
||||||
/** Is widget accept drop */
|
|
||||||
bool accept;
|
|
||||||
/** Is widget refuse drop */
|
|
||||||
bool refuse;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ITEM_DROP_INFO_H__
|
|
|
@ -1,45 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 05/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DATA_FILE_STREAM_H__
|
|
||||||
#define __MYGUI_DATA_FILE_STREAM_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_DataStream.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT DataFileStream : public DataStream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DataFileStream();
|
|
||||||
DataFileStream(std::ifstream* _stream);
|
|
||||||
~DataFileStream();
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::ifstream* mFileStream;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_DATA_STREAM_H__
|
|
|
@ -1,56 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 05/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DATA_MANAGER_H__
|
|
||||||
#define __MYGUI_DATA_MANAGER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_IDataStream.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT DataManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DataManager();
|
|
||||||
virtual ~DataManager() = 0;
|
|
||||||
|
|
||||||
static DataManager& getInstance();
|
|
||||||
static DataManager* getInstancePtr();
|
|
||||||
|
|
||||||
virtual IDataStream* getData(const std::string& _name) = 0;
|
|
||||||
|
|
||||||
virtual bool isDataExist(const std::string& _name) = 0;
|
|
||||||
|
|
||||||
virtual const VectorString& getDataListNames(const std::string& _pattern) = 0;
|
|
||||||
|
|
||||||
virtual const std::string& getDataPath(const std::string& _name) = 0;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static DataManager* msInstance;
|
|
||||||
bool mIsInitialise;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_DATA_MANAGER_H__
|
|
|
@ -1,51 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 05/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DATA_STREAM_H__
|
|
||||||
#define __MYGUI_DATA_STREAM_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_IDataStream.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT DataStream : public IDataStream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DataStream();
|
|
||||||
DataStream(std::istream* _stream);
|
|
||||||
virtual ~DataStream();
|
|
||||||
|
|
||||||
virtual bool eof();
|
|
||||||
virtual size_t size();
|
|
||||||
virtual void readline(std::string& _source, Char _delim);
|
|
||||||
virtual size_t read(void* _buf, size_t _count);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::istream* mStream;
|
|
||||||
size_t mSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_DATA_STREAM_H__
|
|
|
@ -1,137 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DELEGATE_H__
|
|
||||||
#define __MYGUI_DELEGATE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Diagnostic.h"
|
|
||||||
#include <typeinfo>
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
// source
|
|
||||||
// http://rsdn.ru/article/cpp/delegates.xml
|
|
||||||
|
|
||||||
// генерация делегатов для различного колличества параметров
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace delegates
|
|
||||||
{
|
|
||||||
// базовый класс для тех классов, что хотят себя отвязывать от мульти делегатов
|
|
||||||
class MYGUI_EXPORT IDelegateUnlink
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IDelegateUnlink() { }
|
|
||||||
|
|
||||||
IDelegateUnlink() { m_baseDelegateUnlink = this; }
|
|
||||||
bool compare(IDelegateUnlink * _unlink) const { return m_baseDelegateUnlink == _unlink->m_baseDelegateUnlink; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
IDelegateUnlink * m_baseDelegateUnlink;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline IDelegateUnlink * GetDelegateUnlink(void * _base) { return 0; }
|
|
||||||
inline IDelegateUnlink * GetDelegateUnlink(IDelegateUnlink * _base) { return _base; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// без параметров
|
|
||||||
#define MYGUI_SUFFIX 0
|
|
||||||
#define MYGUI_TEMPLATE
|
|
||||||
#define MYGUI_TEMPLATE_PARAMS
|
|
||||||
#define MYGUI_TEMPLATE_ARGS
|
|
||||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T>
|
|
||||||
#define MYGUI_T_TEMPLATE_ARGS <T>
|
|
||||||
#define MYGUI_PARAMS
|
|
||||||
#define MYGUI_ARGS
|
|
||||||
#define MYGUI_TYPENAME
|
|
||||||
|
|
||||||
#include "MyGUI_DelegateImplement.h"
|
|
||||||
|
|
||||||
// один параметр
|
|
||||||
#define MYGUI_SUFFIX 1
|
|
||||||
#define MYGUI_TEMPLATE template
|
|
||||||
#define MYGUI_TEMPLATE_PARAMS <typename TP1>
|
|
||||||
#define MYGUI_TEMPLATE_ARGS <TP1>
|
|
||||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1>
|
|
||||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1>
|
|
||||||
#define MYGUI_PARAMS TP1 p1
|
|
||||||
#define MYGUI_ARGS p1
|
|
||||||
#define MYGUI_TYPENAME typename
|
|
||||||
|
|
||||||
#include "MyGUI_DelegateImplement.h"
|
|
||||||
|
|
||||||
// два параметра
|
|
||||||
#define MYGUI_SUFFIX 2
|
|
||||||
#define MYGUI_TEMPLATE template
|
|
||||||
#define MYGUI_TEMPLATE_PARAMS <typename TP1, typename TP2>
|
|
||||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2>
|
|
||||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2>
|
|
||||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2>
|
|
||||||
#define MYGUI_PARAMS TP1 p1, TP2 p2
|
|
||||||
#define MYGUI_ARGS p1, p2
|
|
||||||
#define MYGUI_TYPENAME typename
|
|
||||||
|
|
||||||
#include "MyGUI_DelegateImplement.h"
|
|
||||||
|
|
||||||
// три параметра
|
|
||||||
#define MYGUI_SUFFIX 3
|
|
||||||
#define MYGUI_TEMPLATE template
|
|
||||||
#define MYGUI_TEMPLATE_PARAMS <typename TP1, typename TP2, typename TP3>
|
|
||||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2, TP3>
|
|
||||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2, typename TP3>
|
|
||||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2, TP3>
|
|
||||||
#define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3
|
|
||||||
#define MYGUI_ARGS p1, p2, p3
|
|
||||||
#define MYGUI_TYPENAME typename
|
|
||||||
|
|
||||||
#include "MyGUI_DelegateImplement.h"
|
|
||||||
|
|
||||||
// четыре параметра
|
|
||||||
#define MYGUI_SUFFIX 4
|
|
||||||
#define MYGUI_TEMPLATE template
|
|
||||||
#define MYGUI_TEMPLATE_PARAMS <typename TP1, typename TP2, typename TP3, typename TP4>
|
|
||||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2, TP3, TP4>
|
|
||||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2, typename TP3, typename TP4>
|
|
||||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2, TP3, TP4>
|
|
||||||
#define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3, TP4 p4
|
|
||||||
#define MYGUI_ARGS p1, p2, p3, p4
|
|
||||||
#define MYGUI_TYPENAME typename
|
|
||||||
|
|
||||||
#include "MyGUI_DelegateImplement.h"
|
|
||||||
|
|
||||||
// пять параметров
|
|
||||||
#define MYGUI_SUFFIX 5
|
|
||||||
#define MYGUI_TEMPLATE template
|
|
||||||
#define MYGUI_TEMPLATE_PARAMS <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5>
|
|
||||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2, TP3, TP4, TP5>
|
|
||||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2, typename TP3, typename TP4, typename TP5>
|
|
||||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2, TP3, TP4, TP5>
|
|
||||||
#define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5
|
|
||||||
#define MYGUI_ARGS p1, p2, p3, p4, p5
|
|
||||||
#define MYGUI_TYPENAME typename
|
|
||||||
|
|
||||||
#include "MyGUI_DelegateImplement.h"
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_DELEGATE_H__
|
|
|
@ -1,319 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace delegates
|
|
||||||
{
|
|
||||||
|
|
||||||
#define MYGUI_COMBINE(a, b) MYGUI_COMBINE1(a, b)
|
|
||||||
#define MYGUI_COMBINE1(a, b) a##b
|
|
||||||
|
|
||||||
#define MYGUI_I_DELEGATE MYGUI_COMBINE(IDelegate, MYGUI_SUFFIX)
|
|
||||||
|
|
||||||
#define MYGUI_C_STATIC_DELEGATE MYGUI_COMBINE(CStaticDelegate, MYGUI_SUFFIX)
|
|
||||||
#define MYGUI_C_METHOD_DELEGATE MYGUI_COMBINE(CMethodDelegate, MYGUI_SUFFIX)
|
|
||||||
|
|
||||||
#define MYGUI_C_DELEGATE MYGUI_COMBINE(CDelegate, MYGUI_SUFFIX)
|
|
||||||
#define MYGUI_C_MULTI_DELEGATE MYGUI_COMBINE(CMultiDelegate, MYGUI_SUFFIX)
|
|
||||||
|
|
||||||
|
|
||||||
// базовый класс всех делегатов
|
|
||||||
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS
|
|
||||||
class MYGUI_I_DELEGATE
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~MYGUI_I_DELEGATE() { }
|
|
||||||
virtual bool isType( const std::type_info& _type) = 0;
|
|
||||||
virtual void invoke( MYGUI_PARAMS ) = 0;
|
|
||||||
virtual bool compare( MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * _delegate) const = 0;
|
|
||||||
virtual bool compare(IDelegateUnlink * _unlink) const { return false; }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// делегат для статической функции
|
|
||||||
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS
|
|
||||||
class MYGUI_C_STATIC_DELEGATE : public MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef void (*Func)( MYGUI_PARAMS );
|
|
||||||
|
|
||||||
MYGUI_C_STATIC_DELEGATE (Func _func) : mFunc(_func) { }
|
|
||||||
|
|
||||||
virtual bool isType( const std::type_info& _type) { return typeid( MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS ) == _type; }
|
|
||||||
|
|
||||||
virtual void invoke( MYGUI_PARAMS )
|
|
||||||
{
|
|
||||||
mFunc( MYGUI_ARGS );
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool compare( MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * _delegate) const
|
|
||||||
{
|
|
||||||
if (nullptr == _delegate || !_delegate->isType(typeid(MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS)) ) return false;
|
|
||||||
MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS * cast = static_cast<MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS *>(_delegate);
|
|
||||||
return cast->mFunc == mFunc;
|
|
||||||
}
|
|
||||||
virtual bool compare(IDelegateUnlink * _unlink) const { return false; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Func mFunc;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// делегат для метода класса
|
|
||||||
template MYGUI_T_TEMPLATE_PARAMS
|
|
||||||
class MYGUI_C_METHOD_DELEGATE : public MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef void (T::*Method)( MYGUI_PARAMS );
|
|
||||||
|
|
||||||
MYGUI_C_METHOD_DELEGATE(IDelegateUnlink * _unlink, T * _object, Method _method) : mUnlink(_unlink), mObject(_object), mMethod(_method) { }
|
|
||||||
|
|
||||||
virtual bool isType( const std::type_info& _type) { return typeid( MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS ) == _type; }
|
|
||||||
|
|
||||||
virtual void invoke( MYGUI_PARAMS )
|
|
||||||
{
|
|
||||||
(mObject->*mMethod)( MYGUI_ARGS );
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool compare( MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * _delegate) const
|
|
||||||
{
|
|
||||||
if (nullptr == _delegate || !_delegate->isType(typeid(MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS)) ) return false;
|
|
||||||
MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS * cast = static_cast< MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS * >(_delegate);
|
|
||||||
return cast->mObject == mObject && cast->mMethod == mMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool compare(IDelegateUnlink * _unlink) const
|
|
||||||
{
|
|
||||||
return mUnlink == _unlink;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
IDelegateUnlink *mUnlink;
|
|
||||||
T * mObject;
|
|
||||||
Method mMethod;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace delegates
|
|
||||||
|
|
||||||
// шаблон для создания делегата статической функции
|
|
||||||
// параметры : указатель на функцию
|
|
||||||
// пример : newDelegate(funk_name);
|
|
||||||
// пример : newDelegate(class_name::static_method_name);
|
|
||||||
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS
|
|
||||||
inline delegates::MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * newDelegate( void (*_func)( MYGUI_PARAMS ) )
|
|
||||||
{
|
|
||||||
return new delegates::MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS (_func);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// шаблон для создания делегата метода класса
|
|
||||||
// параметры : указатель на объект класса и указатель на метод класса
|
|
||||||
// пример : newDelegate(&object_name, &class_name::method_name);
|
|
||||||
template MYGUI_T_TEMPLATE_PARAMS
|
|
||||||
inline delegates::MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * newDelegate( T * _object, void (T::*_method)( MYGUI_PARAMS ) )
|
|
||||||
{
|
|
||||||
return new delegates::MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS (delegates::GetDelegateUnlink(_object), _object, _method);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace delegates
|
|
||||||
{
|
|
||||||
// шаблон класса делегата
|
|
||||||
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS
|
|
||||||
class MYGUI_C_DELEGATE
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS IDelegate;
|
|
||||||
|
|
||||||
MYGUI_C_DELEGATE () : mDelegate(nullptr) { }
|
|
||||||
MYGUI_C_DELEGATE (const MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& _event)
|
|
||||||
{
|
|
||||||
// забираем себе владение
|
|
||||||
mDelegate = _event.mDelegate;
|
|
||||||
const_cast< MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& >(_event).mDelegate = nullptr;
|
|
||||||
}
|
|
||||||
~MYGUI_C_DELEGATE () { clear(); }
|
|
||||||
|
|
||||||
bool empty() const { return mDelegate == nullptr; }
|
|
||||||
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
if (mDelegate)
|
|
||||||
{
|
|
||||||
delete mDelegate;
|
|
||||||
mDelegate = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS & operator=(IDelegate* _delegate)
|
|
||||||
{
|
|
||||||
delete mDelegate;
|
|
||||||
mDelegate = _delegate;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS & operator=(const MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& _event)
|
|
||||||
{
|
|
||||||
// забираем себе владение
|
|
||||||
delete mDelegate;
|
|
||||||
mDelegate = _event.mDelegate;
|
|
||||||
const_cast< MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& >(_event).mDelegate = nullptr;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()( MYGUI_PARAMS )
|
|
||||||
{
|
|
||||||
if (mDelegate == nullptr) return;
|
|
||||||
mDelegate->invoke( MYGUI_ARGS );
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
IDelegate * mDelegate;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// шаблон класса мульти делегата
|
|
||||||
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS
|
|
||||||
class MYGUI_C_MULTI_DELEGATE
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS IDelegate;
|
|
||||||
typedef MYGUI_TYPENAME std::list<IDelegate* /*, Allocator<IDelegate*>*/ > ListDelegate;
|
|
||||||
typedef MYGUI_TYPENAME ListDelegate::iterator ListDelegateIterator;
|
|
||||||
typedef MYGUI_TYPENAME ListDelegate::const_iterator ConstListDelegateIterator;
|
|
||||||
|
|
||||||
MYGUI_C_MULTI_DELEGATE () { }
|
|
||||||
~MYGUI_C_MULTI_DELEGATE () { clear(); }
|
|
||||||
|
|
||||||
bool empty() const
|
|
||||||
{
|
|
||||||
for (ConstListDelegateIterator iter = mListDelegates.begin(); iter!=mListDelegates.end(); ++iter)
|
|
||||||
{
|
|
||||||
if (*iter) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter)
|
|
||||||
{
|
|
||||||
if (*iter)
|
|
||||||
{
|
|
||||||
delete (*iter);
|
|
||||||
(*iter) = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear(IDelegateUnlink * _unlink)
|
|
||||||
{
|
|
||||||
for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter)
|
|
||||||
{
|
|
||||||
if ((*iter) && (*iter)->compare(_unlink))
|
|
||||||
{
|
|
||||||
delete (*iter);
|
|
||||||
(*iter) = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & operator+=(IDelegate* _delegate)
|
|
||||||
{
|
|
||||||
for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter)
|
|
||||||
{
|
|
||||||
if ((*iter) && (*iter)->compare(_delegate))
|
|
||||||
{
|
|
||||||
MYGUI_ASSERT(false, "dublicate delegate");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mListDelegates.push_back(_delegate);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & operator-=(IDelegate* _delegate)
|
|
||||||
{
|
|
||||||
for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter)
|
|
||||||
{
|
|
||||||
if ((*iter) && (*iter)->compare(_delegate))
|
|
||||||
{
|
|
||||||
// проверяем на идентичность делегатов
|
|
||||||
if ((*iter) != _delegate) delete (*iter);
|
|
||||||
(*iter) = nullptr;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete _delegate;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()( MYGUI_PARAMS )
|
|
||||||
{
|
|
||||||
ListDelegateIterator iter = mListDelegates.begin();
|
|
||||||
while (iter != mListDelegates.end())
|
|
||||||
{
|
|
||||||
if (nullptr == (*iter))
|
|
||||||
{
|
|
||||||
iter = mListDelegates.erase(iter);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
(*iter)->invoke( MYGUI_ARGS );
|
|
||||||
++iter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
// constructor and operator =, without implementation, just for private
|
|
||||||
MYGUI_C_MULTI_DELEGATE (const MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & _event);
|
|
||||||
MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & operator=(const MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & _event);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
ListDelegate mListDelegates;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#undef MYGUI_COMBINE
|
|
||||||
#undef MYGUI_COMBINE1
|
|
||||||
|
|
||||||
#undef MYGUI_I_DELEGATE
|
|
||||||
|
|
||||||
#undef MYGUI_C_STATIC_DELEGATE
|
|
||||||
#undef MYGUI_C_METHOD_DELEGATE
|
|
||||||
|
|
||||||
#undef MYGUI_C_DELEGATE
|
|
||||||
#undef MYGUI_C_MULTI_DELEGATE
|
|
||||||
|
|
||||||
#undef MYGUI_SUFFIX
|
|
||||||
#undef MYGUI_TEMPLATE
|
|
||||||
#undef MYGUI_TEMPLATE_PARAMS
|
|
||||||
#undef MYGUI_TEMPLATE_ARGS
|
|
||||||
#undef MYGUI_T_TEMPLATE_PARAMS
|
|
||||||
#undef MYGUI_T_TEMPLATE_ARGS
|
|
||||||
#undef MYGUI_PARAMS
|
|
||||||
#undef MYGUI_ARGS
|
|
||||||
#undef MYGUI_TYPENAME
|
|
||||||
|
|
||||||
} // namespace delegates
|
|
|
@ -1,115 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@author baho_is
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DIAGNOSTIC_H__
|
|
||||||
#define __MYGUI_DIAGNOSTIC_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Exception.h"
|
|
||||||
#include "MyGUI_LogManager.h"
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
// for debugging
|
|
||||||
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
|
|
||||||
#include <crtdbg.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MYGUI_LOG_SECTION "Core"
|
|
||||||
#define MYGUI_LOG_FILENAME "MyGUI.log"
|
|
||||||
#define MYGUI_LOG(level, text) MYGUI_LOGGING(MYGUI_LOG_SECTION, level, text)
|
|
||||||
|
|
||||||
#define MYGUI_BASE_EXCEPT(desc, src) throw MyGUI::Exception(desc, src, __FILE__, __LINE__);
|
|
||||||
|
|
||||||
// MSVC specific: sets the breakpoint
|
|
||||||
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
|
|
||||||
#define MYGUI_DBG_BREAK _CrtDbgBreak();
|
|
||||||
#else
|
|
||||||
#define MYGUI_DBG_BREAK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MYGUI_EXCEPT(dest) \
|
|
||||||
{ \
|
|
||||||
MYGUI_LOG(Critical, dest); \
|
|
||||||
MYGUI_DBG_BREAK;\
|
|
||||||
std::ostringstream stream; \
|
|
||||||
stream << dest << "\n"; \
|
|
||||||
MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MYGUI_ASSERT(exp, dest) \
|
|
||||||
{ \
|
|
||||||
if ( ! (exp) ) \
|
|
||||||
{ \
|
|
||||||
MYGUI_LOG(Critical, dest); \
|
|
||||||
MYGUI_DBG_BREAK;\
|
|
||||||
std::ostringstream stream; \
|
|
||||||
stream << dest << "\n"; \
|
|
||||||
MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MYGUI_ASSERT_RANGE(index, size, owner) MYGUI_ASSERT(index < size, owner << " : index number " << index << " out of range [" << size << "]");
|
|
||||||
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner) MYGUI_ASSERT(index < size || index == ITEM_NONE, owner << " : index number " << index << " out of range [" << size << "]");
|
|
||||||
#define MYGUI_ASSERT_RANGE_INSERT(index, size, owner) MYGUI_ASSERT((index <= size) || (index == MyGUI::ITEM_NONE), owner << " : insert index number " << index << " out of range [" << size << "] or not ITEM_NONE");
|
|
||||||
|
|
||||||
#if MYGUI_DEBUG_MODE == 1
|
|
||||||
#define MYGUI_REGISTER_VALUE(map, value) \
|
|
||||||
{ \
|
|
||||||
MYGUI_LOG(Info, "Register value : '" << #value << "' = " << (int)value); \
|
|
||||||
map[#value] = value; \
|
|
||||||
}
|
|
||||||
#define MYGUI_DEBUG_ASSERT(exp, dest) MYGUI_ASSERT(exp, dest)
|
|
||||||
#else
|
|
||||||
#define MYGUI_REGISTER_VALUE(map, value) map[#value] = value;
|
|
||||||
#define MYGUI_DEBUG_ASSERT(exp, dest) ((void)0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// for more info see: http://mdf-i.blogspot.com/2008/09/deprecated-gcc-vs-vs-vs-vs.html
|
|
||||||
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
|
|
||||||
#if MYGUI_COMP_VER == 1310 // VC++ 7.1
|
|
||||||
#define MYGUI_OBSOLETE_START(text)
|
|
||||||
#define MYGUI_OBSOLETE_END
|
|
||||||
#else
|
|
||||||
#define MYGUI_OBSOLETE_START(text) __declspec(deprecated(text))
|
|
||||||
#define MYGUI_OBSOLETE_END
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif MYGUI_COMPILER == MYGUI_COMPILER_GNUC
|
|
||||||
#if MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX && MYGUI_COMP_VER == 412
|
|
||||||
#define MYGUI_OBSOLETE_START(text)
|
|
||||||
#define MYGUI_OBSOLETE_END
|
|
||||||
#else
|
|
||||||
#define MYGUI_OBSOLETE_START(text)
|
|
||||||
#define MYGUI_OBSOLETE_END __attribute__((deprecated))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define MYGUI_OBSOLETE_START(text)
|
|
||||||
#define MYGUI_OBSOLETE_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MYGUI_OBSOLETE(text) /*! \deprecated text */ MYGUI_OBSOLETE_START(text)MYGUI_OBSOLETE_END
|
|
||||||
|
|
||||||
#endif // __MYGUI_DIAGNOSTIC_H__
|
|
|
@ -1,111 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Denis Koronchik
|
|
||||||
@author Georgiy Evmenov
|
|
||||||
@date 09/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MYGUI_DYNLIB_H__
|
|
||||||
#define __MYGUI_DYNLIB_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
||||||
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
|
|
||||||
# define MYGUI_DYNLIB_HANDLE hInstance
|
|
||||||
# define MYGUI_DYNLIB_LOAD( a ) LoadLibrary( a )
|
|
||||||
# define MYGUI_DYNLIB_GETSYM( a, b ) GetProcAddress( a, b )
|
|
||||||
# define MYGUI_DYNLIB_UNLOAD( a ) !FreeLibrary( a )
|
|
||||||
|
|
||||||
struct HINSTANCE__;
|
|
||||||
typedef struct HINSTANCE__* hInstance;
|
|
||||||
|
|
||||||
#elif MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX
|
|
||||||
# define MYGUI_DYNLIB_HANDLE void*
|
|
||||||
# define MYGUI_DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
|
|
||||||
# define MYGUI_DYNLIB_GETSYM( a, b ) dlsym( a, b )
|
|
||||||
# define MYGUI_DYNLIB_UNLOAD( a ) dlclose( a )
|
|
||||||
|
|
||||||
#elif MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
|
|
||||||
# include <CoreFoundation/CFBundle.h>
|
|
||||||
# define MYGUI_DYNLIB_HANDLE CFBundleRef
|
|
||||||
# define MYGUI_DYNLIB_LOAD( a ) mac_loadExeBundle( a )
|
|
||||||
# define MYGUI_DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b )
|
|
||||||
# define MYGUI_DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/*! @brief Resource holding data about a dynamic library.
|
|
||||||
|
|
||||||
@remarks
|
|
||||||
This class holds the data required to get symbols from
|
|
||||||
libraries loaded at run-time (i.e. from DLL's for so's)
|
|
||||||
*/
|
|
||||||
class MYGUI_EXPORT DynLib
|
|
||||||
{
|
|
||||||
friend class DynLibManager;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
DynLib(const std::string &name);
|
|
||||||
|
|
||||||
~DynLib();
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/*! Load the library
|
|
||||||
*/
|
|
||||||
bool load();
|
|
||||||
|
|
||||||
/*! Unload the library
|
|
||||||
*/
|
|
||||||
void unload();
|
|
||||||
|
|
||||||
//! Get the name of the library
|
|
||||||
std::string getName(void) const { return mName; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
Returns the address of the given symbol from the loaded library.
|
|
||||||
@param
|
|
||||||
strName The name of the symbol to search for
|
|
||||||
@returns
|
|
||||||
If the function succeeds, the returned value is a handle to the symbol.
|
|
||||||
If the function fails, the returned value is <b>nullptr</b>.
|
|
||||||
*/
|
|
||||||
void* getSymbol( const std::string& strName ) const throw();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
//! Gets the last loading error
|
|
||||||
std::string dynlibError(void);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
//! Name of library
|
|
||||||
std::string mName;
|
|
||||||
|
|
||||||
//! Handle to the loaded library.
|
|
||||||
MYGUI_DYNLIB_HANDLE mInstance;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_DYNLIB_H__
|
|
|
@ -1,58 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Denis Koronchik
|
|
||||||
@date 08/2007
|
|
||||||
@module libEngine
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_DYN_LIB_MANAGER_H__
|
|
||||||
#define __MYGUI_DYN_LIB_MANAGER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_DynLib.h"
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/*! \brief Manager of dynamic libraries
|
|
||||||
*/
|
|
||||||
class MYGUI_EXPORT DynLibManager
|
|
||||||
{
|
|
||||||
MYGUI_INSTANCE_HEADER( DynLibManager )
|
|
||||||
|
|
||||||
public:
|
|
||||||
void initialise();
|
|
||||||
void shutdown();
|
|
||||||
|
|
||||||
//! Load library
|
|
||||||
DynLib* load(const std::string &fileName);
|
|
||||||
//! Unload library
|
|
||||||
void unload(DynLib *library);
|
|
||||||
|
|
||||||
private:
|
|
||||||
//! Dynamic libraries map
|
|
||||||
typedef std::map <std::string, DynLib*> StringDynLibMap;
|
|
||||||
//! Loaded libraries
|
|
||||||
StringDynLibMap mLibsMap;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_DYN_LIB_MANAGER_H__
|
|
443
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Edit.h
vendored
443
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Edit.h
vendored
|
@ -1,443 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_EDIT_H__
|
|
||||||
#define __MYGUI_EDIT_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_StaticText.h"
|
|
||||||
#include "MyGUI_TextChangeHistory.h"
|
|
||||||
#include "MyGUI_TextIterator.h"
|
|
||||||
#include "MyGUI_EventPair.h"
|
|
||||||
#include "MyGUI_ScrollViewBase.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef delegates::CDelegate1<Edit*> EventHandle_EditPtr;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT Edit :
|
|
||||||
public StaticText,
|
|
||||||
public ScrollViewBase
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( Edit )
|
|
||||||
|
|
||||||
public:
|
|
||||||
Edit();
|
|
||||||
|
|
||||||
/** Colour interval */
|
|
||||||
void setTextIntervalColour(size_t _start, size_t _count, const Colour& _colour);
|
|
||||||
|
|
||||||
/** Get index of first selected character or ITEM_NONE if nothing selected */
|
|
||||||
size_t getTextSelectionStart();
|
|
||||||
|
|
||||||
/** Get index of last selected character or ITEM_NONE if nothing selected */
|
|
||||||
size_t getTextSelectionEnd();
|
|
||||||
|
|
||||||
/** Get length of selected text */
|
|
||||||
size_t getTextSelectionLength();
|
|
||||||
|
|
||||||
// возвращает текст с тегами
|
|
||||||
/** Get _count characters with tags from _start position */
|
|
||||||
UString getTextInterval(size_t _start, size_t _count);
|
|
||||||
|
|
||||||
/** Set selected text interval
|
|
||||||
@param _start of interval
|
|
||||||
@param _end of interval
|
|
||||||
*/
|
|
||||||
void setTextSelection(size_t _start, size_t _end);
|
|
||||||
|
|
||||||
/** Delete selected text */
|
|
||||||
void deleteTextSelection();
|
|
||||||
|
|
||||||
/** Get selected text */
|
|
||||||
UString getTextSelection();
|
|
||||||
|
|
||||||
/** Is any text selected */
|
|
||||||
bool isTextSelection();
|
|
||||||
|
|
||||||
/** Colour selected text */
|
|
||||||
void setTextSelectionColour(const Colour& _value);
|
|
||||||
|
|
||||||
/** Set text cursor position */
|
|
||||||
void setTextCursor(size_t _index);
|
|
||||||
/** Get text cursor position */
|
|
||||||
size_t getTextCursor() { return mCursorPosition; }
|
|
||||||
|
|
||||||
|
|
||||||
/** Set edit text applying tags */
|
|
||||||
virtual void setCaption(const UString& _value);
|
|
||||||
/** Get edit text with tags */
|
|
||||||
virtual const UString& getCaption();
|
|
||||||
|
|
||||||
/** Set edit text without tags */
|
|
||||||
void setOnlyText(const UString& _value);
|
|
||||||
/** Get edit text without tags */
|
|
||||||
UString getOnlyText();
|
|
||||||
|
|
||||||
/** Get text length excluding tags
|
|
||||||
For example "#00FF00Hello" length is 5
|
|
||||||
*/
|
|
||||||
size_t getTextLength() const { return mTextLength; }
|
|
||||||
|
|
||||||
//! Sets if surplus characters should push characters off the left side rather than ignored
|
|
||||||
void setOverflowToTheLeft(bool _value) { mOverflowToTheLeft = _value; }
|
|
||||||
//! Returns true if surplus characters will be pushed off the left rather than ignored
|
|
||||||
bool getOverflowToTheLeft() { return mOverflowToTheLeft; }
|
|
||||||
|
|
||||||
//! Sets the max amount of text allowed in the edit field.
|
|
||||||
void setMaxTextLength(size_t _value) { mMaxTextLength = _value; }
|
|
||||||
//! Gets the max amount of text allowed in the edit field.
|
|
||||||
size_t getMaxTextLength() { return mMaxTextLength; }
|
|
||||||
|
|
||||||
/** Inser text at _index position (text end by default) */
|
|
||||||
void insertText(const UString& _text, size_t _index = ITEM_NONE);
|
|
||||||
/** Add text */
|
|
||||||
void addText(const UString& _text);
|
|
||||||
/** Erase _count characters from _start position */
|
|
||||||
void eraseText(size_t _start, size_t _count = 1);
|
|
||||||
|
|
||||||
/** Enable or disable edit read only mode\n
|
|
||||||
Read only mode: you can't edit text, but can select it.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setEditReadOnly(bool _value);
|
|
||||||
/** Get edit read only mode flag */
|
|
||||||
bool getEditReadOnly() { return mModeReadOnly; }
|
|
||||||
|
|
||||||
/** Enable or disable edit password mode\n
|
|
||||||
Password mode: you see password chars (*** by default) instead text.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setEditPassword(bool _value);
|
|
||||||
/** Get edit password mode flag */
|
|
||||||
bool getEditPassword() { return mModePassword; }
|
|
||||||
|
|
||||||
/** Enable or disable edit multiline mode\n
|
|
||||||
Multile mode: new line character moves text to new line.\n
|
|
||||||
Otherwise new lines replaced with space and all text is in single line.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setEditMultiLine(bool _value);
|
|
||||||
/** Get edit multiline mode flag */
|
|
||||||
bool getEditMultiLine() { return mModeMultiline; }
|
|
||||||
|
|
||||||
/** Enable or disable edit static mode\n
|
|
||||||
Static mode is same as read only, but you also can't select text.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setEditStatic(bool _value);
|
|
||||||
/** Get edit static mode flag */
|
|
||||||
bool getEditStatic() { return mModeStatic; }
|
|
||||||
|
|
||||||
/** Set edit password character ('*' by default) */
|
|
||||||
void setPasswordChar(Char _value);
|
|
||||||
/** Set edit password character ('*' by default). First character of string used. */
|
|
||||||
void setPasswordChar(const UString& _char);
|
|
||||||
/** Get edit password character */
|
|
||||||
Char getPasswordChar() { return mCharPassword; }
|
|
||||||
|
|
||||||
/** Enable or disable edit word wrap mode\n
|
|
||||||
Word Wrap mode: move words to new line if they goes out of width.
|
|
||||||
Also in this mode you can't edit or select text.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setEditWordWrap(bool _value);
|
|
||||||
/** Get edit word wrap mode flag */
|
|
||||||
bool getEditWordWrap() { return mModeWordWrap; }
|
|
||||||
|
|
||||||
/** Enable or disable tab printing mode\n
|
|
||||||
Tab printing mode: when editing text and pressing Tab key it displayed.
|
|
||||||
If this mode disabled Tab key ignored.\n
|
|
||||||
Disabled (false) by default.
|
|
||||||
*/
|
|
||||||
void setTabPrinting(bool _value) { mTabPrinting = _value; }
|
|
||||||
/** Get edit tab printing wrap mode flag */
|
|
||||||
bool getTabPrinting() { return mTabPrinting; }
|
|
||||||
|
|
||||||
/** Get invert selected text color property */
|
|
||||||
bool getInvertSelected();
|
|
||||||
/** Enable or disable inverting color of selected text\n
|
|
||||||
Enabled (true) by default
|
|
||||||
*/
|
|
||||||
void setInvertSelected(bool _value);
|
|
||||||
|
|
||||||
//! @copydoc Widget::setPosition(const IntPoint& _value)
|
|
||||||
virtual void setPosition(const IntPoint& _value);
|
|
||||||
//! @copydoc Widget::setSize(const IntSize& _value)
|
|
||||||
virtual void setSize(const IntSize& _value);
|
|
||||||
//! @copydoc Widget::setCoord(const IntCoord& _value)
|
|
||||||
virtual void setCoord(const IntCoord& _value);
|
|
||||||
|
|
||||||
/** @copydoc Widget::setPosition(int _left, int _top) */
|
|
||||||
void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); }
|
|
||||||
/** @copydoc Widget::setSize(int _width, int _height) */
|
|
||||||
void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); }
|
|
||||||
/** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */
|
|
||||||
void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); }
|
|
||||||
|
|
||||||
/** Show VScroll when text size larger than Edit */
|
|
||||||
void setVisibleVScroll(bool _value);
|
|
||||||
/** Get Show VScroll flag */
|
|
||||||
bool isVisibleVScroll() { return mVisibleVScroll; }
|
|
||||||
/** Get range of vertical scroll (or 0 if no scroll).
|
|
||||||
Range measured in pixels (full text heiht minus Edit height).
|
|
||||||
For example if Edit is 200 pixels height and 40 lines of text
|
|
||||||
30 pixels height each (i.e. 600 pixels total), then return
|
|
||||||
value is 400 ( = 600 - 200 ).
|
|
||||||
*/
|
|
||||||
size_t getVScrollRange();
|
|
||||||
/** Get current position of vertical scroll (or 0 if no scroll) */
|
|
||||||
size_t getVScrollPosition();
|
|
||||||
/** Set current position of vertical scroll */
|
|
||||||
void setVScrollPosition(size_t _index);
|
|
||||||
|
|
||||||
/** Show HScroll when text size larger than Edit */
|
|
||||||
void setVisibleHScroll(bool _value);
|
|
||||||
/** Get Show HScroll flag */
|
|
||||||
bool isVisibleHScroll() { return mVisibleHScroll; }
|
|
||||||
/** Get range of horizontal scroll (or 0 if no scroll).
|
|
||||||
Range measured in pixels (full text width minus Edit width).
|
|
||||||
For example if Edit is 200 pixels width and the longest line
|
|
||||||
is 600 pixels width, then return value is 400 ( = 600 - 200 ).
|
|
||||||
*/
|
|
||||||
size_t getHScrollRange();
|
|
||||||
/** Get current position of horizontal scroll (or 0 if no scroll) */
|
|
||||||
size_t getHScrollPosition();
|
|
||||||
/** Set current position of horizontal scroll */
|
|
||||||
void setHScrollPosition(size_t _index);
|
|
||||||
|
|
||||||
|
|
||||||
//! @copydoc StaticText::setFontName
|
|
||||||
virtual void setFontName(const std::string& _value);
|
|
||||||
//! @copydoc StaticText::setFontHeight
|
|
||||||
virtual void setFontHeight(int _value);
|
|
||||||
|
|
||||||
//! @copydoc StaticText::setTextAlign
|
|
||||||
virtual void setTextAlign(Align _value);
|
|
||||||
|
|
||||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
|
||||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
|
||||||
|
|
||||||
/*event:*/
|
|
||||||
/** Event : Enter pressed (Ctrl+enter in multiline mode).\n
|
|
||||||
signature : void method(MyGUI::Edit* _sender)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
*/
|
|
||||||
EventPair<EventHandle_WidgetVoid, EventHandle_EditPtr> eventEditSelectAccept;
|
|
||||||
|
|
||||||
/** Event : Text changed.\n
|
|
||||||
signature : void method(MyGUI::Edit* _sender)
|
|
||||||
@param _sender widget that called this event
|
|
||||||
*/
|
|
||||||
EventPair<EventHandle_WidgetVoid, EventHandle_EditPtr> eventEditTextChange;
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
/*obsolete:*/
|
|
||||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Edit::setVisibleVScroll(bool _visible)")
|
|
||||||
void showVScroll(bool _visible) { setVisibleVScroll(_visible); }
|
|
||||||
MYGUI_OBSOLETE("use : bool Edit::isVisibleVScroll()")
|
|
||||||
bool isShowVScroll() { return isVisibleVScroll(); }
|
|
||||||
MYGUI_OBSOLETE("use : void Edit::setVisibleHScroll(bool _visible)")
|
|
||||||
void showHScroll(bool _visible) { setVisibleHScroll(_visible); }
|
|
||||||
MYGUI_OBSOLETE("use : bool Edit::isVisibleHScroll()")
|
|
||||||
bool isShowHScroll() { return isVisibleHScroll(); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)")
|
|
||||||
void setPosition(const IntCoord& _coord) { setCoord(_coord); }
|
|
||||||
MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)")
|
|
||||||
void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); }
|
|
||||||
|
|
||||||
// to avoid hiding base virtual function
|
|
||||||
virtual void setTextColour(const Colour& _colour) { Base::setTextColour(_colour); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Edit::setTextIntervalColour(size_t _start, size_t _count, const Colour& _colour)")
|
|
||||||
void setTextColour(size_t _start, size_t _count, const Colour& _colour) { setTextIntervalColour(_start, _count, _colour); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : size_t Edit::getTextSelectionStart() , size_t getTextSelectionEnd()")
|
|
||||||
void getTextSelect(size_t& _start, size_t& _end);
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : UString Edit::getTextInterval(size_t _start, size_t _count)")
|
|
||||||
UString getText(size_t _start, size_t _count) { return getTextInterval(_start, _count); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Edit::setTextSelection(size_t _start, size_t _end)")
|
|
||||||
void setTextSelect(size_t _start, size_t _end) { setTextSelection(_start, _end); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Edit::deleteTextSelection()")
|
|
||||||
void deleteTextSelect() { deleteTextSelection(); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : UString Edit::getTextSelection()")
|
|
||||||
UString getSelectedText() { return getTextSelection(); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : bool Edit::isTextSelection()")
|
|
||||||
bool isTextSelect() { return isTextSelection(); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Edit::setTextSelectionColour(const Colour& _colour)")
|
|
||||||
void setTextSelectColour(const Colour& _colour) { setTextSelectionColour(_colour); }
|
|
||||||
|
|
||||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~Edit();
|
|
||||||
|
|
||||||
virtual void onMouseDrag(int _left, int _top);
|
|
||||||
virtual void onKeyLostFocus(Widget* _new);
|
|
||||||
virtual void onKeySetFocus(Widget* _old);
|
|
||||||
virtual void onKeyButtonPressed(KeyCode _key, Char _char);
|
|
||||||
|
|
||||||
// потом убрать все нотифи в сраку
|
|
||||||
void notifyMouseSetFocus(Widget* _sender, Widget* _old);
|
|
||||||
void notifyMouseLostFocus(Widget* _sender, Widget* _new);
|
|
||||||
void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
|
|
||||||
void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id);
|
|
||||||
void notifyMouseDrag(Widget* _sender, int _left, int _top);
|
|
||||||
void notifyMouseButtonDoubleClick(Widget* _sender);
|
|
||||||
|
|
||||||
void notifyScrollChangePosition(VScroll* _sender, size_t _position);
|
|
||||||
void notifyMouseWheel(Widget* _sender, int _rel);
|
|
||||||
|
|
||||||
// обновление представления
|
|
||||||
void updateView();
|
|
||||||
void updateViewWithCursor();
|
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
|
||||||
|
|
||||||
void eraseView();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
private:
|
|
||||||
// устанавливает текст
|
|
||||||
void setText(const UString& _text, bool _history);
|
|
||||||
// удаляет все что выделенно
|
|
||||||
bool deleteTextSelect(bool _history);
|
|
||||||
// вставляет текст в указанную позицию
|
|
||||||
void insertText(const UString& _text, size_t _index, bool _history);
|
|
||||||
// удаляет текст
|
|
||||||
void eraseText(size_t _start, size_t _count, bool _history);
|
|
||||||
// выделяет цветом выделение
|
|
||||||
void setTextSelectColour(const Colour& _colour, bool _history);
|
|
||||||
// выделяет цветом диапазон
|
|
||||||
void _setTextColour(size_t _start, size_t _count, const Colour& _colour, bool _history);
|
|
||||||
|
|
||||||
void frameEntered(float _frame);
|
|
||||||
|
|
||||||
void updateEditState();
|
|
||||||
|
|
||||||
// обновляет курсор по координате
|
|
||||||
void updateSelectText();
|
|
||||||
|
|
||||||
void resetSelect();
|
|
||||||
|
|
||||||
// запись в историю данных о позиции
|
|
||||||
void commandPosition(size_t _undo, size_t _redo, size_t _length, VectorChangeInfo * _info = nullptr);
|
|
||||||
|
|
||||||
// команнды отмена и повтор
|
|
||||||
bool commandRedo();
|
|
||||||
bool commandUndo();
|
|
||||||
// объединяет последние две комманды
|
|
||||||
void commandMerge();
|
|
||||||
// очистка
|
|
||||||
void commandResetRedo() { mVectorRedoChangeInfo.clear(); }
|
|
||||||
void commandResetHistory() { mVectorRedoChangeInfo.clear();mVectorUndoChangeInfo.clear(); }
|
|
||||||
void saveInHistory(VectorChangeInfo * _info = nullptr);
|
|
||||||
|
|
||||||
// работа с буфером обмена
|
|
||||||
void commandCut();
|
|
||||||
void commandCopy();
|
|
||||||
void commandPast();
|
|
||||||
|
|
||||||
const UString& getRealString();
|
|
||||||
|
|
||||||
void setRealString(const UString& _caption);
|
|
||||||
|
|
||||||
void updateCursorPosition();
|
|
||||||
|
|
||||||
// размер данных
|
|
||||||
virtual IntSize getContentSize();
|
|
||||||
// смещение данных
|
|
||||||
virtual IntPoint getContentPosition();
|
|
||||||
virtual void setContentPosition(const IntPoint& _point);
|
|
||||||
// размер окна, через которые видно данные
|
|
||||||
virtual IntSize getViewSize() const;
|
|
||||||
// размер на который прокручиваются данные при щелчке по скролу
|
|
||||||
virtual size_t getVScrollPage();
|
|
||||||
virtual size_t getHScrollPage();
|
|
||||||
|
|
||||||
virtual Align getContentAlign();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// нажата ли кнопка
|
|
||||||
bool mIsPressed;
|
|
||||||
// в фокусе ли кнопка
|
|
||||||
bool mIsFocus;
|
|
||||||
|
|
||||||
bool mCursorActive;
|
|
||||||
float mCursorTimer;
|
|
||||||
float mActionMouseTimer;
|
|
||||||
|
|
||||||
// позиция курсора
|
|
||||||
size_t mCursorPosition;
|
|
||||||
// максимальное колличество
|
|
||||||
size_t mTextLength;
|
|
||||||
|
|
||||||
// выделение
|
|
||||||
size_t mStartSelect;
|
|
||||||
size_t mEndSelect;
|
|
||||||
|
|
||||||
// списоки изменений для отмены и повтора
|
|
||||||
DequeUndoRedoInfo mVectorUndoChangeInfo;
|
|
||||||
DequeUndoRedoInfo mVectorRedoChangeInfo;
|
|
||||||
|
|
||||||
bool mMouseLeftPressed;
|
|
||||||
|
|
||||||
bool mModeReadOnly;
|
|
||||||
bool mModePassword;
|
|
||||||
bool mModeMultiline;
|
|
||||||
bool mModeStatic;
|
|
||||||
bool mModeWordWrap;
|
|
||||||
|
|
||||||
bool mTabPrinting;
|
|
||||||
|
|
||||||
// настоящий текст, закрытый за звездочками
|
|
||||||
UString mPasswordText;
|
|
||||||
|
|
||||||
// для поддержки режима статик, где курсор не нужен
|
|
||||||
std::string mOriginalPointer;
|
|
||||||
|
|
||||||
Char mCharPassword;
|
|
||||||
|
|
||||||
bool mOverflowToTheLeft;
|
|
||||||
size_t mMaxTextLength;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_EDIT_H__
|
|
|
@ -1,164 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 09/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_EDIT_TEXT_H__
|
|
||||||
#define __MYGUI_EDIT_TEXT_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_XmlDocument.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_ISubWidgetText.h"
|
|
||||||
#include "MyGUI_IFont.h"
|
|
||||||
#include "MyGUI_ResourceSkin.h"
|
|
||||||
#include "MyGUI_RenderFormat.h"
|
|
||||||
#include "MyGUI_TextView.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class RenderItem;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT EditText : public ISubWidgetText
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( EditText )
|
|
||||||
|
|
||||||
public:
|
|
||||||
EditText();
|
|
||||||
virtual ~EditText();
|
|
||||||
|
|
||||||
virtual void setVisible(bool _value);
|
|
||||||
|
|
||||||
// обновляет все данные связанные с тектом
|
|
||||||
virtual void updateRawData();
|
|
||||||
|
|
||||||
// метод для отрисовки себя
|
|
||||||
virtual void doRender();
|
|
||||||
|
|
||||||
void setCaption(const UString& _value);
|
|
||||||
const UString& getCaption();
|
|
||||||
|
|
||||||
void setTextColour(const Colour& _value);
|
|
||||||
const Colour& getTextColour();
|
|
||||||
|
|
||||||
void setAlpha(float _value);
|
|
||||||
float getAlpha();
|
|
||||||
|
|
||||||
virtual void setFontName(const std::string& _value);
|
|
||||||
virtual const std::string& getFontName();
|
|
||||||
|
|
||||||
virtual void setFontHeight(int _value);
|
|
||||||
virtual int getFontHeight();
|
|
||||||
|
|
||||||
virtual void createDrawItem(ITexture* _texture, ILayerNode * _node);
|
|
||||||
virtual void destroyDrawItem();
|
|
||||||
|
|
||||||
virtual void setTextAlign(Align _value);
|
|
||||||
virtual Align getTextAlign();
|
|
||||||
|
|
||||||
virtual size_t getTextSelectionStart();
|
|
||||||
virtual size_t getTextSelectionEnd();
|
|
||||||
virtual void setTextSelection(size_t _start, size_t _end);
|
|
||||||
|
|
||||||
virtual bool getSelectBackground();
|
|
||||||
virtual void setSelectBackground(bool _normal);
|
|
||||||
|
|
||||||
virtual bool isVisibleCursor();
|
|
||||||
virtual void setVisibleCursor(bool _value);
|
|
||||||
|
|
||||||
/** Get invert selected text color property */
|
|
||||||
virtual bool getInvertSelected() { return mInvertSelect; }
|
|
||||||
/** Enable or disable inverting color of selected text\n
|
|
||||||
Enabled (true) by default
|
|
||||||
*/
|
|
||||||
virtual void setInvertSelected(bool _value);
|
|
||||||
|
|
||||||
virtual size_t getCursorPosition();
|
|
||||||
virtual void setCursorPosition(size_t _index);
|
|
||||||
|
|
||||||
virtual IntSize getTextSize();
|
|
||||||
|
|
||||||
// устанавливает смещение текста в пикселях
|
|
||||||
virtual void setViewOffset(const IntPoint& _point);
|
|
||||||
virtual IntPoint getViewOffset();
|
|
||||||
|
|
||||||
// возвращает положение курсора по произвольному положению
|
|
||||||
virtual size_t getCursorPosition(const IntPoint& _point);
|
|
||||||
|
|
||||||
// возвращает положение курсора в обсолютных координатах
|
|
||||||
virtual IntCoord getCursorCoord(size_t _position);
|
|
||||||
|
|
||||||
void setShiftText(bool _shift);
|
|
||||||
|
|
||||||
void setWordWrap(bool _value);
|
|
||||||
|
|
||||||
virtual void setStateData(IStateInfo * _data);
|
|
||||||
|
|
||||||
void _updateView();
|
|
||||||
void _correctView();
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
void _setAlign(const IntSize& _oldsize, bool _update);
|
|
||||||
void _setAlign(const IntCoord& _oldcoord, bool _update);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool mEmptyView;
|
|
||||||
uint32 mCurrentColour;
|
|
||||||
uint32 mInverseColour;
|
|
||||||
uint32 mCurrentAlpha;
|
|
||||||
IntCoord mCurrentCoord;
|
|
||||||
|
|
||||||
UString mCaption;
|
|
||||||
bool mTextOutDate;
|
|
||||||
Align mTextAlign;
|
|
||||||
|
|
||||||
Colour mColour;
|
|
||||||
float mAlpha;
|
|
||||||
VertexColourType mVertexFormat;
|
|
||||||
|
|
||||||
IFont* mFont;
|
|
||||||
ITexture* mTexture;
|
|
||||||
int mFontHeight;
|
|
||||||
|
|
||||||
bool mBackgroundNormal;
|
|
||||||
size_t mStartSelect;
|
|
||||||
size_t mEndSelect;
|
|
||||||
size_t mCursorPosition;
|
|
||||||
bool mVisibleCursor;
|
|
||||||
bool mInvertSelect;
|
|
||||||
|
|
||||||
IntPoint mViewOffset; // смещение текста
|
|
||||||
|
|
||||||
ILayerNode* mNode;
|
|
||||||
RenderItem* mRenderItem;
|
|
||||||
size_t mCountVertex;
|
|
||||||
bool mIsAddCursorWidth;
|
|
||||||
|
|
||||||
bool mShiftText;
|
|
||||||
bool mWordWrap;
|
|
||||||
int mOldWidth;
|
|
||||||
|
|
||||||
TextView mTextView;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_EDIT_TEXT_H__
|
|
|
@ -1,108 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 08/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_ENUMERATOR_H__
|
|
||||||
#define __MYGUI_ENUMERATOR_H__
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Class for comfortable using of vectors with small while loop
|
|
||||||
instead iterators. Performance is same as with iterators.
|
|
||||||
Enumerator usage
|
|
||||||
@example Enumerator
|
|
||||||
@code
|
|
||||||
typedef std::vector<std::string> VectorString;
|
|
||||||
typedef Enumerator<VectorString> EnumeratorVectorString;
|
|
||||||
|
|
||||||
VectorString vec;
|
|
||||||
vec.push_back("value");
|
|
||||||
//EnumeratorVectorString enum_vec(vec.begin(), vec.end());
|
|
||||||
EnumeratorVectorString enum_vec(vec);
|
|
||||||
while (enum_vec.next())
|
|
||||||
{
|
|
||||||
std::string value = enum_vec.current();
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef std::pair<std::string, std::string> PairString;
|
|
||||||
typedef std::map<PairString> MapString;
|
|
||||||
|
|
||||||
MapString map;
|
|
||||||
map["key"] = "value";
|
|
||||||
//EnumeratorMapString enum_map(map.begin(), map.end());
|
|
||||||
EnumeratorMapString enum_map(map);
|
|
||||||
while (enum_map.next())
|
|
||||||
{
|
|
||||||
std::string key = enum_map.current().first;
|
|
||||||
std::string value = enum_map.current().second;
|
|
||||||
}
|
|
||||||
@endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class Enumerator
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
Enumerator() { }
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit Enumerator(const T& _container) :
|
|
||||||
m_first(true),
|
|
||||||
m_current(_container.begin()),
|
|
||||||
m_end(_container.end())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Enumerator(typename T::const_iterator _first, typename T::const_iterator _end) :
|
|
||||||
m_first(true),
|
|
||||||
m_current(_first),
|
|
||||||
m_end(_end)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool next()
|
|
||||||
{
|
|
||||||
if (m_current == m_end) return false;
|
|
||||||
else if (m_first)
|
|
||||||
{
|
|
||||||
m_first = false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
++ m_current;
|
|
||||||
if (m_current == m_end) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
typename T::const_reference operator->() const { assert(m_current != m_end); return (*m_current); }
|
|
||||||
typename T::const_reference current() { assert(m_current != m_end); return (*m_current); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_first;
|
|
||||||
typename T::const_iterator m_current;
|
|
||||||
typename T::const_iterator m_end;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ENUMERATOR_H__
|
|
|
@ -1,118 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 10/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_EVENT_PAIR_H__
|
|
||||||
#define __MYGUI_EVENT_PAIR_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
template <typename EventObsolete, typename Event>
|
|
||||||
class EventPair
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate")
|
|
||||||
void operator = (T * _delegate)
|
|
||||||
{
|
|
||||||
m_eventObsolete = _delegate;
|
|
||||||
m_event = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator = (typename Event::IDelegate * _delegate)
|
|
||||||
{
|
|
||||||
m_eventObsolete = nullptr;
|
|
||||||
m_event = _delegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1>
|
|
||||||
void operator()( TP1 p1 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1);
|
|
||||||
m_event(p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2>
|
|
||||||
void operator()( TP1 p1, TP2 p2 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2);
|
|
||||||
m_event(p1, p2);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2, typename TP3>
|
|
||||||
void operator()( TP1 p1, TP2 p2, TP3 p3 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2, p3);
|
|
||||||
m_event(p1, p2, p3);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2, typename TP3, typename TP4>
|
|
||||||
void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2, p3, p4);
|
|
||||||
m_event(p1, p2, p3, p4);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5>
|
|
||||||
void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2, p3, p4, p5);
|
|
||||||
m_event(p1, p2, p3, p4, p5);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5, typename TP6>
|
|
||||||
void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2, p3, p4, p5, p6);
|
|
||||||
m_event(p1, p2, p3, p4, p5, p6);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5, typename TP6, typename TP7>
|
|
||||||
void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6, TP7 p7 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2, p3, p4, p5, p6, p7);
|
|
||||||
m_event(p1, p2, p3, p4, p5, p6, p7);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5, typename TP6, typename TP7, typename TP8>
|
|
||||||
void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6, TP7 p7, TP8 p8 )
|
|
||||||
{
|
|
||||||
m_eventObsolete(p1, p2, p3, p4, p5, p6, p7, p8);
|
|
||||||
m_event(p1, p2, p3, p4, p5, p6, p7, p8);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool empty() const
|
|
||||||
{
|
|
||||||
return m_eventObsolete.empty() && m_event.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
EventObsolete m_eventObsolete;
|
|
||||||
Event m_event;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_EVENT_PAIR_H__
|
|
|
@ -1,69 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 05/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_EXCEPTION_H__
|
|
||||||
#define __MYGUI_EXCEPTION_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include <exception>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT Exception : public std::exception
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
std::string mDescription;
|
|
||||||
std::string mSource;
|
|
||||||
std::string mFile;
|
|
||||||
long mLine;
|
|
||||||
mutable std::string mFullDesc;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Exception(const std::string& _description, const std::string& _source, const char* _file, long _line );
|
|
||||||
|
|
||||||
Exception(const Exception& _rhs);
|
|
||||||
|
|
||||||
// Needed for compatibility with std::exception
|
|
||||||
~Exception() throw() { }
|
|
||||||
|
|
||||||
Exception& operator = (const Exception& _rhs);
|
|
||||||
|
|
||||||
virtual const std::string& getFullDescription() const;
|
|
||||||
|
|
||||||
virtual const std::string &getSource() const { return mSource; }
|
|
||||||
|
|
||||||
virtual const std::string &getFile() const { return mFile; }
|
|
||||||
|
|
||||||
virtual long getLine() const { return mLine; }
|
|
||||||
|
|
||||||
virtual const std::string& getDescription() const { return mDescription; }
|
|
||||||
|
|
||||||
// Override std::exception::what
|
|
||||||
const char* what() const throw() { return getFullDescription().c_str(); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_EXCEPTION_H__
|
|
|
@ -1,79 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_FACTORY_MANAGER_H__
|
|
||||||
#define __MYGUI_FACTORY_MANAGER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_IObject.h"
|
|
||||||
#include "MyGUI_GenericFactory.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT FactoryManager
|
|
||||||
{
|
|
||||||
MYGUI_INSTANCE_HEADER( FactoryManager )
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef delegates::CDelegate1<IObject*&> Delegate;
|
|
||||||
|
|
||||||
void initialise();
|
|
||||||
void shutdown();
|
|
||||||
|
|
||||||
void registerFactory(const std::string& _category, const std::string& _type, Delegate::IDelegate* _delegate);
|
|
||||||
void unregisterFactory(const std::string& _category, const std::string& _type);
|
|
||||||
void unregisterFactory(const std::string& _category);
|
|
||||||
|
|
||||||
bool isFactoryExist(const std::string& _category, const std::string& _type);
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
void registerFactory(const std::string& _category)
|
|
||||||
{
|
|
||||||
registerFactory(_category, Type::getClassTypeName(), GenericFactory<Type>::getFactory());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
void registerFactory(const std::string& _category, const std::string& _type)
|
|
||||||
{
|
|
||||||
registerFactory(_category, _type, GenericFactory<Type>::getFactory());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
void unregisterFactory(const std::string& _category)
|
|
||||||
{
|
|
||||||
unregisterFactory(_category, Type::getClassTypeName());
|
|
||||||
}
|
|
||||||
|
|
||||||
IObject* createObject(const std::string& _category, const std::string& _type);
|
|
||||||
void destroyObject(IObject* _object);
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef std::map<std::string, Delegate> MapFactoryItem;
|
|
||||||
typedef std::map<std::string, MapFactoryItem> MapRegisterFactoryItem;
|
|
||||||
MapRegisterFactoryItem mRegisterFactoryItems;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_FACTORY_MANAGER_H__
|
|
|
@ -1,129 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_FONT_DATA_H__
|
|
||||||
#define __MYGUI_FONT_DATA_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT FontCodeType
|
|
||||||
{
|
|
||||||
enum Enum
|
|
||||||
{
|
|
||||||
Selected = 6,
|
|
||||||
SelectedBack = 7,
|
|
||||||
Cursor = 8,
|
|
||||||
Tab = 9,
|
|
||||||
LF = 0x000A,
|
|
||||||
CR = 0x000D,
|
|
||||||
Space = 0x0020,
|
|
||||||
LatinStart = 0x0021,
|
|
||||||
NEL = 0x0085,
|
|
||||||
LatinEnd = 0x00A6,
|
|
||||||
MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
FontCodeType(Enum _value = MAX) : value(_value) { }
|
|
||||||
|
|
||||||
friend bool operator == (FontCodeType const& a, FontCodeType const& b) { return a.value == b.value; }
|
|
||||||
friend bool operator != (FontCodeType const& a, FontCodeType const& b) { return a.value != b.value; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Enum value;
|
|
||||||
};
|
|
||||||
|
|
||||||
// èíôîðìàöèÿ îá îäíîì ñèìâîëå
|
|
||||||
struct GlyphInfo
|
|
||||||
{
|
|
||||||
FloatRect uvRect;
|
|
||||||
Char codePoint;
|
|
||||||
int width;
|
|
||||||
|
|
||||||
GlyphInfo() : codePoint(0), width(0) { }
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<GlyphInfo> VectorGlyphInfo;
|
|
||||||
|
|
||||||
// èíôîðìàöèÿ îá äèàïàçîíå
|
|
||||||
//FIXME move to std::pair
|
|
||||||
class PairCodePoint
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PairCodePoint() : first(0), last(0) { }
|
|
||||||
PairCodePoint(Char _first, Char _last) : first(_first), last(_last) { }
|
|
||||||
|
|
||||||
// ïðîâåðÿåò âõîäèò ëè ñèìâîë â äèàïàçîí
|
|
||||||
bool isExist(Char _code) const { return _code >= first && _code <= last; }
|
|
||||||
|
|
||||||
public:
|
|
||||||
Char first;
|
|
||||||
Char last;
|
|
||||||
};
|
|
||||||
|
|
||||||
// èíôîìàöèÿ î äèàïàçîíå ñèìâîëîâ
|
|
||||||
class RangeInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RangeInfo() : first(0), last(0) { }
|
|
||||||
RangeInfo(Char _first, Char _last) :
|
|
||||||
first(_first),
|
|
||||||
last(_last)
|
|
||||||
{
|
|
||||||
range.resize(last - first + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ïðîâåðÿåò âõîäèò ëè ñèìâîë â äèàïàçîí
|
|
||||||
bool isExist(Char _code) const { return _code >= first && _code <= last; }
|
|
||||||
|
|
||||||
// âîçâðàùàåò óêàçàòåëü íà ãëèô, èëè 0, åñëè êîä íå âõîäèò â äèàïàçîí
|
|
||||||
GlyphInfo* getInfo(Char _code) { return isExist(_code) ? &range[_code - first] : nullptr; }
|
|
||||||
void setInfo(Char _code, GlyphInfo* _value) { if (isExist(_code)) range[_code - first] = *_value; }
|
|
||||||
|
|
||||||
public:
|
|
||||||
Char first;
|
|
||||||
Char last;
|
|
||||||
VectorGlyphInfo range;
|
|
||||||
};
|
|
||||||
|
|
||||||
// FIXME move to resource font
|
|
||||||
class PairCodeCoord
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PairCodeCoord() : code(0) { }
|
|
||||||
PairCodeCoord(Char _code, const IntCoord& _coord) :
|
|
||||||
code(_code),
|
|
||||||
coord(_coord)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator < (const PairCodeCoord& _value) const { return code < _value.code; }
|
|
||||||
|
|
||||||
Char code;
|
|
||||||
IntCoord coord;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_FONT_DATA_H__
|
|
|
@ -1,60 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_FONT_MANAGER_H__
|
|
||||||
#define __MYGUI_FONT_MANAGER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Enumerator.h"
|
|
||||||
#include "MyGUI_IFont.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_XmlDocument.h"
|
|
||||||
#include "MyGUI_ResourceManager.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT FontManager
|
|
||||||
{
|
|
||||||
MYGUI_INSTANCE_HEADER( FontManager )
|
|
||||||
|
|
||||||
public:
|
|
||||||
void initialise();
|
|
||||||
void shutdown();
|
|
||||||
|
|
||||||
/** Load additional MyGUI *_font.xml file */
|
|
||||||
bool load(const std::string& _file);
|
|
||||||
void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
|
|
||||||
|
|
||||||
const std::string& getDefaultFont() const { return mDefaultName; }
|
|
||||||
void setDefaultFont(const std::string& _value);
|
|
||||||
|
|
||||||
/** Get font resource */
|
|
||||||
IFont* getByName(const std::string& _name) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::string mDefaultName;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_FONT_MANAGER_H__
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_GENERIC_FACTORY_H__
|
|
||||||
#define __MYGUI_GENERIC_FACTORY_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_Delegate.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
template <typename Type>
|
|
||||||
class GenericFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef delegates::CDelegate1<IObject*&> Delegate;
|
|
||||||
static typename Delegate::IDelegate* getFactory()
|
|
||||||
{
|
|
||||||
return newDelegate(createFromFactory);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
static void createFromFactory(IObject*& _instance)
|
|
||||||
{
|
|
||||||
_instance = new Type();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __MYGUI_GENERIC_FACTORY_H__
|
|
287
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Gui.h
vendored
287
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Gui.h
vendored
|
@ -1,287 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_GUI_H__
|
|
||||||
#define __MYGUI_GUI_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_Instance.h"
|
|
||||||
#include "MyGUI_XmlDocument.h"
|
|
||||||
#include "MyGUI_IWidgetCreator.h"
|
|
||||||
#include "MyGUI_IUnlinkWidget.h"
|
|
||||||
#include "MyGUI_Widget.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef delegates::CMultiDelegate1<float> FrameEventDelegate;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT Gui : public IWidgetCreator, public IUnlinkWidget
|
|
||||||
{
|
|
||||||
friend class WidgetManager;
|
|
||||||
MYGUI_INSTANCE_HEADER( Gui )
|
|
||||||
|
|
||||||
public:
|
|
||||||
/** Initialise GUI and all GUI Managers
|
|
||||||
@param
|
|
||||||
_core name of core config file for MyGUI (contain main config files with skins, layers, fonts, etc.)
|
|
||||||
@param
|
|
||||||
_logFileName Log file name
|
|
||||||
*/
|
|
||||||
void initialise(const std::string& _core = "core.xml", const std::string& _logFileName = MYGUI_LOG_FILENAME);
|
|
||||||
|
|
||||||
/** Shutdown GUI and all GUI Managers*/
|
|
||||||
void shutdown();
|
|
||||||
|
|
||||||
// methods for creating widgets
|
|
||||||
/** Create widget
|
|
||||||
@param _type widget type
|
|
||||||
@param _skin widget skin
|
|
||||||
@param _coord int coordinates of widget (_left, _top, _width, _height)
|
|
||||||
@param _align widget align (possible values can be found in enum Align)
|
|
||||||
@param _layer layer where widget will be created (all layers usually defined in core.layer file).
|
|
||||||
If your widget will overlap with any other you shoud select _layer with "overlapped" property enabled.
|
|
||||||
@param _name if needed (you can use it for finding widget by name later)
|
|
||||||
*/
|
|
||||||
Widget* createWidgetT(const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return baseCreateWidget(WidgetStyle::Overlapped, _type, _skin, _coord, _align, _layer, _name);
|
|
||||||
}
|
|
||||||
/** See Gui::createWidgetT */
|
|
||||||
Widget* createWidgetT(const std::string& _type, const std::string& _skin, int _left, int _top, int _width, int _height, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return createWidgetT(_type, _skin, IntCoord(_left, _top, _width, _height), _align, _layer, _name);
|
|
||||||
}
|
|
||||||
/** Create widget using coordinates relative to parent. see Gui::createWidgetT */
|
|
||||||
Widget* createWidgetRealT(const std::string& _type, const std::string& _skin, const FloatCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return createWidgetT(_type, _skin, IntCoord((int)(_coord.left*mViewSize.width), (int)(_coord.top*mViewSize.height), (int)(_coord.width*mViewSize.width), (int)(_coord.height*mViewSize.height)), _align, _layer, _name);
|
|
||||||
}
|
|
||||||
/** Create widget using coordinates relative to parent. see Gui::createWidgetT */
|
|
||||||
Widget* createWidgetRealT(const std::string& _type, const std::string& _skin, float _left, float _top, float _width, float _height, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return createWidgetT(_type, _skin, IntCoord((int)(_left*mViewSize.width), (int)(_top*mViewSize.height), (int)(_width*mViewSize.width), (int)(_height*mViewSize.height)), _align, _layer, _name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// templates for creating widgets by type
|
|
||||||
/** Same as Gui::createWidgetT but return T* instead of Widget* */
|
|
||||||
template <typename T>
|
|
||||||
T* createWidget(const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return static_cast<T*>(createWidgetT(T::getClassTypeName(), _skin, _coord, _align, _layer, _name));
|
|
||||||
}
|
|
||||||
/** Same as Gui::createWidgetT but return T* instead of Widget* */
|
|
||||||
template <typename T>
|
|
||||||
T* createWidget(const std::string& _skin, int _left, int _top, int _width, int _height, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return static_cast<T*>(createWidgetT(T::getClassTypeName(), _skin, IntCoord(_left, _top, _width, _height), _align, _layer, _name));
|
|
||||||
}
|
|
||||||
/** Same as Gui::createWidgetRealT but return T* instead of Widget* */
|
|
||||||
template <typename T>
|
|
||||||
T* createWidgetReal(const std::string& _skin, const FloatCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return static_cast<T*>(createWidgetRealT(T::getClassTypeName(), _skin, _coord, _align, _layer, _name));
|
|
||||||
}
|
|
||||||
/** Same as Gui::createWidgetRealT but return T* instead of Widget* */
|
|
||||||
template <typename T>
|
|
||||||
T* createWidgetReal(const std::string& _skin, float _left, float _top, float _width, float _height, Align _align, const std::string& _layer, const std::string& _name = "")
|
|
||||||
{
|
|
||||||
return static_cast<T*>(createWidgetRealT(T::getClassTypeName(), _skin, _left, _top, _width, _height, _align, _layer, _name));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get view size of GUI area */
|
|
||||||
const IntSize& getViewSize() const { return mViewSize; }
|
|
||||||
|
|
||||||
int getViewWidth() { return mViewSize.width; }
|
|
||||||
int getViewHeight() { return mViewSize.height; }
|
|
||||||
|
|
||||||
// mirror of InputManager methods
|
|
||||||
/** Inject MouseMove event
|
|
||||||
@return true if event has been processed by GUI
|
|
||||||
*/
|
|
||||||
bool injectMouseMove(int _absx, int _absy, int _absz);
|
|
||||||
/** Inject MousePress event
|
|
||||||
@return true if event has been processed by GUI
|
|
||||||
*/
|
|
||||||
bool injectMousePress(int _absx, int _absy, MouseButton _id);
|
|
||||||
/** Inject MouseRelease event
|
|
||||||
@return true if event has been processed by GUI
|
|
||||||
*/
|
|
||||||
bool injectMouseRelease(int _absx, int _absy, MouseButton _id);
|
|
||||||
|
|
||||||
/** Inject KeyPress event
|
|
||||||
@return true if event has been processed by GUI
|
|
||||||
*/
|
|
||||||
bool injectKeyPress(KeyCode _key, Char _text = 0);
|
|
||||||
/** Inject KeyReleas event
|
|
||||||
@return true if event has been processed by GUI
|
|
||||||
*/
|
|
||||||
bool injectKeyRelease(KeyCode _key);
|
|
||||||
|
|
||||||
/** Destroy any created widget */
|
|
||||||
void destroyWidget(Widget* _widget);
|
|
||||||
|
|
||||||
/** Destroy vector of widgets */
|
|
||||||
void destroyWidgets(VectorWidgetPtr& _widgets);
|
|
||||||
|
|
||||||
/** Destroy Enumerator of widgets */
|
|
||||||
void destroyWidgets(EnumeratorWidgetPtr& _widgets);
|
|
||||||
|
|
||||||
/** Find widget by name
|
|
||||||
If widget is not found the exception will be thrown, or if the second parameter is false the nullptr pointer will be returned
|
|
||||||
*/
|
|
||||||
Widget* findWidgetT(const std::string& _name, bool _throw = true);
|
|
||||||
|
|
||||||
/** Find widget by name and prefix
|
|
||||||
If widget is not found the exception will be thrown, or if the second parameter is false the nullptr pointer will be returned
|
|
||||||
*/
|
|
||||||
Widget* findWidgetT(const std::string& _name, const std::string& _prefix, bool _throw = true)
|
|
||||||
{
|
|
||||||
return findWidgetT(_prefix + _name, _throw);
|
|
||||||
}
|
|
||||||
|
|
||||||
// mirror WidgetManager
|
|
||||||
/** Find widget by name and cast it to T type.
|
|
||||||
If widget not found or T and found widget have different types cause exception, or if the second parameter is false the nullptr pointer will be returned
|
|
||||||
*/
|
|
||||||
template <typename T>
|
|
||||||
T* findWidget(const std::string& _name, bool _throw = true)
|
|
||||||
{
|
|
||||||
Widget* widget = findWidgetT(_name, _throw);
|
|
||||||
if (nullptr == widget) return nullptr;
|
|
||||||
return widget->castType<T>(_throw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Find widget by name and prefix and cast it to T type
|
|
||||||
If widget not found or T and found widget have different types cause exception, or if the second parameter is false the nullptr pointer will be returned
|
|
||||||
*/
|
|
||||||
template <typename T>
|
|
||||||
T* findWidget(const std::string& _name, const std::string& _prefix, bool _throw = true)
|
|
||||||
{
|
|
||||||
return findWidget<T>(_prefix + _name, _throw);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Show or hide mouse pointer */
|
|
||||||
void setVisiblePointer(bool _visible);
|
|
||||||
/** Is mouse pointer visible */
|
|
||||||
bool isVisiblePointer();
|
|
||||||
|
|
||||||
|
|
||||||
// mirror ResourceManager
|
|
||||||
/** Load config with any info (file can have different data such other config files that will be loaded, skins, layers, pointers, etc) */
|
|
||||||
bool load(const std::string& _file);
|
|
||||||
|
|
||||||
void resizeWindow(const IntSize& _size);
|
|
||||||
|
|
||||||
/** Destroy child widget or throw exception if this child widget not found */
|
|
||||||
void destroyChildWidget(Widget* _widget) { _destroyChildWidget(_widget); }
|
|
||||||
|
|
||||||
/** Destroy all child widgets */
|
|
||||||
void destroyAllChildWidget() { _destroyAllChildWidget(); }
|
|
||||||
|
|
||||||
/** Get name of Gui ResourceGroup*/
|
|
||||||
//static const std::string& getResourceGroup();
|
|
||||||
|
|
||||||
/** Get root widgets Enumerator */
|
|
||||||
EnumeratorWidgetPtr getEnumerator() { return EnumeratorWidgetPtr(mWidgetChild); }
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
|
|
||||||
/** Inject frame entered event (called be renderer, do not call it manually).
|
|
||||||
This function is called every frame by renderer.
|
|
||||||
*/
|
|
||||||
void _injectFrameEntered(float _time);
|
|
||||||
|
|
||||||
/*event:*/
|
|
||||||
/** Multidelegate for GUI per frame call.\n
|
|
||||||
signature : void method(float _time)\n
|
|
||||||
@param _time Time elapsed since last frame
|
|
||||||
*/
|
|
||||||
FrameEventDelegate eventFrameStart;
|
|
||||||
|
|
||||||
/*obsolete:*/
|
|
||||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Gui::destroyWidgets(VectorWidgetPtr &_widgets)")
|
|
||||||
void destroyWidgetsVector(VectorWidgetPtr& _widgets) { destroyWidgets(_widgets); }
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void Gui::setVisiblePointer(bool _value)")
|
|
||||||
void hidePointer() { setVisiblePointer(false); }
|
|
||||||
MYGUI_OBSOLETE("use : void Gui::setVisiblePointer(bool _value)")
|
|
||||||
void showPointer() { setVisiblePointer(true); }
|
|
||||||
MYGUI_OBSOLETE("use : bool Gui::isVisiblePointer()")
|
|
||||||
bool isShowPointer() { return isVisiblePointer(); }
|
|
||||||
MYGUI_OBSOLETE("called be renderer, do not call it manually")
|
|
||||||
void injectFrameEntered(float _time) { }
|
|
||||||
|
|
||||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
private:
|
|
||||||
// создает виджет
|
|
||||||
virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name);
|
|
||||||
|
|
||||||
// удяляет неудачника
|
|
||||||
void _destroyChildWidget(Widget* _widget);
|
|
||||||
|
|
||||||
// удаляет всех детей
|
|
||||||
void _destroyAllChildWidget();
|
|
||||||
|
|
||||||
virtual void _unlinkWidget(Widget* _widget);
|
|
||||||
|
|
||||||
// добавляет в список виджет
|
|
||||||
virtual void _linkChildWidget(Widget* _widget);
|
|
||||||
|
|
||||||
// удаляет из списка
|
|
||||||
virtual void _unlinkChildWidget(Widget* _widget);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
// вектор всех детей виджетов
|
|
||||||
VectorWidgetPtr mWidgetChild;
|
|
||||||
|
|
||||||
// размеры экрана
|
|
||||||
IntSize mViewSize;
|
|
||||||
|
|
||||||
// синглтоны гуя
|
|
||||||
InputManager * mInputManager;
|
|
||||||
SubWidgetManager * mSubWidgetManager;
|
|
||||||
LayerManager* mLayerManager;
|
|
||||||
SkinManager* mSkinManager;
|
|
||||||
WidgetManager* mWidgetManager;
|
|
||||||
FontManager* mFontManager;
|
|
||||||
ControllerManager* mControllerManager;
|
|
||||||
PointerManager* mPointerManager;
|
|
||||||
ClipboardManager* mClipboardManager;
|
|
||||||
LayoutManager* mLayoutManager;
|
|
||||||
DynLibManager* mDynLibManager;
|
|
||||||
PluginManager* mPluginManager;
|
|
||||||
LanguageManager* mLanguageManager;
|
|
||||||
ResourceManager* mResourceManager;
|
|
||||||
FactoryManager* mFactoryManager;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_GUI_H__
|
|
137
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Guid.h
vendored
137
extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Guid.h
vendored
|
@ -1,137 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 09/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_GUID_H__
|
|
||||||
#define __MYGUI_GUID_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include <memory.h>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT Guid
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Guid() { fast._data1 = fast._data2 = fast._data3 = fast._data4 = 0; }
|
|
||||||
Guid( Guid const& _value ) { *this = _value; }
|
|
||||||
explicit Guid(const std::string& _value) { *this = parse(_value); }
|
|
||||||
explicit Guid(unsigned char(&_id)[16]) { ::memcpy((void*)&vec._data1[0], (void*)&_id[0], 16); }
|
|
||||||
|
|
||||||
bool operator == (Guid const& _comp) const
|
|
||||||
{
|
|
||||||
return _comp.fast._data1 == fast._data1
|
|
||||||
&& _comp.fast._data2 == fast._data2
|
|
||||||
&& _comp.fast._data3 == fast._data3
|
|
||||||
&& _comp.fast._data4 == fast._data4;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator != ( Guid const& _comp ) const
|
|
||||||
{
|
|
||||||
return ! (*this == _comp);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator < ( Guid const& _comp ) const
|
|
||||||
{
|
|
||||||
if (_comp.fast._data1 < fast._data1) return true;
|
|
||||||
else if (_comp.fast._data1 > fast._data1) return false;
|
|
||||||
if (_comp.fast._data2 < fast._data2) return true;
|
|
||||||
else if (_comp.fast._data2 > fast._data2) return false;
|
|
||||||
if (_comp.fast._data3 < fast._data3) return true;
|
|
||||||
else if (_comp.fast._data3 > fast._data3) return false;
|
|
||||||
if (_comp.fast._data4 < fast._data4) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Guid& operator = (Guid const& _rvalue)
|
|
||||||
{
|
|
||||||
fast._data1 = _rvalue.fast._data1;
|
|
||||||
fast._data2 = _rvalue.fast._data2;
|
|
||||||
fast._data3 = _rvalue.fast._data3;
|
|
||||||
fast._data4 = _rvalue.fast._data4;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool empty() const
|
|
||||||
{
|
|
||||||
return fast._data1 == 0
|
|
||||||
&& fast._data2 == 0
|
|
||||||
&& fast._data3 == 0
|
|
||||||
&& fast._data4 == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
fast._data1 = fast._data2 = fast._data3 = fast._data4 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string print() const;
|
|
||||||
static Guid parse(const std::string& _value);
|
|
||||||
static Guid generate();
|
|
||||||
|
|
||||||
friend std::ostream& operator << ( std::ostream& _stream, const Guid& _value )
|
|
||||||
{
|
|
||||||
_stream << _value.print();
|
|
||||||
return _stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::istream& operator >> ( std::istream& _stream, Guid& _value )
|
|
||||||
{
|
|
||||||
std::string value;
|
|
||||||
_stream >> value;
|
|
||||||
if (_stream.fail()) _value.clear();
|
|
||||||
else _value = Guid::parse(value);
|
|
||||||
return _stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
// массив для быстрой конвертации
|
|
||||||
static const char convert_hex[64];
|
|
||||||
|
|
||||||
struct _original
|
|
||||||
{
|
|
||||||
uint32 data1;
|
|
||||||
uint16 data2, data3;
|
|
||||||
uint8 data4[8];
|
|
||||||
};
|
|
||||||
struct _fast
|
|
||||||
{
|
|
||||||
uint32 _data1, _data2, _data3, _data4;
|
|
||||||
};
|
|
||||||
struct _vec
|
|
||||||
{
|
|
||||||
unsigned char _data1[16];
|
|
||||||
};
|
|
||||||
|
|
||||||
union
|
|
||||||
{
|
|
||||||
_original original;
|
|
||||||
_fast fast;
|
|
||||||
_vec vec;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_GUID_H__
|
|
|
@ -1,67 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_HSCROLL_H__
|
|
||||||
#define __MYGUI_HSCROLL_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_VScroll.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT HScroll :
|
|
||||||
public VScroll
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( HScroll )
|
|
||||||
|
|
||||||
public:
|
|
||||||
HScroll();
|
|
||||||
|
|
||||||
//! @copydoc VScroll::getLineSize()
|
|
||||||
virtual int getLineSize();
|
|
||||||
|
|
||||||
//! @copydoc VScroll::setTrackSize(int _value)
|
|
||||||
virtual void setTrackSize(int _value);
|
|
||||||
//! @copydoc VScroll::getTrackSize()
|
|
||||||
virtual int getTrackSize();
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~HScroll();
|
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void TrackMove(int _left, int _top);
|
|
||||||
void updateTrack();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_HSCROLL_H__
|
|
|
@ -1,111 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_ITEM_INFO_H__
|
|
||||||
#define __MYGUI_ITEM_INFO_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
// структура информации об отображении элемента
|
|
||||||
/** Info about ItemBox item*/
|
|
||||||
struct MYGUI_EXPORT IBDrawItemInfo
|
|
||||||
{
|
|
||||||
|
|
||||||
IBDrawItemInfo() :
|
|
||||||
index(ITEM_NONE),
|
|
||||||
update(false),
|
|
||||||
select(false),
|
|
||||||
active(false),
|
|
||||||
drag(false),
|
|
||||||
drop_accept(false),
|
|
||||||
drop_refuse(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
IBDrawItemInfo(size_t _index, size_t _select, size_t _active, size_t _accept, size_t _refuse, bool _update, bool _drag) :
|
|
||||||
index(_index),
|
|
||||||
update(_update),
|
|
||||||
select(_index == _select),
|
|
||||||
active(_index == _active),
|
|
||||||
drag(_drag),
|
|
||||||
drop_accept(_index == _accept),
|
|
||||||
drop_refuse(_index == _refuse)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Index of element */
|
|
||||||
size_t index;
|
|
||||||
/** State and interdan data changed */
|
|
||||||
bool update;
|
|
||||||
/** Is widget selected */
|
|
||||||
bool select;
|
|
||||||
/** Is widget active */
|
|
||||||
bool active;
|
|
||||||
/** Is widget able to be dragged */
|
|
||||||
bool drag;
|
|
||||||
/** Is widget accepting drop */
|
|
||||||
bool drop_accept;
|
|
||||||
/** Is widget refuseing drop */
|
|
||||||
bool drop_refuse;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT IBNotifyItemData
|
|
||||||
{
|
|
||||||
enum NotifyItem
|
|
||||||
{
|
|
||||||
MousePressed,
|
|
||||||
MouseReleased,
|
|
||||||
KeyPressed,
|
|
||||||
KeyReleased
|
|
||||||
};
|
|
||||||
|
|
||||||
IBNotifyItemData(size_t _index, NotifyItem _notify, int _x, int _y, MouseButton _id) :
|
|
||||||
index(_index), notify(_notify), x(_x), y(_y), id(_id), code(KeyCode::None), key(0) { }
|
|
||||||
|
|
||||||
IBNotifyItemData(size_t _index, NotifyItem _notify, KeyCode _code, Char _key) :
|
|
||||||
index(_index), notify(_notify), x(0), y(0), id(MouseButton::None), code(_code), key(_key) { }
|
|
||||||
|
|
||||||
IBNotifyItemData(size_t _index, NotifyItem _notify, KeyCode _code) :
|
|
||||||
index(_index), notify(_notify), x(0), y(0), id(MouseButton::None), code(_code), key(KeyCode::None) { }
|
|
||||||
|
|
||||||
/** Item index */
|
|
||||||
size_t index;
|
|
||||||
/** Notify type */
|
|
||||||
NotifyItem notify;
|
|
||||||
/** If Mouse* notify type - mouse x position, else 0 */
|
|
||||||
int x;
|
|
||||||
/** If Mouse* notify type - mouse y position, else 0 */
|
|
||||||
int y;
|
|
||||||
/** If Mouse* notify type - mouse button id position, else 0 */
|
|
||||||
MouseButton id;
|
|
||||||
/** If Key* notify type - key code, else 0 */
|
|
||||||
KeyCode code;
|
|
||||||
/** If Key* notify type - mouse button id position, else 0 */
|
|
||||||
Char key;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_ITEM_INFO_H__
|
|
|
@ -1,213 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Georgiy Evmenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_CROPPED_RECTANGLE_H__
|
|
||||||
#define __MYGUI_I_CROPPED_RECTANGLE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ICroppedRectangle
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ICroppedRectangle() :
|
|
||||||
mIsMargin(false),
|
|
||||||
mCroppedParent(nullptr),
|
|
||||||
mVisible(true),
|
|
||||||
mAlign(Align::Default)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
virtual ~ICroppedRectangle() { }
|
|
||||||
|
|
||||||
/** Get parent ICroppedRectangle */
|
|
||||||
ICroppedRectangle * getCroppedParent() { return mCroppedParent; }
|
|
||||||
|
|
||||||
/** Set coordinates (position and size) */
|
|
||||||
virtual void setCoord(const IntCoord& _value) { mCoord = _value; }
|
|
||||||
/** Get coordinates (position and size) */
|
|
||||||
const IntCoord& getCoord() const { return mCoord; }
|
|
||||||
|
|
||||||
/** Set position */
|
|
||||||
virtual void setPosition(const IntPoint& _value) { mCoord.left = _value.left; mCoord.top = _value.top; }
|
|
||||||
/** Get position */
|
|
||||||
IntPoint getPosition() const { return mCoord.point(); }
|
|
||||||
|
|
||||||
/** Set size */
|
|
||||||
virtual void setSize(const IntSize& _value) { mCoord.width = _value.width; mCoord.height = _value.height; }
|
|
||||||
/** Get size */
|
|
||||||
IntSize getSize() const { return mCoord.size(); }
|
|
||||||
|
|
||||||
/** Hide or show */
|
|
||||||
virtual void setVisible(bool _value) { mVisible = _value; }
|
|
||||||
/** Return true if visible */
|
|
||||||
bool isVisible() const { return mVisible; }
|
|
||||||
|
|
||||||
/** Get position in screen coordinates */
|
|
||||||
const IntPoint& getAbsolutePosition() const { return mAbsolutePosition; }
|
|
||||||
/** Get rectangle in screen coordinates */
|
|
||||||
IntRect getAbsoluteRect() const { return IntRect(mAbsolutePosition.left, mAbsolutePosition.top, mAbsolutePosition.left+mCoord.width, mAbsolutePosition.top+mCoord.height); }
|
|
||||||
/** Get coordinate in screen coordinates */
|
|
||||||
IntCoord getAbsoluteCoord() const { return IntCoord(mAbsolutePosition.left, mAbsolutePosition.top, mCoord.width, mCoord.height); }
|
|
||||||
|
|
||||||
/** Get X in screen coordinates */
|
|
||||||
int getAbsoluteLeft() const { return mAbsolutePosition.left; }
|
|
||||||
/** Get Y in screen coordinates */
|
|
||||||
int getAbsoluteTop() const { return mAbsolutePosition.top; }
|
|
||||||
|
|
||||||
/** Set align */
|
|
||||||
virtual void setAlign(Align _value) { mAlign = _value; }
|
|
||||||
/** Get align */
|
|
||||||
Align getAlign() const { return mAlign; }
|
|
||||||
|
|
||||||
/** Get left x-coordinate */
|
|
||||||
int getLeft() const { return mCoord.left; }
|
|
||||||
/** Get right x-coordinate */
|
|
||||||
int getRight() const { return mCoord.right(); }
|
|
||||||
/** Get top y-coordinate */
|
|
||||||
int getTop() const { return mCoord.top; }
|
|
||||||
/** Get bottom y-coordinate */
|
|
||||||
int getBottom() const { return mCoord.bottom(); }
|
|
||||||
/** Get width */
|
|
||||||
int getWidth() const { return mCoord.width; }
|
|
||||||
/** Get height */
|
|
||||||
int getHeight() const { return mCoord.height; }
|
|
||||||
|
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
/** True if rectangle is cropped by parent rectangle */
|
|
||||||
bool _isMargin() const { return mIsMargin; }
|
|
||||||
|
|
||||||
// Get cropped by parent rectangle coordinates
|
|
||||||
int _getViewLeft() const { return mCoord.left + mMargin.left; }
|
|
||||||
int _getViewRight() const { return mCoord.right() - mMargin.right; }
|
|
||||||
int _getViewTop() const { return mCoord.top + mMargin.top; }
|
|
||||||
int _getViewBottom() const { return mCoord.bottom() - mMargin.bottom; }
|
|
||||||
int _getViewWidth() const { return mCoord.width - mMargin.left - mMargin.right; }
|
|
||||||
int _getViewHeight() const { return mCoord.height - mMargin.top - mMargin.bottom; }
|
|
||||||
|
|
||||||
virtual void _updateView() { }
|
|
||||||
virtual void _correctView() { }
|
|
||||||
virtual void _setAlign(const IntSize& _oldsize, bool _update) { }
|
|
||||||
virtual void _setAlign(const IntCoord& _oldcoord, bool _update) { }
|
|
||||||
|
|
||||||
void _setCroppedParent(ICroppedRectangle* _parent) { mCroppedParent = _parent; }
|
|
||||||
|
|
||||||
const IntRect& _getMargin() const { return mMargin; }
|
|
||||||
int _getMarginLeft() const { return mMargin.left; }
|
|
||||||
int _getMarginRight() const { return mMargin.right; }
|
|
||||||
int _getMarginTop() const { return mMargin.top; }
|
|
||||||
int _getMarginBottom() const { return mMargin.bottom; }
|
|
||||||
|
|
||||||
/*obsolete:*/
|
|
||||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
MYGUI_OBSOLETE("use : void ICroppedRectangle::setVisible(bool _visible)")
|
|
||||||
void show() { setVisible(true); }
|
|
||||||
MYGUI_OBSOLETE("use : void ICroppedRectangle::setVisible(bool _visible)")
|
|
||||||
void hide() { setVisible(false); }
|
|
||||||
MYGUI_OBSOLETE("use : bool ICroppedRectangle::isVisible()")
|
|
||||||
bool isShow() { return isVisible(); }
|
|
||||||
|
|
||||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool _checkPoint(int _left, int _top)
|
|
||||||
{
|
|
||||||
return ! ((_getViewLeft() > _left) || (_getViewTop() > _top) || (_getViewRight() < _left) || (_getViewBottom() < _top));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool _checkMargin()
|
|
||||||
{
|
|
||||||
bool margin = false;
|
|
||||||
//вылезли ли налево
|
|
||||||
if (getLeft() < mCroppedParent->mMargin.left)
|
|
||||||
{
|
|
||||||
mMargin.left = mCroppedParent->mMargin.left - getLeft();
|
|
||||||
margin = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mMargin.left = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//вылезли ли направо
|
|
||||||
if (getRight() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right)
|
|
||||||
{
|
|
||||||
mMargin.right = getRight() - (mCroppedParent->getWidth() - mCroppedParent->mMargin.right);
|
|
||||||
margin = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mMargin.right = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//вылезли ли вверх
|
|
||||||
if (getTop() < mCroppedParent->mMargin.top)
|
|
||||||
{
|
|
||||||
mMargin.top = mCroppedParent->mMargin.top - getTop();
|
|
||||||
margin = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mMargin.top = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//вылезли ли вниз
|
|
||||||
if (getBottom() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom)
|
|
||||||
{
|
|
||||||
mMargin.bottom = getBottom() - (mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom);
|
|
||||||
margin = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mMargin.bottom = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return margin;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool _checkOutside() // проверка на полный выход за границу
|
|
||||||
{
|
|
||||||
return ( (getRight() < mCroppedParent->mMargin.left ) || // совсем уехали налево
|
|
||||||
(getLeft() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right ) || // совсем уехали направо
|
|
||||||
(getBottom() < mCroppedParent->mMargin.top ) || // совсем уехали вверх
|
|
||||||
(getTop() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom ) ); // совсем уехали вниз
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool mIsMargin;
|
|
||||||
IntRect mMargin; // перекрытие
|
|
||||||
IntCoord mCoord; // координаты
|
|
||||||
IntPoint mAbsolutePosition; // обсолютные координаты
|
|
||||||
|
|
||||||
ICroppedRectangle * mCroppedParent;
|
|
||||||
bool mVisible;
|
|
||||||
Align mAlign;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_CROPPED_RECTANGLE_H__
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 08/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_DATA_STREAM_H__
|
|
||||||
#define __MYGUI_I_DATA_STREAM_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IDataStream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IDataStream() { }
|
|
||||||
|
|
||||||
virtual bool eof() = 0;
|
|
||||||
virtual size_t size() = 0;
|
|
||||||
virtual void readline(std::string& _source, Char _delim = '\n') = 0;
|
|
||||||
virtual size_t read(void* _buf, size_t _count) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_DATA_STREAM_H__
|
|
|
@ -1,54 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_FONT_H__
|
|
||||||
#define __MYGUI_I_FONT_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_ISerializable.h"
|
|
||||||
#include "MyGUI_IResource.h"
|
|
||||||
#include "MyGUI_FontData.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class ITexture;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IFont : public IResource
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( IFont )
|
|
||||||
|
|
||||||
public:
|
|
||||||
IFont() { }
|
|
||||||
virtual ~IFont() { }
|
|
||||||
|
|
||||||
virtual GlyphInfo* getGlyphInfo(Char _id) = 0;
|
|
||||||
|
|
||||||
virtual ITexture* getTextureFont() = 0;
|
|
||||||
|
|
||||||
virtual int getDefaultHeight() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_FONT_H__
|
|
|
@ -1,79 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 02/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_LAYER_H__
|
|
||||||
#define __MYGUI_I_LAYER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_IRenderTarget.h"
|
|
||||||
#include "MyGUI_ILayerNode.h"
|
|
||||||
#include "MyGUI_ISerializable.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class ILayerItem;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ILayer : public ISerializable
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ILayer )
|
|
||||||
|
|
||||||
public:
|
|
||||||
ILayer() { }
|
|
||||||
virtual ~ILayer() { }
|
|
||||||
|
|
||||||
// èìÿ ëååðà
|
|
||||||
const std::string& getName() const { return mName; }
|
|
||||||
|
|
||||||
// ñîçäàåì äî÷åðíèé íîä
|
|
||||||
virtual ILayerNode* createChildItemNode() = 0;
|
|
||||||
// óäàëÿåì äî÷åðíèé íîä
|
|
||||||
virtual void destroyChildItemNode(ILayerNode* _node) = 0;
|
|
||||||
|
|
||||||
// ïîäíèìàåì äî÷åðíèé íîä
|
|
||||||
virtual void upChildItemNode(ILayerNode* _node) = 0;
|
|
||||||
|
|
||||||
// ñïèñîê äåòåé
|
|
||||||
virtual EnumeratorILayerNode getEnumerator() = 0;
|
|
||||||
|
|
||||||
// âîçâðàùàåò âèäæåò ïî ïîçèöèè
|
|
||||||
virtual ILayerItem* getLayerItemByPoint(int _left, int _top) = 0;
|
|
||||||
|
|
||||||
// âîçâðàùàåò ïîçèöèþ â êîîðäèíàòàõ ëååðà
|
|
||||||
virtual IntPoint getPosition(int _left, int _top) const = 0;
|
|
||||||
|
|
||||||
// âîçâðàùàåò ðàçìåð ëååðà
|
|
||||||
virtual const IntSize& getSize() const = 0;
|
|
||||||
|
|
||||||
// ðèñóåò ëååð
|
|
||||||
virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0;
|
|
||||||
|
|
||||||
virtual void dumpStatisticToLog() { }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::string mName;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_LAYER_H__
|
|
|
@ -1,50 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 02/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_LAYER_ITEM_H__
|
|
||||||
#define __MYGUI_I_LAYER_ITEM_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class ILayer;
|
|
||||||
class ILayerNode;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ILayerItem
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~ILayerItem() { }
|
|
||||||
|
|
||||||
virtual ILayerItem * getLayerItemByPoint(int _left, int _top) = 0;
|
|
||||||
virtual const IntCoord& getLayerItemCoord() = 0;
|
|
||||||
|
|
||||||
virtual void attachItemToNode(ILayer* _layer, ILayerNode* _node) = 0;
|
|
||||||
virtual void detachFromLayer() = 0;
|
|
||||||
virtual void upLayerItem() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_LAYER_ITEM_H__
|
|
|
@ -1,91 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 02/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_LAYER_NODE_H__
|
|
||||||
#define __MYGUI_I_LAYER_NODE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Enumerator.h"
|
|
||||||
#include "MyGUI_IObject.h"
|
|
||||||
#include "MyGUI_IRenderTarget.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class ILayer;
|
|
||||||
class ILayerItem;
|
|
||||||
class ILayerNode;
|
|
||||||
|
|
||||||
class RenderItem;
|
|
||||||
class ISubWidget;
|
|
||||||
|
|
||||||
typedef std::vector<ILayerNode*> VectorILayerNode;
|
|
||||||
typedef Enumerator<VectorILayerNode> EnumeratorILayerNode;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ILayerNode : public IObject
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ILayerNode )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~ILayerNode() { }
|
|
||||||
|
|
||||||
// ëååð, êîòîðîìó ìû ïðèíàäëåæèì
|
|
||||||
virtual ILayer* getLayer() = 0;
|
|
||||||
|
|
||||||
// âîçâðàùàåò îòöà èëè nullptr
|
|
||||||
virtual ILayerNode* getParent() = 0;
|
|
||||||
|
|
||||||
// ñîçäàåì äî÷åðíèé íîä
|
|
||||||
virtual ILayerNode* createChildItemNode() = 0;
|
|
||||||
// óäàëÿåì äî÷åðíèé íîä
|
|
||||||
virtual void destroyChildItemNode(ILayerNode* _node) = 0;
|
|
||||||
|
|
||||||
// ïîäíèìàåì äî÷åðíèé íîä
|
|
||||||
virtual void upChildItemNode(ILayerNode* _node) = 0;
|
|
||||||
|
|
||||||
// ñïèñîê äåòåé
|
|
||||||
virtual EnumeratorILayerNode getEnumerator() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// äîáàâëÿåì àéòåì ê íîäó
|
|
||||||
virtual void attachLayerItem(ILayerItem* _item) = 0;
|
|
||||||
// óäàëÿåì àéòåì èç íîäà
|
|
||||||
virtual void detachLayerItem(ILayerItem* _root) = 0;
|
|
||||||
|
|
||||||
// äîáàâëÿåò ñàá àéòåì è âîçâðàùàåò ðåíäåð àéòåì
|
|
||||||
virtual RenderItem* addToRenderItem(ITexture* _texture, ISubWidget* _item) = 0;
|
|
||||||
// íåîáõîäèìî îáíîâëåíèå íîäà
|
|
||||||
virtual void outOfDate(RenderItem* _item) = 0;
|
|
||||||
|
|
||||||
// âîçâðàùàåò âèäæåò ïî ïîçèöèè
|
|
||||||
virtual ILayerItem* getLayerItemByPoint(int _left, int _top) = 0;
|
|
||||||
|
|
||||||
// ðèñóåò ëååð
|
|
||||||
virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0;
|
|
||||||
|
|
||||||
virtual void dumpStatisticToLog(size_t _level) { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_LAYER_NODE_H__
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_OBJECT_H__
|
|
||||||
#define __MYGUI_I_OBJECT_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_RTTI.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IObject
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_BASE( IObject )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~IObject() { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_OBJECT_H__
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_POINTER_H__
|
|
||||||
#define __MYGUI_I_POINTER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_IResource.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IPointer : public IResource
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( IPointer )
|
|
||||||
|
|
||||||
public:
|
|
||||||
IPointer() { }
|
|
||||||
virtual ~IPointer() { }
|
|
||||||
|
|
||||||
virtual void setImage(StaticImage* _image) = 0;
|
|
||||||
virtual void setPosition(StaticImage* _image, const IntPoint& _point) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_POINTER_H__
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 02/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_RENDER_TARGET_H__
|
|
||||||
#define __MYGUI_I_RENDER_TARGET_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_RenderTargetInfo.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class ITexture;
|
|
||||||
class IVertexBuffer;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IRenderTarget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
IRenderTarget() { }
|
|
||||||
virtual ~IRenderTarget() { }
|
|
||||||
|
|
||||||
virtual void begin() = 0;
|
|
||||||
virtual void end() = 0;
|
|
||||||
|
|
||||||
virtual void doRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) = 0;
|
|
||||||
|
|
||||||
virtual const RenderTargetInfo& getInfo() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_RENDER_TARGET_H__
|
|
|
@ -1,77 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 09/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_RESOURCE_H__
|
|
||||||
#define __MYGUI_I_RESOURCE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_XmlDocument.h"
|
|
||||||
#include "MyGUI_Guid.h"
|
|
||||||
#include "MyGUI_Version.h"
|
|
||||||
#include "MyGUI_ISerializable.h"
|
|
||||||
#include "MyGUI_ResourceHolder.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class IResource;
|
|
||||||
typedef IResource * IResourcePtr;
|
|
||||||
|
|
||||||
class ResourceManager;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IResource : public ISerializable
|
|
||||||
{
|
|
||||||
// для серелизации
|
|
||||||
friend class ResourceManager;
|
|
||||||
// для удаления
|
|
||||||
friend class ResourceHolder<IResource>;
|
|
||||||
|
|
||||||
MYGUI_RTTI_DERIVED( IResource )
|
|
||||||
|
|
||||||
public:
|
|
||||||
const std::string& getResourceName() { return mResourceName; }
|
|
||||||
const Guid& getResourceID() { return mResourceID; }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
IResource() { }
|
|
||||||
private:
|
|
||||||
// constructors and operator =, without implementation, just for private
|
|
||||||
IResource(IResource const &);
|
|
||||||
IResource& operator = (IResource const &);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
|
||||||
{
|
|
||||||
mResourceID = Guid::parse(_node->findAttribute("id"));
|
|
||||||
mResourceName = _node->findAttribute("name");
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~IResource() { }
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::string mResourceName;
|
|
||||||
Guid mResourceID;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_RESOURCE_H__
|
|
|
@ -1,49 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_SERIALIZABLE_H__
|
|
||||||
#define __MYGUI_I_SERIALIZABLE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_IObject.h"
|
|
||||||
#include "MyGUI_XmlDocument.h"
|
|
||||||
#include "MyGUI_Version.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ISerializable : public IObject
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ISerializable )
|
|
||||||
|
|
||||||
public:
|
|
||||||
ISerializable() { }
|
|
||||||
virtual ~ISerializable() { }
|
|
||||||
|
|
||||||
virtual void serialization(xml::ElementPtr _node, Version _version) { }
|
|
||||||
virtual void deserialization(xml::ElementPtr _node, Version _version) { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_SERIALIZABLE_H__
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 06/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_STATE_INFO_H__
|
|
||||||
#define __MYGUI_I_STATE_INFO_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_ISerializable.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IStateInfo : public ISerializable
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( IStateInfo )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~IStateInfo() { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<IStateInfo*> VectorStateInfo;
|
|
||||||
typedef std::map<std::string, IStateInfo*> MapStateInfo;
|
|
||||||
typedef std::map<std::string, VectorStateInfo> MapWidgetStateInfo;
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_STATE_INFO_H__
|
|
|
@ -1,62 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 09/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_SUB_WIDGET_H__
|
|
||||||
#define __MYGUI_I_SUB_WIDGET_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_ICroppedRectangle.h"
|
|
||||||
#include "MyGUI_ILayerNode.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_IRenderTarget.h"
|
|
||||||
#include "MyGUI_IStateInfo.h"
|
|
||||||
#include "MyGUI_IObject.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class ISubWidget;
|
|
||||||
typedef std::vector<ISubWidget*> VectorSubWidget;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ISubWidget :
|
|
||||||
public ICroppedRectangle,
|
|
||||||
public IObject
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ISubWidget )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~ISubWidget() { }
|
|
||||||
|
|
||||||
virtual void createDrawItem(ITexture* _texture, ILayerNode* _node) = 0;
|
|
||||||
virtual void destroyDrawItem() = 0;
|
|
||||||
|
|
||||||
virtual void setAlpha(float _alpha) { }
|
|
||||||
|
|
||||||
virtual void setStateData(IStateInfo* _data) { }
|
|
||||||
|
|
||||||
virtual void doRender() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_SUB_WIDGET_H__
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 09/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_SUB_WIDGET_RECT_H__
|
|
||||||
#define __MYGUI_I_SUB_WIDGET_RECT_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_ISubWidget.h"
|
|
||||||
#include "MyGUI_Colour.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ISubWidgetRect : public ISubWidget
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ISubWidgetRect )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~ISubWidgetRect() { }
|
|
||||||
|
|
||||||
virtual void _setUVSet(const FloatRect& _rect) { }
|
|
||||||
virtual void _setColour(const Colour& _value) { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_SUB_WIDGET_RECT_H__
|
|
|
@ -1,114 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 12/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_SUB_WIDGET_TEXT_H__
|
|
||||||
#define __MYGUI_I_SUB_WIDGET_TEXT_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_ISubWidget.h"
|
|
||||||
#include "MyGUI_Colour.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ISubWidgetText : public ISubWidget
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED( ISubWidgetText )
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~ISubWidgetText() { }
|
|
||||||
|
|
||||||
/** Get index of start of selection */
|
|
||||||
virtual size_t getTextSelectionStart() { return 0; }
|
|
||||||
/** Get index of end of selection */
|
|
||||||
virtual size_t getTextSelectionEnd() { return 0; }
|
|
||||||
/** Set text selection */
|
|
||||||
virtual void setTextSelection(size_t _start, size_t _end) { }
|
|
||||||
|
|
||||||
// интенсивность выделенного текста
|
|
||||||
virtual bool getSelectBackground() { return true; }
|
|
||||||
virtual void setSelectBackground(bool _normal) { }
|
|
||||||
|
|
||||||
// нужно ли инвертировать выделение
|
|
||||||
virtual bool getInvertSelected() { return true; }
|
|
||||||
virtual void setInvertSelected(bool _value) { }
|
|
||||||
|
|
||||||
// управление видимостью курсора
|
|
||||||
virtual bool isVisibleCursor() { return false; }
|
|
||||||
virtual void setVisibleCursor(bool _value) { }
|
|
||||||
|
|
||||||
// управление положением курсора
|
|
||||||
virtual size_t getCursorPosition() { return 0; }
|
|
||||||
virtual void setCursorPosition(size_t _index) { }
|
|
||||||
|
|
||||||
virtual void setWordWrap(bool _value) { }
|
|
||||||
|
|
||||||
// возвращает положение курсора по произвольному положению
|
|
||||||
// позиция абсолютная, без учета смещений
|
|
||||||
virtual size_t getCursorPosition(const IntPoint& _point) { return 0; }
|
|
||||||
|
|
||||||
// возвращает положение курсора в обсолютных координатах
|
|
||||||
virtual IntCoord getCursorCoord(size_t _position) { return IntCoord(); }
|
|
||||||
|
|
||||||
// возвращает положение курсора в обсолютных координатах
|
|
||||||
IntPoint getCursorPoint(size_t _position)
|
|
||||||
{
|
|
||||||
const IntCoord& coord = getCursorCoord(_position);
|
|
||||||
return IntPoint(coord.left + coord.width / 2, coord.top + coord.height / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// возвращает положение курсора в обсолютных координатах
|
|
||||||
IntRect getCursorRect(size_t _position)
|
|
||||||
{
|
|
||||||
const IntCoord& coord = getCursorCoord(_position);
|
|
||||||
return IntRect(coord.left, coord.top, coord.left + coord.width, coord.top + coord.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
// возвращает размер текста в пикселях
|
|
||||||
virtual IntSize getTextSize() { return IntSize(); }
|
|
||||||
|
|
||||||
// устанавливает смещение текста в пикселях
|
|
||||||
virtual void setViewOffset(const IntPoint& _point) { }
|
|
||||||
virtual IntPoint getViewOffset() { return IntPoint(); }
|
|
||||||
|
|
||||||
virtual void setCaption(const UString& _value) { }
|
|
||||||
virtual const UString& getCaption() { static UString caption; return caption; }
|
|
||||||
|
|
||||||
virtual void setTextColour(const Colour& _value) { }
|
|
||||||
virtual const Colour& getTextColour() { return Colour::Zero; }
|
|
||||||
|
|
||||||
virtual void setFontName(const std::string& _value) { }
|
|
||||||
virtual const std::string& getFontName() { static std::string name; return name; }
|
|
||||||
|
|
||||||
virtual void setFontHeight(int _value) { }
|
|
||||||
virtual int getFontHeight() { return 0; }
|
|
||||||
|
|
||||||
virtual void setTextAlign(Align _value) { }
|
|
||||||
virtual Align getTextAlign() { return Align::Default; }
|
|
||||||
|
|
||||||
virtual void setShiftText(bool _value) { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_SUB_WIDGET_TEXT_H__
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 04/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_TEXTURE_H__
|
|
||||||
#define __MYGUI_I_TEXTURE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_IRenderTarget.h"
|
|
||||||
#include "MyGUI_RenderFormat.h"
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
class ITexture;
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ITextureInvalidateListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void textureInvalidate(ITexture* _texture) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MYGUI_EXPORT ITexture
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~ITexture() { }
|
|
||||||
|
|
||||||
virtual const std::string& getName() const = 0;
|
|
||||||
|
|
||||||
virtual void createManual(int _width, int _height, TextureUsage _usage, PixelFormat _format) = 0;
|
|
||||||
virtual void loadFromFile(const std::string& _filename) = 0;
|
|
||||||
virtual void saveToFile(const std::string& _filename) = 0;
|
|
||||||
|
|
||||||
virtual void setInvalidateListener(ITextureInvalidateListener* _listener) { }
|
|
||||||
|
|
||||||
virtual void destroy() = 0;
|
|
||||||
|
|
||||||
virtual void* lock(TextureUsage _access) = 0;
|
|
||||||
virtual void unlock() = 0;
|
|
||||||
virtual bool isLocked() = 0;
|
|
||||||
|
|
||||||
virtual int getWidth() = 0;
|
|
||||||
virtual int getHeight() = 0;
|
|
||||||
|
|
||||||
virtual PixelFormat getFormat() = 0;
|
|
||||||
virtual TextureUsage getUsage() = 0;
|
|
||||||
virtual size_t getNumElemBytes() = 0;
|
|
||||||
|
|
||||||
virtual IRenderTarget* getRenderTarget() { return nullptr; }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_TEXTURE_H__
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 01/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_UNLINK_WIDGET_H__
|
|
||||||
#define __MYGUI_UNLINK_WIDGET_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IUnlinkWidget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IUnlinkWidget() { }
|
|
||||||
virtual void _unlinkWidget(Widget* _widget) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<IUnlinkWidget*> VectorIUnlinkWidget;
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_UNLINK_WIDGET_H__
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 04/2009
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_VERTEX_BUFFER_H__
|
|
||||||
#define __MYGUI_I_VERTEX_BUFFER_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_VertexData.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IVertexBuffer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IVertexBuffer() { }
|
|
||||||
|
|
||||||
virtual void setVertextCount(size_t _value) = 0;
|
|
||||||
virtual size_t getVertextCount() = 0;
|
|
||||||
|
|
||||||
virtual Vertex* lock() = 0;
|
|
||||||
virtual void unlock() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_VERTEX_BUFFER_H__
|
|
|
@ -1,64 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 03/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_WIDGET_CREATOR_H__
|
|
||||||
#define __MYGUI_WIDGET_CREATOR_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_WidgetStyle.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class MYGUI_EXPORT IWidgetCreator
|
|
||||||
{
|
|
||||||
friend class WidgetManager;
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~IWidgetCreator() { }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name) = 0;
|
|
||||||
|
|
||||||
// удяляет неудачника
|
|
||||||
virtual void _destroyChildWidget(Widget* _widget) = 0;
|
|
||||||
|
|
||||||
// удаляет всех детей
|
|
||||||
virtual void _destroyAllChildWidget() = 0;
|
|
||||||
|
|
||||||
// удаляет виджет с закрытым конструктором
|
|
||||||
void _deleteWidget(Widget* _widget);
|
|
||||||
|
|
||||||
public:
|
|
||||||
// добавляет в список виджет
|
|
||||||
// имплементировать только для рутовых креаторов
|
|
||||||
virtual void _linkChildWidget(Widget* _widget) { }
|
|
||||||
// удаляет из списка
|
|
||||||
// имплементировать только для рутовых креаторов
|
|
||||||
virtual void _unlinkChildWidget(Widget* _widget) { }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_WIDGET_CREATOR_H__
|
|
|
@ -1,95 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 11/2007
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_I_WIDGET_FACTORY_H__
|
|
||||||
#define __MYGUI_I_WIDGET_FACTORY_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
#include "MyGUI_Types.h"
|
|
||||||
#include "MyGUI_WidgetStyle.h"
|
|
||||||
#include "MyGUI_WidgetDefines.h"
|
|
||||||
#include "MyGUI_ICroppedRectangle.h"
|
|
||||||
|
|
||||||
#include "MyGUI_WidgetManager.h"
|
|
||||||
#include "MyGUI_SkinManager.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
//OBSOLETE
|
|
||||||
class MYGUI_EXPORT IWidgetFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IWidgetFactory() { }
|
|
||||||
|
|
||||||
virtual const std::string& getTypeName() = 0;
|
|
||||||
virtual Widget* createWidget(WidgetStyle _style, const std::string& _skin, const IntCoord& _coord, Align _align, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace factory
|
|
||||||
{
|
|
||||||
|
|
||||||
//OBSOLETE
|
|
||||||
template <typename T>
|
|
||||||
class MYGUI_EXPORT BaseWidgetFactory : public IWidgetFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BaseWidgetFactory()
|
|
||||||
{
|
|
||||||
// регестрируем себя
|
|
||||||
MyGUI::WidgetManager& manager = MyGUI::WidgetManager::getInstance();
|
|
||||||
manager.registerFactory(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
~BaseWidgetFactory()
|
|
||||||
{
|
|
||||||
// удаляем себя
|
|
||||||
MyGUI::WidgetManager& manager = MyGUI::WidgetManager::getInstance();
|
|
||||||
manager.unregisterFactory(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& getTypeName()
|
|
||||||
{
|
|
||||||
return T::getClassTypeName();
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget* createWidget(WidgetStyle _style, const std::string& _skin, const IntCoord& _coord, Align _align, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
T* instance = new T(_style, _coord, _align, SkinManager::getInstance().getByName(_skin), _parent, _croppedParent, _creator, _name);
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFalseType(Widget* _ptr, const std::string &_key)
|
|
||||||
{
|
|
||||||
if (!_ptr->isType<T>())
|
|
||||||
{
|
|
||||||
MYGUI_LOG(Error, "Property '" << _key << "' is not supported by '" << _ptr->getTypeName() << "' widget");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace factory
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_I_WIDGET_FACTORY_H__
|
|
|
@ -1,64 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 09/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_IMAGE_INFO_H__
|
|
||||||
#define __MYGUI_IMAGE_INFO_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct ImageItem
|
|
||||||
{
|
|
||||||
ImageItem() : frame_rate(0) { }
|
|
||||||
|
|
||||||
float frame_rate;
|
|
||||||
std::vector<FloatRect> images;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<ImageItem> VectorImages;
|
|
||||||
|
|
||||||
struct ImageIndexInfo
|
|
||||||
{
|
|
||||||
ImageIndexInfo(
|
|
||||||
const std::string& _texture,
|
|
||||||
const IntSize& _size,
|
|
||||||
const float _rate,
|
|
||||||
const std::vector<IntPoint>& _frames
|
|
||||||
) :
|
|
||||||
texture(_texture),
|
|
||||||
size(_size),
|
|
||||||
rate(_rate),
|
|
||||||
frames(_frames)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& texture;
|
|
||||||
const IntSize& size;
|
|
||||||
const float rate;
|
|
||||||
const std::vector<IntPoint>& frames;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_IMAGE_INFO_H__
|
|
|
@ -1,227 +0,0 @@
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
@author Albert Semenov
|
|
||||||
@date 03/2008
|
|
||||||
@module
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This file is part of MyGUI.
|
|
||||||
|
|
||||||
MyGUI is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
MyGUI is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#ifndef __MYGUI_INPUT_DEFINE_H__
|
|
||||||
#define __MYGUI_INPUT_DEFINE_H__
|
|
||||||
|
|
||||||
#include "MyGUI_Prerequest.h"
|
|
||||||
|
|
||||||
namespace MyGUI
|
|
||||||
{
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT MouseButton
|
|
||||||
{
|
|
||||||
enum Enum
|
|
||||||
{
|
|
||||||
Left = 0,
|
|
||||||
Right,
|
|
||||||
Middle,
|
|
||||||
|
|
||||||
Button0 = 0,
|
|
||||||
Button1,
|
|
||||||
Button2,
|
|
||||||
Button3,
|
|
||||||
Button4,
|
|
||||||
Button5,
|
|
||||||
Button6,
|
|
||||||
Button7,
|
|
||||||
|
|
||||||
None = -1
|
|
||||||
};
|
|
||||||
|
|
||||||
MouseButton(Enum _value = None) : value(_value) { }
|
|
||||||
|
|
||||||
friend bool operator == (MouseButton const& a, MouseButton const& b) { return a.value == b.value; }
|
|
||||||
friend bool operator != (MouseButton const& a, MouseButton const& b) { return a.value != b.value; }
|
|
||||||
|
|
||||||
int toValue() const { return (int)value; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Enum value;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MYGUI_EXPORT KeyCode
|
|
||||||
{
|
|
||||||
enum Enum
|
|
||||||
{
|
|
||||||
None = 0x00,
|
|
||||||
Escape = 0x01,
|
|
||||||
One = 0x02,
|
|
||||||
Two = 0x03,
|
|
||||||
Three = 0x04,
|
|
||||||
Four = 0x05,
|
|
||||||
Five = 0x06,
|
|
||||||
Six = 0x07,
|
|
||||||
Seven = 0x08,
|
|
||||||
Eight = 0x09,
|
|
||||||
Nine = 0x0A,
|
|
||||||
Zero = 0x0B,
|
|
||||||
Minus = 0x0C, /* - on main keyboard */
|
|
||||||
Equals = 0x0D,
|
|
||||||
Backspace = 0x0E, /* Backspace */
|
|
||||||
Tab = 0x0F,
|
|
||||||
Q = 0x10,
|
|
||||||
W = 0x11,
|
|
||||||
E = 0x12,
|
|
||||||
R = 0x13,
|
|
||||||
T = 0x14,
|
|
||||||
Y = 0x15,
|
|
||||||
U = 0x16,
|
|
||||||
I = 0x17,
|
|
||||||
O = 0x18,
|
|
||||||
P = 0x19,
|
|
||||||
LeftBracket = 0x1A,
|
|
||||||
RightBracket = 0x1B,
|
|
||||||
Return = 0x1C, /* Enter on main keyboard */
|
|
||||||
LeftControl = 0x1D,
|
|
||||||
A = 0x1E,
|
|
||||||
S = 0x1F,
|
|
||||||
D = 0x20,
|
|
||||||
F = 0x21,
|
|
||||||
G = 0x22,
|
|
||||||
H = 0x23,
|
|
||||||
J = 0x24,
|
|
||||||
K = 0x25,
|
|
||||||
L = 0x26,
|
|
||||||
Semicolon = 0x27,
|
|
||||||
Apostrophe = 0x28,
|
|
||||||
Grave = 0x29, /* Accent grave ( ~ ) */
|
|
||||||
LeftShift = 0x2A,
|
|
||||||
Backslash = 0x2B,
|
|
||||||
Z = 0x2C,
|
|
||||||
X = 0x2D,
|
|
||||||
C = 0x2E,
|
|
||||||
V = 0x2F,
|
|
||||||
B = 0x30,
|
|
||||||
N = 0x31,
|
|
||||||
M = 0x32,
|
|
||||||
Comma = 0x33,
|
|
||||||
Period = 0x34, /* . on main keyboard */
|
|
||||||
Slash = 0x35, /* '/' on main keyboard */
|
|
||||||
RightShift = 0x36,
|
|
||||||
Multiply = 0x37, /* * on numeric keypad */
|
|
||||||
LeftAlt = 0x38, /* Left Alt */
|
|
||||||
Space = 0x39,
|
|
||||||
Capital = 0x3A,
|
|
||||||
F1 = 0x3B,
|
|
||||||
F2 = 0x3C,
|
|
||||||
F3 = 0x3D,
|
|
||||||
F4 = 0x3E,
|
|
||||||
F5 = 0x3F,
|
|
||||||
F6 = 0x40,
|
|
||||||
F7 = 0x41,
|
|
||||||
F8 = 0x42,
|
|
||||||
F9 = 0x43,
|
|
||||||
F10 = 0x44,
|
|
||||||
NumLock = 0x45,
|
|
||||||
ScrollLock = 0x46, /* Scroll Lock */
|
|
||||||
Numpad7 = 0x47,
|
|
||||||
Numpad8 = 0x48,
|
|
||||||
Numpad9 = 0x49,
|
|
||||||
Subtract = 0x4A, /* - on numeric keypad */
|
|
||||||
Numpad4 = 0x4B,
|
|
||||||
Numpad5 = 0x4C,
|
|
||||||
Numpad6 = 0x4D,
|
|
||||||
Add = 0x4E, /* + on numeric keypad */
|
|
||||||
Numpad1 = 0x4F,
|
|
||||||
Numpad2 = 0x50,
|
|
||||||
Numpad3 = 0x51,
|
|
||||||
Numpad0 = 0x52,
|
|
||||||
Decimal = 0x53, /* . on numeric keypad */
|
|
||||||
OEM_102 = 0x56, /* < > | on UK/Germany keyboards */
|
|
||||||
F11 = 0x57,
|
|
||||||
F12 = 0x58,
|
|
||||||
F13 = 0x64, /* (NEC PC98) */
|
|
||||||
F14 = 0x65, /* (NEC PC98) */
|
|
||||||
F15 = 0x66, /* (NEC PC98) */
|
|
||||||
Kana = 0x70, /* (Japanese keyboard) */
|
|
||||||
ABNT_C1 = 0x73, /* / ? on Portugese (Brazilian) keyboards */
|
|
||||||
Convert = 0x79, /* (Japanese keyboard) */
|
|
||||||
NoConvert = 0x7B, /* (Japanese keyboard) */
|
|
||||||
Yen = 0x7D, /* (Japanese keyboard) */
|
|
||||||
ABNT_C2 = 0x7E, /* Numpad . on Portugese (Brazilian) keyboards */
|
|
||||||
NumpadEquals = 0x8D, /* = on numeric keypad (NEC PC98) */
|
|
||||||
PrevTrack = 0x90, /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
|
|
||||||
At = 0x91, /* (NEC PC98) */
|
|
||||||
Colon = 0x92, /* (NEC PC98) */
|
|
||||||
Underline = 0x93, /* (NEC PC98) */
|
|
||||||
Kanji = 0x94, /* (Japanese keyboard) */
|
|
||||||
Stop = 0x95, /* (NEC PC98) */
|
|
||||||
AX = 0x96, /* (Japan AX) */
|
|
||||||
Unlabeled = 0x97, /* (J3100) */
|
|
||||||
NextTrack = 0x99, /* Next Track */
|
|
||||||
NumpadEnter = 0x9C, /* Enter on numeric keypad */
|
|
||||||
RightControl = 0x9D,
|
|
||||||
Mute = 0xA0,
|
|
||||||
Calculator = 0xA1,
|
|
||||||
PlayPause = 0xA2, /* Play / Pause */
|
|
||||||
MediaStop = 0xA4, /* Media Stop */
|
|
||||||
VolumeDown = 0xAE, /* Volume - */
|
|
||||||
VolumeUp = 0xB0, /* Volume + */
|
|
||||||
WebHome = 0xB2, /* Web home */
|
|
||||||
NumpadComma = 0xB3, /* , on numeric keypad (NEC PC98) */
|
|
||||||
Divide = 0xB5, /* / on numeric keypad */
|
|
||||||
SysRq = 0xB7,
|
|
||||||
RightAlt = 0xB8, /* Right Alt */
|
|
||||||
Pause = 0xC5,
|
|
||||||
Home = 0xC7, /* Home on arrow keypad */
|
|
||||||
ArrowUp = 0xC8, /* UpArrow on arrow keypad */
|
|
||||||
PageUp = 0xC9, /* PgUp on arrow keypad */
|
|
||||||
ArrowLeft = 0xCB, /* LeftArrow on arrow keypad */
|
|
||||||
ArrowRight = 0xCD, /* RightArrow on arrow keypad */
|
|
||||||
End = 0xCF, /* End on arrow keypad */
|
|
||||||
ArrowDown = 0xD0, /* DownArrow on arrow keypad */
|
|
||||||
PageDown = 0xD1, /* PgDn on arrow keypad */
|
|
||||||
Insert = 0xD2, /* Insert on arrow keypad */
|
|
||||||
Delete = 0xD3, /* Delete on arrow keypad */
|
|
||||||
LeftWindows = 0xDB, /* Left Windows key */
|
|
||||||
RightWindow = 0xDC, /* Right Windows key */
|
|
||||||
RightWindows = 0xDC, /* Right Windows key - Correct spelling :) */
|
|
||||||
AppMenu = 0xDD, /* AppMenu key */
|
|
||||||
Power = 0xDE, /* System Power */
|
|
||||||
Sleep = 0xDF, /* System Sleep */
|
|
||||||
Wake = 0xE3, /* System Wake */
|
|
||||||
WebSearch = 0xE5,
|
|
||||||
WebFavorites = 0xE6,
|
|
||||||
WebRefresh = 0xE7,
|
|
||||||
WebStop = 0xE8,
|
|
||||||
WebForward = 0xE9,
|
|
||||||
WebBack = 0xEA,
|
|
||||||
MyComputer = 0xEB,
|
|
||||||
Mail = 0xEC,
|
|
||||||
MediaSelect = 0xED
|
|
||||||
};
|
|
||||||
|
|
||||||
KeyCode(Enum _value = None) : value(_value) { }
|
|
||||||
|
|
||||||
friend bool operator == (KeyCode const& a, KeyCode const& b) { return a.value == b.value; }
|
|
||||||
friend bool operator != (KeyCode const& a, KeyCode const& b) { return a.value != b.value; }
|
|
||||||
|
|
||||||
int toValue() const { return (int)value; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Enum value;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace MyGUI
|
|
||||||
|
|
||||||
#endif // __MYGUI_INPUT_DEFINE_H__
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue