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


C++ DisplayString函数代码示例

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


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

示例1: s_right_menu

void s_right_menu(void){
//-----------------------------------------------------------------------------------------------------
//  Purpose:	Display a scrolling menu for the right button
//  Rev:    1.0     Initial Release
//  Notes:          Currently displays NC State Song 
//-----------------------------------------------------------------------------------------------------
	int index = ad0/SONG;
	if (index > UNDER) end = ON;

	if (index == SHIGH  && beginning == ON){
		//beginning = OFF; 
		end = OFF;
	}
	if (end == ON && index <= SHIGH){
		offset = SHIGH - index;
		index = SHIGH + offset;
	}
	if (index<ABOVE) beginning = OFF; 
	if (index == SHIGH  && beginning == ON){
		end = OFF;
	}
	if (end == ON && index >= LIMIT_A) beginning = ON;
	if (index+ABOVE == LENGTH) {
		DisplayString(LCD_LINE1, "STOP     ");
		DisplayString(LCD_LINE2, "STOP     ");
	}
	else {
		DisplayString(LCD_LINE1, r_menu[index].lyric);
		DisplayString(LCD_LINE2, r_menu[index].color);
	}
}
开发者ID:agyoungs,项目名称:beefybot,代码行数:31,代码来源:menus.c

示例2: EMMMessage

static int EMMMessage(void)
{
     static char MouseErrMsg1[]="·¢ÏÖEMM386ÒѾ­ÔËÐÐ,ÈôÄúÔÚÔËÐб¾";
     static char MouseErrMsg2[]="Èí¼þ¹ý³ÌÖз¢ÏÖÓÐÒì³££¬Çë¹Ø±ÕEMM386¡£";
     static char MouseErrMsg3[]="[½«Config.sysÖÐµÄ device=EMM386 ɾ³ý";
     static char MouseErrMsg4[]="»òÓà REM ×¢Ê͵ô»òн¨Ò»²Ëµ¥Ñ¡Ïî]";
     static char MouseErrMsg5[]=" ÏÖÔÚÄú¿É°´<Esc>Í˳ö, ±ðµÄ¼ü½«¼ÌÐø";
     int x=getmaxx(),y=getmaxy();
     int disp_x=x/2-(strlen(MouseErrMsg2)+4)*ASC16WIDTH/2;
     int disp_y=y/2-10;
     int Result;

     setfillstyle(1,EGA_BLACK);
     bar(0,0,x,y-40);

     DisplayString(MouseErrMsg1,disp_x+4*ASC16WIDTH,disp_y-3*ASC16HIGHT-4,
               EGA_WHITE,EGA_BLACK);
     DisplayString(MouseErrMsg2,disp_x,disp_y-2*ASC16HIGHT,
               EGA_WHITE,EGA_BLACK);
     DisplayString(MouseErrMsg3,disp_x,disp_y-1*ASC16HIGHT+4,
               EGA_WHITE,EGA_BLACK);
     DisplayString(MouseErrMsg4,disp_x,disp_y-0*ASC16HIGHT+8,
               EGA_WHITE,EGA_BLACK);
     DisplayString(MouseErrMsg5,disp_x,disp_y+1*ASC16HIGHT+20,
               EGA_WHITE,EGA_BLACK);
     fflush(stdout);
     Result=getch();
     if(Result==0) getch();
     else if(Result==ESC) return(-1);

     while (kbhit()) getch();
     return 0;
}
开发者ID:Inzaghi2012,项目名称:EZP,代码行数:33,代码来源:MAINC.C

示例3: gdk_x_io_error

static int
gdk_x_io_error (Display *display)
{
  /* This is basically modelled after the code in XLib. We need
   * an explicit error handler here, so we can disable our atexit()
   * which would otherwise cause a nice segfault.
   * We fprintf(stderr, instead of g_warning() because g_warning()
   * could possibly be redirected to a dialog
   */
  if (errno == EPIPE)
    {
      g_warning ("The application '%s' lost its connection to the display %s;\n"
                 "most likely the X server was shut down or you killed/destroyed\n"
                 "the application.\n",
                 g_get_prgname (),
                 display ? DisplayString (display) : gdk_get_display_arg_name ());
    }
  else
    {
      g_warning ("%s: Fatal IO error %d (%s) on X server %s.\n",
                 g_get_prgname (),
                 errno, g_strerror (errno),
                 display ? DisplayString (display) : gdk_get_display_arg_name ());
    }

  _exit (1);
}
开发者ID:Davletvm,项目名称:gtk,代码行数:27,代码来源:gdkmain-x11.c

示例4: CoShutdown

void CoShutdown(int mode)
{
	if (!DisplayIsOn()) {
		DisplayInit();
	}

	DisplayString("Shutting down.\n");
	DisplayString("Done.\n");

	switch (mode) {
	case SD_WAIT:
		while (1)
			;
	case SD_OFF:
		HalShutdown();
		break;
	case SD_REBOOT:
		HalReboot();
		while (1)
			;
	default:
		while (1)
			;
	}
}
开发者ID:danopia,项目名称:dux,代码行数:25,代码来源:shutdown.c

