2
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
#ifndef _MFORMS_POPUP_H_
21
#define _MFORMS_POPUP_H_
23
#include <mforms/base.h>
24
#include <mforms/view.h>
26
#include "cairo/cairo.h"
27
#include "base/geometry.h"
30
* This class implements a popup window class which can be used for context menus or drop down menus.
31
* A popup is always a modal window and cannot be used to embed other controls nor can itself be embedded.
37
PopupPlain, // A simple popup window, similar to context menus.
38
PopupBezel, // A semi-transparent black window with rounded corners and a white border.
43
#ifndef DOXYGEN_SHOULD_SKIP_THIS
47
bool (__stdcall *create)(Popup *, PopupStyle);
48
void (__stdcall *set_needs_repaint)(Popup *);
49
void (__stdcall *set_size)(Popup *, int, int);
50
int (__stdcall *show)(Popup *, int, int);
51
MySQL::Geometry::Rect (__stdcall *get_content_rect)(Popup *);
52
void (__stdcall *set_modal_result)(Popup *, int result);
57
class MFORMS_EXPORT Popup : public Object
60
Popup(PopupStyle style);
62
void set_needs_repaint();
63
void set_size(int width, int height);
64
int show(int spot_x, int spot_y);
65
MySQL::Geometry::Rect get_content_rect();
66
void set_modal_result(int result);
68
#ifndef DOXYGEN_SHOULD_SKIP_THIS
70
virtual void repaint(cairo_t *cr, int x, int y, int w, int h) {}
72
virtual void mouse_down(int button, int x, int y) {}
73
virtual void mouse_up(int button, int x, int y) {}
74
virtual void mouse_click(int button, int x, int y) {}
75
virtual void mouse_double_click(int button, int x, int y) {}
76
virtual void mouse_enter() {}
77
virtual void mouse_leave() {}
78
virtual void mouse_move(int x, int y) {}
82
PopupImplPtrs *_popup_impl;
86
#endif // _MFORMS_POPUP_H_