StatusView.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * The contents of this file are subject to the Mozilla Public
  3. * License Version 1.1 (the "License"); you may not use this file
  4. * except in compliance with the License. You may obtain a copy of
  5. * the License at http://www.mozilla.org/MPL/
  6. *
  7. * Software distributed under the License is distributed on an "AS
  8. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9. * implied. See the License for the specific language governing
  10. * rights and limitations under the License.
  11. *
  12. * The Original Code is Vision.
  13. *
  14. * The Initial Developer of the Original Code is The Vision Team.
  15. * Portions created by The Vision Team are
  16. * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
  17. * Reserved.
  18. *
  19. * Contributor(s): Wade Majors <wade@ezri.org>
  20. * Rene Gollent
  21. * Todd Lair
  22. * Andrew Bazan
  23. * Jamie Wilkinson
  24. */
  25. #ifndef _STATUSVIEW_H_
  26. #define _STATUSVIEW_H_
  27. #define STATUS_ALIGN_RIGHT 0
  28. #define STATUS_ALIGN_LEFT 1
  29. #define STATUS_HEIGHT 13
  30. #include <View.h>
  31. #include <List.h>
  32. #include <String.h>
  33. class StatusItem;
  34. class StatusView : public BView
  35. {
  36. BList items;
  37. public:
  38. StatusView (BRect);
  39. virtual ~StatusView (void);
  40. void AddItem (StatusItem *, bool);
  41. StatusItem *ItemAt (int32) const;
  42. void SetItemValue (int32, const char *, bool = true);
  43. virtual void Draw (BRect);
  44. virtual void MouseDown (BPoint);
  45. void Clear (void);
  46. protected:
  47. void DrawSplit (float);
  48. };
  49. class StatusItem
  50. {
  51. public:
  52. StatusItem (const char *,
  53. const char *,
  54. int32 = STATUS_ALIGN_RIGHT);
  55. virtual ~StatusItem (void);
  56. void GeneratePopUp(BPoint, BRect);
  57. private:
  58. BString label,
  59. value;
  60. BRect frame;
  61. int32 alignment;
  62. friend class StatusView;
  63. };
  64. #endif