本文整理汇总了C++中DeselectAll函数的典型用法代码示例。如果您正苦于以下问题:C++ DeselectAll函数的具体用法?C++ DeselectAll怎么用?C++ DeselectAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DeselectAll函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Window
/**
Mouse click scenarios.
*/
void AlbumView::MouseDown(BPoint where)
{
// This is an event hook so there must be a Looper.
BMessage *message = Window()->CurrentMessage();
int32 mods = 0, clicks = 0, buttons=0;
message->FindInt32("modifiers", &mods);
message->FindInt32("clicks", &clicks);
message->FindInt32("buttons", &buttons);
// Scale back.
where.x /= fZoom;
where.y /= fZoom;
int32 i = IndexOf(&where);
int32 changes = 0;
if (i >= 0) {
AlbumItem *item = ItemAt(i);
// double-clicks are handled later in MouseUp()
fDoubleClick = (fLastSelected == i && clicks == 2 && (buttons & B_PRIMARY_MOUSE_BUTTON));
fMayDrag = !fDoubleClick && (buttons & B_PRIMARY_MOUSE_BUTTON);
if (mods & B_SHIFT_KEY)
// Block selection
changes += SelectBlock(fLastSelected, i, !item->IsSelected());
else if (mods & B_COMMAND_KEY)
// Modify selection
changes += Select(i, 1, !item->IsSelected());
else {
// Normal selection
if (!item->IsSelected())
changes += DeselectAll();
changes += Select(i);
}
fLastWhere = where;
fLastSelected = i;
}
else
changes += DeselectAll();
if (changes > 0) {
//PRINT(("selection changed\n"));
SelectionChanged();
if (!fDoubleClick && Message()) {
BMessage msg = *Message();
msg.AddInt32("buttons", buttons);
msg.AddPoint("where", where);
msg.AddInt32("index", fLastSelected);
Invoke(&msg);
}
}
}
示例2: DeselectAll
void CTDCTaskListCtrl::SetSelectedTasks(const CDWordArray& aTaskIDs, DWORD dwFocusedTaskID)
{
DeselectAll();
int nID = aTaskIDs.GetSize();
if (nID)
{
CTLSHoldResync hr(*this);
while (nID--)
{
DWORD dwTaskID = aTaskIDs[nID];
int nItem = FindTaskItem(dwTaskID);
if (nItem != -1)
{
BOOL bAnchor = (dwTaskID == dwFocusedTaskID);
DWORD dwState = LVIS_SELECTED;
if (bAnchor)
{
dwState |= LVIS_FOCUSED;
m_lcTasks.SetSelectionMark(nItem);
m_lcColumns.SetSelectionMark(nItem);
}
m_lcTasks.SetItemState(nItem, dwState, (LVIS_SELECTED | LVIS_FOCUSED));
m_lcColumns.SetItemState(nItem, dwState, (LVIS_SELECTED | LVIS_FOCUSED));
}
}
}
}
示例3: DeselectAll
BOOL CLibraryAlbumView::Select(DWORD nObject)
{
CRect rcClient, rcItem;
CLibraryAlbumTrack** pList = m_pList + m_nCount - 1;
int nItem = m_nCount;
for ( ; nItem ; nItem--, pList-- )
{
CLibraryAlbumTrack* pTrack = *pList;
if ( pTrack->m_nIndex == nObject ) break;
}
if ( nItem == 0 ) return FALSE;
m_pFocus = *pList;
DeselectAll( m_pFocus );
Select( m_pFocus );
Invalidate();
GetClientRect( &rcClient );
GetItemRect( m_pFocus, &rcItem );
if ( rcItem.top < rcClient.top )
ScrollBy( rcItem.top - rcClient.top );
else if ( rcItem.bottom > rcClient.bottom )
ScrollBy( rcItem.bottom - rcClient.bottom );
return TRUE;
}
示例4: GetMouse
void
PrefListView::MouseDown(BPoint point)
{
BPoint cursor;
ulong m_buttons;
GetMouse(&cursor,&m_buttons);
if (!(m_buttons & 0x2))
BOutlineListView::MouseDown(point);
else {
// right mouse button is for popup only :-)
BMessage msg(MSG_LIST_POPUP);
msg.AddPoint("point", point);
int32 index = IndexOf(point);
msg.AddInt32("index", index);
if (index>0) {
DeselectAll();
Select(index);
InvalidateItem(index);
}
Window()->PostMessage( &msg );
}
}
示例5: DeselectAll
void BrushIconBox::SelectFirstBrush() {
if(tileset && tileset->size() > 0) {
DeselectAll();
brush_buttons[0]->SetValue(true);
EnsureVisible((size_t)0);
}
}
示例6: oLock
void CLibraryTileView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CSingleLock oLock( &Library.m_pSection );
if ( oLock.Lock( 200 ) )
{
if ( _istalnum( TCHAR( nChar ) ) )
{
iterator pStart = m_pFocus;
for ( int nLoop = 0; nLoop < 2; nLoop++ )
{
for ( iterator pChild = begin(); pChild != end(); ++pChild )
{
if ( pStart != end() )
{
if ( pStart == pChild )
pStart = end();
}
else if ( toupper( (*pChild)->GetTitle().GetAt( 0 ) ) == toupper( (int)nChar ) )
{
DeselectAll( m_pFocus = pChild );
Select( m_pFocus, TRI_TRUE );
Highlight( m_pFocus );
Invalidate();
return;
}
}
}
}
}
CLibraryView::OnChar( nChar, nRepCnt, nFlags );
}
示例7: RemoveSelItems
void TItemList::RemoveSelItems(TOnItemRemove on_remove)
{
if (mrYes==MessageDlg("Remove selected item(s)?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0)){
on_remove = on_remove.empty()?OnItemRemoveEvent:on_remove;
VERIFY (!on_remove.empty());
RStringVec sel_items;
if (GetSelected(sel_items)){
tvItems->IsUpdating = true; // LockUpdating нельзя
DeselectAll ();
tvItemsAfterSelectionChange (0);
bool bSelChanged=false;
bool bRes=false;
for (RStringVecIt it=sel_items.begin(); it!=sel_items.end(); it++){
TElTreeItem* pNode = FHelper.FindItem(tvItems,**it);
if (!FHelper.RemoveItem(tvItems,pNode,on_remove.empty()?OnItemRemoveEvent:on_remove)){
SelectItem(**it,true,true,false);
bSelChanged=true;
}else{
bRes = true;
}
}
if (bSelChanged||bRes){
tvItemsAfterSelectionChange (0);
if (bRes&&!OnModifiedEvent.empty()) OnModifiedEvent();
}
tvItems->IsUpdating = false;
}
}
}
示例8: DeselectAll
// MoveItems
void
DragSortableListView::MoveItems(BList& items, int32 index)
{
DeselectAll();
// we remove the items while we look at them, the insertion index is decreased
// when the items index is lower, so that we insert at the right spot after
// removal
BList removedItems;
int32 count = items.CountItems();
for (int32 i = 0; i < count; i++) {
BListItem* item = (BListItem*)items.ItemAt(i);
int32 removeIndex = IndexOf(item);
if (RemoveItem(item) && removedItems.AddItem((void*)item)) {
if (removeIndex < index)
index--;
}
// else ??? -> blow up
}
for (int32 i = 0;
BListItem* item = (BListItem*)removedItems.ItemAt(i); i++) {
if (AddItem(item, index)) {
// after we're done, the newly inserted items will be selected
Select(index, true);
// next items will be inserted after this one
index++;
} else
delete item;
}
}
示例9: lRoot
BOOL CBrowseTreeCtrl::CleanItems(CBrowseTreeItem* pItem, DWORD nCookie, BOOL bVisible)
{
CSingleLock lRoot( &m_csRoot, TRUE );
CBrowseTreeItem** pChild = pItem->m_pList + pItem->m_nCount - 1;
BOOL bChanged = FALSE;
for ( int nChild = pItem->m_nCount ; nChild ; nChild--, pChild-- )
{
if ( (*pChild)->m_nCleanCookie != nCookie )
{
if ( m_pFocus == *pChild ) m_pFocus = NULL;
if ( (*pChild)->m_bSelected ) Select( *pChild, TS_FALSE, FALSE );
bChanged |= DeselectAll( NULL, *pChild, FALSE );
if ( bVisible )
{
m_nTotal -= (*pChild)->GetChildCount() + 1;
bChanged = TRUE;
}
delete *pChild;
MoveMemory( pChild, pChild + 1, 4 * ( pItem->m_nCount - nChild ) );
pItem->m_nCount--;
}
}
return bChanged;
}
示例10: current
void KeyHandlesSheet::OnCursorStillDown(const Input::Cursor& cursor)
{
if (cursor.isPressed) {
if (!mIsFrameSelecting)
{
if (cursor.delta != Vec2F())
mIsFrameSelecting = true;
}
if (mIsFrameSelecting)
{
mSelectionFrame->enabled = true;
Vec2F current(mTimeline->WorldToLocal(cursor.position.x), mTree->GetLineNumber(cursor.position.y));
mSelectionRect.left = Math::Min(mBeginSelectPoint.x, current.x);
mSelectionRect.right = Math::Max(mBeginSelectPoint.x, current.x);
mSelectionRect.top = Math::Floor(Math::Min(mBeginSelectPoint.y, current.y));
mSelectionRect.bottom = Math::Ceil(Math::Max(mBeginSelectPoint.y, current.y));
DeselectAll();
for (auto handle : mBeginSelectHandles)
SelectHandle(handle);
for (auto handle : mHandles) {
Vec2F handlePos(handle->GetPosition().x, mTree->GetLineNumber(handle->GetScreenPosition().y));
if (handlePos.x > mSelectionRect.left && handlePos.x < mSelectionRect.right && handlePos.y > mSelectionRect.top && handlePos.y < mSelectionRect.bottom + 0.5f) {
SelectHandle(handle);
}
}
}
}
}
示例11: puts
void
PrefListView::BuildView(XmlNode *node, int level, BListItem* parent)
{
if (!node) {
puts("Rebuild mit NULL?!");
return;
}
int anz = node->Children();
//printf("BuildView: %s %d einträge\n", node->Attribute("text"), anz);
if (anz>0) {
if (level==0) {
for (int i=0;i<anz;i++) {
XmlNode* c = (XmlNode*)node->ItemAt(i);
const char* t = c->Attribute("text");
BStringItem* item = new BStringItem(t);
item->SetText( t );
if (level>0)
AddUnder(item, parent);
else
AddItem(item);
//printf("Hinzufügen war %d\n", b);
if (c->Children()>0) {
BuildView(c, level+1, item);
}
}
DeselectAll();
}
else {
for (int i=anz-1;i>=0;i--) {
XmlNode* c = (XmlNode*)node->ItemAt(i);
const char* t = c->Attribute("text");
BStringItem* item = new BStringItem(t);
item->SetText( t );
if (level>0)
AddUnder(item, parent);
else
AddItem(item);
//printf("Hinzufügen war %d\n", b);
if (c->Children()>0) {
BuildView(c, level+1, item);
}
}
}
}
else {
//puts("Tja...");
}
}
示例12: DeselectAll
// MouseDown
void
PropertyListView::MouseDown(BPoint where)
{
if (!(modifiers() & B_SHIFT_KEY)) {
DeselectAll();
}
MakeFocus(true);
}
示例13: while
void SelectionState::DeselectAll(Node* pNode)
{
while (pNode != NULL)
{
DeselectAll(pNode->FindFirstChild());
pNode->ClearSelection();
pNode = pNode->FindNext();
}
}
示例14: GetScrollPosition
afx_msg void
MFCSequenceEditor::OnLButtonDown(
UINT nFlags,
CPoint point
)
{
point += GetScrollPosition();
last_mouse_point = mouse_click = point;
short at_channel;
// at_channel = Pix2Channel(point.y);
Time at_time;
Pix2Time(point.x, at_time);
// int bar, barbeat, beattick;
// at_time.GetBBQValue(bar, barbeat, beattick);
// fprintf(stderr, "left button down: on point %d %d, channel %d, ticks %d t %d:%d.%d\n", point.x, point.y, at_channel, at_time.ticks, bar, barbeat, beattick);
switch (currentTool) {
case ID_ARTOOL_POINT: {
DeselectAll();
// mouse_instance = InstanceViewAtPoint(mouse_click);
// if (mouse_instance) {
// mouse_action = QUA_MOUSE_ACTION_MOVE_INSTANCE;
// mouse_move_inst_offset.x = mouse_click.x - mouse_instance->bounds.left;
// mouse_move_inst_offset.y = mouse_click.y;
// mouse_instance->Select(true);
// }
break;
}
case ID_ARTOOL_SLICE: {
break;
}
case ID_ARTOOL_RGSELECT: {
fprintf(stderr, "region select\n");
mouse_action = QUA_MOUSE_ACTION_REGION_SELECT;
BRect r(min(mouse_click.x,point.x),min(mouse_click.y,point.y),max(mouse_click.x,point.x),max(mouse_click.y,point.y));
ChangeSelection(r);
break;
}
case ID_ARTOOL_DRAW: {
// mouse_instance = InstanceViewAtPoint(mouse_click);
// if (mouse_instance) {
// mouse_action = QUA_MOUSE_ACTION_SIZE_INSTANCE;
// mouse_move_inst_offset.x = mouse_instance->bounds.left;
// mouse_move_inst_offset.y = mouse_click.y;
// Instance *inst = mouse_instance->instance;
// if (inst) {
// Pix2Time(point.x-mouse_move_inst_offset.x, at_time);
// quaLink->MoveInstance(inst->sym, -1, NULL, &at_time);
// }
// }
break;
}
}
}
示例15: DeselectAll
void KeyHandlesSheet::OnCursorPressed(const Input::Cursor& cursor)
{
if (!o2Input.IsKeyDown(VK_CONTROL))
DeselectAll();
mBeginSelectHandles = mSelectedHandles;
mBeginSelectPoint.x = mTimeline->WorldToLocal(cursor.position.x);
mBeginSelectPoint.y = mTree->GetLineNumber(cursor.position.y);
}