當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetPage函數代碼示例

本文整理匯總了C++中GetPage函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetPage函數的具體用法?C++ GetPage怎麽用?C++ GetPage使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetPage函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ReleaseCapture

LRESULT CPageNavigator::OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if (!m_bCapture)
		return S_OK;
		
	ReleaseCapture();
	m_bCapture = false;

	if (!m_bDown)
		return S_OK;
		
	m_bDown = false;

	int nPage = -1;
	POINT ptCursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
	for (int i = 0; i < GetItemCount(); i++)
	{
		RECT ItemRect = {0,0,0,0};
		GetIconRect(i, &ItemRect);
		if (::PtInRect(&ItemRect, ptCursor))
		{
			nPage = i;
			break;
		}
	}

	if (::GetFocus() != m_hWnd)
		::SetFocus(m_hWnd);

	if (nPage < m_pAGDoc->GetNumPages())
	{
		int nLastPage = GetPage();
		if (SelectPage(nPage, true/*bSetState*/))
			SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED/*wNotifyCode*/), MAKELPARAM(nLastPage,nPage));
	}
	else
	{ // It must be the add button
		SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(IDC_DOC_PAGEADD, BN_CLICKED/*wNotifyCode*/), 0L);
	}

	return S_OK;
}
開發者ID:jimmccurdy,項目名稱:ArchiveGit,代碼行數:42,代碼來源:PageNavigator.cpp

示例2: tr

