Listing 3
// taken from smart_dialogs/adv_msg_box sample
struct msg_box_dlg : wnd_extend<dialog,msg_box_dlg> {
// ...
};
struct msg_box_ex {
msg_box_ex(hwnd_proxy parent, const string & msg)
: m_parent(parent), m_msg(msg) {}
msg_box_ex& title(const string & val) {
m_title = val; return *this;
}
// ...
int show() {
return create_modal_dlg<msg_box_dlg>(m_parent, ...;
}
};
// in code
msg_box_result res = msg_box_ex(this,
"File '" + file_name + "' is a hidden file\r\n\r\n"
"Do you still want to delete it?")
.title("Bulk Delete...").icon(ID_bulk_del);
switch( res) {
case yes: // ...
case yes_to_all: // ...
// ...
}