本文整理汇总了C++中CChildFrame::GetCommentViewState方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::GetCommentViewState方法的具体用法?C++ CChildFrame::GetCommentViewState怎么用?C++ CChildFrame::GetCommentViewState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::GetCommentViewState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDestroy
void CViewComments::OnDestroy()
//-----------------------------
{
CChildFrame *pFrame = (CChildFrame *)GetParentFrame();
if (pFrame)
{
COMMENTVIEWSTATE *pState = pFrame->GetCommentViewState();
pState->cbStruct = sizeof(COMMENTVIEWSTATE);
pState->nId = m_nListId;
}
CView::OnDestroy();
}
示例2: OnInitialUpdate
void CViewComments::OnInitialUpdate()
//-----------------------------------
{
if(m_nListId == 0)
{
m_nListId = IDC_LIST_SAMPLES;
// For XM, set the instrument list as the default list
CModDoc *pModDoc = GetDocument();
CSoundFile *pSndFile;
if(pModDoc)
{
pSndFile= pModDoc->GetSoundFile();
if(pSndFile && (pSndFile->m_nType & MOD_TYPE_XM) && pSndFile->m_nInstruments > 0)
{
m_nListId = IDC_LIST_INSTRUMENTS;
}
}
}
CChildFrame *pFrame = (CChildFrame *)GetParentFrame();
CRect rect;
if (pFrame)
{
COMMENTVIEWSTATE *pState = pFrame->GetCommentViewState();
if (pState->cbStruct == sizeof(COMMENTVIEWSTATE))
{
m_nListId = pState->nId;
}
}
GetClientRect(&rect);
m_ToolBar.Create(WS_CHILD|WS_VISIBLE|CCS_NOPARENTALIGN, rect, this, IDC_TOOLBAR_DETAILS);
m_ToolBar.Init(CMainFrame::GetMainFrame()->m_MiscIcons, CMainFrame::GetMainFrame()->m_MiscIconsDisabled);
m_ItemList.Create(WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_SINGLESEL|LVS_EDITLABELS|LVS_NOSORTHEADER, rect, this, IDC_LIST_DETAILS);
m_ItemList.ModifyStyleEx(0, WS_EX_STATICEDGE);
// Add ToolBar Buttons
m_ToolBar.AddButton(IDC_LIST_SAMPLES, IMAGE_SAMPLES);
m_ToolBar.AddButton(IDC_LIST_INSTRUMENTS, IMAGE_INSTRUMENTS);
//m_ToolBar.AddButton(IDC_LIST_PATTERNS, TIMAGE_TAB_PATTERNS);
m_ToolBar.SetIndent(4);
UpdateButtonState();
OnUpdate(NULL, HINT_MODTYPE, NULL);
}