这篇教程C++ EnsureVisible函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中EnsureVisible函数的典型用法代码示例。如果您正苦于以下问题:C++ EnsureVisible函数的具体用法?C++ EnsureVisible怎么用?C++ EnsureVisible使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了EnsureVisible函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxLogDebugvoid DirectoryTree::OnItemExpanded(wxTreeEvent& evt) { wxTreeItemId tid = evt.GetItem(); if(!tid.IsOk()) { wxLogDebug(wxT("OnItemExpanded(): invalid event wxTreeItemId %u"), (int) tid); return; } wxString sPath; bool bGotPath = GetItemPath(tid, sPath); if(!bGotPath) { wxLogDebug(wxT("OnItemExpanded(): Can't get path from tree item %u"), (int) tid); return; } wxLogTrace(DIRECTORYTREE_EVENTS, wxT("OnItemExpanded(): '%s'"), sPath.c_str()); AddChildren(tid); // TBI: Improve this by using GetBoundingRect // Scroll the view so that we can see as much of the newly expanded branch as possible // Get the last 'nChildId', so we can call 'EnsureVisible' wxTreeItemId tidLastChild = GetLastChild(tid); if(tidLastChild.IsOk()) EnsureVisible(tidLastChild); EnsureVisible(tid); }
开发者ID:joeyates,项目名称:sherpa,代码行数:29,
示例2: EnsureVisibleBOOL CDuiItemBox::SetNewPosition(CDuiWindow * pChild, DWORD nPos, BOOL bEnsureVisible){ if (pChild == NULL) { return FALSE; } CDuiWindow * pCurChild = m_pFirstChild; DWORD nCurPos = 0; for (; pCurChild != NULL; pCurChild = pCurChild->GetDuiWindow(GDUI_NEXTSIBLING)) { if (pCurChild == pChild) { break; } ++nCurPos; } if (pCurChild == NULL) { return FALSE; } if (nCurPos == nPos) { if (bEnsureVisible) { EnsureVisible(pChild); } NotifyInvalidate(); return TRUE; } if (nPos == 0) { BringWindowAfter(pChild, ICWND_FIRST); } else { CDuiWindow * pNewNext = m_pFirstChild; for (UINT i = 0; i < nPos && pNewNext != NULL; i++) { pNewNext = pNewNext->GetDuiWindow(GDUI_NEXTSIBLING); } BringWindowAfter(pChild, pNewNext); } UpdateScroll(); ReLayout(); if (bEnsureVisible) { EnsureVisible(pChild); } NotifyInvalidate(); return TRUE;}
开发者ID:maerson,项目名称:GUI-duiengine,代码行数:58,
示例3: ATLASSERTvoid CTuotuoTabCtrl::InsertItem(size_t nInsertTo, CTabItem *pItem){ ATLASSERT(pItem); m_bClosingTabs = false; // we assume, that any new tab appears on the right if (m_TabItems.empty()) { m_TabItems.push_back(pItem); pItem->SetIndex(0); pItem->ChangeItemParent(this); pItem->SetPosImmediately(0); pItem->SetNewWidthImmediately(); } else { if (nInsertTo == -1) nInsertTo = m_TabItems.size(); ATLASSERT(nInsertTo >= 0 && nInsertTo <= m_TabItems.size()); m_TabItems.insert(m_TabItems.begin() + nInsertTo, pItem); for (size_t i = nInsertTo; i < m_TabItems.size(); i++) { m_TabItems[i]->SetIndex(i); m_TabItems[i]->SetPosImmediately(i * m_iCurrentWidth); } pItem->ChangeItemParent(this); pItem->SetNewWidthImmediately(); } EnsureVisible(pItem); UpdateLayout();}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:32,
示例4: GetSelectionvoid CCrystalEditView::OnEditDelete() { if (! QueryEditable() || m_pTextBuffer == NULL) return; CPoint ptSelStart, ptSelEnd; GetSelection(ptSelStart, ptSelEnd); if (ptSelStart == ptSelEnd) { if (ptSelEnd.x == GetLineLength(ptSelEnd.y)) { if (ptSelEnd.y == GetLineCount() - 1) return; ptSelEnd.y ++; ptSelEnd.x = 0; } else ptSelEnd.x ++; } CPoint ptCursorPos = ptSelStart; ASSERT_VALIDTEXTPOS(ptCursorPos); SetAnchor(ptCursorPos); SetSelection(ptCursorPos, ptCursorPos); SetCursorPos(ptCursorPos); EnsureVisible(ptCursorPos); m_pTextBuffer->DeleteText(this, ptSelStart.y, ptSelStart.x, ptSelEnd.y, ptSelEnd.x, CE_ACTION_DELETE); // [JRT]}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:29,
示例5: CBCGPropLRESULT CObjectProperty::OnAddEditBox ( WPARAM wParam, LPARAM lParam ){ //char szDebug [ 255 ] = ""; //theApp.m_Debug.Write ( "OnAddEditBox - Begin" ); sItem* pEdit = ( sItem* ) lParam; //sprintf ( szDebug, "pEdit->iGroup - %i", pEdit->iGroup ); //theApp.m_Debug.Write ( szDebug ); if ( pEdit->iGroup > (int)m_pGroups.size ( ) ) { //theApp.m_Debug.Write ( "INVALID GROUP" ); return 0; } CBCGProp* pProp = m_pGroups [ pEdit->iGroup ].pProperty; m_pGroups [ pEdit->iGroup ].iType = 0; //sprintf ( szDebug, "pEdit->name - %s", GetANSIFromWide ( pEdit->name ) ); //theApp.m_Debug.Write ( szDebug ); //sprintf ( szDebug, "pEdit->contents - %s", GetANSIFromWide ( pEdit->contents ) ); //theApp.m_Debug.Write ( szDebug ); //sprintf ( szDebug, "pEdit->description - %s", GetANSIFromWide ( pEdit->description ) ); //theApp.m_Debug.Write ( szDebug ); pProp->AddSubItem ( new CBCGProp ( pEdit->name, ( _variant_t ) pEdit->contents, pEdit->description ) ); EnsureVisible ( pProp ); //theApp.m_Debug.Write ( "OnAddEditBox - End/n" ); return 0;}
开发者ID:LeeBamberTGC,项目名称:FPS-Creator-Classic,代码行数:34,
示例6: InsertChildCDuiPanel* CDuiItemBox::InsertItem(LPCWSTR pszXml,int iItem/*=-1*/,BOOL bEnsureVisible/*=FALSE*/){ CDuiStringA strXml=DUI_CW2A(pszXml,CP_UTF8);; pugi::xml_document xmlDoc; if(!xmlDoc.load_buffer((LPCSTR)strXml,strXml.GetLength(),pugi::parse_default,pugi::encoding_utf8)) return NULL; CDuiWindow *pChild=m_pFirstChild,*pPrevChild=ICWND_FIRST; for(int iChild=0; iChild<iItem || iItem==-1; iChild++) { if(!pChild) break; pPrevChild=pChild; pChild=pChild->GetDuiWindow(GDUI_NEXTSIBLING); } CDuiPanel *pPanel=new CDuiPanel; InsertChild(pPanel, pPrevChild); pPanel->LoadChildren(xmlDoc); pPanel->SetVisible(TRUE); pPanel->SetFixSize(m_nItemWid,m_nItemHei); UpdateScroll(); ReLayout(); if(bEnsureVisible) EnsureVisible(pPanel); NotifyInvalidate(); return pPanel;}
开发者ID:maerson,项目名称:GUI-duiengine,代码行数:30,
示例7: getSelectedEntries// ----------------------------------------------------------------------------// ArchiveEntryList::filterList//// Filters the list to only entries and directories with names matching// [filter], and with type categories matching [category].// ----------------------------------------------------------------------------void ArchiveEntryList::filterList(string filter, string category){ // Update variables filter_text = filter; filter_category = category; // Save current selection vector<ArchiveEntry*> selection = getSelectedEntries(); ArchiveEntry* focus = getFocusedEntry(); // Apply the filter clearSelection(); applyFilter(); // Restore selection (if selected entries aren't filtered) ArchiveEntry* entry = nullptr; for (int a = 0; a < GetItemCount(); a++) { entry = getEntry(a, false); for (unsigned b = 0; b < selection.size(); b++) { if (entry == selection[b]) { selectItem(a); break; } } if (entry == focus) { focusItem(a); EnsureVisible(a); } }}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:41,
示例8: PopulateTreeViewbool CXTPShellTreeCtrl::Init(){ if (!CXTPShellTreeCtrlBase::Init()) return false; if (m_bAutoInit) { // mimic native Windows Explorer styles. DWORD dwStyle = TVS_SHOWSELALWAYS | TVS_HASBUTTONS; if (XTPSystemVersion()->IsWinXPOrGreater()) { dwStyle |= (TVS_TRACKSELECT); } else { dwStyle |= (TVS_HASLINES | TVS_LINESATROOT); } if (InitializeTree(dwStyle)) { PopulateTreeView(); } // make the parent of the selected item visible if found. HTREEITEM hItem = GetSelectedItem(); HTREEITEM hItemParent = GetParentItem(hItem); EnsureVisible(hItemParent ? hItemParent : hItem); } return true;}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:33,
示例9: FindSpacevoid CDebugView::MarkPauseItem(int64 PauseItemID){ CVSpace2* Item = FindSpace(PauseItemID); if (Item) { if (m_Toolbar.m_Owner) { m_Toolbar.m_Owner->m_AreaBottom-=m_Toolbar.m_Height; m_Toolbar.m_Owner->m_State &= ~SPACE_SELECTED; } m_Toolbar.m_Owner = Item; m_Toolbar.m_Owner->m_AreaBottom+=m_Toolbar.m_Height; Item->m_State |= SPACE_PAUSE|SPACE_SELECTED; m_SpaceSelected = Item; SetStepBnt(true); SetRunBnt(true); SetBreakBnt(false,0); Layout(); EnsureVisible(Item,true); }else { Invalidate(); } }
开发者ID:GMIS,项目名称:GMIS,代码行数:31,
示例10: GetItemCountvoid CXTPTaskPanelGroup::RepositionScrollOffset(){ int nItemCount = GetItemCount(); int nLastVisibleItem = m_pItems->GetNextVisibleIndex(nItemCount, -1); int nScrollOffset = min(GetOffsetItem(), nLastVisibleItem); if (nScrollOffset > 0) { CRect rcItem(GetAt(nLastVisibleItem)->GetItemRect()); int nTopMargin = GetPaintManager()->GetGroupInnerMargins(this).top; while ((nScrollOffset > 0) && ((rcItem.bottom - GetAt(nScrollOffset - 1)->GetItemRect().top + nTopMargin < m_nExpandedClientHeight) || !GetAt(nScrollOffset - 1)->IsVisible())) { nScrollOffset--; } } SetOffsetItem(nScrollOffset, FALSE); for (int i = 0; i < nItemCount; i++) { CXTPTaskPanelGroupItem* pItem = GetAt(i); if (pItem->IsItemFocused() || (pItem->IsItemSelected() && GetTaskPanel()->m_bSelectItemOnFocus)) { EnsureVisible(pItem, FALSE); break; } }}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:32,
示例11: SetFocus/// Left-clickvoid InstanceCtrl::OnLeftClick(wxMouseEvent& event){ SetFocus(); VisualCoord clickedIndex; HitTest(event.GetPosition(), clickedIndex); if(clickedIndex.isItem()) { int flags = 0; if (event.ControlDown()) flags |= wxINST_CTRL_DOWN; if (event.ShiftDown()) flags |= wxINST_SHIFT_DOWN; if (event.AltDown()) flags |= wxINST_ALT_DOWN; EnsureVisible(clickedIndex); DoSelection(clickedIndex); SetIntendedColumn(clickedIndex); } else if(clickedIndex.isHeaderTicker()) { ToggleGroup(clickedIndex.groupIndex); } else ClearSelections();}
开发者ID:Glought,项目名称:MultiMC4,代码行数:26,
示例12: GetSelectionvoid CEditWnd::InsertText(LPCSTR text, int action){ m_pTextBuffer->BeginUndoGroup(); CPoint ptCursorPos; if (IsSelection ()) { CPoint ptSelStart, ptSelEnd; GetSelection (ptSelStart, ptSelEnd); ptCursorPos = ptSelStart; m_pTextBuffer->DeleteText (this, ptSelStart.y, ptSelStart.x, ptSelEnd.y, ptSelEnd.x, CE_ACTION_PASTE); } else ptCursorPos = GetCursorPos (); ASSERT_VALIDTEXTPOS (ptCursorPos); int x, y; m_pTextBuffer->InsertText (this, ptCursorPos.y, ptCursorPos.x, text, y, x, action); ptCursorPos.x = x; ptCursorPos.y = y; ASSERT_VALIDTEXTPOS (ptCursorPos); SetAnchor (ptCursorPos); SetSelection (ptCursorPos, ptCursorPos); SetCursorPos (ptCursorPos); EnsureVisible (ptCursorPos); m_pTextBuffer->FlushUndoGroup (this);}
开发者ID:kosfango,项目名称:fips,代码行数:29,
示例13: _TBOOL CEditWnd::ReplaceSelection (LPCTSTR pszNewText){ if (!pszNewText) pszNewText = _T (""); CPoint ptCursorPos; if (IsSelection ()) { CPoint ptSelStart, ptSelEnd; GetSelection (ptSelStart, ptSelEnd); ptCursorPos = ptSelStart; m_pTextBuffer->DeleteText (this, ptSelStart.y, ptSelStart.x, ptSelEnd.y, ptSelEnd.x, CE_ACTION_REPLACE); } else ptCursorPos = GetCursorPos (); ASSERT_VALIDTEXTPOS (ptCursorPos); int x, y; m_pTextBuffer->InsertText (this, ptCursorPos.y, ptCursorPos.x, pszNewText, y, x, CE_ACTION_REPLACE); m_nLastReplaceLen = (int)_tcslen (pszNewText); CPoint ptEndOfBlock = CPoint (x, y); ASSERT_VALIDTEXTPOS (ptCursorPos); ASSERT_VALIDTEXTPOS (ptEndOfBlock); SetAnchor (ptEndOfBlock); SetSelection (ptCursorPos, ptEndOfBlock); SetCursorPos (ptEndOfBlock); EnsureVisible (ptEndOfBlock); return TRUE;}
开发者ID:kosfango,项目名称:fips,代码行数:28,
示例14: ConvertWideToANSILRESULT CObjectProperty::OnAddColorPicker (WPARAM wParam, LPARAM lParam ){ //char szDebug [ 255 ] = ""; //theApp.m_Debug.Write ( "OnAddColorPicker - Begin" ); sItem* pColor = ( sItem* ) lParam; //sprintf ( szDebug, "pColor->iGroup - %i", pColor->iGroup ); //theApp.m_Debug.Write ( szDebug ); if ( pColor->iGroup > (int)m_pGroups.size ( ) ) { //theApp.m_Debug.Write ( "INVALID GROUP" ); return 0; } CBCGProp* pProp = m_pGroups [ pColor->iGroup ].pProperty; int iColor [ 3 ]; { char szTextANSI [ 255 ] = ""; ConvertWideToANSI ( NULL, &pColor->contents, szTextANSI ); char seps[ ] = " "; char* token; token = strtok ( szTextANSI, seps ); int iToken = 0; while ( token != NULL ) { iColor [ iToken++ ] = atoi ( token ); token = strtok ( NULL, seps ); } } CBCGColorProp* pColorProp = new CBCGColorProp ( pColor->name, RGB ( iColor [ 0 ], iColor [ 1 ], iColor [ 2 ] ), NULL, pColor->description ); //sprintf ( szDebug, "pColor->description - %s", GetANSIFromWide ( pColor->description ) ); //theApp.m_Debug.Write ( szDebug ); m_pGroups [ pColor->iGroup ].iType = 2; pProp->AddSubItem ( pColorProp ); // v105 - 190107 - fix by reverting to standard colour dialog// pColorProp->EnableOtherButton ( _T ( "Other..." ) ); pColorProp->EnableOtherButton ( _T ( "Other..." ), FALSE, TRUE ); pColorProp->EnableAutomaticButton (_T ( "Default" ), ::GetSysColor ( COLOR_3DFACE ) ); EnsureVisible ( pProp ); //theApp.m_Debug.Write ( "OnAddColorPicker - End/n" ); return 0;}
开发者ID:LeeBamberTGC,项目名称:FPS-Creator-Classic,代码行数:60,
示例15: sigSelectItemvoid PG_ListBox::OnItemSelected(PG_ListBoxBaseItem* item, bool select) { if(item == NULL) { return; } if(!my_multiselect) { if((m_poCurrentItem != NULL) && (m_poCurrentItem != item)) { m_poCurrentItem->Select(false); m_poCurrentItem->Update(); } m_poCurrentItem = item; m_poCurrentItem->Update(); } if (select) { sigSelectItem(item); eventSelectItem(item); EnsureVisible(item); }}
开发者ID:KAMI911,项目名称:openmortal,代码行数:26,
示例16: CellHitTest//------------------------------------------------------------------------//! Called by the framework when a drop operation is to occur, where the//! origin is the CGridListCtrlEx itself//!//! @param pDataObject Points to the data object containing the data that can be dropped//! @param dropEffect The effect that the user chose for the drop operation (DROPEFFECT_COPY, DROPEFFECT_MOVE, DROPEFFECT_LINK)//! @param point Contains the current location of the cursor in client coordinates.//! @return Nonzero if the drop is successful; otherwise 0//------------------------------------------------------------------------BOOL CGridListCtrlGroups::OnDropSelf(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point){ // Internal drag (Move rows to other group) int nRow, nCol; CellHitTest(point, nRow, nCol); if (!IsGroupViewEnabled()) return CGridListCtrlEx::MoveSelectedRows(nRow); if (GetStyle() & LVS_OWNERDATA) return false; int nGroupId = nRow!=-1 ? GetRowGroupId(nRow) : GroupHitTest(point); if (nGroupId==-1) return FALSE; if (MoveSelectedRows(nGroupId)) { if (nRow!=-1) { EnsureVisible(nRow, FALSE); SetFocusRow(nRow); } } return TRUE;}
开发者ID:Lyarvo4ka,项目名称:Projects,代码行数:34,
示例17: GetCurSel//******************************************************************************************void CArrayGrid::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { CWnd::OnChar(nChar, nRepCnt, nFlags); if (m_nDraggedColumn >= 0 || m_bTracking || m_bSelecting || nChar == 3) { return; } if (!CanBeginInplaceEditOnChar (nChar, nRepCnt, nFlags)) { return; } CBCGPGridRow* pSel = GetCurSel (); if (pSel == NULL || !pSel->IsEnabled()) { return; } ASSERT_VALID (pSel); EnsureVisible (pSel, TRUE); SetBeginEditReason (BeginEdit_Char); if (!EditItem (pSel)) { return; } DoInplaceEditSetSel (OnInplaceEditSetSel (GetCurSelItem (pSel), BeginEdit_Char)); pSel->PushChar (nChar);}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:35,
示例18: ReleaseCapturevoid CDragVirtualListCtrl::OnLButtonUp(UINT nFlags, CPoint point) { CListCtrl::OnLButtonUp(nFlags, point); // NOTE that only report view is supported if (m_Dragging) { m_Dragging = FALSE; ReleaseCapture(); UINT flags; int InsPos = HitTest(point, &flags); if (InsPos < 0) { if (flags & LVHT_ABOVE) InsPos = 0; else // assume end of list InsPos = GetItemCount(); // this works, amazingly } m_InsertPos = InsPos; // update insert position member // notify the parent window NMLISTVIEW lvh; ZeroMemory(&lvh, sizeof(lvh)); lvh.hdr.hwndFrom = m_hWnd; lvh.hdr.idFrom = GetDlgCtrlID(); lvh.hdr.code = ULVN_REORDER; GetParent()->SendMessage(WM_NOTIFY, lvh.hdr.idFrom, long(&lvh)); KillTimer(m_ScrollTimer); m_ScrollTimer = 0; EnsureVisible(min(InsPos, GetItemCount() - 1), FALSE); }}
开发者ID:victimofleisure,项目名称:FFRend,代码行数:28,
示例19: DeselectAllvoid BrushIconBox::SelectFirstBrush() { if(tileset && tileset->size() > 0) { DeselectAll(); brush_buttons[0]->SetValue(true); EnsureVisible((size_t)0); }}
开发者ID:Arydia,项目名称:rme,代码行数:7,
示例20: GetCurSelvoid CTDLFindTaskExpressionListCtrl::MoveSelectedRuleDown(){ if (CanMoveSelectedRuleDown()) { int nRow, nCol; GetCurSel(nRow, nCol); // save off rule SEARCHPARAM sp = m_aSearchParams[nRow]; // delete rule m_aSearchParams.RemoveAt(nRow); DeleteItem(nRow); // reinsert rule nRow = InsertRule(nRow + 1, sp); // sanity check ValidateListData(); // restore selection SetCurSel(nRow, nCol); EnsureVisible(nRow, FALSE); }}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:25,
示例21: HitTestvoid CTuotuoCategoryCtrl::OnLButtonDown(UINT /* nFlags */, CPoint ptCursor){ //CSogouToolTip::GetTooltip()->RelayEventSingleton(m_hWnd, INVALID_ITEM); if (::PtInRect(&m_rcTabItemAreaDraw, ptCursor)) { CategoryPosition pos; CCategoryItem *pItem = HitTest(ptCursor, &pos); if (pItem) { SetMousePosAndStatus(pos, Btn_MouseDown); if (pItem != m_pSelectedItem && pos == CatePos_TabItem) FS()->MDI()->ActiveCategory(pItem); else if (pItem == m_pSelectedItem) EnsureVisible(pItem); } } else if (m_bOverflowLeft && ::PtInRect(&m_rcScrollLLeft, ptCursor)) { SetMousePosAndStatus(CatePos_ScrollLLeftBtn, Btn_MouseDown); SetScrollDir(-1); } else if (m_bOverflowRight && ::PtInRect(&m_rcScrollRRight, ptCursor)) { SetMousePosAndStatus(CatePos_ScrollRRightBtn, Btn_MouseDown); SetScrollDir(1); } else SetMousePosAndStatus(CatePos_Unknown, Btn_MouseOut); if (m_ePosition != CatePos_Unknown) SetCapture();}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:33,
示例22: GetOwnervoid SListBoxEx::OnKeyDown( TCHAR nChar, UINT nRepCnt, UINT nFlags ){ int nNewSelItem = -1; SWindow *pOwner = GetOwner(); if (pOwner && (nChar == VK_ESCAPE)) { pOwner->SSendMessage(WM_KEYDOWN, nChar, MAKELONG(nFlags, nRepCnt)); return; } if (nChar == VK_DOWN && m_iSelItem < GetItemCount() - 1) nNewSelItem = m_iSelItem+1; else if (nChar == VK_UP && m_iSelItem > 0) nNewSelItem = m_iSelItem-1; else if (pOwner && nChar == VK_RETURN) nNewSelItem = m_iSelItem; else if(nChar == VK_PRIOR) { OnScroll(TRUE,SB_PAGEUP,0); }else if(nChar == VK_NEXT) { OnScroll(TRUE,SB_PAGEDOWN,0); } if(nNewSelItem!=-1) { EnsureVisible(nNewSelItem); NotifySelChange(m_iSelItem,nNewSelItem); }}
开发者ID:435420057,项目名称:soui,代码行数:30,
示例23: CreateTreevoid MyGameTreeCtrl::RefreshTree(string* pstrPanelName){ m_mapNode.clear(); CreateTree(); m_bInsertData = true; EnsureVisible(GetRootItem());}
开发者ID:2Dou,项目名称:PlayBox,代码行数:7,
示例24: Freezevoid ProcList::showList(int highlight){ int c = 0; Freeze(); DeleteAllItems(); for (std::vector<Database::Item>::const_iterator i = list.items.begin(); i != list.items.end(); i++) { const Database::Symbol *sym = i->symbol; double inclusive = i->inclusive; double exclusive = i->exclusive; float inclusivepercent = i->inclusive * 100.0f / list.totalcount; float exclusivepercent = i->exclusive * 100.0f / list.totalcount; InsertItem(c, sym->procname.c_str(), -1); if(sym->isCollapseFunction || sym->isCollapseModule) { SetItemTextColour(c,wxColor(0,128,0)); } setColumnValue(c, COL_EXCLUSIVE, wxString::Format("%0.2fs",exclusive)); setColumnValue(c, COL_INCLUSIVE, wxString::Format("%0.2fs",inclusive)); setColumnValue(c, COL_EXCLUSIVEPCT, wxString::Format("%0.2f%%",exclusivepercent)); setColumnValue(c, COL_INCLUSIVEPCT, wxString::Format("%0.2f%%",inclusivepercent)); setColumnValue(c, COL_SAMPLES, wxString::Format("%0.2fs",exclusive)); setColumnValue(c, COL_CALLSPCT, wxString::Format("%0.2f%%",exclusivepercent)); setColumnValue(c, COL_MODULE, sym->module.c_str()); setColumnValue(c, COL_SOURCEFILE, sym->sourcefile.c_str()); setColumnValue(c, COL_SOURCELINE, ::toString(sym->sourceline).c_str()); c++; } this->SetItemState(highlight, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED); Thaw(); EnsureVisible(highlight);}
开发者ID:CyberShadow,项目名称:verysleepy-1,代码行数:35,
示例25: EnsureVisiblevoid OutputCtrl::ShowLine( int line ){ // First make sure the line is not folded. EnsureVisible( line ); line = VisibleFromDocLine( line ); int firstVisible = GetFirstVisibleLine(); int lastVisible = firstVisible + ( LinesOnScreen() - 1 ); if ( line <= firstVisible ) { int lines = line - firstVisible; if ( lines < -1 ) { lines -= LinesOnScreen() / 2; } LineScroll( 0, lines ); } else if ( line >= lastVisible ) { int lines = line - lastVisible; if ( lines > 1 ) { lines += LinesOnScreen() / 2; } LineScroll( 0, lines ); }}
开发者ID:Duion,项目名称:Torsion,代码行数:26,
示例26: fnamevoid wxFileCtrl::GoToParentDir(){ if (!IsTopMostDir(m_dirName)) { size_t len = m_dirName.Len(); if (wxEndsWithPathSeparator(m_dirName)) m_dirName.Remove( len-1, 1 ); wxString fname( wxFileNameFromPath(m_dirName) ); m_dirName = wxPathOnly( m_dirName );#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) if (!m_dirName.empty()) { if (m_dirName.Last() == wxT('.')) m_dirName = wxEmptyString; }#elif defined(__UNIX__) if (m_dirName.empty()) m_dirName = wxT("/");#endif UpdateFiles(); long id = FindItem( 0, fname ); if (id != wxNOT_FOUND) { ignoreChanges = true; SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); EnsureVisible( id ); ignoreChanges = false; } }}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:30,
示例27: DeleteCurrentSelectionvoid CCrystalEditView::Paste(){ if (! QueryEditable()) return; if (m_pTextBuffer == NULL) return; if(m_pTextBuffer->m_bUndoGroup) m_pTextBuffer->FlushUndoGroup(this); m_pTextBuffer->BeginUndoGroup(); DeleteCurrentSelection(); CString text; if (GetFromClipboard(text)) { CPoint ptCursorPos = GetCursorPos(); ASSERT_VALIDTEXTPOS(ptCursorPos); int x, y; m_pTextBuffer->InsertText(this, ptCursorPos.y, ptCursorPos.x, text, y, x, CE_ACTION_PASTE); // [JRT] ptCursorPos.x = x; ptCursorPos.y = y; ASSERT_VALIDTEXTPOS(ptCursorPos); SetAnchor(ptCursorPos); SetSelection(ptCursorPos, ptCursorPos); SetCursorPos(ptCursorPos); EnsureVisible(ptCursorPos); } m_pTextBuffer->FlushUndoGroup(this);}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:32,
注:本文中的EnsureVisible函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ EnterCritical函数代码示例 C++ EnsureInitialized函数代码示例 |