void ResultCheckListCtrl::OnUnselectAll(wxCommandEvent& WXUNUSED(event))
{
    long Item = -1;
    if(GetSelectionCount() == 1)
    {
        //If user has selected only 1 item, that apply to all files
        for ( ;; )
        {
            Item = GetNextItem(Item);
            if(Item == -1)
                break;
            SetItemImage(Item, 1);
        }
    }
    else
    {
        //If user has selected more than 1 item, that apply to selected files
        for ( ;; )
        {
            Item = GetNextItem(Item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
            if(Item == -1)
                break;
            SetItemImage(Item, 1);
        }
    }
}
示例#2
0
void CHostList::OnLButtonDblClk(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	do 
	{
		POSITION pos = GetFirstSelectedItemPosition();
		int index = GetNextSelectedItem(pos);

		if (index < 0)
		{
			break;
		}

		if (GetItemData(index) == 0)
		{
			int nImage = GetItemImage(index,0);
			CString szGName = GetItemText(index,0);

			if (nImage == 1)
			{
				SetItemImage(index,0,2);
				InsertGroupsClient(index,m_GroupsMap[(LPCTSTR)szGName]);
			}
			else
			{
				SetItemImage(index,0,1);
				DeleteGroupsClient(index,m_GroupsMap[(LPCTSTR)szGName]);
			}
		}
	} while (FALSE);

	_MouseClkMonitor(WM_LBUTTONDBLCLK, nFlags, point, TRUE);
}
示例#3
0
void SymbolTree::UpdateGuiItem(TagEntry& data, const wxString& key)
{
	if (!m_tree)
		return;

	TagNode* node = m_tree->Find(key);
	if ( node ) {
		// Update the new data with the gui tree item id
		data.SetTreeItemId( node->GetData().GetTreeItemId() );
		node->SetData(data);

		// Update Icon if needed
		int iconIndex = GetItemIconIndex(data.GetKind(), data.GetAccess());
		int curIconIndex = -1;
		wxTreeItemId itemId = node->GetData().GetTreeItemId();
		if (itemId.IsOk()) {
			curIconIndex = GetItemImage(itemId);
			if (curIconIndex != iconIndex ) {
				// Need to update the image as well
				SetItemImage(node->GetData().GetTreeItemId(), iconIndex);
				SetItemImage(node->GetData().GetTreeItemId(), iconIndex, wxTreeItemIcon_Selected);

			} // if(curIconIndex != iconIndex )
			//update the linenumber and file
			MyTreeItemData *item_data = new MyTreeItemData(data.GetFile(), data.GetPattern());
			wxTreeItemData *old_data = GetItemData(itemId);
			if (old_data)
				delete old_data;
			SetItemData(itemId, item_data);
		}
	}
}
示例#4
0
CLocalTreeView::CLocalTreeView(wxWindow* parent, wxWindowID id, CState *pState, CQueueView *pQueueView)
	: wxTreeCtrlEx(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_EDIT_LABELS | wxTR_LINES_AT_ROOT | wxTR_HAS_BUTTONS | wxNO_BORDER),
	CSystemImageList(16),
	CStateEventHandler(pState),
	m_pQueueView(pQueueView)
{
	wxGetApp().AddStartupProfileRecord(_T("CLocalTreeView::CLocalTreeView"));
#ifdef __WXMAC__
	SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
#endif

	pState->RegisterHandler(this, STATECHANGE_LOCAL_DIR);
	pState->RegisterHandler(this, STATECHANGE_APPLYFILTER);

	SetImageList(GetSystemImageList());

#ifdef __WXMSW__
	m_pVolumeEnumeratorThread = 0;

	CreateRoot();
#else
	wxTreeItemId root = AddRoot(_T("/"));
	SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Normal);
	SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_Selected);
	SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Expanded);
	SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_SelectedExpanded);

	SetDir(_T("/"));
