Hasty Badger
Small UI library (a branch of Turbo Badger)
|
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 |
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.
|
inline |
Align relative to the target widget.
|
inline |
Align relative to the given position (coordinates relative to the root widget).
|
inline |
Align relative to the given position (coordinates relative to the root widget).
Applies an additional offset.
Calculate a good rect for the given popup window using its preferred size and the preferred alignment information stored in this class.
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.