Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBPopupAlignment Class Reference

TBPopupAlignment describes the preferred alignment of a popup relative to a target widget or a given point. More...

#include <tb_popup_window.h>

Public Member Functions

 TBPopupAlignment (TB_ALIGN align=TB_ALIGN_BOTTOM)
 Align relative to the target widget. More...
 
 TBPopupAlignment (const TBPoint &pos_in_root, TB_ALIGN align=TB_ALIGN_BOTTOM)
 Align relative to the given position (coordinates relative to the root widget). More...
 
 TBPopupAlignment (const TBPoint &pos_in_root, const TBPoint &pos_offset)
 Align relative to the given position (coordinates relative to the root widget). More...
 
TBRect GetAlignedRect (TBWidget *popup, TBWidget *target) const
 Calculate a good rect for the given popup window using its preferred size and the preferred alignment information stored in this class. More...
 

Public Attributes

TBPoint pos_in_root
 
TBPoint pos_offset
 
TB_ALIGN align
 
bool expand_to_target_width
 If true, the width of the popup will be at least the same as the target widget if the alignment is TB_ALIGN_TOP or TB_ALIGN_BOTTOM. More...
 

Static Public Attributes

static const int UNSPECIFIED = TB_INVALID_DIMENSION
 

Detailed Description

TBPopupAlignment describes the preferred alignment of a popup relative to a target widget or a given point.

It calculates the rect to be used to match these preferences for any given popup and target.

Constructor & Destructor Documentation

tb::TBPopupAlignment::TBPopupAlignment ( TB_ALIGN  align = TB_ALIGN_BOTTOM)
inline

Align relative to the target widget.

tb::TBPopupAlignment::TBPopupAlignment ( const TBPoint pos_in_root,
TB_ALIGN  align = TB_ALIGN_BOTTOM 
)
inline

Align relative to the given position (coordinates relative to the root widget).

tb::TBPopupAlignment::TBPopupAlignment ( const TBPoint pos_in_root,
const TBPoint pos_offset 
)
inline

Align relative to the given position (coordinates relative to the root widget).

Applies an additional offset.

Member Function Documentation

TBRect tb::TBPopupAlignment::GetAlignedRect ( TBWidget popup,
TBWidget target 
) const

Calculate a good rect for the given popup window using its preferred size and the preferred alignment information stored in this class.

Member Data Documentation

bool tb::TBPopupAlignment::expand_to_target_width

If true, the width of the popup will be at least the same as the target widget if the alignment is TB_ALIGN_TOP or TB_ALIGN_BOTTOM.


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