#endif

	SetDropTarget(new CLocalTreeViewDropTarget(this));
}
void
JXCurrentPathMenu::SetPath
	(
	const JCharacter* path
	)
{
	RemoveAllItems();

	JString p = path;
	JCleanPath(&p);

	JString p1, n;
	while (!JIsRootDirectory(p))
		{
		JStripTrailingDirSeparator(&p);
		JSplitPathAndName(p, &p1, &n);
		PrependItem(n);
		SetItemImage(1, GetIcon(p), kJFalse);
		p = p1;
		}

	PrependItem(p);
	SetItemImage(1, GetIcon(p), kJFalse);

	const JXImage* image = NULL;
	GetItemImage(GetItemCount(), &image);
	SetTitle(GetItemText(GetItemCount()), const_cast<JXImage*>(image), kJFalse);
	SetUpdateAction(kDisableNone);
}
//---------------------------------------------------------
void CData_Source_PgSQL::Update_Source(const wxTreeItemId &Item)
{
	CData_Source_PgSQL_Data	*pData	= Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;

	if( pData->Get_Type() != TYPE_SOURCE )
	{
		return;
	}

	Freeze();

	DeleteChildren(Item);

	//-----------------------------------------------------
	if( !pData->is_Connected() )
	{
		SetItemImage(Item, IMG_SRC_CLOSED, wxTreeItemIcon_Normal);
		SetItemImage(Item, IMG_SRC_CLOSED, wxTreeItemIcon_Selected);
	}
	else
	{
		SetItemImage(Item, IMG_SRC_OPENED, wxTreeItemIcon_Normal);
		SetItemImage(Item, IMG_SRC_OPENED, wxTreeItemIcon_Selected);

		CSG_Table	Tables;

		RUN_MODULE(DB_PGSQL_Table_List, false,	// CTable_List
				SET_PARAMETER("CONNECTION", pData->Get_Value())
			&&	SET_PARAMETER("TABLES"    , &Tables)
		);

		Tables.Set_Index(1, TABLE_INDEX_Ascending, 0, TABLE_INDEX_Ascending);

		for(int i=0; i<Tables.Get_Count(); i++)
		{
			CSG_String	s(Tables[i].asString(1));

			TSG_Shape_Type	Shape;
			TSG_Vertex_Type	Vertex;

			if( CSG_Shapes_OGIS_Converter::to_ShapeType(s, Shape, Vertex) )
			{
				switch( Shape )
				{
				case SHAPE_TYPE_Point:   Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_POINT  ); break;
				case SHAPE_TYPE_Points:  Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_POINTS ); break;
				case SHAPE_TYPE_Line:    Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_LINE   ); break;
				case SHAPE_TYPE_Polygon: Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_POLYGON); break;
				}
			}
			else if( !s.Cmp("RASTER" ) ) Append_Table(Item, Tables[i].asString(0), TYPE_GRIDS , IMG_GRIDS  );
			else if( !s.Cmp("TABLE"  ) ) Append_Table(Item, Tables[i].asString(0), TYPE_TABLE , IMG_TABLE  );
		}

		Expand(Item);
	}

	Thaw();
}
示例#7
0
 wxTreeItemId HierTreeCtrl::AppendDirectory(wxTreeItemId& destination, const char *text)
 {
     wxTreeItemId newItem;
     newItem = AppendItem(destination, wxString::FromUTF8(text));
     SetItemData(newItem, new HierTreeItemData(true));
     SetItemImage(newItem, 6, wxTreeItemIcon_Normal);
     SetItemImage(newItem, 7, wxTreeItemIcon_Expanded);
     return newItem;
 }
