|
|
Comments and Discussions
|
|
 |

|
Can some one help me with an ocx file of this cute code so that the same can be used in VB6 for saving and retrieving data from .mdb file.
|
|
|
|

|
First, I want to say, this code is really really excellent.
I try to update the supergrid in run-time, such as, add or delete some columns, so first i call the function of SuperGrid "DeleteAll" but it just deletes items of list, not include columns. And then i modified the code in "CMySuperGrid" function "_DeleteAll"by the codes below:
void CMySuperGrid::_DeleteAll()
{
DeleteAll(); CHeaderCtrl* pHeader=this->GetHeaderCtrl();
int i, nCount=pHeader->GetItemCount();
for(i=nCount-1; i>=0; i--)
pHeader->DeleteItem(i);
LPTSTR lpszCols[] = {_T("Tree thing"),_T("Column #1"),_T("Column #2"),_T("Column #3"),_T("Column #4"),_T("Column #5"),0};
LV_COLUMN lvColumn;
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 200;
for(int x = 0; lpszCols[x]!=NULL; x++)
{
if(x)
lvColumn.cx = 150;
lvColumn.pszText = lpszCols[x];
InsertColumn(x,&lvColumn);
}
CItemInfo* lp = new CItemInfo();
lp->SetImage(4);
lp->SetItemText(_T("New data"));
CTreeItem * pRoot = InsertRootItem(lp); if( pRoot == NULL )
return;
int nCol = GetNumCol();
for(i=0; i < nCol; i++)
{
CItemInfo* lpItemInfo = new CItemInfo();
CString strItem;
strItem.Format(_T("Item %d"),i);
lpItemInfo->SetItemText(strItem);
for(int y=0;y < nCol-1; y++)
{
CString str;
str.Format(_T("subItem %d of %s"),y,lpItemInfo->GetItemText());
lpItemInfo->AddSubItemText(str);
lpItemInfo->AddSubItemText(str);
}
CTreeItem* pParent = InsertItem(pRoot, lpItemInfo);
if(i%nCol)
{
CTreeItem* pParent1=NULL;
CTreeItem* pParent2=NULL;
for(int x=0; x < nCol; x++)
{
CItemInfo* lpItemInfo = new CItemInfo();
CString strItem;
strItem.Format(_T("Item %d"),x);
lpItemInfo->SetItemText(strItem);
for(int z=0; z < nCol-1; z++)
{
CString str;
str.Format(_T("subItem %d of %s"),z, lpItemInfo->GetItemText());
lpItemInfo->AddSubItemText(str);
}
pParent1 = InsertItem(pParent, lpItemInfo);
}
}
}
Expand(pRoot, 0 );
UINT uflag = LVIS_SELECTED | LVIS_FOCUSED;
SetItemState(0, uflag, uflag);
}
but after this, readd columns and items, it shows some different, after drawing, there are columns at the end of the this new columns i created. how could i recreate the columns and items.
modified 20 Nov '11 - 13:34.
|
|
|
|

|
cool, nice work.
cheers Allan
|
|
|
|

|
i Get Icon of a process and i don't know to add it to SuperList
m_List.SetImageList (CImageList::FromHandle (GetSystemImageList (FALSE)), LVSIL_NORMAL);
HIMAGELIST CTreeListDlg::GetSystemImageList(BOOL bLarge)
{
SHFILEINFO sfi;
UINT uFlag = bLarge ? SHGFI_LARGEICON : SHGFI_SMALLICON;
return (HIMAGELIST) SHGetFileInfo (TEXT (""), NULL, &sfi, sizeof (sfi), SHGFI_SYSICONINDEX | uFlag);
}
int CShowProcessTree::GetIcon(LPTSTR szPath, UINT uFlags)
{
SHFILEINFO sfi;
SHGetFileInfo (szPath, NULL, &sfi, sizeof (sfi), SHGFI_SYSICONINDEX | uFlags);
return sfi.iIcon;
}
i saw your function SetImage(index) to get index Image from BitMap
but how to add Icon Process to...when i got icon of it?
i added successful in Tree..but when i use your control...i don't know how
can you give me a funtion to add Icon (i got from SystemIcon of that Process)
thanks so much
sorry if my english is not good
|
|
|
|

|
I'm looking for a way to group edit boxes with labels. I want to keep it simple. I could use a grid if I needed to, but this looks a lot cleaner.
Thanks!
|
|
|
|

|
can u please explain me how to do the same in dialog based application?I have seen how to use the SuperGrid in dialog based application.But there is no check boxes available for items in dialog .Also I don't want the image icons.Can u please guide me how to achieve these things?
modified on Thursday, July 3, 2008 12:50 AM
|
|
|
|

|
before go into DrawItem(), I set the column with the item's length in LVN_GETDISPINFO process function OnGetDispInfo().
But there are some problem in DrawItem() that i can't find the reason.
[problem]
suppose i have follow data:
[+]ICON aaa
[+]ICON aaaa
[+]ICON aaaaa
DrawItem() first:
[+]ICON aaa
DrawItem() second:
[+]ICON aaa
___________a // before 'a', nothing
DrawItem() third:
[+]ICON aaa
___________a // before 'a', nothing
____________a // before 'a', nothing
have some idea? Thank you very much!
Follow the C++ technical
|
|
|
|

|
Hi
this is really fantastic control. I really like this.
Does this support multiple column sorting....
sharath b
"The world's biggest power is the youth and beauty of a woman."
|
|
|
|

|
It looks so good.
|
|
|
|

