/****f* LCD.SDK/RemovePage(INT.pageNumber)
* NAME
*  INT RemovePage(INT pageNumber) -- Call this method to remove a page
*  from the pages you've created to be displayed on the LCD.
* INPUTS
*  pageNumber - The number for the page that is to be removed.
* RETURN VALUE
*  Current number of pages, after the page is removed.
******
*/
INT CEzLcd::RemovePage(INT pageNumber)
{
    LCD_PAGE_LIST& PageList = GetPageList();

    // Do we have this page, if not return error
    if (pageNumber >= (INT)(PageList.size()))
    {
        return -1;
    }

    // find the next active screen
    LCD_PAGE_LIST::iterator it = PageList.begin();
    PageList.erase(it + pageNumber);

    // If there are any pages, the first one is the active page
    if (PageList.size())
    {
        SetActivePage(*PageList.begin());
    }
    else
    {
        SetActivePage(NULL);
    }

    return (INT)PageList.size();
}
Example #2
0
LRESULT CPropSheet::WizardBack()//前一页面
{
	int nPrint = _wtoi(g_sorFileArray.reportConfig.Print); //是否为报表
	int nActivePage = GetActiveIndex();
	switch (nActivePage)
	{
	case REPORT_PAGE::PROP_SETTING:
		break;	
	
	case REPORT_PAGE::PROP_FILE_SELECT:
		{
			SetActivePage(PROP_SETTING);
			break;
		}
	
	case PROP_CONFIG:
		{
			//SetActivePage(PROP_FILE_SELECT);
			MAIN->ShowMainSetting(TRUE);
			break;
		}
	
	case REPORT_PAGE::PROP_OUTPUT:
		{
			//MAIN->ShowMainSetting(TRUE);
			SetActivePage(PROP_CONFIG);
			break;
		}
	}

	return 0;
}
BOOL OptionsDialog::OnInitDialog() 
{
  CPropertySheet::OnInitDialog();

  // Enable context sensitive help
  ModifyStyleEx(0,WS_EX_CONTEXTHELP);

  // Create the font to use
  m_font.CreateFontIndirect(&m_logFont);

  // Set the font for the property pages
  ChangeDialogFont(this,&m_font);
  CPropertyPage* page = GetActivePage();
  for (int i = 0; i < GetPageCount(); i++)
  {
    SetActivePage(i);
    CPropertyPage* page = GetActivePage();
    ChangeDialogFont(page,&m_font);
  }
  SetActivePage(page);

  // Resize the property page
  CTabCtrl* tab = GetTabControl();
  tab->GetWindowRect(&m_page);
  ScreenToClient(&m_page);
  tab->AdjustRect(FALSE,&m_page);
  page->MoveWindow(&m_page);

  return TRUE;
}
Example #4
0
void COptionSheet::OnBack()
{
	LRESULT result;
	
	// Make sure there is a current item it has a page
	ASSERT(NULL != m_CurrentPage);

	// Make sure the Next button is enabled
	CWnd *wnd = GetDlgItem(ID_WIZBACK);
	if(NULL == wnd) {
		return;
	}

	if(FALSE == wnd->IsWindowEnabled()) {
		return;
	}

	// Check to see if we can move to the next page
	result = GetPage(m_PageIndex)->OnWizardNext();

	switch(result) {
	case -1:
		break;
	case 0:
		SetActivePage(--m_PageIndex);
		break;
	default:
		if(result > 0) {
			SetActivePage(result);
		}
		break;
	}

	return;
}
Example #5
0
LRESULT CModControlView::OnActivateModView(WPARAM nIndex, LPARAM lParam)
//----------------------------------------------------------------------
{
    if (m_TabCtrl.m_hWnd)
    {
        if (nIndex < 100)
        {
            m_TabCtrl.SetCurSel(nIndex);
            SetActivePage(nIndex, lParam);
        } else
        // Might be a dialog id IDD_XXXX
        {
            int nItems = m_TabCtrl.GetItemCount();
            for (int i=0; i<nItems; i++)
            {
                if (m_TabCtrl.GetItemData(i) == nIndex)
                {
                    m_TabCtrl.SetCurSel(i);
                    SetActivePage(i, lParam);
                    break;
                }
            }
        }
    }
    return 0;
}
 BOOL CMyPropertySheet::OnInitDialog()
 {
	 __super::OnInitDialog();
	SetActivePage(0);
	SetActivePage(1);
	SetActivePage(2);
	return TRUE;
}
Example #7
0
void CCoolTabCtrl::UpdateWindow()
{
 	AutoSize();
 	if(m_nActivePage < 0)
 		SetActivePage(0);
 	else
 		SetActivePage(m_nActivePage);
 	Invalidate();
}
Example #8
0
BOOL CMainDlg::OnInitDialog()
{
	BOOL bResult = CPropertySheet::OnInitDialog();

	// CChooseRacePage einmal öffnen, damit die Steuerelemente existieren
	SetActivePage(1);
	SetActivePage(0);

	// Hilfe-Button wieder entfernen, andere Buttons verschieben
/*	CWnd *helpBtn = GetDlgItem(IDHELP);
	if (helpBtn)
	{
		CWnd *cancelBtn = GetDlgItem(IDCANCEL);
		AssertBotE(cancelBtn);

		CRect rect1, rect2;
		cancelBtn->GetWindowRect(&rect1);
		helpBtn->GetWindowRect(&rect2);

		int dx = rect2.right - rect1.right;

		helpBtn->ShowWindow(SW_HIDE);
		rect1.MoveToX(rect1.left + dx);
		ScreenToClient(&rect1);
		cancelBtn->MoveWindow(rect1);

		CWnd *backBtn = GetDlgItem(ID_WIZBACK);
		if (backBtn)
		{
			backBtn->GetWindowRect(&rect1);
			rect1.MoveToX(rect1.left + dx);
			ScreenToClient(&rect1);
			backBtn->MoveWindow(rect1);
		}

		CWnd *nextBtn = GetDlgItem(ID_WIZNEXT);
		if (nextBtn)
		{
			nextBtn->GetWindowRect(&rect1);
			rect1.MoveToX(rect1.left + dx);
			ScreenToClient(&rect1);
			nextBtn->MoveWindow(rect1);
		}

		CWnd *finishBtn = GetDlgItem(ID_WIZFINISH);
		if (finishBtn)
		{
			finishBtn->GetWindowRect(&rect1);
			rect1.MoveToX(rect1.left + dx);
			ScreenToClient(&rect1);
			finishBtn->MoveWindow(rect1);
		}
	} */

	return bResult;
}
Example #9
0
//The warning generated by this code is OK because we do not use the
//this pointer until the OnInitDialog in the base members.  -TVI
CColorSheet::CColorSheet(UINT nIDCaption,int iStartColorScheme,CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage),m_AgePage(this),m_DepthPage(this)
{
	AddPage(&m_AgePage);
	AddPage(&m_DepthPage);
	if (iStartColorScheme==0)
	{
		SetActivePage(&m_AgePage);
	}
	else
	{
		SetActivePage(&m_DepthPage);
	}
	m_iRecommendedColorSchemeIndex=COLORSCHEME_AGE;
}
/*--------------------------------------------------------------------
FUNCTION:	OnSelChanged(NMHDR* pNotifyStruct, LRESULT* pResult);
RETURNS:		
PURPOSE:		
--------------------------------------------------------------------*/
void	 CTreePropertySheet::OnSelChanged(
				NMHDR* pNotifyStruct, 
				LRESULT* pResult)
{
	NMTREEVIEW	*pNotify=(NMTREEVIEW*)pNotifyStruct;

	(*pResult)	=0;
	
	int		dwPage=m_cTreeCtrl.GetItemData(pNotify->itemNew.hItem);
	LockWindowUpdate();
  if (GetPageIndex(GetActivePage()) != dwPage)    // NJG
  {
	  /* Theming has these nice fades inbetween controls being disabled and enabled.
	   * That is all nice and well, but switching a page for the _first_ time since
	   * the dialog had been opened causes the dialog controls to be updated in plain
	   * sight - a rather visible and eye-catching affair once you are aware of it.
	   * Updating the dialog controls manually before switching to the active page
	   * causes these updates to be done while the user cannot see it. -JW
	   */
	  GetPage(dwPage)->UpdateDialogControls(this, false);
	  SetActivePage(dwPage);
  }
	UnlockWindowUpdate();

	// Prevent losing the focus when invoked by keyboard
	if(pNotify->action==TVC_BYKEYBOARD)
		m_cTreeCtrl.SetFocus();

  InvalidateRect(NULL, FALSE);  /* invalidate entire control for redraw -JW */
}
Example #11
0
ConfigSheet::ConfigSheet( int nSelectTab,CWnd* pParentWnd )
	: CTreePropSheet( IDS_PROPSHEET_CDEXCONFIG, pParentWnd )
{
    CUStringConvert strCnv;

	// translate property sheet title
    SetTitle( strCnv.ToT( g_language.GetString( IDS_PROPSHEET_CDEXCONFIG ) ) );

	m_psh.dwFlags |= PSH_NOAPPLYNOW;	// Construct pages

    SetTreeViewMode( TRUE, TRUE, 0 );

    SetEmptyPageText( strCnv.ToT( g_language.GetString( IDS_PROPPAGE_SELECT_CHILD_ITEM  ) ));

	AddPage( &m_GenericPropPage );
	AddPage( &m_FilenamePropPage );
	AddPage( &m_CDPropPage );
	AddPage( &m_EncoderPropPage );
	AddPage( &m_LocalCDDBPropPage );
	AddPage( &m_RemoteCDDBPropPage );
	AddPage( &m_TagPropPage );

	ASSERT( nSelectTab>=0 && nSelectTab<4);

	m_bIsInSync = FALSE;

	// Select Active Page
	SetActivePage( nSelectTab );
}
Example #12
0
int CScreenPannel::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	for(int i = 0; i < 16; i++)
	{
		m_wndVideo[i].Create(
			NULL, 
			NULL, 
			WS_VISIBLE | WS_CHILD,
			CRect(0, 0, 0, 0),
			this,
			1979,
			NULL);

		m_wndVideo[i].SetWinID(i);
		
		AddPage(&m_wndVideo[i]);
	}

	SetActivePage(&m_wndVideo[0], TRUE);
	SetDrawActivePage(TRUE, RGB(248,5,182), RGB(248,5,182));

	return 0;
}
Example #13
0
OSStatus
CPrinterSetupWizardSheet::OnRemovePrinter( Printer * printer, bool moreComing )
{
	CPropertyPage	*	active	= GetActivePage();
	OSStatus			err		= kNoErr;

	if ( active == &m_pgSecond )
	{
		m_pgSecond.OnRemovePrinter( printer, moreComing );
	}

	m_printers.remove( printer );

	if ( m_selectedPrinter == printer )
	{
		m_selectedPrinter = NULL;

		if ( ( active == &m_pgThird ) || ( active == &m_pgFourth ) )
		{
			CString caption;
			CString message;

			caption.LoadString( IDS_ERROR_CAPTION );
			message.LoadString( IDS_PRINTER_UNAVAILABLE );

			MessageBox(message, caption, MB_OK|MB_ICONEXCLAMATION);

			SetActivePage( &m_pgSecond );
		}
	}

	delete printer;

	return err;
}
Example #14
0
void wxRibbonBar::OnMouseLeftDown(wxMouseEvent& evt)
{
    wxRibbonPageTabInfo *tab = HitTestTabs(evt.GetPosition());
    if(tab && tab != &m_pages.Item(m_current_page))
    {
        wxRibbonBarEvent query(wxEVT_COMMAND_RIBBONBAR_PAGE_CHANGING, GetId(), tab->page);
        query.SetEventObject(this);
        ProcessWindowEvent(query);
        if(query.IsAllowed())
        {
            SetActivePage(query.GetPage());

            wxRibbonBarEvent notification(wxEVT_COMMAND_RIBBONBAR_PAGE_CHANGED, GetId(), m_pages.Item(m_current_page).page);
            notification.SetEventObject(this);
            ProcessWindowEvent(notification);
        }
    }
    else if(tab == NULL)
    {
        if(m_tab_scroll_left_button_rect.Contains(evt.GetPosition()))
        {
            m_tab_scroll_left_button_state |= wxRIBBON_SCROLL_BTN_ACTIVE | wxRIBBON_SCROLL_BTN_HOVERED;
            RefreshTabBar();
        }
        else if(m_tab_scroll_right_button_rect.Contains(evt.GetPosition()))
        {
            m_tab_scroll_right_button_state |= wxRIBBON_SCROLL_BTN_ACTIVE | wxRIBBON_SCROLL_BTN_HOVERED;
            RefreshTabBar();
        }
    }
}
Example #15
0
void CTreePropSheet::ActivatePreviousPage()
{
	if (!IsWindow(m_hWnd))
		return;

	if (!IsWindow(m_pwndPageTree->GetSafeHwnd()))
	{
		// normal tab property sheet. Simply use page index
		int	nPageIndex = GetActiveIndex();
		if (nPageIndex<0 || nPageIndex>=GetPageCount())
			return;

		int	nPrevIndex = (nPageIndex==0)? GetPageCount()-1 : nPageIndex-1;
		SetActivePage(nPrevIndex);
	}
	else
	{
		// property sheet with page tree.
		// we need a more sophisticated handling here, than simply using
		// the page index, because we won't skip empty pages.
		// so we have to walk the page tree
		HTREEITEM	hItem = m_pwndPageTree->GetSelectedItem();
		ASSERT(hItem);
		if (!hItem)
			return;

		HTREEITEM	hPrevItem = NULL;
		if (hPrevItem=m_pwndPageTree->GetPrevSiblingItem(hItem))
		{
			while (m_pwndPageTree->ItemHasChildren(hPrevItem))
			{
				hPrevItem = m_pwndPageTree->GetChildItem(hPrevItem);
				while (m_pwndPageTree->GetNextSiblingItem(hPrevItem))
					hPrevItem = m_pwndPageTree->GetNextSiblingItem(hPrevItem);
			}
		}
		else 
			hPrevItem=m_pwndPageTree->GetParentItem(hItem);

		if (!hPrevItem)
		{
			// no prev item, so cycle to the last item
			hPrevItem = m_pwndPageTree->GetRootItem();

			while (TRUE)
			{
				while (m_pwndPageTree->GetNextSiblingItem(hPrevItem))
					hPrevItem = m_pwndPageTree->GetNextSiblingItem(hPrevItem);

				if (m_pwndPageTree->ItemHasChildren(hPrevItem))
					hPrevItem = m_pwndPageTree->GetChildItem(hPrevItem);
				else
					break;
			}
		}

		if (hPrevItem)
			m_pwndPageTree->SelectItem(hPrevItem);
	}
}
LRESULT CResizableSheetEx::OnResizeSupport(WPARAM wParam, LPARAM lParam)
{
	switch (wParam)
	{
	case RSZSUP_SHEETPAGEEXHACK:
		{
			// a window object must be still associated to the page handle
			// but MFC subclassing has been turned off to allow the system
			// to subclass it first, so we can catch all the messages
			CWnd* pWnd = CWnd::FromHandlePermanent((HWND)lParam);
			if (pWnd == NULL)
				return 0;

			// suclass the window again and refresh page and sheet
			pWnd->SubclassWindow(pWnd->Detach());
			RefreshLayout();
			pWnd->SendMessage(WM_SIZE);
			Invalidate();
			UnlockWindowUpdate();

			if (pWnd->IsWindowVisible())
			{
				// send lost PSN_SETACTIVE notification message
				CPropertyPage* pPage = DYNAMIC_DOWNCAST(CPropertyPage, pWnd);
				if (pPage != NULL)
					SetActivePage(pPage);
			}
		}
		break;

	default:
		return FALSE;
	}
	return TRUE;
}
Example #17
0
BOOL CDownloadSheet::OnInitDialog()
{
	BOOL bResult = CPropertySheetAdv::OnInitDialog();

	SetFont( &CoolInterface.m_fntNormal );
	SetIcon( theApp.LoadIcon( IDI_PROPERTIES ), TRUE );

	SetWindowText( LoadString( IDS_DOWNLOAD_PROPERTIES ) );

	if ( GetDlgItem( IDOK ) )
	{
		CRect rc;

		GetDlgItem( 0x3021 )->GetWindowRect( &rc );		// Apply Position for OK
		ScreenToClient( &rc );
		GetDlgItem( IDOK )->SetWindowPos( NULL, rc.left + 1, rc.top, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE );

		GetDlgItem( 0x0009 )->GetWindowRect( &rc );		// Help Position for Cancel
		ScreenToClient( &rc );
		GetDlgItem( IDCANCEL )->SetWindowPos( NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE );
	}

	if ( GetDlgItem( 0x3021 ) ) GetDlgItem( 0x3021 )->ShowWindow( SW_HIDE );	// No Apply
	if ( GetDlgItem( 0x0009 ) ) GetDlgItem( 0x0009 )->ShowWindow( SW_HIDE );	// No Help

	// Forcibly create all pages under protection of Transfers.m_pSection
	for ( int i = GetPageCount() - 1; i >= 0; --i )
	{
		SetActivePage( i );
	}
	m_pLock.Unlock();

	return bResult;
}
Example #18
0
void CResizableSheet::LoadWindowRect()
{
	CString data;
	WINDOWPLACEMENT wp;
	int page;

	data = AfxGetApp()->GetProfileString(m_sSection, m_sEntry);
	
	if (data.IsEmpty())	// never saved before
		return;
	
	ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
	wp.length = sizeof(WINDOWPLACEMENT);

	RECT& rc = wp.rcNormalPosition;	// alias

	if (_stscanf_s(data, PROFILE_FMT, &rc.left, &rc.top,
		&rc.right, &rc.bottom, &wp.showCmd, &wp.flags, &page) == 7)
	{
		SetWindowPlacement(&wp);
		if (m_bSavePage)
		{
			SetActivePage(page);
			ArrangeLayout();	// needs refresh
		}
	}
}
Example #19
0
void CTreePropSheet::OnPageTreeSelChanging(NMHDR *pNotifyStruct, LRESULT *plResult)
{
	*plResult = 0;
	if (m_bPageTreeSelChangedActive)
		return;
	else
		m_bPageTreeSelChangedActive = TRUE;

	NMTREEVIEW	*pTvn = reinterpret_cast<NMTREEVIEW*>(pNotifyStruct);
	int					nPage = m_pwndPageTree->GetItemData(pTvn->itemNew.hItem);
	BOOL				bResult;
	if (nPage<0 || (unsigned)nPage>=m_pwndPageTree->GetCount())
		bResult = KillActiveCurrentPage();
	else
		bResult = SetActivePage(nPage);

	if (!bResult)
		// prevent selection to change
		*plResult = TRUE;

	// Set focus to tree ctrl (I guess that's what the user expects)
	m_pwndPageTree->SetFocus();

	m_bPageTreeSelChangedActive = FALSE;

	return;
}
Example #20
0
BOOL CSettingsSheet::OnInitDialog()
{
	CDialog::OnInitDialog();

	SetWindowText( m_sCaption );

	CRect rect;
	m_wndTree.Create( WS_CHILD|WS_TABSTOP|WS_VISIBLE|/*TVS_PRIVATEIMAGELISTS|*/
		TVS_HASLINES|TVS_SHOWSELALWAYS|TVS_TRACKSELECT, rect, this, IDC_SETTINGS_TREE );

	m_wndOK.Create( _T("确定"), WS_CHILD|WS_TABSTOP|WS_VISIBLE|BS_DEFPUSHBUTTON, rect, this, IDOK );
	m_wndOK.SetFont( &CoolInterface.m_fntNormal );
	m_wndCancel.Create( _T("取消"), WS_CHILD|WS_TABSTOP|WS_VISIBLE, rect, this, IDCANCEL );
	m_wndCancel.SetFont( &CoolInterface.m_fntNormal );
	m_wndApply.Create( _T("应用(&A)"), WS_CHILD|WS_TABSTOP|WS_VISIBLE, rect, this, IDRETRY );
	m_wndApply.SetFont( &CoolInterface.m_fntNormal );

	Layout();
	CenterWindow();

	if ( m_pFirst == NULL ) m_pFirst = GetPage( 0 );
	SetActivePage( m_pFirst );

	BuildTree();

	return TRUE;
}
Example #21
0
void CMyPropertySheet::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMITEMACTIVATE lpItem = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
	m_nSelectedItem = lpItem->iItem ;

   if (lpItem->iItem  >= 0 && lpItem->iItem < m_wndList.GetItemCount())
   {
	   m_nSelectedItem = lpItem->iItem;
	   CString strCaption = m_wndList.GetItemText(lpItem->iItem,0);
	_tcscpy(m_szCaption, strCaption);
	
	

	SetActivePage(m_nSelectedItem);
	
	Invalidate();
	
	
	GetPage(m_nSelectedItem)->MoveWindow(&m_rectPage);

	m_wndList.SetFocus();
   }
	
	
}
Example #22
0
BOOL CPreferencesDlg::OnInitDialog()
{
	ASSERT( !m_bSaveIniFile );
	BOOL bResult = CTreePropSheet::OnInitDialog();
	InitWindowStyles(this);

	for (int i = 0; i < m_pages.GetSize(); i++)
	{
		if (GetPage(i)->m_psp.pszTemplate == m_pPshStartPage)
		{
			SetActivePage(i);
			break;
		}
	}

	//Xman Preferences Banner
	CBitmap bmp;
	VERIFY( bmp.Attach(theApp.LoadImage(_T("BANNER"), _T("JPG"))) );
	if (bmp.GetSafeHandle())
	{
		m_banner.SetTexture((HBITMAP)bmp.Detach());	
		m_banner.SetFillFlag(KCSB_FILL_TEXTURE);
		m_banner.SetSize(75);
		m_banner.SetTitle(_T(""));
		m_banner.SetCaption(_T(""));
		m_banner.Attach(this, KCSB_ATTACH_RIGHT);
	}
	//Xman end

	Localize();	
	return bResult;
}
Example #23
0
BOOL COptionsDlg::OnInitDialog() 
{
	BOOL bResult = CPropertySheet::OnInitDialog();
	CreateResetAllButton();	// create reset all button
	SetActivePage(m_CurPage);	// set current page
	GetInfo(m_PrevInfo);	// save current state; restore on cancel
	return bResult;
}
Example #24
0
BOOL CMyPropertySheet::PreTranslateMessage(MSG* pMsg)
{
	// TODO: 在此添加专用代码和/或调用基类
/*
	if(pMsg!=NULL && pMsg->message == WM_LBUTTONDOWN)
	{
		CWnd *pWnd = (CWnd*)CPropertySheet::GetTabControl();
		if(pWnd !=NULL &&pWnd->GetSafeHwnd() == pMsg->hwnd)
		{
			::SendMessage(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam);
			if(GetActiveIndex() == 0)
			{

			}else
			{

			}
			return TRUE;
		}
	}
*/
	if(pMsg->message == WM_KEYUP && pMsg->wParam ==  VK_PRIOR)
	{
		if(GetPageCount()>1)
		{
			if(GetActiveIndex()==0)
				SetActivePage(GetPageCount()-1);
			else
				SetActivePage(GetActiveIndex()-1);
		}
	}

	if(pMsg->message == WM_KEYUP && pMsg->wParam == VK_NEXT)
	{
		if(GetPageCount()>1)
		{
			if(GetActiveIndex()==(GetPageCount()-1))
				SetActivePage(0);
			else
				SetActivePage(GetActiveIndex()+1);
		}
	}


	return CPropertySheet::PreTranslateMessage(pMsg);
}
Example #25
0
BOOL CPSCPColorDialog::OnInitDialog()
{
	MoveWindow(0,0,350,300);
	BOOL ret =  CXTPColorDialog::OnInitDialog();

	SetActivePage(2);

	return ret;
}
Example #26
0
void CNewProfileWizard::DoBack()
{
	PressButton(PSBTN_BACK);

	if(theApp.m_bPEEnabled)
	{
		CPropertyPage* curPage = GetActivePage();
		
		if(curPage == m_pASWReadyPage)  
			SetActivePage(m_pProfileNamePage);
		
		if(curPage == m_pMucReadyPage && m_bUpgrade)
			SetActivePage(m_pProfileNamePage);

		if(curPage == m_pMucIntroPage && m_bUpgrade)
			SetActivePage(m_pIntroPage);
	}
}
Example #27
0
void COptionSheet::ListSelectionChanging(NMHDR *pNMHDR, LRESULT *pResult)
{
	COptionPage *page;

	page = m_ListWindow->GetSelection();
	if(NULL != page) {
		ASSERT_KINDOF(COptionPage, page);
	}
	*pResult = SetActivePage(page);
}
Example #28
0
void CSettingsSheet::OnSelectPage(NM_TREEVIEW* pNotify, LRESULT *pResult)
{
	*pResult = NULL;

	if ( ( pNotify->itemNew.state & TVIS_SELECTED ) == 0 ) return;
	CSettingsPage* pPage = (CSettingsPage*)m_wndTree.GetItemData( m_wndTree.GetSelectedItem() );
	if ( pPage == NULL || pPage == m_pPage ) return;

	SetActivePage( pPage );
}
Example #29
0
// don't take focus
void CInfoSheet::SoftSetActivePage( INDEX iActivePage)
{
  // get active view 
  CWorldEditorView *pWorldEditorView = theApp.GetActiveView();
  SetActivePage( iActivePage);
  if( pWorldEditorView != NULL)
  {
//    pWorldEditorView->SetFocus();
  }
}
Example #30
0
BOOL CSettingsSheet::SkinMe(LPCTSTR pszSkin, UINT nIcon, BOOL bLanguage)
{
	EnableBanner( FALSE );

	m_szPages.cx = m_szPages.cy = 0;

	for ( int nPage = 0 ; nPage < GetPageCount() ; nPage++ )
	{
		CSettingsPage* pPage = GetPage( nPage );
		CDialogTemplate pTemplate;

		if ( pPage->GetTemplateName() == NULL )  continue;

		if ( pTemplate.Load( pPage->GetTemplateName() ) )
		{
			CSize size;
			pTemplate.GetSizeInPixels( &size );
			m_szPages.cx = max( m_szPages.cx, size.cx );
			m_szPages.cy = max( m_szPages.cy, size.cy );
		}
	}

	CRect rcWindow(
		0,
		0,
		m_szPages.cx + m_nListWidth + m_nListMargin,
		m_szPages.cy + + m_nButtonHeight + 8 + 8 + 2 );
	CalcWindowRect( &rcWindow );
	SetWindowPos( &wndTop, 0, 0, rcWindow.Width(), rcWindow.Height(),
		SWP_NOMOVE|SWP_NOZORDER );

	CRect rcTree(
		0,
		2,
		m_nListWidth,
		2 + m_szPages.cy );
	m_wndTree.MoveWindow( &rcTree );

	CRect rcButton(
		8,
		2 + m_szPages.cy + 8,
		8 + m_nButtonWidth,
		2 + m_szPages.cy + 8 + m_nButtonHeight );
	m_wndOK.MoveWindow( &rcButton );
	rcButton.OffsetRect( rcButton.Width() + 8, 0 );
	m_wndCancel.MoveWindow( &rcButton );
	rcButton.OffsetRect( rcButton.Width() + 8, 0 );
	m_wndApply.MoveWindow( &rcButton );

	CenterWindow();

	SetActivePage( m_pPage ? m_pPage : m_pFirst );

	return CSkinDialog::SkinMe( pszSkin, nIcon, bLanguage );
}