This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Полезные советы
Программирование на C#
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm (Experimental)
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::WidgetDialogFile Class

Header: #include <UnigineWidgets.h>
Inherits: WidgetDialog

This class creates dialog window where a file is selected. On the left side file-related information or an image preview is displayed.

Example#

The following code illustrates how to create a file selection dialog widget and set its parameters.

Source code (C++)
#include <UnigineWidgets.h>
using namespace Unigine;

/* .. */

// CLICKED event handler function for dialog cancel button
int onDlgCancelClicked()
{
	/* .. */
	
	return 1;
}

// CLICKED event handler function for dialog OK button
int onDlgOKClicked()
{
	/* .. */
	
	return 1;
}
/* .. */

// getting a pointer to the system GUI
GuiPtr gui = Gui::get();

// creating a file dialog widget and setting its caption
WidgetDialogFilePtr widget_file_dialog = WidgetDialogFile::create(gui, "Select a mesh file");

// setting the default path for the file dialog
widget_file_dialog->setPath("../");

//setting a file name filter to display only *.mesh files
widget_file_dialog->setFilter(".mesh");

// hiding the dialog window
widget_file_dialog->setHidden(0);

// setting onDlgCancelClicked function to handle CLICKED event for dialog cancel button
widget_file_dialog->getCancelButton()->addCallback(Gui::CLICKED, MakeCallback(onDlgCancelClicked));

// setting onDlgOKClicked function to handle CLICKED event for dialog OK button
widget_file_dialog->getOkButton()->addCallback(Gui::CLICKED, MakeCallback(onDlgOKClicked));

// adding created checkbox widget to the system GUI
gui->addChild(widget_file_dialog, Gui::ALIGN_OVERLAP | Gui::ALIGN_FIXED | Gui::ALIGN_CENTER);

WidgetDialogFile Class

Members


static WidgetDialogFilePtr create ( const Ptr<Gui> & gui, const char * str = 0 ) #

Constructor. Creates a file picker dialog with given parameters and adds it to the specified GUI.

Arguments

  • const Ptr<Gui> & gui - GUI, to which the dialog will belong.
  • const char * str - Dialog title. This is an optional parameter.

static WidgetDialogFilePtr create ( const char * str = 0 ) #

Constructor. Creates a file picker dialog with given parameters and adds it to the Engine GUI.

Arguments

  • const char * str - Dialog title. This is an optional parameter.

void setFile ( const char * file ) #

Selects a given file in the file picker.

Arguments

  • const char * file - Absolute or relative (to the data folder) path.

const char * getFile ( ) const#

Returns the currently selected file.

Return value

Path to the file.

void setFilter ( const char * filter ) #

Sets a file name filter, which is used to display files of required types only.

Arguments

  • const char * filter - List of file extensions with leading dots and without additional separators, for example: .mesh.smesh.

const char * getFilter ( ) const#

Returns the currently used file name filter.

Return value

List of file extensions with leading dots and without additional separators, for example: .mesh.smesh.

void setPath ( const char * path ) #

Sets a path to the folder, contents of which should be displayed in the file picker.

Arguments

  • const char * path - Absolute or relative (to the data folder) path.

const char * getPath ( ) const#

Returns the current path to the folder, contents of which is displayed in the file picker.

Return value

Current path to the folder.

void setTabs ( const char * tabs ) #

Adds a set of tabs to the file picker dialog. The tabs allow the user to interact with several folders at once.

Arguments

  • const char * tabs - List of paths separated with semicolons. Each path corresponds to a tab.

const char * getTabs ( ) const#

Returns a list of tabs in the file picker dialog. The tabs allow the user to interact several folders at once.

Return value

List of paths separated with semicolons. Each path corresponds to a tab.
Last update: 24.11.2020
Build: ()