本文整理汇总了C++中gtk::MessageDialog::set_secondary_text方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageDialog::set_secondary_text方法的具体用法?C++ MessageDialog::set_secondary_text怎么用?C++ MessageDialog::set_secondary_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::MessageDialog
的用法示例。
在下文中一共展示了MessageDialog::set_secondary_text方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show_dialog
void show_dialog() const
{
Gtk::MessageDialog* dialog = new Gtk::MessageDialog(
m_simple_desc,
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_NONE,
false);
Gtk::Window* parent = NULL;
Gtk::Widget* toplevel_widget = m_widget->get_toplevel();
if(gtk_widget_is_toplevel(toplevel_widget->gobj()))
parent = dynamic_cast<Gtk::Window*>(toplevel_widget);
g_assert(parent != NULL);
dialog->set_transient_for(*parent);
dialog->add_button(_("_Close"), Gtk::RESPONSE_CLOSE);
dialog->set_secondary_text(m_detail_desc, true);
dialog->signal_response().connect(
sigc::hide(
sigc::bind(
sigc::ptr_fun(dispose_dialog),
dialog)));
dialog->show();
}
示例2: alert
void View::alert (Gtk::MessageType t, const char *message,
const char *secondary)
{
Gtk::MessageDialog dialog (*this, message, false /* markup */,
t, Gtk::BUTTONS_CLOSE, true);
if (secondary)
dialog.set_secondary_text (secondary);
dialog.run();
}
示例3: SendNow
void Model::SendNow(string str)
{
if (rr_dev_fd (m_device) > 0)
rr_dev_enqueue_cmd (m_device, RR_PRIO_HIGH, str.data(), str.size());
else {
Gtk::MessageDialog dialog ("Can't send command", false,
Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE);
dialog.set_secondary_text ("You must first connect to a device!");
dialog.run ();
}
}
示例4: show_dialog
void show_dialog() const
{
Gtk::MessageDialog* dialog = new Gtk::MessageDialog(
m_simple_desc,
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_NONE,
false);
dialog->add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
dialog->set_secondary_text(m_detail_desc, true);
dialog->signal_response().connect(
sigc::hide(
sigc::bind(
sigc::ptr_fun(dispose_dialog),
dialog)));
dialog->show();
}
示例5: ext
void
file_chooser::on_response (int response_id)
{
if (Gtk::RESPONSE_ACCEPT != response_id) return;
if (get_current_extension ().empty ())
set_current_extension (default_extension_);
std::string fmt;
{ // check whether extension is known
std::string ext (get_current_extension ());
bool found = false;
Gtk::TreeModel::Children children (file_type_.get_model ()->children ());
for (Gtk::TreeModel::Children::const_iterator it = children.begin ();
!found && children.end () != it;
++it)
{
Gtk::TreeModel::Row r = *it;
extension_list l = r[column->exts];
found = count (l.begin (), l.end (), ext);
if (found) fmt = r[column->text];
}
if (!found)
{
Gtk::MessageDialog tbd
(*this, _("Unsupported file format."),
use_markup, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, modal);
tbd.set_secondary_text
((format (_("The '%1%' file extension is not associated with"
" a supported file format. Please select a file"
" format or use one of the known file extensions."))
% ext).str ());
if (dynamic_cast< Gtk::Window * > (this))
get_group ()->add_window (tbd);
tbd.run ();
signal_response ().emission_stop ();
response (Gtk::RESPONSE_CANCEL);
return;
}
}
if (!single_image_mode_
&& requests_single_file (get_current_name ()))
{ // check whether single file is okay
if (!supports_multi_image (get_current_name ()))
{
Gtk::MessageDialog tbd
(*this, (format (_("The %1% format does not support multiple"
" images in a single file.")) % fmt).str (),
use_markup, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, modal);
tbd.set_secondary_text
((format (_("Please save to PDF or TIFF if you want a single"
" file. If you prefer the %1% image format, use"
" a filename such as 'Untitled-%%3i%2%'."))
% fmt % get_current_extension ()).str ());
if (dynamic_cast< Gtk::Window * > (this))
get_group ()->add_window (tbd);
tbd.run ();
signal_response ().emission_stop ();
response (Gtk::RESPONSE_CANCEL);
return;
}
}
if (!do_overwrite_confirmation_) return;
format message;
format details;
if (requests_single_file (get_current_name ()))
{
if (!fs::exists (std::string (get_filename ()))) return;
message = format (_("The name \"%1%\" already exists.\n"
"OK to overwrite this name using the new settings?"));
details = format (_("The file already exists in \"%1%\"."
" Replacing it will overwrite its contents."));
}
else
{
// FIXME Add meaningful checking
// if (no_possible_matches ) return;
message = format (_("Files matching \"%1%\" may already exist."
" Do you want to replace them?"));
//details = format (_("These files already exist in \"%1%\"."
// " Replacing them may overwrite their contents."));
// FIXME show list of matching files in an expander with details
}
//.........这里部分代码省略.........