|
my data is dynamic load from database,and i have carried it out only in the this
control.
my problem is i used the tree to control the data display in the list
tree control.On this way,i selchanged on the my tree control need display the data
in the list tree.at first,In my tree control selchange function i used the
deleteAll() function to delete the list tree all items and display the new
data.when i use the deleteall function the program will be intermitted. when i
used the DeleteAllItems() function to delete the list tree data,itself delete the
child node and display the child node function will be error.it display the data
not right.
like this:
+Root1
+Root2
+Root3
expend the Root1 then Root2 node will be delete and collapsed the Root1 it can't
delete itself children.
someone can help me or give me some suggestion,thanks
|
|
|
|

|
Hi,
This is fantastic and just what I need. However, I'm using VB6 to write my app (loads of very good reasons for that which I won't go into). Do you have the control compiled as an OCX?
Cheers,
Mike May
|
|
|
|

|
Settting the check in a root level item does not work. For example the following code addition to the demo (InitializeGrid method) fails to set the check:
CItemInfo* lp = new CItemInfo();
lp->SetCheck(1);
lp->SetImage(4);
//add item text
lp->SetItemText(_T("Hello World"));
//add subitem text
lp->AddSubItemText(_T("Happy"));
....
I'm hunting this bug down now...
faraz
|
|
|
|

|
To fix: In CSuperGridCtrl::InsertRootItem(CItemInfo * lpInfo) starting line 1488: CItemInfo* lp = GetData(pRoot); LV_ITEM lvItem; lvItem.mask = LVIF_TEXT | LVIF_INDENT | LVIF_PARAM; CString strItem = lp->GetItemText(); lvItem.pszText = strItem.GetBuffer(1); lvItem.iItem = GetItemCount(); lvItem.lParam = (LPARAM)pRoot; lvItem.iIndent = 1; lvItem.iSubItem = 0; CListCtrl::InsertItem(&lvItem); //Add this line in to let CListCtrl know about the check SetCheck(lvItem.iItem, lpInfo->GetCheck()); ** Sometimes you know yourself something is a bad idea; follow your instinct ** //yes I know..have to maintain to sets of checkstates here... //one for listview statemask and one for CTreeItem..but its located here so no harm done SetCheck(ht.iItem,!GetCheck(ht.iItem)); CItemInfo *pInfo = GetData(pItem); pInfo->SetCheck(!pInfo->GetCheck());
|
|
|
|

|
First,i should say thanks to your effort.i take advantage of your control in my own project. but i think the interface is too large to manipulate.
would you give me a description on how do you combine "LIST" with "TREE" ?
the tree like thing is in the first column .when a tree subitem collapses ,the relevent items in list acts accordingly . how does it work ?
|
|
|
|

|
Do you have any plans to implement nested List-Controls or Supergrids instead of 'normal' rows (like FlyGrid.Net or Sandgrid) ?
|
|
|
|

|
Really useful but is it possible to add checkboxes to the SuperGrid in the dialog?
Do the controls work also in the dialog view?
Can't get them to work.
I would really appreciate anyones help?
I'm not daft, just stupid really!!!
-- modified at 8:12 Tuesday 24th October, 2006
|
|
|
|

|
1. Does anybody know how to implement Multiselection ( Rows ) into this fine piece of code?
^^dssfasdfadsafasdfasdfasdfasdf
|
|
|
|

|
I am waiting for this as well.
|
|
|
|

|
the tree are blinking and freeeze for many times when I trying to add 100 000 nodes ... I think that this can make better ... I remember one VirtualTreeView in C Builder that load 100 000 nodes for 2 seconds may we can take an idea from this ... If i have time I will try to improve it ...
nik
|
|
|
|

|
my list like:
+ RootItem0
|-Item01
|-Item02
|-Item03
|-Item04
+ RootItem1
|-Item11
|-Item12
|-Item13
|-Item14
+ RootItem2
|-Item21
|-Item22
|-Item23
|-Item24
when collapse all rootitems,like:
+ RootItem0
+ RootItem1
+ RootItem2
run search("Item13",NULL)
result like:
+ RootItem0
|-Item11
|-Item12
|-Item13
|-Item14 <--(selected)
- RootItem1
+ RootItem2
at this time,click "+" or "-" some other errors can be found.
|
|
|
|

|
Dear All,
I am new in Visual C++. I use the Microsoft Visual C++ Version 6.0 and i have a small problem with the list control.
I cannot find a way (or i do not understand) how i could change the letter in specific lines with bolt and change at the same lines the text color and the background color.
Until now i am using the report style with a grid and i am load the data from a database.
I hope someone helps me as soon as possible.
Thans in advabce for your time.
Best regards,
Konstantinos.
|
|
|
|

|
This is a good ariticle,thanks for the author.
I used it,very nice to extend,simple interface,detailed example.I use it inherited from my own listctrl,to just make my list ctrl has the tree behavior.
thanks again.
|
|
|
|

|
the version in this page is the one updated in 14 july(by history text) .it doesnot support the subitem'image.
the newest version is 4 dec. where is it ?
|
|
|
|

|
Hi;
If anyone has implemented this style,can u please post it here ??
|
|
|
|

|
In listCtrl, we can use SetItemData to bound DWORD to every list item, but in this control, we can't do that, hope you can give those functions:SetItemData, GetItemData.;P
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
A combination list control and tree control with checkbox capability
| Type | Article |
| Licence | CPOL |
| First Posted | 26 Nov 1999 |
| Views | 556,769 |
| Downloads | 5,960 |
| Bookmarked | 303 times |
|
|