This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.WidgetSpinBoxDouble Class

Inherits from: Widget

This class creates a spin box with double values.

Usage Example
#

This example illustrates creation of a spinbox via code.

Source code (C#)
using System.Collections;
using System.Collections.Generic;
using Unigine;

[Component(PropertyGuid = "AUTOGENERATED_GUID")] // <-- this line is generated automatically for a new component
public class ComponentName : Component
{
	 // declaring a spinbox
		WidgetSpinBoxDouble spinbox;

		// implement the Changed event handler to be fired on changing spinbox value
		void onSpinboxChanged(Widget widget)
		{
			// printing the current spinbox value to the console and 
			Log.Message("Spinbox value changed: {0} \n", (widget as WidgetSpinBoxDouble).Value);
			(widget as WidgetSpinBoxDouble).SetFocus();
		}

	// Method creating a spinbox with specified parameters at the specified position
	WidgetSpinBoxDouble CreateSB(double x, double y, double min, double max, double value, double step)
	{
		// get a pointer to the system GUI
		Gui gui = Gui.GetCurrent();
		// creating a new edit line and adding it to the GUI
		WidgetEditLine new_el = new WidgetEditLine(gui);
		gui.AddChild(new_el, Gui.ALIGN_OVERLAP);
		// setting widget's position
		new_el.SetPosition(x, y);

		// creating a spinbox with the specified parameters and adding it to the GUI
		WidgetSpinBoxDouble new_sb = new WidgetSpinBoxDouble(gui, min, max, value, step);
		gui.AddChild(new_sb, Gui.ALIGN_OVERLAP);

		// adding a callback to be fired on changing spinbox value
		new_sb.EventChanged.Connect(onSpinboxChanged);
		new_sb.Order = 1;

		// attaching the spinbox to the edit line
		new_el.AddAttach(new_sb);

		// setting initial spinbox value
		new_sb.Value = value;

		return new_sb;
	}

	void Init()
	{
		  // creating a spinbox with values in [0, 10] range (current - 5) at position (100, 100)
			spinbox = CreateSB(100, 100, 0.0, 10.0, 5.0, 1.0);
		
	}
}

WidgetSpinBoxDouble Class

Properties

double Value#

The current value of the spinbox.

double MaxExpand#

The current maximum value, up to which the upper limit of the range of the spinbox values can be expanded. the upper limit of the spinbox can be expanded only if the spinbox is attached to an editline with the Gui::ATTACH_MAX_EXPAND flag.

double MinExpand#

The current minimum value, up to which the lower limit of the range of the spinbox values can be expanded. the lower limit of the spinbox can be expanded only if the spinbox is attached to an editline with the Gui::ATTACH_MIN_EXPAND flag.

double MaxValue#

The maximum value of the spinbox.

double MinValue#

The minimum value of the spinbox.

vec4 ButtonColor#

The current color for the widget's button..

double Step#

The current step of the spinbox.

Members


WidgetSpinBoxDouble ( Gui gui, double min = 0.0, double max = 100.0, double value = 0.0, double step = 1.0 ) #

Constructor. Creates a spinbox with given parameters and adds it to the specified GUI.

Arguments

  • Gui gui - GUI, to which the spinbox will belong.
  • double min - Minimum value.
  • double max - Maximum value.
  • double value - Initial value.
  • double step - Initial step.

WidgetSpinBoxDouble ( double min = 0.0, double max = 100.0, double value = 0.0, double step = 1.0 ) #

Constructor. Creates a spinbox with given parameters and adds it to the Engine GUI.

Arguments

  • double min - Minimum value.
  • double max - Maximum value.
  • double value - Initial value.
  • double step - Initial step.
Last update: 19.04.2024
Build: ()