PNTK
Public Member Functions | List of all members
pntk::gui_window Class Reference

#include <gui_window.h>

Inheritance diagram for pntk::gui_window:
pntk::gui_container pntk::gui_widget pntk::gui_object

Public Member Functions

 gui_window (std::string title, int x, int y, int w, int h, int style=GUI_WINDOW_DEFAULT)
 
virtual void show (bool state, gui_window *transient=nullptr)
 
virtual void apply_decorations ()
 
virtual void set_position (gui_point pos)
 
virtual void set_actual_size (gui_size size)
 
virtual void recalc_min_size ()
 
virtual void set_min_size (gui_size size)
 
virtual void set_label (const std::string &text)
 
virtual std::string get_label ()
 
virtual std::string get_self_name ()
 
virtual widget_types get_self_type ()
 
void do_size_changed (int width, int height)
 
virtual gui_size get_actual_min_size ()
 
virtual void __internal_set_min_size (gui_size minimum, gui_size ideal)
 
virtual void __internal_set_actual_size (gui_size size, bool propagate_to_os=true)
 
virtual void __internal_set_os_minimum (gui_size minimum)
 
virtual void __internal_set_os_actual (gui_size size)
 
- Public Member Functions inherited from pntk::gui_container
 gui_container ()
 
 ~gui_container ()
 
child_list & get_children ()
 
void set_sizes_dirty (bool state)
 
bool get_sizes_dirty ()
 
void check_integrity ()
 
virtual void add_child (gui_widget *child, int alignment=GUI_ALIGN_LEFT, int weight=1, bool recalc=true)
 
virtual void remove_child (gui_widget *child)
 
virtual void remove_child_using_native (native_widget child)
 
virtual gui_size get_size ()
 
virtual bool is_container ()
 
virtual void get_sizer_padding (int &header, int &edge)
 
virtual void recalc_sizes ()
 
virtual void set_actual_min_size (gui_size size)
 
virtual void __internal_set_actual_min_size (gui_size size)
 
- Public Member Functions inherited from pntk::gui_widget
virtual void init (bool visible=true)
 
virtual void set_configuration (gui_configuration &configuration)
 
virtual gui_configuration get_configuration ()
 
virtual void set_actual_position (gui_point pos)
 
gui_point get_position ()
 
gui_point get_actual_position ()
 
gui_point get_screen_position ()
 
virtual void set_size (gui_size size)
 
gui_size get_actual_size ()
 
virtual gui_size get_min_size ()
 
virtual void show (bool state)
 
virtual bool is_owned ()
 
virtual void set_border (int border)
 
virtual int get_border ()
 
virtual void set_border_style (int style)
 
virtual int get_border_style ()
 
virtual void set_weight (int weight)
 
virtual int get_weight ()
 
virtual void set_alignment (int alignment)
 
virtual int get_alignment ()
 
virtual void set_style (int style)
 
virtual int get_style ()
 
virtual void set_font (gui_font *font)
 
virtual gui_fontget_font ()
 
virtual void set_system_cursor (gui_system_cursors cursor)
 
virtual gui_widgetget_parent ()
 
gui_widgetget_sibling (bool next)
 
gui_widgetget_sequential (bool next, bool wrap=false)
 
virtual void reparent (gui_widget *parent)
 
virtual native_widget get_native_widget ()
 
virtual void set_bg_color (gui_color color)
 
virtual void set_fg_color (gui_color color)
 
virtual gui_color get_bg_color ()
 
virtual gui_color get_fg_color ()
 
virtual void set_enabled (bool state)
 
virtual bool get_enabled ()
 
virtual bool is_visible ()
 
virtual bool is_ok ()
 
virtual void refresh (int flags=0, const gui_rect *area=nullptr)
 
gui_extra_data & get_extra_data ()
 
virtual void set_focus ()
 
virtual bool has_focus ()
 
void set_default ()
 
gui_size bound_by_requested (gui_size size)
 
