From 4e08461f8ad23fb75ca8587c781c2cf65351b1ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 7 Feb 2012 19:29:10 -0800 Subject: EXP-1181 WIP as a designer I would like to specify default floater positions using realtive coordinates changed over to new convert() method added LLCoordFloater --- indra/llui/llfloater.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 1eb8c964f9..a7cc9ae961 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -82,9 +82,37 @@ namespace LLInitParam }; } -struct LL_COORD_FLOATER; +struct LL_COORD_FLOATER +{ + typedef F32 value_t; + + LLCoordCommon convertToCommon() const; + void convertFromCommon(const LLCoordCommon& from); +protected: + LLHandle mFloater; +}; + +struct LLCoordFloater : LLCoord +{ + typedef LLCoord coord_t; -typedef LLCoord LLCoordFloater; + LLCoordFloater() {} + LLCoordFloater(F32 x, F32 y, LLFloater& floater); + LLCoordFloater(const LLCoordCommon& other, LLFloater& floater); + + LLCoordFloater& operator=(const LLCoordCommon& other) + { + convertFromCommon(other); + return *this; + } + + LLCoordFloater& operator=(const LLCoordFloater& other); + + bool operator==(const LLCoordFloater& other) const; + bool operator!=(const LLCoordFloater& other) const { return !(*this == other); } + + void setFloater(LLFloater& floater); +}; class LLFloater : public LLPanel, public LLInstanceTracker { @@ -187,7 +215,7 @@ public: bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL); /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); - /*virtual*/ BOOL canSnapTo(const LLView* other_view); + /*virtual*/ BOOL canSnapTo(const LLView* other_view); /*virtual*/ void setSnappedTo(const LLView* snap_view); /*virtual*/ void setFocus( BOOL b ); /*virtual*/ void setIsChrome(BOOL is_chrome); @@ -428,6 +456,7 @@ private: LLFloaterEnums::EOpenPositioning mOpenPositioning; S32 mSpecifiedLeft; S32 mSpecifiedBottom; + LLCoordFloater mPosition; S32 mMinWidth; S32 mMinHeight; -- cgit v1.2.3