llmodaldialog.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLMODALDIALOG_H
00033 #define LL_LLMODALDIALOG_H
00034 
00035 #include "llfloater.h"
00036 #include "llframetimer.h"
00037 
00038 class LLModalDialog;
00039 
00040 // By default, a ModalDialog is modal, i.e. no other window can have focus
00041 // However, for the sake of code reuse and simplicity, if mModal == false,
00042 // the dialog behaves like a normal floater
00043 // https://wiki.lindenlab.com/mediawiki/index.php?title=LLModalDialog&oldid=81385
00044 class LLModalDialog : public LLFloater
00045 {
00046 public:
00047         LLModalDialog( const LLString& title, S32 width, S32 height, BOOL modal = true );
00048         /*virtual*/ ~LLModalDialog();
00049 
00050         /*virtual*/ void        open(); /* Flawfinder: ignore */
00051         
00052         /*virtual*/ void        reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
00053         
00054         /*virtual*/ void        startModal();
00055         /*virtual*/ void        stopModal();
00056 
00057         /*virtual*/ BOOL        handleMouseDown(S32 x, S32 y, MASK mask);
00058         /*virtual*/ BOOL        handleMouseUp(S32 x, S32 y, MASK mask);
00059         /*virtual*/ BOOL        handleHover(S32 x, S32 y, MASK mask);
00060         /*virtual*/ BOOL        handleScrollWheel(S32 x, S32 y, S32 clicks);
00061         /*virtual*/ BOOL        handleDoubleClick(S32 x, S32 y, MASK mask);
00062         /*virtual*/ BOOL        handleRightMouseDown(S32 x, S32 y, MASK mask);
00063         /*virtual*/ BOOL        handleKeyHere(KEY key, MASK mask );
00064 
00065         /*virtual*/ void        onClose(bool app_quitting);
00066 
00067         /*virtual*/ void        setVisible(BOOL visible);
00068         /*virtual*/ void        draw();
00069 
00070         BOOL isModal() const { return mModal; }
00071 
00072         static void             onAppFocusLost();
00073         static void             onAppFocusGained();
00074 
00075         static S32              activeCount() { return sModalStack.size(); }
00076         
00077 protected:
00078         void                    centerOnScreen();
00079 
00080 private:
00081         LLFrameTimer    mVisibleTime;
00082         const BOOL              mModal;
00083 
00084         static std::list<LLModalDialog*> sModalStack;  // Top of stack is currently being displayed
00085 };
00086 
00087 #endif  // LL_LLMODALDIALOG_H

Generated on Fri May 16 08:32:54 2008 for SecondLife by  doxygen 1.5.5