Skip to content
James Bremner edited this page Apr 6, 2019 · 2 revisions

spinbox

Doxygen description

Spinbox is a widget that allows a user to choose a value in the specified range. It supports a group of integers, doubles or texts.

#include <nana/gui.hpp>
#include <nana/gui/widgets/spinbox.hpp>

int main()
{
    using namespace nana;

    form fm;
    spinbox spbox(fm, rectangle{10, 10, 100, 30});
    spbox.range(0, 100, 1); //Set the range of integers

    fm.show();
    exec();
}

There are 4 overloaded functions for the member function spinbox::range, they determine the value type of the input.

/// Sets the numeric spin values and step.
void range(int begin, int last, int step);
void range(double begin, double last, double step);

/// Sets the string spin values.
void range(std::initializer_list<std::string> steps_utf8);
void range(std::initializer_list<std::wstring> steps);
Clone this wiki locally