1/* 2 * Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5#ifndef WIDGET_LAYOUT_TEST_TWO_DIMENSIONAL_SLIDER_VIEW_H 6#define WIDGET_LAYOUT_TEST_TWO_DIMENSIONAL_SLIDER_VIEW_H 7 8 9#include <Invoker.h> 10 11#include "View.h" 12 13 14class TwoDimensionalSliderView : public View, public BInvoker { 15public: 16 TwoDimensionalSliderView( 17 BMessage* message = NULL, 18 BMessenger target = BMessenger()); 19 20 void SetLocationRange(BPoint minLocation, 21 BPoint maxLocation); 22 23 BPoint MinLocation() const; 24 BPoint MaxLocation() const; 25 26 BPoint Value() const; 27 void SetValue(BPoint value); 28 29 virtual void MouseDown(BPoint where, uint32 buttons, 30 int32 modifiers); 31 virtual void MouseUp(BPoint where, uint32 buttons, 32 int32 modifiers); 33 virtual void MouseMoved(BPoint where, uint32 buttons, 34 int32 modifiers); 35 36private: 37 BPoint fMinLocation; 38 BPoint fMaxLocation; 39 bool fDragging; 40 BPoint fOriginalPoint; 41 BPoint fOriginalLocation; 42}; 43 44#endif // WIDGET_LAYOUT_TEST_TWO_DIMENSIONAL_SLIDER_VIEW_H 45