本文整理汇总了C++中CRect函数的典型用法代码示例。如果您正苦于以下问题:C++ CRect函数的具体用法?C++ CRect怎么用?C++ CRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CRect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetDC
void CLogGraph::OnMouseMove(UINT nFlags, CPoint point)
{
if (hitRect(point, m_rectGraph) && m_bNav) {
CDC* pDC = GetDC();
if (pDC) {
int oldRop = pDC->GetROP2();
pDC->SetROP2(R2_XORPEN);
CPen pen(PS_DOT, 1, RGB(255, 255, 255));
CPen* pOldPen = pDC->SelectObject(&pen);
if (m_nLastCursorPos != -1) {
pDC->MoveTo(m_rectGraph.left + m_nLastCursorPos, m_rectGraph.top);
pDC->LineTo(m_rectGraph.left + m_nLastCursorPos, m_rectGraph.bottom);
}
m_nLastCursorPos = (point.x - m_rectGraph.left);
pDC->MoveTo(m_rectGraph.left + m_nLastCursorPos, m_rectGraph.top);
pDC->LineTo(m_rectGraph.left + m_nLastCursorPos, m_rectGraph.bottom);
pDC->SelectObject(pOldPen);
pDC->SetROP2(oldRop);
if (m_bNav) {
int pos = m_nCurrentPos + int(m_fZoomFactor * m_nLastCursorPos);
// lib->mque_getn(m_hQue, pos, m_aTmp);
// calcStat(m_aTmp, false);
sendMsg(LG_NAV_MSG, pos);
m_tLastNav = time(NULL);
}
ReleaseDC(pDC);
}
}
if (m_bLdown)
{
m_bDragSel = true;
m_ptEtMouse = point;
redraw();
}
if (m_bLoad){
tdata *tp = getTptr(m_nCurrentPos); //getPtrLeftPos();
int x = point.x - m_rectGraph.left;
if (x < 0) goto NOMATCH;
int last = getLength();
int pos = m_nCurrentPos + point.x * (int)m_fZoomFactor - m_rectGraph.left;
if (pos > last){
goto NOMATCH;
}
tp = tp+ x*((int)m_fZoomFactor);
Channel* pCh = m_aChannels[0];
int ey = m_rectGraph.top + m_rectGraph.Height();
int ry = ey - int(pCh->C * (int(tp->temp) / pCh->scale - pCh->low));
// TRACE("%s %d\n", __FUNCTION__ , tp->temp);
CString strTemp;
CString stime = tformat("%Y-%m-%d %H:%M:%S", tp->time);
strTemp.Format("%s\t %d℃",stime, tp->temp/100 );
// strTemp.Format("%5ld",lUnitSize);
m_ctrTooltip.Activate(TRUE);
m_ctrTooltip.AddTool(this,strTemp, CRect(point.x-1,point.y-1,point.x+1,point.y+1), TRUE); // skin[i].rc 각 버튼들의 Rect...
m_ctrTooltip.Update();
}
NOMATCH:
// TRACE("%s : cpos %d\n", __FUNCTION__, m_nCurrentPos);
CWnd::OnMouseMove(nFlags, point);
}
开发者ID:tlogger,项目名称:TMon,代码行数:72,代码来源:LogGraph.cpp
示例2: SetScissors
void CRenderSystemGL::ResetScissors()
{
SetScissors(CRect(0, 0, (float)m_width, (float)m_height));
}
开发者ID:ssfdre38,项目名称:xbmc,代码行数:4,代码来源:RenderSystemGL.cpp
示例3: dc
void Graph::OnPaint()
{
CPaintDC dc(this); // device context for painting
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
CLogicSimulatorDoc* pDoc = (CLogicSimulatorDoc *)pFrame->GetActiveDocument();
dc.SetBkMode(TRANSPARENT);
if (previousInput < 0)
previousInput = pDoc->currBox->NumInput;
else if (previousInput != pDoc->currBox->NumInput) {
UpdateGraph = 1;
previousInput = pDoc->currBox->NumInput;
}
dc.DrawText(_T("입력핀"), CRect(0, 0, 50, 50), DT_LEFT);
int input = 0 , curr =20;
for (int i = 0; i < pDoc->currBox->logicInfo.size(); i++)
{
CString Fornumber;
if (pDoc->currBox->logicInfo.at(i)->objectName == PIN) {
Pin* PT = (Pin*)pDoc->currBox->logicInfo.at(i);
Fornumber.Format(_T("ID : %d, Label : %s"), PT->getConNum(), PT->label);
if (PT->getConNum() >= 0)
inputValue[PT->getConNum()] = PT->getOutput();
dc.TextOutW(0, curr, Fornumber);
curr += 50;
}
}
dc.TextOutW(0, curr, _T("출력핀"));
curr += 20;
for (int i = 0; i < pDoc->currBox->logicInfo.size(); i++)
{
CString Fornumber;
if (pDoc->currBox->logicInfo.at(i)->objectName == OUTPIN) {
Out* PT = (Out*)pDoc->currBox->logicInfo.at(i);
Fornumber.Format(_T("ID : %d, Label : %s"), PT->getConNum(), PT->label);
if (PT->getConNum() >= 0)
outputValue[PT->getConNum()] = PT->getOutput();
dc.TextOutW(0, curr, Fornumber);
curr += 50;
}
}
int i ,final_i;
CPen pen;
pen.CreatePen(PS_SOLID, 3, RGB(255, 0, 0)); // 빨간색 펜 생성
dc.SelectObject(&pen);
for (i = 0; i < pDoc->currBox->NumInput; i++)
{
for (int j = 1; j < (count < 200 ? count : 200); j++)
{
inputline[i][j - 1].x += 5;
}
for (int j = (count < 200 ? count : 200); j >= 1; j--)
{
inputline[i][j].x = inputline[i][j - 1].x;
inputline[i][j].y = inputline[i][j - 1].y;
}
//그리기
if (inputValue[i])
{
inputline[i][0].x = 0;
inputline[i][0].y = 45 + 50 * i;
}
else {
inputline[i][0].x = 0;
inputline[i][0].y = 60 + 50 * i;
}
dc.Polyline(inputline[i], (count < 200 ? count : 200));
}
final_i = i;
if (UpdateGraph) {
for (i = 0; i < 10; i++)
{
for (int j = 0; j < 250; j++)
{
outputline[i][j].y = 80 + 50 * (i + final_i);
}
}
UpdateGraph = false;
}
pen.DeleteObject();
pen.CreatePen(PS_SOLID, 3, RGB(0, 0, 255)); // 파란색 펜 생성
dc.SelectObject(&pen);
for (i = 0; i < pDoc->currBox->NumOuput; i++)
{
for (int j = 1; j < (count < 200 ? count : 200); j++)
//.........这里部分代码省略.........
开发者ID:zzong2006,项目名称:LogicSimulator,代码行数:101,代码来源:Graph.cpp
示例4: SetPlaceholderID
// CSheetExchMain message handlers
BOOL CSheetExchMain::OnInitDialog()
{
SetPlaceholderID(IDC_PAGEPOS);
CExchCalcMain* pCalcData = GetData();
if( pCalcData == NULL )
{
ASSERT(FALSE);
return CHSNewWizDialog::OnInitDialog();
}
// 设置数据指针
CWizPageExchBase::SetMainTech(pCalcData);
GetData()->SetMsgWnd(this);
GetData()->SetMsg(HX_USER_COMPILEDATA);
// 初始化项面
CWizPageExchBase* pPage = new CWizPageExchSelIndicator(this);
if( pPage != NULL )
{
AddPage(pPage,IDD_EXCHANGE_SELECT);
}
else
{
ASSERT(FALSE);
return CHSNewWizDialog::OnInitDialog();
}
pPage->InitialData(pCalcData->GetExchExp());
pPage = new CWizPageExchBuy(this);
if( pPage != NULL )
{
AddPage(pPage,IDD_EXCHANGE_BUY);
}
else
{
ASSERT(FALSE);
return CHSNewWizDialog::OnInitDialog();
}
pPage->InitialData(pCalcData->GetBuy());
pPage = new CWizPageExchSell(this);
if( pPage != NULL )
{
AddPage(pPage,IDD_EXCHANGE_SELL);
}
else
{
ASSERT(FALSE);
return CHSNewWizDialog::OnInitDialog();
}
pPage->InitialData(pCalcData->GetSell());
pPage = new CWizPageExchModel(this);
if( pPage != NULL )
{
AddPage(pPage,IDD_EXCHANGE_MODEL);
}
else
{
ASSERT(FALSE);
return CHSNewWizDialog::OnInitDialog();
}
pPage->InitialData(pCalcData->GetMode());
pPage = new CWizPageExchResult(this);
if( pPage != NULL )
{
AddPage(pPage,IDD_EXCHANGE_RESULT);
}
else
{
ASSERT(FALSE);
return CHSNewWizDialog::OnInitDialog();
}
// 初始化进度条,并隐藏
m_wndPress.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(0, 0, 0, 0), this, PROGRESS_ID);
m_wndPress.ShowWindow(SW_HIDE);
// 初始化TAB项签 ①②③④⑤⑥⑦⑧⑨⑩
m_wndPageTab.Create(this, TAB_ID, 5, CRect(0, 0, 0, 0));
m_wndPageTab.SetItem(0, "①", IDD_EXCHANGE_SELECT);
m_wndPageTab.SetItem(1, "②", IDD_EXCHANGE_BUY );
m_wndPageTab.SetItem(2, "③", IDD_EXCHANGE_SELL );
m_wndPageTab.SetItem(3, "④", IDD_EXCHANGE_MODEL );
m_wndPageTab.SetItem(4, "⑤", IDD_EXCHANGE_RESULT);
//m_wndPageTab.SetColors(RGB(255, 0, 0), RGB(0, 0, 0), ::GetSysColor(CTLCOLOR_DLG), RGB(0, 255, 0));
m_wndPageTab.SetCallBreak((HS_Call_Notify)OnMsgPress, (DWORD)m_hWnd);
m_wndPageTab.SetActive((int)0);
// 设置位置
CRect rtClient;
GetClientRect(&rtClient);
rtClient.left += 4;
CWnd* pWnd = GetDlgItem(ID_WIZBACK);
if( pWnd )
{
//.........这里部分代码省略.........
开发者ID:hefen1,项目名称:XCaimi,代码行数:101,代码来源:SheetExchMain.cpp
示例5: pen
BOOL CDrawQuoteTab::DrawButton( CDC* pDC, CRect& rect, short nMask)
{
m_rcTab.SetRectEmpty();
if (rect.IsRectEmpty())
return FALSE;
const ColorProperty* colorFrame = m_pColor->GetQuoteTabFrameColorProp(); // 边框颜色;
CPen pen(colorFrame->m_nPenStyle,colorFrame->m_nWidth,colorFrame->m_lColor);
CFont* pFont = m_pFont->GetQuoteTabFont();
CFont* pOldFont = pDC->SelectObject(pFont);
// 字体宽度
CSize size = pDC->GetTextExtent(m_strName);
COLORREF clrTabText = 0;
COLORREF clrFill = 0;
COLORREF clrArrow = 0;
switch(nMask)
{
case Tab_Pressed:
{
clrTabText = m_pColor->GetQuoteActiveTabTextColor(); //字体颜色
clrFill = m_pColor->GetQuoteActiveTabBKColor(); // 选中时填充色
clrArrow = colorFrame->m_lColor;
break;
}
case Tab_Disabled:
{
clrTabText = GetSysColor(COLOR_BTNSHADOW);
clrFill = m_pColor->GetQuoteTabBKColor();
clrArrow = GetSysColor(COLOR_BTNSHADOW);
break;
}
default:
{
clrTabText = m_pColor->GetQuoteTabTextColor();
clrFill = m_pColor->GetQuoteTabBKColor();
clrArrow = colorFrame->m_lColor;
break;
}
}
CBrush brush(clrFill);
CPen* pOldPen = pDC->SelectObject(&pen);
CBrush* pOldBrush = pDC->SelectObject(&brush);
COLORREF clrOldTabText = pDC->SetTextColor(clrTabText);
// 计算当前大小
m_rcTab = rect;
m_rcTab.top += 1;
if (m_lMenuMask & CDrawQuoteTabCtrl::TabPrev)
{
m_rcTab.right = m_rcTab.left + size.cx;
pDC->Rectangle(CRect(m_rcTab.left, m_rcTab.top, m_rcTab.right, m_rcTab.bottom+1));
POINT pt[4];
CBrush brushTemp(clrArrow);
pDC->SelectObject(&brushTemp);
pDC->MoveTo(m_rcTab.left + 3,m_rcTab.CenterPoint().y);
pt[0].x = m_rcTab.left + 3;
pt[0].y = m_rcTab.CenterPoint().y;
pt[1].x = m_rcTab.right - 3;
pt[1].y = m_rcTab.top + 3;
pt[2].x = m_rcTab.right - 3;
pt[2].y = m_rcTab.bottom - 3;
pt[3] = pt[0];
pDC->Polygon(pt,4);
pDC->SelectObject(&brush);
brushTemp.DeleteObject();
rect.left = m_rcTab.right - 1;
}
else if (m_lMenuMask & CDrawQuoteTabCtrl::TabNext)
{
m_rcTab.right = m_rcTab.left + size.cx;
pDC->Rectangle(CRect(m_rcTab.left, m_rcTab.top, m_rcTab.right, m_rcTab.bottom+1));
POINT pt[4];
CBrush brushTemp(clrArrow);
pDC->SelectObject(&brushTemp);
pDC->MoveTo(m_rcTab.left + 3,m_rcTab.CenterPoint().y);
pt[0].x = m_rcTab.left + 3;
pt[0].y = m_rcTab.top + 3;
pt[1].x = m_rcTab.right - 3;
pt[1].y = m_rcTab.CenterPoint().y;
pt[2].x = m_rcTab.left + 3;
pt[2].y = m_rcTab.bottom - 3;
pt[3] = pt[0];
pDC->Polygon(pt,4);
pDC->SelectObject(&brush);
brushTemp.DeleteObject();
rect.left = m_rcTab.right - 1;
}
else
{
m_rcTab.left = m_rcTab.right - size.cx - 8;
rect.right = m_rcTab.left - 15;
pDC->Rectangle(CRect(m_rcTab.left, m_rcTab.top, m_rcTab.right, m_rcTab.bottom+1));
pDC->DrawText(m_strName, m_rcTab, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
brush.DeleteObject();
//.........这里部分代码省略.........
开发者ID:hefen1,项目名称:XCaimi,代码行数:101,代码来源:DrawQuoteTabCtrl.cpp
示例6: GetWindowPlacement
void CWarnPopVideo::FullScreenPopVideo(void)
{
if (m_bFullScreen==false) //full screen
{
//Hide OK Button
CButton *pBtnOK = (CButton *)GetDlgItem(IDOK);
if (pBtnOK)
pBtnOK->ShowWindow(SW_HIDE);
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_TIMEOUT);
if (pEdit)
pEdit->ShowWindow(SW_HIDE);
CButton *pBtnPause = (CButton*)GetDlgItem(IDC_PAUSE_ALARM);
if (pBtnPause)
pBtnPause->ShowWindow(SW_HIDE);
//Full Video Screen
GetWindowPlacement(&m_struOldPlacement);
//Remove WS_SIZEBOX windows style. or not the window can't be full-creen.
ModifyStyle(WS_SIZEBOX,0,0);
CRect WindowRect, ClientRect;
RECT m_FullScreenRect;
//ReDraw the window. Get the correct edge value.
GetWindowRect(&WindowRect);
WindowRect.left+=1;
WindowRect.right+=1;
MoveWindow(CRect(0,0,352,288),TRUE);
GetWindowRect(&WindowRect);
GetClientRect(&ClientRect);
ClientToScreen(&ClientRect);
//get the dest window rect.
int x = GetSystemMetrics(SM_CXSCREEN);
int y = GetSystemMetrics(SM_CYSCREEN);
m_FullScreenRect.left = WindowRect.left - ClientRect.left;
m_FullScreenRect.top = WindowRect.top - ClientRect.top;
m_FullScreenRect.right = WindowRect.right - ClientRect.right + x;
m_FullScreenRect.bottom = WindowRect.bottom - ClientRect.bottom + y;
// m_FullScreenRect.left = 0;
// m_FullScreenRect.top = 0;
// m_FullScreenRect.right = GetSystemMetrics(SM_CXSCREEN);
// m_FullScreenRect.bottom = GetSystemMetrics(SM_CYSCREEN);
//Move the main window to the dest rect.
WINDOWPLACEMENT wndpl;
wndpl.length = sizeof(WINDOWPLACEMENT);
wndpl.flags = 0;
wndpl.showCmd = SW_SHOWNORMAL;
wndpl.rcNormalPosition = m_FullScreenRect;
SetWindowPlacement(&wndpl);
//Move the view winow to full-screen.
RECT rc;
GetClientRect(&rc);
m_pPopView->MoveWindow(&rc,TRUE);
//
m_bFullScreen = true;
}
else //Restore normal screen
{
//Show OK Button
CRect btnRect;
CButton *pBtnOK = (CButton *)GetDlgItem(IDOK);
if (pBtnOK)
{
pBtnOK->ShowWindow(SW_SHOW);
pBtnOK->GetClientRect(&btnRect);
}
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_TIMEOUT);
if (pEdit)
pEdit->ShowWindow(SW_SHOW);
CButton *pBtnPause = (CButton*)GetDlgItem(IDC_PAUSE_ALARM);
if (pBtnPause)
pBtnPause->ShowWindow(SW_SHOW);
//Restore old position
ModifyStyle(0,WS_SIZEBOX,0);
SetWindowPlacement(&m_struOldPlacement);
RECT rc;
GetClientRect(&rc);
rc.bottom -= (btnRect.Height()+3);
m_pPopView->MoveWindow(&rc,TRUE);
//SetWindowSize();
//
m_bFullScreen = false;
}
}
开发者ID:dalinhuang,项目名称:demodemo,代码行数:98,代码来源:WarnPopVideo.cpp
示例7: CRect
BOOL Page1::OnInitDialog()
{
txt_info.Create(L"选择待压缩文件夹", WS_VISIBLE, CRect(10, 10, 600, 100), this);
// _input_path.Create(WS_VISIBLE, CRect(10, 10, 300, 100), this,0);
str = CSelectFolderDlg::Show();
txt_info.SetWindowTextW( str);
// CString ss = "\"";
//str.Insert(0, toUnicode( "\""));
//str.Insert(str.GetLength(), toUnicode("\""));
p = new UnCompressor(UnicodeToANSI(str.GetBuffer(0)));
p->setCompressCallback([&](string name)
{
name.insert(0, "\\");
CString ss = toUnicode(name.c_str());
ss.Insert(0, toUnicode(p->dir.c_str()));
ss.Insert(0, toUnicode("正在提取 "));
txt_info.SetWindowTextW(ss);
});
// p->UnCompress();
/* p = new Compressor(( UnicodeToANSI( str.GetBuffer(0) )));
TRACE("76.................................");
p->setCompressCallback(
[=](string, int, int)
{
}
,[=](string name)
{
auto s = (LPCTSTR)(p->dir.c_str());
// txt_info.SetWindowTextW(s);
});
p->Compress();
*/
return TRUE;
}
开发者ID:dreamyouxi,项目名称:LiteSetup,代码行数:85,代码来源:Page1.cpp
示例8: p
bool CMpaDecSettingsWnd::OnActivate()
{
DWORD dwStyle = WS_VISIBLE|WS_CHILD|WS_TABSTOP;
CRect r;
CPoint p(10, 10);
m_outputformat_static.Create(ResStr(IDS_MPADECSETTINGSWND_0), dwStyle, CRect(p, CSize(120, m_fontheight)), this);
p.y += m_fontheight + 5;
m_outputformat_combo.Create(dwStyle|CBS_DROPDOWNLIST, CRect(p + CSize(10, 0), CSize(100, 200)), this, IDC_PP_COMBO1);
m_outputformat_combo.SetItemData(m_outputformat_combo.AddString(_T("PCM 16 Bit")), SF_PCM16);
m_outputformat_combo.SetItemData(m_outputformat_combo.AddString(_T("PCM 24 Bit")), SF_PCM24);
m_outputformat_combo.SetItemData(m_outputformat_combo.AddString(_T("PCM 32 Bit")), SF_PCM32);
m_outputformat_combo.SetItemData(m_outputformat_combo.AddString(_T("IEEE Float")), SF_FLOAT32);
m_outputformat_combo.SetCurSel(0);
for(int i = 0; i < m_outputformat_combo.GetCount(); i++)
if((int)m_outputformat_combo.GetItemData(i) == m_outputformat) {
m_outputformat_combo.SetCurSel(i);
}
p.y += 30;
CString strSpeak;
strSpeak.Format (_T("%s%s"), ResStr(IDS_MPADECSETTINGSWND_1), GetDolbyMode(m_ddmode));
m_ac3spkcfg_static.Create(ResStr(IDS_MPADECSETTINGSWND_1) + GetDolbyMode(m_ddmode), dwStyle, CRect(p, CSize(220, m_fontheight)), this);
p.y += m_fontheight + 5;
m_ac3spkcfg_combo.Create(dwStyle|CBS_DROPDOWNLIST, CRect(p + CSize(150, 0), CSize(100, 200)), this, IDC_PP_COMBO2);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(_T("Mono")), A52_MONO);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(_T("Dual Mono")), A52_CHANNEL);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(_T("Stereo")), A52_STEREO);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(_T("Dolby Stereo")), A52_DOLBY);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_3F)), A52_3F);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_2F_1R)), A52_2F1R);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_3F_1R)), A52_3F1R);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_2F_2R)), A52_2F2R);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_3F_2R)), A52_3F2R);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_CHANNEL_1)), A52_CHANNEL1);
m_ac3spkcfg_combo.SetItemData(m_ac3spkcfg_combo.AddString(ResStr(IDS_MPA_CHANNEL_2)), A52_CHANNEL2);
for(int i = 0, sel = abs(m_ac3spkcfg) & A52_CHANNEL_MASK; i < m_ac3spkcfg_combo.GetCount(); i++)
if((int)m_ac3spkcfg_combo.GetItemData(i) == sel) {
m_ac3spkcfg_combo.SetCurSel(i);
}
m_ac3spkcfg_combo.GetWindowRect(r);
ScreenToClient(r);
m_ac3lfe_check.Create(_T("LFE"), dwStyle|BS_AUTOCHECKBOX, CRect(CPoint(r.left, r.bottom + 3), CSize(50, m_fontheight)), this, IDC_PP_CHECK4);
m_ac3lfe_check.SetCheck(!!(abs(m_ac3spkcfg) & A52_LFE));
for(int i = 0, h = max(20, m_fontheight)+1; i < countof(m_ac3spkcfg_radio); i++, p.y += h) {
static const TCHAR* labels[] = {m_strDecodeToSpeaker, _T("SPDIF")};
m_ac3spkcfg_radio[i].Create(labels[i], dwStyle|BS_AUTORADIOBUTTON|(i == 0 ? WS_GROUP : 0), CRect(p + CPoint(10, 0), CSize(140, h)), this, IDC_PP_RADIO1+i);
}
CheckRadioButton(IDC_PP_RADIO1, IDC_PP_RADIO2, m_ac3spkcfg >= 0 ? IDC_PP_RADIO1 : IDC_PP_RADIO2);
p.y += 5;
m_ac3spkcfg_check.Create(ResStr(IDS_MPA_DYNRANGE), dwStyle|BS_AUTOCHECKBOX, CRect(p + CPoint(10, 0), CSize(205, m_fontheight)), this, IDC_PP_CHECK1);
m_ac3spkcfg_check.SetCheck(m_ac3drc);
p.y += m_fontheight + 10;
m_dtsspkcfg_static.Create(ResStr(IDS_MPADECSETTINGSWND_7), dwStyle, CRect(p, CSize(120, m_fontheight)), this);
p.y += m_fontheight + 5;
m_dtsspkcfg_combo.Create(dwStyle|CBS_DROPDOWNLIST, CRect(p + CSize(150, 0), CSize(100, 200)), this, IDC_PP_COMBO3);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(_T("Mono")), DTS_MONO);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(_T("Dual Mono")), DTS_CHANNEL);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(_T("Stereo")), DTS_STEREO);
//m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(_T("Stereo ..")), DTS_STEREO_SUMDIFF);
//m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(_T("Stereo ..")), DTS_STEREO_TOTAL);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(ResStr(IDS_MPA_3F)), DTS_3F);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(ResStr(IDS_MPA_2F_1R)), DTS_2F1R);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(ResStr(IDS_MPA_3F_1R)), DTS_3F1R);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(ResStr(IDS_MPA_2F_2R)), DTS_2F2R);
m_dtsspkcfg_combo.SetItemData(m_dtsspkcfg_combo.AddString(ResStr(IDS_MPA_3F_2R)), DTS_3F2R);
for(int i = 0, sel = abs(m_dtsspkcfg) & DTS_CHANNEL_MASK; i < m_dtsspkcfg_combo.GetCount(); i++)
if((int)m_dtsspkcfg_combo.GetItemData(i) == sel) {
m_dtsspkcfg_combo.SetCurSel(i);
}
m_dtsspkcfg_combo.GetWindowRect(r);
ScreenToClient(r);
m_dtslfe_check.Create(_T("LFE"), dwStyle|BS_AUTOCHECKBOX, CRect(CPoint(r.left, r.bottom + 3), CSize(50, m_fontheight)), this, IDC_PP_CHECK5);
m_dtslfe_check.SetCheck(!!(abs(m_dtsspkcfg) & DTS_LFE));
for(int i = 0, h = max(20, m_fontheight)+1; i < countof(m_dtsspkcfg_radio); i++, p.y += h) {
static const TCHAR* labels[] = {m_strDecodeToSpeaker, _T("SPDIF")};
m_dtsspkcfg_radio[i].Create(labels[i], dwStyle|BS_AUTORADIOBUTTON|(i == 0 ? WS_GROUP : 0), CRect(p + CPoint(10, 0), CSize(140, h)), this, IDC_PP_RADIO3+i);
//.........这里部分代码省略.........
开发者ID:wangarong,项目名称:mpc-loop,代码行数:101,代码来源:MpaDecSettingsWnd.cpp
示例9: CreateContent
bool CDepotView::CreateContent()
{
if(!m_depotTreeCtrl.Create( WS_CHILD | WS_VISIBLE, CRect(0, 0, 10, 10), this, 1))
return false;
return true;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:6,代码来源:DepotView.cpp
示例10: dc
void CTreeListCtrl::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rcClip, rcClient;
dc.GetClipBox( &rcClip );
GetClientRect(&rcClient);
// Set clip region to be same as that in paint DC
CRgn rgn;
rgn.CreateRectRgnIndirect( &rcClip );
dc.SelectClipRgn(&rgn);
rgn.DeleteObject();
COLORREF m_wndColor = GetSysColor( COLOR_WINDOW );
dc.SetViewportOrg(m_nOffset, 0);
dc.SetTextColor(m_wndColor);
// First let the control do its default drawing.
CWnd::DefWindowProc( WM_PAINT, (WPARAM)dc.m_hDC, 0 );
HTREEITEM hItem = GetFirstVisibleItem();
int n = GetVisibleCount(), m_nWidth;
dc.FillSolidRect(GetColumnWidth(0),1,rcClient.Width(),rcClient.Height(),m_wndColor);
CTreeListItem *pItem;
// the most urgent thing is to erase the labels that were drawn by the tree
while(hItem!=NULL && n>=0)
{
CRect rect;
UINT selflag = TVIS_DROPHILITED | TVIS_SELECTED;
CRect m_labelRect;
GetItemRect( hItem, &m_labelRect, TRUE );
GetItemRect( hItem, &rect, FALSE );
if (GetColumnsNum()>1)
rect.left = min(m_labelRect.left, GetColumnWidth(0));
else
rect.left = m_labelRect.left;
rect.right = m_nColumnsWidth;
dc.FillSolidRect(rect.left,rect.top,rect.Width(),rect.Height(),m_wndColor);
hItem = GetNextVisibleItem( hItem );
n--;
}
// create the font
CFont *pFontDC;
CFont fontDC, boldFontDC;
LOGFONT logfont;
CFont *pFont = GetFont();
pFont->GetLogFont( &logfont );
fontDC.CreateFontIndirect( &logfont );
pFontDC = dc.SelectObject( &fontDC );
logfont.lfWeight = 700;
boldFontDC.CreateFontIndirect( &logfont );
// and now let's get to the painting itself
hItem = GetFirstVisibleItem();
n = GetVisibleCount();
while (hItem != NULL && n >= 0)
{
CRect rect;
UINT selflag = TVIS_DROPHILITED | TVIS_SELECTED;
if ( !(GetItemState( hItem, selflag ) & selflag ))
{
dc.SetBkMode(TRANSPARENT);
pItem = (CTreeListItem *)CTreeCtrl::GetItemData(hItem);
CString sItem = ((pItem != NULL) ? pItem->GetItemText() : "");
CRect m_labelRect;
GetItemRect( hItem, &m_labelRect, TRUE );
GetItemRect( hItem, &rect, FALSE );
if (GetColumnsNum()>1)
rect.left = min(m_labelRect.left, GetColumnWidth(0));
else
rect.left = m_labelRect.left;
rect.right = m_nColumnsWidth;
dc.SetBkColor( m_wndColor );
if (pItem != NULL)
{
dc.SetTextColor( pItem->m_Color );
//.........这里部分代码省略.........
开发者ID:mpatwa,项目名称:CCEtoODB_Translator,代码行数:101,代码来源:TreeListCtrl.cpp
示例11: bChanged
bool CGUIProgressControl::UpdateLayout(void)
{
bool bChanged(false);
if (m_width == 0)
m_width = m_guiBackground.GetTextureWidth();
if (m_height == 0)
m_height = m_guiBackground.GetTextureHeight();
bChanged |= m_guiBackground.SetHeight(m_height);
bChanged |= m_guiBackground.SetWidth(m_width);
float fScaleX, fScaleY;
fScaleY = m_guiBackground.GetTextureHeight() ? m_height / m_guiBackground.GetTextureHeight() : 1.0f;
fScaleX = m_guiBackground.GetTextureWidth() ? m_width / m_guiBackground.GetTextureWidth() : 1.0f;
float posX = m_guiBackground.GetXPosition();
float posY = m_guiBackground.GetYPosition();
if (m_guiLeft.GetFileName().empty() && m_guiRight.GetFileName().empty())
{ // rendering without left and right image - fill the mid image completely
float width = m_fPercent * m_width * 0.01f;
float offset = fabs(fScaleY * 0.5f * (m_guiMid.GetTextureHeight() - m_guiBackground.GetTextureHeight()));
if (offset > 0) // Center texture to the background if necessary
bChanged |= m_guiMid.SetPosition(posX, posY + offset);
else
bChanged |= m_guiMid.SetPosition(posX, posY);
bChanged |= m_guiMid.SetHeight(fScaleY * m_guiMid.GetTextureHeight());
if (m_bReveal)
{
bChanged |= m_guiMid.SetWidth(m_width);
float x = posX, y = posY + offset, w = width, h = fScaleY * m_guiMid.GetTextureHeight();
CRect rect(x, y, x + w, y + h);
if (rect != m_guiMidClipRect)
{
m_guiMidClipRect = rect;
bChanged = true;
}
}
else
{
bChanged |= m_guiMid.SetWidth(width);
m_guiMidClipRect = CRect();
}
}
else
{
float fWidth = m_fPercent;
float fFullWidth = m_guiBackground.GetTextureWidth() - m_guiLeft.GetTextureWidth() - m_guiRight.GetTextureWidth();
fWidth /= 100.0f;
fWidth *= fFullWidth;
float offset = fabs(fScaleY * 0.5f * (m_guiLeft.GetTextureHeight() - m_guiBackground.GetTextureHeight()));
if (offset > 0) // Center texture to the background if necessary
bChanged |= m_guiLeft.SetPosition(posX, posY + offset);
else
bChanged |= m_guiLeft.SetPosition(posX, posY);
bChanged |= m_guiLeft.SetHeight(fScaleY * m_guiLeft.GetTextureHeight());
bChanged |= m_guiLeft.SetWidth(fScaleX * m_guiLeft.GetTextureWidth());
posX += fScaleX * m_guiLeft.GetTextureWidth();
offset = fabs(fScaleY * 0.5f * (m_guiMid.GetTextureHeight() - m_guiBackground.GetTextureHeight()));
if (offset > 0) // Center texture to the background if necessary
bChanged |= m_guiMid.SetPosition(posX, posY + offset);
else
bChanged |= m_guiMid.SetPosition(posX, posY);
bChanged |= m_guiMid.SetHeight(fScaleY * m_guiMid.GetTextureHeight());
if (m_bReveal)
{
bChanged |= m_guiMid.SetWidth(fScaleX * fFullWidth);
float x = posX, y = posY + offset, w = fScaleX * fWidth, h = fScaleY * m_guiMid.GetTextureHeight();
CRect rect(x, y, x + w, y + h);
if (rect != m_guiMidClipRect)
{
m_guiMidClipRect = rect;
bChanged = true;
}
}
else
{
bChanged |= m_guiMid.SetWidth(fScaleX * fWidth);
m_guiMidClipRect = CRect();
}
posX += fWidth * fScaleX;
offset = fabs(fScaleY * 0.5f * (m_guiRight.GetTextureHeight() - m_guiBackground.GetTextureHeight()));
if (offset > 0) // Center texture to the background if necessary
bChanged |= m_guiRight.SetPosition(posX, posY + offset);
else
bChanged |= m_guiRight.SetPosition(posX, posY);
bChanged |= m_guiRight.SetHeight(fScaleY * m_guiRight.GetTextureHeight());
bChanged |= m_guiRight.SetWidth(fScaleX * m_guiRight.GetTextureWidth());
}
float offset = fabs(fScaleY * 0.5f * (m_guiOverlay.GetTextureHeight() - m_guiBackground.GetTextureHeight()));
if (offset > 0) // Center texture to the background if necessary
bChanged |= m_guiOverlay.SetPosition(m_guiBackground.GetXPosition(), m_guiBackground.GetYPosition() + offset);
else
bChanged |= m_guiOverlay.SetPosition(m_guiBackground.GetXPosition(), m_guiBackground.GetYPosition());
bChanged |= m_guiOverlay.SetHeight(fScaleY * m_guiOverlay.GetTextureHeight());
//.........这里部分代码省略.........
开发者ID:7orlum,项目名称:xbmc,代码行数:101,代码来源:GUIProgressControl.cpp
示例12: RUNTIME_CLASS
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
// Hauptfenster aufteilen:
// +---------------------------------------------------+
// | CMenuChooseView 0 CGalaxyMenuView / CMainBaseViews |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// |ooooooooooooooooooooooooooooooooooooooooooooooooooo|
// | CSmallInfoView 0 CBottomBaseViews |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// | 0 |
// +---------------------------------------------------+
/* Größe der CGalaxyMenuView mit ScrollBars: 1058 | 733
ohne Scrollbars: 1075 | 750
Größe der CCMenuChooseView: 200 | 750
Größe der CView3: 1075 | 249
Größe der CCSmallInfoView: 200 | 249
Alle Ansichten haben bei dieser angegebenen Größe nicht mehr den Rahmen der
SplitterWindows. Also den, womit man die Größe der einzelnen Fenster verschieben
konnte. Die Monitorauflösung muß 1280*1024 betragen.
(Scrollbars haben also eine Dicke von 17 Pixeln bei einer Monitorauflösung von 1280*1024)
*/
CRect r;
this->GetDesktopWindow()->GetClientRect(r);
m_wndSplitter.CreateStatic(this, 2, 2, WS_CHILD | WS_VISIBLE);
// Größen der Splitter festlegen. Der Mulitplikator kommt zustande, so dass es auf jeder Monitorauflösung trotzdem noch
// das selbe Verhältnis hat. Deswegen können dort keine statischen Werte verwendet werden.
// m_wndSplitter.SetRowInfo(0, r.bottom * VERT_PROPORTION, r.bottom * VERT_PROPORTION);
// m_wndSplitter.SetColumnInfo(0, r.right * HORZ_PROPORTION, r.right * HORZ_PROPORTION);
/* m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMenuChooseView), CSize(r.right * 0.15625, r.bottom * 0.732421875), pContext);
m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CGalaxyMenuView), CSize(r.Width() - r.right * 0.15625, r.bottom * 0.732421875), pContext);
m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CSmallInfoView), CSize(r.right * 0.15625, r.Height() - r.bottom * 0.732421875), pContext);
m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CPlanetBottomView), CSize(r.Width() - r.right * 0.15625, r.Height() - r.bottom * 0.732421875), pContext);
*/
// View hinzufügen
// Hauptmenü
m_wndSplitter.AddSwitchableView(m_wndSplitter.IdFromRowCol(0, 1), RUNTIME_CLASS(CStartMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , true , VIEWS::START_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::NEWGAME_VIEW, RUNTIME_CLASS(CNewGameView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::NEWGAME_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::CHOOSERACE_VIEW, RUNTIME_CLASS(CChooseRaceView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::CHOOSERACE_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::GALAXY_VIEW, RUNTIME_CLASS(CGalaxyMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::GALAXY_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::SYSTEM_VIEW, RUNTIME_CLASS(CSystemMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::SYSTEM_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::RESEARCH_VIEW, RUNTIME_CLASS(CResearchMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::RESEARCH_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::INTEL_VIEW, RUNTIME_CLASS(CIntelMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::INTEL_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::DIPLOMACY_VIEW, RUNTIME_CLASS(CDiplomacyMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::DIPLOMACY_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::TRADE_VIEW, RUNTIME_CLASS(CTradeMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::TRADE_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::EMPIRE_VIEW, RUNTIME_CLASS(CEmpireMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::EMPIRE_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::FLEET_VIEW, RUNTIME_CLASS(CFleetMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::FLEET_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::SHIPDESIGN_VIEW, RUNTIME_CLASS(CShipDesignMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::SHIPDESIGN_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::TRANSPORT_VIEW, RUNTIME_CLASS(CTransportMenuView),
pContext, CRect(r.right * HORZ_PROPORTION, 0, r.Width(), r.bottom * VERT_PROPORTION) , false , VIEWS::TRANSPORT_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::EVENT_VIEW, RUNTIME_CLASS(CEventMenuView),
pContext, CRect(r.right, 0, r.Width(), r.bottom) , false , VIEWS::EVENT_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::COMBAT_VIEW, RUNTIME_CLASS(CCombatMenuView),
pContext, CRect(r.right, 0, r.Width(), r.bottom) , false , VIEWS::COMBAT_VIEW);
// kleine View unten/links
m_wndSplitter.AddSwitchableView(m_wndSplitter.IdFromRowCol(1, 0), RUNTIME_CLASS(CSmallInfoView),
pContext, CRect(0, 0, r.Width(), r.Height()) , true);
// Planeten/Schiffsansichtsmenü
m_wndSplitter.AddSwitchableView(m_wndSplitter.IdFromRowCol(1, 1), RUNTIME_CLASS(CPlanetBottomView),
pContext, CRect(0, 0, r.Width(), r.Height()) , true, VIEWS::PLANET_BOTTOM_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::SHIP_BOTTOM_VIEW, RUNTIME_CLASS(CShipBottomView),
pContext, CRect(0, 0, r.Width(), r.Height()) , false , VIEWS::SHIP_BOTTOM_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::RESEARCH_BOTTOM_VIEW, RUNTIME_CLASS(CResearchBottomView),
pContext, CRect(0, 0, r.Width(), r.Height()) , false , VIEWS::RESEARCH_BOTTOM_VIEW);
m_wndSplitter.AddSwitchableView(VIEWS::INTEL_BOTTOM_VIEW, RUNTIME_CLASS(CIntelBottomView),
//.........这里部分代码省略.........
开发者ID:bote-team,项目名称:bote,代码行数:101,代码来源:MainFrm.cpp
示例13: CRect
CRect CStatisticForm::GetDefaultRect() const
{
return CRect(50, 200, 750, 600);
}
开发者ID:EnigmaIndustries,项目名称:graph-studio-next,代码行数:4,代码来源:StatisticForm.cpp
示例14: GetDlgItem
BOOL CStatDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// m_Graph.SubclassWindow( GetDlgItem(IDC_GRAPH)->m_hWnd );
#if(0)
RECT CtrlRect, DlgRect;
GetDlgItem(IDC_GRAPH)->GetWindowRect(&CtrlRect);
GetDlgItem(IDC_GRAPH)->DestroyWindow();
GetWindowRect(&DlgRect);
CRect NewRect = CtrlRect;
NewRect.OffsetRect(-CRect(DlgRect).TopLeft());
m_Graph.Create("LINE_CHART_CTRL", "", WS_VISIBLE | WS_CHILD,
NewRect, this, IDC_GRAPH);
m_Graph.Add(RGB(0,255,0),100, 0, "Connections");
#endif
#if (_MFC_VER > 0x0421)
m_GraphTab.InsertItem(0, "Logins");
m_GraphTab.InsertItem(1, "Login Duration");
m_GraphTab.InsertItem(2, "Login Duration Avg.");
m_GraphTab.InsertItem(3, "Password Failures");
m_GraphTab.InsertItem(4, "Download Count");
m_GraphTab.InsertItem(5, "Download Size");
m_GraphTab.InsertItem(6, "Download Duration");
m_GraphTab.InsertItem(7, "Upload Count");
m_GraphTab.InsertItem(8, "Upload Size");
m_GraphTab.InsertItem(9, "Upload Duration");
#else
TC_ITEM tcItem;
tcItem.mask = TCIF_TEXT;
tcItem.pszText = "Logins";
m_GraphTab.InsertItem(0, &tcItem);
tcItem.pszText = "Login Duration";
m_GraphTab.InsertItem(1, &tcItem);
tcItem.pszText = "Login Duration Avg.";
m_GraphTab.InsertItem(2, &tcItem);
m_GraphTab.InsertItem(3, &tcItem);
m_GraphTab.InsertItem(4, &tcItem);
m_GraphTab.InsertItem(5, &tcItem);
m_GraphTab.InsertItem(6, &tcItem);
m_GraphTab.InsertItem(7, &tcItem);
m_GraphTab.InsertItem(8, &tcItem);
m_GraphTab.InsertItem(9, &tcItem);
#endif
// CImageList* ImageList = new CImageList();
// ImageList->Create(MAKEINTRESOURCE(IDB_BITMAP_2), 22, 1, RGB(192,192,192));
// m_ChartWnd.SetImageList(ImageList);
m_ChartWnd.SetUserColTitle("Logins");
m_StatCallback(&m_FullStat, -1, "", "", &m_GroupArray, &m_UserArray);
FillUserGroupList();
GetStats(m_User, m_Group);
STAT_ADD_PLOTS(LoginCount);
m_ChartWnd.EnableTitleTips();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:modmanmatt,项目名称:blackcats-mirc,代码行数:67,代码来源:StatDialog.cpp
示例15: CamPreview
void COKJDlg::OnCam1()
{
CamPreview(TRUE,CRect(80,0,720,480));
}
开发者ID:mildrock,项目名称:7520Inspru,代码行数:4,代码来源:OKJDlg.cpp
示例16: EndEdit
BOOL CReportCtrl::StartEdit(int nItem, int nSubItem)
{
// Get the grid width and height
if (!m_bAllowEdit || !_IsValidIndex(nItem) || nSubItem < 0 || nSubItem >= GetColumnCount())
return FALSE;
if (m_ptEditting.x == nItem && m_ptEditting.y == nSubItem)
return TRUE;
EndEdit(TRUE);
m_ptEditting.x = nItem;
m_ptEditting.y = nSubItem;
SetAllItemStates(RC_ITEM_SELECTED, RC_ITEM_UNSELECTED); // unselect all
SetItemStates(m_ptEditting.x, RC_ITEM_SELECTED | RC_ITEM_FOCUSED);
// determine editbox font and alignment
const DWORD FMT = _GetHeaderTextFormat(nSubItem);
if (FMT != m_dwPrevEditFmt)
{
m_dwPrevEditFmt = FMT;
// Funny thing:
// Changing CEdit style among ES_LEFT, ES_CENTER, ES_RIGHT at runtime works
// sometimes and fails other times. It just cannot guarantee to be succeed.
// So I decided to destroy and recreate the CEdit every time when the text
// format changes.
if (m_pWndEdit->GetSafeHwnd() != NULL)
m_pWndEdit->DestroyWindow();
if (!m_pWndEdit->Create(ES_READONLY | ES_AUTOHSCROLL | ES_NOHIDESEL | WS_CHILD | WS_BORDER | FMT, CRect(0, 0, 1, 1), this, 0))
return FALSE;
}
else
{
if (m_pWndEdit->GetSafeHwnd() == NULL
&& !m_pWndEdit->Create(ES_READONLY | ES_AUTOHSCROLL | ES_NOHIDESEL | WS_CHILD | WS_BORDER | FMT, CRect(0, 0, 1, 1), this, 0))
{
return FALSE;
}
}
m_pWndEdit->SetFont(GetFont());
CRect rcEdit;
ListView_GetSubItemRect(GetSafeHwnd(), m_ptEditting.x, m_ptEditting.y, LVIR_LABEL, &rcEdit);
if (m_ptEditting.y > 0 && GetImageList() != NULL && GetItemImage(m_ptEditting.x, m_ptEditting.y) >= 0)
rcEdit.DeflateRect(16, 0, 0, 0);
// Move the editbox to that grid, obtain text from the grid, display the
// editbox, and, finally, highlights all text in the editbox and set the
// windows focus to the editbox.
m_pWndEdit->MoveWindow(&rcEdit);
m_pWndEdit->SetWindowText(GetItemText(m_ptEditting.x, m_ptEditting.y));
m_pWndEdit->ShowWindow(SW_SHOW);
m_pWndEdit->SetSel(0, -1);
m_pWndEdit->SetFocus();
return TRUE;
}
开发者ID:jin1818,项目名称:projectcodesync,代码行数:58,代码来源:ReportCtrl.cpp
示例17: ASSERT
CRect rect;
rect.SetRect(256, 256, 512, 512);
ASSERT(rect == CRect(256, 256, 512, 512));
开发者ID:terryjintry,项目名称:OLSource1,代码行数:4,代码来源:crect--setrect_1.cpp
示例18: CRect
int CEventDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
CString strCurrentPath;
strCurrentPath = CMyUtil::GetCurrentPath();
CRect rc;
if (CDialogEx::OnCreate(lpCreateStruct)
|
请发表评论