本文整理汇总了C++中CString::LoadString方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::LoadString方法的具体用法?C++ CString::LoadString怎么用?C++ CString::LoadString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CString
的用法示例。
在下文中一共展示了CString::LoadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL CPropertiesGeneral::OnInitDialog() {
CPropertyPage::OnInitDialog();
CARMDlg* dlg=(CARMDlg*)this->GetParentOwner()->GetParent();
TCHAR szTemp[MAX_PATH];
arfile* arFile=(arfile*)dlg->m_lstFiles.GetItemDataPtr(dlg->m_lstFiles.GetCurSel());
HANDLE hFile;
FILETIME fileTime;
size_t fileSize;
SYSTEMTIME stUTC, stLocal;
TCITEM ti={0};
HZIP hZip;
ZIPENTRY ze;
LPTSTR pszTemp, pszBuffer, pszTok;
CString szBytes;
szBytes.LoadString(IDS_BYTES);
_tcscpy(szTemp,arFile->fileName);
*_tcsrchr(szTemp,'\\')=0;
SetDlgItemText(IDC_PROP_DESC,arFile->description);
SetDlgItemText(IDC_PROP_FILENAME,szTemp+_tcslen(szTemp)+1);
SetDlgItemText(IDC_PROP_LOCATION,szTemp);
_itot(arFile->size,szTemp,10);
_tcscat(szTemp,szBytes);
SetDlgItemText(IDC_PROP_UNCOMPRESSED,szTemp);
hFile=CreateFile(arFile->fileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
fileSize=GetFileSize(hFile,NULL);
GetFileTime(hFile,NULL,NULL,&fileTime);
FileTimeToSystemTime(&fileTime, &stUTC);
SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
CloseHandle(hFile);
_itot((int)fileSize,szTemp,10);
_tcscat(szTemp,szBytes);
SetDlgItemText(IDC_PROP_FILESIZE,szTemp);
_stprintf(szTemp,"%4d/%2d/%2d %2d:%2d:%2d",stLocal.wYear,stLocal.wMonth,stLocal.wDay,stLocal.wHour,stLocal.wMinute,stLocal.wSecond);
SetDlgItemText(IDC_PROP_MODIFIED,szTemp);
_stprintf(szTemp,"%d - ",arFile->features);
ti.mask=TCIF_TEXT;
ti.pszText=szTemp+_tcslen(szTemp);
ti.cchTextMax=MAX_PATH-(int)_tcslen(szTemp);
dlg->m_tab.GetItem(dlg->m_tab.GetCurSel(),&ti);
SetDlgItemText(IDC_PROP_FILETYPE,szTemp);
hZip=OpenZip(arFile->fileName,0,ZIP_FILENAME);
if (hZip) {
for (int c=0; GetZipItem(hZip,c,&ze)!=ZR_ARGS; c++) {
_tcslwr(ze.name);
if (!_tcsncmp(ze.name,"tune/",5) && _tcsstr(ze.name,".info")) {
pszTemp=(LPTSTR)malloc(ze.unc_size);
UnzipItem(hZip,c,pszTemp,ze.unc_size,ZIP_MEMORY);
pszBuffer=_tcsstr(pszTemp,"Colors=");
if (pszBuffer) {
pszBuffer+=7;
if (_tcschr(pszBuffer,'\r')) *_tcschr(pszBuffer,'\r')=0;
if (_tcschr(pszBuffer,'\n')) *_tcschr(pszBuffer,'\n')=0;
pszTok=_tcstok(pszBuffer,"|");
while (pszTok) {
((CListBox*)this->GetDlgItem(IDC_PROP_VARIATIONS))->AddString(pszTok);
pszTok=_tcstok(NULL,"|");
}
}
free(pszTemp);
}
}
CloseZip(hZip);
}
return FALSE;
}
示例2: OnEdit
void CQuestionnaireButtonPage::OnEdit()
{
const MSG* pMsg = GetCurrentMessage( );
int iAction = -1;
CString csTitle;
switch (WPARAM(pMsg->wParam))
{
case IDC_EDIT_PASSIV:
csTitle.LoadString(IDS_PREVIEW_PASSIV);
iAction = CButtonAppearanceSettings::ACTION_PASSIV;
break;
case IDC_EDIT_NORMAL:
csTitle.LoadString(IDS_PREVIEW_NORMAL);
iAction = CButtonAppearanceSettings::ACTION_NORMAL;
break;
case IDC_EDIT_MOUSEOVER:
csTitle.LoadString(IDS_PREVIEW_MOUSEOVER);
iAction = CButtonAppearanceSettings::ACTION_OVER;
break;
case IDC_EDIT_PRESSED:
csTitle.LoadString(IDS_PREVIEW_PRESSED);
iAction = CButtonAppearanceSettings::ACTION_PRESSED;
break;
}
// TODO Error message
if (iAction < 0)
return;
if (m_wndChoosebuttonTypes.GetCurSel() == 0) {
CEditInteractionTextDialog dlgEdit(this);
dlgEdit.Init(csTitle, m_csButtonText, m_rcArea, m_pButtonVisualSettings->m_clrFill[iAction], m_pButtonVisualSettings->m_clrLine[iAction],
m_pButtonVisualSettings->m_clrText[iAction], &m_pButtonVisualSettings->m_lf[iAction]);
if (dlgEdit.DoModal() == IDOK) {
dlgEdit.SetUserEntries(m_rcArea, m_pButtonVisualSettings->m_clrFill[iAction], m_pButtonVisualSettings->m_clrLine[iAction],
m_pButtonVisualSettings->m_clrText[iAction], &m_pButtonVisualSettings->m_lf[iAction]);
m_wndPreview[iAction].SetColors(m_pButtonVisualSettings->m_clrFill[iAction], m_pButtonVisualSettings->m_clrLine[iAction],
m_pButtonVisualSettings->m_clrText[iAction]);
m_wndPreview[iAction].SetButtonFont(&m_pButtonVisualSettings->m_lf[iAction]);
}
} else {
CEditInteractionButtonDialog dlgEdit(this);
dlgEdit.Init(csTitle, m_csButtonText, m_rcArea, m_pButtonVisualSettings->m_csFileNames[iAction],
m_pButtonVisualSettings->m_clrText[iAction], &m_pButtonVisualSettings->m_lf[iAction]);
if (dlgEdit.DoModal() == IDOK) {
dlgEdit.SetUserEntries(m_rcArea, m_pButtonVisualSettings->m_csFileNames[iAction],
m_pButtonVisualSettings->m_clrText[iAction], &m_pButtonVisualSettings->m_lf[iAction]);
m_wndPreview[iAction].SetTextColor(m_pButtonVisualSettings->m_clrText[iAction]);
m_wndPreview[iAction].SetButtonFont(&m_pButtonVisualSettings->m_lf[iAction]);
m_wndPreview[iAction].SetImage(m_pButtonVisualSettings->m_csFileNames[iAction]);
m_wndPreview[iAction].GetImageDimension(m_pButtonVisualSettings->m_siImageDimension[iAction]);
// if passive button was changed, apply to all other buttons
if (WPARAM(pMsg->wParam) == IDC_EDIT_PASSIV) {
CString csImagePath = m_pButtonVisualSettings->m_csFileNames[iAction];
int iSlashPos = csImagePath.ReverseFind('\\');
csImagePath = csImagePath.Left(iSlashPos);
m_pButtonVisualSettings->m_csFileNames[CButtonAppearanceSettings::ACTION_NORMAL] = csImagePath;
m_pButtonVisualSettings->m_csFileNames[CButtonAppearanceSettings::ACTION_NORMAL] += "\\Normal.png";
m_pButtonVisualSettings->m_csFileNames[CButtonAppearanceSettings::ACTION_OVER] = csImagePath;
m_pButtonVisualSettings->m_csFileNames[CButtonAppearanceSettings::ACTION_OVER] += "\\MouseOver.png";
m_pButtonVisualSettings->m_csFileNames[CButtonAppearanceSettings::ACTION_PRESSED] = csImagePath;
m_pButtonVisualSettings->m_csFileNames[CButtonAppearanceSettings::ACTION_PRESSED] += "\\MouseDown.png";
for (int i = 1; i < CButtonAppearanceSettings::ACTION_EVENT_COUNT; ++i) {
m_wndPreview[i].SetImage(m_pButtonVisualSettings->m_csFileNames[i]);
m_wndPreview[i].GetImageDimension(m_pButtonVisualSettings->m_siImageDimension[i]);
}
}
}
}
m_wndPreview[iAction].SetText(m_csButtonText);
}
示例3: OnCreate
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
BOOL bNameValid;
// set the visual manager and style based on persisted value
OnApplicationLook(theApp.m_nAppLook);
if (!m_wndMenuBar.Create(this))
{
TRACE0("Failed to create menubar\n");
return -1; // fail to create
}
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY);
// prevent the menu bar from taking the focus on activation
CMFCPopupMenu::SetForceMenuFocus(FALSE);
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
CString strToolBarName;
bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD);
ASSERT(bNameValid);
m_wndToolBar.SetWindowText(strToolBarName);
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
// Allow user-defined toolbars operations:
InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId);
if (!m_wndStatusBar.Create(this))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
// TODO: Delete these five lines if you don't want the toolbar and menubar to be dockable
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
// enable Visual Studio 2005 style docking window behavior
CDockingManager::SetDockingMode(DT_SMART);
// enable Visual Studio 2005 style docking window auto-hide behavior
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// Enable toolbar and docking window menu replacement
EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);
// enable quick (Alt+drag) toolbar customization
CMFCToolBar::EnableQuickCustomization();
if (CMFCToolBar::GetUserImages() == NULL)
{
// load user-defined toolbar images
if (m_UserImages.Load(_T(".\\UserImages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
}
// enable menu personalization (most-recently used commands)
// TODO: define your own basic commands, ensuring that each pulldown menu has at least one basic command.
CList<UINT, UINT> lstBasicCommands;
lstBasicCommands.AddTail(ID_FILE_NEW);
lstBasicCommands.AddTail(ID_FILE_OPEN);
lstBasicCommands.AddTail(ID_FILE_SAVE);
lstBasicCommands.AddTail(ID_FILE_PRINT);
lstBasicCommands.AddTail(ID_APP_EXIT);
lstBasicCommands.AddTail(ID_EDIT_CUT);
lstBasicCommands.AddTail(ID_EDIT_PASTE);
lstBasicCommands.AddTail(ID_EDIT_UNDO);
lstBasicCommands.AddTail(ID_APP_ABOUT);
lstBasicCommands.AddTail(ID_VIEW_STATUS_BAR);
lstBasicCommands.AddTail(ID_VIEW_TOOLBAR);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2003);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_VS_2005);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLUE);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_SILVER);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLACK);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_AQUA);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_WINDOWS_7);
CMFCToolBar::SetBasicCommands(lstBasicCommands);
//.........这里部分代码省略.........
示例4: OnInitDialog
// **************************************************************************
// OnInitDialog ()
//
// Description:
// Called immediately before the dialog box is displayed. Use opportunity
// to initialize controls.
//
// Parameters:
// none
//
// Returns:
// BOOL - TRUE.
// **************************************************************************
BOOL CKServerInterfacesPage::OnInitDialog ()
{
CListCtrl *pList = NULL;
CString strLoader;
CString strYes;
CString strNo;
int nIndex;
// Perform default processing:
CPropertyPage::OnInitDialog ();
// Get a pointer to our list control:
pList = (CListCtrl *) GetDlgItem (IDC_LIST);
ASSERT (pList != NULL);
// Initialize the image list for the interfaces. The bitmap must use a
// purple background color, RGB (255, 0, 255), so that the CImageList
// object can construct a mask. The images are 16x16 pixels. Set the
// image list background color to CLR_NONE so masked pixels will be
// transparent.
// Image number Use
// 0 not used
// 1 not used
// 2 Interface
m_cImageList.Create (IDB_COMPONENTS, 16, 4, RGB (255, 0, 255));
m_cImageList.SetBkColor (CLR_NONE);
pList->SetImageList (&m_cImageList, LVSIL_SMALL);
// Create interface column:
strLoader.LoadString (IDS_INTERFACE);
pList->InsertColumn (0, strLoader, LVCFMT_LEFT, 200);
// Create required column:
strLoader.LoadString (IDS_REQUIRED);
pList->InsertColumn (1, strLoader, LVCFMT_LEFT, 75);
// Creaete supported column:
strLoader.LoadString (IDS_SUPPORTED);
pList->InsertColumn (2, strLoader, LVCFMT_LEFT, 75);
// The server had better have been set by now (check for debug):
ASSERT (m_pServer != NULL);
// Load "Yes" and "No" strings from string resources:
strNo.LoadString (IDS_NO);
strYes.LoadString (IDS_YES);
// Loop over interfaces and set list control items (one per interface):
nIndex = 0;
while (nIndex < NUMGROUPINTERFACES)
{
switch (nIndex)
{
case 0:
// IOPCServer:
pList->InsertItem (nIndex, _T ("IOPCServer"), ILI_INTERFACE); // interface
pList->SetItemText (nIndex, 1, strYes); // required
pList->SetItemText (nIndex, 2,
m_pServer->IsIServerSupported () ? strYes : strNo); // supported
break;
case 1:
// IOPCBrowseServerAddressSpace:
pList->InsertItem (nIndex, _T ("IOPCBrowseServerAddressSpace"), ILI_INTERFACE);
pList->SetItemText (nIndex, 1, strNo);
pList->SetItemText (nIndex, 2,
m_pServer->IsIBrowsingSupported () ? strYes : strNo);
break;
case 2:
// IOPCServerPublicGroups:
pList->InsertItem (nIndex, _T ("IOPCServerPublicGroups"), ILI_INTERFACE);
pList->SetItemText (nIndex, 1, strNo);
pList->SetItemText (nIndex, 2,
m_pServer->IsIServerPublicGroupsSupported () ? strYes : strNo);
break;
case 3:
// IPersistFile:
pList->InsertItem (nIndex, _T ("IPersistFile"), ILI_INTERFACE);
pList->SetItemText (nIndex, 1, strNo);
pList->SetItemText (nIndex, 2,
m_pServer->IsIPersistFileSupported () ? strYes : strNo);
//.........这里部分代码省略.........
示例5: InitLang
void CSetEditDlg::InitLang()
{
CString strTemp;
BOOL bNameVaild = strTemp.LoadString(IDOK);
ASSERT(bNameVaild);
SetDlgItemText(IDOK, strTemp);
bNameVaild = strTemp.LoadString(IDCANCEL);
ASSERT(bNameVaild);
SetDlgItemText(IDCANCEL, strTemp);
bNameVaild = strTemp.LoadString(IDD_SYNEDIT_SET);
ASSERT(bNameVaild);
SetWindowText(strTemp);
bNameVaild = strTemp.LoadString(IDC_BUTTON_DEFAULTEXT);
ASSERT(bNameVaild);
SetDlgItemText(IDC_BUTTON_DEFAULTEXT, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_EDITFONT);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_EDITFONT, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_EDITSTYLE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_EDITSTYLE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_EDITSIZE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_EDITSIZE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_BACK);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_BACK, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_LINEOUTLINE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_LINEOUTLINE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_SYN);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_SYN, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_TEXT);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_TEXT, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_BACKOUTLINE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_BACKOUTLINE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_TYPE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_TYPE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_LINENUMBER);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_LINENUMBER, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_BACKSELACTIVE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_BACKSELACTIVE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_STRING);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_STRING, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_LINENUMBERBACK);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_LINENUMBERBACK, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_BACKSELINACTIVE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_BACKSELINACTIVE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_NUMBER);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_NUMBER, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_SIDEBAR);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_SIDEBAR, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_TEXTSELACTIVE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_TEXTSELACTIVE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_CHAR);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_CHAR, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_LINK);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_LINK, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_TEXTSELINACTIVE);
ASSERT(bNameVaild);
SetDlgItemText(IDC_STATIC_COLOR_TEXTSELINACTIVE, strTemp);
bNameVaild = strTemp.LoadString(IDC_STATIC_COLOR_COMMENT);
//.........这里部分代码省略.........
示例6: goPreRender
//.........这里部分代码省略.........
stop(*_PlayingNodes[k]);
}
// yes -> trigger the fx
play(*_PlayingNodes[k]);
}
else if (!_PlayingNodes[k]->getPSPointer()->hasParticles()) // fx is being shut down, stop it when necessary
{
stop(*_PlayingNodes[k]); // no more particles so stop the system
}
}
else
{
if (!_PlayingNodes[k]->getTriggerAnim().empty())
{
if (_PlayingNodes[k]->getPSModel()->hasActiveEmitters())
{
// see if anim if already playing. If this is not the case then shutdown the emitters
if (!currAnims.count(_PlayingNodes[k]->getTriggerAnim()))
{
_PlayingNodes[k]->getPSModel()->activateEmitters(false);
}
}
}
}
}
}
}
if (_ActiveNode)
{
// display number of particles for the currently active node
if (currNumParticles != _LastCurrNumParticles || maxNumParticles != _LastMaxNumParticles)
{
CString numParts;
numParts.LoadString(IDS_NUM_PARTICLES);
numParts += CString(NLMISC::toString("%d / %d",(int) currNumParticles, (int) maxNumParticles).c_str());
GetDlgItem(IDC_NUM_PARTICLES)->SetWindowText((LPCTSTR) numParts);
_LastCurrNumParticles = currNumParticles;
_LastMaxNumParticles = maxNumParticles;
}
// display max number of wanted faces
NLMISC::CMatrix camMat = ps->getScene()->getCam()->getMatrix();
sint numWantedFaces = (uint) ps->getWantedNumTris((ps->getSysMat().getPos() - camMat.getPos()).norm());
if (numWantedFaces != _LastNumWantedFaces)
{
CString numWF;
numWF.LoadString(IDS_NUM_WANTED_FACES);
numWF += CString(NLMISC::toString("%d",(int) numWantedFaces).c_str());
GetDlgItem(IDC_NUM_ASKED_FACES)->SetWindowText((LPCTSTR) numWF);
_LastNumWantedFaces = numWantedFaces;
}
// display system date
if (ps->getSystemDate() != _LastSystemDate)
{
_LastSystemDate = ps->getSystemDate();
CString sysDate;
sysDate.LoadString(IDS_SYSTEM_DATE);
sysDate += CString(NLMISC::toString("%.2f s",_LastSystemDate).c_str());
GetDlgItem(IDC_SYSTEM_DATE)->SetWindowText((LPCTSTR) sysDate);
}
}
if (_ParticleDlg)
{
CParticleWorkspace *pws = _ParticleDlg->getParticleWorkspace();
if (pws)
{
for(uint k = 0; k < pws->getNumNode(); ++k)
示例7: OnCreate
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
BOOL bNameValid;
// 基于持久值设置视觉管理器和样式
OnApplicationLook(theApp.m_nAppLook);
if (!m_wndMenuBar.Create(this))
{
TRACE0("未能创建菜单栏\n");
return -1; // 未能创建
}
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY);
// 防止菜单栏在激活时获得焦点
CMFCPopupMenu::SetForceMenuFocus(FALSE);
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME))
{
TRACE0("未能创建工具栏\n");
return -1; // 未能创建
}
CString strToolBarName;
bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD);
ASSERT(bNameValid);
m_wndToolBar.SetWindowText(strToolBarName);
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
// 允许用户定义的工具栏操作:
InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId);
if (!m_wndStatusBar.Create(this))
{
TRACE0("未能创建状态栏\n");
return -1; // 未能创建
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
// TODO: 如果您不希望工具栏和菜单栏可停靠,请删除这五行
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
// 启用 Visual Studio 2005 样式停靠窗口行为
CDockingManager::SetDockingMode(DT_SMART);
// 启用 Visual Studio 2005 样式停靠窗口自动隐藏行为
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// 启用工具栏和停靠窗口菜单替换
EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);
// 启用快速(按住 Alt 拖动)工具栏自定义
CMFCToolBar::EnableQuickCustomization();
if (CMFCToolBar::GetUserImages() == NULL)
{
// 加载用户定义的工具栏图像
if (m_UserImages.Load(_T(".\\UserImages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
}
return 0;
}
示例8: OnPaint
void CCalendarBar::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rectClient;
GetClientRect(rectClient);
dc.FillRect(rectClient, &afxGlobalData.brWindow);
if (rectClient.bottom - m_nMyCalendarsY > 0)
{
CRect rectMyCalendarsCaption = rectClient;
rectMyCalendarsCaption.top = m_nMyCalendarsY;
rectMyCalendarsCaption.bottom = rectMyCalendarsCaption.top + afxGlobalData.GetTextHeight(TRUE) * 3 / 2;
COLORREF clrText = CMFCVisualManager::GetInstance()->OnDrawPaneCaption(&dc, NULL, FALSE, rectMyCalendarsCaption, CRect(0, 0, 0, 0));
CPen* pOldPen = dc.SelectObject(&afxGlobalData.penBarShadow);
dc.MoveTo(rectMyCalendarsCaption.left - 1, rectMyCalendarsCaption.top);
dc.LineTo(rectMyCalendarsCaption.right, rectMyCalendarsCaption.top);
dc.SelectStockObject(BLACK_PEN);
dc.MoveTo(rectMyCalendarsCaption.left - 1, rectMyCalendarsCaption.bottom);
dc.LineTo(rectMyCalendarsCaption.right, rectMyCalendarsCaption.bottom);
dc.SelectObject(pOldPen);
CRect rectText = rectMyCalendarsCaption;
rectText.DeflateRect(10, 0);
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(clrText);
CFont* pOldFont = dc.SelectObject(&afxGlobalData.fontRegular);
BOOL bNameValid;
CString str;
bNameValid = str.LoadString(IDS_MYCALENDARS);
ASSERT(bNameValid);
dc.DrawText(str, rectText, DT_VCENTER | DT_LEFT | DT_SINGLELINE);
CRect rectCalendar = rectClient;
rectCalendar.top = rectMyCalendarsCaption.bottom + 5;
rectCalendar.bottom = rectCalendar.top + afxGlobalData.GetTextHeight(TRUE) * 3 / 2 - 5;
dc.FillSolidRect(rectCalendar, RGB(255, 255, 213));
rectCalendar.DeflateRect(20, 0);
m_Images.Draw(&dc, 3, rectCalendar.TopLeft(), 0);
rectCalendar.left += 20;
bNameValid = str.LoadString(IDS_CALENDAR);
ASSERT(bNameValid);
dc.SetTextColor(afxGlobalData.clrHotLinkNormalText);
dc.DrawText(str, rectCalendar, DT_VCENTER | DT_LEFT | DT_SINGLELINE);
dc.SelectObject(pOldFont);
}
}
示例9: SetTooltipText
BOOL CTryIconDriver::SetTooltipText(UINT nID)
{
CString strText;
VERIFY(strText.LoadString(nID));
return SetTooltipText(strText);
}
示例10: OnCreate
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
BOOL bNameValid;
// set the visual manager and style based on persisted value
OnApplicationLook(theApp.m_nAppLook);
CMDITabInfo mdiTabParams;
mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_ONENOTE; // other styles available...
mdiTabParams.m_bActiveTabCloseButton = TRUE; // set to FALSE to place close button at right of tab area
mdiTabParams.m_bTabIcons = FALSE; // set to TRUE to enable document icons on MDI taba
mdiTabParams.m_bAutoColor = TRUE; // set to FALSE to disable auto-coloring of MDI tabs
mdiTabParams.m_bDocumentMenu = TRUE; // enable the document menu at the right edge of the tab area
EnableMDITabbedGroups(TRUE, mdiTabParams);
if (!m_wndMenuBar.Create(this))
{
TRACE0("Failed to create menubar\n");
return -1; // fail to create
}
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY);
// prevent the menu bar from taking the focus on activation
CMFCPopupMenu::SetForceMenuFocus(FALSE);
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
CString strToolBarName;
bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD);
ASSERT(bNameValid);
m_wndToolBar.SetWindowText(strToolBarName);
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
// Allow user-defined toolbars operations:
InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId);
if (!m_wndStatusBar.Create(this))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
// TODO: Delete these five lines if you don't want the toolbar and menubar to be dockable
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
// enable Visual Studio 2005 style docking window behavior
CDockingManager::SetDockingMode(DT_SMART);
// enable Visual Studio 2005 style docking window auto-hide behavior
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// Load menu item image (not placed on any standard toolbars):
CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0);
// create docking windows
if (!CreateDockingWindows())
{
TRACE0("Failed to create docking windows\n");
return -1;
}
m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
m_wndClassView.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndFileView);
CDockablePane* pTabbedBar = NULL;
m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
m_wndOutput.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndOutput);
m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndProperties);
// Enable enhanced windows management dialog
EnableWindowsDialog(ID_WINDOW_MANAGER, ID_WINDOW_MANAGER, TRUE);
// Enable toolbar and docking window menu replacement
EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);
// enable quick (Alt+drag) toolbar customization
CMFCToolBar::EnableQuickCustomization();
if (CMFCToolBar::GetUserImages() == NULL)
{
//.........这里部分代码省略.........
示例11: Parse
void CSkillLogCommand::Parse( const MSGROOT* message, CListCtrl& listCtrl, CProgressCtrl& progressCtrl, CStatic& resultStatic, CButton& findButton, CButton& stopButton ) const
{
switch( message->Protocol )
{
case MP_RM_SKILL_LOG_GET_ACK:
{
CString text;
const MSG_RM_SKILL_LOG* m = ( MSG_RM_SKILL_LOG* )message;
// 080401 LUJ, 이전 로그에 대한 인덱스 세트를 만들어 중복되지 않도록 체크한다
std::set< DWORD > indexSet;
{
for( int row = 0; row < listCtrl.GetItemCount(); ++row )
{
indexSet.insert( _ttoi( listCtrl.GetItemText( row, 0 ) ) );
}
}
for( DWORD i = 0; i < m->mSize; ++i )
{
const MSG_RM_SKILL_LOG::Log& data = m->mLog[ i ];
const DWORD row = listCtrl.GetItemCount();
int step = 0;
if( indexSet.end() != indexSet.find( data.mLogIndex ) )
{
continue;
}
CString text;
text.Format( _T( "%d" ), data.mLogIndex );
listCtrl.InsertItem( row, text, 0 );
listCtrl.SetItemText( row, ++step, CA2WEX< sizeof( data.mDate ) >( data.mDate ) );
listCtrl.SetItemText( row, ++step, mApplication.GetText( data.mType ) );
text.Format( _T( "%d" ), data.mPoint );
listCtrl.SetItemText( row, ++step, text );
const ActiveSkillScript* script = mApplication.GetActiveSkillScript( data.mIndex );
if( script )
{
text.Format( _T( "%d" ), data.mDbIndex );
listCtrl.SetItemText( row, ++step, text );
listCtrl.SetItemText( row, ++step, script->mName );
text.Format( _T( "%d" ), data.mLevel );
listCtrl.SetItemText( row, ++step, text );
}
listCtrl.SetItemText( row, ++step, CA2WEX< sizeof( data.mMemo ) >( data.mMemo ) );
}
{
int minRange;
int maxRange;
progressCtrl.GetRange( minRange, maxRange );
progressCtrl.SetPos( progressCtrl.GetPos() + int( m->mSize ) );
text.Format( _T( "%d/%d" ), progressCtrl.GetPos(), maxRange );
resultStatic.SetWindowText( text );
// 080523 LUJ, 버튼 활성화 체크가 정상적으로 되도록 수정함
if( progressCtrl.GetPos() == maxRange )
{
findButton.EnableWindow( TRUE );
stopButton.EnableWindow( FALSE );
}
}
break;
}
case MP_RM_SKILL_LOG_SIZE_ACK:
{
const MSG_DWORD* m = ( MSG_DWORD* )message;
const DWORD size = m->dwData;
CString text;
text.Format( _T( "0/%d" ), size );
resultStatic.SetWindowText( text );
progressCtrl.SetRange32( 0, size );
progressCtrl.SetPos( 0 );
findButton.EnableWindow( FALSE );
stopButton.EnableWindow( TRUE );
listCtrl.DeleteAllItems();
break;
}
case MP_RM_SKILL_LOG_SIZE_NACK:
{
CString textThereIsNoResult;
textThereIsNoResult.LoadString( IDS_STRING1 );
MessageBox( 0, textThereIsNoResult, _T( "" ), MB_ICONERROR | MB_OK );
//.........这里部分代码省略.........
示例12: SetStatus
void CHttpDownloadDlg::SetStatus(UINT nID)
{
CString sCaption;
sCaption.LoadString(nID);
SetStatus(sCaption);
}
示例13: ShowContextMenu
void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPShadowTree& selectedLeafs)
{
CIconMenu popupMenu;
popupMenu.CreatePopupMenu();
bool bAddSeparator = false;
CString remoteName;
if(selectedLeafs.size()==1)
{
bAddSeparator = true;
bool bShowReflogOption = false;
bool bShowFetchOption = false;
bool bShowRenameOption = false;
bool bShowCreateBranchOption = false;
bool bShowEditBranchDescriptionOption = false;
CString fetchFromCmd;
if(selectedLeafs[0]->IsFrom(L"refs/heads/"))
{
bShowReflogOption = true;
bShowRenameOption = true;
bShowEditBranchDescriptionOption = true;
}
else if(selectedLeafs[0]->IsFrom(L"refs/remotes/"))
{
bShowReflogOption = true;
bShowFetchOption = true;
bShowCreateBranchOption = true;
CString remoteBranch;
if (SplitRemoteBranchName(selectedLeafs[0]->GetRefName(), remoteName, remoteBranch))
bShowFetchOption = false;
else
fetchFromCmd.Format(IDS_PROC_BROWSEREFS_FETCHFROM, remoteName);
}
else if(selectedLeafs[0]->IsFrom(L"refs/tags/"))
{
}
CString temp;
temp.LoadString(IDS_MENULOG);
popupMenu.AppendMenuIcon(eCmd_ViewLog, temp, IDI_LOG);
popupMenu.AppendMenuIcon(eCmd_RepoBrowser, IDS_LOG_BROWSEREPO, IDI_REPOBROWSE);
if(bShowReflogOption)
{
temp.LoadString(IDS_MENUREFLOG);
popupMenu.AppendMenuIcon(eCmd_ShowReflog, temp, IDI_LOG);
}
popupMenu.AppendMenu(MF_SEPARATOR);
bAddSeparator = false;
if(bShowFetchOption)
{
bAddSeparator = true;
popupMenu.AppendMenuIcon(eCmd_Fetch, fetchFromCmd, IDI_PULL);
}
if(bAddSeparator)
popupMenu.AppendMenu(MF_SEPARATOR);
bAddSeparator = false;
if (m_bHasWC)
{
CString format, str;
if (selectedLeafs[0]->GetRefName() != _T("refs/heads/") + g_Git.GetCurrentBranch())
{
format.LoadString(IDS_LOG_POPUP_MERGEREV);
str.Format(format, g_Git.GetCurrentBranch());
popupMenu.AppendMenuIcon(eCmd_Merge, str, IDI_MERGE);
}
popupMenu.AppendMenuIcon(eCmd_Switch, CString(MAKEINTRESOURCE(IDS_SWITCH_TO_THIS)), IDI_SWITCH);
popupMenu.AppendMenu(MF_SEPARATOR);
}
if(bShowCreateBranchOption)
{
bAddSeparator = true;
temp.LoadString(IDS_MENUBRANCH);
popupMenu.AppendMenuIcon(eCmd_CreateBranch, temp, IDI_COPY);
}
if (bShowEditBranchDescriptionOption)
{
bAddSeparator = true;
popupMenu.AppendMenuIcon(eCmd_EditBranchDescription, CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_EDITDESCRIPTION)), IDI_RENAME);
}
if(bShowRenameOption)
{
bAddSeparator = true;
popupMenu.AppendMenuIcon(eCmd_Rename, CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_RENAME)), IDI_RENAME);
}
}
else if(selectedLeafs.size() == 2)
{
bAddSeparator = true;
popupMenu.AppendMenuIcon(eCmd_Diff, CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_COMPAREREFS)), IDI_DIFF);
//.........这里部分代码省略.........
示例14: _Event
void CGame::_Event (int ID, int iTyp, char const * psText, int iVoice)
{
ASSERT ((sizeof (aiRes) / sizeof (int)) == NUM_EVENTS);
ASSERT ((sizeof (aiSfx) / sizeof (int)) == NUM_EVENTS);
if ((ID < 0) || (NUM_EVENTS <= ID))
{
ASSERT (FALSE);
return;
}
// if no HP then no events
if ( ! theGame.HaveHP () )
return;
// not during cut scenes
if ( ! theGame.DoOper () )
return;
// don't repeat ourselves too often
if ( theGame.GettimeGetTime () - dwLastTime [ID] < dwTimeBetween [ID] * 1000 )
return;
dwLastTime [ID] = theGame.GettimeGetTime ();
// if its clear it - do it now and leave
if (iTyp == EVENT_OFF)
{
if (ID != iLastEvent)
return;
if (hTimer != NULL)
{
theApp.m_wndBar.KillTimer (hTimer);
hTimer = NULL;
}
theApp.m_wndBar.SetStatusText (0, "");
return;
}
TRAP (ID == EVENT_ROAD_START);
TRAP (ID == EVENT_VEH_UNDER_ATK);
TRAP (ID == EVENT_PLAYER_LEFT);
TRAP (ID == EVENT_PLAYER_JOINED);
TRAP (ID == EVENT_HPR_SEAPORTS);
TRAP (ID == EVENT_HPR_CARGOSHIP);
TRAP (ID == EVENT_HPR_NOREACH);
int iRes = aiRes [ID];
int iSfx = aiSfx [ID];
CString sMsg;
sMsg.LoadString (iRes);
if (psText != NULL)
csPrintf (&sMsg, psText);
CStatInst::IMPORTANCE iImp;
int iShow;
switch (iTyp)
{
case EVENT_NOTIFY :
iImp = CStatInst::status;
iShow = 10;
break;
case EVENT_WARN :
iImp = CStatInst::warn;
iShow = 20;
break;
case EVENT_BAD :
iImp = CStatInst::critical;
iShow = 40;
break;
default:
return;
}
iLastEvent = ID;
theApp.m_wndBar.SetStatusText (0, sMsg, iImp);
// we kill the message after iShow seconds
if (hTimer != NULL)
theApp.m_wndBar.KillTimer (hTimer);
hTimer = theApp.m_wndBar.SetTimer (99, iShow * 1000, NULL);
if (iSfx > 0)
{
// keep at least 3 seconds apart
static DWORD dwLastVoice = 0;
if ( theGame.GettimeGetTime () - dwLastVoice > 3 * 1000 )
{
dwLastVoice = theGame.GettimeGetTime ();
theMusicPlayer.PlayForegroundSound (VOICES::GetID (iSfx, iVoice), SFXPRIORITY::voice_pri );
}
}
}
示例15: OnInitDialog
//.........这里部分代码省略.........
// Maybe, the template with same ID is already exist?
//----------------------------------------------------
BOOL bIsAlreadyExist = FALSE;
for (int i = 0; !bIsAlreadyExist && i < m_wndMenuesList.GetCount (); i++)
{
CBCGPMultiDocTemplate* pListTemplate =
(CBCGPMultiDocTemplate*) m_wndMenuesList.GetItemData (i);
bIsAlreadyExist = pListTemplate != NULL &&
pListTemplate->GetResId () == pTemplate->GetResId ();
}
if (!bIsAlreadyExist)
{
CString strName;
pTemplate->GetDocString (strName, CDocTemplate::fileNewName);
int iIndex = m_wndMenuesList.AddString (strName);
m_wndMenuesList.SetItemData (iIndex, (DWORD_PTR) pTemplate);
if (pTemplate->m_hMenuShared == m_hmenuCurr)
{
iCurrMenu = iIndex;
}
}
}
}
//--------------------------
// Add a default frame menu:
//--------------------------
CString strName;
{
CBCGPLocalResource locaRes;
strName.LoadString (IDS_BCGBARRES_DEFUALT_MENU);
}
int iIndex = m_wndMenuesList.AddString (strName);
m_wndMenuesList.SetItemData (iIndex, (DWORD_PTR) NULL);
if (iCurrMenu == -1)
{
m_bIsDefaultMDIMenu = TRUE;
iCurrMenu = iIndex;
}
m_hmenuSelected = m_hmenuCurr;
m_wndMenuesList.SetCurSel (iCurrMenu);
UpdateData (FALSE);
OnSelchangeMenuList ();
}
else
{
//-------------------------------------------------
// No menubar found, disable menu selecting engine:
//-------------------------------------------------
m_wndMenuesList.EnableWindow (FALSE);
GetDlgItem(IDC_BCGBARRES_RESET_FRAME_MENU)->EnableWindow(FALSE);
CBCGPLocalResource locaRes;
m_strMenuDescr.LoadString (IDS_BCGBARRES_NO_MENUBAR);
UpdateData (FALSE);
}
//--------------------------