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


C++ gtk::MessageDialog类代码示例

本文整理汇总了C++中gtk::MessageDialog的典型用法代码示例。如果您正苦于以下问题:C++ MessageDialog类的具体用法?C++ MessageDialog怎么用?C++ MessageDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MessageDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: on_notification_from_worker_thread

// Function executed after the map has been solved
void MapWindow::on_notification_from_worker_thread()
{
	if (m_WorkerThread && worker.has_stopped())
	{
		// Show a window dialog if there is no solution
		if( !worker.get_solution_exists() )
		{
			DialogWindow.notification();
			Gtk::MessageDialog *dlg = new Gtk::MessageDialog("No solution exists.");
			dlg->run();
			delete dlg;
		}
		// Work is done.
		m_WorkerThread->join();
		m_WorkerThread = NULL;

		// Update buttons
		m_Button_Solve.set_sensitive(false);
		m_Button_File.set_sensitive(true);

		// Force the on_draw function
		m_draw.queue_draw();

		// Hide the spinner window
		DialogWindow.notification();
	}
}
开发者ID:fultoncjb,项目名称:astar,代码行数:28,代码来源:menuwindow.cpp

示例2: onAddPredicate

void PredicateDialog::onAddPredicate() {
    SimpleTypeBox box( ("New predicate name?"), "");
    std::string name = boost::trim_copy(box.run());
    if (box.valid() and checkName(name)) {
        setSensitivePredicate(false);
        Gtk::TreeIter iter = m_model->append();
        if (iter) {
            savePreviousPredicate(mPredicateNameEntry->get_text());
            mPredicateNameEntry->set_text(name);
            Gtk::ListStore::Row row = *iter;
            row[m_viewscolumnrecord.name] = name;

            mTextViewFunction->get_buffer()->set_text("");
            mHeaderPred->set_text( "bool " + name
            + "() const {" );

            m_iter = iter;
            mTreePredicateList->set_cursor(m_model->get_path(iter));
            mPredicateName.push_back(name);
            setSensitivePredicate(true);
        }
    }
    else {
        Gtk::MessageDialog errorDial ("Name error !",
            false,
            Gtk::MESSAGE_ERROR,
            Gtk::BUTTONS_OK,
            true);
        errorDial.set_title("Error !");
        errorDial.run();
    }
}
开发者ID:mikaelgrialou,项目名称:packages,代码行数:32,代码来源:PredicateDialog.cpp

示例3: onDspEntryActivate

void MainSynthWindow::onDspEntryActivate (void)
{
    gthPatchManager *patchMgr = gthPatchManager::instance();
    string dspfile = dspEntry_.get_text();
    int pagenum = notebook_.get_current_page();

    /* noop caused by a spurious Enter */
    if (dspfile == "")
        return;
    
    if (patchMgr->newPatch(dspfile, pagenum) == false)
    {
        char *error = g_strdup_printf("Couldn't load DSP %s; syntax error, or does not exist",
            dspfile.c_str());
        
        Gtk::MessageDialog errorDialog (error, false, Gtk::MESSAGE_ERROR);
        
        errorDialog.run();

        free(error);

        return;
    }

    notebook_.hide_all();
    notebook_.pages().clear();
    populate();
    notebook_.show_all();

    notebook_.set_current_page(pagenum);
}
开发者ID:mishan,项目名称:thinksynth,代码行数:31,代码来源:MainSynthWindow.cpp

示例4: keyReplaceDialog

Glib::ustring Document::keyReplaceDialog (
	Glib::ustring const &original,
	Glib::ustring const &replacement,
	const char *message_text)
{
	Glib::ustring message = String::ucompose (
		"<big><b>%1</b></big>\n\n%2",
		_("Key naming conflict"),
		String::ucompose (
			message_text,
			original, replacement));

	Gtk::MessageDialog dialog (message, true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true);
	Gtk::Button *button;

	button = dialog.add_button (_("_Ignore"), Gtk::RESPONSE_CANCEL);
	Gtk::Image *noImage = Gtk::manage (new Gtk::Image (Gtk::Stock::NO, Gtk::ICON_SIZE_BUTTON));
	button->set_image (*noImage);

	button = dialog.add_button (_("_Replace"), Gtk::RESPONSE_ACCEPT);
	Gtk::Image *yesImage = Gtk::manage (new Gtk::Image (Gtk::Stock::YES, Gtk::ICON_SIZE_BUTTON));
	button->set_image (*yesImage);
	dialog.set_default_response (Gtk::RESPONSE_ACCEPT);

	if (dialog.run () == Gtk::RESPONSE_ACCEPT)
		return replacement;
	else
		return original;
}
开发者ID:mcraveiro,项目名称:referencer,代码行数:29,代码来源:Document.C

