示例#1
0
EXPORT_C_(void) PADconfigure()
{
	LoadConfig();

	DisplayDialog();
	return;
}
void ScoreLoopThread::InformUser(AppData_t *app, const char* title, const char* message) {
	/* Inform user by displaying a simple dialog here */
	DisplayDialog(app, title, message);

	/* Also log title and message */
	qDebug() << title << ": " << message;
}
示例#3
0
文件: Map.cpp 项目: 88er/tutorials
void CMap::CheckForNpc(int x, int y)
{
	// Go through all of the npcs and see if we have a match for the position
	for(int i = 0; i < (int)m_vNpcs.size(); i++)
	{
		CNpc *pNpc= &m_vNpcs[i];

		// Check if this npc has the same position as the position passed in
		if(x == pNpc->GetIndex().X && y == pNpc->GetIndex().Y)
		{
			// Move the player back so they aren't on the NPC
			g_Player.MovePlayerBack();

			// Check if the npc has an action key
			if(pNpc->GetActionKey())
			{
				// Handle the action key and return
				g_ActionKeys.HandleKey(pNpc->GetActionKey(), pNpc);
				return;
			}

			// Display the NPC message, pause, then clear the input buffer and wait for a key
			char szDialog[5000] = {0};
			sprintf(szDialog, "%s: %s", pNpc->GetName(), pNpc->GetMessage());
			DisplayDialog(szDialog);
			Sleep(1000);
			FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
			getch();
			break;
		}
	}
}
示例#4
0
void CMap::CheckForNpc(int x, int y)
{
	// Go through all of the npcs and see if we have a match for the position
	for(int i = 0; i < (int)m_vNpcs.size(); i++)
	{
		CNpc *pNpc= &m_vNpcs[i];

		// Check if this npc has the same position as the position passed in
		if(x == pNpc->GetIndex().x && y == pNpc->GetIndex().y)
		{
			// If we get here, then we know that the player ran into a npc.
			// This means that we want to display some dialog since the player
			// wants to talk to this person.  We first move the player backwards
			// to it's last position so we don't smother the npc with too much love,
			// then grab the npc's message and display to the screen in a dialog box.
			g_Player.MovePlayerBack();

			// Display the message of the npc and pause.  Notice that 
			// we add the npc's name to the string so we know who's talking.
			char szDialog[5000] = {0};
			sprintf(szDialog, "%s: %s", pNpc->GetName(), pNpc->GetMessage());
			DisplayDialog(szDialog);
			break;
		}
	}
}
示例#5
0
bool CLoginManager::GetPassword(CServer &server, bool silent, wxString name /*=_T("")*/, wxString challenge /*=_T("")*/)
{
    wxASSERT(!silent || server.GetLogonType() == ASK || server.GetLogonType() == INTERACTIVE);
    wxASSERT(challenge == _T("") || server.GetLogonType() == INTERACTIVE);

    if (server.GetLogonType() == ASK)
    {
        std::list<t_passwordcache>::const_iterator iter;
        for (iter = m_passwordCache.begin(); iter != m_passwordCache.end(); iter++)
        {
            if (iter->host != server.GetHost())
                continue;
            if (iter->port != server.GetPort())
                continue;
            if (iter->user != server.GetUser())
                continue;

            server.SetUser(server.GetUser(), iter->password);
            return true;
        }
    }
    if (silent)
        return false;

    return DisplayDialog(server, name, challenge);
}
示例#6
0
void configure()
{
    initIni();
    ReadSettings();
    DisplayDialog();
    WriteSettings();
    delete spuConfig;
    spuConfig = NULL;
}
示例#7
0
void CPasswordTest::StartMainPasswordTestL()
	{
	if (iPassWin->BaseWin()->PasswordWindow(EPasswordAlways)!=KErrNone)
		{
		DisplayDialog(_L("Can't do password tests"),_L("Password window"),_L("already exists"), Client()->iGroup->GroupWin());
		AbortL();
		}
	SetPassState(EWaitForSwitchOff);
	}
