llscrollingpanelparam.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * @file llscrollingpanelparam.h
  3. * @brief the scrolling panel containing a list of visual param
  4. * panels
  5. *
  6. * $LicenseInfo:firstyear=2002&license=viewergpl$
  7. *
  8. * Copyright (c) 2002-2009, Linden Research, Inc.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #ifndef LL_SCROLLINGPANELPARAM_H
  34. #define LL_SCROLLINGPANELPARAM_H
  35. #include "llbutton.h"
  36. #include "llscrollingpanellist.h"
  37. #include "llsliderctrl.h"
  38. #include "lltextbox.h"
  39. class LLJoint;
  40. class LLPanelEditWearable;
  41. class LLViewerJointMesh;
  42. class LLVisualParamHint;
  43. class LLViewerVisualParam;
  44. class LLWearable;
  45. class LLScrollingPanelParam : public LLScrollingPanel
  46. {
  47. protected:
  48. LOG_CLASS(LLScrollingPanelParam);
  49. public:
  50. LLScrollingPanelParam(LLPanelEditWearable* panel,
  51. LLViewerJointMesh* mesh,
  52. LLViewerVisualParam* param,
  53. bool allow_modify,
  54. LLWearable* wearable,
  55. LLJoint* jointp,
  56. bool use_hints = true);
  57. virtual ~LLScrollingPanelParam();
  58. virtual void draw();
  59. virtual void setVisible(bool visible);
  60. virtual void updatePanel(bool allow_modify);
  61. static void onSliderMouseDown(LLUICtrl* ctrl, void* userdata);
  62. static void onSliderMoved(LLUICtrl* ctrl, void* userdata);
  63. static void onSliderMouseUp(LLUICtrl* ctrl, void* userdata);
  64. static void onHintMinMouseDown(void* userdata);
  65. static void onHintMinHeldDown(void* userdata);
  66. static void onHintMaxMouseDown(void* userdata);
  67. static void onHintMaxHeldDown(void* userdata);
  68. static void onHintMinMouseUp(void* userdata);
  69. static void onHintMaxMouseUp(void* userdata);
  70. void onHintMouseDown(LLVisualParamHint* hint);
  71. void onHintHeldDown(LLVisualParamHint* hint);
  72. F32 weightToPercent(F32 weight);
  73. F32 percentToWeight(F32 percent);
  74. public:
  75. LLPanelEditWearable* mPanelParams;
  76. LLWearable* mWearable;
  77. LLViewerVisualParam* mParam;
  78. LLPointer<LLVisualParamHint> mHintMin;
  79. LLPointer<LLVisualParamHint> mHintMax;
  80. LLButton* mLess;
  81. LLButton* mMore;
  82. LLSliderCtrl* mSlider;
  83. LLTextBox* mMinParamText;
  84. LLTextBox* mMaxParamText;
  85. static S32 sUpdateDelayFrames;
  86. protected:
  87. LLTimer mMouseDownTimer; // timer for how long mouse has been held down on a hint.
  88. F32 mLastHeldTime;
  89. bool mAllowModify;
  90. };
  91. #endif