示例5: onRenamePredicate

void PredicateDialog::onRenamePredicate() {
    Glib::RefPtr < Gtk::TreeView::Selection > ref = mTreePredicateList->
        get_selection();
    if (ref) {
        Gtk::TreeModel::iterator iter = ref->get_selected();
        if (iter) {
            Gtk::TreeModel::Row row = *iter;
            std::string oldName(row.get_value(m_viewscolumnrecord.name));
            savePreviousPredicate(oldName);

            SimpleTypeBox box(("Predicate new name?"), "");
            std::string name = boost::trim_copy(box.run());
            if (box.valid() and checkName(name)) {

                setSensitivePredicate(false);
                m_model->erase(iter);

                Gtk::TreeModel::Children children = m_model->children();
                m_iter = children.begin();

                iter = m_model->append();
                mPredicateNameEntry->set_text(name);
                Gtk::ListStore::Row row = *iter;
                row[m_viewscolumnrecord.name] = name;

                if (mPredicateFunction.find(oldName) !=
                        mPredicateFunction.end()) {
                    mTextViewFunction->get_buffer()->
                            set_text(mPredicateFunction[oldName]);
                    mPredicateFunction[name] = mPredicateFunction[oldName];
                    mPredicateFunction.erase(oldName);
                }

                mPredicateName.push_back(name);
                // Delete the element in the vector
                for (std::vector < std::string > ::iterator it =
                        mPredicateName.begin(); it != mPredicateName.end(); ) {
                    if ( *it == oldName ) {
                        it = mPredicateName.erase(it);
                    }
                    else {
                        ++it;
                    }
                }
                mTreePredicateList->set_cursor(m_model->get_path(iter));
                setSensitivePredicate(true);
            }
            else {
                Gtk::MessageDialog errorDial ("Name error !",
                    false,
                    Gtk::MESSAGE_ERROR,
                    Gtk::BUTTONS_OK,
                    true);
                errorDial.set_title("Error !");
                errorDial.run();
            }
        }
    }
}
开发者ID:mikaelgrialou,项目名称:packages,代码行数:59,代码来源:PredicateDialog.cpp

示例6: ShowMessage

	void ShowMessage(const Glib::ustring& s, Gtk::Window* parent)
	{
		Gtk::MessageDialog* msg = new Gtk::MessageDialog(s);
		if(parent)
			msg->set_transient_for(*parent);
		msg->run();
		delete msg;
	}
开发者ID:Caaraya,项目名称:Jazz,代码行数:8,代码来源:jazz_util.cpp

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

示例8: new_user_clicked

void LoginWindow::new_user_clicked()
{
  if (login.get_text() != "" && pass.get_text() != "" && uc->addUser(login.get_text(), pass.get_text()))
  {
    Gtk::MessageDialog *info = new Gtk::MessageDialog("Konto utworzono");
    info->set_modal(true);
    info->run();
    delete info;
  }
}
开发者ID:kn65op,项目名称:domag_old,代码行数:10,代码来源:LoginWindow.cpp

示例9: onPatchLoadError

void MainSynthWindow::onPatchLoadError (const char* failure)
{
    char *error = g_strdup_printf("Couldn't load patchfile %s; syntax error, or DSP does not exist",
        failure);
        
    Gtk::MessageDialog errorDialog (error, false, Gtk::MESSAGE_ERROR);
    
    errorDialog.run();
    free(error);
}
开发者ID:mishan,项目名称:thinksynth,代码行数:10,代码来源:MainSynthWindow.cpp

示例10: 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

示例11: onNewExtraField

