2014-03-11 04:27:18 +04:00
|
|
|
/*
|
2015-03-12 00:17:16 +03:00
|
|
|
* Copyright 2015 Haiku, Inc. All rights reserved.
|
2014-03-11 04:27:18 +04:00
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* John Scipione, jscipione@gmail.com
|
|
|
|
*/
|
2015-03-12 00:17:16 +03:00
|
|
|
#ifndef _SPINNER_H
|
|
|
|
#define _SPINNER_H
|
2014-03-11 04:27:18 +04:00
|
|
|
|
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
#include <AbstractSpinner.h>
|
2014-03-11 04:27:18 +04:00
|
|
|
|
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
class BSpinner : public BAbstractSpinner {
|
2014-03-11 04:27:18 +04:00
|
|
|
public:
|
|
|
|
BSpinner(BRect frame, const char* name,
|
|
|
|
const char* label, BMessage* message,
|
|
|
|
uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
|
|
|
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
|
|
|
BSpinner(const char* name, const char* label,
|
|
|
|
BMessage* message,
|
|
|
|
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
|
|
|
BSpinner(BMessage* data);
|
|
|
|
virtual ~BSpinner();
|
|
|
|
|
|
|
|
static BArchivable* Instantiate(BMessage* data);
|
|
|
|
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
|
|
|
|
2015-03-11 02:23:43 +03:00
|
|
|
virtual void Increment();
|
2015-03-12 00:17:16 +03:00
|
|
|
virtual void Decrement();
|
2014-03-11 04:27:18 +04:00
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
virtual status_t GetSupportedSuites(BMessage* message);
|
2014-03-11 04:27:18 +04:00
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
virtual void AttachedToWindow();
|
2014-03-11 04:27:18 +04:00
|
|
|
|
|
|
|
virtual void SetEnabled(bool enable);
|
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
int32 MinValue() const { return fMinValue; }
|
|
|
|
virtual void SetMinValue(int32 min);
|
2014-03-11 04:27:18 +04:00
|
|
|
|
2017-01-13 00:42:23 +03:00
|
|
|
int32 MaxValue() const { return fMaxValue; }
|
|
|
|
virtual void SetMaxValue(int32 max);
|
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
void Range(int32* min, int32* max);
|
|
|
|
virtual void SetRange(int32 min, int32 max);
|
2014-03-11 04:27:18 +04:00
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
int32 Value() const { return fValue; };
|
|
|
|
virtual void SetValue(int32 value);
|
|
|
|
virtual void SetValueFromText();
|
2014-03-11 04:27:18 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// FBC padding
|
|
|
|
virtual void _ReservedSpinner20();
|
|
|
|
virtual void _ReservedSpinner19();
|
|
|
|
virtual void _ReservedSpinner18();
|
|
|
|
virtual void _ReservedSpinner17();
|
|
|
|
virtual void _ReservedSpinner16();
|
|
|
|
virtual void _ReservedSpinner15();
|
|
|
|
virtual void _ReservedSpinner14();
|
|
|
|
virtual void _ReservedSpinner13();
|
|
|
|
virtual void _ReservedSpinner12();
|
|
|
|
virtual void _ReservedSpinner11();
|
|
|
|
virtual void _ReservedSpinner10();
|
|
|
|
virtual void _ReservedSpinner9();
|
|
|
|
virtual void _ReservedSpinner8();
|
|
|
|
virtual void _ReservedSpinner7();
|
|
|
|
virtual void _ReservedSpinner6();
|
|
|
|
virtual void _ReservedSpinner5();
|
|
|
|
virtual void _ReservedSpinner4();
|
|
|
|
virtual void _ReservedSpinner3();
|
|
|
|
virtual void _ReservedSpinner2();
|
|
|
|
virtual void _ReservedSpinner1();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void _InitObject();
|
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
int32 fMinValue;
|
|
|
|
int32 fMaxValue;
|
|
|
|
int32 fValue;
|
2014-03-11 04:27:18 +04:00
|
|
|
|
|
|
|
// FBC padding
|
|
|
|
uint32 _reserved[20];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-03-12 00:17:16 +03:00
|
|
|
#endif // _SPINNER_H
|