示例5: gui_x_io_error

static int gui_x_io_error (Display *display) {
  /*
   *   The X I/O error handling routine.
   *
   * Arguments:
   *   "display" is the X display the error orignated from.
   *
   * Results:
   *   An X I/O error basically means we lost our connection
   *   to the X server. There is not much we can do to
   *   continue, so simply print an error message and exit.
   *
   */

  /* This is basically modelled after the code in XLib. We need
   * an explicit error handler here, so we can disable our atexit()
   * which would otherwise cause a nice segfault.
   */
  if (errno == EPIPE) {
    fprintf(SE_ERR,
    "GUI-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n",
	    gdk_display ? DisplayString(gdk_display) : gdk_display_name);
  }
  else {
    fprintf(SE_ERR,
	    "Gdk-ERROR **: Fatal IO error %d (%s) on X server %s.\n",
	    errno, basic_gui_strerror(errno),
	    gdk_display ? DisplayString(gdk_display) : gdk_display_name);
    }

#ifdef SE_NO_CHECK
  error0("gui_x_io_error.", NULL);
#endif
  exit(1);
}
开发者ID:roskakori,项目名称:sofa,代码行数:35,代码来源:basic_gui.c

示例6: s_left_menu

void s_left_menu(void){
//-----------------------------------------------------------------------------------------------------
//  Purpose:	Display a scrolling menu for the left button
//  Rev:    1.0     Initial Release
//  Notes:          Currently displays Resistor Codes  
//-----------------------------------------------------------------------------------------------------
	int index = ad0/RESISTORS;
	DisplayString(LCD_LINE1, l_menu[index].value);
	DisplayString(LCD_LINE2, l_menu[index].color);
	beginning = OFF;
	end = OFF;
}
开发者ID:agyoungs,项目名称:beefybot,代码行数:12,代码来源:menus.c

示例7: DisplayString

void Tools::DisplayCommon::DisplayMetaDataConnections( FbxObject* pObject )
{
	int totalMetaData = pObject->GetSrcObjectCount<FbxObjectMetaData>();
	if( totalMetaData > 0 )
		DisplayString( "    MetaData connections " );

	for( int i = 0; i < totalMetaData; i++ )
	{
		FbxObjectMetaData *metaData = pObject->GetSrcObject<FbxObjectMetaData>( i );
		DisplayString( "        Name: ", (char*)metaData->GetName() );
	}
}
开发者ID:ServerGame,项目名称:GameEngine,代码行数:12,代码来源:DisplayCommon.cpp

示例8: s_mid_menu

void s_mid_menu(void){
//-----------------------------------------------------------------------------------------------------
//  Purpose:	Display a scrolling menu for the middle button
//  Rev:    1.0     Initial Release
//  Notes:          Currently displays Shapes
//-----------------------------------------------------------------------------------------------------	
	int index = ad0/SHAPES;
	DisplayString(LCD_LINE1, m_menu[index]);
	if (index+ABOVE == SIZE) DisplayString(LCD_LINE2, "STOP     ");
	else	DisplayString(LCD_LINE2, m_menu[index+ABOVE]);
	beginning = OFF;
	end = OFF;
}
开发者ID:agyoungs,项目名称:beefybot,代码行数:13,代码来源:menus.c

示例9: HandleXIOError

/*
 * Interrupt handler for X IO errors
 */
static int HandleXIOError(Display *d)
{
    char msg[BUFSIZE];      
    if (errno == EPIPE) {
        sprintf(msg, "X connection to %s broken (server error - EPIPE).",
               DisplayString(d));
    } else {
        sprintf(msg, "Fatal IO error on X server %s.", DisplayString(d));
    }

    emergency_exit(gapp, FALSE, msg);
    
    /* Ideally, we don't reach this anyway ... */
    return 1;
}
开发者ID:astrotycoon,项目名称:grace,代码行数:18,代码来源:xutil.c

示例10: InitMainWnd

static BOOL
InitMainWnd(PMAIN_WND_INFO Info)
{
    HANDLE DevEnumThread;
    HMENU hMenu;

    if (!pCreateToolbar(Info))
        DisplayString(_T("error creating toolbar"));

    if (!CreateTreeView(Info))
    {
        DisplayString(_T("error creating list view"));
        return FALSE;
    }

    if (!CreateStatusBar(Info))
        DisplayString(_T("error creating status bar"));

    UpdateViewMenu(Info);

    /* make 'properties' bold */
    hMenu = GetMenu(Info->hMainWnd);
    hMenu = GetSubMenu(hMenu, 1);
    SetMenuDefaultItem(hMenu, IDC_PROP, FALSE);

    /* Create Popup Menu */
    Info->hShortcutMenu = LoadMenu(hInstance,
                                   MAKEINTRESOURCE(IDR_POPUP));
    Info->hShortcutMenu = GetSubMenu(Info->hShortcutMenu,
                                     0);
    SetMenuDefaultItem(Info->hShortcutMenu, IDC_PROP, FALSE);

    /* create seperate thread to emum devices */
    DevEnumThread = CreateThread(NULL,
                                 0,
                                 DeviceEnumThread,
                                 Info,
                                 0,
                                 NULL);
    if (!DevEnumThread)
    {
        DisplayString(_T("Failed to enumerate devices"));
        return FALSE;
    }

    CloseHandle(DevEnumThread);
    return TRUE;
}
开发者ID:RareHare,项目名称:reactos,代码行数:48,代码来源:mainwnd.c

