• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Prompt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Reconfigure

void Reconfigure()
{
    fflush(stdin);

    Prompt("\nDo you want to \n"
           "  Randomly generate graphs (r),\n"
           "  Specify a graph (s),\n"
           "  Randomly generate a maximal planar graph (m), or\n"
           "  Randomly generate a non-planar graph (n)?");
    scanf(" %c", &Mode);

    Mode = tolower(Mode);
    if (!strchr("rsmn", Mode))
        Mode = 's';

    if (Mode == 'r')
    {
        Message("\nNOTE: The directories for the graphs you want must exist.\n\n");

        Prompt("Do you want original graphs in directory 'random' (last 10 max)?");
        scanf(" %c", &OrigOut);

        Prompt("Do you want adj. matrix of embeddable graphs in directory 'embedded' (last 10 max))?");
        scanf(" %c", &EmbeddableOut);

        Prompt("Do you want adj. matrix of obstructed graphs in directory 'obstructed' (last 10 max)?");
        scanf(" %c", &ObstructedOut);

        Prompt("Do you want adjacency list format of embeddings in directory 'adjlist' (last 10 max)?");
        scanf(" %c", &AdjListsForEmbeddingsOut);
    }

    FlushConsole(stdout);
}
开发者ID:graph-algorithms,项目名称:edge-addition-planarity-suite,代码行数:34,代码来源:planarityUtils.c


示例2: delete_lines

static int delete_lines(int nrows, char *rows)
{
	char input[4];
	int first, last;

	DDPut(sd[ledelstr]);
	input[0] = 0;
	if (!(Prompt(input, 3, PROMPT_NOCRLF)))
		return -1;
	if ((first = str2uint(input, 1, nrows)) == -1)
		return nrows;	

	DDPut(sd[ledeltostr]);
	input[0] = 0;
	if (!(Prompt(input, 3, 0)))
		return -1;
	if ((last = str2uint(input, 1, nrows)) == -1)
		return nrows;

	if (last < first) {
		int tmp;
		tmp = last;
		last = first;
		first = tmp;
	}

	memmove(rows + (first - 1) * 80, rows + last * 80, (nrows - last) * 80);
	return nrows - (last - first + 1);
}
开发者ID:hlyytine,项目名称:daydream,代码行数:29,代码来源:lineed.c


示例3: PromptPlugin

PPlugin	PromptPlugin (int Type)
{
	char filepath[MAX_PATH];
	PPlugin result = (PPlugin)DialogBoxParam(hInst,MAKEINTRESOURCE(IDD_SELECTPLUGIN),topHWnd,DLG_SelectPlugin,(LPARAM)Type);
	if (result == NULL)
		return NULL;

	if (result->num != 9998)
		return result;

	PromptTitle = "Specify iNES mapper number (cancel for none):\r\n(-1 to skip .NES, 9999 to skip .NES and .UNIF)";
	if (Prompt(topHWnd))
		custplug.num = atoi(PromptResult);
	else	custplug.num = -1;

	if (custplug.num != 9999)
	{
		PromptTitle = "Specify UNIF board name (cancel for none):";
		if (Prompt(topHWnd))
			strcpy(custplug.name,PromptResult);
		else if (custplug.num == -1)
			custplug.num = 9999;
	}

	while (1)
	{
		if (!PromptFile(topHWnd,"USB CopyNES Plugins (*.bin)\0*.bin\0\0\0\0", filepath, custplug.file, Path_PLUG, "Select a plugin (must be in Plugins path)", "bin", FALSE))
			return NULL;
		if (strnicmp(Path_PLUG, filepath, strlen(Path_PLUG)))
			MessageBox(topHWnd,"Selected file is not located in Plugins directory!","Select Plugin", MB_OK | MB_ICONERROR);
		else	break;
	}
	return &custplug;
}
开发者ID:bbbradsmith,项目名称:usbcopynesblue,代码行数:34,代码来源:miscdialogs.c


