aseprite/src/ui/popup_window.h

50 lines
1.1 KiB
C
Raw Normal View History

// Aseprite UI Library
2013-01-27 12:13:13 -03:00
// Copyright (C) 2001-2013 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
2010-03-07 16:10:48 -02:00
2012-07-08 23:24:42 -03:00
#ifndef UI_POPUP_WINDOW_H_INCLUDED
#define UI_POPUP_WINDOW_H_INCLUDED
2014-03-29 19:40:17 -03:00
#pragma once
2010-03-07 16:10:48 -02:00
2012-07-08 23:24:42 -03:00
#include "ui/window.h"
2010-03-07 16:10:48 -02:00
namespace ui {
2012-07-08 23:24:42 -03:00
class PopupWindow : public Window
{
public:
enum ClickBehavior {
kDoNothingOnClick,
kCloseOnClickInOtherWindow,
kCloseOnClickOutsideHotRegion
};
PopupWindow(const std::string& text, ClickBehavior clickBehavior);
2012-07-08 23:24:42 -03:00
~PopupWindow();
void setHotRegion(const gfx::Region& region);
void makeFloating();
void makeFixed();
protected:
bool onProcessMessage(Message* msg) override;
void onPreferredSize(PreferredSizeEvent& ev) override;
void onPaint(PaintEvent& ev) override;
void onInitTheme(InitThemeEvent& ev) override;
private:
void startFilteringMessages();
void stopFilteringMessages();
ClickBehavior m_clickBehavior;
gfx::Region m_hotRegion;
bool m_filtering;
};
} // namespace ui
2010-03-07 16:10:48 -02:00
#endif