Ejemplo n.º 1
0
void CNewHeaderCtrl::SetItemImage( int nItem, int nImage )
{
	// Save the image index
	m_mapImageIndex[nItem] = nImage;

	// Change the item to ownder drawn
	HD_ITEM hditem;

	hditem.mask = HDI_FORMAT;
	GetItem( nItem, &hditem );
	hditem.fmt |= HDF_OWNERDRAW;
	SetItem( nItem, &hditem );

	// Invalidate header control so that it gets redrawn
	Invalidate();
}
Ejemplo n.º 2
0
void FileCtrl::UpdateItem(const wxListItem &item)
{
   FileData *fd = (FileData*)GetItemData(item);
   wxCHECK_RET(fd, wxT("invalid filedata"));
   
   fd->ReadData();
   
   SetItemText(item, fd->GetFileName());
   SetItemImage(item, fd->GetImageId());
   
   if (GetWindowStyleFlag() & wxLC_REPORT)
   {
      for (int i = 1; i < FileData::FileList_Max; i++)
         SetItem( item.m_itemId, i, fd->GetEntry((FileData::fileListFieldType)i) );
   }
}
Ejemplo n.º 3
0
bool wxTreeCtrl::SetItemImage(long item, int image, int selImage)
{
    wxTreeItem info;

    info.m_mask = wxTREE_MASK_IMAGE;
    info.m_image = image;
    if ( selImage > -1)
    {
        info.m_selectedImage = selImage;
        info.m_mask |= wxTREE_MASK_SELECTED_IMAGE;
    }

    info.m_itemId = item;

    return SetItem(info);
}
Ejemplo n.º 4
0
void CSortHeaderCtrl::SetSortArrow( const int iSortColumn, const BOOL bSortAscending )
{
	m_iSortColumn = iSortColumn;
	m_bSortAscending = bSortAscending;

	// change the item to owner drawn.
	HD_ITEM hditem;

	hditem.mask = HDI_FORMAT;
	VERIFY( GetItem( iSortColumn, &hditem ) );
	hditem.fmt |= HDF_OWNERDRAW;
	VERIFY( SetItem( iSortColumn, &hditem ) );

	// invalidate the header control so it gets redrawn
	Invalidate();
}
Ejemplo n.º 5
0
//*****************************************************************************
//*
//*		SetItemText
//*
//*****************************************************************************
//	Set the text of an item
//	hItem		: Is the handle of the item
//	pText		: Is the new text of the item
//	nCol		: Is the column for the text (0=tree column)
//	Returns TRUE if the text was changed or FALSE if an error occurs
BOOL CTreeListCtrl::SetItemText(HTREEITEM hItem, LPCTSTR pText, int nCol) {
	TV_ITEM		sItem;


	ASSERT(::IsWindow(m_hWnd));

	sItem.mask				= TVIF_SUBITEM | TVIF_TEXT;
	sItem.hItem				= hItem;
	sItem.stateMask			= 0;
	sItem.pszText			= (LPTSTR)pText;
	sItem.cchTextMax		= (pText) ? 256 : 0;
	sItem.cChildren			= nCol;


	return SetItem(&sItem);
}
void EXWaitingTreeCtrl::ExpandItem(HTREEITEM hItem)
{
	if (m_hItemToPopulate == NULL)
		return;	// just expand, doesn't want new items

	ASSERT(hItem == m_hItemToPopulate);	// should never fail!!!

	if (m_bShowWaitMsg)
	{
		// display wait msg now, make sure it's visible
		SetRedraw();
		EnsureVisible(m_hItemMsg);
		UpdateWindow();
	}
	// setup animation thread, call PreAnimation
	StartAnimation();
	// draw icon
	if (m_bShowWaitMsg)
		DrawUserIcon();
	// delay redraw after populating
	SetRedraw(FALSE);
	// take a snapshot of the background
	TakeSnapshot();
	// del temporary item (wait msg still shown)
	DeleteItem(m_hItemMsg);
	// fill in with sub items
	BOOL bCheckChildren = PopulateItem(hItem);
	// clean up animation thread, call PostAnimation
	StopAnimation();
	// change parent to reflect current children number
	if (hItem != TVI_ROOT)
	{
		TVITEM item;
		item.hItem = hItem;
		item.mask = TVIF_HANDLE | TVIF_CHILDREN;
		item.cChildren = NeedsChildren(hItem) ? 0 : 1;
		if (bCheckChildren)
			SetItem(&item);
		else if (item.cChildren == 0)
			// restore item's plus button if no children inserted
			SetItemState(hItem, 0, TVIS_EXPANDED);
	}
	// clean up snapshot
	DestroySnapshot();
	// redraw now
	SetRedraw(TRUE);
}
Ejemplo n.º 7
0
void Client::ParseItems(string str)
{
	if (str.length() > 0)
	{
		std::vector<string> itemtokens;
		std::vector<string> tokens;
		boost::split(itemtokens, str, boost::is_any_of("|"));

		for (int i = 0; i < itemtokens.size(); ++i)
		{
			boost::split(tokens, itemtokens[i], boost::is_any_of(","));

			if (tokens.size() == 2)
				SetItem(tokens[0], _atoi64(tokens[1].c_str()));
		}
	}
}
Ejemplo n.º 8
0
void CDragDropTreeCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
    CTreeCtrl::OnLButtonUp(nFlags, point);

    if (m_bDragging && m_pImageList != NULL)
    {
        // Stop the scroll timer if it's running.
        KillTimer(1);

        // Terminate the dragging operation and release the mouse.
        m_pImageList->DragLeave(this);
        m_pImageList->EndDrag();
        ::ReleaseCapture();
        m_bDragging = FALSE;
        SelectDropTarget(NULL);

        // Delete the image list created by CreateDragImage.
        delete m_pImageList;
        m_pImageList = NULL;

        // Get the HTREEITEM of the drop target and exit now if it's NULL.
        UINT nFlags;
        HTREEITEM hItem = HitTest(point, &nFlags);
        if (hItem == NULL)
            return;

        if (hItem == m_hDragItem)
            return;
        else if (hItem == GetParentItem(m_hDragItem))
            return;
        else if (IsChildOf(hItem, m_hDragItem))
            return;

        // Move the dragged item and its subitems (if any) to the drop point.
        MoveTree(hItem, m_hDragItem);

        // Mark the item as having children
        TVITEM tvItem;
        tvItem.mask = TVIF_CHILDREN | TVIF_HANDLE;
        tvItem.cChildren = 1;
        tvItem.hItem = hItem;
        SetItem(&tvItem);

        m_hDragItem = NULL;
    }
}
Ejemplo n.º 9
0
// Restores the entire list if the filter is empty
void wxAdvancedListCtrl::RestoreList()
{
    if (BackupItems.empty())
        return;

    DeleteAllItems();

    for (size_t x = 0; x < BackupItems.size(); ++x)
    {
        InsertItem(x, wxT(""));

        for (size_t y = 0; y < BackupItems[x].size(); ++y)
        {
            SetItem(BackupItems[x][y]);
        }
    }
}
Ejemplo n.º 10
0
/**
 * \brief Set the correct font for a required field.
 * \param i The line to change.
 * \param b Tell if the field has a value or not.
 */
