当前位置: 首页>>代码示例>>C++>>正文


C++ SetActivePage函数代码示例

本文整理汇总了C++中SetActivePage函数的典型用法代码示例。如果您正苦于以下问题:C++ SetActivePage函数的具体用法?C++ SetActivePage怎么用?C++ SetActivePage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetActivePage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetPageList

/****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();
}
开发者ID:Eagle3386,项目名称:WhatPulse-Logitech-Widget,代码行数:36,代码来源:EZ_LCD.cpp

示例2: _wtoi

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;
}
开发者ID:iloveghq,项目名称:Otdr_v1,代码行数:32,代码来源:PropSheet.cpp

示例3: ModifyStyleEx

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;
}
开发者ID:DavidKinder,项目名称:Windows-Frotz,代码行数:30,代码来源:FrotzDialogs.cpp

示例4: ASSERT

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;
}
开发者ID:leiqunni,项目名称:STEP_Unicode,代码行数:35,代码来源:OptionSheet.cpp

示例5: SetActivePage

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;
}
开发者ID:aidush,项目名称:openmpt,代码行数:26,代码来源:Globals.cpp

示例6: SetActivePage

 BOOL CMyPropertySheet::OnInitDialog()
 {
	 __super::OnInitDialog();
	SetActivePage(0);
	SetActivePage(1);
	SetActivePage(2);
	return TRUE;
}
开发者ID:Codeer-Software,项目名称:FriendlyBaseTest,代码行数:8,代码来源:MyPropertySheet.cpp

示例7: AutoSize

void CCoolTabCtrl::UpdateWindow()
{
 	AutoSize();
 	if(m_nActivePage < 0)
 		SetActivePage(0);
 	else
 		SetActivePage(m_nActivePage);
 	Invalidate();
}
开发者ID:JetC,项目名称:DigitalMap,代码行数:9,代码来源:CoolTabCtrl.cpp

示例8: SetActivePage

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;
}
开发者ID:IcyX,项目名称:bote,代码行数:56,代码来源:MainDlg.cpp

示例9: AddPage

//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;
}
开发者ID:felixcollins,项目名称:onstation,代码行数:17,代码来源:ColorSheet.cpp

示例10: OnSelChanged

/*--------------------------------------------------------------------
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 */
}
开发者ID:RKelson93,项目名称:mushclient,代码行数:35,代码来源:TreePropertySheet.cpp

示例11: CTreePropSheet

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 );
}
开发者ID:IMSoP,项目名称:CDex,代码行数:29,代码来源:ConfigDlg.cpp

示例12: CRect

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;
}
开发者ID:dulton,项目名称:brpj,代码行数:27,代码来源:ScreenPannel.cpp

示例13: HitTestTabs

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();
        }
    }
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:31,代码来源:bar.cpp

示例14: GetActiveIndex

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);
	}
}
开发者ID:elha,项目名称:CDex,代码行数:60,代码来源:TreePropSheet.cpp

示例15: switch

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;
}
开发者ID:KristinaTaylor,项目名称:TortoiseSI,代码行数:35,代码来源:ResizableSheetEx.cpp


注:本文中的SetActivePage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。