[Python-ogre-commit] SF.net SVN: python-ogre: [460] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2007-10-24 11:07:30
|
Revision: 460 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=460&view=rev Author: andy_miller Date: 2007-10-24 04:07:33 -0700 (Wed, 24 Oct 2007) Log Message: ----------- Updated QuickGUI Updated Caelum from the branch SVN (just for fun!) Final update before putting out a linux binary Modified Paths: -------------- trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalTrackBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUINStateButton.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIScrollPane.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalTrackBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.h Added Paths: ----------- trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h Removed Paths: ------------- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.h trunk/python-ogre/code_generators/physx/build.out Modified: trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h =================================================================== --- trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h 2007-10-24 11:07:33 UTC (rev 460) @@ -5,19 +5,19 @@ #include "Ogre.h" // Define the dll export qualifier if compiling for Windows -// // // #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 -// // // #ifdef CAELUM_LIB -// // // #define DllExport __declspec (dllexport) -// // // #else -// // // #ifdef __MINGW32__ -// // // #define DllExport -// // // #else -// // // #define DllExport __declspec (dllimport) -// // // #endif -// // // #endif -// // // #else +#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 + #ifdef CAELUM_LIB + #define DllExport __declspec (dllexport) + #else + #ifdef __MINGW32__ + #define DllExport + #else + #define DllExport __declspec (dllimport) + #endif + #endif +#else #define DllExport -// // // #endif +#endif // Define the version code #define CAELUM_VERSION_MAIN 0 Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -16,34 +16,42 @@ switch(mBorderType) { case BORDER_TYPE_TOP_LEFT: + mSkinComponent = ".border.topleft"; mHorizontalAnchor = ANCHOR_HORIZONTAL_LEFT; mVerticalAnchor = ANCHOR_VERTICAL_TOP; break; case BORDER_TYPE_TOP_RIGHT: + mSkinComponent = ".border.topright"; mHorizontalAnchor = ANCHOR_HORIZONTAL_RIGHT; mVerticalAnchor = ANCHOR_VERTICAL_TOP; break; case BORDER_TYPE_BOTTOM_LEFT: + mSkinComponent = ".border.bottomleft"; mHorizontalAnchor = ANCHOR_HORIZONTAL_LEFT; mVerticalAnchor = ANCHOR_VERTICAL_BOTTOM; break; case BORDER_TYPE_BOTTOM_RIGHT: + mSkinComponent = ".border.bottomright"; mHorizontalAnchor = ANCHOR_HORIZONTAL_RIGHT; mVerticalAnchor = ANCHOR_VERTICAL_BOTTOM; break; case BORDER_TYPE_LEFT: + mSkinComponent = ".border.left"; mHorizontalAnchor = ANCHOR_HORIZONTAL_LEFT; mVerticalAnchor = ANCHOR_VERTICAL_TOP_BOTTOM; break; case BORDER_TYPE_TOP: + mSkinComponent = ".border.top"; mHorizontalAnchor = ANCHOR_HORIZONTAL_LEFT_RIGHT; mVerticalAnchor = ANCHOR_VERTICAL_TOP; break; case BORDER_TYPE_RIGHT: + mSkinComponent = ".border.right"; mHorizontalAnchor = ANCHOR_HORIZONTAL_RIGHT; mVerticalAnchor = ANCHOR_VERTICAL_TOP_BOTTOM; break; case BORDER_TYPE_BOTTOM: + mSkinComponent = ".border.bottom"; mHorizontalAnchor = ANCHOR_HORIZONTAL_LEFT_RIGHT; mVerticalAnchor = ANCHOR_VERTICAL_BOTTOM; break; @@ -158,4 +166,19 @@ mc->offsetOrigin(0,0); mc->setPosition(currentPosition.x,currentPosition.y); } + + void Border::setSkin(const Ogre::String& skinName, Ogre::String extension, bool recursive) + { + mSkinName = skinName; + if(mParentWidget != NULL) + setTexture(mSkinName + mParentWidget->getSkinComponent() + mSkinComponent + extension); + else + setTexture(mSkinName + mSkinComponent + extension); + + if(recursive) + { + for(std::vector<Widget*>::iterator it = mChildWidgets.begin(); it != mChildWidgets.end(); ++it) + (*it)->setSkin(skinName,extension,recursive); + } + } } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h 2007-10-24 11:07:33 UTC (rev 460) @@ -47,6 +47,8 @@ BorderType getBorderType(); + void setSkin(const Ogre::String& skinName, Ogre::String extension = ".png", bool recursive = false); + protected: virtual ~Border(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -10,6 +10,7 @@ mButtonDown(false) { mWidgetType = TYPE_BUTTON; + mSkinComponent = ".button"; mButtonDownTexture = mTextureName + ".down" + mTextureExtension; mButtonOverTexture = mTextureName + ".over" + mTextureExtension; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -13,10 +13,12 @@ mVPixelPadHeight(10) { mWidgetType = TYPE_COMBOBOX; + mSkinComponent = ".combobox"; addEventHandler(EVENT_LOSE_FOCUS,&ComboBox::onLoseFocus,this); addEventHandler(EVENT_MOUSE_ENTER,&ComboBox::onMouseEnters,this); addEventHandler(EVENT_MOUSE_LEAVE,&ComboBox::onMouseLeaves,this); addEventHandler(EVENT_MOUSE_BUTTON_UP,&ComboBox::onMouseButtonUp,this); + addEventHandler(EVENT_MOUSE_BUTTON_DOWN,&ComboBox::onMouseButtonDown,this); mTextUtilities = new Text(mInstanceName+".TextUtilities",mQuadContainer,this); mTextUtilities->disable(); @@ -38,6 +40,7 @@ mList->allowScrolling(true); mList->hide(); mList->setPropogateEventFiring(EVENT_MOUSE_BUTTON_UP,true); + mList->setPropogateEventFiring(EVENT_MOUSE_BUTTON_DOWN,true); mList->setPropogateEventFiring(EVENT_MOUSE_ENTER,true); mList->setPropogateEventFiring(EVENT_MOUSE_LEAVE,true); @@ -48,6 +51,8 @@ mMenuLabel->setHorizontalAnchor(ANCHOR_HORIZONTAL_LEFT_RIGHT); mMenuLabel->setPosition(0,0); mMenuLabel->setPropogateEventFiring(EVENT_LOSE_FOCUS,true); + mMenuLabel->setPropogateEventFiring(EVENT_MOUSE_ENTER,true); + mMenuLabel->setPropogateEventFiring(EVENT_MOUSE_LEAVE,true); mGUIManager->notifyNameUsed(mInstanceName+".DropDownButton"); mButton = new Button(mInstanceName+".DropDownButton",Size(mSize.height,mSize.height),mTextureName + ".button" + mTextureExtension,mGUIManager); @@ -57,6 +62,8 @@ mButton->setHorizontalAnchor(ANCHOR_HORIZONTAL_RIGHT); mButton->setVerticalAnchor(ANCHOR_VERTICAL_TOP_BOTTOM); mButton->setPropogateEventFiring(EVENT_MOUSE_BUTTON_UP,true); + mButton->setPropogateEventFiring(EVENT_MOUSE_ENTER,true); + mButton->setPropogateEventFiring(EVENT_MOUSE_LEAVE,true); mHighlightTexture = mTextureName + ".highlight" + mTextureExtension; @@ -181,7 +188,9 @@ { highlightListItem(dynamic_cast<MenuLabel*>(mea.widget)); } - //setTexture(mDefaultTexture + ".over" + mTextureExtension); + + setTexture(mTextureName + ".over" + mTextureExtension,false); + mButton->applyButtonOverTexture(); } void ComboBox::onMouseLeaves(const EventArgs& args) @@ -189,9 +198,16 @@ mHighlightPanel->setVisible(false); mHighlightedItem = NULL; - //setTexture(mDefaultTexture + mTextureExtension); + setTexture(mTextureName + mTextureExtension,false); + mButton->applyDefaultTexture(); } + void ComboBox::onMouseButtonDown(const EventArgs& args) + { + setTexture(mTextureName + ".down" + mTextureExtension,false); + mButton->applyButtonDownTexture(); + } + void ComboBox::onMouseButtonUp(const EventArgs& args) { const MouseEventArgs& mea = dynamic_cast<const MouseEventArgs&>(args); @@ -203,13 +219,11 @@ { mList->hide(); mGUIManager->_menuClosed(mList); - mButton->applyDefaultTexture(); } else { mList->show(); mGUIManager->_menuOpened(mList); - mButton->applyButtonDownTexture(); } } } @@ -217,7 +231,7 @@ void ComboBox::onSelection(const EventArgs& args) { selectItem(dynamic_cast<MenuLabel*>(dynamic_cast<const WidgetEventArgs&>(args).widget)); -// setTexture(mDefaultTexture + mTextureExtension); + setTexture(mTextureName + mTextureExtension,false); mButton->applyDefaultTexture(); mList->hide(); @@ -314,6 +328,27 @@ ComboBox::setSize(pixelSize.width,pixelSize.height); } + void ComboBox::setSkin(const Ogre::String& skinName, Ogre::String extension, bool recursive) + { + mSkinName = skinName; + setTexture(mSkinName + mSkinComponent + extension); + } + + void ComboBox::setTexture(const Ogre::String& textureName, bool updateBaseTexture) + { + Image::setTexture(textureName,updateBaseTexture); + + if(updateBaseTexture) + { + mList->setTexture(mTextureName + ".list" + mTextureExtension); + mMenuLabel->setTexture(mTextureName + ".menulabel" + mTextureExtension); + mButton->setTexture(mTextureName + ".button" + mTextureExtension); + + mHighlightTexture = mTextureName + ".highlight" + mTextureExtension; + mHighlightPanel->setTexture(mHighlightTexture); + } + } + void ComboBox::setVerticalPixelPadHeight(unsigned int height) { mVPixelPadHeight = height; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h 2007-10-24 11:07:33 UTC (rev 460) @@ -80,6 +80,12 @@ */ virtual void setSize(const Ogre::Real& pixelWidth, const Ogre::Real& pixelHeight); virtual void setSize(const Size& pixelSize); + virtual void setSkin(const Ogre::String& skinName, Ogre::String extension = ".png", bool recursive = false); + /** + * Applies the texture to the Quad if exists in some form, and updates the Image used for + * transparency picking. + */ + virtual void setTexture(const Ogre::String& textureName, bool updateBaseTexture = true); void setVerticalPixelPadHeight(unsigned int height); protected: @@ -99,6 +105,7 @@ void hideDropDownList(const EventArgs& args); void onLoseFocus(const EventArgs& args); void onMouseButtonUp(const EventArgs& args); + void onMouseButtonDown(const EventArgs& args); void onMouseEnters(const EventArgs& args); void onMouseLeaves(const EventArgs& args); /** Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -3,10 +3,11 @@ namespace QuickGUI { Console::Console(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm) : - MultiLineLabel(instanceName,pixelSize,textureName,gm), + LabelArea(instanceName,pixelSize,textureName,gm), mMaxLines(30) { mWidgetType = TYPE_CONSOLE; + mSkinComponent = ".console"; mInputBox = new TextBox(mInstanceName+".InputBox",Size(mSize.width,0),"qgui.textbox.png",mGUIManager); addChild(mInputBox); @@ -59,7 +60,7 @@ void Console::clearText() { - MultiLineLabel::clearText(); + LabelArea::clearText(); mInputBox->clearText(); } @@ -83,13 +84,13 @@ void Console::setDisabledTextColor(const Ogre::ColourValue& c) { - MultiLineLabel::setDisabledTextColor(c); + LabelArea::setDisabledTextColor(c); mInputBox->setDisabledTextColor(c); } void Console::setHorizontalAlignment(HorizontalAlignment ha) { - MultiLineLabel::setHorizontalAlignment(ha); + LabelArea::setHorizontalAlignment(ha); mInputBox->setHorizontalAlignment(ha); } @@ -100,13 +101,13 @@ void Console::setTextColor(Ogre::ColourValue color) { - MultiLineLabel::setTextColor(color); + LabelArea::setTextColor(color); mInputBox->setTextColor(color); } void Console::setVerticalAlignment(VerticalAlignment va) { - MultiLineLabel::setVerticalAlignment(va); + LabelArea::setVerticalAlignment(va); mInputBox->setVerticalAlignment(va); } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.h 2007-10-24 11:07:33 UTC (rev 460) @@ -1,13 +1,13 @@ #ifndef QUICKGUICONSOLE_H #define QUICKGUICONSOLE_H -#include "QuickGUIMultiLineLabel.h" +#include "QuickGUILabelArea.h" #include "QuickGUITextBox.h" namespace QuickGUI { class Console : - public MultiLineLabel + public LabelArea { public: Console(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -15,6 +15,7 @@ mButtonLayout(BUTTON_LAYOUT_OPPOSITE) { mWidgetType = TYPE_SCROLLBAR_HORIZONTAL; + mSkinComponent = ".scrollbar.horizontal"; mGUIManager->registerTimeListener(this); addEventHandler(EVENT_MOUSE_BUTTON_DOWN,&HorizontalScrollBar::onMouseDownOnTrack,this); addEventHandler(EVENT_MOUSE_BUTTON_UP,&HorizontalScrollBar::onMouseUpOnTrack,this); @@ -261,9 +262,11 @@ void HorizontalScrollBar::onMouseDownOnTrack(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if(id == MB_Left) { mMouseDownOnTrack = true; + mButtonDown = MB_Left; Point mousePosition = dynamic_cast<const MouseEventArgs&>(args).position - getScreenPosition(); @@ -282,11 +285,34 @@ mRepeatTimer = 0; } + else if(id == MB_Right) + { + mMouseDownOnTrack = true; + mButtonDown = MB_Right; + + Point mousePosition = dynamic_cast<const MouseEventArgs&>(args).position - getScreenPosition(); + + ScrollEventArgs scrollArgs(this); + // if mouse clicked left of track, scroll right. + if(mousePosition.x < mSlider->getXPosition()) + { + scrollArgs.sliderIncreasedPosition = false; + _scroll(mLargeChange,scrollArgs); + } + else + { + scrollArgs.sliderIncreasedPosition = true; + _scroll(-mLargeChange,scrollArgs); + } + + mRepeatTimer = 0; + } } void HorizontalScrollBar::onMouseUpOnTrack(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if((id == MB_Left) || (id == MB_Right)) { mMouseDownOnTrack = false; } @@ -306,22 +332,36 @@ void HorizontalScrollBar::onScrollLeftDown(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if(id == MB_Left) { scrollLeftSmall(); mRepeatTimer = 0; } + else if(id == MB_Right) + { + scrollRightSmall(); + + mRepeatTimer = 0; + } } void HorizontalScrollBar::onScrollRightDown(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if(id == MB_Left) { scrollRightSmall(); mRepeatTimer = 0; } + else if(id == MB_Right) + { + scrollLeftSmall(); + + mRepeatTimer = 0; + } } void HorizontalScrollBar::onSliderDragged(const EventArgs& args) @@ -431,7 +471,7 @@ if(mMouseDownOnTrack) { MouseEventArgs args(this); - args.button = MB_Left; + args.button = mButtonDown; args.position = mGUIManager->getMouseCursor()->getPosition(); onMouseDownOnTrack(args); return; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.h 2007-10-24 11:07:33 UTC (rev 460) @@ -132,6 +132,7 @@ void onScrollRightDown(const EventArgs& args); bool mMouseDownOnTrack; + MouseButtonID mButtonDown; void onMouseDownOnTrack(const EventArgs& args); void onMouseUpOnTrack(const EventArgs& args); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalTrackBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalTrackBar.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalTrackBar.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -10,6 +10,7 @@ mLargeChange(3) { mWidgetType = TYPE_TRACKBAR_HORIZONTAL; + mSkinComponent = ".trackbar.horizontal"; addEventHandler(EVENT_MOUSE_BUTTON_DOWN,&HorizontalTrackBar::onMouseButtonDown,this); // Creat slider button at the beginning of the HorizontalTrackBar, whether horizonal (left) or vertical (bot) Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -6,6 +6,7 @@ Widget(instanceName,pixelSize,texture,gm) { mWidgetType = TYPE_IMAGE; + mSkinComponent = ".image"; } Image::~Image() Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -17,6 +17,7 @@ mVPixelPadHeight(6) { mWidgetType = TYPE_LABEL; + mSkinComponent = ".label"; mText = new Text(mInstanceName+".Text",mQuadContainer,this); mText->setQuadLayer(mQuadLayer); } Added: trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -0,0 +1,205 @@ +#include "QuickGUILabelArea.h" + +namespace QuickGUI +{ + LabelArea::LabelArea(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm) : + Label(instanceName,pixelSize,textureName,gm), + mOffset(0.0), + mCaption("") + { + mWidgetType = TYPE_LABELAREA; + mSkinComponent = ".labelarea"; + mAutoSize = false; + + mTextList = new List(mInstanceName+".TextList",mSize,"",mGUIManager); + addChild(mTextList); + mTextList->setHorizontalAnchor(ANCHOR_HORIZONTAL_LEFT_RIGHT); + mTextList->setVerticalAnchor(ANCHOR_VERTICAL_TOP_BOTTOM); + + allowScrolling(true); + } + + LabelArea::~LabelArea() + { + } + + int LabelArea::_getLine(int startIndex) + { + int end = startIndex + 1; + + Ogre::Real length = 0; + Ogre::FontPtr font = mText->getFont(); + Ogre::Real fontTextureWidth = mText->getFontTextureWidth(); + Ogre::Font::UVRect uvRect; + while( (end < static_cast<int>(mCaption.length())) && (length <= (mSize.width - mOffset))) + { + if(mText->isWhiteSpace(mCaption[end])) + { + if(mText->isSpace(mCaption[end])) + uvRect = font->getGlyphTexCoords('r'); + else if(mText->isTab(mCaption[end])) + { + uvRect = font->getGlyphTexCoords('r'); + uvRect.right = uvRect.right + ((uvRect.right - uvRect.left) * (SPACES_PER_TAB - 1)); + } + } + else + uvRect = font->getGlyphTexCoords(mCaption[end]); + length += (((uvRect.right - uvRect.left) * TEXT_MULTIPLIER) * fontTextureWidth); + ++end; + } + + // The rest of the caption is less than the width of the Widget. + if( end == static_cast<int>(mCaption.length()) ) + return end; + // Remaining portion of caption is larger than the width of the widget. + else + { + // Iterate backwards until we find a space. + while( !mText->isSpace(mCaption[end]) ) + --end; + + return end; + } + } + + void LabelArea::alignText() + { + } + + void LabelArea::allowScrolling(bool allow) + { + mScrollingAllowed = allow; + mTextList->allowScrolling(mScrollingAllowed); + + if(allow) + mOffset = mTextList->mRightScrollBar->getWidth(); + else + mOffset = 0.0; + } + + void LabelArea::clearText() + { + setText(""); + } + + void LabelArea::disable() + { + mTextColor = mText->getColor(); + + for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) + { + dynamic_cast<TextBox*>(mTextList->getItem(i))->setTextColor(mDisabledTextColor); + } + + Label::disable(); + } + + void LabelArea::enable() + { + for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) + { + dynamic_cast<TextBox*>(mTextList->getItem(i))->setTextColor(mTextColor); + } + + Label::enable(); + } + + Ogre::UTFString LabelArea::getText() + { + return mCaption; + } + + bool LabelArea::scrollingAllowed() + { + return mScrollingAllowed; + } + + void LabelArea::setDisabledTextColor(const Ogre::ColourValue& c) + { + mDisabledTextColor = c; + + for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) + { + dynamic_cast<TextBox*>(mTextList->getItem(i))->setDisabledTextColor(mDisabledTextColor); + } + + if(!mEnabled) + disable(); + } + + void LabelArea::setFont(const Ogre::String& fontScriptName, bool recursive) + { + Label::setFont(fontScriptName,recursive); + setText(mCaption); + } + + void LabelArea::setHorizontalAlignment(HorizontalAlignment ha) + { + mHorizontalAlignment = ha; + + for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) + { + dynamic_cast<TextBox*>(mTextList->getItem(i))->setHorizontalAlignment(mHorizontalAlignment); + } + } + + void LabelArea::setText(const Ogre::UTFString& text) + { + mCaption = text; + + // Caption Iterator + int textIndex = 0; + // Index denoting the end of a line that can fix within the widgets width. + int lineEnd = 0; + // The index of the text box to use, or create and use. + int textBoxIndex = 0; + + while( textIndex < static_cast<int>(mCaption.size()) ) + { + lineEnd = _getLine(textIndex); + + TextBox* tb; + if( textBoxIndex >= mTextList->getNumberOfItems() ) + { + tb = mTextList->addTextBox(); + tb->setTexture(""); + } + else + tb = dynamic_cast<TextBox*>(mTextList->getItem(textBoxIndex)); + + tb->setReadOnly(true); + tb->setUseBorders(false); + tb->setText(mCaption.substr(textIndex,lineEnd - textIndex)); + ++textBoxIndex; + + textIndex = lineEnd + 1; + } + + // destroy remaining unused textboxes. + int numExtraTextBoxes = mTextList->getNumberOfItems() - textBoxIndex; + while( numExtraTextBoxes > 0 ) + { + mTextList->removeItem(textBoxIndex); + --numExtraTextBoxes; + } + } + + void LabelArea::setTextColor(Ogre::ColourValue color) + { + for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) + { + dynamic_cast<TextBox*>(mTextList->getItem(i))->setTextColor(color); + } + } + + void LabelArea::setVerticalAlignment(VerticalAlignment va) + { + mVerticalAlignment = va; + + for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) + { + dynamic_cast<TextBox*>(mTextList->getItem(i))->setVerticalAlignment(mVerticalAlignment); + } + } +} Added: trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.h (rev 0) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.h 2007-10-24 11:07:33 UTC (rev 460) @@ -0,0 +1,71 @@ +#ifndef QUICKGUIMULTILINELABEL_H +#define QUICKGUIMULTILINELABEL_H + +#include "QuickGUIList.h" +#include "QuickGUILabel.h" + +#include <vector> + +namespace QuickGUI +{ + class _QuickGUIExport LabelArea : + public Label + { + public: + LabelArea(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm); + ~LabelArea(); + + /** + * Aligns the child Label widget horizontally and vertically + */ + virtual void alignText(); + void allowScrolling(bool allow); + + virtual void clearText(); + + /** + * Disable Widget, making it unresponsive to events. + */ + virtual void disable(); + /** + * Enable Widget, allowing it to accept and handle events. + */ + virtual void enable(); + + virtual Ogre::UTFString getText(); + + bool scrollingAllowed(); + /** + * Sets the color of the text when the widget is disabled. + */ + virtual void setDisabledTextColor(const Ogre::ColourValue& c); + virtual void setFont(const Ogre::String& fontScriptName, bool recursive = false); + /** + * Sets text horizontal alignment. + */ + virtual void setHorizontalAlignment(HorizontalAlignment ha); + virtual void setText(const Ogre::UTFString& text); + virtual void setTextColor(Ogre::ColourValue color); + /** + * Sets text vertical alignment. + */ + virtual void setVerticalAlignment(VerticalAlignment va); + + protected: + Ogre::UTFString mCaption; + List* mTextList; + // if ScrollBar is visible, width used to calculating a line of text is modified. + Ogre::Real mOffset; + + bool mScrollingAllowed; + + // Properties that are used across all TextBoxes + Ogre::String mTextBoxTextureName; + Ogre::String mTextBoxFont; + + // Finds the end of the last word that can fit in one text box. + int _getLine(int startIndex); + }; +} + +#endif Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -14,6 +14,7 @@ mVPixelPadHeight(6) { mWidgetType = TYPE_LIST; + mSkinComponent = ".list"; mTextUtilities = new Text(mInstanceName+".TextUtilities",mQuadContainer,this); mTextUtilities->disable(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.h 2007-10-24 11:07:33 UTC (rev 460) @@ -24,7 +24,7 @@ { public: friend class ComboBox; - friend class MultiLineLabel; + friend class LabelArea; public: /** Constructor @param Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -316,8 +316,8 @@ case Widget::TYPE_LABEL: s = "Label"; break; case Widget::TYPE_LIST: s = "List"; break; case Widget::TYPE_MENULABEL: s = "MenuLabel"; break; - case Widget::TYPE_MULTILINELABEL: s = "MultiLineLabel"; break; - case Widget::TYPE_MULTILINETEXTBOX: s = "MultiLineTextBox"; break; + case Widget::TYPE_LABELAREA: s = "LabelArea"; break; + case Widget::TYPE_TEXTAREA: s = "TextArea"; break; case Widget::TYPE_NSTATEBUTTON: s = "NStateButton"; break; case Widget::TYPE_PANEL: s = "Panel"; break; case Widget::TYPE_PROGRESSBAR: s = "ProgressBar"; break; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -10,6 +10,7 @@ mButtonTextureName("") { mWidgetType = TYPE_MENULABEL; + mSkinComponent = ".menulabel"; mTextBoundsPixelOffset.x = mSize.height; mTextBoundsRelativeSize.width = (mSize.width - (mSize.height * 2.0)) / mSize.width; Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -1,204 +0,0 @@ -#include "QuickGUIMultiLineLabel.h" - -namespace QuickGUI -{ - MultiLineLabel::MultiLineLabel(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm) : - Label(instanceName,pixelSize,textureName,gm), - mOffset(0.0), - mCaption("") - { - mWidgetType = TYPE_MULTILINELABEL; - mAutoSize = false; - - mTextList = new List(mInstanceName+".TextList",mSize,"",mGUIManager); - addChild(mTextList); - mTextList->setHorizontalAnchor(ANCHOR_HORIZONTAL_LEFT_RIGHT); - mTextList->setVerticalAnchor(ANCHOR_VERTICAL_TOP_BOTTOM); - - allowScrolling(true); - } - - MultiLineLabel::~MultiLineLabel() - { - } - - int MultiLineLabel::_getLine(int startIndex) - { - int end = startIndex + 1; - - Ogre::Real length = 0; - Ogre::FontPtr font = mText->getFont(); - Ogre::Real fontTextureWidth = mText->getFontTextureWidth(); - Ogre::Font::UVRect uvRect; - while( (end < static_cast<int>(mCaption.length())) && (length <= (mSize.width - mOffset))) - { - if(mText->isWhiteSpace(mCaption[end])) - { - if(mText->isSpace(mCaption[end])) - uvRect = font->getGlyphTexCoords('r'); - else if(mText->isTab(mCaption[end])) - { - uvRect = font->getGlyphTexCoords('r'); - uvRect.right = uvRect.right + ((uvRect.right - uvRect.left) * (SPACES_PER_TAB - 1)); - } - } - else - uvRect = font->getGlyphTexCoords(mCaption[end]); - length += (((uvRect.right - uvRect.left) * TEXT_MULTIPLIER) * fontTextureWidth); - ++end; - } - - // The rest of the caption is less than the width of the Widget. - if( end == static_cast<int>(mCaption.length()) ) - return end; - // Remaining portion of caption is larger than the width of the widget. - else - { - // Iterate backwards until we find a space. - while( !mText->isSpace(mCaption[end]) ) - --end; - - return end; - } - } - - void MultiLineLabel::alignText() - { - } - - void MultiLineLabel::allowScrolling(bool allow) - { - mScrollingAllowed = allow; - mTextList->allowScrolling(mScrollingAllowed); - - if(allow) - mOffset = mTextList->mRightScrollBar->getWidth(); - else - mOffset = 0.0; - } - - void MultiLineLabel::clearText() - { - setText(""); - } - - void MultiLineLabel::disable() - { - mTextColor = mText->getColor(); - - for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) - { - dynamic_cast<TextBox*>(mTextList->getItem(i))->setTextColor(mDisabledTextColor); - } - - Label::disable(); - } - - void MultiLineLabel::enable() - { - for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) - { - dynamic_cast<TextBox*>(mTextList->getItem(i))->setTextColor(mTextColor); - } - - Label::enable(); - } - - Ogre::UTFString MultiLineLabel::getText() - { - return mCaption; - } - - bool MultiLineLabel::scrollingAllowed() - { - return mScrollingAllowed; - } - - void MultiLineLabel::setDisabledTextColor(const Ogre::ColourValue& c) - { - mDisabledTextColor = c; - - for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) - { - dynamic_cast<TextBox*>(mTextList->getItem(i))->setDisabledTextColor(mDisabledTextColor); - } - - if(!mEnabled) - disable(); - } - - void MultiLineLabel::setFont(const Ogre::String& fontScriptName, bool recursive) - { - Label::setFont(fontScriptName,recursive); - setText(mCaption); - } - - void MultiLineLabel::setHorizontalAlignment(HorizontalAlignment ha) - { - mHorizontalAlignment = ha; - - for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) - { - dynamic_cast<TextBox*>(mTextList->getItem(i))->setHorizontalAlignment(mHorizontalAlignment); - } - } - - void MultiLineLabel::setText(const Ogre::UTFString& text) - { - mCaption = text; - - // Caption Iterator - int textIndex = 0; - // Index denoting the end of a line that can fix within the widgets width. - int lineEnd = 0; - // The index of the text box to use, or create and use. - int textBoxIndex = 0; - - while( textIndex < static_cast<int>(mCaption.size()) ) - { - lineEnd = _getLine(textIndex); - - TextBox* tb; - if( textBoxIndex >= mTextList->getNumberOfItems() ) - { - tb = mTextList->addTextBox(); - tb->setTexture(""); - } - else - tb = dynamic_cast<TextBox*>(mTextList->getItem(textBoxIndex)); - - tb->setReadOnly(true); - tb->setUseBorders(false); - tb->setText(mCaption.substr(textIndex,lineEnd - textIndex)); - ++textBoxIndex; - - textIndex = lineEnd + 1; - } - - // destroy remaining unused textboxes. - int numExtraTextBoxes = mTextList->getNumberOfItems() - textBoxIndex; - while( numExtraTextBoxes > 0 ) - { - mTextList->removeItem(textBoxIndex); - --numExtraTextBoxes; - } - } - - void MultiLineLabel::setTextColor(Ogre::ColourValue color) - { - for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) - { - dynamic_cast<TextBox*>(mTextList->getItem(i))->setTextColor(color); - } - } - - void MultiLineLabel::setVerticalAlignment(VerticalAlignment va) - { - mVerticalAlignment = va; - - for( int i = 0; i < mTextList->getNumberOfItems(); ++i ) - { - dynamic_cast<TextBox*>(mTextList->getItem(i))->setVerticalAlignment(mVerticalAlignment); - } - } -} Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineLabel.h 2007-10-24 11:07:33 UTC (rev 460) @@ -1,71 +0,0 @@ -#ifndef QUICKGUIMULTILINELABEL_H -#define QUICKGUIMULTILINELABEL_H - -#include "QuickGUIList.h" -#include "QuickGUILabel.h" - -#include <vector> - -namespace QuickGUI -{ - class _QuickGUIExport MultiLineLabel : - public Label - { - public: - MultiLineLabel(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm); - ~MultiLineLabel(); - - /** - * Aligns the child Label widget horizontally and vertically - */ - virtual void alignText(); - void allowScrolling(bool allow); - - virtual void clearText(); - - /** - * Disable Widget, making it unresponsive to events. - */ - virtual void disable(); - /** - * Enable Widget, allowing it to accept and handle events. - */ - virtual void enable(); - - virtual Ogre::UTFString getText(); - - bool scrollingAllowed(); - /** - * Sets the color of the text when the widget is disabled. - */ - virtual void setDisabledTextColor(const Ogre::ColourValue& c); - virtual void setFont(const Ogre::String& fontScriptName, bool recursive = false); - /** - * Sets text horizontal alignment. - */ - virtual void setHorizontalAlignment(HorizontalAlignment ha); - virtual void setText(const Ogre::UTFString& text); - virtual void setTextColor(Ogre::ColourValue color); - /** - * Sets text vertical alignment. - */ - virtual void setVerticalAlignment(VerticalAlignment va); - - protected: - Ogre::UTFString mCaption; - List* mTextList; - // if ScrollBar is visible, width used to calculating a line of text is modified. - Ogre::Real mOffset; - - bool mScrollingAllowed; - - // Properties that are used across all TextBoxes - Ogre::String mTextBoxTextureName; - Ogre::String mTextBoxFont; - - // Finds the end of the last word that can fit in one text box. - int _getLine(int startIndex); - }; -} - -#endif Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -1,14 +0,0 @@ -#include "QuickGUIMultiLineTextBox.h" - -namespace QuickGUI -{ - MultiLineTextBox::MultiLineTextBox(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm) : - MultiLineLabel(instanceName,pixelSize,textureName,gm) - { - mWidgetType = TYPE_MULTILINETEXTBOX; - } - - MultiLineTextBox::~MultiLineTextBox() - { - } -} Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMultiLineTextBox.h 2007-10-24 11:07:33 UTC (rev 460) @@ -1,19 +0,0 @@ -#ifndef QUICKGUIMULTILINETEXTBOX_H -#define QUICKGUIMULTILINETEXTBOX_H - -#include "QuickGUIMultiLineLabel.h" - -namespace QuickGUI -{ - class _QuickGUIExport MultiLineTextBox : - public MultiLineLabel - { - public: - MultiLineTextBox(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm); - ~MultiLineTextBox(); - - protected: - }; -} - -#endif Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUINStateButton.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUINStateButton.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUINStateButton.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -6,6 +6,7 @@ Button(instanceName,pixelSize,"",gm) { mWidgetType = TYPE_NSTATEBUTTON; + mSkinComponent = ""; mAutoSize = false; addEventHandler(EVENT_MOUSE_BUTTON_UP,&NStateButton::onMouseButtonUp,this); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -201,12 +201,12 @@ return newList; } - MultiLineLabel* Panel::createMultiLineLabel() + LabelArea* Panel::createMultiLineLabel() { - Ogre::String name = mGUIManager->generateName(TYPE_MULTILINELABEL); + Ogre::String name = mGUIManager->generateName(TYPE_LABELAREA); mGUIManager->notifyNameUsed(name); - MultiLineLabel* newMultiLineLabel = new MultiLineLabel(name,Size(300,100),"qgui.multilinelabel.png",mGUIManager); + LabelArea* newMultiLineLabel = new LabelArea(name,Size(300,100),"qgui.LabelArea.png",mGUIManager); addChild(newMultiLineLabel); newMultiLineLabel->setPosition(0,0); newMultiLineLabel->setFont(mFontName,true); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.h 2007-10-24 11:07:33 UTC (rev 460) @@ -8,7 +8,7 @@ #include "QuickGUIComboBox.h" #include "QuickGUIConsole.h" #include "QuickGUIImage.h" -#include "QuickGUIMultiLineLabel.h" +#include "QuickGUILabelArea.h" #include "QuickGUINStateButton.h" #include "QuickGUIProgressBar.h" #include "QuickGUIScrollPane.h" @@ -74,7 +74,7 @@ List* createList(); - MultiLineLabel* createMultiLineLabel(); + LabelArea* createMultiLineLabel(); NStateButton* createNStateButton(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -10,6 +10,7 @@ mFillDirection(FILLS_NEGATIVE_TO_POSITIVE) { mWidgetType = TYPE_PROGRESSBAR; + mSkinComponent = ".progressbar"; if( mSize.width > mSize.height ) mLayout = LAYOUT_HORIZONTAL; else Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIScrollPane.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIScrollPane.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIScrollPane.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -10,6 +10,7 @@ mVerticalButtonLayout(VerticalScrollBar::BUTTON_LAYOUT_OPPOSITE) { mWidgetType = TYPE_SCROLL_PANE; + mSkinComponent = ".scrollpane"; mScrollPaneAccessible = false; mGainFocusOnClick = false; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -5,11 +5,10 @@ namespace QuickGUI { Sheet::Sheet(const Ogre::String& name, const Ogre::String& texture, GUIManager* gm) : - Panel(name,Size(gm->getViewportWidth(),gm->getViewportHeight()),texture,gm), - mDefaultTextColor(Ogre::ColourValue::White), - mSkin("qgui") + Panel(name,Size(gm->getViewportWidth(),gm->getViewportHeight()),texture,gm) { mQuadContainer = this; + mSkinComponent = ".sheet"; mWidgetType = TYPE_SHEET; Ogre::FontManager* fm = Ogre::FontManager::getSingletonPtr(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.h 2007-10-24 11:07:33 UTC (rev 460) @@ -44,9 +44,6 @@ protected: virtual void setQuadContainer(QuadContainer* container); - protected: - Ogre::String mSkin; - Ogre::ColourValue mDefaultTextColor; }; } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -5,8 +5,7 @@ namespace QuickGUI { - SkinSet::SkinSet(const Ogre::String& skinName, - const Ogre::String &resourceGroup) : + SkinSet::SkinSet(const Ogre::String& skinName, const Ogre::String &resourceGroup) : mSkinName(skinName), mResourceGroup(resourceGroup), mNumIndividualTextures(0), @@ -386,11 +385,11 @@ } // Following lines are unnecessary... just puts it out to a file to see :-) - Ogre::Image finalImageSet; +/* Ogre::Image finalImageSet; finalImageSet.load("QuickGUI.output.png", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); buf->blitToMemory(finalImageSet.getPixelBox()); finalImageSet.save("SkinSetImage.png"); - } +*/ } bool SkinSet::containsImage(Ogre::String textureName) { @@ -400,6 +399,11 @@ return false; } + Ogre::String SkinSet::getSkinName() + { + return mSkinName; + } + Ogre::String SkinSet::getTextureName() { return mTexture->getName(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.h 2007-10-24 11:07:33 UTC (rev 460) @@ -49,6 +49,7 @@ */ bool containsImage(Ogre::String textureName); + Ogre::String getSkinName(); // Return the name of the skin for this SkinSet Ogre::String getTextureName(); Added: trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -0,0 +1,15 @@ +#include "QuickGUITextArea.h" + +namespace QuickGUI +{ + TextArea::TextArea(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm) : + LabelArea(instanceName,pixelSize,textureName,gm) + { + mWidgetType = TYPE_TEXTAREA; + mSkinComponent = ".textarea"; + } + + TextArea::~TextArea() + { + } +} Added: trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h (rev 0) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h 2007-10-24 11:07:33 UTC (rev 460) @@ -0,0 +1,19 @@ +#ifndef QUICKGUIMULTILINETEXTBOX_H +#define QUICKGUIMULTILINETEXTBOX_H + +#include "QuickGUILabelArea.h" + +namespace QuickGUI +{ + class _QuickGUIExport TextArea : + public LabelArea + { + public: + TextArea(const Ogre::String& instanceName, Size pixelSize, Ogre::String textureName, GUIManager* gm); + ~TextArea(); + + protected: + }; +} + +#endif Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -28,6 +28,7 @@ mRCtrlDown(false) { mWidgetType = TYPE_TEXTBOX; + mSkinComponent = ".textbox"; mHorizontalAlignment = HA_LEFT; mMouseCursor = mGUIManager->getMouseCursor(); mGUIManager->registerTimeListener(this); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h 2007-10-24 11:07:33 UTC (rev 460) @@ -22,7 +22,7 @@ public Label { public: - friend class MultiLineLabel; + friend class LabelArea; public: /** Constructor @param Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -10,6 +10,7 @@ Label(instanceName,pixelSize,texture,gm) { mWidgetType = TYPE_TITLEBAR; + mSkinComponent = ".titlebar"; mScrollPaneAccessible = false; setQuadLayer(Quad::LAYER_MENU); mInheritQuadLayer = false; @@ -110,6 +111,21 @@ fireEvent(EVENT_PARENT_CHANGED,args); } + void TitleBar::setSkin(const Ogre::String& skinName, Ogre::String extension, bool recursive) + { + mSkinName = skinName; + if(mParentWidget != NULL) + setTexture(mSkinName + mParentWidget->getSkinComponent() + mSkinComponent + extension); + else + setTexture(mSkinName + mSkinComponent + extension); + + if(recursive) + { + for(std::vector<Widget*>::iterator it = mChildWidgets.begin(); it != mChildWidgets.end(); ++it) + (*it)->setSkin(skinName,extension,recursive); + } + } + void TitleBar::setText(const Ogre::UTFString& text) { mText->setCaption(text); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h 2007-10-24 11:07:33 UTC (rev 460) @@ -70,6 +70,7 @@ */ void setCaption(const Ogre::UTFString& caption); virtual void setFont(const Ogre::String& fontScriptName, bool recursive = false); + void setSkin(const Ogre::String& skinName, Ogre::String extension = ".png", bool recursive = false); virtual void setText(const Ogre::UTFString& text); virtual void setWidth(Ogre::Real pixelWidth); /** Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -15,6 +15,7 @@ mButtonLayout(BUTTON_LAYOUT_OPPOSITE) { mWidgetType = TYPE_SCROLLBAR_VERTICAL; + mSkinComponent = ".scrollbar.vertical"; mGUIManager->registerTimeListener(this); addEventHandler(EVENT_MOUSE_BUTTON_DOWN,&VerticalScrollBar::onMouseDownOnTrack,this); addEventHandler(EVENT_MOUSE_BUTTON_UP,&VerticalScrollBar::onMouseUpOnTrack,this); @@ -262,14 +263,16 @@ void VerticalScrollBar::onMouseDownOnTrack(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if(id == MB_Left) { mMouseDownOnTrack = true; + mButtonDown = MB_Left; Point mousePosition = dynamic_cast<const MouseEventArgs&>(args).position - getScreenPosition(); ScrollEventArgs scrollArgs(this); - // if mouse clicked left of track, scroll left. + // if mouse clicked above track, scroll up. if(mousePosition.y < mSlider->getYPosition()) { scrollArgs.sliderIncreasedPosition = false; @@ -283,11 +286,34 @@ mRepeatTimer = 0; } + else if(id == MB_Right) + { + mMouseDownOnTrack = true; + mButtonDown = MB_Right; + + Point mousePosition = dynamic_cast<const MouseEventArgs&>(args).position - getScreenPosition(); + + ScrollEventArgs scrollArgs(this); + // if mouse clicked below track, scroll down. + if(mousePosition.y < mSlider->getYPosition()) + { + scrollArgs.sliderIncreasedPosition = false; + _scroll(mLargeChange,scrollArgs); + } + else + { + scrollArgs.sliderIncreasedPosition = true; + _scroll(-mLargeChange,scrollArgs); + } + + mRepeatTimer = 0; + } } void VerticalScrollBar::onMouseUpOnTrack(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if((id == MB_Left) || (id == MB_Right)) { mMouseDownOnTrack = false; } @@ -307,22 +333,36 @@ void VerticalScrollBar::onScrollUpDown(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if(id == MB_Left) { scrollUpSmall(); mRepeatTimer = 0; } + else if(id == MB_Right) + { + scrollDownSmall(); + + mRepeatTimer = 0; + } } void VerticalScrollBar::onScrollDownDown(const EventArgs& args) { - if(dynamic_cast<const MouseEventArgs&>(args).button == MB_Left) + QuickGUI::MouseButtonID id = dynamic_cast<const MouseEventArgs&>(args).button; + if(id == MB_Left) { scrollDownSmall(); mRepeatTimer = 0; } + else if(id == MB_Right) + { + scrollUpSmall(); + + mRepeatTimer = 0; + } } void VerticalScrollBar::onSliderDragged(const EventArgs& args) @@ -432,7 +472,7 @@ if(mMouseDownOnTrack) { MouseEventArgs args(this); - args.button = MB_Left; + args.button = mButtonDown; args.position = mGUIManager->getMouseCursor()->getPosition(); onMouseDownOnTrack(args); return; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.h 2007-10-24 11:07:33 UTC (rev 460) @@ -133,6 +133,7 @@ void onScrollDownDown(const EventArgs& args); bool mMouseDownOnTrack; + MouseButtonID mButtonDown; void onMouseDownOnTrack(const EventArgs& args); void onMouseUpOnTrack(const EventArgs& args); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalTrackBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalTrackBar.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalTrackBar.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -11,6 +11,7 @@ mLargeChange(3) { mWidgetType = TYPE_TRACKBAR_VERTICAL; + mSkinComponent = ".trackbar.vertical"; addEventHandler(EVENT_MOUSE_BUTTON_DOWN,&VerticalTrackBar::onMouseButtonDown,this); // Creat slider button at the beginning of the VerticalTrackBar, whether horizonal (left) or vertical (bot) Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.cpp 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.cpp 2007-10-24 11:07:33 UTC (rev 460) @@ -1136,9 +1136,16 @@ mScrollPaneAccessible = accessible; } - void Widget::setSkin(const Ogre::String& skinName) + void Widget::setSkin(const Ogre::String& skinName, Ogre::String extension, bool recursive) { mSkinName = skinName; + setTexture(mSkinName + mSkinComponent + extension); + + if(recursive) + { + for(std::vector<Widget*>::iterator it = mChildWidgets.begin(); it != mChildWidgets.end(); ++it) + (*it)->setSkin(skinName,extension,recursive); + } } void Widget::setSize(const Ogre::Real& pixelWidth, const Ogre::Real& pixelHeight) Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.h 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.h 2007-10-24 11:07:33 UTC (rev 460) @@ -51,8 +51,8 @@ TYPE_LABEL , TYPE_LIST , TYPE_MENULABEL , - TYPE_MULTILINELABEL , - TYPE_MULTILINETEXTBOX , + TYPE_LABELAREA , + TYPE_TEXTAREA , TYPE_NSTATEBUTTON , TYPE_PANEL , TYPE_PROGRESSBAR , @@ -422,7 +422,7 @@ void setScreenXPosition(const Ogre::Real& pixelX); void setScreenYPosition(const Ogre::Real& pixelY); void setScrollPaneAccessible(bool accessible); - void setSkin(const Ogre::String& skinName); + virtual void setSkin(const Ogre::String& skinName, Ogre::String extension = ".png", bool recursive = false); /** * Manually set size of widget. */ Deleted: trunk/python-ogre/code_generators/physx/build.out =================================================================== --- trunk/python-ogre/code_generators/physx/build.out 2007-10-24 06:16:06 UTC (rev 459) +++ trunk/python-ogre/code_generators/physx/build.out 2007-10-24 11:07:33 UTC (rev 460) @@ -1,1176 +0,0 @@ -WARNING: Unable to find ode/ode.h include file (ode class) in include_dirs -WARNING: Unable to find ode/ode.h include file (ogrerefapp class) in include_dirs -WARNING: Unable to find ode/ode.h include file (ogreode class) in include_dirs -WARNING: Unable to find ode/odecpp.h include file (ogreode class) in include_dirs -WARNING: Unable to find Ogreode_Prefab.h include file (ogreode class) in include_dirs - -INFO Creating xml file "/home/andy/development/python-ogre/code_generators/cache/physx_2.7.2_cache.xml" from source file "/home/andy/development/python-ogre/code_generators/physx/python_physx.h" ... - -INFO gccxml cmd: /home/andy/development/gccxml-build/bin/gccxml -I"/home/andy/development/python-ogre" -I"/home/andy/development/root/usr/include/boost-1_34" -I"/home/andy/development/root/usr/include/OGRE" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs/Cooking/Include" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs/Foundation/include" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs/PhysXLoader/include" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs/NxCharacter/include" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs/NxExtensions/include" -I"/home/andy/development/root/usr/include/PhysX/v2.7.2/SDKs/Physics/include" -D"LINUX" -D"VERSION_2.7.2" "/home/andy/development/python-ogre/code_generators/physx/python_physx.h" -fxml="/home/andy/development/python-ogre/code_generators/cache/physx_2.7.2_cache.xml" - -INFO Parsing xml file "/home/andy/development/python-ogre/code_generators/cache/physx_2.7.2_cache.xml" ... -Excluding static const NX_NO_HIGH_LIMIT [variable] -Excluding static const NX_NO_LOW_LIMIT [variable] -Excluding static const NxInvPiF32 [variable] -Excluding static const NxTwoPiF32 [variable] -Excluding static const NxHalfPiF32 [variable] -Excluding static const NxPiF32 [variable] -Excluding static const NxInvPiF64 [variable] -Excluding static const NxTwoPiF64 [variable] -Excluding static const NxHalfPiF64 [variable] -Excluding static const NxPiF64 [variable] -excluded NxForceFieldShapeDesc::type [variable] protected -excluded NxContactStreamIterator::pointNormalForce [variable] protected -excluded NxContactStreamIterator::stream [variable] protected... [truncated message content] |