您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetPageCount函数代码示例

51自学网 2021-06-01 21:12:14
  C++
这篇教程C++ GetPageCount函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GetSelection

void cbAuiNotebook::AdvanceSelection(bool forward){    if (GetPageCount() <= 1)        return;    int currentSelection = GetSelection();    wxAuiTabCtrl* tabCtrl = nullptr;    int idx = -1;    if (!FindTab(GetPage(currentSelection), &tabCtrl, &idx))        return;    if (!tabCtrl || idx < 0)        return;    wxWindow* page = nullptr;    size_t maxPages = tabCtrl->GetPageCount();    forward?idx++:idx--;    if (idx < 0)        idx = maxPages - 1;    if ((size_t)idx < maxPages)        page = tabCtrl->GetPage(idx).window;    if (!page && maxPages > 0)        page = tabCtrl->GetPage(0).window;    if (page)    {        currentSelection = GetPageIndex(page);        SetSelection(currentSelection);    }}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:36,


示例2: GetImageList

bool wxNotebook::InsertPage(size_t n, wxWindow *page, const wxString& text,    bool bSelect, int imageId){    // disable firing qt signals until wx structures are filled    m_qtTabWidget->blockSignals(true);    if (imageId != -1)    {        if (HasImageList())        {            const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId);            m_qtTabWidget->insertTab( n, page->GetHandle(), QIcon( *bitmap->GetHandle() ), wxQtConvertString( text ));        }        else        {            wxFAIL_MSG("invalid notebook imagelist");        }    }    else    {        m_qtTabWidget->insertTab( n, page->GetHandle(), wxQtConvertString( text ));    }    m_pages.Insert(page, n);    m_images.insert(m_images.begin() + n, imageId);    // reenable firing qt signals as internal wx initialization was completed    m_qtTabWidget->blockSignals(false);    if (bSelect && GetPageCount() > 1)    {        SetSelection( n );    }    return true;}
开发者ID:slunski,项目名称:wxWidgets,代码行数:36,


示例3: wxCHECK_MSG

bool CMuleNotebook::DeletePage(int nPage){	wxCHECK_MSG((nPage >= 0) && (nPage < (int)GetPageCount()), false,		wxT("Trying to delete invalid page-index in CMuleNotebook::DeletePage"));	// Send out close event	wxNotebookEvent evt( wxEVT_COMMAND_MULENOTEBOOK_PAGE_CLOSING, GetId(), nPage );	evt.SetEventObject(this);	ProcessEvent( evt );	// and finally remove the actual page	bool result = wxNotebook::DeletePage( nPage );	// Ensure a valid selection	if ( GetPageCount() && (int)GetSelection() >= (int)GetPageCount() ) {		SetSelection( GetPageCount() - 1 );	}	// Send a page change event to work around wx problem when newly selected page	// is identical with deleted page (wx sends a page change event during deletion,	// but the control is still the one to be deleted at that moment).	if (GetPageCount()) {		// Select the tab that took the place of the one we just deleted.		size_t page = nPage;		// Except if we deleted the last one - then select the one that is last now.		if (page == GetPageCount()) {			page--;		}		wxNotebookEvent event( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId(), page );		event.SetEventObject(this);		ProcessEvent( event );	} else {	// Send an event when no pages are left open		wxNotebookEvent event( wxEVT_COMMAND_MULENOTEBOOK_ALL_PAGES_CLOSED, GetId() );		event.SetEventObject(this);		ProcessEvent( event );	}	return result;}
开发者ID:amule-project,项目名称:amule,代码行数:40,


示例4: GetSelection

void wxSTEditorNotebook::SortTabs(int style){    if ((int)GetPageCount() < 2)        return;    if (STE_HASBIT(style, STN_ALPHABETICAL_TABS))    {        int sel = GetSelection();        int new_sel = sel;        size_t page_count = GetPageCount();        size_t n;        if (page_count < 2)            return;        wxString curPageName;        wxArrayString names;        for (n = 0; n < page_count; n++)        {            wxString name(GetPageText(n));            if ((name.Length() > 0) && (name[0u] == wxT('*')))                name = name.Mid(1);            names.Add(name + wxString::Format(wxT("=%d"), (int)n));        }        names.Sort(STN_SortNameCompareFunction);        bool sel_changed = false;        for (n = 0; n < page_count; n++)        {            long old_page = 0;            names[n].AfterLast(wxT('=')).ToLong(&old_page);            if (old_page != long(n))            {                wxWindow *oldWin = GetPage(old_page);                wxString oldName(GetPageText(old_page));                if (oldWin && RemovePage(old_page))                {                    sel_changed = true;                    if (old_page == sel)                        new_sel = (int)n;                    if (n < page_count - 1)                        InsertPage((int)(n+1), oldWin, oldName, old_page == sel);                    else                        AddPage(oldWin, oldName, old_page == sel);                }            }        }        if (sel_changed)        {            wxNotebookEvent noteEvent(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId(),                                    new_sel, new_sel);            noteEvent.SetString(wxT("wxSTEditorNotebook Page Change"));            noteEvent.SetExtraLong(new_sel); // FIXME no Clone in wxNotebookEvent            // NOTE: this may have to be AddPendingEvent for wx < 2.7 since gtk            //       can become reentrant            GetEventHandler()->AddPendingEvent(noteEvent);        }        // causes reentrant assert in gtk, even though it's necessary sometimes        //SetSelection(new_sel); // force selection for GTK    }}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:71,


示例5: SetTimer

BOOL CTPropertySheet::OnInitDialog() {//	TRACE("CTPropertySheet::OnInitDialog()/n");/*	// DR00169 2.001 removed hardcoding from 2.000  NOTE:  For MICGM, m_bSameNextFinish is always true.  MIC 1.9.0.7 set it false when  creating a WATCH window; MICGM uses a different mechanism for creating a WATCH window  that doesn't use the wizard functionality.	PJM May 18, 2005*/	BOOL bResult = CPropertySheet::OnInitDialog();	SetTimer(1,1000,NULL);	char temp[32];	WINDOWPLACEMENT lpwndpl;	//grow the property sheet 	GetWindowPlacement(&lpwndpl);	lpwndpl.rcNormalPosition.bottom += 27;	// DR00169 2.001 removed hardcoding from 2.000	SetWindowPlacement(&lpwndpl);	//we do want the cancel action	GetDlgItem(IDCANCEL)->GetWindowPlacement(&lpwndpl);	lpwndpl.rcNormalPosition.bottom += 28;	// DR00169 2.001 removed hardcoding from 2.000	GetDlgItem(IDCANCEL)->SetWindowPlacement(&lpwndpl);	int minutes = (m_dMyDlgClose/1000-m_dToClose)/60;	int seconds   = (m_dMyDlgClose/1000-m_dToClose) % 60;	sprintf(temp,"Extend Auto/nClose: %d:%02d",minutes,seconds);	SetDlgItemText(IDHELP,temp);	GetDlgItem(IDHELP)->ModifyStyle(NULL,BS_MULTILINE);	GetDlgItem(IDHELP)->GetWindowPlacement(&lpwndpl);	lpwndpl.rcNormalPosition.bottom += 28;	// DR00169 2.001 removed hardcoding from 2.000	GetDlgItem(IDHELP)->SetWindowPlacement(&lpwndpl);	GetDlgItem(IDHELP)->SetDlgCtrlID(IDB_TOCLOSE);	if (m_bSameNextFinish)	{		GetDlgItem(ID_WIZNEXT)->GetWindowPlacement(&lpwndpl);		int offset = lpwndpl.rcNormalPosition.right-lpwndpl.rcNormalPosition.left;		lpwndpl.rcNormalPosition.bottom += 28;		lpwndpl.rcNormalPosition.left -= offset;		lpwndpl.rcNormalPosition.right -= offset;		// DR00169 2.001 removed hardcoding from 2.000		GetDlgItem(ID_WIZNEXT)->SetWindowPlacement(&lpwndpl);		GetDlgItem(ID_WIZBACK)->GetWindowPlacement(&lpwndpl);		lpwndpl.rcNormalPosition.bottom += 28;		lpwndpl.rcNormalPosition.left -= offset;		lpwndpl.rcNormalPosition.right -= offset;		// DR00169 2.001 removed hardcoding from 2.000		GetDlgItem(ID_WIZBACK)->SetWindowPlacement(&lpwndpl);		GetDlgItem(ID_WIZFINISH)->GetWindowPlacement(&lpwndpl);		lpwndpl.rcNormalPosition.bottom += 28;		// DR00169 2.001 removed hardcoding from 2.000		GetDlgItem(ID_WIZFINISH)->SetWindowPlacement(&lpwndpl);//		GetDlgItem(ID_WIZFINISH)->EnableWindow(false);	}	else	{		GetDlgItem(ID_WIZNEXT)->GetWindowPlacement(&lpwndpl);		lpwndpl.rcNormalPosition.bottom += 28;		GetDlgItem(ID_WIZNEXT)->SetWindowPlacement(&lpwndpl);		GetDlgItem(ID_WIZBACK)->GetWindowPlacement(&lpwndpl);		lpwndpl.rcNormalPosition.bottom += 28;		GetDlgItem(ID_WIZBACK)->SetWindowPlacement(&lpwndpl);		GetDlgItem(ID_WIZFINISH)->GetWindowPlacement(&lpwndpl);		lpwndpl.rcNormalPosition.bottom += 28;		GetDlgItem(ID_WIZFINISH)->SetWindowPlacement(&lpwndpl);//		GetDlgItem(ID_WIZFINISH)->EnableWindow(false);	}	for (int i = GetPageCount();i>=0;i--)		SetActivePage(i-1);	m_dToClose = 0;	return bResult;}
开发者ID:hnordquist,项目名称:MIC,代码行数:83,


示例6: wxCHECK_MSG

bool wxNotebook::InsertPage( size_t position,                             wxNotebookPage* win,                             const wxString& text,                             bool select,                             int imageId ){    wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );    wxCHECK_MSG( win->GetParent() == this, false,               wxT("Can't add a page whose parent is not the notebook!") );    wxCHECK_MSG( position <= GetPageCount(), false,                 wxT("invalid page index in wxNotebookPage::InsertPage()") );    // Hack Alert! (Part II): See above in wxNotebook::AddChildGTK    // why this has to be done.    gtk_widget_unparent(win->m_widget);    if (m_themeEnabled)        win->SetThemeEnabled(true);    GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);    wxGtkNotebookPage* pageData = new wxGtkNotebookPage;    m_pages.Insert(win, position);    m_pagesData.Insert(position, pageData);    // set the label image and text    // this must be done before adding the page, as GetPageText    // and GetPageImage will otherwise return wrong values in    // the page-changed event that results from inserting the    // first page.    pageData->m_imageIndex = imageId;    pageData->m_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);    gtk_container_set_border_width(GTK_CONTAINER(pageData->m_box), 2);    pageData->m_image = NULL;    if (imageId != -1)    {        if (HasImageList())        {            const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId);            pageData->m_image = gtk_image_new_from_pixbuf(bitmap->GetPixbuf());            gtk_box_pack_start(GTK_BOX(pageData->m_box),                pageData->m_image, false, false, m_padding);        }        else        {            wxFAIL_MSG("invalid notebook imagelist");        }    }    /* set the label text */    pageData->m_label = gtk_label_new(wxGTK_CONV(wxStripMenuCodes(text)));    gtk_box_pack_end(GTK_BOX(pageData->m_box),        pageData->m_label, false, false, m_padding);    gtk_widget_show_all(pageData->m_box);    gtk_notebook_insert_page(notebook, win->m_widget, pageData->m_box, position);    /* apply current style */#ifdef __WXGTK3__    GTKApplyStyle(pageData->m_label, NULL);#else    GtkRcStyle *style = GTKCreateWidgetStyle();    if ( style )    {        gtk_widget_modify_style(pageData->m_label, style);        g_object_unref(style);    }#endif    if (select && GetPageCount() > 1)    {        SetSelection( position );    }    InvalidateBestSize();    return true;}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:82,


示例7: GTKApplyStyle

void wxNotebook::DoApplyWidgetStyle(GtkRcStyle *style){    GTKApplyStyle(m_widget, style);    for (size_t i = GetPageCount(); i--;)        GTKApplyStyle(GetNotebookPage(i)->m_label, style);}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:6,


示例8: ASSERT_VALID

BOOL COXTabViewContainer::InsertPage(int nIndex, 									 CRuntimeClass* pClass, 									 CCreateContext* pContext,									 LPCTSTR lpszTitle/*=NULL*/){	ASSERT_VALID(this);	ASSERT(nIndex>=0 && nIndex<=GetPageCount());	ASSERT(pClass!=NULL);	ASSERT(pClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));	ASSERT(AfxIsValidAddress(pClass,sizeof(CRuntimeClass),FALSE));	if(!(nIndex>=0 && nIndex<=GetPageCount()) || pClass==NULL)		return FALSE;	CCreateContext context;	if(pContext==NULL)	{		// if no context specified, generate one from the currently active		// view if possible		CView* pOldView=(CView*)GetActivePage();		if(pOldView!=NULL && pOldView->IsKindOf(RUNTIME_CLASS(CView)))		{			// set info about last pane			ASSERT(context.m_pCurrentFrame==NULL);			context.m_pLastView=pOldView;			context.m_pCurrentDoc=pOldView->GetDocument();			if(context.m_pCurrentDoc!=NULL)			{				context.m_pNewDocTemplate=context.m_pCurrentDoc->					GetDocTemplate();			}		}		pContext=&context;	}	CWnd* pWnd;	TRY	{		pWnd=(CWnd*)pClass->CreateObject();		if(pWnd==NULL)			AfxThrowMemoryException();	}	CATCH_ALL(e)	{		TRACE(_T("COXTabViewContainer::InsertPage: Out of memory inserting new page/n"));		// Note: DELETE_EXCEPTION(e) not required		return FALSE;	}	END_CATCH_ALL	ASSERT_KINDOF(CWnd,pWnd);	ASSERT(pWnd->m_hWnd==NULL);       // not yet created	DWORD dwStyle=AFX_WS_DEFAULT_VIEW;#if _MFC_VER < 0x0700	if(afxData.bWin4)#endif		dwStyle&=~WS_BORDER;	DWORD dwID=GetUniqueId();	// Create with the right size	if(!pWnd->Create(NULL,NULL,dwStyle,m_rectPage,this,dwID,pContext))	{		TRACE(_T("COXTabViewContainer::InsertPage: couldn't create new page/n"));		// pWnd will be cleaned up by PostNcDestroy		return FALSE;	}	if(InsertPage(nIndex,pWnd,lpszTitle))	{		CWnd* pWnd=GetPage(nIndex);		ASSERT(pWnd!=NULL);		ASSERT(::IsWindow(pWnd->m_hWnd));		if(pWnd->IsKindOf(RUNTIME_CLASS(CView)))		{			// send initial notification message			pWnd->SendMessage(WM_INITIALUPDATE);		}		return TRUE;	}	return FALSE;}
开发者ID:leonwang9999,项目名称:testcode,代码行数:84,


示例9: GetWindowRect

BOOL CXTPResizePropertySheet::OnInitDialog(){	CRect rcClientBegin, rcClientEnd;	GetWindowRect(rcClientBegin);	SendMessage(WM_NCCALCSIZE, FALSE, (LPARAM)(LPRECT)rcClientBegin);	// Modify the window style to include WS_THICKFRAME for resizing.	::SetWindowLong(m_hWnd,		GWL_STYLE, GetStyle() | WS_THICKFRAME);	GetWindowRect(rcClientEnd);	SendMessage(WM_NCCALCSIZE, FALSE, (LPARAM)(LPRECT)rcClientEnd);	CPropertySheet::OnInitDialog();	// subclass our "flicker-free" tab control.	m_tabCtrl.SubclassWindow(GetTabControl()->m_hWnd);	// the size icon is too close to the buttons, so inflate the sheet	CRect rc;	GetWindowRect(rc);	if (rcClientBegin.Width() - rcClientEnd.Width() > 3)	{		rc.InflateRect((rcClientBegin.Width() - rcClientEnd.Width()) / 2,			(rcClientBegin.Height() - rcClientEnd.Height()) / 2);		MoveWindow(rc);	}	// Do this last so that any prop pages are moved accordingly	else if (!HasFlag(xtpResizeNoSizeIcon) && !IsWizard())	{		rc.InflateRect(1, 1, 2, 2);		MoveWindow(rc);	}	// add sizing entries to the system menu	CMenu* pSysMenu = (CMenu*)GetSystemMenu(FALSE);	if (pSysMenu)	{		CString szMaximize, szMinimize, szSize, szRestore;		// try to get the strings from the topmost window		CWnd* pwndTop;		for (pwndTop = this; pwndTop->GetParent(); pwndTop = pwndTop->GetParent());		CMenu* pTopSysMenu = (CMenu*)pwndTop->GetSystemMenu(FALSE);		if (pTopSysMenu)		{			pTopSysMenu->GetMenuString(SC_MAXIMIZE, szMaximize, MF_BYCOMMAND);			pTopSysMenu->GetMenuString(SC_MINIMIZE, szMinimize, MF_BYCOMMAND);			pTopSysMenu->GetMenuString(SC_SIZE, szSize, MF_BYCOMMAND);			pTopSysMenu->GetMenuString(SC_RESTORE, szRestore, MF_BYCOMMAND);		}		// if we din't get the strings then set them to the English defaults		if (szMaximize.IsEmpty()) szMaximize = _T("Ma&ximize");		if (szMinimize.IsEmpty()) szMinimize = _T("Mi&nimize");		if (szSize.IsEmpty()) szSize = _T("&Size");		if (szRestore.IsEmpty()) szRestore = _T("&Restore");		pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_SEPARATOR, 0, (LPCTSTR) 0);		pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_STRING, SC_MAXIMIZE, szMaximize);		pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_STRING, SC_MINIMIZE, szMinimize);		pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_STRING, SC_SIZE, szSize);		pSysMenu->InsertMenu(0, MF_BYPOSITION | MF_STRING, SC_RESTORE, szRestore);	}	DWORD dwStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);	if ((dwStyle & WS_THICKFRAME) == 0)	{		SetFlag(xtpResizeNoSizeIcon);	}	CXTPResize::Init();	// Check which buttons are available in sheet or wizard	if (IsWizard())	{		SetResize(ID_WIZBACK, XTP_ATTR_REPOS(1));		SetResize(ID_WIZNEXT, XTP_ATTR_REPOS(1));		SetResize(ID_WIZFINISH, XTP_ATTR_REPOS(1));		SetResize(ID_WIZLINE, XTP_ANCHOR_BOTTOMLEFT, XTP_ANCHOR_BOTTOMRIGHT);	}	else	{		SetResize(IDOK, XTP_ATTR_REPOS(1));		SetResize(ID_APPLY_NOW, XTP_ATTR_REPOS(1));		SetResize(AFX_IDC_TAB_CONTROL, XTP_ATTR_RESIZE(1));	}	SetResize(IDCANCEL, XTP_ATTR_REPOS(1));	SetResize(IDHELP, XTP_ATTR_REPOS(1));	// set page sizings	CRect rcPage;	GetActivePage()->GetWindowRect(rcPage);	ScreenToClient(rcPage);	int i;	for (i = 0; i <GetPageCount(); i++)	{		SetResize(GetPage(i), XTP_ATTR_RESIZE(1), rcPage);	}//.........这里部分代码省略.........
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:101,


示例10: ASSERT

BOOL COXCustomizeManager::InsertPage(COXCustomizePage* pCustomizePage, 									 int nPageIndex){	ASSERT(pCustomizePage!=NULL);	CString sTitle=pCustomizePage->GetTitle();	LPCTSTR lpszImageResource=pCustomizePage->GetImageResource(); 	COLORREF clrMask=pCustomizePage->GetImageMask();	CString sTooltip=pCustomizePage->GetTooltip();	CString sGroup=pCustomizePage->GetGroup();#ifdef _DEBUG	ASSERT(nPageIndex>=0 && nPageIndex<=GetPageCount(sGroup));	HSHBGROUP hGroupTest=NULL;	int nIndexTest=-1;	ASSERT(!FindPage(pCustomizePage,hGroupTest,nIndexTest));	ASSERT(!FindPage(sTitle,sGroup,hGroupTest,nIndexTest));#endif	// find/create the corresponding shortcut bar group	HSHBGROUP hGroup=m_shb.FindGroupByTitle(sGroup);	BOOL bNewGroup=FALSE;	if(hGroup==NULL)	{		hGroup=m_shb.InsertGroup(sGroup);		bNewGroup=TRUE;	}	if(hGroup==NULL)	{		TRACE(_T("COXCustomizeManager::InsertPage: failed to create group for the specified page/n"));		if(bNewGroup)			m_shb.DeleteGroup(hGroup);		return FALSE;	}	// associate image list with the created group	m_shb.SetLCImageList(hGroup,&m_ilShortcutBar,LVSIL_NORMAL);	// get image index for new page	int nImageIndex=-1;	if(lpszImageResource!=NULL)	{		CImageList imageList;		if(!imageList.Create(lpszImageResource,32,0,clrMask))		{			TRACE(_T("COXCustomizeManager::InsertPage: failed to extract image for new page/n"));			if(bNewGroup)			{				m_shb.DeleteGroup(hGroup);			}			return FALSE;		}		HICON hIcon=imageList.ExtractIcon(0);		ASSERT(hIcon!=NULL);		nImageIndex=m_ilShortcutBar.Add(hIcon);		ASSERT(nImageIndex!=-1);		VERIFY(::DestroyIcon(hIcon));	}	int nItem=m_shb.InsertLCItem(hGroup,nPageIndex,sTitle,nImageIndex,		(LPARAM)pCustomizePage);	if(nItem==-1)	{		TRACE(_T("COXCustomizeManager::InsertPage: failed to insert new item into the shortcut bar/n"));		if(bNewGroup)		{			m_shb.DeleteGroup(hGroup);		}		return FALSE;	}	m_mapPages.SetAt(pCustomizePage,((PtrToLong(hGroup))<<16)+nItem);	m_mapTooltips.SetAt(pCustomizePage,sTooltip);	return TRUE;}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:77,


示例11: ASSERT

void COXTabViewContainer::DrawTabButton(CDC* pDC, int nIndex) const{	ASSERT(nIndex>=0 && nIndex<GetPageCount());	CRect rect=m_arrTabBtnRects[nIndex];	rect+=m_rectTabBtnArea.TopLeft();	rect.OffsetRect(m_nTabBtnAreaOrigin,0);	if(rect.right>m_rectTabBtnArea.left && rect.left<m_rectTabBtnArea.right)	{		rect.bottom=m_rectTabBtnArea.bottom;				POINT arrPoints[4];		arrPoints[0].x=rect.left;		arrPoints[0].y=rect.top;		arrPoints[1].x=rect.left+ID_TABBTNOVERLAPSIZE;		arrPoints[1].y=rect.bottom;		arrPoints[2].x=rect.right-ID_TABBTNOVERLAPSIZE;		arrPoints[2].y=rect.bottom;		arrPoints[3].x=rect.right;		arrPoints[3].y=rect.top;		CPen penTop(PS_SOLID,1,::GetSysColor(COLOR_BTNHILIGHT));		CPen penBottom(PS_SOLID,1,::GetSysColor(COLOR_BTNSHADOW));		CPen* pOldPen=NULL;		if(nIndex==GetActivePageIndex())		{			pDC->Polygon(arrPoints,4);			pOldPen=pDC->SelectObject(&penTop);			arrPoints[0].x++;			pDC->MoveTo(arrPoints[0]);			pDC->LineTo(arrPoints[3]);			pDC->SelectObject(&penBottom);			arrPoints[1].y--;			arrPoints[2].y--;			pDC->MoveTo(arrPoints[1]);			pDC->LineTo(arrPoints[2]);		}		else		{			pDC->Polygon(arrPoints,4);			pOldPen=pDC->SelectObject(&penBottom);			arrPoints[1].y--;			arrPoints[2].y--;			pDC->MoveTo(arrPoints[1]);			pDC->LineTo(arrPoints[2]);			arrPoints[2].x--;			arrPoints[3].x--;			pDC->MoveTo(arrPoints[2]);			pDC->LineTo(arrPoints[3]);			pDC->SelectObject(&penTop);			arrPoints[0].x+=2;			arrPoints[0].y++;			arrPoints[1].x++;			pDC->MoveTo(arrPoints[0]);			pDC->LineTo(arrPoints[1]);		}		if(pOldPen!=NULL)			pDC->SelectObject(pOldPen);		CString sTitle=GetPageTitle(nIndex);		if(!sTitle.IsEmpty())		{			COLORREF oldColor=pDC->SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));			int nOldBkMode=pDC->SetBkMode(TRANSPARENT);			pDC->DrawText(sTitle,rect,DT_CENTER|DT_SINGLELINE|DT_VCENTER);			pDC->SetBkMode(nOldBkMode);			pDC->SetTextColor(oldColor);		}	}}
开发者ID:leonwang9999,项目名称:testcode,代码行数:74,


示例12: GetPageCount

uint32 CGsCachedArea::GetSize() const{	return GetPageCount() * CGsPixelFormats::PAGESIZE;}
开发者ID:250394,项目名称:Play-,代码行数:4,


示例13: wxCHECK_MSG

int wxTreebook::DoSetSelection(size_t pagePos, int flags){    wxCHECK_MSG( IS_VALID_PAGE(pagePos), wxNOT_FOUND,                 wxT("invalid page index in wxListbook::DoSetSelection()") );    wxASSERT_MSG( GetPageCount() == DoInternalGetPageCount(),                  wxT("wxTreebook logic error: m_treeIds and m_pages not in sync!"));    wxBookCtrlEvent event(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, m_windowId);    const int oldSel = m_selection;    wxTreeCtrl *tree = GetTreeCtrl();    bool allowed = false;    if (flags & SetSelection_SendEvent)    {        event.SetEventObject(this);        event.SetSelection(pagePos);        event.SetOldSelection(m_selection);        // don't send the event if the old and new pages are the same; do send it        // otherwise and be prepared for it to be vetoed        allowed = (int)pagePos == m_selection ||                  !GetEventHandler()->ProcessEvent(event) ||                  event.IsAllowed();    }    if ( !(flags & SetSelection_SendEvent) || allowed )    {        // hide the previously shown page        wxTreebookPage * const oldPage = DoGetCurrentPage();        if ( oldPage )            oldPage->Hide();        // then show the new one        m_selection = pagePos;        wxTreebookPage *page = wxBookCtrlBase::GetPage(m_selection);        if ( !page )        {            // find the next page suitable to be shown: the first (grand)child            // of this one with a non-NULL associated page            wxTreeItemId childId = m_treeIds[pagePos];            int actualPagePos = pagePos;            while ( !page && childId.IsOk() )            {                wxTreeItemIdValue cookie;                childId = tree->GetFirstChild( childId, cookie );                if ( childId.IsOk() )                {                    page = wxBookCtrlBase::GetPage(++actualPagePos);                }            }            m_actualSelection = page ? actualPagePos : m_selection;        }        if ( page )            page->Show();        tree->SelectItem(DoInternalGetPage(pagePos));        if (flags & SetSelection_SendEvent)        {            // notify about the (now completed) page change            event.SetEventType(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED);            (void)GetEventHandler()->ProcessEvent(event);        }    }    else if ( (flags & SetSelection_SendEvent) && !allowed) // page change vetoed    {        // tree selection might have already had changed        if ( oldSel != wxNOT_FOUND )            tree->SelectItem(DoInternalGetPage(oldSel));    }    return oldSel;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:75,


示例14: if

HRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, int count, int *moved){    if (moved == NULL)        return E_POINTER;    // if document is closed, don't do anything    if (!document->IsDocumentLoaded())        return E_FAIL;    // if not set, don't do anything    if (IsNullRange())        return S_OK;    // what to move    int *target_page, *target_glyph;    if (endpoint == TextPatternRangeEndpoint_Start) {        target_page = &startPage;        target_glyph = &startGlyph;    } else if (endpoint == TextPatternRangeEndpoint_End) {        target_page = &endPage;        target_glyph = &endGlyph;    } else {        return E_INVALIDARG;    }    class EndPointMover {    protected:        SumatraUIAutomationTextRange* target;        int* target_page;        int* target_glyph;    public:        // return false when cannot be moved        virtual bool NextEndpoint() const {            // HACK: Declaring these as pure virtual causes "unreferenced local variable" warnings ==> define a dummy body to get rid of warnings            CrashIf(true);            return false;        }        virtual bool PrevEndpoint() const {            CrashIf(true);            return false;        }        // return false when not appliable        bool NextPage() const {            int max_glyph = target->GetPageGlyphCount(*target_page);            if (*target_glyph == max_glyph) {                if (*target_page == target->GetPageCount()) {                    // last page                    return false;                }                // go to next page                (*target_page)++;                (*target_glyph) = 0;            }            return true;        }        bool PreviousPage() const {            if (*target_glyph == 0) {                if (*target_page == 1) {                    // first page                    return false;                }                // go to next page                (*target_page)--;                (*target_glyph) = target->GetPageGlyphCount(*target_page);            }            return true;        }        // do the moving        int Move(int count, SumatraUIAutomationTextRange* target, int* target_page, int* target_glyph) {            this->target = target;            this->target_page = target_page;            this->target_glyph = target_glyph;            int retVal = 0;            if (count > 0) {                for (int i=0;i<count && (NextPage() || NextEndpoint());++i)                    ++retVal;            } else {                for (int i=0;i<-count && (PreviousPage() || PrevEndpoint());++i)                    ++retVal;            }            return retVal;        }    };    class CharEndPointMover : public EndPointMover {        bool NextEndpoint() const  {            (*target_glyph)++;            return true;        }        bool PrevEndpoint() const  {            (*target_glyph)--;            return true;        }//.........这里部分代码省略.........
开发者ID:RazvanB,项目名称:sumatrapdf,代码行数:101,


示例15: GetPageCount

void wxSTEditorNotebook::UpdateGotoCloseMenu(wxMenu *menu, int startID){    if (!menu) return;    size_t n, page_count = GetPageCount();    size_t item_count = menu->GetMenuItemCount();// ========  Radio items have problems in gtk/*    // delete extra menu items (if any)    if (page_count < item_count)    {        for (n=page_count; n < item_count; n++)            menu->Delete(startID+n);        item_count = page_count;    }    wxString label;    // change labels of existing items    for (n=0; n<item_count; n++)    {        label = wxString::Format(wxT("%2d : %s"), n+1, GetPageText(n).wx_str());        if (menu->GetLabel(startID+n) != label)            menu->SetLabel(startID+n, label);    }    // append new pages    for (n=item_count; n<page_count; n++)        menu->AppendRadioItem(startID+n, wxString::Format(wxT("%2d : %s"), n+1, GetPageText(n).wx_str()));*//*    // This just clears it and adds the items fresh    for (n=0; n<item_count; n++)        menu->Delete(startID+n);    for (n=0; n<page_count; n++)        menu->AppendRadioItem(startID+n, wxString::Format(wxT("%2d : %s"), n+1, GetPageText(n).wx_str()));*/// ==== check items do not    // delete extra menu items (if any)    if (page_count < item_count)    {        for (n = page_count; n < item_count; n++)            menu->Delete(int(startID+n));        item_count = page_count;    }    wxString label;    // change labels of existing items    for (n = 0; n < item_count; n++)    {        label = wxString::Format(wxT("%2d : %s"), (int)n+1, GetPageText(n).wx_str());        if (menu->GetLabel(int(startID+n)) != label)            menu->SetLabel(int(startID+n), label);        menu->Check(int(startID+n), false);    }    // append new pages    for (n = item_count; n < page_count; n++)        menu->AppendCheckItem(int(startID+n), wxString::Format(wxT("%2d : %s"), (int)n+1, GetPageText(n).wx_str()));/*    // use check items    for (n = 0; n < item_count; n++)        menu->Delete(startID+n);    for (n = 0; n < page_count; n++)        menu->AppendCheckItem(startID+n, wxString::Format(wxT("%2d : %s"), n+1, GetPageText(n).wx_str()));*/    // show what page we're on    int sel = GetSelection();    if ((sel >= 0) && (page_count >= 0))        menu->Check(startID+sel, true);}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:78,


示例16: guard

bool wxSTEditorNotebook::HandleMenuEvent(wxCommandEvent &event){    wxSTERecursionGuard guard(m_rGuard_HandleMenuEvent);    if (guard.IsInside()) return false;    int n_page = (int)GetPageCount();    int win_id = event.GetId();    switch (win_id)    {        case wxID_NEW:        {            NewPage();            return true;        }        case wxID_OPEN:        {            LoadFiles();            return true;        }        case wxID_SAVEAS:        {            wxSTEditor *editor = GetEditor();            if (!editor) return true; // event handled, but we couldn't do anything with it.            if (!editor->IsFileFromDisk())            {                editor->SaveFile(true);            }            else            {                wxFileName selectedFileName;                wxString   selectedFileEncoding;                bool       selected_file_bom = false;                bool ok = editor->SaveFileDialog(true, wxEmptyString, &selectedFileName, &selectedFileEncoding, &selected_file_bom);                if (!ok) return true; // they probably canceled the dialog                if (selectedFileName == editor->GetFileName())                {                    // They want to save to the same filename, update current editor.                    editor->SaveFile(selectedFileName, selectedFileEncoding, selected_file_bom);                    return true;                }                else                {                    // Make a new editor for the new filename, leave the original editor as is.                    wxSTEditorSplitter *splitter = CreateSplitter(wxID_ANY);                    wxCHECK_MSG(splitter, true, wxT("Invalid splitter"));                    wxSTEditor *newEditor = splitter->GetEditor();                    wxCHECK_MSG(newEditor, true, wxT("Invalid splitter editor"));                    // Make this new editor identical to the original one                    // these are probably not necessary                    //splitter->GetEditor()->SetOptions(editor->GetOptions());                    //splitter->GetEditor()->RegisterPrefs(editor->GetEditorPrefs());                    //splitter->GetEditor()->RegisterStyles(editor->GetEditorStyles());                    //splitter->GetEditor()->RegisterLangs(editor->GetEditorLangs());                    newEditor->SetLanguage(editor->GetLanguageId());                    newEditor->SetFileName(editor->GetFileName());                    newEditor->SetFileEncoding(editor->GetFileEncoding());                    newEditor->SetFileBOM(editor->GetFileBOM());                    newEditor->SetText(editor->GetText());                    newEditor->ColouriseDocument();                    newEditor->GotoPos(editor->PositionFromLine(editor->LineFromPosition(editor->GetCurrentPos())));                    newEditor->GotoPos(editor->GetCurrentPos());                    newEditor->ScrollToLine(editor->GetFirstVisibleLine());                    // if we can save it, then add it to the notebook                    if (newEditor->SaveFile(selectedFileName, selectedFileEncoding, selected_file_bom))                    {                        if (!InsertEditorSplitter(-1, splitter, true))                            splitter->Destroy();                    }                    else                        splitter->Destroy(); // problem saving, delete new editor                }            }            return true;        }        case ID_STN_SAVE_ALL:        {            SaveAllFiles();            return true;        }        case ID_STN_CLOSE_PAGE:        {            if ((GetSelection() != -1) && GetEditor(GetSelection()))            {                ClosePage(GetSelection(), true);            }            return true;        }        case ID_STN_CLOSE_ALL:        {            if (wxYES == wxMessageBox(_("Close all pages?"), _("Confim closing all pages"),                                   wxICON_QUESTION|wxYES_NO, this))            {//.........这里部分代码省略.........
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:101,


示例17: GetPageCount

int Menu::PagekeyToItem(page_t page, item_t key){	size_t start = page * items_per_page;	size_t num_pages = GetPageCount();	if (num_pages == 1 || !items_per_page)	{		if (key > m_Items.length())		{			return MENU_EXIT;		} else {			return key-1;		}	} else {		//first page		if (page == 0)		{			/* The algorithm for spaces here is same as a middle page. */			item_t new_key = key;			for (size_t i=start; i<(start+key-1) && i<m_Items.length(); i++)			{				for (size_t j=0; j<m_Items[i]->blanks.length(); j++)				{					if (m_Items[i]->blanks[j].EatNumber())					{						if (!new_key)						{							break;						}						new_key--;					}					if (!new_key)					{						break;					}				}			}			key = new_key;			if (key == items_per_page + 2)			{				return MENU_MORE;			} else if (key == items_per_page + 3) {				return MENU_EXIT;			} else {				return (start + key - 1);			}		} else if (page == num_pages - 1) {			//last page			item_t item_tracker = 0; //  tracks how many valid items we have passed so far.			size_t remaining = m_Items.length() - start;			item_t new_key = key;						// For every item that takes up a slot (item or padded blank)			// we subtract one from new key.			// For every item (not blanks), we increase item_tracker.			// When new_key equals 0, item_tracker will then be set to			// whatever valid item was selected.			for (size_t i=m_Items.length() - remaining; i<m_Items.length(); i++)			{				item_tracker++;								if (new_key<=1) // If new_key is 0, or will be 0 after the next decrease				{					new_key=0;					break;				}								new_key--;								for (size_t j=0; j<m_Items[i]->blanks.length(); j++)				{					if (m_Items[i]->blanks[j].EatNumber())					{						new_key--;					}					if (!new_key)					{						break;					}				}			}			// If new_key doesn't equal zero, then a back/exit button was pressed.			if (new_key!=0)			{				if (key == items_per_page + 1)				{					return MENU_BACK;				}				else if (key == items_per_page + 3)				{					return MENU_EXIT;				}				// MENU_MORE should never happen here.			}			// otherwise our item is now start + item_tracker - 1			return (start + item_tracker - 1);		} else {			/* The algorithm for spaces here is a bit harder.  We have to subtract 			 * one from the key for each space we find along the way.			 *///.........这里部分代码省略.........
开发者ID:WPMGPRoSToTeMa,项目名称:amxmodx,代码行数:101,


示例18: SetPageText

bool Notebook::SetPageText(size_t index, const wxString &text){    if (index >= GetPageCount())        return false;    return wxNotebook::SetPageText(index, text);}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:6,


示例19: wxCHECK_MSG

// same as AddPage() but does it at given positionbool wxNotebook::InsertPage(size_t nPage,                            wxNotebookPage *pPage,                            const wxString& strText,                            bool bSelect,                            int imageId){    wxCHECK_MSG( pPage != NULL, false, wxT("NULL page in wxNotebook::InsertPage") );    wxCHECK_MSG( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), false,                 wxT("invalid index in wxNotebook::InsertPage") );    wxASSERT_MSG( pPage->GetParent() == this,                    wxT("notebook pages must have notebook as parent") );    // add a new tab to the control    // ----------------------------    // init all fields to 0    TC_ITEM tcItem;    wxZeroMemory(tcItem);    // set the image, if any    if ( imageId != -1 )    {        tcItem.mask |= TCIF_IMAGE;        tcItem.iImage  = imageId;    }    // and the text    if ( !strText.empty() )    {        tcItem.mask |= TCIF_TEXT;        tcItem.pszText = wxMSW_CONV_LPTSTR(strText);    }    // hide the page: unless it is selected, it shouldn't be shown (and if it    // is selected it will be shown later)    HWND hwnd = GetWinHwnd(pPage);    SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VISIBLE);    // this updates internal flag too -- otherwise it would get out of sync    // with the real state    pPage->Show(false);    // fit the notebook page to the tab control's display area: this should be    // done before adding it to the notebook or TabCtrl_InsertItem() will    // change the notebooks size itself!    AdjustPageSize(pPage);    // finally do insert it    if ( TabCtrl_InsertItem(GetHwnd(), nPage, &tcItem) == -1 )    {        wxLogError(wxT("Can't create the notebook page '%s'."), strText.c_str());        return false;    }    // need to update the bg brush when the first page is added    // so the first panel gets the correct themed background    if ( m_pages.empty() )    {#if wxUSE_UXTHEME        UpdateBgBrush();#endif // wxUSE_UXTHEME    }    // succeeded: save the pointer to the page    m_pages.Insert(pPage, nPage);    // we may need to adjust the size again if the notebook size changed:    // normally this only happens for the first page we add (the tabs which    // hadn't been there before are now shown) but for a multiline notebook it    // can happen for any page at all as a new row could have been started    if ( m_pages.GetCount() == 1 || HasFlag(wxNB_MULTILINE) )    {        AdjustPageSize(pPage);        // Additionally, force the layout of the notebook itself by posting a        // size event to it. If we don't do it, notebooks with pages on the        // left or the right side may fail to account for the fact that they        // are now big enough to fit all all of their pages on one row and        // still reserve space for the second row of tabs, see #1792.        const wxSize s = GetSize();        ::PostMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(s.x, s.y));    }    // now deal with the selection    // ---------------------------    // if the inserted page is before the selected one, we must update the    // index of the selected page    if ( int(nPage) <= m_selection )    {        // one extra page added        m_selection++;    }    DoSetSelectionAfterInsertion(nPage, bSelect);//.........这里部分代码省略.........
开发者ID:chromylei,项目名称:third_party,代码行数:101,


示例20: RedrawScrollButton

void COXTabViewContainer::OnMouseMove(UINT nFlags, CPoint point) {	// TODO: Add your message handler code here and/or call default		if(m_nPressedScrlBtn!=NONE)	{		int hitTest=HitTest(point);		// send corresponding messages		if(((int)m_nPressedScrlBtn==hitTest && !m_bIsScrlBtnPressed) ||			((int)m_nPressedScrlBtn!=hitTest && m_bIsScrlBtnPressed))		{			m_bIsScrlBtnPressed=!m_bIsScrlBtnPressed;			RedrawScrollButton(m_nPressedScrlBtn);		}	}	else if(m_bIsSplitterPressed)	{		CPoint ptMoved=point;		if(ptMoved.x>m_rectPage.right-ID_MINSCROLLBARWIDTH+ID_SPLITTERWIDTH/2)			ptMoved.x=m_rectPage.right-ID_MINSCROLLBARWIDTH+ID_SPLITTERWIDTH/2;		if(ptMoved.x<m_rectScrollToEndBtn.right+ID_SPLITTERWIDTH/2)			ptMoved.x=m_rectScrollToEndBtn.right+ID_SPLITTERWIDTH/2;		int nOldSplitterLeft=m_rectSplitter.left;		m_rectSplitter.left=ptMoved.x-ID_SPLITTERWIDTH/2;		if(nOldSplitterLeft!=m_rectSplitter.left)		{			m_rectSplitter.right=m_rectSplitter.left+ID_SPLITTERWIDTH;			m_rectScrollBarHorz.left=m_rectSplitter.right;			m_nLastTabBtnAreaWidth=m_rectSplitter.left-m_rectScrollToEndBtn.right;			m_rectTabBtnArea.right+=m_rectSplitter.left-nOldSplitterLeft;			if(m_rectTabBtnArea.right<m_rectTabBtnArea.left)				m_rectTabBtnArea.right=m_rectTabBtnArea.left;			if(::IsWindow(m_scrlBarHorz.GetSafeHwnd()))				m_scrlBarHorz.MoveWindow(m_rectScrollBarHorz);			RedrawSplitter();			if(nOldSplitterLeft<m_rectSplitter.left)			{					CRect rect=m_rectSplitter;				rect.left=nOldSplitterLeft;				rect.right=m_rectSplitter.left;				RedrawWindow(rect);				if(m_nTabBtnAreaOrigin<0)				{					ASSERT(GetPageCount()==m_arrTabBtnRects.GetSize());					rect=m_arrTabBtnRects[GetPageCount()-1];					rect+=m_rectTabBtnArea.TopLeft();					if(rect.right+m_nTabBtnAreaOrigin<=m_rectTabBtnArea.right)					{						m_nTabBtnAreaOrigin+=							m_rectSplitter.left-nOldSplitterLeft;						m_nTabBtnAreaOrigin=							m_nTabBtnAreaOrigin>0 ? 0 : m_nTabBtnAreaOrigin;						RedrawTabBtnArea();					}				}			}				}	}	CWnd::OnMouseMove(nFlags, point);}
开发者ID:leonwang9999,项目名称:testcode,代码行数:68,


示例21: OnSize

void wxNotebook::OnSize(wxSizeEvent& event){    if ( GetPageCount() == 0 )    {        // Prevents droppings on resize, but does cause some flicker        // when there are no pages.        Refresh();        event.Skip();        return;    }#ifndef __WXWINCE__    else    {        // Without this, we can sometimes get droppings at the edges        // of a notebook, for example a notebook in a splitter window.        // This needs to be reconciled with the RefreshRect calls        // at the end of this function, which weren't enough to prevent        // the droppings.        wxSize sz = GetClientSize();        // Refresh right side        wxRect rect(sz.x-4, 0, 4, sz.y);        RefreshRect(rect);        // Refresh bottom side        rect = wxRect(0, sz.y-4, sz.x, 4);        RefreshRect(rect);        // Refresh left side        rect = wxRect(0, 0, 4, sz.y);        RefreshRect(rect);    }#endif // !__WXWINCE__    // fit all the notebook pages to the tab control's display area    RECT rc;    rc.left = rc.top = 0;    GetSize((int *)&rc.right, (int *)&rc.bottom);    // save the total size, we'll use it below    int widthNbook = rc.right - rc.left,        heightNbook = rc.bottom - rc.top;    // there seems to be a bug in the implementation of TabCtrl_AdjustRect(): it    // returns completely false values for multiline tab controls after the tabs    // are added but before getting the first WM_SIZE (off by ~50 pixels, see    //    // http://sf.net/tracker/index.php?func=detail&aid=645323&group_id=9863&atid=109863    //    // and the only work around I could find was this ugly hack... without it    // simply toggling the "multiline" checkbox in the notebook sample resulted    // in a noticeable page displacement    if ( HasFlag(wxNB_MULTILINE) )    {        // avoid an infinite recursion: we get another notification too!        static bool s_isInOnSize = false;        if ( !s_isInOnSize )        {            s_isInOnSize = true;            SendMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED,                    MAKELPARAM(rc.right, rc.bottom));            s_isInOnSize = false;        }        // The best size depends on the number of rows of tabs, which can        // change when the notepad is resized.        InvalidateBestSize();    }#if wxUSE_UXTHEME    // background bitmap size has changed, update the brush using it too    UpdateBgBrush();#endif // wxUSE_UXTHEME    TabCtrl_AdjustRect(GetHwnd(), false, &rc);    int width = rc.right - rc.left,        height = rc.bottom - rc.top;    size_t nCount = m_pages.Count();    for ( size_t nPage = 0; nPage < nCount; nPage++ ) {        wxNotebookPage *pPage = m_pages[nPage];        pPage->SetSize(rc.left, rc.top, width, height);    }    // unless we had already repainted everything, we now need to refresh    if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )    {        // invalidate areas not covered by pages        RefreshRect(wxRect(0, 0, widthNbook, rc.top), false);        RefreshRect(wxRect(0, rc.top, rc.left, height), false);        RefreshRect(wxRect(0, rc.bottom, widthNbook, heightNbook - rc.bottom),                    false);        RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.right, height),                    false);    }//.........这里部分代码省略.........
开发者ID:chromylei,项目名称:third_party,代码行数:101,


示例22: GetPageCount

void CU8GLcd::SetRotaryFocusMainPage(){    _rotarybutton.SetPageIdx((rotarypos_t) _currentpage);    _rotarybutton.SetMinMax(0, GetPageCount() - 1, true);    _rotaryFocus = RotaryMainPage;}
开发者ID:aiten,项目名称:CNCLib,代码行数:6,


示例23: gtk_widget_get_allocation

int wxNotebook::HitTest(const wxPoint& pt, long *flags) const{    GtkAllocation a;    gtk_widget_get_allocation(m_widget, &a);    const int x = a.x;    const int y = a.y;    const size_t count = GetPageCount();    size_t i = 0;#ifndef __WXGTK3__    GtkNotebook * notebook = GTK_NOTEBOOK(m_widget);    if (gtk_notebook_get_scrollable(notebook))        i = g_list_position( notebook->children, notebook->first_tab );#endif    for ( ; i < count; i++ )    {        wxGtkNotebookPage* pageData = GetNotebookPage(i);        GtkWidget* box = pageData->m_box;        const gint border = gtk_container_get_border_width(GTK_CONTAINER(box));        if ( IsPointInsideWidget(pt, box, x, y, border) )        {            // ok, we're inside this tab -- now find out where, if needed            if ( flags )            {                if (pageData->m_image && IsPointInsideWidget(pt, pageData->m_image, x, y))                {                    *flags = wxBK_HITTEST_ONICON;                }                else if (IsPointInsideWidget(pt, pageData->m_label, x, y))                {                    *flags = wxBK_HITTEST_ONLABEL;                }                else                {                    *flags = wxBK_HITTEST_ONITEM;                }            }            return i;        }    }    if ( flags )    {        *flags = wxBK_HITTEST_NOWHERE;        wxWindowBase * page = GetCurrentPage();        if ( page )        {            // rect origin is in notebook's parent coordinates            wxRect rect = page->GetRect();            // adjust it to the notebook's coordinates            wxPoint pos = GetPosition();            rect.x -= pos.x;            rect.y -= pos.y;            if ( rect.Contains( pt ) )                *flags |= wxBK_HITTEST_ONPAGE;        }    }    return wxNOT_FOUND;}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:66,


示例24: InsertPage

void Notebook::AddPage(CustomTab *tab){	InsertPage(tab, GetPageCount());}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:4,


示例25: SetSavePlacementOnClose

void OperaMenuDialog::OnInit(){ 	int i;	//don't save position, the dialog will be aligned automatically	SetSavePlacementOnClose(FALSE);		// Listen to parent desktop window to get notified about movements	if (GetParentDesktopWindow() && GetParentDesktopWindow()->GetParentDesktopWindow())			GetParentDesktopWindow()->GetParentDesktopWindow()->AddListener(this);	m_tabs =  static_cast<OpTabs *> (GetWidgetByType(WIDGET_TYPE_TABS));	m_tabs->SetButtonStyle(OpButton::STYLE_IMAGE);	m_tabs->SetXResizeEffect(RESIZE_FIXED);	m_tabs->SetYResizeEffect(RESIZE_SIZE);	OpWidget *w = (OpWidget*) m_tabs->childs.First();	while (w)	{		w->SetListener(this);		OpInputAction *action = OP_NEW(OpInputAction, (OpInputAction::ACTION_SHOW_MENU_SECTION));		if (w->GetType() == WIDGET_TYPE_BUTTON)			((OpButton*)w)->SetAction(action);		w = (OpWidget*) w->Suc();	}	// Basic layout and initialization	for(i = 0; i < (int)GetPageCount(); i++)	{		OpWidget *page = GetPageByNumber(i);		OpWidget *w = page->GetFirstChild();		int y = 0, row_add = 0;		while (w)		{			if (w->GetType() == WIDGET_TYPE_BUTTON)			{				OpButton *b = static_cast<OpButton*> (w);				b->SetButtonStyle(OpButton::STYLE_IMAGE_AND_TEXT_ON_RIGHT);				b->SetButtonType(OpButton::TYPE_OMENU);				b->SetFixedImage(FALSE);				if (b->GetBounds().width >= 300)					b->SetShowShortcut(TRUE);			}			// test of some really basic vertical layout so we don't have to do that by hand in ini.			/*if (page->GetName().Compare("Menu Page") == 0 ||				page->GetName().Compare("Menu Tools") == 0 ||				page->GetName().Compare("Menu Closed Tabs") == 0)*/			{				int x = w->GetRect().x;				int height = w->GetRect().height;				if (x == 0)					y += row_add;				w->SetRect(OpRect(x, y, w->GetRect().width, height));				w->SetOriginalRect(w->GetRect());				row_add = height;			}			w = (OpWidget *) w->Suc();		}	}	if (OpSlider *slider = static_cast<OpSlider*> (GetWidgetByName("zoom_slider")))	{		int zoom = 100;		slider->SetMin(20);		slider->SetMax(300);		slider->SetValue(zoom);		slider->SetStep(10);		slider->ShowTickLabels(TRUE);		OpSlider::TICK_VALUE tick_values[5] = {	{20, FALSE },												{50, FALSE },												{100, TRUE },												{200, TRUE },												{300, FALSE } };		slider->SetTickValues(5, tick_values, 10);	}	// Create window animation for slider fade	m_window_animation = OP_NEW(QuickAnimationWindowObject, ());	if (!m_window_animation || OpStatus::IsError(m_window_animation->Init(this, NULL)))	{		OP_DELETE(m_window_animation);		m_window_animation = NULL;	}}
开发者ID:prestocore,项目名称:browser,代码行数:87,


示例26: FindString

int wxSTEditorNotebook::FindString(const wxString &str, STE_TextPos start_pos,                                   int flags, int action){    int n_pages = (int)GetPageCount();    int n_sel = GetSelection();    int n = -1;    STE_TextPos pos = start_pos;    bool forward = STE_HASBIT(flags, wxFR_DOWN) != 0;    int noteb_flags = flags & (~STE_FR_WRAPAROUND); // switch to new page    wxSTEditor *editor = NULL;    if (n_sel < 0) return wxNOT_FOUND; // oops    // search this page and later or before to end    for (n = n_sel;         forward ? n < n_pages : n >= 0;         n = forward ? n+1 : n-1)    {        editor = GetEditor(n);        if (!editor)            continue;        if (n != n_sel)            pos = forward ? 0 : editor->GetLength();        pos = editor->FindString(str, pos, -1, noteb_flags, action);        if (pos != wxNOT_FOUND)        {            SetSelection(n);            editor->UpdateCanDo(true); // make sure CanFind is updated            return pos;        }    }    // search through remaining pages    for (n = forward ? 0 : n_pages-1;         forward ? n < n_sel : n > n_sel;         n = forward ? n+1 : n-1)    {        editor = GetEditor(n);        if (!editor)            continue;        pos = forward ? 0 : editor->GetLength();        pos = editor->FindString(str, pos, -1, noteb_flags, action);        if (pos != wxNOT_FOUND)        {            SetSelection(n);            editor->UpdateCanDo(true); // make sure CanFind is updated            return pos;        }    }    // if we haven't found the string then try to wrap around on this doc.    editor = GetEditor(n_sel);    if ((editor != NULL) && STE_HASBIT(flags, STE_FR_WRAPAROUND))    {        pos = editor->FindString(str, start_pos, -1, flags, action);        editor->UpdateCanDo(true); // make sure CanFind is updated        return pos;    }    return wxNOT_FOUND;}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:67,



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


C++ GetPageEnd函数代码示例
C++ GetPage函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。