示例11: _DisplayUrl

void _DisplayUrl(const char * caller, pUrlChainType pThisUrlChainPar)
{    
pUrlChainType pThisUrlChain = pThisUrlChainPar;

    /* process each  entry of chain */
    while (NULL != pThisUrlChain)
    {

	if (NULL != pThisUrlChain->pCompound)
	{
		DXMLAUX("\t[%s]: pCompund is not NULL, its contents are:\n", caller);

		DisplayCompound(pThisUrlChain->pCompound);
	}

	if (NULL != pThisUrlChain->pCompound)
	{

		DXMLAUX("\t[%s]: Cumulative resulting URL is :\n", caller);

		DisplayString(pThisUrlChain->pcSumm);

	}
	
	/* Go to next record of Chainwork */
	pThisUrlChain =  pThisUrlChain->pNextChain;
    };	    
}
开发者ID:metallistov20,项目名称:trafinject-1.MSVC,代码行数:28,代码来源:lists.c

示例12: RunCommand

/** Execute an external program. */
void RunCommand(const char *command) {

   const char *displayString;
   char *str;

   if(JUNLIKELY(!command)) {
      return;
   }

   displayString = DisplayString(display);

   if(!fork()) {
      close(ConnectionNumber(display));
      if(displayString && displayString[0]) {
         str = malloc(strlen(displayString) + 9);
         sprintf(str, "DISPLAY=%s", displayString);
         putenv(str);
      }
      setsid();
      execl(SHELL_NAME, SHELL_NAME, "-c", command, NULL);
      Warning(_("exec failed: (%s) %s"), SHELL_NAME, command);
      exit(EXIT_SUCCESS);
   }

}
开发者ID:bbidulock,项目名称:jwmtools,代码行数:26,代码来源:command.c

示例13: Xerror

static int Xerror(Display *d, XErrorEvent *error) {
	X_UNLOCK;

	if (getenv("X11VNC_PRINT_XERROR")) {
		fprintf(stderr, "Xerror: major_opcode: %d minor_opcode: %d error_code: %d\n",
		    error->request_code, error->minor_code, error->error_code);
	}

	if (xshm_opcode > 0 && error->request_code == xshm_opcode) {
		if (error->minor_code == X_ShmAttach) {
			char *dstr = DisplayString(dpy);
			fprintf(stderr, "\nX11 MIT Shared Memory Attach failed:\n");
			fprintf(stderr, "  Is your DISPLAY=%s on a remote machine?\n", dstr);
			if (strstr(dstr, "localhost:")) {
				fprintf(stderr, "  Note:   DISPLAY=localhost:N suggests a SSH X11 redir to a remote machine.\n");
			} else if (dstr[0] != ':') {
				fprintf(stderr, "  Note:   DISPLAY=hostname:N suggests a remote display.\n");
			}
			fprintf(stderr, "  Suggestion, use: x11vnc -display :0 ... for local display :0\n\n");
		}
	}

	interrupted(0);

	if (d) {} /* unused vars warning: */

	return (*Xerror_def)(d, error);
}
开发者ID:Apreta,项目名称:x11vnc-macosx,代码行数:28,代码来源:cleanup.c

示例14: subSubtleSingDisplayReader

VALUE
subSubtleSingDisplayReader(VALUE self)
{
  subSubtlextConnect(NULL); ///< Implicit open connection

  return rb_str_new2(DisplayString(display));
} /* }}} */
开发者ID:guns,项目名称:subtle,代码行数:7,代码来源:subtle.c

示例15: gst_gl_display_x11_new_with_display

/**
 * gst_gl_display_x11_new_with_display:
 * @display: an existing, x11 display
 *
 * Creates a new display connection from a X11 Display.
 *
 * Returns: (transfer full): a new #GstGLDisplayX11
 */
GstGLDisplayX11 *
gst_gl_display_x11_new_with_display (Display * display)
{
  GstGLDisplayX11 *ret;

  g_return_val_if_fail (display != NULL, NULL);

  GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay");

  ret = g_object_new (GST_TYPE_GL_DISPLAY_X11, NULL);

  ret->name = g_strdup (DisplayString (display));
  ret->display = display;

  ret->xcb_connection = XGetXCBConnection (ret->display);
  if (!ret->xcb_connection) {
    GST_ERROR ("Failed to open retieve XCB connection from X11 Display");
    gst_object_unref (ret);
    return NULL;
  }

  ret->foreign_display = TRUE;

  return ret;
}
开发者ID:GrokImageCompression,项目名称:gst-plugins-bad,代码行数:33,代码来源:gstgldisplay_x11.c


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