102be5353SAxel Dörfler /* 202be5353SAxel Dörfler Open Tracker License 302be5353SAxel Dörfler 402be5353SAxel Dörfler Terms and Conditions 502be5353SAxel Dörfler 602be5353SAxel Dörfler Copyright (c) 1991-2000, Be Incorporated. All rights reserved. 702be5353SAxel Dörfler 802be5353SAxel Dörfler Permission is hereby granted, free of charge, to any person obtaining a copy of 902be5353SAxel Dörfler this software and associated documentation files (the "Software"), to deal in 1002be5353SAxel Dörfler the Software without restriction, including without limitation the rights to 1102be5353SAxel Dörfler use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 1202be5353SAxel Dörfler of the Software, and to permit persons to whom the Software is furnished to do 1302be5353SAxel Dörfler so, subject to the following conditions: 1402be5353SAxel Dörfler 1502be5353SAxel Dörfler The above copyright notice and this permission notice applies to all licensees 1602be5353SAxel Dörfler and shall be included in all copies or substantial portions of the Software. 1702be5353SAxel Dörfler 1802be5353SAxel Dörfler THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1902be5353SAxel Dörfler IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, 2002be5353SAxel Dörfler FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 2102be5353SAxel Dörfler BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 2202be5353SAxel Dörfler AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION 2302be5353SAxel Dörfler WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2402be5353SAxel Dörfler 2502be5353SAxel Dörfler Except as contained in this notice, the name of Be Incorporated shall not be 2602be5353SAxel Dörfler used in advertising or otherwise to promote the sale, use or other dealings in 2702be5353SAxel Dörfler this Software without prior written authorization from Be Incorporated. 2802be5353SAxel Dörfler 2902be5353SAxel Dörfler Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks 3002be5353SAxel Dörfler of Be Incorporated in the United States and other countries. Other brand product 3102be5353SAxel Dörfler names are registered trademarks or trademarks of their respective holders. 3202be5353SAxel Dörfler All rights reserved. 3302be5353SAxel Dörfler */ 344242cbe2SJohn Scipione #ifndef _DIALOG_PANE_H 354242cbe2SJohn Scipione #define _DIALOG_PANE_H 3602be5353SAxel Dörfler 37b05aa8b5SJohn Scipione 3802be5353SAxel Dörfler #include <Control.h> 394242cbe2SJohn Scipione #include <ObjectList.h> 4002be5353SAxel Dörfler 41b05aa8b5SJohn Scipione 4202be5353SAxel Dörfler namespace BPrivate { 4302be5353SAxel Dörfler 4402be5353SAxel Dörfler class PaneSwitch : public BControl { 4502be5353SAxel Dörfler public: 463e3d7acbSStephan Aßmus PaneSwitch(BRect frame, const char* name, 473e3d7acbSStephan Aßmus bool leftAligned = true, 483e3d7acbSStephan Aßmus uint32 resizeMask 493e3d7acbSStephan Aßmus = B_FOLLOW_LEFT | B_FOLLOW_TOP, 5002be5353SAxel Dörfler uint32 flags = B_WILL_DRAW | B_NAVIGABLE); 5102be5353SAxel Dörfler 523e3d7acbSStephan Aßmus PaneSwitch(const char* name, 533e3d7acbSStephan Aßmus bool leftAligned = true, 543e3d7acbSStephan Aßmus uint32 flags = B_WILL_DRAW | B_NAVIGABLE); 5502be5353SAxel Dörfler 563e3d7acbSStephan Aßmus virtual ~PaneSwitch(); 573e3d7acbSStephan Aßmus 583e3d7acbSStephan Aßmus virtual void Draw(BRect updateRect); 593e3d7acbSStephan Aßmus virtual void MouseDown(BPoint where); 60*20f2ebaeSAdrien Destugues virtual void MouseMoved(BPoint where, uint32 code, const BMessage*); 61*20f2ebaeSAdrien Destugues virtual void MouseUp(BPoint where); 623e3d7acbSStephan Aßmus 633e3d7acbSStephan Aßmus virtual void GetPreferredSize(float* _width, 643e3d7acbSStephan Aßmus float* _height); 653e3d7acbSStephan Aßmus 663e3d7acbSStephan Aßmus virtual BSize MinSize(); 673e3d7acbSStephan Aßmus virtual BSize MaxSize(); 683e3d7acbSStephan Aßmus virtual BSize PreferredSize(); 693e3d7acbSStephan Aßmus 703e3d7acbSStephan Aßmus void SetLabels(const char* labelOn, 713e3d7acbSStephan Aßmus const char* labelOff); 723e3d7acbSStephan Aßmus 733e3d7acbSStephan Aßmus protected: 7402be5353SAxel Dörfler enum State { 7502be5353SAxel Dörfler kCollapsed, 7602be5353SAxel Dörfler kPressed, 7702be5353SAxel Dörfler kExpanded 7802be5353SAxel Dörfler }; 7902be5353SAxel Dörfler 8002be5353SAxel Dörfler virtual void DrawInState(PaneSwitch::State state); 8102be5353SAxel Dörfler 823e3d7acbSStephan Aßmus private: 8302be5353SAxel Dörfler bool fLeftAligned; 8402be5353SAxel Dörfler bool fPressing; 853e3d7acbSStephan Aßmus 863e3d7acbSStephan Aßmus char* fLabelOn; 873e3d7acbSStephan Aßmus char* fLabelOff; 8802be5353SAxel Dörfler }; 8902be5353SAxel Dörfler 9002be5353SAxel Dörfler } // namespace BPrivate 9102be5353SAxel Dörfler 9202be5353SAxel Dörfler using namespace BPrivate; 9302be5353SAxel Dörfler 944242cbe2SJohn Scipione 954242cbe2SJohn Scipione #endif // _DIALOG_PANE_H 96