-
Notifications
You must be signed in to change notification settings - Fork 24
/
Sample.Picker.h
39 lines (29 loc) · 1.17 KB
/
Sample.Picker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "Sample.h"
DEF_SAMPLE(Picker)
{
vu::Picker picker;
COLORREF color = 0x00FF00;
picker.choose_rgb_color(color);
std::tcout << ts("COLOR -> ") << std::hex << color << std::endl;
LOGFONT font = { 0 };
picker.choose_log_font(font);
std::tcout << ts("FONT -> ") << font.lfFaceName << std::endl;
std::tstring file_dir = ts("C:\\Windows\\");
std::tstring file_path = ts("example_default_file_name");
const auto file_filter = ts("All Files (*.*)\0*.*\0Document (.doc)\0*.doc\0Text (.txt)\0*.txt\0");
picker.choose_file(vu::Picker::action_type::open, file_path, file_dir, file_filter);
std::tcout << ts("PATH -> ") << file_path << std::endl;
picker.choose_file(vu::Picker::action_type::save, file_path, file_dir, file_filter);
std::tcout << ts("PATH -> ") << file_path << std::endl;
std::vector<std::tstring> file_names;
picker.choose_files(file_names, file_dir);
std::tcout << ts("DIR -> ") << file_dir << std::endl;
for (const auto& file_name : file_names)
{
std::tcout << vu::ttab << file_name << std::endl;
}
picker.choose_directory(file_dir);
std::tcout << ts("DIR -> ") << file_dir << std::endl;
return vu::VU_OK;
}