57 return static_cast<label_placement>(
static_cast<uint32_t
>(aLhs) |
static_cast<uint32_t
>(aRhs));
62 return static_cast<label_placement>(
static_cast<uint32_t
>(aLhs) &
static_cast<uint32_t
>(aRhs));
85 class label :
public widget<>
89 struct no_center_spacer : std::logic_error { no_center_spacer() :
std::logic_error(
"neogfx::label::no_center_spacer") {} };
90 struct no_buddy : std::logic_error { no_buddy() :
std::logic_error(
"neogfx::label::no_buddy") {} };
112 const grid_layout& layout()
const override;
113 grid_layout& layout()
override;
115 neogfx::size_policy size_policy()
const override;
118 void set_font(optional_font
const& aFont)
override;
123 i_string
const& text()
const;
124 void set_text(i_string
const& aText);
125 const texture& image()
const;
126 void set_image(i_string
const& aImageUri);
128 void set_image(
const texture& aImage);
136 const i_spacer& center_spacer()
const;
137 i_spacer& center_spacer();
138 bool has_buddy()
const;
139 i_widget& buddy()
const;
140 void set_buddy(i_widget& aBuddy);
141 void set_buddy(std::shared_ptr<i_widget> aBuddy);
145 void handle_placement_change();
151 size_policy_of_parent<neogfx::text_widget, layout_item_category::Widget> iText;
152 size_policy_of_parent<neogfx::image_widget, layout_item_category::Widget> iImage;
153 i_spacer* iCenterSpacer;
154 std::shared_ptr<i_widget> iBuddy;
#define end_declare_enum(enumName)
#define declare_enum_string(enumName, enumEnumerator)
#define begin_declare_enum(enumName)
constexpr style_aspect operator&(style_aspect aLhs, style_aspect aRhs)
optional< font_role > optional_font_role
constexpr style_aspect operator|(style_aspect aLhs, style_aspect aRhs)
@ ImageSpacerTextHorizontal
@ ImageSpacerTextVertical
@ TextSpacerImageHorizontal
@ TextSpacerImageVertical