aseprite/src/ui/int_entry.h

52 lines
1.0 KiB
C
Raw Normal View History

// Aseprite UI Library
// Copyright (C) 2001-2013, 2015 David Capello
2013-03-31 00:11:35 +08:00
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
2013-03-31 00:11:35 +08:00
#ifndef UI_INT_ENTRY_H_INCLUDED
#define UI_INT_ENTRY_H_INCLUDED
2014-03-30 06:40:17 +08:00
#pragma once
2013-03-31 00:11:35 +08:00
#include "ui/entry.h"
#include "ui/slider.h"
2013-03-31 00:11:35 +08:00
namespace ui {
class CloseEvent;
2013-03-31 00:11:35 +08:00
class PopupWindow;
class IntEntry : public Entry {
2013-03-31 00:11:35 +08:00
public:
IntEntry(int min, int max, SliderDelegate* sliderDelegate = nullptr);
2013-03-31 00:11:35 +08:00
~IntEntry();
int getValue() const;
void setValue(int value);
protected:
bool onProcessMessage(Message* msg) override;
2015-12-04 08:50:05 +08:00
void onSizeHint(SizeHintEvent& ev) override;
void onChange() override;
2013-03-31 00:11:35 +08:00
// New events
virtual void onValueChange();
private:
void openPopup();
void closePopup();
void onChangeSlider();
void onPopupClose(CloseEvent& ev);
void removeSlider();
2013-03-31 00:11:35 +08:00
int m_min;
int m_max;
Slider m_slider;
2013-03-31 00:11:35 +08:00
PopupWindow* m_popupWindow;
bool m_changeFromSlider;
2013-03-31 00:11:35 +08:00
};
} // namespace ui
#endif