예제 #1
0
void CViewComments::OnDestroy()
//-----------------------------
{
	CChildFrame *pFrame = (CChildFrame *)GetParentFrame();
	if (pFrame)
	{
		COMMENTVIEWSTATE *pState = pFrame->GetCommentViewState();
		pState->cbStruct = sizeof(COMMENTVIEWSTATE);
		pState->nId = m_nListId;
	}
	CView::OnDestroy();
}
예제 #2
0
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);
}