Example #1
0
CString GitStatus::GetDepthString(git_depth_t depth)
{
#if 0
	CString sDepth;
	switch (depth)
	{
	case git_depth_unknown:
		sDepth.LoadString(IDS_Git_DEPTH_UNKNOWN);
		break;
	case git_depth_empty:
		sDepth.LoadString(IDS_Git_DEPTH_EMPTY);
		break;
	case git_depth_files:
		sDepth.LoadString(IDS_Git_DEPTH_FILES);
		break;
	case git_depth_immediates:
		sDepth.LoadString(IDS_Git_DEPTH_IMMEDIATE);
		break;
	case git_depth_infinity:
		sDepth.LoadString(IDS_Git_DEPTH_INFINITE);
		break;
	}
	return sDepth;
#endif
	return CString("");
}
Example #2
0
void CSkillDialog::OnBnClickedSkillRemoveButton()
{
	// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.

	POSITION	position	= mMyListCtrl.GetFirstSelectedItemPosition();
	CString		dbIndex		= mMyListCtrl.GetItemText( mMyListCtrl.GetNextSelectedItem( position ), 0 );

	if( dbIndex.IsEmpty() )
	{
		CString textSelectTarget;
		textSelectTarget.LoadString( IDS_STRING31 );

		MessageBox( textSelectTarget, _T( "" ), MB_ICONERROR | MB_OK );
		return;
	}

	CString textDoYouDeleteIt;
	textDoYouDeleteIt.LoadString( IDS_STRING108 );

	if( IDNO == MessageBox( textDoYouDeleteIt, _T( "" ), MB_ICONWARNING | MB_YESNO ) )
	{
		return;
	}

	MSG_DWORD message;

	message.Category	= MP_RM_SKILL;
	message.Protocol	= MP_RM_SKILL_REMOVE_SYN;
	message.dwObjectID	= mPlayerIndex;
	message.dwData		= _ttoi( dbIndex );

	mApplication.Send( mServerIndex, message, sizeof( message ) );
}
Example #3
0
bool CIVConnection::HttpError(HINTERNET hFile, DWORD dwStatus)
{
	if (dwStatus == HTTP_STATUS_OK)
		return false;
	
	CString strError;
	CString strStatus;
	QueryStatusText (hFile, strStatus);

	switch (dwStatus)
	{
	case HTTP_STATUS_SERVER_ERROR:
		strError.LoadString (ERR_IDS_HTTP_INTERNAL);
		break;
	case HTTP_STATUS_NOT_FOUND:
		strError.LoadString (ERR_IDS_HTTP_NOT_FOUND);
		break;
	default:
		strError.Format (ERR_IDS_HTTP_ERROR, dwStatus, (LPCTSTR) strStatus);
	}

	SetError (  GetCommonIVError(strError) );

	return true;
}
Example #4
0
void CChildView::OnSize(UINT nType, int cx, int cy) 
{
	CWnd::OnSize(nType, cx, cy);
    if (m_hWnd && cx && cy) {
        TRACE("OnSize: width == %d, height == %d\n", cx, cy);

		// Initialize screen format
		// First time init with an hwnd
		if (m_eSurf == eNone) {
			CClientDC dc(this);
			int pixels;
			bool bWarnDepth = false;
			bool bWarnDebug = false;

			SetTimer(m_kTimerID, m_kTimerDelay, NULL);
			pixels = dc.GetDeviceCaps(BITSPIXEL) * dc.GetDeviceCaps(PLANES);
			switch (pixels) {
				case 16:
					m_eSurf = IsSSE2() ? e16BitSSE2Intrin :
						IsMMX() ? e16BitMMXIntrin : e16BitGeneric;
					break;
				case 24:
					m_eSurf =  IsSSE2() ? e24BitSSE2Intrin :
						IsMMX() ? e24BitMMXIntrin : e24BitGeneric;
					break;
				case 32:
					m_eSurf =  IsSSE2() ? e32BitSSE2Intrin :
						IsMMX() ? e32BitMMXIntrin : e32BitGeneric;
					break;
				default:
					bWarnDepth = true;
					m_eSurf =  IsSSE2() ? e32BitSSE2Intrin :
						IsMMX() ? e32BitMMXIntrin : e32BitGeneric;
					break;
			}
#ifdef _DEBUG
			bWarnDebug = true;
#endif
			if (bWarnDepth || bWarnDebug) {
				CString fmt;
				if (bWarnDepth) {
					fmt.LoadString(IDS_WARNING_BITDEPTH);
				}
				if (bWarnDepth && bWarnDebug) {
					fmt += "\n";
				}
				if (bWarnDebug) {
					CString temp;
					temp.LoadString(IDS_WARNING_DEBUG);
					fmt += temp;
				}
				::AfxMessageBox(fmt, MB_ICONINFORMATION);
			}

		}

		m_bSizeChanged = true;
		CreateSurface();
    }
}
Example #5
0
// フォーム入力イベント
// checkbox, radio button 押下時
void CRsfSimpleForm::OnChgForm() 
{
	// TODO: この位置にコントロール通知ハンドラ用のコードを追加してください

	// checkboxの併用チェック
	CButton *chk_audio = (CButton *)GetDlgItem(IDC_CHK_AUDIO);
	CButton *chk_chat = (CButton *)GetDlgItem(IDC_CHK_CHAT);
	CButton *chk_img = (CButton *)GetDlgItem(IDC_CHK_IMG);
	CButton *chk_video = (CButton *)GetDlgItem(IDC_CHK_VIDEO);
	if (chk_img->GetCheck() && chk_video->GetCheck()) {
		UpdateData(FALSE);	// ボタン状態を戻す
		CString str;
		str.LoadString(IDS_MSGBOX58);
		AfxMessageBox(str, MB_OK | MB_APPLMODAL | MB_ICONINFORMATION);
		return;
	}
	if (!chk_audio->GetCheck() && !chk_chat->GetCheck() && 
		!chk_img->GetCheck() && !chk_video->GetCheck()) {
			UpdateData(FALSE);	// ボタン状態を戻す
			CString str;
			str.LoadString(IDS_MSGBOX59);
			AfxMessageBox(str, MB_OK | MB_APPLMODAL | MB_ICONINFORMATION);
			return;
	}

	/// RSFファイルの更新
	UpdateFile();
}
Example #6
0
void CSkillDialog::OnBnClickedSkillLogButton()
{
	// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
	CLogDialog* dialog = mApplication.GetLogDialog();

	if( dialog )
	{
		CString textSkill;
		textSkill.LoadString( IDS_STRING365 );

		CString textLog;
		textLog.LoadString( IDS_STRING10 );

		CString title;
		title.Format(
			_T( "%s %s: %s(%d)" ),
			textSkill,
			textLog,
			mPlayerName,
			mPlayerIndex );
		
		dialog->DoModal(
			mServerIndex,
			CSkillLogCommand( mApplication, title, mPlayerIndex ) );
	}
}
Example #7
0
//Авторские права - VTOOLS.RU (info@vtools.ru)
// ReportManager.cpp: implementation of the CReportManager class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ReportManager.h"
#include "Compiler\ChooseValue.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CReportManager::CReportManager()
{
	csTitle="Выбор";
	bSmall=FALSE;
}
 
