MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mforms::Box Class Reference

Places child views sequentially in a vertical or horizontal layout. More...

#include <box.h>

Inheritance diagram for mforms::Box:
mforms::Container mforms::View mforms::AppView mforms::FsObjectSelector mforms::SectionBox

Public Member Functions

 Box (bool horiz)
 Constructor. More...
 
void add (View *subview, bool expand, bool fill=false)
 Adds a child view, from left to right or top to bottom. More...
 
void add_end (View *subview, bool expand, bool fill=false)
 Adds a child view, from right to left or bottom to top. More...
 
virtual void remove (View *subview)
 Remove a subview. More...
 
void set_homogeneous (bool flag)
 Sets whether all child views should have the same space. More...
 
void set_spacing (int space)
 Sets spacing between child items. More...
 
bool is_horizontal ()
 Returns the orientation of the box. More...
 
- Public Member Functions inherited from mforms::Container
 Container ()
 
virtual void set_padding (int left, int top, int right, int bottom)
 
void set_padding (int padding)
 
virtual void set_back_image (const std::string &path, Alignment alignment)
 
- Public Member Functions inherited from mforms::View
virtual ~View ()
 
virtual void set_managed ()
 
Viewfind_subview (const std::string &name)
 
bool contains_subview (View *subview)
 
void clear_subviews ()
 
void set_name (const std::string &name)
 
void set_tooltip (const std::string &text)
 
void set_font (const std::string &fontDescription)
 
std::string get_name ()
 
void set_parent (View *parent)
 
Viewget_parent () const
 
Formget_parent_form () const
 
virtual int get_width ()
 
virtual int get_height ()
 
virtual int get_preferred_width ()
 
virtual int get_preferred_height ()
 
virtual int get_x ()
 
virtual int get_y ()
 
virtual void set_position (int x, int y)
 
virtual void set_size (int width, int height)
 
std::pair< int, int > client_to_screen (int x, int y)
 
std::pair< int, int > screen_to_client (int x, int y)
 
void show (bool flag=true)
 Show/hide view. More...
 
bool is_shown ()
 Check whenever view is visible. More...
 
bool is_fully_visible ()
 Returns true if the view and all it's parents are visible. More...
 
void set_enabled (bool flag)
 Enable view so user can interact with it. More...
 
bool is_enabled ()
 Check whenever view is enabled. More...
 
void set_needs_repaint ()
 Mark view to be repainted with next iteration. More...
 
virtual void relayout ()
 
virtual void set_layout_dirty (bool value)
 
virtual bool is_layout_dirty ()
 
void suspend_layout ()
 Freeze gui updates for this view. More...
 
void resume_layout ()
 Resume gui updates for this view. More...
 
void set_front_color (const std::string &color)
 Set view foreground color. More...
 
std::string get_front_color ()
 Get view foreground color. More...
 
void set_back_color (const std::string &color)
 Set view background color. More...
 
std::string get_back_color ()
 Get view background color. More...
 
virtual std::string get_string_value ()
 Get string value from the view if it's holding some. More...
 
virtual int get_int_value ()
 Get int value from the view if it's holding some. More...
 
virtual bool get_bool_value ()
 Get bool value from the view if it's holding some. More...
 
virtual void flush_events ()
 Iterate over all events that were queuedand flush them, results in faster gui updates or faster signal calls. More...
 
virtual void focus ()
 Causes view to have keyboard focus. More...
 
void register_drop_formats (DropDelegate *target, const std::vector< std::string > &drop_formats)
 Enables or disables the ability to accept a drag/drop operation (internal or from outside) based on drop_formats. More...
 
DragOperation do_drag_drop (DragDetails details, const std::string &text)
 Starts an internal drag/drop operation with the given text/data and blocks until that op is finished. More...
 
DragOperation do_drag_drop (DragDetails details, void *data, const std::string &format)
 
void focus_changed ()
 
virtual void resize ()
 Triggered by the platform layers when the size of the view changes. More...
 
boost::signals2::signal< void()> * signal_resized ()
 

Protected Attributes

BoxImplPtrs * _box_impl
 
bool _is_horizontal
 
- Protected Attributes inherited from mforms::View
ViewImplPtrs * _view_impl
 
View_parent
 
std::vector< std::pair< View
*, bool > > 
_subviews
 

Additional Inherited Members

- Protected Member Functions inherited from mforms::View
 View ()
 
void cache_view (View *sv)
 
virtual void remove_from_cache (View *sv)
 
int get_subview_index (View *sv)
 
Viewget_subview_at_index (int index)
 

Detailed Description

Places child views sequentially in a vertical or horizontal layout.

The container will use all available space in its parent and layout child views so that their minimal sizes are respected. If there is leftover space in the Box, it will be evenly distributed among child views that are marked to expand.

Definition at line 50 of file box.h.

Constructor & Destructor Documentation

mforms::Box::Box ( bool  horiz)

Constructor.

Parameters
horiz- true to place child views from left to right. false to place them from top to bottom.

Member Function Documentation

void mforms::Box::add ( View subview,
bool  expand,
bool  fill = false 
)

Adds a child view, from left to right or top to bottom.

Parameters
subview- subview to be added
expand- whether the subview should expand to use leftover space in the box
fill- whether the subview should be resized to fill all allocated space or use only its minimum required size. If not set then the subview is centered within the computed space (vertically in horizontal layout, horizontally in vertical layout).
void mforms::Box::add_end ( View subview,
bool  expand,
bool  fill = false 
)

Adds a child view, from right to left or bottom to top.

Parameters
subview- subview to be added
expand- whether the subview should expand to use leftover space in the box
fill- whether the subview should be resized to fill all allocated space or use only its minimum required size. Only makes sense if the target size is larger than the preferred view size (if set to expand, homogeneous mode enabled).
bool mforms::Box::is_horizontal ( )

Returns the orientation of the box.

virtual void mforms::Box::remove ( View subview)
virtual

Remove a subview.

void mforms::Box::set_homogeneous ( bool  flag)

Sets whether all child views should have the same space.

void mforms::Box::set_spacing ( int  space)

Sets spacing between child items.

Member Data Documentation

BoxImplPtrs* mforms::Box::_box_impl
protected

Definition at line 91 of file box.h.

bool mforms::Box::_is_horizontal
protected

Definition at line 92 of file box.h.


The documentation for this class was generated from the following file:
MySQL Workbench 6.1 documentation