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


C++ DRAW::draw方法代码示例

本文整理汇总了C++中DRAW::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ DRAW::draw方法的具体用法?C++ DRAW::draw怎么用?C++ DRAW::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DRAW的用法示例。


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

示例1: cntrl

main (int argc, char **argv, char **envp) {
	register c;

	if (argc > 2) {
		outerr("Usage: deco [dirname]\n",0);
		exit (1);
	}
	outerr("Demos Commander, Copyright (C) 1989-1994 Serge Vakulenko\n",0);
	palette = dflt_palette;
	EnvInit (envp);
	uid = getuid ();
	gid = getgid ();
# ifdef GROUPS
	gidnum = getgroups (sizeof(gidlist)/sizeof(gidlist[0]), (unsigned int *)gidlist);
# endif
	ppid = getppid ();
	user = username (uid);
	group = groupname (gid);
	tty = ttyname (0);
	machine = getmachine ();
#if 0
	sigign();
#else
	signal(SIGTERM, SIG_IGN);
	signal(SIGQUIT, SIG_IGN);
	signal(SIGINT, SIG_IGN);
# ifdef SIGTSTP
	signal(SIGTSTP, SIG_IGN);
# endif
#endif
	init ();
//	inithome ();
	VClear ();
/* init class dir */
	if (argc > 1)
//		chdir (argv [1]);
		left = new dir(argv [1]);
	else
		left = new dir;
	right = new dir;
	left->d.basecol = 0;
	right->d.basecol = 40;
/*-----------*/
	initfile.read();
	if (uid == 0)
		palette.dimfg = 6;
	v.VSetPalette (palette.fg, palette.bg, palette.revfg, palette.revbg,
		palette.boldfg, palette.boldbg, palette.boldrevfg, palette.boldrevbg,
		palette.dimfg, palette.dimbg, palette.dimrevfg, palette.dimrevbg);
	setdir (left, ".");
	setdir (right, ".");
	left->chdir(left->d.cwd);
	cur = left;
	draw.draw(cur, left, right);
	for (;;) {
		if (! cmdreg)
			draw.drawcursor(cur);
//		cmd.drawcmd(cur, &left, &right);
		VSync ();
		c = KeyGet ();
		if (! cmdreg)
			draw.undrawcursor(cur);
		switch (c) {
		case '+':               /* select */
		case '-':               /* unselect */
			if (! cpos && ! cmdreg && ! cur->d.status) {
				if (c == '+')
					tagall ();
				else
					untagall ();
				draw.draw(cur, left, right);
				continue;
			}
		default:
//			if (c>=' ' && c<='~' || c>=0300 && c<=0376) {
//				if (cpos || c!=' ')
//					cmd.inscmd(c);
//				continue;
//			}
			VBeep ();
			continue;
//		case cntrl ('V'):       /* quote next char */
//			cmd.inscmd(quote ());
//			continue;
//		case cntrl ('J'):       /* insert file name */
//			if (! cmdreg && ! cur->status)
//				cmd.namecmd(cur);
//			continue;
//		case cntrl ('G'):
//			cmd.delcmd();
//			continue;
//		case meta ('b'):        /* backspace */
//			if (cpos) {
//				cmd.leftcmd();
//				cmd.delcmd();
//			}
//			continue;
		case cntrl ('O'):       /* set/unset command mode */
		case cntrl ('P'):       /* set/unset command mode */
			switchcmdreg ();
//.........这里部分代码省略.........
开发者ID:kotohvost,项目名称:arvid,代码行数:101,代码来源:main.cpp

示例2: doscrreg


//.........这里部分代码省略.........
		}
		cur->d.curfile -= H;
		if (cur->d.topfile <= cur->d.curfile)
			return;
		cur->d.topfile -= H;
		if (cur->d.topfile <= 0) {
			cur->d.curfile -= cur->d.topfile;
			cur->d.topfile = 0;
		}
		break;
	case meta ('r'):          /* right */
		if (cur->d.curfile + H < cur->d.num) {
			cur->d.curfile += H;
			if (cur->d.topfile + PAGELEN (cur) > cur->d.curfile)
				return;
			cur->d.topfile += H;
			break;
		}
		if (cur->d.topfile + PAGELEN (cur) < cur->d.num) {
			cur->d.curfile = cur->d.num-1;
			cur->d.topfile += H;
			break;
		}
		if ((cur->d.curfile - cur->d.topfile) / H <
		    (cur->d.num - cur->d.topfile - 1) / H)
			cur->d.curfile = cur->d.num-1;
		return;
	case meta ('n'):          /* next page */
		if (cur->d.topfile + PAGELEN (cur) >= cur->d.num) {
			cur->d.curfile = cur->d.num-1;
		} else if (cur->d.topfile + 2 * PAGELEN (cur) >= cur->d.num) {
			cur->d.curfile = cur->d.num-1;
			cur->d.topfile = cur->d.num - PAGELEN (cur);
		} else {
			cur->d.curfile += PAGELEN (cur);
			cur->d.topfile += PAGELEN (cur);
		}
		break;
	case meta ('p'):          /* prev page */
		if (cur->d.topfile == 0) {
			cur->d.curfile = 0;
		} else {
			cur->d.curfile -= PAGELEN (cur);
			if (cur->d.topfile > cur->d.curfile)
				cur->d.topfile -= PAGELEN (cur);
			if (cur->d.topfile < 0) {
				cur->d.curfile -= cur->d.topfile;
				cur->d.topfile = 0;
			}
		}
		break;
	case cntrl ('K'):         /* find file */
		findname ();
		break;
	case cntrl ('R'):         /* reread catalog */
		reread (cur);
		break;
	case cntrl ('T'):         /* tag file */
		if ((cur->d.cat[cur->d.curfile].mode & S_IFMT) == (unsigned) S_IFREG) {
			cur->d.cat[cur->d.curfile].tag ^= 1;
			counttag (cur);
		}
		if (cur->d.curfile < cur->d.num-1) {
			/* move down */
			++cur->d.curfile;
			if (cur->d.topfile + PAGELEN (cur) - 1 < cur->d.curfile)
				cur->d.topfile = cur->d.curfile - PAGELEN (cur) + 1;
		}
		break;
//	case meta ('C'):          /* f3 */
//		if ((cur->d.cat[cur->d.curfile].mode & S_IFMT) != (unsigned) S_IFREG)
//			return;
//		view ();
//		draw.draw(cur, &left, &right);
//		return;
//	case meta ('D'):          /* f4 */
//		edit ();
//		setdir (cur==&left ? &right : &left, NULL);
//		setdir (cur, NULL);
//		draw.draw(cur, &left, &right);
//		return;
	case meta ('E'):          /* f5 */
		copy ();
		draw.draw(cur, left, right);
		return;
//	case meta ('F'):          /* f6 */
//		renmove ();
//		draw.draw(cur, &left, &right);
//		return;
//	case meta ('H'):          /* f8 */
//		mydelete ();
//		draw.draw(cur, &left, &right);
//		return;
	case cntrl ('L'):         /* status */
		setstatus ();
		draw.draw(cur, left, right);
		return;
	}
	draw.drawdir(cur, 1, left, right);
}
开发者ID:kotohvost,项目名称:arvid,代码行数:101,代码来源:main.cpp


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