CReportManager::~CReportManager()
{

}

void CReportManager::OnFileNew()
{
	CChooseValue dlg;
	CArray <CDocTemplate*,CDocTemplate*> listTemlate;
	POSITION pos=GetFirstDocTemplatePosition();
	for(int i=0;i<aDescription.GetSize();i++)
	{
		CDocTemplate* pTemplate=GetNextDocTemplate(pos);
		if(aDescription[i].bCanVisible)
		{
			dlg.List.Add(aDescription[i].csDescription);
			dlg.ListImage.Add(aDescription[i].nImage);
			listTemlate.Add(pTemplate);
		}
	}

	dlg.nStart=0;
	dlg.csTitle=csTitle;
	dlg.nMode=0;
	if(bSmall)
		dlg.Small();

	int nResponse = IDOK;
	int nIndex=0;
	if(dlg.List.GetSize()>1)
	{
		nResponse = dlg.DoModal();
		nIndex=dlg.nRes;
	}
	if (nResponse == IDOK)
	{
		if(listTemlate.GetSize()>0)
		if(listTemlate[nIndex])
			listTemlate[nIndex]->OpenDocumentFile(NULL);
	}
}
void CReportManager::AddDocTemplate(CMultiDocTemplate *p,CString csName,CString csDescription,bool bCanView,int nImage)
{
	CDocManager::AddDocTemplate(p);
	csName.TrimLeft();
	csName.TrimRight();
	
	CReportElement data;
	data.csName=csName;
	data.csDescription=csDescription;
	data.bCanVisible=bCanView;
	data.nImage=nImage;

	aDescription.Add(data);
}