示例#8
0
void CLocalTreeView::OnSelectionChanging(wxTreeEvent& event)
{
	// On-demand open icon for selected items
	wxTreeItemId item = event.GetItem();
	if (GetItemImage(item, wxTreeItemIcon_Selected) == -1)
	{
		int icon = GetIconIndex(opened_dir, GetDirFromItem(item));
		SetItemImage(item, icon, wxTreeItemIcon_Selected);
		SetItemImage(item, icon, wxTreeItemIcon_SelectedExpanded);
	}
}
示例#9
0
void browsers::TDTbrowser::collectChildren(laydata::TDTHierTree *root, wxTreeItemId& lroot) {
   laydata::TDTHierTree* Child= root->GetChild();
   wxTreeItemId nroot;
   while (Child) {
      SetItemImage(lroot,0,wxTreeItemIcon_Normal);
      SetItemImage(lroot,1,wxTreeItemIcon_Expanded);
      nroot = AppendItem(lroot, wxString(Child->GetItem()->name().c_str()));
      SetItemTextColour(nroot,*wxLIGHT_GREY);
      collectChildren(Child, nroot);
      Child = Child->GetBrother();
	}
}
示例#10
0
void wxSpinTreeCtrl::UpdateTreeItemIcon(wxTreeItemId id)
{
    wxSpinTreeItemData *treeData = (wxSpinTreeItemData*)GetItemData(id);
    if ((!treeData) || (!treeData->m_pNode.valid()))
        return;
    if (treeData->m_pNode->nodeType == "GroupNode")
        SetItemImage(id, 1, wxTreeItemIcon_Normal);
    else if (treeData->m_pNode->nodeType == "ShapeNode")
        SetItemImage(id, wxTreeItemIcon_Normal);
    else
        SetItemImage(id, 0, wxTreeItemIcon_Normal);
}
示例#11
0
void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item)
{
    int image = (GetItemImage(item) == TreeCtrlIcon_Folder)
                    ? TreeCtrlIcon_File
                    : TreeCtrlIcon_Folder;
    SetItemImage(item, image, wxTreeItemIcon_Normal);

    image = (GetItemImage(item) == TreeCtrlIcon_FolderSelected)
                    ? TreeCtrlIcon_FileSelected
                    : TreeCtrlIcon_FolderSelected;
    SetItemImage(item, image, wxTreeItemIcon_Selected);
}
示例#12
0
BOOL CTreeOptionsCtrlEx::SetRadioButton(HTREEITEM hParent, int nIndex)
{
	//Validate our parameters
	ASSERT(IsGroup(hParent)); //Parent item must be a group item

	//Iterate through the child items and turn on the specified one and turn off all the other ones
	HTREEITEM hChild = GetNextItem(hParent, TVGN_CHILD);

	//Turn of redraw to Q all the changes we're going to make here
	SetRedraw(FALSE);

	int i=0;
	BOOL bCheckedSomeItem = FALSE;
	while (hChild)
	{
		//if we reach a non radio button then break out of the loop
		if (!IsRadioButton(hChild))
			break;

		if (i == nIndex)
		{
			//Turn this item on
			BOOL bOldState;
			GetRadioButton(hChild, bOldState);
			VERIFY(SetItemImage(hChild, 3, 3));
			bCheckedSomeItem = TRUE;
			if (!bOldState)
				NotifyParent(BN_CLICKED, hChild);
		}
		else
		{
			BOOL bEnable;
			VERIFY(GetRadioButtonEnable(hChild, bEnable));

			//Turn this item off
			if (bEnable)
				VERIFY(SetItemImage(hChild, 2, 2));
			else
				VERIFY(SetItemImage(hChild, 4, 4));
		}

		//Move on to the next item
		hChild = GetNextItem(hChild, TVGN_NEXT);
		++i;
	}
	ASSERT(bCheckedSomeItem); //You specified an index which does not exist

	//Reset the redraw flag
	SetRedraw(TRUE);

	return TRUE;
}
BOOL CTreeOptionsCtrlEx::SetRadioButton(HTREEITEM hItem)
{
	//Validate our parameters
	ASSERT(IsRadioButton(hItem)); //Must be a radio item to check it

	//Iterate through the sibling items and turn them all off except this one
	HTREEITEM hParent = GetNextItem(hItem, TVGN_PARENT);
	ASSERT(IsGroup(hParent)); //Parent item must be a group item

	//Iterate through the child items and turn on the specified one and turn off all the other ones
	HTREEITEM hChild = GetNextItem(hParent, TVGN_CHILD);

	//Turn of redraw to Q all the changes we're going to make here
	SetRedraw(FALSE);

	while (hChild)
	{
		//if we reach a non radio button then break out of the loop
		if (!IsRadioButton(hChild))
			break;

		if (hChild == hItem)
		{
			//Turn this item on
			BOOL bOldState;
			GetRadioButton(hChild, bOldState);
			BOOL bSuccess = SetItemImage(hChild, 3, 3);
			ASSERT(bSuccess);
			if (!bOldState)
				NotifyParent(BN_CLICKED, hChild);
		}
		else
		{
			BOOL bEnable;
			VERIFY(GetRadioButtonEnable(hChild, bEnable));

			//Turn this item off
			if (bEnable)
				VERIFY(SetItemImage(hChild, 2, 2));
			else
				VERIFY(SetItemImage(hChild, 6, 6));
		}

		//Move on to the next item
		hChild = GetNextItem(hChild, TVGN_NEXT);
	}

	//Reset the redraw flag
	SetRedraw(TRUE);

	return TRUE;
}
示例#14
0
void browsers::CellBrowser::copyItem(const wxTreeItemId item, const wxTreeItemId newparent) {
   wxTreeItemId newitem = AppendItem(newparent, GetItemText(item));
   SetItemImage(newitem, GetItemImage(item,wxTreeItemIcon_Normal), wxTreeItemIcon_Normal);
   SetItemImage(newitem, GetItemImage(item,wxTreeItemIcon_Expanded), wxTreeItemIcon_Expanded);
   SetItemImage(newparent,0,wxTreeItemIcon_Normal);
   SetItemImage(newparent,1,wxTreeItemIcon_Expanded);
   SetItemTextColour(newitem, GetItemTextColour(newparent));
   wxTreeItemIdValue cookie;
   wxTreeItemId child = GetFirstChild(item,cookie);
   while (child.IsOk()) {
      copyItem(child, newitem);
      child = GetNextChild(item,cookie);
   }
}
示例#15
0
void CZoneTree::ConvertMobToIndex(HTREEITEM &hItem, HTREEITEM &hNewItem, HTREEITEM &htiNewParent)
{
	int x;
	HTREEITEM par;

	GetItemImage(htiNewParent, x, x);

	switch(x) {
	case PEOPLE:
		room_data *room;
		mob_index *mob;
					
		par = GetParentItem(htiNewParent);
		room = (room_data*)GetItemData(par);
					
		if(room) {
			mob = room->AddPerson((mob_data*)GetItemData(hItem));
			mob->m_tThis = hNewItem;
		}
					
		SetItemImage(hNewItem, MOB_INDEX, MOB_INDEX);
		SetItemData(hNewItem, (DWORD)mob);
		break;
	}
}
示例#16
0
void wxGISCheckList::SetItemCheckState(long item, int nState)
{
    LPITEM_DATA pdata = (LPITEM_DATA)wxListView::GetItemData(item);
    pdata->nCheckState = nState;
    bool bCheck = pdata->nCheckState != 0;
    SetItemImage(item, bCheck == true ? 1 : 0, bCheck == true ? 1 : 0);
}
示例#17
0
void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item)
{
    int image = GetItemImage(item) == TreeCtrlIcon_Folder ? TreeCtrlIcon_File
                                                          : TreeCtrlIcon_Folder;

    SetItemImage(item, image);
}
示例#18
0
void CSitesWnd::UpdateSite(fsSiteInfo *pSite)
{
	LVFINDINFO fi;
	fi.flags = LVFI_PARAM;
	fi.lParam = (LPARAM)pSite;
	int iItem = FindItem (&fi);
	if (iItem == -1)
		return;

	SetItemText (iItem, 0, pSite->strName);

	CString str, strConn;
	if (pSite->cMaxConns != UINT_MAX)
		str.Format ("%d", pSite->cMaxConns);
	else
		str = "+";
	strConn.Format ("%d/%s", pSite->cConnsNow, str);
	SetItemText (iItem, 1, strConn);

	SetItemText (iItem, 2, pSite->strUser == NULL ? "" : pSite->strUser);

	if (pSite->pGroup)
	{
		if (pSite->pGroup->nId == GRP_OTHER_ID)
			SetItemText (iItem, 3, LS (L_OTHER));
		else
			SetItemText (iItem, 3, pSite->pGroup->strName);
	}
	else
		SetItemText (iItem, 3, "");

	SetItemImage (iItem, pSite->bTemp ? 1 : 0);
}
示例#19
0
void ctlCheckTreeView::SetParentImage(wxTreeItemId node, int newimage)
{
	if (node.IsOk())
	{
		SetItemImage(node, newimage);
		SetParentImage(GetItemParent(node), newimage);
	}
}
示例#20
0
void CDownloads_Groups::UpdateDeletedIcon()
{
	int img = _DldsMgr.Get_DeletedDownloadCount () ? 7 : 6;
	int imgold;
	GetItemImage (m_hDeleted, imgold, imgold);
	if (img != imgold)
		SetItemImage (m_hDeleted, img, img);
}
示例#21
0
 wxTreeItemId HierTreeCtrl::AppendFile(wxTreeItemId& destination, const char *text)
 {
     wxTreeItemId newItem;
     newItem = AppendItem(destination, wxString::FromUTF8(text));
     SetItemData(newItem, new HierTreeItemData(false));
     SetItemImage(newItem, 8, wxTreeItemIcon_Normal);
     return newItem;
 }
