summaryrefslogtreecommitdiff
path: root/indra/llui/llfloater.h
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-11-24 15:16:27 -0800
committerJames Cook <james@lindenlab.com>2009-11-24 15:16:27 -0800
commit5e6fb96b0b93c25a92cf7200fe2e4f5fc82f0fc4 (patch)
tree8a7d0ee1dd99ad6b7b69da9885c8e3a1b63f61f8 /indra/llui/llfloater.h
parent179582a195ae438da918448204aa6a58a45b9a2c (diff)
Expose floater close, etc. button images in XML.
Renamed EFloaterButtons to EFloaterButton Review with Richard pending
Diffstat (limited to 'indra/llui/llfloater.h')
-rw-r--r--indra/llui/llfloater.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 95c8dd84f6..d75629629a 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -97,7 +97,7 @@ public:
|*==========================================================================*/
};
- enum EFloaterButtons
+ enum EFloaterButton
{
BUTTON_CLOSE = 0,
BUTTON_RESTORE,
@@ -128,6 +128,29 @@ public:
can_dock;
Optional<S32> header_height,
legacy_header_height; // HACK see initFromXML()
+
+ // Images for top-right controls
+ Optional<LLUIImage*> close_image,
+ restore_image,
+ minimize_image,
+ tear_off_image,
+ dock_image,
+ undock_image,
+ help_image;
+ Optional<LLUIImage*> close_pressed_image,
+ restore_pressed_image,
+ minimize_pressed_image,
+ tear_off_pressed_image,
+ dock_pressed_image,
+ undock_pressed_image,
+ help_pressed_image;
+ Optional<std::string> close_tooltip,
+ restore_tooltip,
+ minimize_tooltip,
+ tear_off_tooltip,
+ dock_tooltip,
+ undock_tooltip,
+ heap_tooltip;
Optional<CommitCallbackParam> open_callback,
close_callback;
@@ -158,7 +181,7 @@ public:
/*virtual*/ void setIsChrome(BOOL is_chrome);
/*virtual*/ void setRect(const LLRect &rect);
- void initFloater();
+ void initFloater(const Params& p);
void openFloater(const LLSD& key = LLSD());
@@ -308,8 +331,15 @@ private:
void cleanupHandles(); // remove handles to dead floaters
void createMinimizeButton();
void updateButtons();
- void buildButtons();
- BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index);
+ void buildButtons(const Params& p);
+
+ // Images and tooltips are named in the XML, but we want to look them
+ // up by index.
+ static LLUIImage* getButtonImage(const Params& p, EFloaterButton e);
+ static LLUIImage* getButtonPressedImage(const Params& p, EFloaterButton e);
+ static std::string getButtonTooltip(const Params& p, EFloaterButton e);
+
+ BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index);
void addResizeCtrls();
void layoutResizeCtrls();
void enableResizeCtrls(bool enable);
@@ -367,7 +397,7 @@ private:
typedef std::set<LLHandle<LLFloater> >::iterator handle_set_iter_t;
handle_set_t mDependents;
- BOOL mButtonsEnabled[BUTTON_COUNT];
+ bool mButtonsEnabled[BUTTON_COUNT];
LLButton* mButtons[BUTTON_COUNT];
F32 mButtonScale;
BOOL mAutoFocus;
@@ -381,8 +411,6 @@ private:
static LLMultiFloater* sHostp;
static BOOL sQuitting;
- static std::string sButtonActiveImageNames[BUTTON_COUNT];
- static std::string sButtonPressedImageNames[BUTTON_COUNT];
static std::string sButtonNames[BUTTON_COUNT];
static std::string sButtonToolTips[BUTTON_COUNT];
static std::string sButtonToolTipsIndex[BUTTON_COUNT];