CDocument* CReportManager::OpenForm(CString csName,BOOL bVisible)
{
	if(!AfxGetMainWnd())
		return 0;

	POSITION pos=GetFirstDocTemplatePosition();
	CString csFind=mUpper(csName);
	CDocTemplate* pTemplate=NULL;
	BOOL bFind=FALSE;
	for(int i=0;i<aDescription.GetSize();i++)
	{
		pTemplate=GetNextDocTemplate(pos);

		CString csCurName=aDescription[i].csName;
		if(csFind==mUpper(csCurName))
		{
			bFind=TRUE;
			break;
		}
	}
	if(bFind)
	{
		if(pTemplate)
		{
			CDocument* pDoc=pTemplate->OpenDocumentFile(NULL,bVisible);
			((CEnterpriseApp*)AfxGetApp())->DeleteConfigName();
			return pDoc;
		}
	}
	return NULL;
}
void AFXAPI _AfxAppendFilterSuffix(CString& filter, OPENFILENAME& ofn,
	CDocTemplate* pTemplate, CString* pstrDefaultExt)
{
	ASSERT_VALID(pTemplate);
	ASSERT_KINDOF(CDocTemplate, pTemplate);

	CString strFilterExt, strFilterName;
	if (pTemplate->GetDocString(strFilterExt, CDocTemplate::filterExt) &&
	 !strFilterExt.IsEmpty() &&
	 pTemplate->GetDocString(strFilterName, CDocTemplate::filterName) &&
	 !strFilterName.IsEmpty())
	{
		// a file based document template - add to filter list
		ASSERT(strFilterExt[0] == '.');
		if (pstrDefaultExt != NULL)
		{
			// set the default extension
			*pstrDefaultExt = ((LPCTSTR)strFilterExt) + 1;  // skip the '.'
			ofn.lpstrDefExt = (LPTSTR)(LPCTSTR)(*pstrDefaultExt);
			ofn.nFilterIndex = ofn.nMaxCustFilter + 1;  // 1 based number
		}

		// add to filter
		filter += strFilterName;
		ASSERT(!filter.IsEmpty());  // must have a file type name
		filter += (TCHAR)'\0';  // next string please
		filter += (TCHAR)'*';
		filter += strFilterExt;
		filter += (TCHAR)'\0';  // next string please
		ofn.nMaxCustFilter++;
	}
}
//*/
BOOL CReportManager::DoPromptFileName(CString& fileName, UINT nIDSTitle, DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate)
{
	CFileDialog dlgFile(bOpenFileDialog);

	CString title;
	VERIFY(title.LoadString(nIDSTitle));

	dlgFile.m_ofn.Flags |= lFlags;

	CString strFilter;
	CString strDefault;
	if (pTemplate != NULL)
	{
		ASSERT_VALID(pTemplate);
		_AfxAppendFilterSuffix(strFilter, dlgFile.m_ofn, pTemplate, &strDefault);
	}
	else
	{
		// do for all doc template
		POSITION pos = m_templateList.GetHeadPosition();
		BOOL bFirst = TRUE;
		while (pos != NULL)
		{
			CDocTemplate* pTemplate = (CDocTemplate*)m_templateList.GetNext(pos);
			_AfxAppendFilterSuffix(strFilter, dlgFile.m_ofn, pTemplate,
				bFirst ? &strDefault : NULL);
			bFirst = FALSE;
		}
	}

	CString allFilter;

	// append the "*.html" files filter
	if(mUpper(strDefault)=="2C")
	{
		allFilter="Файлы HTML (*.htm)";
		strFilter += allFilter;
		strFilter += (TCHAR)'\0';   // next string please
		strFilter += _T("*.htm");
		strFilter += (TCHAR)'\0';   // last string
		dlgFile.m_ofn.nMaxCustFilter++;
	}

	// append the "*.*" all files filter
	VERIFY(allFilter.LoadString(AFX_IDS_ALLFILTER));
	strFilter += allFilter;
	strFilter += (TCHAR)'\0';   // next string please
	strFilter += _T("*.*");
	strFilter += (TCHAR)'\0';   // last string
	dlgFile.m_ofn.nMaxCustFilter++;


	dlgFile.m_ofn.lpstrFilter = strFilter;
	dlgFile.m_ofn.lpstrTitle = title;
	dlgFile.m_ofn.lpstrFile = fileName.GetBuffer(_MAX_PATH);

	int nResult = dlgFile.DoModal();
	fileName.ReleaseBuffer();
	return nResult == IDOK;
}
BOOL CPropTreeItemCombo::CreateComboBoxBool()
{
	ASSERT(m_pProp!=NULL);

	if (IsWindow(m_hWnd))
		DestroyWindow();

	// force as a non-visible child window
	DWORD dwStyle = WS_CHILD|WS_VSCROLL|CBS_SORT|CBS_DROPDOWNLIST;

	if (!Create(dwStyle, CRect(0,0,0,0), m_pProp->GetCtrlParent(), GetCtrlID()))
	{
		TRACE0("CPropTreeItemCombo::CreateComboBoxBool() - failed to create combo box\n");
		return FALSE;
	}

	SendMessage(WM_SETFONT, (WPARAM)m_pProp->GetNormalFont()->m_hObject);

	// file the combo box
	LONG idx;
	CString s;

	s.LoadString(IDS_TRUE);
	idx = AddString(s);
	SetItemData(idx, TRUE);

	s.LoadString(IDS_FALSE);
	idx = AddString(s);
	SetItemData(idx, FALSE);

	return TRUE;
}
Example #9
0
BOOL CIVFunctionSelDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    CString strHead;
    strHead.LoadString(g_hmodule, IDS_Type);
    m_FunList.InsertColumn(0, strHead,LVCFMT_LEFT, 110);
    strHead.LoadString(g_hmodule, IDS_Description);
    m_FunList.InsertColumn(1, strHead, LVCFMT_LEFT, 450);

    CString strFunctionName;
    for (int i = 0; i< IV_Name_Number; ++i)
    {
        BOOL bRc = strFunctionName.LoadString(g_hmodule, IV_Name_StringID_Start+i);
        m_FunList.InsertItem(i, strFunctionName);
        strFunctionName.LoadString(g_hmodule, IV_Name_DIR_StringID_Start+i);
        m_FunList.SetItemText(i, 1, strFunctionName);
    }

    m_FunList.SetExtendedStyle(m_FunList.GetExtendedStyle()|LVS_EX_FULLROWSELECT);
    //m_FunList.SetItemState(0,LVIS_SELECTED,LVIS_SELECTED);
    m_FunList.SetItemState(0, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);

    UpdateData(FALSE);
    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
