本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例6: SetActivePage
BOOL CMyPropertySheet::OnInitDialog()
{
__super::OnInitDialog();
SetActivePage(0);
SetActivePage(1);
SetActivePage(2);
return TRUE;
}
示例7: AutoSize
void CCoolTabCtrl::UpdateWindow()
{
AutoSize();
if(m_nActivePage < 0)
SetActivePage(0);
else
SetActivePage(m_nActivePage);
Invalidate();
}
示例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;
}
示例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;
}
示例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 */
}
示例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 );
}
示例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;
}
示例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();
}
}
}
示例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);
}
}
示例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;
}