void bf::item_field_edit::set_required_color( unsigned int i, bool b )
{
  wxListItem prop;
  prop.SetId(i);
  GetItem(prop);

  wxFont font( GetFont() );
  font.SetWeight( wxFONTWEIGHT_BOLD );
  prop.SetFont( font );

  if (b)
    prop.SetTextColour( *wxBLACK );
  else
    prop.SetTextColour( *wxRED );

  SetItem(prop);
} // item_field_edit::set_required_color()
Ejemplo n.º 11
0
BOOL CObjectClassStatistics::EnumDataSources (HPROJECT hPr, BOOL, UINT_PTR *pData)
{
// Namen der Datenquelle besorgen
char cbBuffer[_MAX_PATH];

	DEX_GetDataSourceShortName(hPr, cbBuffer);

// Icon der Datenquelle besorgen
DWORD dwBmp = IMG_DATASOURCE;

	{
	__Interface<ITRiASConnection> Conn;

		if (DEX_GetDataSourcePtr(hPr, *Conn.ppv())) {
		__Interface<ITRiASDatabase> DBase;

			if (SUCCEEDED(Conn -> get_Database (DBase.ppi()))) {
				USES_CONVERSION;

			CComBSTR bstrProgID;		// ProgID des TRiAS-DataBase-TargetObjektes

				if (SUCCEEDED(DBase -> get_Type (&bstrProgID))) {
				__Interface<ITRiASDataServerRegEntries> Entries(CLSID_TRiASDataServerRegEntries);
				__Interface<ITRiASDataServerRegEntry> Entry;

					if (SUCCEEDED(Entries -> FindFromServerProgID (bstrProgID, Entry.ppi()))) 
						Entry -> get_ToolboxBitmap32 ((LONG *)&dwBmp);
				}
			}
		}
	}

// Item in Baum einhängen und mit dummy [+] versehen
	_ASSERTE(0 <= dwBmp && dwBmp < _countof(g_cbBmps));

HTREEITEM hRoot = *reinterpret_cast<HTREEITEM *>(pData);
HTREEITEM hItem = InsertItem(cbBuffer, g_cbBmps[dwBmp], g_cbBmps[dwBmp], hRoot, TVI_LAST);
TV_ITEM tvi;

	tvi.mask = TVIF_HANDLE|TVIF_CHILDREN|TVIF_PARAM;
	tvi.hItem = hItem;
	tvi.cChildren = 1;
	tvi.lParam = reinterpret_cast<LPARAM>(new CDataSourceItemCallback(hPr, hItem));
	SetItem(&tvi);
	return TRUE;
}
Ejemplo n.º 12
0
void LstOdaSrvDetails::InsertHeader(const wxString &Name, 
                                    const wxColor *NameColor,
                                    const wxColor *NameBGColor)
{
    wxListItem ListItem;
    
    ListItem.SetMask(wxLIST_MASK_TEXT);
    
    // Name Column
    ListItem.SetText(Name);
    ListItem.SetColumn(srvdetails_field_name);
    ListItem.SetId(InsertItem(GetItemCount(), ListItem.GetText()));

    ListItem.SetBackgroundColour(*NameBGColor);
    ListItem.SetTextColour(*NameColor);
    SetItem(ListItem);
}
Ejemplo n.º 13
0
void CKadContactListCtrl::UpdateContact(int iItem, const Kademlia::CContact* contact, bool bLocalize)
{
	CString id;
	if (!bLocalize) // update the following fields only if really needed (it's quite expensive to always update them)
	{
		contact->getClientID(&id);
		SetItemText(iItem,colID,id);

		id.Format(_T("%i"),contact->getType());
		SetItemText(iItem,colType,id);

		contact->getDistance(&id);
		SetItemText(iItem,colDistance,id);

		SetItem(iItem,0,LVIF_IMAGE,0,contact->getType()>4?4:contact->getType(),0,0,0,0);
	}
}
Ejemplo n.º 14
0
//*****************************************************************************
//*
//*		SetItemImageEx
//*
//*****************************************************************************
//	Changes the image of an entry
//	hItem		: Is the handle of the item
//	nImage		: Is the new the image number
//	nCol		: Is the column of the item
//	Returns TRUE if the image number was detected or FALSE if an error occurs
BOOL CTreeListCtrl::SetItemImageEx(HTREEITEM hItem, int nImage, int nCol) {
	TVITEM	sItem;



	ASSERT(::IsWindow(m_hWnd));

	sItem.mask		= TVIF_IMAGE | TVIF_SUBITEM;
	sItem.hItem		= hItem;
	sItem.iImage	= nImage;
	sItem.cChildren	= nCol;




	return SetItem(&sItem);
}
Ejemplo n.º 15
0
void CUISpinText::SetCurrentValue(){
	xr_token* tok = GetOptToken();

	while (tok->name){
		AddItem_(tok->name, tok->id);
		tok++;
	}
	xr_string val = GetOptTokenValue();

	for (u32 i = 0; i < m_list.size(); i++)
		if (val == m_list[i]._orig.c_str())
		{
			m_curItem	= i;
			break;
		}

	SetItem();
}
Ejemplo n.º 16
0
void CListProcess::Select(long ndx, bool bSelect)
{
  GetInfo(m_itm,ndx);
  long nState = m_itm.GetState();
  if(bSelect != !!(nState & wxLIST_STATE_SELECTED))
  {
    if(bSelect)
    {
      nState |= wxLIST_STATE_SELECTED;
    }
    else
    {
      nState ^= wxLIST_STATE_SELECTED;
    }
    m_itm.SetState(nState);
    SetItem(m_itm);
  }
}
Ejemplo n.º 17
0
void
TeamDescriptionView::CtrlAltDelPressed(bool keyDown)
{
	if (!(keyDown ^ (fRebootRunner != NULL)))
		return;

	delete fRebootRunner;
	fRebootRunner = NULL;
	fSeconds = 4;

	if (keyDown) {
		Window()->PostMessage(kMsgDeselectAll);
		BMessage tick(kMsgRebootTick);
		fRebootRunner = new BMessageRunner(this, &tick, 1000000LL);
	}

	SetItem(NULL);
}
Ejemplo n.º 18
0
long wxFileCtrl::Add( wxFileData *fd, wxListItem &item )
{
    long ret = -1;
    item.m_mask = wxLIST_MASK_TEXT + wxLIST_MASK_DATA + wxLIST_MASK_IMAGE;
    fd->MakeItem( item );
    long my_style = GetWindowStyleFlag();
    if (my_style & wxLC_REPORT)
    {
        ret = InsertItem( item );
        for (int i = 1; i < wxFileData::FileList_Max; i++)
            SetItem( item.m_itemId, i, fd->GetEntry((wxFileData::fileListFieldType)i) );
    }
    else if ((my_style & wxLC_LIST) || (my_style & wxLC_SMALL_ICON))
    {
        ret = InsertItem( item );
    }
    return ret;
}
Ejemplo n.º 19
0
void CNamingTreeCtrl::ListBindingList(HTREEITEM hItem, CosNaming::NamingContext_ptr pContext, CosNaming::BindingList_var& bl)
{
  try
  {
    for(unsigned int i=0; i < bl->length(); i++)
    {
      // Add each entry into the tree control
      CORBA::Object_var Object = pContext->resolve(bl[i].binding_name);
      bool Context = (bl[i].binding_type == CosNaming::ncontext);
      CNamingObject* pNewObject = new CNamingObject(bl[i].binding_name, Object, Context);
      CString Name;
      const char* pKind = (bl[i].binding_name[0]).kind;
      if(*pKind)
      {
        Name.Format(ACE_TEXT ("%s | %s"), (bl[i].binding_name[0]).id, pKind);
      }
      else
      {
        Name.Format(ACE_TEXT ("%s"), (bl[i].binding_name[0]).id);
      }
      HTREEITEM hContext = InsertItem(Name, hItem);
      SetItemData(hContext, (DWORD)pNewObject);
      switch(bl[i].binding_type)
      {
      case CosNaming::ncontext:
        {
          // Set the children flag so the + button is displayed
          TV_ITEM Item;
          Item.mask = TVIF_CHILDREN | TVIF_HANDLE;
          Item.cChildren = 1;
          Item.hItem = hContext;
          SetItem(&Item);
        }
        break;
      case CosNaming::nobject:
        break;
      }
    }
  }
  catch(CORBA::Exception& ex)
  {
    MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception"));
  }
}
Ejemplo n.º 20
0
BOOL CEnHeaderCtrl::SetItemWidth(int nItem, int nWidth, BOOL bRecalcTooltipRect)
{
	if (nWidth == GetItemWidth(nItem))
		return TRUE;

	HD_ITEM hdi = { 0 };

	hdi.mask = HDI_WIDTH;
	hdi.cxy = nWidth;

	if (SetItem(nItem, &hdi, bRecalcTooltipRect))
	{
		SetTrackedItem(nItem, FALSE);
		return TRUE;
	}

	// else
	return FALSE;
}
Ejemplo n.º 21
0
void CLabelListCtrl::InsertLabel(CP4Label *label, int index)
{
	// Add the data
	LV_ITEM lvItem;
	int iActualItem = -1;
	CString txt;

	ASSERT(label != NULL);
	m_iImage = CP4ViewImageList::VI_LABEL;

	for(int subItem=0; subItem < LABEL_MAXCOL; subItem++)
	{
		lvItem.mask=LVIF_TEXT | 
					((subItem==0) ? LVIF_IMAGE : 0) |
					((subItem==0) ? LVIF_PARAM : 0);

		lvItem.iItem= (subItem==0) ? index : iActualItem;
        ASSERT(lvItem.iItem != -1);
		lvItem.iSubItem= subItem;
		lvItem.iImage = CP4ViewImageList::VI_LABEL;
		lvItem.lParam=(LPARAM) label;

		switch(subItem)
		{
		case LABEL_NAME: 
			lvItem.pszText = const_cast<LPTSTR>( (LPCTSTR) label->GetLabelName()); break;
		case LABEL_OWNER: 
			lvItem.pszText = const_cast<LPTSTR>( (LPCTSTR) label->GetOwner()); break;
		case LABEL_OPTIONS: 
			lvItem.pszText = const_cast<LPTSTR>( (LPCTSTR) label->GetOptions()); break;
		case LABEL_UPDATEDATE: 
			lvItem.pszText = const_cast<LPTSTR>( (LPCTSTR) label->GetDate()); break;
		case LABEL_DESC:
			txt= PadCRs(label->GetDescription());
			lvItem.pszText = const_cast<LPTSTR>( (LPCTSTR) txt); break;
		}
			
		if(subItem==0)
			iActualItem=InsertItem(&lvItem);
		else
			SetItem(&lvItem);
	}
}
Ejemplo n.º 22
0
BOOL CConvertPropsDlg::OnInitDialog()
{
	__super::OnInitDialog();

	AddAnchor(IDC_COMBO1, TOP_LEFT);
	AddAnchor(IDC_EDIT1, TOP_LEFT, TOP_RIGHT);
	AddAnchor(IDC_BUTTON1, TOP_RIGHT);
	AddAnchor(IDC_LIST1, TOP_LEFT, BOTTOM_RIGHT);
	AddAnchor(IDOK, BOTTOM_CENTER);
	AddAnchor(IDCANCEL, BOTTOM_CENTER);

	if(m_fPin)
	{
		m_fcc.AddString(_T("NAME"));
		m_fcc.AddString(_T("LANG"));
		m_fcc.AddString(_T("DESC"));
		m_fcc.AddString(_T("SGRP"));
	}
	else
	{
		m_fcc.AddString(_T("TITL"));
		m_fcc.AddString(_T("AUTH"));
		m_fcc.AddString(_T("RTNG"));
		m_fcc.AddString(_T("CPYR"));
		m_fcc.AddString(_T("DESC"));
	}

	m_list.InsertColumn(0, _T("ID"), LVCFMT_LEFT, 75);
	m_list.InsertColumn(1, _T("Text"), LVCFMT_LEFT, 280);

	m_list.SetExtendedStyle(m_list.GetExtendedStyle()|LVS_EX_FULLROWSELECT);

	POSITION pos = m_props.GetStartPosition();
	while(pos)
	{
		CString key, value;
		m_props.GetNextAssoc(pos, key, value);
		SetItem(key, value);
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void CImageTreeCtrl::OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult) 
{
	TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
	TVITEM & item = pTVDispInfo->item;
	*pResult = 1;

	if(item.pszText && CanSetLabelText(item)) {
		if (UpdateDataToDB())
		{
		// item.pszText=m_name_new.GetBuffer();
		} 
		else
		{
		item.pszText=m_name_old.GetBuffer();
		}
		SetItem(&item);
		*pResult = 0;
	}
}
Ejemplo n.º 24
0
/////////////////////////////////////////////////////////////////////////////
// CHeaderCtrlEx メッセージ ハンドラ
int CHeaderCtrlEx::SetSortImage( int nCol, BOOL bAsc )
{
    int nPrevCol = m_nSortCol;

    m_nSortCol = nCol;
    m_bSortAsc = bAsc;

    // Change the item to ownder drawn
    HD_ITEM hditem;

    hditem.mask = HDI_FORMAT;
    GetItem( nCol, &hditem );
    hditem.fmt |= HDF_OWNERDRAW;
    SetItem( nCol, &hditem );

    // Invalidate header control so that it gets redrawn
    Invalidate();
    return nPrevCol;
}
Ejemplo n.º 25
0
void COptionsList::AddCheckItemEx(LPCTSTR lpItemText, LPCTSTR lpSubItemText, BOOL *pValueStorage, BOOL *pLinkedValue, int nLinkType)
{
	AddCheckItem(lpItemText, pValueStorage, pLinkedValue, nLinkType);
	if(m_bTwoColumns == FALSE) return;

	ASSERT(lpSubItemText != NULL); if(lpSubItemText == NULL) return;

	LV_ITEM lvi;

	ZeroMemory(&lvi, sizeof(LV_ITEM));

	lvi.mask = LVIF_TEXT;
	lvi.iItem = GetItemCount() - 1;
	lvi.iSubItem = 1;
	lvi.pszText = (LPTSTR)lpSubItemText;
	lvi.cchTextMax = static_cast<int>(_tcslen(lpSubItemText));

	SetItem(&lvi);
}
Ejemplo n.º 26
0
//重画函数
void CSkinHeaderCtrl::OnPaint() 
{
	//获取位置
	CRect ClientRect;
	GetClientRect(&ClientRect);

	//设置自画
	HD_ITEM HDItem;
	HDItem.mask=HDI_FORMAT;
	int iItemCount=GetItemCount();
	for (int i=0;i<iItemCount;i++)
	{
		GetItem(i,&HDItem);
		HDItem.fmt|=HDF_OWNERDRAW;
		SetItem(i,&HDItem);
	}

	//建立缓冲图
	CBitmap BufferBmp;
	CClientDC ClientDC(this);
	BufferBmp.CreateCompatibleBitmap(&ClientDC,ClientRect.Width(),ClientRect.Height());
	m_BufferDC.CreateCompatibleDC(&ClientDC);
	m_BufferDC.SelectObject(&BufferBmp);
	m_BufferDC.SetBkMode(TRANSPARENT);
	m_BufferDC.SetTextColor(m_SkinAttribute.m_crHeadText);
	m_BufferDC.SelectObject(CSkinResourceManager::m_DefaultFont);

	//加载位图
	CImageHandle ImageHandle(&m_SkinAttribute.m_ImageHead);
	if (ImageHandle.IsResourceValid())
	{
		ImageHandle->StretchBlt(m_BufferDC,ClientRect.left,ClientRect.top,ClientRect.Width(),ClientRect.Height());
		m_BufferDC.Draw3dRect(ClientRect.left,ClientRect.top,ClientRect.Width(),ClientRect.Height(),RGB(0,0,0),RGB(0,0,0));
		Default();
	}
	
	//绘画界面
	ClientDC.BitBlt(0,0,ClientRect.Width(),ClientRect.Height(),&m_BufferDC,0,0,SRCCOPY);
	m_BufferDC.DeleteDC();
	BufferBmp.DeleteObject();
	
	return;
}
Ejemplo n.º 27
0
	BOOL CMSMdxCfgSequences::CreateTree(	CMSMdxTreeNode* pParent, 
		HWND hTree, HTREEITEM hRoot )
	{
		TVINSERTSTRUCT tvInsert;
		ZeroMemory(&tvInsert,sizeof(TVINSERTSTRUCT));

		tvInsert.hParent = hRoot;
		tvInsert.hInsertAfter = NULL;
		tvInsert.item.mask = TVIF_TEXT|TVIF_PARAM;
		tvInsert.item.pszText = LPWSTR(GetText());
		tvInsert.item.lParam = (LPARAM)this;
		HTREEITEM hChild = TreeView_InsertItem(hTree,&tvInsert);
		SetItem( hChild );
		SetParent( pParent );

		for( int i = 0; i < m_vectorSequence.size(); i++ )
			m_vectorSequence[i]->CreateTree( this, hTree, hChild );
		m_hRootItem = hChild;
		return TRUE;
	}
Ejemplo n.º 28
0
/*===========================================================================
 *
 * Class CSrBatchListCtrl Event - void OnLButtonDown (nFlags, Point);
 *
 *=========================================================================*/
void CSrBatchListCtrl::OnLButtonDown (UINT nFlags, CPoint Point) {
  LVHITTESTINFO HitTest;
  int		Result;

  CListCtrl::OnLButtonDown(nFlags, Point);

  HitTest.pt    = Point;
  HitTest.flags = 0;
  HitTest.iItem = -1;

  Result = SubItemHitTest(&HitTest);

  if (Result < 0) {
    GetParent()->SendMessage(ID_BATCHEDIT_MSG_UPDATE, -1, 0);
    return;
  }
  
  SetItem(Result, 0, LVIF_STATE, "", 0, LVIS_SELECTED, LVIS_SELECTED, 0);
  GetParent()->SendMessage(ID_BATCHEDIT_MSG_UPDATE, Result, 0);
}
Ejemplo n.º 29
0
void wxWebUpdateListCtrl::OnCacheSizeComplete(wxCommandEvent &ev)
{
    wxArrayLong *arr = (wxArrayLong *)ev.GetClientData();

    for (int i=0; i<(int)m_arrRemotePackages.GetCount(); i++)
        m_arrRemotePackages[i].GetDownload().SetDownloadSize(arr->Item(i));
    delete arr;

    // modify the items currently shown
    for (int j=0; j < GetItemCount(); j++) {

        const wxWebUpdatePackage &p = GetRemotePackage(GetItemText(j));
        wxASSERT_MSG(p.GetDownload().IsDownloadSizeCached(),
                    wxS("Why does this item has not a cached size ?"));
        unsigned long bytesize = p.GetDownload().GetDownloadSize();
        SetItem(j, 3, wxGetSizeStr(bytesize));
    }

    wxLogAdvMsg(wxS("wxWebUpdateListCtrl::OnCacheSizeComplete - sizes cached"));
}
Ejemplo n.º 30
0
// Clears text and images located in all cells of a particular item
void LstOdaServerList::ClearItemCells(long item)
{
    int ColumnCount;
    wxListItem ListItem;
    
    ListItem.m_itemId = item;
    ListItem.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE;
    ListItem.m_text = wxT("");
    ListItem.m_image = -1;
    
    ColumnCount = GetColumnCount();
    
    // iterate through each column, resetting everything to 'nothing'
    for (int i = 0; i < ColumnCount; ++i)
    {
        ListItem.m_col = i;
        
        SetItem(ListItem);
    }
}