void DocumentProperties::onNewExtraField ()
{
	Gtk::Dialog dialog ("New Field", *dialog_, true, false);

	Gtk::VBox *vbox = dialog.get_vbox ();

	Gtk::HBox hbox;
	hbox.set_spacing (12);
	vbox->pack_start (hbox, true, true, 0);

	Gtk::Label label ("Field name:", false);
	hbox.pack_start (label, false, false, 0);

	Gtk::Entry entry;
	entry.set_activates_default (true);
	hbox.pack_start (entry, true, true, 0);

	dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	dialog.add_button (Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
	dialog.set_default_response (Gtk::RESPONSE_ACCEPT);

	dialog.show_all ();
	vbox->set_border_width (12);

	if (dialog.run () == Gtk::RESPONSE_ACCEPT) {

		Gtk::ListStore::iterator it = extrafieldsstore_->children().begin ();
		Gtk::ListStore::iterator const end = extrafieldsstore_->children().end ();
		bool key_isnew = true;
		for (; it != end; ++it)
			if (Utility::firstCap ((*it)[extrakeycol_]) == Utility::firstCap (entry.get_text ())) {
				key_isnew = false;
			}
		if ( key_isnew ) {
			Gtk::ListStore::iterator row = extrafieldsstore_->append ();
			(*row)[extrakeycol_] = Utility::firstCap (entry.get_text ());
			(*row)[extravalcol_] = "";
		} else {
			Glib::ustring message;
			message = String::ucompose (
			"<b><big>%1</big></b>",
			_("This key already exists.\n"));
			Gtk::MessageDialog dialog (

			message, true,
			Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true);

			dialog.run ();

		}
	}
}
开发者ID:mcraveiro,项目名称:referencer,代码行数:52,代码来源:DocumentProperties.C

示例12: SetSilhouette

void PhotoPreview::SetSilhouette() {
	try {
		Image=Gdk::Pixbuf::create_from_file(Cfg->GetSilhouetteImage());
	} catch(...) {
		Gtk::MessageDialog *message = new Gtk::MessageDialog(_("Error reading data file: ")+Cfg->GetSilhouetteImage()+"\n",
			false,Gtk::MESSAGE_WARNING,Gtk::BUTTONS_OK,true);
		message->run();
		delete message;
		return;
	}

	Redraw();
	IsSilhouette=true;
}
开发者ID:adsllc,项目名称:muenstercam,代码行数:14,代码来源:PhotoPreview.cpp

示例13: ok_clicked

void LoginWindow::ok_clicked()
{
  if (login_ok = uc->checkUser(login.get_text(), pass.get_text()))
  {
    hide();
  }
  else
  {
    Gtk::MessageDialog *info = new Gtk::MessageDialog("Błędny login lub hasło.");
    info->set_modal(true);
    info->run();
    delete info;
  }
}
开发者ID:kn65op,项目名称:domag_old,代码行数:14,代码来源:LoginWindow.cpp

示例14: dialog

void
catch_and_return_to_GUI_thread (void)
{
  try
    {
      throw;
    }
  catch (const std::exception& e)
    {
      Gtk::MessageDialog dialog (e.what (), false, Gtk::MESSAGE_ERROR);

      dialog.set_keep_above ();
      dialog.run ();
    }
}
开发者ID:jlpoolen,项目名称:utsushi,代码行数:15,代码来源:scan-gtkmm.cpp

示例15: onBrowseButton

void MainSynthWindow::onBrowseButton (void)
{
    gthPatchManager *patchMgr = gthPatchManager::instance();
    int pagenum = notebook_.get_current_page();
    Gtk::FileSelection fileSel("thinksynth - Load DSP");

    if (prevDir_ != "")
        fileSel.set_filename(prevDir_);

    if (fileSel.run() == Gtk::RESPONSE_OK)
    {
        dspEntry_.set_text(fileSel.get_filename());

        if (patchMgr->newPatch(fileSel.get_filename(), pagenum))
        {
            string dn = thUtil::dirname((char*)fileSel.get_filename().c_str());

            prevDir_ = dn + "/";

            string **vals = new string *[2];
            vals[0] = new string(prevDir_);
            vals[1] = NULL;

            gthPrefs *prefs = gthPrefs::instance();
            prefs->Set("dspdir", vals);

            /* load up the patch file */
            notebook_.hide_all();
            notebook_.pages().clear();
            populate();
            notebook_.show_all();
            notebook_.set_current_page(pagenum);
        }
        else
        {
            char *error = g_strdup_printf("Couldn't load DSP %s; syntax error, or does not exist",
                fileSel.get_filename().c_str());
        
            Gtk::MessageDialog errorDialog (error, false, Gtk::MESSAGE_ERROR);
        
            errorDialog.run();

            free(error);
        }
    }
}
开发者ID:mishan,项目名称:thinksynth,代码行数:46,代码来源:MainSynthWindow.cpp


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