forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
int_entry.h
51 lines (39 loc) · 1.02 KB
/
int_entry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Aseprite UI Library
// Copyright (C) 2001-2013, 2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef UI_INT_ENTRY_H_INCLUDED
#define UI_INT_ENTRY_H_INCLUDED
#pragma once
#include "ui/entry.h"
#include "ui/slider.h"
namespace ui {
class CloseEvent;
class PopupWindow;
class IntEntry : public Entry {
public:
IntEntry(int min, int max, SliderDelegate* sliderDelegate = nullptr);
~IntEntry();
int getValue() const;
void setValue(int value);
protected:
bool onProcessMessage(Message* msg) override;
void onSizeHint(SizeHintEvent& ev) override;
void onChange() override;
// New events
virtual void onValueChange();
private:
void openPopup();
void closePopup();
void onChangeSlider();
void onPopupClose(CloseEvent& ev);
void removeSlider();
int m_min;
int m_max;
Slider m_slider;
PopupWindow* m_popupWindow;
bool m_changeFromSlider;
};
} // namespace ui
#endif