Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
guiPathSelectMenu.h
Go to the documentation of this file.
1
2// Luanti
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2013 sapier
5
6#pragma once
7
8#include <string>
9
10#include "modalMenu.h"
11#include "IGUIFileOpenDialog.h"
12
13struct TextDest;
14
16{
17public:
18 GUIFileSelectMenu(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id,
19 IMenuManager *menumgr, const std::string &title,
20 const std::string &formid, bool is_file_select);
22
23 /*
24 Remove and re-add (or reposition) stuff
25 */
26 void regenerateGui(v2u32 screensize);
27
28 void drawMenu();
29
30 bool OnEvent(const SEvent &event);
31
32 void setTextDest(TextDest *dest) { m_text_dst = dest; }
33
34protected:
35 std::wstring getLabelByID(s32 id) { return L""; }
36 std::string getNameByID(s32 id) { return ""; }
37
38private:
39 void acceptInput();
40
41 std::wstring m_title;
42 bool m_accepted = false;
43
44 gui::IGUIFileOpenDialog *m_fileOpenDialog = nullptr;
45
46 TextDest *m_text_dst = nullptr;
47
48 std::string m_formname;
50};
Definition guiPathSelectMenu.h:16
TextDest * m_text_dst
Definition guiPathSelectMenu.h:46
bool m_file_select_dialog
Definition guiPathSelectMenu.h:49
void acceptInput()
Definition guiPathSelectMenu.cpp:53
std::string m_formname
Definition guiPathSelectMenu.h:48
~GUIFileSelectMenu()
Definition guiPathSelectMenu.cpp:19
bool m_accepted
Definition guiPathSelectMenu.h:42
std::wstring getLabelByID(s32 id)
Definition guiPathSelectMenu.h:35
GUIFileSelectMenu(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, IMenuManager *menumgr, const std::string &title, const std::string &formid, bool is_file_select)
Definition guiPathSelectMenu.cpp:8
void drawMenu()
Definition guiPathSelectMenu.cpp:44
bool OnEvent(const SEvent &event)
Definition guiPathSelectMenu.cpp:75
void setTextDest(TextDest *dest)
Definition guiPathSelectMenu.h:32
std::string getNameByID(s32 id)
Definition guiPathSelectMenu.h:36
gui::IGUIFileOpenDialog * m_fileOpenDialog
Definition guiPathSelectMenu.h:44
void regenerateGui(v2u32 screensize)
Definition guiPathSelectMenu.cpp:24
std::wstring m_title
Definition guiPathSelectMenu.h:41
Definition modalMenu.h:36
Definition modalMenu.h:25
core::vector2d< u32 > v2u32
Definition irr_v2d.h:14
Definition guiFormSpecMenu.h:67