ResizeView.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * Ted Stodgell <kart@hal-pc.org>
  24. */
  25. #ifndef _RESIZEVIEW_H
  26. #define _RESIZEVIEW_H
  27. #include <View.h>
  28. #include <Cursor.h>
  29. // horizontal resize cursor taken from OpenTracker, see www.opentracker.org for license
  30. const unsigned char kHorizontalResizeCursor[] = {
  31. 16, 1, 7, 7,
  32. 0, 0, 1, 0, 1, 0, 1, 0, 9, 32, 25, 48, 57, 56, 121, 60,
  33. 57, 56, 25, 48, 9, 32, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0,
  34. 3, 128, 3, 128, 3, 128, 15, 224, 31, 240, 63, 248, 127, 252, 255, 254,
  35. 127, 252, 63, 248, 31, 240, 15, 224, 3, 128, 3, 128, 3, 128, 0, 0
  36. };
  37. class ResizeView : public BView
  38. {
  39. public:
  40. ResizeView (BView *, BRect, const char * = "resizeView", uint32 = B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, uint32 = 0);
  41. virtual ~ResizeView (void);
  42. virtual void MouseDown(BPoint);
  43. virtual void MouseMoved (BPoint, uint32, const BMessage *);
  44. virtual void MouseUp (BPoint);
  45. private:
  46. bool mousePressed;
  47. BView *attachedView;
  48. BCursor cursor;
  49. };
  50. #endif // _RESIZEVIEW_H