示例#22
0
void CFileTreeCtrl::setImage(HTREEITEM hItem, CString &sPath, DWORD uiAction)
{
    if(sPath.CompareNoCase(EMPTYITEM) == 0)
        return;

    if(hItem == m_hRoot)
    {
        // Load My Computer Icon
        LPITEMIDLIST pidl = NULL;
        SHGetSpecialFolderLocation(m_hWnd, CSIDL_DRIVES, &pidl);

        if (pidl != NULL)
        {
            SHFILEINFO shfi;
            ZeroMemory(&shfi, sizeof(shfi));

            LPMALLOC pMalloc;
            SHGetMalloc (&pMalloc);

            SHGetFileInfo((LPCTSTR)pidl, 0, &shfi, sizeof(shfi),
                SHGFI_PIDL | SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);

            SetItemImage(hItem, shfi.iIcon, shfi.iIcon);

            if(pidl)
                pMalloc->Free (pidl);

            pMalloc->Release();
        }
    }
    else
    {
        SHFILEINFO shfi;
        ZeroMemory(&shfi, sizeof(shfi));

        SHGetFileInfo(sPath, FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi),
            SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);

        if(shfi.hIcon != NULL)
            DestroyIcon(shfi.hIcon);

        SetItemImage(hItem, shfi.iIcon, shfi.iIcon);
    }

}
示例#23
0
void CSpiderTaskTree::OnDldWillBeDeleted(vmsDownloadSmartPtr dld)
{
	int iIndex = FindDownload (dld);
	if (iIndex == -1)
		return;

	int iImage = dld->pMgr->IsDone () ? 1 : 6;
	SetItemImage (m_vConfs [iIndex].hItem, iImage, iImage);
}
示例#24
0
void CSpiderTaskTree::UpdateDownload(vmsDownloadSmartPtr dld)
{
	int iIndex = FindDownload (dld);
	if (iIndex == -1)
		return;

	int iImage = GetDownloadImage (m_vConfs [iIndex].wptree->GetData ());
	SetItemImage (m_vConfs [iIndex].hItem, iImage, iImage);
}
示例#25
0
void
JXPathHistoryMenu::UpdateMenu()
{
	if (GetFirstIndex() == 1)
		{
		JMountPointList list(JPtrArrayT::kDeleteAll);
		time_t t;
		if (JGetUserMountPointList(&list, &t))
			{
			const JSize count = list.GetElementCount();
			SetFirstIndex(count+1);

			for (JIndex i=count; i>=1; i--)
				{
				const JMountPoint mp = list.GetElement(i);
				PrependItem(*(mp.path));
				if (i == count)
					{
					ShowSeparatorAfter(1);
					}

				if (mp.type == kJHardDisk)
					{
					SetItemImage(1, jx_hard_disk_small);
					}
				else if (mp.type == kJZipDisk)
					{
					SetItemImage(1, jx_zip_disk_small);
					}
				else if (mp.type == kJFloppyDisk)
					{
					SetItemImage(1, jx_floppy_disk_small);
					}
				else if (mp.type == kJCDROM)
					{
					SetItemImage(1, jx_cdrom_disk_small);
					}
				}
			}
		}

	RemoveInvalidPaths();
	JXStringHistoryMenu::UpdateMenu();
}
bool ResultCheckListCtrl::SetIcon(long& item)
{
    bool Ret = true;

    wxListItem l_item;
    l_item.SetId(item);
    GetItem(l_item);
    wxString l_text = l_item.GetText();

    if(l_item.GetImage() == 0)
    {
        Engine::CEngine::Instance()->SetUnselectedInputPlugs(std::string(l_text.ToAscii()));
        SetItemImage(item, 1);
    }
    else
        SetItemImage(item, 0);

    return Ret;
}
void
JXTextMenu::SetItemImage
	(
	const JIndex	index,
	const JXPM&		data
	)
{
	JXImage* image = GetDisplay()->GetImageCache()->GetImage(data);
	if (image->GetXColormap() == GetColormap())
		{
		SetItemImage(index, image, kJFalse);
		}
	else
		{
		JXImage* image = jnew JXImage(GetDisplay(), data);
		assert( image != NULL );
		SetItemImage(index, image, kJTrue);
		}
}
示例#28
0
void CTreeView::UpdateIndicator()
{
	HTREEITEM hItem = m_hCurrentItem;
	int img = m_iRun + m_runIndex;
	while (hItem)
	{
		SetItemImage(hItem, img);
		hItem = GetParentItem(hItem);
	}
}
示例#29
0
BOOL CReportCtrl::SwapItems(int nItem1, int nItem2)
{
	EndEdit(TRUE);
	if(!_IsValidIndex(nItem1) || !_IsValidIndex(nItem2))
	{
		return(FALSE);
	}

	if(nItem1 == nItem2)
	{
		return(TRUE);
	}

	_UnsetSortedColumn();

	// record previous states first
	const DWORD STATES1 = GetItemStates(nItem1);
	const DWORD STATES2 = GetItemStates(nItem2);
	const DWORD DATA1 = CListCtrl :: GetItemData(nItem1);
	const DWORD DATA2 = CListCtrl :: GetItemData(nItem2);

	// swap item texts and images
	for(int i = 0; i < GetColumnCount(); i++)
	{
		CString str = GetItemText(nItem1, i);
		CListCtrl :: SetItemText(nItem1, i, GetItemText(nItem2, i));
		CListCtrl :: SetItemText(nItem2, i, str);

		UINT	nImg = GetItemImage(nItem1, i);
		SetItemImage(nItem1, i, GetItemImage(nItem2, i));
		SetItemImage(nItem2, i, nImg);
	}

	// swap item data
	CListCtrl :: SetItemData(nItem1, DATA2);
	CListCtrl :: SetItemData(nItem2, DATA1);

	// restore states
	SetItemStates(nItem1, STATES2);
	SetItemStates(nItem2, STATES1);

	return(TRUE);
}
示例#30
0
void CTreeView::RemoveIndicator()
{
	HTREEITEM hItem = m_hCurrentItem;
	while (hItem)
	{
		SetItemImage(hItem, m_iEmpty);
		hItem = GetParentItem(hItem);
	}
	m_hCurrentItem = nullptr;
}