示例#8
0
void ProcessIconSelect()
{
    if (IconDB) {
        DisplayDialog(IconSelectForm, IconSelectHandleEvent) ;
    }
    else {
        FrmCustomAlert(ErrorAlert,  "IconDB is not installed", "", "");
    }
}
void SetExceptions()
{
  /***************************************************************************/
  /*  - Get the Screen write access.                                         */
  /*  - Display the Exceptions Dialog.                                       */
  /*  - Process the Events in the Exceptions Dialog.                         */
  /*  - Remove the Exceptions Dialog.                                        */
  /*  - Restore the Screen write access.                                     */
  /***************************************************************************/
  GetScrAccess();
  DisplayDialog( &Dia_Excep, TRUE );
  ProcessDialog( &Dia_Excep, &Dia_Excep_Choices, TRUE, NULL );
  RemoveDialog( &Dia_Excep );
  SetScrAccess();
  xSetExceptions(ExceptionMap,sizeof(ExceptionMap) );
}
示例#10
0
文件: Map.cpp 项目: 88er/tutorials
void CMap::CheckForNpc(int x, int y)
{
	// Go through all of the npcs and see if we have a match for the position
	for(int i = 0; i < (int)m_vNpcs.size(); i++)
	{
		CNpc *pNpc= &m_vNpcs[i];

		// Check if this npc has the same position as the position passed in
		if(x == pNpc->GetIndex().X && y == pNpc->GetIndex().Y)
		{
			// Move the player back so they aren't on the NPC
			g_Player.MovePlayerBack();


//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

			// Since we have cut scenes and eventual shop keepers, we first check
			// to see if there is any action key assigned with the npc before we
			// let them speak.  If they do, we want to use that dialog and not
			// the standard dialog that they would spit out.  Like Jax's case.
			if(pNpc->GetActionKey())
			{
				// Handle the action key and return
				g_ActionKeys.HandleKey(pNpc->GetActionKey(), pNpc);
				return;
			}

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////


			// Display the NPC message, pause, then clear the input buffer and wait for a key
			char szDialog[5000] = {0};
			sprintf(szDialog, "%s: %s", pNpc->GetName(), pNpc->GetMessage());
			DisplayDialog(szDialog);
			Sleep(1000);
			FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
			getch();
			break;
		}
	}
}
示例#11
0
void CMap::CheckForNpc(int x, int y)
{
	// Go through all of the npcs and see if we have a match for the position
	for(int i = 0; i < (int)m_vNpcs.size(); i++)
	{
		CNpc *pNpc= &m_vNpcs[i];

		// Check if this npc has the same position as the position passed in
		if(x == pNpc->GetIndex().x && y == pNpc->GetIndex().y)
		{
			// Move the player back so it's not bumpin' and grinding with the npc
			g_Player.MovePlayerBack();


//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

			// Since we have cut scenes and eventual shop keepers, we first check
			// to see if there is any action key assigned with the npc before we
			// let them speak.  If they do, we want to use that dialog and not
			// the standard dialog that they would spit out.
			if(pNpc->GetActionKey())
			{
				// Handle the action key and return
				g_ActionKeys.HandleKey(pNpc->GetActionKey(), pNpc);
				return;
			}

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////


			// Display the message of the npc and pause.  Notice that 
			// we add the npc's name to the string so we know who's talking.
			char szDialog[5000] = {0};
			sprintf(szDialog, "%s: %s", pNpc->GetName(), pNpc->GetMessage());
			DisplayDialog(szDialog);
			break;
		}
	}
}
示例#12
0
bool CLoginManager::GetPassword(CServer &server, bool silent, wxString const& name, wxString const& challenge)
{
    wxASSERT(!silent || server.GetLogonType() == ASK || server.GetLogonType() == INTERACTIVE);
    wxASSERT(challenge.empty() || server.GetLogonType() == INTERACTIVE);

    if (server.GetLogonType() == ASK) {
        for (auto const& it : m_passwordCache) {
            if (it.host != server.GetHost())
                continue;
            if (it.port != server.GetPort())
                continue;
            if (it.user != server.GetUser())
                continue;

            server.SetUser(server.GetUser(), it.password);
            return true;
        }
    }
    if (silent)
        return false;

    return DisplayDialog(server, name, challenge);
}
示例#13
0
void CALLBACK SPU2configure()
{
	LOG_CALLBACK("SPU2configure()\n");
	DisplayDialog();
}
示例#14
0
文件: Dialog.c 项目: jljusten/efi-sct
EFI_STATUS
DoDialog(
  IN CHAR16                        *DialogTitle,
  IN OUT EFI_DIALOG_CONTEXT        *DialogContext
  )
