Пример #1
0
void CWndDialog::EndSay()
{
	if( m_strArray.GetSize() )
	{
		LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
		m_string.Init( m_pFont, &lpWndCtrl->rect );
		m_string.SetEditString( *(CEditString*)m_strArray.GetAt( 0 ) );//, 0xff000000 );
		m_nCurArray = 0;
	}
	MakeKeyButton();
	MakeContextButton();
	MakeAnswerButton();
	UpdateButtonEnable();

}
Пример #2
0
static void InitTonerReplacementDlgWidgets(UIStatusWnd *wnd)
{
	if(wnd != NULL){
		GtkWidget *window = UI_DIALOG(wnd->toner_replacement_dlg)->window;

		wnd->toner_replacement_dlg->isCoverOpend = TRUE;
		wnd->toner_replacement_dlg->isModeChanged = FALSE;
		wnd->toner_replacement_dlg->isModeChangeThreadActive = FALSE;
		wnd->toner_replacement_dlg->modeChangeRetCode = RET_ERROR;

		SetTextToTextView(window, "TonerReplacementDlg_text", _(MessageStr[MAIN_MES_WAIT_MOMENT]));
		SetTextToLabel(window, "TonerReplacementDlg_Replaceable_TonerColor_label", "");
		UpdateButtonEnable(wnd, FALSE);
		wnd->toner_replacement_dlg->buttonEnableOld = FALSE;

		UpdateDialogPosition(wnd);
	}
}
Пример #3
0
void CWndDialog::OnLButtonUp( UINT nFlags, CPoint point ) 
{ 
	if( m_timer.IsTimeOut() == FALSE )
		return;

	PLAYSND( SND_INF_CLICK );
	if( m_bWordButtonEnable )
	{
		int i; for( i = 0; i < m_nWordButtonNum; i++ )
		{
			if( m_aWordButton[ i ].rect.PtInRect( point ) )
			{			
				BeginText();
				RunScript( m_aWordButton[i].szKey, m_aWordButton[i].dwParam, m_aWordButton[i].dwParam2 );
				MakeKeyButton();
				UpdateButtonEnable();
			}
		}
	}
	int i; for( i = 0; i < m_nKeyButtonNum; i++ )
	{
		if( m_aKeyButton[ i ].rect.PtInRect( point ) )
		{
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
			m_nSelectKeyButton = i;

			CWndGroupBox* pWndGroupBox = ( CWndGroupBox* )GetDlgItem( WIDC_GROUP_BOX_TITLE );
			if( pWndGroupBox )
				pWndGroupBox->SetTitle( m_aKeyButton[ m_nSelectKeyButton ].szWord );

			m_bSay = FALSE;
			BeginText();
 			LPWNDCTRL lpWndCustom1 = GetWndCtrl( WIDC_CUSTOM1 );
			if( strcmp( m_aKeyButton[ i ].szWord, prj.GetText( TID_GAME_NEW_QUEST ) ) == 0 && m_nNewQuestListNumber > 0 )
			{
				m_WndNewQuestListBox.SetVisible( TRUE );
				m_WndNewQuestListBox.SetFocus();
				m_WndCurrentQuestListBox.SetVisible( FALSE );
			}
			else if( strcmp( m_aKeyButton[ i ].szWord, prj.GetText( TID_GAME_CURRENT_QUEST ) ) == 0 && m_nCurrentQuestListNumber > 0 )
			{
				m_WndCurrentQuestListBox.SetVisible( TRUE );
				m_WndCurrentQuestListBox.SetFocus();
				m_WndNewQuestListBox.SetVisible( FALSE );
			}
			else
			{
				m_WndNewQuestListBox.SetVisible( FALSE );
				m_WndCurrentQuestListBox.SetVisible( FALSE );
				RunScript( m_aKeyButton[i].szKey, m_aKeyButton[i].dwParam, m_aKeyButton[i].dwParam2 );
			}
			MakeKeyButton();
			UpdateButtonEnable();
#else // __IMPROVE_QUEST_INTERFACE
			BeginText();
			RunScript( m_aKeyButton[i].szKey, m_aKeyButton[i].dwParam, m_aKeyButton[i].dwParam2 );
			MakeKeyButton();
			UpdateButtonEnable();
#endif // __IMPROVE_QUEST_INTERFACE
		}
	}
	for( i = 0; i < m_nContextButtonNum; i++ )
	{
		WORDBUTTON* pContextButton = &m_aContextButton[ i ];
		if( pContextButton->rect.PtInRect( point ) )
		{
			CString strKey = pContextButton->szKey;
			BeginText();
			RunScript( strKey, 0, 0 );
		}
	}
} 
Пример #4
0
void CWndDialog::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 

