本文整理汇总了C++中CChildFrame::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::SetTitle方法的具体用法?C++ CChildFrame::SetTitle怎么用?C++ CChildFrame::SetTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::SetTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnOK
void CDialogClasses::OnOK()
{
unsigned numselected = m_ClassView.GetSelectedCount();
POSITION pos = m_ClassView.GetFirstSelectedItemPosition();
while (pos)
{
int nItem = m_ClassView.GetNextSelectedItem(pos);
// FUUUUCK pushign this out last second shutup
CString szBuffer = m_ClassView.GetItemText(nItem, 0);
printf("nitem %d\n", nItem);
nItem = FindClassByName(szBuffer.GetBuffer());
//printf( "szBuffer %s new %d\n", szBuffer.GetBuffer( ), nItem );
CMainFrame* pFrame = static_cast<CMainFrame*>(AfxGetApp( )->m_pMainWnd);
CChildFrame* pChild = (CChildFrame*)pFrame->CreateNewChild(RUNTIME_CLASS(CChildFrame), IDR_ReClass2015TYPE, theApp.m_hMDIMenu, theApp.m_hMDIAccel);
pChild->m_wndView.m_pClass = theApp.Classes[nItem];
// This will get overwritten for each class that is opened
pChild->SetTitle(theApp.Classes[nItem]->Name);
pChild->SetWindowTextA(theApp.Classes[nItem]->Name);
pFrame->UpdateFrameTitleForDocument(theApp.Classes[nItem]->Name);
}
CDialogEx::OnOK();
}
示例2: OnCmdMsg
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
if (nCode == CN_UPDATE_COMMAND_UI)
{
if (nID >= WM_CLASSMENU && nID < (WM_CLASSMENU + WM_MAXITEMS))
{
((CCmdUI*)pExtra)->Enable(TRUE);
return TRUE;
}
else if (nID >= WM_PROCESSMENU && nID < (WM_PROCESSMENU + WM_MAXITEMS))
{
((CCmdUI*)pExtra)->Enable(TRUE);
return TRUE;
}
else if (nID >= WM_DELETECLASSMENU && nID < (WM_DELETECLASSMENU + WM_MAXITEMS))
{
((CCmdUI*)pExtra)->Enable(TRUE);
return TRUE;
}
}
if (nCode == CN_COMMAND)
{
if (nID >= WM_CLASSMENU && nID < (WM_CLASSMENU + WM_MAXITEMS))
{
UINT idx = nID - WM_CLASSMENU;
CChildFrame* pChild = (CChildFrame*)this->CreateNewChild(RUNTIME_CLASS(CChildFrame), IDR_ReClass2015TYPE, theApp.m_hMDIMenu, theApp.m_hMDIAccel);
CNodeClass* pClass = theApp.Classes[idx];
pClass->pChildWindow = pChild;
pChild->SetTitle(pClass->Name);
pChild->SetWindowText(pClass->Name);
UpdateFrameTitleForDocument(pClass->Name);
pChild->m_wndView.m_pClass = pClass;
return TRUE;
}
if (nID >= WM_PROCESSMENU && nID < (WM_PROCESSMENU + WM_MAXITEMS) )
{
UINT idx = nID - WM_PROCESSMENU;
g_ProcessID = ProcMenuItems[idx].ProcessId;
g_hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, g_ProcessID);
UpdateMemoryMap();
return TRUE;
}
if (nID >= WM_DELETECLASSMENU && nID < (WM_DELETECLASSMENU + WM_MAXITEMS) )
{
UINT idx = nID - WM_DELETECLASSMENU;
if (theApp.Classes[idx]->pChildWindow)
theApp.Classes[idx]->pChildWindow->SendMessage(WM_CLOSE, 0, 0);
theApp.DeleteClass(theApp.Classes[idx]);
return TRUE;
}
}
return CMDIFrameWndEx::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
示例3: OnInitialUpdate
void CdcmviewerView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
memset(m_lut,0,sizeof(m_lut));
CString title;
title.Format(_T("DicomView:%s"),GetDocument()->GetTitle());
CChildFrame* pMDI = (CChildFrame*)GetParent();
pMDI->SetTitle(title);
SetScrollRange();
}
示例4: OnPaint
void CChildView::OnPaint()
{
CRect pos(0, 0, 0, 0);
HotSpots.clear();
CPaintDC pdc(this); // device context for painting
CMemDC m(pdc, this);
CDC& dc = m.GetDC();
CRect client;
GetClientRect(&client);
dc.FillSolidRect(&client, crBackground);
if (!m_pClass)
return;
dc.SelectObject(&Font);
HotSpots.clear();
DWORD classSize = m_pClass->GetMemorySize();
Memory.SetSize(classSize);
ReadMemory((LPVOID)m_pClass->offset, Memory.pMemory, classSize);
ViewInfo View;
View.Address = m_pClass->offset;
View.pData = Memory.pMemory;
View.Classes = &theApp.Classes;
View.client = &client;
View.dc = &dc;
View.Level = 0;
View.HotSpots = &HotSpots;
View.bMultiSelected = (Selected.size() > 1) ? true : false;
int ypos = m_Scroll.GetScrollPos() * FontHeight;
if (m_Scroll.IsWindowVisible()) View.client->right -= SB_WIDTH;
int DrawMax = m_pClass->Draw(View, 0, -ypos) + ypos;
if (m_pClass->RequestPosition != -1)
{
if ((m_pClass->RequestPosition >= 0) && ((unsigned int)m_pClass->RequestPosition < theApp.Classes.size()))
{
int idx = -1;
for (UINT i = 0; i < theApp.Classes.size(); i++)
{
CNodeClass* pClass = View.Classes->at(i);
if (m_pClass == theApp.Classes[i])
idx = i;
}
theApp.Classes.erase(theApp.Classes.begin() + idx);
theApp.Classes.insert(theApp.Classes.begin() + m_pClass->RequestPosition, m_pClass);
}
m_pClass->RequestPosition = -1;
}
if (client.Height() < DrawMax)
{
SCROLLINFO si;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_PAGE | SIF_RANGE;
si.nMin = 0;
si.nMax = DrawMax / FontHeight;
si.nPage = client.Height() / FontHeight;
m_Scroll.SetScrollInfo(&si);
m_Scroll.ShowScrollBar(1);
}
else
{
m_Scroll.SetScrollPos(0);
m_Scroll.ShowScrollBar(0);
}
// this makes tabs
CMDIFrameWnd* pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CChildFrame* pChild = (CChildFrame*)pFrame->GetActiveFrame();
if (pChild->m_wndView.m_hWnd == this->m_hWnd)
{
pChild->SetWindowText(m_pClass->Name.GetString());
pChild->SetTitle(m_pClass->Name.GetString());
pFrame->UpdateFrameTitleForDocument(m_pClass->Name.GetString());
//char txt[256];
//sprintf (txt,"Total HotSpots: %i",HotSpots.size());
//dc.SetTextColor(0xFF0000);
//dc.SetBkColor(0x000000);
//dc.SetBkMode(OPAQUE);
//dc.DrawText(txt,-1,&CRect(0,0,0,0), DT_LEFT | DT_NOCLIP | DT_NOPREFIX);
}
//for (UINT i=0; i < HotSpots.size();i++)
//{
// dc.DrawFocusRect(HotSpots[i].Rect);
//}
}