mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:18:13 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
42
Libraries/LibGUI/GComboBox.h
Normal file
42
Libraries/LibGUI/GComboBox.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GListView.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class GButton;
|
||||
class GTextEditor;
|
||||
|
||||
class GComboBox : public GWidget {
|
||||
public:
|
||||
explicit GComboBox(GWidget* parent = nullptr);
|
||||
virtual ~GComboBox() override;
|
||||
|
||||
String text() const;
|
||||
void set_text(const String&);
|
||||
|
||||
void open();
|
||||
void close();
|
||||
void select_all();
|
||||
|
||||
GModel* model() { return m_list_view->model(); }
|
||||
const GModel* model() const { return m_list_view->model(); }
|
||||
void set_model(NonnullRefPtr<GModel>);
|
||||
|
||||
bool only_allow_values_from_model() const { return m_only_allow_values_from_model; }
|
||||
void set_only_allow_values_from_model(bool);
|
||||
|
||||
Function<void(const String&)> on_change;
|
||||
Function<void()> on_return_pressed;
|
||||
|
||||
virtual const char* class_name() const override { return "GComboBox"; }
|
||||
|
||||
protected:
|
||||
virtual void resize_event(GResizeEvent&) override;
|
||||
|
||||
private:
|
||||
GTextEditor* m_editor { nullptr };
|
||||
GButton* m_open_button { nullptr };
|
||||
GWindow* m_list_window { nullptr };
|
||||
GListView* m_list_view { nullptr };
|
||||
bool m_only_allow_values_from_model { false };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue