2013-08-09 08:01:20 +08:00
|
|
|
// Aseprite UI Library
|
2013-03-31 00:11:35 +08:00
|
|
|
// Copyright (C) 2001-2013 David Capello
|
|
|
|
//
|
2014-03-30 07:08:05 +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"
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
2014-03-09 07:31:55 +08:00
|
|
|
class CloseEvent;
|
2013-03-31 00:11:35 +08:00
|
|
|
class PopupWindow;
|
|
|
|
class Slider;
|
|
|
|
|
2014-03-09 07:31:55 +08:00
|
|
|
class IntEntry : public Entry {
|
2013-03-31 00:11:35 +08:00
|
|
|
public:
|
|
|
|
IntEntry(int min, int max);
|
|
|
|
~IntEntry();
|
|
|
|
|
|
|
|
int getValue() const;
|
|
|
|
void setValue(int value);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool onProcessMessage(Message* msg) OVERRIDE;
|
|
|
|
void onEntryChange() OVERRIDE;
|
|
|
|
|
|
|
|
// New events
|
|
|
|
virtual void onValueChange();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void openPopup();
|
|
|
|
void closePopup();
|
|
|
|
void onChangeSlider();
|
2014-03-09 07:31:55 +08:00
|
|
|
void onPopupClose(CloseEvent& ev);
|
2013-03-31 00:11:35 +08:00
|
|
|
|
|
|
|
int m_min;
|
|
|
|
int m_max;
|
|
|
|
PopupWindow* m_popupWindow;
|
|
|
|
Slider* m_slider;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
|
|
|
#endif
|