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

#include <view.h>

Inheritance diagram for mforms::View:
mforms::Button mforms::CodeEditor mforms::Container mforms::DrawBox mforms::FileChooser mforms::FindPanel mforms::Form mforms::HyperText mforms::ImageBox mforms::Label mforms::ListBox mforms::NativeContainer mforms::ProgressBar mforms::Selector mforms::TabView mforms::TextBox mforms::TextEntry mforms::TreeNodeView mforms::WebBrowser

Public Member Functions

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 Member Functions

 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)
 
virtual void set_back_image (const std::string &path, Alignment alignment)
 

Protected Attributes

ViewImplPtrs * _view_impl
 
View_parent
 
std::vector< std::pair< View
*, bool > > 
_subviews
 

Private Attributes

std::string _name
 
bool _layout_dirty
 
boost::signals2::signal< void()> _signal_resized
 

Detailed Description

Definition at line 201 of file view.h.

Constructor & Destructor Documentation

mforms::View::View ( )
protected
virtual mforms::View::~View ( )
virtual

Member Function Documentation

void mforms::View::cache_view ( View sv)
protected
void mforms::View::clear_subviews ( )
std::pair<int, int> mforms::View::client_to_screen ( int  x,
int  y 
)
bool mforms::View::contains_subview ( View subview)
DragOperation mforms::View::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.

The result tells the caller what actually happened.

DragOperation mforms::View::do_drag_drop ( DragDetails  details,
void *  data,
const std::string &  format 
)
View* mforms::View::find_subview ( const std::string &  name)
virtual void mforms::View::flush_events ( )
virtual

Iterate over all events that were queuedand flush them, results in faster gui updates or faster signal calls.

Reimplemented in mforms::Form.

virtual void mforms::View::focus ( )
virtual

Causes view to have keyboard focus.

Reimplemented in mforms::FindPanel.

void mforms::View::focus_changed ( )
std::string mforms::View::get_back_color ( )

Get view background color.

virtual bool mforms::View::get_bool_value ( )
inlinevirtual

Get bool value from the view if it's holding some.

Reimplemented in mforms::FsObjectSelector, and mforms::CheckBox.

Definition at line 338 of file view.h.

338 { return false; }
std::string mforms::View::get_front_color ( )

Get view foreground color.

virtual int mforms::View::get_height ( )
virtual
virtual int mforms::View::get_int_value ( )
inlinevirtual

Get int value from the view if it's holding some.

Reimplemented in mforms::FsObjectSelector, and mforms::CheckBox.

Definition at line 333 of file view.h.

333 { return 0; }
std::string mforms::View::get_name ( )
View* mforms::View::get_parent ( ) const
Form* mforms::View::get_parent_form ( ) const
virtual int mforms::View::get_preferred_height ( )
virtual
virtual int mforms::View::get_preferred_width ( )
virtual
virtual std::string mforms::View::get_string_value ( )
inlinevirtual

Get string value from the view if it's holding some.

Reimplemented in mforms::CodeEditor, mforms::TextBox, mforms::ListBox, mforms::Selector, mforms::TextEntry, mforms::FsObjectSelector, and mforms::CheckBox.

Definition at line 328 of file view.h.

328 { return ""; }
View* mforms::View::get_subview_at_index ( int  index)
protected
int mforms::View::get_subview_index ( View sv)
protected
virtual int mforms::View::get_width ( )
virtual
virtual int mforms::View::get_x ( )
virtual
virtual int mforms::View::get_y ( )
virtual
bool mforms::View::is_enabled ( )

Check whenever view is enabled.

bool mforms::View::is_fully_visible ( )

Returns true if the view and all it's parents are visible.

virtual bool mforms::View::is_layout_dirty ( )
virtual
bool mforms::View::is_shown ( )

Check whenever view is visible.

void mforms::View::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.

Parameters
targetspecifies a target that will receive drop events. It can be the same as the view or any other class (even non-visual) that implements this interface.
virtual void mforms::View::relayout ( )
virtual
virtual void mforms::View::remove_from_cache ( View sv)
protectedvirtual
virtual void mforms::View::resize ( )
virtual

Triggered by the platform layers when the size of the view changes.

void mforms::View::resume_layout ( )

Resume gui updates for this view.

Should be called after suspend_layout was called.

std::pair<int, int> mforms::View::screen_to_client ( int  x,
int  y 
)
void mforms::View::set_back_color ( const std::string &  color)

Set view background color.

virtual void mforms::View::set_back_image ( const std::string &  path,
Alignment  alignment 
)
protectedvirtual

Reimplemented in mforms::Container.

Referenced by mforms::Container::set_back_image().

void mforms::View::set_enabled ( bool  flag)

Enable view so user can interact with it.

void mforms::View::set_font ( const std::string &  fontDescription)
void mforms::View::set_front_color ( const std::string &  color)

Set view foreground color.

virtual void mforms::View::set_layout_dirty ( bool  value)
virtual

Reimplemented in mforms::DrawBox.

virtual void mforms::View::set_managed ( )
virtual
void mforms::View::set_name ( const std::string &  name)
void mforms::View::set_needs_repaint ( )

Mark view to be repainted with next iteration.

void mforms::View::set_parent ( View parent)
virtual void mforms::View::set_position ( int  x,
int  y 
)
virtual
virtual void mforms::View::set_size ( int  width,
int  height 
)
virtual
void mforms::View::set_tooltip ( const std::string &  text)
void mforms::View::show ( bool  flag = true)

Show/hide view.

boost::signals2::signal<void ()>* mforms::View::signal_resized ( )
inline

Definition at line 388 of file view.h.

388 { return &_signal_resized; }
boost::signals2::signal< void()> _signal_resized
Definition: view.h:209
void mforms::View::suspend_layout ( )

Freeze gui updates for this view.

This method is useful when there is a need to manipulate childs of this view. After calling suspend_layout, resume_layout need to be called!

Member Data Documentation

bool mforms::View::_layout_dirty
private

Definition at line 207 of file view.h.

std::string mforms::View::_name
private

Definition at line 206 of file view.h.

View* mforms::View::_parent
protected

Definition at line 215 of file view.h.

boost::signals2::signal<void ()> mforms::View::_signal_resized
private

Definition at line 209 of file view.h.

std::vector<std::pair<View*, bool> > mforms::View::_subviews
protected

Definition at line 216 of file view.h.

ViewImplPtrs* mforms::View::_view_impl
protected

Definition at line 214 of file view.h.


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