#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
	CWndGroupBox* pWndGroupBox = ( CWndGroupBox* )GetDlgItem( WIDC_GROUP_BOX_TITLE );
	if( pWndGroupBox )
	{
		pWndGroupBox->m_dwColor = D3DCOLOR_ARGB( 255, 128, 0, 64 );
		pWndGroupBox->SetTitle( prj.GetText( TID_GAME_DIALOG ) );
	}

	m_pNewQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperGreen.tga" )), 0xffffffff );
	m_pExpectedQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperRed.tga" )), 0xffffffff );
	m_pCurrentQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperGray.tga" )), 0xffffffff );
	m_pCompleteQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperYellow.tga" )), 0xffffffff );

	LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
	lpWndCtrl->dwWndStyle |= WBS_VSCROLL;

	static const int QUEST_LIST_SELECT_COLOR = 0xffff0000;
	static const int QUEST_LIST_LINE_SPACE = 3;

	m_WndNewQuestListBox.Create( lpWndCtrl->dwWndStyle, lpWndCtrl->rect, this, lpWndCtrl->dwWndId );
	m_WndNewQuestListBox.m_nSelectColor = QUEST_LIST_SELECT_COLOR;
	m_WndNewQuestListBox.m_nLineSpace = QUEST_LIST_LINE_SPACE;
	if( m_pNewQuestListIconTexture )
		m_WndNewQuestListBox.SetLeftMargin( m_pNewQuestListIconTexture->m_size.cx );
	m_WndNewQuestListBox.SetVisible( FALSE );

	m_WndCurrentQuestListBox.Create( lpWndCtrl->dwWndStyle, lpWndCtrl->rect, this, lpWndCtrl->dwWndId );
	m_WndCurrentQuestListBox.m_nSelectColor = QUEST_LIST_SELECT_COLOR;
	m_WndCurrentQuestListBox.m_nLineSpace = QUEST_LIST_LINE_SPACE;
	if( m_pCurrentQuestListIconTexture )
		m_WndCurrentQuestListBox.SetLeftMargin( m_pCurrentQuestListIconTexture->m_size.cx );
	m_WndCurrentQuestListBox.SetVisible( FALSE );
#endif // __IMPROVE_QUEST_INTERFACEf
	
	CWndBase* pWndBase = (CWndBase*)g_WndMng.GetApplet( APP_INVENTORY );

	if( pWndBase )
	{
		pWndBase->Destroy();
	}
	
	CMover* pMover = prj.GetMover( m_idMover );
	if( pMover == NULL ) return;
	LPCHARACTER lpCharacter = pMover->GetCharacter();

	if( lpCharacter )
	{
		m_texChar.DeleteDeviceObjects();
		m_texChar.LoadTexture( g_Neuz.m_pd3dDevice, MakePath( "char\\",lpCharacter->m_szChar ), 0xffff00ff, TRUE );
		if( lpCharacter->m_dwMusicId )
			PlayMusic( lpCharacter->m_dwMusicId, 1 );
	}
	m_nCurArray = 0;
	int i; for( i = 0; i < m_strArray.GetSize(); i++ )
	{
		CEditString* pEditString = (CEditString*) m_strArray.GetAt( i );
		safe_delete( pEditString );
	}
	m_strArray.RemoveAll();


	MakeKeyButton();
	
	m_bSay = FALSE;

	UpdateButtonEnable();
	// 윈도를 중앙으로 옮기는 부분.
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rect = GetWindowRect();
	int nWidth  = rect.Width(); 
	int nHeight = rect.Height(); 
	int x = rectRoot.left + (rectRoot.Width()  / 2) - (nWidth  / 2);
	int y = rectRoot.top  + (rectRoot.Height() / 2) - (nHeight / 2);	
	CPoint point( x, 10 );
	Move( point );

#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
	CWndQuest* pWndQuest = (CWndQuest*)g_WndMng.GetWndBase( APP_QUEST_EX_LIST );