Example #10
0
void CPullFetchDlg::OnCbnSelchangeRemote()
{
	CString remote = m_Remote.GetString();
	if (remote.IsEmpty() || remote == CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)))
	{
		GetDlgItem(IDC_STATIC_TAGOPT)->SetWindowText(_T(""));
		GetDlgItem(IDC_STATIC_PRUNE)->SetWindowText(_T(""));
		return;
	}

	CString key;
	key.Format(_T("remote.%s.tagopt"), (LPCTSTR)remote);
	CString tagopt = g_Git.GetConfigValue(key);
	if (tagopt == "--no-tags")
		tagopt.LoadString(IDS_NONE);
	else if (tagopt == "--tags")
		tagopt.LoadString(IDS_ALL);
	else
		tagopt.LoadString(IDS_FETCH_REACHABLE);
	CString value;
	value.Format(_T("%s: %s"), (LPCTSTR)CString(MAKEINTRESOURCE(IDS_DEFAULT)), (LPCTSTR)tagopt);
	GetDlgItem(IDC_STATIC_TAGOPT)->SetWindowText(value);

	key.Format(_T("remote.%s.prune"), (LPCTSTR)remote);
	CString prune = g_Git.GetConfigValue(key);
	if (prune.IsEmpty())
		prune = g_Git.GetConfigValue(_T("fetch.prune"));
	if (!prune.IsEmpty())
	{
		value.Format(_T("%s: %s"), (LPCTSTR)CString(MAKEINTRESOURCE(IDS_DEFAULT)), (LPCTSTR)prune);
		GetDlgItem(IDC_STATIC_PRUNE)->SetWindowText(value);
	}
	else
		GetDlgItem(IDC_STATIC_PRUNE)->SetWindowText(_T(""));
}
Example #11
0
BOOL CMainFrame::CreateDockingWindows()
{
	BOOL bNameValid;
	// Create output window
	CString strOutputWnd;
	bNameValid = strOutputWnd.LoadString(IDS_OUTPUT_WND);
	ASSERT(bNameValid);
	if (!m_wndOutput.Create(strOutputWnd, this, CRect(0, 0, 100, 100), TRUE, ID_VIEW_OUTPUTWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI))
	{
		TRACE0("Failed to create Output window\n");
		return FALSE; // failed to create
	}

	// Create properties window
	CString strPropertiesWnd;
	bNameValid = strPropertiesWnd.LoadString(IDS_PROPERTIES_WND);
	ASSERT(bNameValid);
	if (!m_wndProperties.Create(strPropertiesWnd, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_PROPERTIESWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
	{
		TRACE0("Failed to create Properties window\n");
		return FALSE; // failed to create
	}

	SetDockingWindowIcons(theApp.m_bHiColorIcons);
	return TRUE;
}
Example #12
0
void CSiriusView::OnPaint() 
{
    if (GetListCtrl().GetItemCount() == 0)  { // show empty list message
        CPaintDC dc( this );
        int nSavedDC = dc.SaveDC();
        
        CRect rc;
        GetClientRect( &rc );
        
        CHeaderCtrl* pHC;
        pHC = GetListCtrl().GetHeaderCtrl();
        if (pHC != NULL) {
            CRect rcH;
            pHC->GetItemRect( 0, &rcH );
            rc.top += rcH.bottom;
        }
        rc.top += 10;
        
        CString strText;
        if (g_bStarted)
			strText.LoadString(IDS_NODATA);
		else
			strText.LoadString(IDS_BEGIN);
        
        dc.SetTextColor( ::GetSysColor( COLOR_WINDOWTEXT ) );
        dc.SetBkColor( ::GetSysColor( COLOR_WINDOW ) );
        dc.SelectStockObject( ANSI_VAR_FONT );
        dc.DrawText( strText, rc, DT_CENTER | DT_WORDBREAK | DT_NOPREFIX | DT_NOCLIP );
        
        dc.RestoreDC(nSavedDC);
    }
    else {
        Default();
    }
}
Example #13
0
BOOL CMainFrame::CreateDockingWindows()
{
	BOOL bNameValid;

	// Create file view
	CString strFileView;
	bNameValid = strFileView.LoadString(IDS_FILE_VIEW);
	ASSERT(bNameValid);
	if (!m_wndFileView.Create(strFileView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_FILEVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT| CBRS_FLOAT_MULTI))
	{
		TRACE0("Failed to create File View window\n");
		return FALSE; // failed to create
	}

	// Create output window
	CString strOutputWnd;
	bNameValid = strOutputWnd.LoadString(IDS_OUTPUT_WND);
	ASSERT(bNameValid);
	if (!m_wndOutput.Create(strOutputWnd, this, CRect(0, 0, 100, 100), TRUE, ID_VIEW_OUTPUTWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI))
	{
		TRACE0("Failed to create Output window\n");
		return FALSE; // failed to create
	}

	SetDockingWindowIcons(theApp.m_bHiColorIcons);
	return TRUE;
}
Example #14
0
BOOL CPlayerToolBar::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult)
{
    TOOLTIPTEXT* pTTT = (TOOLTIPTEXT*)pNMHDR;

    UINT_PTR nID = pNMHDR->idFrom;
    if (pTTT->uFlags & TTF_IDISHWND) {
        nID = ::GetDlgCtrlID((HWND)nID);
    }

    if (nID != ID_VOLUME_MUTE) {
        return FALSE;
    }

    CToolBarCtrl& tb = GetToolBarCtrl();
    TBBUTTONINFO bi;
    bi.cbSize = sizeof(bi);
    bi.dwMask = TBIF_IMAGE;
    tb.GetButtonInfo(ID_VOLUME_MUTE, &bi);

    static CString strTipText;
    if (bi.iImage == 12) {
        strTipText.LoadString(ID_VOLUME_MUTE);
    } else if (bi.iImage == 13) {
        strTipText.LoadString(ID_VOLUME_MUTE_ON);
    } else if (bi.iImage == 14) {
        strTipText.LoadString(ID_VOLUME_MUTE_DISABLED);
    } else {
        return FALSE;
    }
    pTTT->lpszText = (LPWSTR)(LPCWSTR)strTipText;

    *pResult = 0;

    return TRUE;    // message was handled
}
Example #15
0
void InputPinDialog::OnOK() 
{
    long    num = 0;
    CString str = "";
    CEdit   *p = (CEdit *)GetDlgItem( IDC_EDIT_PIN );
    p->GetWindowText( str );
    if ( str.GetLength() > 0 )
        num = atol( str );
    if ( str.GetLength() < 6 ) {
        // 注: 0 で始まる6桁の数字もあり得る(ことがわかった)
        CString ttl = _T("");
        CString msg = _T("");

        ttl.LoadString(IDS_TTL_INPUT_PIN);
        msg.LoadString(IDS_TXT_INPUT_PIN);
        MessageBox( msg, ttl, MB_OK|MB_ICONWARNING );
        return;
    }

    char    buf[64];
    m_pin  = _T("00000");
    m_pin += ltoa( num, buf, 10 );
    m_pin  = m_pin.Right(6);

	CDialog::OnOK();
}
Example #16
0
UINT PerformanceMonitor::PrepareMenu(CMenu* menu, UINT /*id_first*/,
                                     UINT /*id_last*/) {
  menu->AppendMenu(MF_SEPARATOR);

  CString text;
  text.LoadString(ID_MONITOR_PERFORMANCE);
  menu->AppendMenu(enabled_ ? MF_CHECKED : MF_UNCHECKED, ID_MONITOR_PERFORMANCE,
                   text);

  if (block_)
    text.LoadString(IDS_BLOCKING);
  else
    text.LoadString(IDS_NOT_BLOCKING);
  menu->AppendMenu(MF_GRAYED, static_cast<UINT_PTR>(0), text);

  UINT flags = 0;
  if (sleep_)
    flags |= MF_CHECKED;
  if (!enabled_)
    flags |= MF_GRAYED;
  text.LoadString(ID_TRAFFIC_SLEEP);
  menu->AppendMenu(flags, ID_TRAFFIC_SLEEP, text);

  return 0;
}
Example #17
0
void CFarmLogCommand::Initialize( CListCtrl& listCtrl ) const
{
	CRect	rect;
	int		step = -1;

	listCtrl.GetClientRect( rect );

	listCtrl.InsertColumn( ++step,  _T( "log index" ), LVCFMT_LEFT, 0 );

	CString textDate;
	textDate.LoadString( IDS_STRING3 );
	listCtrl.InsertColumn( ++step, textDate, LVCFMT_LEFT, int( rect.Width() * 0.25f ) );

	CString textType;
	textType.LoadString( IDS_STRING4 );
	listCtrl.InsertColumn( ++step, textType, LVCFMT_LEFT, int( rect.Width() * 0.25f ) );

	CString textFarmIndex;
	textFarmIndex.LoadString( IDS_STRING11 );
	listCtrl.InsertColumn( ++step, textFarmIndex, LVCFMT_RIGHT, int( rect.Width() * 0.25f ) );

	listCtrl.InsertColumn( ++step, _T( "Zone" ), LVCFMT_LEFT, int( rect.Width() * 0.25f ) );

	CString textPlayer;
	textPlayer.LoadString( IDS_STRING54 );
	listCtrl.InsertColumn( ++step, textPlayer,	LVCFMT_LEFT, int( rect.Width() * 0.25f ) );

	CString textValue;
	textValue.LoadString( IDS_STRING152 );
	listCtrl.InsertColumn( ++step, textValue + _T( " 1" ),	LVCFMT_RIGHT, int( rect.Width() * 0.25f ) );
	listCtrl.InsertColumn( ++step, textValue + _T( " 2" ),	LVCFMT_RIGHT, int( rect.Width() * 0.25f ) );
}
Example #18
0
void CSkillDialog::OnBnClickedSkillAddButton()
{
	POSITION	position	= mEnableListCtrl.GetFirstSelectedItemPosition();
	CString		index		= mEnableListCtrl.GetItemText( mEnableListCtrl.GetNextSelectedItem( position ), 0 );

	const ActiveSkillScript* script = mApplication.GetActiveSkillScript( _ttoi( index ) );

	if( ! script )
	{
		CString textSelectTarget;
		textSelectTarget.LoadString( IDS_STRING31 );

		MessageBox( textSelectTarget, _T( "" ), MB_ICONERROR | MB_OK );
		return;
	}
	
	CString textDoYouAddIt;
	textDoYouAddIt.LoadString( IDS_STRING201 );

	if( IDNO == MessageBox( textDoYouAddIt, _T( "" ), MB_ICONWARNING | MB_YESNO ) )
	{
		return;
	}

	MSG_DWORD message;
	ZeroMemory( &message, sizeof( message ) );
	message.Category	= MP_RM_SKILL;
	message.Protocol	= MP_RM_SKILL_ADD_SYN;
	message.dwObjectID	= mPlayerIndex;
	message.dwData		= script->mIndex;

	mApplication.Send( mServerIndex, message, sizeof( message ) );
}
Example #19
0
UINT CMessageBox::Show(HWND hWnd, UINT nMessage, UINT nCaption, UINT uType, LPCTSTR sHelpPath)
{
	CString sMessage;
	CString sCaption;
	sMessage.LoadString(nMessage);
	sCaption.LoadString(nCaption);
	return CMessageBox::Show(hWnd, sMessage, sCaption, uType, sHelpPath);
}
Example #20
0
void CGlobalSetting::OnBnClickedBtnConnect()
{
	// TODO: 在此添加控件通知处理程序代码

	UpdateData(TRUE);

	GetDlgItem(IDC_BTN_CONNECT)->EnableWindow(FALSE);

	m_pIni->WriteString(_T("RemoteServer"),_T("ServerIP"),m_strEditServerIP);
	m_pIni->WriteUInt(_T("RemoteServer"),_T("ListenPort"),m_nListenPort);

	CString strResText;
	if (m_bSocketConnected)
	{
		::SendMessage(GetParent()->GetParent()->GetSafeHwnd(),WM_DISCONNECT_SOCKET,0,0);

		m_bSocketConnected = FALSE;
	}
	else
	{
		DWORD dwErrorCode = ::SendMessage(GetParent()->GetParent()->GetSafeHwnd(),WM_CONNECT_SOCKET,0,0);

		if (dwErrorCode != 0)
		{
			strResText = CUtils::GetErrorMsg(dwErrorCode);
			MessageBox(strResText);

			GetDlgItem(IDC_BTN_CONNECT)->EnableWindow(TRUE);
			return;
		}

		/*
		if (!m_bSocketConnected)
		{
			strResText.LoadString(IDS_MSG_CONNECT_FAIL);
			
		}
		*/

		m_pIni->WriteString(_T("RemoteServer"),_T("ServerIP"),m_strEditServerIP);
		m_pIni->WriteUInt(_T("RemoteServer"),_T("ListenPort"),m_nListenPort);

		CDialogEx::OnOK();
	}

	if (m_bSocketConnected)
	{
		strResText.LoadString(IDS_DISCONNECT);
	}
	else
	{
		strResText.LoadString(IDS_CONNECT);
	}

	SetDlgItemText(IDC_BTN_CONNECT,strResText);

	GetDlgItem(IDC_BTN_CONNECT)->EnableWindow(TRUE);
}
Example #21
0
BOOL CMainFrame::CreateDockingWindows()
{
	BOOL bNameValid;

	// 创建类视图
	CString strClassView;
	bNameValid = strClassView.LoadString(IDS_CLASS_VIEW);
	ASSERT(bNameValid);
	if (!m_wndClassView.Create(strClassView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_CLASSVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
	{
		TRACE0("未能创建“类视图”窗口\n");
		return FALSE; // 未能创建
	}

	// 创建文件视图
	CString strFileView;
	bNameValid = strFileView.LoadString(IDS_FILE_VIEW);
	ASSERT(bNameValid);
	if (!m_wndFileView.Create(strFileView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_FILEVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT| CBRS_FLOAT_MULTI))
	{
		TRACE0("未能创建“文件视图”窗口\n");
		return FALSE; // 未能创建
	}

	// 创建资源视图
	CString strResourceView;
	bNameValid = strResourceView.LoadString(IDS_RESOURCE_VIEW);
	ASSERT(bNameValid);
	if (!m_wndResourceView.Create(strResourceView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_RESOURCE, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
	{
		TRACE0("未能创建“资源视图”窗口\n");
		return FALSE;      // 未能创建
	}

	// 创建属性窗口
	CString strPropertiesWnd;
	bNameValid = strPropertiesWnd.LoadString(IDS_PROPERTIES_WND);
	ASSERT(bNameValid);
	if (!m_wndProperties.Create(strPropertiesWnd, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_PROPERTIESWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
	{
		TRACE0("未能创建“属性”窗口\n");
		return FALSE; // 未能创建
	}

	// 创建工具箱窗口
	CString strToolBoxWnd;
	bNameValid = strToolBoxWnd.LoadString(IDS_TOOLBOX_WND);
	ASSERT(bNameValid);
	if (!m_wndToolBox.Create(strToolBoxWnd, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_TOOLBOX, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
	{
		TRACE0("未能创建“工具箱”窗口\n");
		return FALSE; // 未能创建
	}

	SetDockingWindowIcons(theApp.m_bHiColorIcons);
	return TRUE;
}
Example #22
0
UINT CMessageBox::ShowCheck(HWND hWnd, UINT nMessage, UINT nCaption, UINT uType, LPCTSTR lpRegistry, UINT nCheckMessage)
{
	CString sMessage;
	CString sCaption;
	CString sCheckMsg;
	sMessage.LoadString(nMessage);
	sCaption.LoadString(nCaption);
	sCheckMsg.LoadString(nCheckMessage);
	return CMessageBox::ShowCheck(hWnd, sMessage, sCaption, uType, lpRegistry, sCheckMsg);
}
Example #23
0
void CConnDlg :: OnKillSocket()
{
    CWysApp* pApp = (CWysApp*)AfxGetApp();
    INT iItem;
    CString szTemp;
    SCREENLINE sl;

    // get the current selection
    CWysWnd* pWnd = (CWysWnd*)pApp->m_pMainWnd;
    CListBox* pListBox = (CListBox*)GetDlgItem(IDC_LSTCONN);

    iItem = pListBox->GetCurSel();

    if (iItem == LB_ERR) {
        szTemp.LoadString(IDS_NOSEL);
        this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
        return;
    }

    // get the socket value
    // for currently selected item
    SOCKET hSocket;
    hSocket = (SOCKET)pListBox->GetItemData(iItem);
    if (hSocket == LB_ERR) {
        szTemp.LoadString(IDS_SOCKERRLST);
        this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
        return;
    }

    szTemp.LoadString(IDS_KILLSOCK);
    if (this->MessageBox(szTemp, "Kill Connection", MB_ICONQUESTION |
                         MB_YESNO | MB_DEFBUTTON2) == IDYES) {
        CWySock* pSock = (CWySock*)CAsyncSocket::FromHandle(hSocket);
        if (!pSock) {
            szTemp.LoadString(IDS_ERRNOSOCK);
            this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
            return;
        }

        // add item to screen list
        sl.uColor = COLOR_RED;
        szTemp.LoadString(IDS_SERVKILL);
        sl.szText.Format(szTemp, pSock->IPAddress);
        pWnd->AddListItem(&sl);

        // remove socket from array of connected sockets
        pSock->Close();
        pSock->m_hSocket	= INVALID_SOCKET;
        pSock->State		= FREE;

        //  refresh list
        OnRefresh();
    }
    return;
}
Example #24
0
void Message::ShowInformation(UINT idMessage, UINT idCaption)
{
    CString csCaption;
    if (idCaption != 0)
        csCaption.LoadString(idCaption);

    CString csMessage;
    csMessage.LoadString(idMessage);

    MessageBox(NULL, csMessage, csCaption, MB_OK | MB_ICONINFORMATION | MB_TOPMOST);
}
Example #25
0
BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, CMFCShellTreeCtrl& tree, CCalendarBar& calendar, int nInitialWidth)
{
	bar.SetMode2003();

	BOOL bNameValid;
	CString strTemp;
	bNameValid = strTemp.LoadString(IDS_SHORTCUTS);
	ASSERT(bNameValid);
	if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
	{
		return FALSE; // fail to create
	}

	CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();

	if (pOutlookBar == NULL)
	{
		ASSERT(FALSE);
		return FALSE;
	}

	pOutlookBar->EnableInPlaceEdit(TRUE);

	static UINT uiPageID = 1;

	// can float, can autohide, can resize, CAN NOT CLOSE
	DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE;

	CRect rectDummy(0, 0, 0, 0);
	const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	tree.Create(dwTreeStyle, rectDummy, &bar, 1200);
	bNameValid = strTemp.LoadString(IDS_FOLDERS);
	ASSERT(bNameValid);
	pOutlookBar->AddControl(&tree, strTemp, 2, TRUE, dwStyle);

	calendar.Create(rectDummy, &bar, 1201);
	bNameValid = strTemp.LoadString(IDS_CALENDAR);
	ASSERT(bNameValid);
	pOutlookBar->AddControl(&calendar, strTemp, 3, TRUE, dwStyle);

	bar.SetPaneStyle(bar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24);
	pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16);
	pOutlookBar->RecalcLayout();

	BOOL bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE);
	CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);

	bar.SetButtonsFont(&afxGlobalData.fontBold);

	return TRUE;
}
Example #26
0
void Message::Show(UINT idMessage, UINT idCaption)
{
    CString csCaption;
    if (idCaption != 0)
        csCaption.LoadString(idCaption);

    CString csMessage;
    csMessage.LoadString(idMessage);

    MessageBox(NULL, csMessage, csCaption, MB_OK | MB_TOPMOST);
}
Example #27
0
int COutputWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	m_Font.CreateStockObject(DEFAULT_GUI_FONT);

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// 탭 창을 만듭니다.
	if (!m_wndTabs.Create(CMFCTabCtrl::STYLE_FLAT, rectDummy, this, 1))
	{
		TRACE0("출력 탭 창을 만들지 못했습니다.\n");
		return -1;      // 만들지 못했습니다.
	}

	// 출력 창을 만듭니다.
	const DWORD dwStyle = LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL;

	if (!m_wndOutputBuild.Create(dwStyle, rectDummy, &m_wndTabs, 2) ||
		!m_wndOutputDebug.Create(dwStyle, rectDummy, &m_wndTabs, 3) ||
		!m_wndOutputFind.Create(dwStyle, rectDummy, &m_wndTabs, 4))
	{
		TRACE0("출력 창을 만들지 못했습니다.\n");
		return -1;      // 만들지 못했습니다.
	}

	m_wndOutputBuild.SetFont(&m_Font);
	m_wndOutputDebug.SetFont(&m_Font);
	m_wndOutputFind.SetFont(&m_Font);

	CString strTabName;
	BOOL bNameValid;

	// 탭에 목록 창을 연결합니다.
	bNameValid = strTabName.LoadString(IDS_BUILD_TAB);
	ASSERT(bNameValid);
	m_wndTabs.AddTab(&m_wndOutputBuild, strTabName, (UINT)0);
	bNameValid = strTabName.LoadString(IDS_DEBUG_TAB);
	ASSERT(bNameValid);
	m_wndTabs.AddTab(&m_wndOutputDebug, strTabName, (UINT)1);
	bNameValid = strTabName.LoadString(IDS_FIND_TAB);
	ASSERT(bNameValid);
	m_wndTabs.AddTab(&m_wndOutputFind, strTabName, (UINT)2);

	// 출력 탭을 더미 텍스트로 채웁니다.
	FillBuildWindow();
	FillDebugWindow();
	FillFindWindow();

	return 0;
}
Example #28
0
CString DropMoveCommand::Validate(const int /*nID*/, const CString& input)
{
    CString sError;

    CString sDroppath = parser.GetVal(_T("droptarget"));
    if (input.IsEmpty())
        sError.LoadString(IDS_ERR_NOVALIDPATH);
    else if (!CTSVNPath(sDroppath+_T("\\")+input).IsValidOnWindows())
        sError.LoadString(IDS_ERR_NOVALIDPATH);

    return sError;
}
Example #29
0
void CDlg::InitStaticText(void)
{
	CString sTxt;
	sTxt.LoadString(IDS_STRING9017);
	GetDlgItem(IDC_STATIC_EDIT1)->SetWindowText(sTxt);

	sTxt.LoadString(IDS_STRING9018);
	GetDlgItem(IDC_STATIC_EDIT2)->SetWindowText(sTxt);

	sTxt.LoadString(IDS_STRING9019);
	GetDlgItem(IDC_STATIC_EDIT3)->SetWindowText(sTxt);
}
void CItemShopLogCommand::SaveToExcel( DWORD serverIndex, const CListCtrl& listCtrl ) const
{
    CString textHead;
    textHead.LoadString( IDS_STRING271 );

    CString textLog;
    textLog.LoadString( IDS_STRING10 );

    CclientApp::SaveToExcel(
        textHead + textLog + _T( "-" ) + mApplication.GetServerName( serverIndex ),
        textLog,
        listCtrl );
}