llfloatercamera.cpp

Go to the documentation of this file.
00001 
00032 #include "llviewerprecompiledheaders.h"
00033 
00034 #include "llfloatercamera.h"
00035 
00036 // Library includes
00037 #include "lluictrlfactory.h"
00038 
00039 // Viewer includes
00040 #include "lljoystickbutton.h"
00041 #include "llviewercontrol.h"
00042 
00043 // Constants
00044 const F32 CAMERA_BUTTON_DELAY = 0.0f;
00045 
00046 //
00047 // Member functions
00048 //
00049 
00050 LLFloaterCamera::LLFloaterCamera(const LLSD& val)
00051 :       LLFloater("camera floater") // uses "FloaterCameraRect3"
00052 {
00053         setIsChrome(TRUE);
00054         
00055         const BOOL DONT_OPEN = FALSE;
00056         LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml", NULL, DONT_OPEN);
00057         
00058         S32 top = getRect().getHeight();
00059         S32 bottom = 0;
00060         S32 left = 16;
00061         
00062         const S32 ROTATE_WIDTH = 64;
00063         mRotate = new LLJoystickCameraRotate("cam rotate stick", 
00064                                                                                  LLRect( left, top, left + ROTATE_WIDTH, bottom ),
00065                                                                                  "cam_rotate_out.tga",
00066                                                                                  "cam_rotate_in.tga" );
00067         mRotate->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
00068         mRotate->setHeldDownDelay(CAMERA_BUTTON_DELAY);
00069         mRotate->setToolTip( getString("rotate_tooltip") );
00070         mRotate->setSoundFlags(MOUSE_DOWN | MOUSE_UP);
00071         addChild(mRotate);
00072         
00073         left += ROTATE_WIDTH;
00074         
00075         const S32 ZOOM_WIDTH = 16;
00076         mZoom = new LLJoystickCameraZoom( 
00077                                                                          "zoom",
00078                                                                          LLRect( left, top, left + ZOOM_WIDTH, bottom ),
00079                                                                          "cam_zoom_out.tga",
00080                                                                          "cam_zoom_plus_in.tga",
00081                                                                          "cam_zoom_minus_in.tga");
00082         mZoom->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
00083         mZoom->setHeldDownDelay(CAMERA_BUTTON_DELAY);
00084         mZoom->setToolTip( getString("zoom_tooltip") );
00085         mZoom->setSoundFlags(MOUSE_DOWN | MOUSE_UP);
00086         addChild(mZoom);
00087         
00088         left += ZOOM_WIDTH;
00089         
00090         const S32 TRACK_WIDTH = 64;
00091         mTrack = new LLJoystickCameraTrack("cam track stick", 
00092                                                                            LLRect( left, top, left + TRACK_WIDTH, bottom ),
00093                                                                            "cam_tracking_out.tga",
00094                                                                            "cam_tracking_in.tga");
00095         mTrack->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
00096         mTrack->setHeldDownDelay(CAMERA_BUTTON_DELAY);
00097         mTrack->setToolTip( getString("move_tooltip") );
00098         mTrack->setSoundFlags(MOUSE_DOWN | MOUSE_UP);
00099         addChild(mTrack);
00100 }
00101 
00102 // virtual
00103 void LLFloaterCamera::onOpen()
00104 {
00105         LLFloater::onOpen();
00106         
00107         gSavedSettings.setBOOL("ShowCameraControls", TRUE);
00108 }
00109 
00110 // virtual
00111 void LLFloaterCamera::onClose(bool app_quitting)
00112 {
00113         LLFloater::onClose(app_quitting);
00114         
00115         if (!app_quitting)
00116         {
00117                 gSavedSettings.setBOOL("ShowCameraControls", FALSE);
00118         }
00119 }

Generated on Fri May 16 08:33:23 2008 for SecondLife by  doxygen 1.5.5