Add inputbox
This commit is contained in:
@@ -91,6 +91,26 @@ namespace nana
|
||||
button_t button_;
|
||||
icon_t icon_;
|
||||
};
|
||||
|
||||
class inputbox
|
||||
{
|
||||
public:
|
||||
inputbox(window, ::nana::string description, ::nana::string title = ::nana::string(), ::nana::string label = ::nana::string());
|
||||
|
||||
void set_modal();
|
||||
bool valid() const;
|
||||
int get_int(int value, int begin, int last, int step);
|
||||
double get_double(double value, double begin, double last, double step);
|
||||
::nana::string get_string();
|
||||
private:
|
||||
window owner_;
|
||||
bool valid_input_;
|
||||
bool modal_mode_;
|
||||
|
||||
::nana::string description_;
|
||||
::nana::string title_;
|
||||
::nana::string label_;
|
||||
};
|
||||
}//end namespace nana
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace nana
|
||||
void mouse_leave(graph_reference, const arg_mouse&) override;
|
||||
void key_press(graph_reference, const arg_keyboard&) override;
|
||||
void key_char(graph_reference, const arg_keyboard&) override;
|
||||
void resized(graph_reference, const arg_resized&) override;
|
||||
private:
|
||||
implementation * const impl_;
|
||||
};
|
||||
@@ -80,6 +81,11 @@ namespace nana
|
||||
void range(std::initializer_list<std::string> steps_utf8);
|
||||
void range(std::initializer_list<std::wstring> steps);
|
||||
|
||||
/// Gets the spined value
|
||||
::nana::string value() const;
|
||||
int to_int() const;
|
||||
double to_double() const;
|
||||
|
||||
/// Sets a predicator that determines whether accepts the current user input.
|
||||
/// @param pred Predicator to determines the input.
|
||||
void set_accept(std::function<bool(::nana::char_t)> pred);
|
||||
|
||||
Reference in New Issue
Block a user