dl
dl
ui
extend
dl_ui_msg_box.h
浏览该文件的文档.
1
12
#pragma once
13
14
#ifndef DL_DISABLE_RENDER
15
#include "
misc/dl_component_use.h
"
16
#include "
ui/dl_ui_background.h
"
17
#include "
ui/dl_ui_panel.h
"
18
#include "
ui/dl_ui_window.h
"
19
#include "
ui/dl_ui_list_box.h
"
20
21
namespace
dl::UI
22
{
24
class
MsgBox :
public
Window
25
{
26
public
:
27
32
static
MsgBox*
Create
(
UI::Text
* title,
UI::Text
* content,
UI::Button
* btn);
33
38
Panel
*
GetPanelButton
() {
return
_panelBtn; }
39
40
virtual
void
Update
()
override
;
45
void
SetClickClose
(
bool
close)
46
{
47
_bClickClose = close;
48
}
49
52
size_t
GetClickIndex
();
56
size_t
GetOverOnceIndex
();
57
65
void
Set
(std::string_view title, std::string_view info, std::vector<std::string_view> all_btn);
66
67
68
~MsgBox
();
69
private
:
70
MsgBox() :
71
_bAddTab{ true },
72
_bClickClose{ true },
73
_btn{ nullptr }
74
{
75
}
76
77
bool
_bAddTab;
78
bool
_bClickClose;
// 点击任意按钮直接关闭
79
80
UI::Text
* _txtTitle;
81
UI::Text
* _txtContent;
82
UI::Button
* _btn;
83
UI::Panel
* _panelBtn;
84
85
std::vector<UI::Button*> _allBtn;
86
87
void
_init();
88
};
89
}
90
91
#endif
dl::UI::Button
按钮(Button、Switch、Radio)
定义
dl_ui_button_base.h:30
dl::UI::MsgBox::Set
void Set(std::string_view title, std::string_view info, std::vector< std::string_view > all_btn)
设置内容
dl::UI::MsgBox::SetClickClose
void SetClickClose(bool close)
设置是否点击任意按钮关闭窗口
定义
dl_ui_msg_box.h:45
dl::UI::MsgBox::~MsgBox
~MsgBox()
dl::UI::MsgBox::Update
virtual void Update() override
帧函数 @info 子类重载后,需要调用 Window::Update()
dl::UI::MsgBox::GetPanelButton
Panel * GetPanelButton()
返回按钮组 @info 设置整体位置和按钮布局
定义
dl_ui_msg_box.h:38
dl::UI::MsgBox::Create
static MsgBox * Create(UI::Text *title, UI::Text *content, UI::Button *btn)
创建窗口
dl::UI::MsgBox::GetOverOnceIndex
size_t GetOverOnceIndex()
返回经过的按钮下标,不包含关闭按钮
dl::UI::MsgBox::GetClickIndex
size_t GetClickIndex()
返回点击的按钮下标,不包含关闭按钮
dl::UI::Panel
UI面板
定义
dl_ui_panel.h:65
dl::UI::Text
ui文本
定义
dl_ui_text.h:26
dl::UI::Window::Window
Window()
定义
dl_ui_window.h:127
dl_component_use.h
组件实例
dl_ui_background.h
作为绘图背景
dl_ui_list_box.h
UI之列表框
dl_ui_panel.h
ui之panel
dl_ui_window.h
UI之窗口
dl::UI
UI系统
定义
dl_ui_background.h:21
制作者
1.13.1