void feed_mouse (int base_event, int events, bool &veto, gui_point cursor, int button)
 
virtual void set_tooltip (std::string label)
 
virtual std::string get_tooltip ()
 
virtual void __internal_set_size (gui_size size, bool propagate_to_os=true)
 
- Public Member Functions inherited from pntk::gui_object
void set_data (void *user_data)
 
void * get_data ()
 
virtual void connect (gui_event_listener *call_back, void *data=nullptr, bool managed=false)
 
virtual void disconnect (gui_event_listener *call_back, void *data=nullptr)
 
pntk::gui_listener_chain__internal_disconnect (pntk::gui_listener_chain *matching_chain)
 

Additional Inherited Members

- Public Types inherited from pntk::gui_object
typedef std::map< gui_object *, gui_listener_chain * > event_map
 
- Static Public Member Functions inherited from pntk::gui_widget
static void get_widget_geometry (int alignment, gui_point base, gui_size max, gui_point &child_pos, gui_size &child_size)
 
- Public Attributes inherited from pntk::gui_container
gui_size min_size
 
- Public Attributes inherited from pntk::gui_widget
gui_fontfont
 
gui_system_cursors system_cursor
 
gui_size requested_size
 
gui_size extent
 
gui_extra_data extra_data
 
- Static Public Attributes inherited from pntk::gui_object
static event_map windowing_events
 

Detailed Description

A base top level window/dialog widget.

Constructor & Destructor Documentation

◆ gui_window()

pntk::gui_window::gui_window ( std::string  title,
int  x,
int  y,
int  w,
int  h,
int  style = GUI_WINDOW_DEFAULT 
)

Creates a new window with the given title, at the position given by x and y, and the size w (width) and h (height)

Member Function Documentation

◆ apply_decorations()

virtual void pntk::gui_window::apply_decorations ( )
virtual

Applies the windows style/decoration flags. Intended for internal use.

◆ do_size_changed()

void pntk::gui_window::do_size_changed ( int  width,
int  height 
)

The window changed its size, update it internally and (possibly) update its children.

◆ get_actual_min_size()

virtual gui_size pntk::gui_window::get_actual_min_size ( )
virtual

Returns minimum size of the widget (without any border padding).

Reimplemented from pntk::gui_container.

◆ get_label()

virtual std::string pntk::gui_window::get_label ( )
virtual

Returns the title of the window.

Reimplemented from pntk::gui_widget.

◆ get_self_name()

virtual std::string pntk::gui_window::get_self_name ( )
virtual

Returns the human readable name associated with the widget class type.

Reimplemented from pntk::gui_container.

◆ get_self_type()

virtual widget_types pntk::gui_window::get_self_type ( )
virtual

Returns the type of widget: GUI_TYPE_WINDOW.

Reimplemented from pntk::gui_container.

◆ recalc_min_size()

virtual void pntk::gui_window::recalc_min_size ( )
virtual

Forces a recalculation of the containers minmum size.

Reimplemented from pntk::gui_container.

◆ set_actual_size()

virtual void pntk::gui_window::set_actual_size ( gui_size  size)
virtual

Sets the extent of the window (not counting the window decorations padding) to the given size.

Reimplemented from pntk::gui_container.

◆ set_label()

virtual void pntk::gui_window::set_label ( const std::string &  text)
virtual

Changes the title of the window.

Reimplemented from pntk::gui_widget.

◆ set_min_size()

virtual void pntk::gui_window::set_min_size ( gui_size  size)
virtual

Sets the minimum size of the window.

◆ set_position()

virtual void pntk::gui_window::set_position ( gui_point  pos)
virtual

Sets the position (top left corner) of the window to the given pos.

Reimplemented from pntk::gui_widget.

◆ show()

virtual void pntk::gui_window::show ( bool  state,
gui_window transient = nullptr 
)
virtual

Sets visibility of the window to the given state, ensuring it is in front of transient.


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