void SeView::keyPressEvent(QKeyEvent * e)
{
	bool accepted = false;
	int k = e->key();
	if (k == Qt::Key_Delete)
	{
		e->accept();
		if (ScMessageBox::question(this, tr("Delete Page?"),
			 "<qt>" + tr("Are you sure you want to delete this page?") + "</qt>",
			QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
		{
			bool dummy;
			int pageToDelete=GetPage(currentRow(), currentColumn(), &dummy);
			emit DelPage(pageToDelete);
		}
		accepted = true;
	}
	if (!accepted)
		QTableWidget::keyPressEvent(e);
}
開發者ID:gyuris,項目名稱:scribus,代碼行數:20,代碼來源:pagepalette_widgets.cpp

示例3: DYNAMIC_DOWNCAST

// Mark all pages as initialised. This allows them
// to determine that any OnSetActive() calls they
// get are the genuine article, and not a consequence
// of the resizer being initialised
BOOL CNGWizard::SetInitialisingFlag(BOOL bInitialising)
{
	BOOL bResult = FALSE;

	// Mark all pages as initialised
	// This is so they know the next OnSetActive() they
	// get will be a REAL one...
	for (int nPage = 0; nPage < GetPageCount(); nPage++ )
	{
		CNGWizardPage* pPage = DYNAMIC_DOWNCAST(	CNGWizardPage,
												GetPage(nPage) );
		if (pPage != NULL)
		{
			pPage->SetInitialisingFlag(bInitialising);

			bResult = TRUE;
		}
	}
	return bResult;
}
開發者ID:jhbsz,項目名稱:cpe-1,代碼行數:24,代碼來源:NGWizard.cpp

示例4: GetPage

void CSettingsSheet::BuildTree()
{
	HTREEITEM hGroup = NULL;

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

		if ( pPage->m_bGroup ) hGroup = NULL;

		HTREEITEM hItem = m_wndTree.InsertItem(
			TVIF_PARAM|TVIF_TEXT|TVIF_STATE,
			pPage->m_sCaption, 0, 0, TVIS_EXPANDED|(TVIS_BOLD*pPage->m_bGroup),
			TVIS_EXPANDED|TVIS_BOLD, (LPARAM)pPage, hGroup, TVI_LAST );

		if ( pPage->m_bGroup ) hGroup = hItem;

		if ( pPage == m_pPage ) m_wndTree.SelectItem( hItem );
	}
}
開發者ID:pics860,項目名稱:callcenter,代碼行數:20,代碼來源:WndSettingsSheet.cpp

示例5: GetPage

void cbAuiNotebook::RestoreFocus()
{
    // if selected tab has changed, we set the focus on the window it belongs too
    if ((m_LastSelected != wxNOT_FOUND) && (GetSelection() != m_LastSelected))
    {
        wxWindow* win = GetPage(GetSelection());
        if (win)
            win->SetFocus();
    }
    // otherwise, we restore the former focus, if the window
    // with the saved Id still exists
    else if (m_LastId != 0)
    {
        wxWindow* win = FindWindowById(m_LastId);
        if (win)
            win->SetFocus();
    }
    m_LastSelected = wxNOT_FOUND;
    m_LastId = 0;
}
開發者ID:WinterMute,項目名稱:codeblocks_sf,代碼行數:20,代碼來源:cbauibook.cpp

示例6: GetSize

void ReportView::Paint(Draw& w) {
	Size sz = GetSize();
	if(sz.cx <= 0 || sz.cy <= 0) return;
	if(!vsize || !report) {
		w.DrawRect(0, 0, sz.cx, sz.cy, SGray);
		return;
	}
	int i = sb / pagesize.cy;
	int y = i * pagesize.cy - sb;
	i *= pvn;
	while(y < sz.cy) {
		int x = 0;
		for(int j = pvn; j--;) {
			if(i < report->GetCount()) {
				w.DrawImage(x + 1, y + 1, GetPage(i));
				if(j == 0) {
					w.DrawRect(x + pagesize.cx - 1, y, sz.cx - x - pagesize.cx, pagesize.cy, White);
					DrawFrame(w, x, y, sz.cx - x, pagesize.cy, White, LtGray);
				}
				else
					DrawFrame(w, x, y, pagesize.cx, pagesize.cy, White, LtGray);
				if(numbers) {
					String n = Format("%d", i + 1);
					Size tsz = GetTextSize(n, StdFont());
					tsz += Size(8, 4);
					int tx = x + pagesize.cx - tsz.cx;
					DrawFrame(w, tx, y, tsz.cx, tsz.cy, Black, Black);
					w.DrawRect(tx + 1, y + 1, tsz.cx - 2, tsz.cy - 2, Yellow);
					w.DrawText(tx + 4, y + 2, n);
				}
			}
			else {
				w.DrawRect(x, y, sz.cx - x, pagesize.cy, Gray);
				break;
			}
			x += pagesize.cx;
			i++;
		}
		y += pagesize.cy;
	}
}
開發者ID:AbdelghaniDr,項目名稱:mirror,代碼行數:41,代碼來源:ReportDlg.cpp

示例7: return

//-----------------------------------------------------------------------------------------------
// GetLastPage
//
// Updates the page handle with the last reserved page of the file.
//-----------------------------------------------------------------------------------------------
t_rc STORM_FileHandle::GetLastPage(STORM_PageHandle &pageHandle)
{
	if (!m_isOpened)
		return (STORM_FILENOTOPENED);

	int lastPageID = INVALID_PAGEID;

	for (int pageCounter = 1; pageCounter <= m_fileSubHeader.numAllocatedPages; pageCounter++) 
	{
		if (IsPageReserved(pageCounter)) 
		{
			lastPageID = pageCounter;
			m_filePos = lastPageID;
		}
	}

	if (lastPageID == INVALID_PAGEID)
		return (STORM_EOF);

	return (GetPage(lastPageID, pageHandle));
}
開發者ID:csdashes,項目名稱:DB-Implementation,代碼行數:26,代碼來源:STORM_FileHandle.cpp

示例8: UpdateTabControlsArray

void cbAuiNotebook::FocusActiveTabCtrl()
{
    UpdateTabControlsArray();
    int sel = GetSelection();
    if (sel < 0)
        return;

    wxWindow* wnd = GetPage(static_cast<size_t>(sel));
    if (!wnd)
        return;

    for (size_t i = 0; i < m_TabCtrls.GetCount(); ++i)
    {
        wxWindow* win = m_TabCtrls[i]->GetWindowFromIdx(m_TabCtrls[i]->GetActivePage());
        if (win && (win == wnd))
        {
            m_TabCtrls[i]->SetFocus();
            break;
        }
    }
}
開發者ID:WinterMute,項目名稱:codeblocks_sf,代碼行數:21,代碼來源:cbauibook.cpp

示例9: UpdateData

void CDonkeySettingsPage::OnEnable()
{
	UpdateData( TRUE );

	if ( m_bEnabled && ( Settings.GetOutgoingBandwidth() < 2 ) )
	{
		MsgBox( IDS_NETWORK_BANDWIDTH_LOW, MB_OK );
		m_bEnabled = FALSE;
		UpdateData( FALSE );
	}

	CNetworksSettingsPage* ppNetworks =
		(CNetworksSettingsPage*)GetPage( RUNTIME_CLASS(CNetworksSettingsPage) );

	if ( ppNetworks->GetSafeHwnd() != NULL )
	{
		ppNetworks->UpdateData( TRUE );
		ppNetworks->m_bEDEnable = m_bEnabled;
		ppNetworks->UpdateData( FALSE );
	}
}
開發者ID:lemonxiao0,項目名稱:peerproject,代碼行數:21,代碼來源:PageSettingsDonkey.cpp

示例10: StartSession

bool CChatSelector::SendMessage( const wxString& message, const wxString& client_name, uint64 to_id )
{
	// Dont let the user send empty messages
	// This is also a user-fix for people who mash the enter-key ...
	if ( message.IsEmpty() ) {
		return false;
	}

	if (to_id) {
		// Checks if there's a page with this client, and selects it or creates it
		StartSession(to_id, client_name, true);
	}

	int usedtab = GetSelection();
	// Workaround for a problem with wxNotebook, where an invalid selection is returned
	if (usedtab >= (int)GetPageCount()) {
		usedtab = GetPageCount() - 1;
	}
	if (usedtab == -1) {
		return false;
	}

	CChatSession* ci = (CChatSession*)GetPage( usedtab );

	ci->m_active = true;

	//#warning EC needed here.

	#ifndef CLIENT_GUI
	if (theApp->clientlist->SendChatMessage(ci->m_client_id, message)) {
		ci->AddText( thePrefs::GetUserNick(), COLOR_GREEN, false );
		ci->AddText( wxT(": ") + message, COLOR_BLACK );
	} else {
		ci->AddText( _("*** Connecting to Client ***"), COLOR_RED );
	}
	#endif

	return true;
}
開發者ID:geekt,項目名稱:amule,代碼行數:39,代碼來源:ChatSelector.cpp

示例11: while

void CDataProcess::ThreadProc()
{
	long lLastQueryTime = 0;
	string strHeader = m_strHeader;
	int iRet = -1;
	CString strRet = "";
	CString strPath = CFunction::GetAppPath().c_str();
	strPath += "xmlLog";
	CString strFilePath = "";
	if (!CFileUtil::IsDirectoryExist(strPath))
	{
		CFileUtil::CreateDirectory(strPath);
	}
	while (IsRunning())
	{
		if (::GetTickCount() - lLastQueryTime < m_lQueryInterval)
		{
			Sleep(500);
			continue;
		}
		strHeader = m_strHeader;
		if (m_bUseZipCompress)
			strHeader.append("\r\nAccept-Encoding:gzip, deflate");
		strFilePath.Format("%s\\%s.xml", strPath, CTime::GetCurrentTime().Format("%Y%m%d%H%M%S"));

		int iRet = GetPage(m_strObject, strHeader.c_str(), NULL, 0, true, strFilePath);
		if(iRet < 0)
		{
			Sleep(500);
			continue;
		}
		lLastQueryTime = ::GetTickCount();
		ReadXmlInfo(strFilePath);
		if(m_hWndShow)	ShowInfo(m_hWndShow);
		CString strShow = "最後抓取時間: ";
		if(m_hWndNotice) ::SetWindowText(m_hWndNotice,strShow + CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S"));
	}
}
開發者ID:wyrover,項目名稱:myhistoryprojects,代碼行數:38,代碼來源:DataProcess.cpp

示例12: wxCHECK_MSG

int wxNotebook::DoSetSelection( size_t page, int flags )
{
    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );

    wxCHECK_MSG( page < m_pagesData.GetCount(), -1, wxT("invalid notebook index") );

    int selOld = GetSelection();

    if ( !(flags & SetSelection_SendEvent) )
    {
        g_signal_handlers_disconnect_by_func (m_widget,
                                             (gpointer) gtk_notebook_page_changing_callback,
                                             this);

        g_signal_handlers_disconnect_by_func (m_widget,
                                             (gpointer) gtk_notebook_page_changed_callback,
                                             this);
    }

    gtk_notebook_set_current_page( GTK_NOTEBOOK(m_widget), page );

    if ( !(flags & SetSelection_SendEvent) )
    {
        // reconnect to signals

        g_signal_connect (m_widget, "switch_page",
                          G_CALLBACK (gtk_notebook_page_changing_callback), this);

        g_signal_connect_after (m_widget, "switch_page",
                      G_CALLBACK (gtk_notebook_page_changed_callback), this);
    }

    wxNotebookPage *client = GetPage(page);
    if ( client )
        client->SetFocus();

    return selOld;
}
開發者ID:EdgarTx,項目名稱:wx,代碼行數:38,代碼來源:notebook.cpp

示例13: ASSERT_VALID

BOOL COXTabViewContainer::DeletePage(int nIndex, 
									 BOOL bDestroy/*=TRUE*/)
{
	ASSERT_VALID(this);
	ASSERT(nIndex>=0 && nIndex<GetPageCount());

	if(nIndex>=0 && nIndex<GetPageCount())
	{
		// if active page is being deleted - activate next
		int nActivePage=GetActivePageIndex();
		if(nActivePage==nIndex)
		{
			if(nActivePage==GetPageCount()-1)
				SetActivePageIndex(0);
			else
				SetActivePageIndex(GetPageCount()>1 ? nActivePage+1 : 0);
		}
		CWnd* pWnd=GetPage(nIndex);
		ASSERT(pWnd!=NULL);
		m_arrUniqueIDs.Add(pWnd->GetDlgCtrlID());
		if(bDestroy && ::IsWindow(pWnd->m_hWnd))
			VERIFY(pWnd->DestroyWindow());

		m_arrPages.RemoveAt(nIndex);

		nActivePage=GetActivePageIndex();
		if(nActivePage>=nIndex)
			m_nActivePageIndex--;

		CalcTabBtnRects();

		RedrawContainer();
	
		return TRUE;
	}

	return FALSE;
}
開發者ID:leonwang9999,項目名稱:testcode,代碼行數:38,代碼來源:OXTabView.cpp

示例14: UpdateData

void CDCSettingsPage::OnEnable()
{
	UpdateData( TRUE );

	if ( m_bEnabled && ( Settings.GetOutgoingBandwidth() < 2 ) )
	{
		CString strMessage;
		LoadString( strMessage, IDS_NETWORK_BANDWIDTH_LOW );
		MsgBox( strMessage, MB_OK );
		m_bEnabled = FALSE;
		UpdateData( FALSE );
	}

	CNetworksSettingsPage* ppNetworks =
		(CNetworksSettingsPage*)GetPage( RUNTIME_CLASS(CNetworksSettingsPage) );

	if ( ppNetworks->GetSafeHwnd() != NULL )
	{
		ppNetworks->UpdateData( TRUE );
	//	ppNetworks->m_bDCEnable = m_bEnabled;
		ppNetworks->UpdateData( FALSE );
	}
}
開發者ID:GetEnvy,項目名稱:Envy,代碼行數:23,代碼來源:PageSettingsDC.cpp

示例15: event

bool Notebook::DeletePage(size_t page, bool notify)
{
    if (page >= GetPageCount())
        return false;

    if (notify) {
        //send event to noitfy that the page has changed
        NotebookEvent event(wxEVT_COMMAND_BOOK_PAGE_CLOSING, GetId());
        event.SetSelection( page );
        event.SetEventObject( this );
        GetEventHandler()->ProcessEvent(event);

        if (!event.IsAllowed()) {
            return false;
        }
    }

    wxWindow* win = GetPage(page);
    win->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(Notebook::OnKeyDown),  NULL, this);
    GTKDeletePgInfo(win);

    bool rc = wxNotebook::DeletePage(page);
    if (rc) {
        PopPageHistory(win);
    }

    if (rc && notify) {
        //send event to noitfy that the page has been closed
        NotebookEvent event(wxEVT_COMMAND_BOOK_PAGE_CLOSED, GetId());
        event.SetSelection( page );
        event.SetEventObject( this );
        GetEventHandler()->ProcessEvent(event);
    }

    return rc;

}
開發者ID:AndrianDTR,項目名稱:codelite,代碼行數:37,代碼來源:gtk_notebook_ex.cpp


注:本文中的GetPage函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。