fractorium/Source/Fractorium/SpinBox.h

54 lines
1.2 KiB
C
Raw Normal View History

#pragma once
#include "FractoriumPch.h"
/// <summary>
/// SpinBox class.
/// </summary>
/// <summary>
/// A derivation to prevent the spin box from selecting its own text
/// when editing. Also to prevent multiple spin boxes from all having
/// selected text at once.
/// </summary>
class SpinBox : public QSpinBox
{
Q_OBJECT
public:
--User changes -Remove the option --intpalette to format the palette in the xml as ints. If they are not hex formatted, then they should always be float. This option was pointless. -Cleanup some options text for the command line programs. -Allow for dragging around flames in the library tab. This is useful for setting up the order of an animation. -Make the opening of large files in Fractorium much more efficient when not-appending. -Make the opening of large files in all EmberRender and EmberAnimate more efficient. -Better error reporting when opening files. --Bug fixes -Get rid of leftover artifacts that would appear on preview thumbnails when either switching SP/DP or re-rendering previews. -Filename extension was not being appended on Linux when saving as Xml, thus making it impossible to drag that file back in becase drop is filtered on extension. --Code changes -Move GCC compiler spec to C++14. Building with 5.3 now on linux. -Use inline member data initializers. -Make a #define for static for use in Utils.h to make things a little cleaner. -Make various functions able to take arbitrary collections as their parameters rather than just vectors. -Make library collection a list rather than vector. This alleviates the need to re-sync pointers whenever the collection changes. -Subclass QTreeWidget for the library tree. Two new files added for this. -Remove all usage of #ifdef ROW_ONLY_DE in DEOpenCLKernelCreator, it was never used. -Add move constructor and assignment operator to EmberFile. -Add the ability to use a pointer to outside memory in the renderer for the vector of Ember<T>. -Make a lot more functions const where they should be.
2016-04-03 21:55:12 -04:00
explicit SpinBox(QWidget* p = nullptr, int height = 16, int step = 1);
virtual ~SpinBox() { }
void SetValueStealth(int d);
void SetValueStealth(size_t d);
void DoubleClick(bool b);
void DoubleClickZero(int val);
void DoubleClickNonZero(int val);
void SmallStep(int step);
QLineEdit* lineEdit();
public slots:
void onSpinBoxValueChanged(int i);
2015-05-15 21:45:15 -04:00
void OnTimeout();
protected:
bool eventFilter(QObject* o, QEvent* e);
virtual void focusInEvent(QFocusEvent* e);
virtual void focusOutEvent(QFocusEvent* e);
virtual void enterEvent(QEvent* e);
virtual void leaveEvent(QEvent* e);
private:
2015-05-15 21:45:15 -04:00
void StartTimer();
void StopTimer();
bool m_Select;
bool m_DoubleClick;
int m_DoubleClickNonZero;
int m_DoubleClickZero;
int m_Step;
int m_SmallStep;
2015-05-15 21:45:15 -04:00
QPoint m_MouseDownPoint;
QPoint m_MouseMovePoint;
static QTimer s_Timer;
};