当前位置: 首页>>代码示例>>C++>>正文


C++ MessageDialog::set_secondary_text方法代码示例

本文整理汇总了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();
	}
开发者ID:Kaligule,项目名称:gobby,代码行数:27,代码来源:statusbar.cpp

示例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();
}
开发者ID:earizaa,项目名称:repsnapper,代码行数:9,代码来源:view.cpp

示例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 ();
  }
}
开发者ID:jwildeboer,项目名称:repsnapper,代码行数:12,代码来源:model.cpp

示例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();
	}
开发者ID:JohnCC330,项目名称:gobby,代码行数:19,代码来源:statusbar.cpp

示例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
    }

//.........这里部分代码省略.........
开发者ID:sirjaren,项目名称:utsushi,代码行数:101,代码来源:file-chooser.cpp


注:本文中的gtk::MessageDialog::set_secondary_text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。