コード例 #1
0
BOOL CWndTutorial::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	switch(nID)
	{
		case WIDC_LIST1: // view ctrl
			{
				CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LIST1 );
				int sel = pWndListBox->GetCurSel();
				map<int, TUTORIAL_STRING>::iterator iter = m_mapTutorial.find(pWndListBox->GetCurSel());
				m_strKeyword = iter->second.strTitle;
				CWndText* pWndText = (CWndText*)GetDlgItem( WIDC_TEXT2 );
				pWndText->m_string.Init( m_pFont, &pWndText->GetClientRect() );
				pWndText->m_string.SetString("");
				pWndText->m_string.AddParsingString(LPCTSTR(iter->second.strContents));
				pWndText->UpdateScrollBar();
			}
			break;
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
コード例 #2
0
ファイル: WndSelectCh.cpp プロジェクト: domz1/SourceFlyFF
BOOL CWndSelectCh::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	int nSelect = 0;

	switch(nID)
	{
#ifdef __CASH_AREA
		case WIDC_BT_MOVE: //Ok Button
			{
				CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LB_CHANNEL );
				char strTemp[8];
				nSelect = pWndListBox->GetCurSel() * -1;
				_itoa(nSelect, strTemp, 10);
				g_DPlay.SendDoUseItemInput(m_nItemId, strTemp);
				Destroy();
			}
			break;
		case WIDC_BT_CANCEL: //Cancel Button
			{
				Destroy();
			}
			break;
#else
		case WIDC_LISTBOX1: // view ctrl
			{
				CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LISTBOX1 );
				char strTemp[8];
				nSelect = pWndListBox->GetCurSel() * -1;
				_itoa(nSelect, strTemp, 10);
				g_DPlay.SendDoUseItemInput(m_nItemId, strTemp);
				Destroy();
			}
			break;
#endif
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
コード例 #3
0
BOOL CWndAdminCreateItem::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	ItemProp* pItemProp;
	CWndListBox* pListBox = (CWndListBox*)GetDlgItem( WIDC_CONTROL1 );
	if( nID == WIDC_ITEM_KIND || nID == WIDC_ITEM_SEX || nID == WIDC_ITEM_JOB || nID == WIDC_LEVEL )
	{
		if( message == WNM_SELCHANGE || message == EN_CHANGE )
		{
			DWORD dwLevel = 0;
			CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_LEVEL );
			CString string = pWndEdit->GetString();
			dwLevel = atoi( string );
			CWndComboBox* pWndItemKind = (CWndComboBox*)GetDlgItem( WIDC_ITEM_KIND );
			CWndComboBox* pWndItemSex = (CWndComboBox*)GetDlgItem( WIDC_ITEM_SEX );
			CWndComboBox* pWndItemJob = (CWndComboBox*)GetDlgItem( WIDC_ITEM_JOB );
			pListBox->ResetContent();
			for( int i = 0; i < prj.m_aPropItem.GetSize(); i++ )
			{
				ItemProp* pItemProp =  prj.GetItemProp( i );
				DWORD dwKind = pWndItemKind->GetItemData( pWndItemKind->GetCurSel() );
				DWORD dwSex = pWndItemSex->GetItemData( pWndItemSex->GetCurSel() );
				DWORD dwJob = pWndItemJob->GetItemData( pWndItemJob->GetCurSel() );
				if( pItemProp && ( pItemProp->dwItemKind2 == dwKind || dwKind == NULL_ID ) &&
					 ( pItemProp->dwItemSex == dwSex || dwSex == SEX_SEXLESS ) )
				{
					if( pItemProp->dwLimitLevel1 >= dwLevel && ( pItemProp->dwItemJob == dwJob || dwJob == -1 ) )
					{
						if( GetLanguage() != LANG_KOR && pItemProp->nVer >= 7 && pItemProp->bCharged == TRUE )
							continue;
						int nIndex = pListBox->AddString( MakeName( pItemProp ) );
						pListBox->SetItemDataPtr( nIndex, pItemProp );
					}
				}
			}
		}
	}
	else
	if( nID == WIDC_OK || ( nID == WIDC_CONTROL1 && message == WNM_DBLCLK ) )
	{
		CString string;
		CWndText* pWndItemName = (CWndText*)GetDlgItem( WIDC_ITEM_NAME );
		CWndText* pWndItemNum = (CWndText*)GetDlgItem( WIDC_ITEM_NUM );
		DWORD dwNum;
		if( pWndItemNum->m_string.GetLength() ) 
		{
			dwNum = _ttoi(pWndItemNum->m_string);
		}
		else 
		{
			dwNum = 1;
		}
		
		dwNum = ( dwNum == 0? 1:dwNum );
		if( pWndItemName->m_string.GetLength() ) 
		{
			CString str2;
			str2 = pWndItemName->m_string;
			string.Format( "/ci %s %d",str2, dwNum);

			ParsingCommand( string.LockBuffer(), g_pPlayer );
			string.UnlockBuffer();
		}
		else 
		{
			int nIndex = pListBox->GetCurSel();
			if( nIndex != -1 ) 	
			{
				pItemProp = (ItemProp*)pListBox->GetItemDataPtr( nIndex );
				if( pItemProp )	
				{
					string.Format( "/ci \"%s\" %d", pItemProp->szName, dwNum);
					ParsingCommand( string.LockBuffer(), g_pPlayer );
					string.UnlockBuffer();
				}
			}
		}
	//	nID = WTBID_CLOSE;
	}
	else
	if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
	{
		nID = WTBID_CLOSE;
		Destroy( TRUE );
		return TRUE;
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
}