示例4: Prompt

    bool PasswdBackend::authenticate() {
        if (m_autologin)
            return true;

        if (m_user == "sddm") {
            if (m_greeter)
                return true;
            else
                return false;
        }

        Request r;
        QString password;

        if (m_user.isEmpty())
            r.prompts << Prompt(AuthPrompt::LOGIN_USER, "Login", false);
        r.prompts << Prompt(AuthPrompt::LOGIN_PASSWORD, "Password", true);

        Request response = m_app->request(r);
        Q_FOREACH(const Prompt &p, response.prompts) {
            switch (p.type) {
                case AuthPrompt::LOGIN_USER:
                    m_user = p.response;
                    break;
                case AuthPrompt::LOGIN_PASSWORD:
                    password = p.response;
                    break;
                default:
                    break;
            }
        }

        struct passwd *pw = getpwnam(qPrintable(m_user));
        if (!pw) {
            m_app->error(QString("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
            return false;
        }

        struct spwd *spw = getspnam(pw->pw_name);
        if (!spw) {
            qWarning() << "[Passwd] Could get passwd but not shadow";
            return false;
        }

        if(!spw->sp_pwdp || !spw->sp_pwdp[0])
            return true;

        char *crypted = crypt(qPrintable(password), spw->sp_pwdp);
        if (0 == strcmp(crypted, spw->sp_pwdp)) {
            return true;
        }

        m_app->error(QString("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
        return false;
    }
开发者ID:EricKoegel,项目名称:sddm,代码行数:55,代码来源:PasswdBackend.cpp


示例5: PromptAbortRetryIgnore

int PromptAbortRetryIgnore(const char *qtf) {
	BeepExclamation();
	return Prompt(callback(LaunchWebBrowser),
	              Ctrl::GetAppName(), CtrlImg::exclamation(), qtf, false,
	              t_("&Abort"), t_("&Retry"), t_("&Ignore"), 0,
	              AbortButtonImage(), RetryButtonImage(), Null);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:Prompt.cpp


示例6: PromptAbortRetryIgnore

int PromptAbortRetryIgnore(const char *qtf, Callback HelpDlg, const char *help) {
#ifdef PLATFORM_WIN32
	MessageBeep(MB_ICONEXCLAMATION);
#endif
	return Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(), qtf, HelpDlg, 
		          false, t_("&Abort"), t_("&Retry"), t_("&Cancel"), help);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:MyPrompt.cpp


示例7: start_display_buff

void start_display_buff(char *buff)
{
  char buffer[5];

  num_members++;
  if (moreflg)
    return;
  if (currow >= LINES - 2)
    {
      page++;
      currow++;
      mvcur(0, 0, currow, STARTCOL);
      refresh();
      if (Prompt("--RETURN for more, ctl-c to exit--", buffer, 1, 0) == 0)
	{
	  erase_line(currow, STARTCOL);
	  show_text(currow, STARTCOL, "Flushing query...");
	  moreflg = 1;
	  return;
	}
      clrwin(DISPROW + 2);
      currow = DISPROW + 2;
      show_text(currow, STARTCOL, "continued");
      currow++;
    }
  show_text(currow, STARTCOL, buff);
  currow++;
  return;
}
开发者ID:sipb,项目名称:athena-svn-mirror,代码行数:29,代码来源:mailmaint.c


示例8: FinishSave

bool FinishSave(String tmpfile, String outfile)
{
	if(IsDeactivationSave()) {
		FileMove(tmpfile, outfile);
		return true;
	}
	Progress progress;
	int time = GetTickCount();
	for(;;) {
		progress.SetTotal(10000);
		progress.SetText("Saving '" + GetFileName(outfile) + "'");
		if(!FileExists(tmpfile))
			return false;
		FileDelete(outfile);
		if(FileMove(tmpfile, outfile))
			return true;
		IdeConsoleFlush();
		Sleep(200);
		if(progress.SetPosCanceled((GetTickCount() - time) % progress.GetTotal())) {
			int art = Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(),
				"Unable to save current file.&"
				"Retry save, ignore it or save file to another location?",
				"Save as...", "Retry", "Ignore");
			if(art < 0)
				return false;
			if(art && AnySourceFs().ExecuteSaveAs())
				outfile = AnySourceFs();
			progress.SetPos(0);
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:31,代码来源:Util.cpp


示例9: PromptYesNoCancel

int PromptYesNoCancel(const char *qtf) {
	BeepQuestion();
	return Prompt(callback(LaunchWebBrowser),
	              Ctrl::GetAppName(), CtrlImg::question(), qtf, true,
	              t_("&Yes"), t_("&No"), t_("Cancel"), 0,
	              YesButtonImage(), NoButtonImage(), Null);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:Prompt.cpp


示例10: PromptRetryCancel

int PromptRetryCancel(const char *qtf) {
	BeepExclamation();
	return Prompt(callback(LaunchWebBrowser),
	              Ctrl::GetAppName(), CtrlImg::exclamation(), qtf, true,
	              t_("&Retry"), t_("Cancel"), NULL, 0,
	              RetryButtonImage(), Null, Null);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:Prompt.cpp


示例11: Prompt

int Prompt(Callback1<const String&> WhenLink,
           const char *title, const Image& icon, const char *qtf, bool okcancel,
           const char *button1, const char *button2, const char *button3,
		   int cx)
{
	return Prompt(WhenLink, title, icon, qtf, okcancel, button1, button2, button3, cx, Null, Null, Null);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:Prompt.cpp


示例12: delete_member

void delete_member(void)
{
  char *argv[3];
  char *buf;

  show_text(DISPROW, STARTCOL, "Remove yourself from a list\n");
  buf = calloc(LISTMAX, 1);
  if (Prompt("Enter List Name: ", buf, LISTSIZE, 1) == 1)
    {
      display_buff("\n");
      argv[0] = strdup(buf);
      argv[1] = strdup("user");
      argv[2] = strdup(username);
      if ((status = mr_query("delete_member_from_list", 3, argv, NULL, NULL)))
	{
	  display_buff("\n");
	  com_err(whoami, status, " found.\n");
	}
      else
	{
	  sprintf(buf, "User %s deleted from list\n", username);
	  show_text(DISPROW + 3, STARTCOL, buf);
	}
      currow = DISPROW + 4;
      show_text(DISPROW + 4, STARTCOL, "Press any Key to continue...");
      getchar();
      free(argv[0]);
      free(argv[1]);
      free(argv[2]);
    }
  free(buf);
  clrwin(DISPROW);
}
开发者ID:sipb,项目名称:athena-svn-mirror,代码行数:33,代码来源:mailmaint.c


示例13: ClearHistory

/**
* clears the buffer history, not the command history
*/
void ClearHistory()
{
	fn(ptr, SCI_SETTEXT, 0, (sptr_t)"");
	clearLogText();
	cmdVector.clear();
	Prompt();
}
开发者ID:wck01,项目名称:Basic-Excel-R-Toolkit,代码行数:10,代码来源:Console.cpp


示例14: GuiPackageResolver

bool GuiPackageResolver(const String& error, const String& path, int line)
{
prompt:
	switch(Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(),
	              error + "&while parsing package " + DeQtf(path),
		          "Edit \\& Retry", "Ignore",  "Stop")) {
	case 0:
		if(!PromptYesNo("Ignoring will damage package. Everything past the "
			            "point of error will be lost.&Do you want to continue ?"))
			goto prompt;
		return false;
	case 1: {
			TopWindow win;
			LineEdit edit;
			edit.Set(LoadFile(path));
			edit.SetCursor(edit.GetPos(line));
			win.Title(path);
			win.Add(edit.SizePos());
			win.Run();
			SaveFile(path, edit.Get());
		}
		return true;;
	case -1:
		exit(1);
	}
	return false;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:27,代码来源:Util.cpp


示例15: Exec

int Shell::Run(Client* client, Server* server){
	char buf[BUFFER_SIZE];
    if(fgets(buf, BUFFER_SIZE, stdin) == NULL)
        return SHELL_EXIT;
    buf[strlen(buf)-1] = 0;
    int res = Exec(buf, client, server);
    if(res != SHELL_EXIT)Prompt();
    return res;
}
开发者ID:allenwhale,项目名称:np,代码行数:9,代码来源:shell.cpp


示例16: shell_handler

void shell_handler() {
	printf(" ---- Shell le coquillage de l'espace V0.1 \n");
	
	while(1){
		Prompt();
		GetCmd();
		if (!ExecCmd())
			printf("Commande inconnu, tapez ''help'' pour voir la liste des commandes valides. \n");
	}
}
开发者ID:Swelo0,项目名称:prog_sys_le_retour,代码行数:10,代码来源:shell.c


示例17: CancelCommand

void CancelCommand(){

	cmdVector.clear();

	fn(ptr, SCI_APPENDTEXT, 1, (sptr_t)"\n");
	fn(ptr, SCI_AUTOCCANCEL, 0, 0);
	fn(ptr, SCI_CALLTIPCANCEL, 0, 0);

	Prompt();
}
开发者ID:wck01,项目名称:Basic-Excel-R-Toolkit,代码行数:10,代码来源:Console.cpp


示例18: CALLSTACKITEM_N

void CUploadViewImpl::HandleCommandL(TInt aCommand)
{
	CALLSTACKITEM_N(_CL("CUploadViewImpl"), _CL("HandleCommandL"));

	iNext=false; 
	MUploadCallBack* cb=iCallBack; iCallBack=0;
	if (cb) {
		switch(aCommand) {
		case Econtext_logCmdSoftkeyUpload:
			{
			TBool del=ETrue;
			Settings().GetSettingL(SETTING_DELETE_UPLOADED, del);
			MBBData* buf=MakePacketLC();
			iContainer->CloseFile();
			cb->Back(true, del, buf);
			Reporting().ShowGlobalNote(EAknGlobalConfirmationNote, _L("Queued for Upload"));
			CleanupStack::PopAndDestroy();
			}
			break;
		case Econtext_logCmdSoftkeyCancel:
			iContainer->CloseFile();
			cb->Back(false, false, 0);
			Reporting().ShowGlobalNote(EAknGlobalConfirmationNote, _L("Moved to NotShared"));
			break;
		default:
			return;
			break;
		}
	}
	if (!iNext && iCallBacks->iCount > 0) {
		iCallBack=0;
		TCallBackItem i=iCallBacks->Pop();
		Prompt(i.iFileName, i.iCallBack);
	}
	if (!iNext) {
		// if no next, just display previous view
		iCallBack=0;
		TUid statusv={1};
		AppUi()->ActivateLocalViewL(statusv);
		//CSwitchBack::NewL(iPrevView);
		*iNextViewId=iPrevView;
	} else {
		//if iNext -> save callback, remove view, reload it, faking previous view id 
		MUploadCallBack* cb=iCallBack; iCallBack=0;
		DoDeactivate();
		TUid dummy={0};
		iCallBack=cb;
		DoActivateL(iPrevView, dummy, _L8(""));
	}
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:50,代码来源:uploadview.cpp


示例19: Edit_subjects_names

void Edit_subjects_names(Sublist* sublist){
	Sublist* sub_to_edit;
	int num_of_subjects;

	do{
		if(num_of_subjects = Write_available_subjects(sublist)){	// if > 0
			printf("\n\nWybierz przedmiot do edycji nazwy (0 dla wyjscia): ");
			if(sub_to_edit = Select_subject_from_sublist(num_of_subjects, sublist)){
				printf("\nPodaj nowa nazwe dla wybranego przedmiotu (max %i znakow): ", MAX_SUBJ_DESC_LENGTH);
				Get_str(sub_to_edit->description, MIN_NAMEs_LENGTH, MAX_SUBJ_DESC_LENGTH);
			} else break;
		}
	} while(Prompt("\nCzy chcesz edytowac nazwy innych przedmiotow?"));
}
开发者ID:kneefer,项目名称:SchoolRegisterProject,代码行数:14,代码来源:main.c


示例20: main

int main(int argc, char **argv)
{
    SetAllSignals();
    switch (argc)
    {
        case 2:
        {
            if (!strcmp(argv[1], "server"))
            {
                Server();
            }
            else
            {
                Prompt();
            }
            break;
        }
        case 3:
        {
            if (!strcmp(argv[1], "client"))
            {
                Client(argv[2]);
            }
            else
            {
                Prompt();
            }
            break;
        }
        default:
        {
            Prompt();
            break;
        }
    }
    return EXIT_SUCCESS;
}
开发者ID:spolks-2013-2014-sem1,项目名称:050501_alexandrow,代码行数:37,代码来源:main.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PropListIException函数代码示例发布时间:2022-05-30
下一篇:
C++ PromiseResultUpdate函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap