MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
scrollpanel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
3  *
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
7  * License.
8  *
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.
13  *
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
17  * 02110-1301 USA
18  */
19 #ifndef _MFORMS_SCROLLPANEL_H_
20 #define _MFORMS_SCROLLPANEL_H_
21 
22 #include <mforms/panel.h>
23 
24 namespace mforms {
25  class ScrollPanel;
26 
31  };
32 
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 #ifndef SWIG
35  struct MFORMS_EXPORT ScrollPanelImplPtrs
36  {
37  bool (*create)(ScrollPanel*, ScrollPanelFlags flags);
38 
39  void (*add)(ScrollPanel*, View*);
40  void (*remove)(ScrollPanel*);
41 
42  void (*set_visible_scrollers)(ScrollPanel*, bool vertical, bool horizontal);
43  void (*set_autohide_scrollers)(ScrollPanel*, bool flag);
44  void (*scroll_to_view)(ScrollPanel*, View*);
45 
46  base::Rect (*get_content_rect)(ScrollPanel*); //TODO: Windows, Linux
47  void (*scroll_to)(ScrollPanel*, int x, int y);
48  };
49 #endif
50 #endif
51 
57  {
58  public:
66  ~ScrollPanel();
67 
71  void set_visible_scrollers(bool vertical, bool horizontal);
72 
75  void set_autohide_scrollers(bool flag);
76 
78  void add(View *child);
80  void remove();
81 
82  /* Tries to scroll to given child. In other words to make sure child is visible. */
83  void scroll_to_view(View* child);
84 
85  base::Rect get_content_rect();
86 
87  /* Scroll to the given x, y.*/
88  void scroll_to(int x, int y);
89 
90  protected:
91  ScrollPanelImplPtrs *_spanel_impl;
92  };
93 };
94 
95 #endif /* _MFORMS_SCROLLPANEL_H_ */
ScrollPanelFlags
Definition: scrollpanel.h:27
ScrollPanelImplPtrs * _spanel_impl
Definition: scrollpanel.h:91
#define MFORMS_EXPORT
Definition: base.h:33
A container panel with scrollbars.
Definition: scrollpanel.h:56
Intermediate class used to collectively check for containers and later maybe implement special contai...
Definition: container.h:31
MySQL Workbench 6.1 documentation