Esempio n. 1
0
bool PluginWizard::Run(NewPluginData& pd)
{
    bool res = RunWizard( GetFirstPage() );
    if ( res ) {
        pd.SetCodelitePath( m_dirPickerCodeliteDir->GetPath() );
        pd.SetPluginDescription( m_textCtrlDescription->GetValue() );
        pd.SetPluginName( m_textCtrlName->GetValue() );
        pd.SetProjectPath( m_textCtrlPreview->GetValue() );
    }
    return res;
}
Esempio n. 2
0
// Set first page as active page
BOOL CNewWizDialog::SetFirstPage()
{
  CNewWizPage* pPage = GetFirstPage();

	if (!DeactivatePage()) return FALSE;

	EnableBack(FALSE);
	
	if (m_PageList.GetCount() > 1)
	{
		EnableFinish(FALSE);
		EnableNext(TRUE);
	}
	else // wizard has only one page
	{
		EnableFinish(TRUE);
		EnableNext(FALSE);
	}

	if (ActivatePage(pPage)) return TRUE;
	return FALSE;
}
Esempio n. 3
0
void CNewWizDialog::OnWizardBack() 
{
	CNewWizPage* pPage = GetActivePage();
	ASSERT(pPage);

	LRESULT lResult = pPage->OnWizardBack();
	if (lResult == -1) return; // don't change pages

	if (lResult == 0)
	{
		POSITION Pos = m_PageList.Find(pPage);
		ASSERT(Pos);
		m_PageList.GetPrev(Pos);
		if (Pos == NULL) return; // the current page was the first page
		pPage = (CNewWizPage*)m_PageList.GetAt(Pos);
	}
	else
	{
		pPage = GetPageByResourceID(lResult);
		if (pPage == NULL) return;
	}

	if (!ActivatePage(pPage)) return;	

	// if we are on the first page, then disable the back button
	if (pPage == GetFirstPage())
	{
		EnableBack(FALSE);
	}
	//  if we are not on the last page disable finish button
	if (pPage != GetLastPage())
	{
		EnableFinish(FALSE);
	}

	// enable the next button
	EnableNext(TRUE);
}