#else // __IMPROVE_QUEST_INTERFACE
	CWndQuest* pWndQuest = (CWndQuest*)g_WndMng.GetWndBase( APP_QUEST );
#endif // __IMPROVE_QUEST_INTERFACE
	if( pWndQuest ) pWndQuest->Update();
} 
Пример #5
0
static int UpdateTimerFunc(UIStatusWnd *wnd)
{
	int ret = TRUE;
	int needQuit = TRUE;
	int doing = FALSE;
	int warningEnd = FALSE;
	int statusPossibleChange = ALERTSTAT_ERROR;
	int isReplaceMode = FALSE;
	int buttonEnable = FALSE;
	char *mainStatusString = NULL;
	char *subStatusString = NULL;

	if(wnd != NULL){
		GtkWidget *window = UI_DIALOG(wnd->toner_replacement_dlg)->window;

		if(wnd->toner_replacement_dlg->modeChangeRetCode != RET_NORMAL){
			warningEnd = TRUE;
		}else if((wnd->toner_replacement_dlg->isModeChangeThreadActive == FALSE) &&
					(wnd->toner_replacement_dlg->modeChangeRetCode == RET_NORMAL)){
			doing = TRUE;
		}

		if(doing == TRUE){
			statusPossibleChange = GetPossibleChangeValueAtAlertCode(wnd->pAlertCode);
			isReplaceMode = GetIsReplaceModeValueAtAlertCode(wnd->pAlertCode);
			if(statusPossibleChange != ALERTSTAT_ERROR){
				needQuit = FALSE;

				if(wnd->toner_replacement_dlg->isModeChanged == FALSE){
					if((statusPossibleChange == TRUE) && (isReplaceMode == TRUE)){
						wnd->toner_replacement_dlg->isModeChanged = TRUE;
						UpdateButtonEnable(wnd, TRUE);
					}
				}else{
					if(isReplaceMode != TRUE){
						needQuit = TRUE;
					}
				}
			}else{
				needQuit = TRUE;
			}

			if(needQuit == TRUE){
				HideTonerReplacementDlg(wnd);
				ret = FALSE;
			}else{
				mainStatusString = MessageStr[MAIN_MES_WAIT_MOMENT];

				if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenC")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseC")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerC"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_C];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenM")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseM")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerM"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_M];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenY")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseY")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerY"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_Y];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenK")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseK")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerK"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_K];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNRotateTonerOpen")) ||
					!(strcmp(wnd->pAlertCode, "CNRotateTonerClose"))){
					mainStatusString = MessageStr[MAIN_MES_ROTATING];
					subStatusString = MessageStr[SUB_MES_ROTATING];
					buttonEnable = FALSE;
				}

				SetTextToTextView(window, "TonerReplacementDlg_text", _(mainStatusString));
				SetTextToLabel(window, "TonerReplacementDlg_Replaceable_TonerColor_label", _(subStatusString));


				if(GetIsCoverOpenValueAtAlertCode(wnd->pAlertCode) == FALSE){
					UpdateButtonEnable(wnd, buttonEnable);
					if(wnd->toner_replacement_dlg->isCoverOpend == TRUE){
						UpdateJob(REQ_UPDATE_CONSUMABLESINFO_OF_TONERREPLACEMENT);
						wnd->toner_replacement_dlg->isCoverOpend = FALSE;
					}
				}else{
					wnd->toner_replacement_dlg->isCoverOpend = TRUE;
					if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenC")) ||
						!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenM")) ||
						!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenY")) ||
						!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenK")) ||
						!(strcmp(wnd->pAlertCode, "CNRotateTonerOpen"))){
						SetWidgetSensitive(window, "TonerReplacementDlg_Cyan_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Magenta_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Yellow_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Black_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Finish_button", TRUE);
						if(wnd->toner_replacement_dlg->buttonEnableOld == TRUE){
							SetFocus(window, "TonerReplacementDlg_text");
						}
						wnd->toner_replacement_dlg->buttonEnableOld = FALSE;
					}
				}
			}
		}else{
			if(warningEnd == TRUE){
				ShowMsgDlg(wnd, MSG_TYPE_COMMUNICATION_ERR_GET);
				ret = FALSE;
			}
		}
	}else{
		HideTonerReplacementDlg(wnd);
		ret = FALSE;
	}
	return ret;
}