/*++

Routine Description:

  The entry point to do popup menu.

Arguments:

  DialogContext The FILE_DIALOG_CONTEXT,it contains filter
  filename string.

Returns:

  EFI_SUCCESS.

--*/
{
  EFI_STATUS                      Status;
  EFI_DIALOG                      *Dialog;

  UINTN                           ConAttrib;

  if (DialogContext == NULL) {
    return EFI_INVALID_PARAMETER;
  }

  Status                = EFI_SUCCESS;

  ConAttrib             = ST->ConOut->Mode->Attribute;
  Status = BS->AllocatePool (
                 EfiBootServicesData,
                 sizeof(EFI_DIALOG),
                 (VOID*)&Dialog
                 );
  if (EFI_ERROR(Status)) {
    return EFI_OUT_OF_RESOURCES;
  }
  BS->SetMem (Dialog, sizeof(EFI_DIALOG), 0);

  Dialog->Type = DialogContext->Type;

  //
  //set Dialog Title
  //
  Dialog->Title = DialogTitle;

  if ( Dialog->Title == NULL ) {
    BS->FreePool (Dialog);
    return EFI_OUT_OF_RESOURCES;
  }

  //
  //initialize the item values
  //
  Dialog->BodyRect.TopLeft.Row      = 10;
  Dialog->BodyRect.TopLeft.Col      = 18;
  Dialog->BodyRect.BottomRight.Row  = 17;
  Dialog->BodyRect.BottomRight.Col  = 62;

  Dialog->ForeColor = EFI_POPUP_MENU_FORECOLOR;
  Dialog->BackColor = EFI_BLUE;

  //
  //initialize the default pointer and item values
  //

  Status = DisplayDialog (Dialog, DialogContext);

  FreeDialog(Dialog);

  //
  //
  //restore original console attribute
  //
  ST->ConOut->SetAttribute ( ST->ConOut,ConAttrib);

  return EFI_SUCCESS;
}
uint Cua_ActiveProcsMenu( AFILE **fpp )                                 /*701*/
{                                                                       /*701*/
  int     i, rc, MaxSymLen, SymLen, LongSymLen;                    /*811  701*/
  uint    key;                                                          /*701*/
  uchar   *cp, *buf, *SaveBuffer = NULL;                                /*701*/
  DEBFILE *pdf;                                                         /*701*/
  DIALOGCHOICE  *chptr;                                                 /*701*/
  CALLSTACKPARAM ClstkParam;                                            /*701*/
  int     buflen;
  int     ScrollBar;                                                    /*701*/

  for( ;; )                                                             /*701*/
  {                                                                     /*701*/
    chptr = &Dia_Clstk_Choices;                                         /*701*/

    MaxSymLen = VideoCols - 6;                                          /*811*/
    buflen = ( (NActFrames + 1)*(MaxSymLen+2) ) + 1 ;
    cp = buf = Talloc( buflen);                                    /*811  701*/

    LongSymLen = 0;                                                     /*811*/
    SymLen    = 0;                                                      /*811*/
    for( i = (short)NActFrames; --i >= 0;  )                            /*701*/
    {                                                                   /*701*/
     pdf = FindExeOrDllWithAddr( ActFaddrs[i] );                        /*701*/
     if(pdf != NULL )
      FormatProcName( cp, ActFaddrs[i], ActScopes[i], pdf,              /*824*/
                               ActCSAtrs[i], MaxSymLen);                /*824*/
     else
      sprintf(cp,"%08X Invalid Frame Address",ActFaddrs[i]);

     SymLen = strlen(cp);                                               /*824*/
     if( SymLen > MaxSymLen )                                           /*824*/
     {                                                                  /*824*/
      SymLen = MaxSymLen;                                               /*824*/
      cp[SymLen] = '\0';                                                /*824*/
     }                                                                  /*824*/
     if( SymLen > LongSymLen )                                          /*824*/
      LongSymLen = SymLen;                                              /*824*/
     cp += SymLen + 1;                                                  /*824*/
    }                                                                   /*824*/
    /* 906 if terminating check was removed */                          /*701*/
    {                                                                   /*824*/

     pdf = FindExeOrDllWithAddr( GetExecAddr() );                       /*901*/
     if( pdf != NULL )
      FormatProcName( cp, GetExecAddr(), ExecScope, pdf,                /*901*/
                           AppPTB.CSAtr, MaxSymLen);                    /*824*/
     else
      sprintf(cp,"%08X Invalid Frame Address",GetExecAddr() );
     SymLen = strlen(cp);                                               /*824*/
     if( SymLen > MaxSymLen )                                           /*824*/
     {                                                                  /*824*/
      SymLen = MaxSymLen;                                               /*824*/
      cp[SymLen] = '\0';                                                /*824*/
     }                                                                  /*824*/
     if( SymLen > LongSymLen )                                          /*824*/
      LongSymLen = SymLen;                                              /*824*/
    }                                                                   /*824*/

    chptr->entries = NActFrames + 1;
    chptr->labels  = buf;

    if( chptr->entries > 10 )
    {
      chptr->MaxRows = 10;
      Dia_Clstk.length = chptr->MaxRows + 8;
      ScrollBar = TRUE;
    }
    else
    {
      Dia_Clstk.length = chptr->entries + 8;
      chptr->MaxRows = chptr->entries;
      ScrollBar = FALSE;
    }

    /*************************************************************************/
    /* At this point, LongSymLen <= MaxSymLen.                               */
    /*************************************************************************/
    Dia_Clstk.width = LongSymLen + 6;
    if( Dia_Clstk.width < 36 )
      Dia_Clstk.width = 36;
    Dia_Clstk.row = (VideoRows - Dia_Clstk.length) / 2;
    Dia_Clstk.col = (VideoCols - Dia_Clstk.width) / 2;
    Dia_Clstk.Buttons[0].row = Dia_Clstk.row + chptr->MaxRows + 4;
    Dia_Clstk.Buttons[0].col = Dia_Clstk.col + 5;
    Dia_Clstk.Buttons[1].row = Dia_Clstk.row + chptr->MaxRows + 4;
    Dia_Clstk.Buttons[1].col = Dia_Clstk.col + Dia_Clstk.width - 16;
    Dia_Clstk.Buttons[2].row = Dia_Clstk.row + chptr->MaxRows + 5;
    Dia_Clstk.Buttons[2].col = Dia_Clstk.col + 5;
    Dia_Clstk.Buttons[3].row = Dia_Clstk.row + chptr->MaxRows + 5;
    Dia_Clstk.Buttons[3].col = Dia_Clstk.col + Dia_Clstk.width - 16;
    Dia_Clstk.Buttons[4].row = Dia_Clstk.row + chptr->MaxRows + 6;
    Dia_Clstk.Buttons[4].col = Dia_Clstk.col + 5;
    Dia_Clstk.Buttons[5].row = Dia_Clstk.row + chptr->MaxRows + 6;
    Dia_Clstk.Buttons[5].col = Dia_Clstk.col + Dia_Clstk.width - 16;

    if( SaveBuffer )
    {
      RemoveMsgBox( "Unwinding...", SaveBuffer );
      SaveBuffer = NULL;
    }
    DisplayDialog( &Dia_Clstk, ScrollBar );
    rc = 0;
    ClstkParam.rc = &rc;
    ClstkParam.fpp= fpp;
    key = ProcessDialog( &Dia_Clstk, &Dia_Clstk_Choices, ScrollBar,
                         (void *)&ClstkParam );
    RemoveDialog( &Dia_Clstk );

    if( rc != RECIRCULATE )
      return( key );
    else
    {
      SaveBuffer = SayMsgBox4( "Unwinding..." );
      if( key == key_a || key == key_A )
      {
        SetShowAll( TRUE );
        SetActFrames();
        SetShowAll( FALSE );
      }
      else
      {
        SetActFrames();
      }
    }
  }
}
uint  DllDialogFunction( DIALOGSHELL *shell, DIALOGCHOICE *ptr,
                         EVENT *nEvent, void *ParamBlock )
{
  switch( nEvent->Value )
  {
    case INIT_DIALOG:
    {
      /*********************************************************************/
      /* This message is sent before displaying elements in display area.  */
      /* It is to initialise the locals in the dialog function.            */
      /*  - Set the length of the field highlite bar in normal and hilite  */
      /*    arrays (used in the call to putrc).                            */
      /*  - Return zero to denote continue dialog processing.              */
      /*********************************************************************/
      int      NumOfDll, StrLen, MaxStrLen = 0;
      DEBFILE *cur_dll;
      DEBFILE *pdf;

      pdf = pnode->ExeStruct;

      cur_dll = pdf->next;
      NumOfDll = 0;
      while( cur_dll != NULL )
      {
        NumOfDll++;
        StrLen = strlen( cur_dll->DebFilePtr->fn );
        MaxStrLen = MaxStrLen > StrLen ? MaxStrLen : StrLen;
        cur_dll = cur_dll->next;
      }

      shell->width = (MaxStrLen > (MAXSHDLLWINSIZE - 6)) ? MAXSHDLLWINSIZE : (MaxStrLen + 6);

      shell->col = (VideoCols - shell->width) / 2;

      if( shell->Buttons )
        shell->Buttons[0].col = shell->col +
                                (shell->width - shell->Buttons[0].length)/2;

      ptr->entries = NumOfDll;

      hilite[1] = normal[1] = (UCHAR)shell->width - SCROLLBARCOLOFFSET - 2;
      DisplayDialog( shell, TRUE );
    }
    return( 0 );

    case ESC:
    case F10:
    case ENTER:
    {
      /*********************************************************************/
      /* This message is sent if the user clicks on the ENTER button or    */
      /* presses the ENTER key.                                            */
      /*  - Return non zero value to denote the end of dialog processing.  */
      /*********************************************************************/
      ptr->SkipRows = 0;
      return( ENTER );
    }

    default:
      return( 0 );
  }
}
/*****
* Main window dialog box procedure
*****/
long FAR PASCAL _export
WndProc(HWND hwnd, UINT message, UINT wParam, LONG lParam)
{
	HBRUSH hbrush;

	switch (message)
	{
		case WM_CREATE:
			file_sel_changed = 0;
			/* attach keyboard interface */
			if((myhookproc = SetWindowsHookEx(WH_KEYBOARD,
				(HOOKPROC)KeyboardProc, hInst,
				GetCurrentTask())) == NULL)
				ErrHandler(NULL, R_ERROR, RB_OK1, "Winfflow "
					"Error: failed to set keyboard hook.\n"
					"Keyboard interface not installed.");
			return FALSE;
		/* following four cases ctl3d specific */
		case WM_SYSCOLORCHANGE:
			Ctl3dColorChange();
			return FALSE;
		case WM_SETTEXT:
		case WM_NCPAINT:
		case WM_NCACTIVATE:
			SetWindowLong(hwnd, DWL_MSGRESULT,
				Ctl3dDlgFramePaint(hwnd, message, wParam, 
				lParam));
			return TRUE;
		/*
		* paint window background with a brush provided by the response
		* to the WM_CTLCOLOR message
		*/
		case WM_ERASEBKGND:
		{
			RECT lprc;
			HDC hdc = (HDC)wParam;

			if(hwnd != hWndMain)
				return TRUE;
			if(!background_brush)
				return TRUE;
			UnrealizeObject(background_brush);
			GetClientRect(hwnd, &lprc);
			SetBrushOrg(hdc, 0, 0);
			SelectObject(hdc, background_brush);
			FillRect(hdc, &lprc, background_brush);
			return TRUE;
		}
		case WM_SIZE:
			switch(wParam)
			{
				case SIZE_MAXIMIZED:
				case SIZE_RESTORED:
					if(!block_resize)
						DoResize(hwnd, 0);
					return FALSE;
				default:
					break;
			}
			break;
		case WM_COMMAND:
		switch(GET_COMMAND_ID)
		{
			case IDC_MAIN_ABOUT:
				DisplayDialog(hwnd, hInst,WINFFLOW_ABOUT_DIALOG,
					AboutProc);
				break;
			/* add files to the listbox */
			case IDC_MAIN_ADD:
				get_fortran_files(hwnd);
				break;

			/* double click will edit selected file */
			case IDC_MAIN_LISTBOX:
				if(GET_COMMAND_CMD == LBN_DBLCLK)
					get_selected_file(hwnd, 
						IDC_MAIN_LISTBOX);
				break;

			/* remove/edit selected file */
			case IDC_MAIN_EDIT:
			case IDC_MAIN_REMOVE:
				get_selected_file(hwnd, GET_COMMAND_ID);
				break;
			case IDC_MAIN_REMOVE_ALL:
				SendDlgItemMessage(hwnd, IDC_MAIN_LISTBOX, 
					LB_RESETCONTENT, 0, 0L);
				destroy_filelist();
				break;
			/* settings */
			case IDC_MAIN_SETTINGS:
				DisplayDialog(hwnd, hInst,
					WINFFLOW_SETTINGS_DIALOG,
					(FARPROC)SettingsProc);
				break;

			/* scan the files */
			case IDOK:
				/*
				* scan the files when the selection has changed,
				* there is no current flowgraph or when the 
				* previous scan has been aborted
				*/
				if(file_sel_changed || flow == NULL ||
					yylex_abort)
				{
					/* pick up files */
					if(!get_files_to_scan(hwnd))
						break;
					generate_flowgraph();
				}
				/* hide main window */
				ShowWindow(hWndMain, SW_HIDE);
				/* display selector dialog box */
				DisplayDialog(hwnd, hInst,
					WINFFLOW_OUTPUTSELECTOR_DIALOG,
					(FARPROC)SelectorProc);
				/* display main window again */
				ShowWindow(hWndMain, SW_RESTORE);
				break;
			case IDCANCEL:
				/* save the filelist */
				save_ini_file_data(hwnd);
				SendMessage(hWndMain, WM_CLOSE, 0, 0L);
				break;
			case IDHELP:
				WinHelp(hWndMain, "winfflow.hlp", 
					HELP_CONTEXT, WINFFLOW_MAIN_DIALOG);
				break;
		} return(FALSE);
		case WM_SYSCOMMAND:
			if(GET_COMMAND_ID == SC_CLOSE)	/* Get the close item */
			{
				SendMessage(hWndMain, WM_CLOSE, 0, 0L);
				return FALSE;
			}
			break;
		case WM_CLOSE:
			UnregisterResize(hwnd);
			DestroyWindow(hwnd);
			return FALSE;
		case WM_DESTROY:
			PostQuitMessage (0) ;
			return FALSE;
/* Ctl3d specific code */
#ifdef WIN32
		case WM_CTLCOLORBTN:
		case WM_CTLCOLORDLG:
		case WM_CTLCOLOREDIT:
		case WM_CTLCOLORLISTBOX:
		case WM_CTLCOLORMSGBOX:
		case WM_CTLCOLORSCROLLBAR:
		case WM_CTLCOLORSTATIC:
#else
		case WM_CTLCOLOR:
#endif
			hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
			if (hbrush != (HBRUSH) FALSE)
			{
				/* save this brush */
				background_brush = hbrush;
				return hbrush;
			}
			/* fall through */
		default:
			break;
	 }
	 return (DefWindowProc (hwnd, message, wParam, lParam));
}