本文整理汇总了C++中InvalidateItem函数的典型用法代码示例。如果您正苦于以下问题:C++ InvalidateItem函数的具体用法?C++ InvalidateItem怎么用?C++ InvalidateItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InvalidateItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dc
void CContainerItem::UpdateFromServerExtent()
{
CSize size;
if (GetCachedExtent(&size))
{
// OLE returns the extent in HIMETRIC units -- we need pixels
CClientDC dc(NULL);
dc.HIMETRICtoDP(&size);
// Only invalidate if it has actually changed, and also
// only if it is not in-place active. When in-place active, the
// container item size should sync with the "window size" of the
// object. Only when not in-place active should the container
// item size should sync with the natural size of the object.
if ((size != m_rect.Size()) && !IsInPlaceActive())
{
// invalidate old, update, invalidate new
InvalidateItem();
m_rect.bottom = m_rect.top + size.cy;
m_rect.right = m_rect.left + size.cx;
InvalidateItem();
// mark document as modified
GetDocument()->SetModifiedFlag();
}
}
}
示例2: OnSpKeyDown
static void OnSpKeyDown(WPARAM wParam, LPARAM lParam)
{
switch(wParam){
case VK_TAB:
if(!IsWindowVisible(g_hWnd)){
OnListUpdate();
}
else{
if(!g_Shift){
g_WndList->MoveCursor(1);
}
else{
g_WndList->MoveCursor(-1);
}
InvalidateItem();
}
break;
case VK_ESCAPE:
case VK_KANJI:
HideWindow();
break;
case VK_UP:
g_WndList->MoveCursor(-1);
InvalidateItem();
break;
case VK_DOWN:
g_WndList->MoveCursor(1);
InvalidateItem();
break;
case VK_LSHIFT:
case VK_RSHIFT:
g_Shift = TRUE;
break;
}
}
示例3: InvalidateItem
// SetItemFocused
void
DragSortableListView::SetItemFocused(int32 index)
{
InvalidateItem(fFocusedIndex);
InvalidateItem(index);
fFocusedIndex = index;
}
示例4: ASSERT_VALID
BOOL CContainerItem::OnChangeItemPosition(const CRect& rectPos)
{
ASSERT_VALID(this);
// During in-place activation CContainerItem::OnChangeItemPosition
// is called by the server to change the position of the in-place
// window. Usually, this is a result of the data in the server
// document changing such that the extent has changed or as a result
// of in-place resizing.
//
// The default here is to call the base class, which will call
// COleClientItem::SetItemRects to move the item
// to the new position.
if (!COleClientItem::OnChangeItemPosition(rectPos))
return FALSE;
InvalidateItem();
m_rect = rectPos;
InvalidateItem();
// mark document as dirty
GetDocument()->SetModifiedFlag();
return TRUE;
}
示例5: CurrentSelection
void _ArpControllerRangeList::SelectionChanged()
{
inherited::SelectionChanged();
int32 selection = CurrentSelection();
BMessage update('iupd');
if (selection >= 0) {
BListItem* item;
for (int32 k = 0; (item = ItemAt(k)); k++) {
_ArpControllerRangeItem* ccItem = dynamic_cast<_ArpControllerRangeItem*>(item);
if (ccItem) {
if ( IsItemSelected(k) ) {
update.AddInt32(mSettingsKey.String(), k);
if ( !ccItem->IsActive() ) {
ccItem->SetActive(true);
InvalidateItem(k);
}
} else {
if ( ccItem->IsActive() ) {
ccItem->SetActive(false);
InvalidateItem(k);
}
}
}
}
}
if (mTarget) {
mTarget->Implementation().SendConfiguration(&update);
mTarget->Settings().Update(update);
}
}
示例6: ItemFromPoint
void CPlugToolBar::OnMouseMove(UINT nFlags, CPoint point)
{
BOOL bOutside;
int i;
i = ItemFromPoint (point, bOutside);
if (bOutside)
{
if (m_iMayBeSelected != -1)
{
InvalidateItem (m_iMayBeSelected);
ReleaseCapture ();
}
m_iMayBeSelected = m_iPressed = -1;
return;
}
CRect rcItem;
GetItemRect (i, &rcItem);
CPoint pt (rcItem.left + (rcItem.right - rcItem.left) / 2 - 32/2, rcItem.top + 5);
rcItem.left = pt.x;
rcItem.top = pt.y;
rcItem.right = pt.x + 32;
rcItem.bottom = pt.y + 32;
if (!PtInRect (&rcItem, point))
{
if (m_iMayBeSelected != -1)
{
InvalidateItem (m_iMayBeSelected);
ReleaseCapture ();
}
m_iMayBeSelected = m_iPressed = -1;
return;
}
if (m_iMayBeSelected == i)
return;
else if (m_iMayBeSelected != -1)
{
InvalidateItem (m_iMayBeSelected);
ReleaseCapture ();
}
m_iMayBeSelected = i;
m_iPressed = -1;
InvalidateItem (i);
SetCapture ();
CListBox::OnMouseMove(nFlags, point);
}
示例7: InvalidateItem
/*****************************************************************************
* PlaylistView::SetCurrent
*****************************************************************************/
void
PlaylistView::SetCurrent( int32 index )
{
if ( fCurrentIndex != index )
{
InvalidateItem( fCurrentIndex );
fCurrentIndex = index;
InvalidateItem( fCurrentIndex );
}
}
示例8: InvalidateItem
void CFX_ListCtrl::SetCaret(int32_t nItemIndex) {
if (!IsValid(nItemIndex))
return;
if (IsMultipleSel()) {
int32_t nOldIndex = m_nCaretIndex;
if (nOldIndex != nItemIndex) {
m_nCaretIndex = nItemIndex;
InvalidateItem(nOldIndex);
InvalidateItem(nItemIndex);
}
}
}
示例9: SetItemSelect
void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, bool bSelected) {
if (!IsValid(nItemIndex))
return;
if (bSelected != IsItemSelected(nItemIndex)) {
if (bSelected) {
SetItemSelect(nItemIndex, true);
InvalidateItem(nItemIndex);
} else {
SetItemSelect(nItemIndex, false);
InvalidateItem(nItemIndex);
}
}
}
示例10: 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 );
}
}
示例11: SetScrollPos
void CFX_ListCtrl::SetPlateRect(const CFX_FloatRect& rect) {
CFX_ListContainer::SetPlateRect(rect);
m_ptScrollPos.x = rect.left;
SetScrollPos(CFX_PointF(rect.left, rect.top));
ReArrange(0);
InvalidateItem(-1);
}
示例12: Clear
// completely invalidate the cache
void Clear()
{
for ( size_t n = 0; n < SIZE; n++ )
{
InvalidateItem(n);
}
}
示例13: GetPlateRect
void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy) {
if (!IsFloatEqual(m_ptScrollPos.y, fy)) {
CFX_FloatRect rcPlate = GetPlateRect();
CFX_FloatRect rcContent = GetContentRectInternal();
if (rcPlate.Height() > rcContent.Height()) {
fy = rcPlate.top;
} else {
if (IsFloatSmaller(fy - rcPlate.Height(), rcContent.bottom)) {
fy = rcContent.bottom + rcPlate.Height();
} else if (IsFloatBigger(fy, rcContent.top)) {
fy = rcContent.top;
}
}
m_ptScrollPos.y = fy;
InvalidateItem(-1);
if (m_pNotify) {
if (!m_bNotifyFlag) {
m_bNotifyFlag = true;
m_pNotify->IOnSetScrollPosY(fy);
m_bNotifyFlag = false;
}
}
}
}
示例14: InvalidateItem
void CPlugToolBar::OnLButtonDown(UINT , CPoint )
{
if (m_iMayBeSelected != -1)
{
m_iPressed = m_iMayBeSelected;
InvalidateItem (m_iPressed);
}
}
示例15: FindJob
void
JobListView::UpdateJob(Job* job)
{
JobItem* item = FindJob(job);
if (item) {
item->Update();
InvalidateItem(IndexOf(item));
}
}