44 class text_field :
public widget<>
48 class input_box_container :
public framed_widget<>
50 typedef framed_widget<> base_type;
52 input_box_container(text_field& aParent, i_layout& aParentLayout, frame_style aFrameStyle);
54 color frame_color()
const override;
56 color palette_color(color_role aColorRole)
const override;
61 struct no_label : std::logic_error { no_label() :
std::logic_error{
"neogfx::text_field::no_label" } {} };
63 text_field(std::string
const& aLabel = std::string{}, std::string
const& aHint = std::string{},
text_field_placement aPlacement = text_field_placement::LabelAbove,
frame_style aFrameStyle = frame_style::SolidFrame);
64 text_field(i_widget& aParent, std::string
const& aLabel = std::string{}, std::string
const& aHint = std::string{},
text_field_placement aPlacement = text_field_placement::LabelAbove,
frame_style aFrameStyle = frame_style::SolidFrame);
65 text_field(i_layout& aLayout, std::string
const& aLabel = std::string{}, std::string
const& aHint = std::string{},
text_field_placement aPlacement = text_field_placement::LabelAbove,
frame_style aFrameStyle = frame_style::SolidFrame);
67 i_string
const& text()
const;
68 void set_text(i_string
const& aText);
69 bool has_label()
const;
70 const neogfx::label& label()
const;
71 neogfx::label& label();
72 const line_edit& input_box()
const;
73 line_edit& input_box();
74 const text_widget& hint()
const;
77 void set_placement(text_field_placement aPlacement);
78 const text_widget& help()
const;
81 neogfx::size_policy size_policy()
const override;
83 size minimum_size(optional_size
const& aAvailableSpace = optional_size{})
const override;
84 size maximum_size(optional_size
const& aAvailableSpace = optional_size{})
const override;
86 void focus_gained(focus_reason aFocusReason)
override;
92 vertical_layout iLayout;
93 std::optional<neogfx::label> iLabel;
94 horizontal_layout iInputLayout;
95 input_box_container iInputBoxContainer;
96 horizontal_layout iInputBoxContainerLayout;
98 horizontal_layout iInputBoxLayout;
#define end_declare_enum(enumName)
#define declare_enum_string(enumName, enumEnumerator)
#define begin_declare_enum(enumName)
basic_size< coordinate > size