 |
|
 |
Hi,
first I want to thanks the developer. you saved me a lot of time.
I have worked a lot on this listctrl but I just couldn't replace two raws in
the list. I added two buttons for moving a selected raw Up and Down.
Does anyone achived such a thimg?
Uv
|
|
|
|
 |
|
 |
how can set a col readonly?
|
|
|
|
 |
|
 |
Hi;
I'm popping up a dialog containing only a CComboBoxEx in response to a column RClick. The last ComboboxEx list item text (as soon as DoModal on dialog) appears in all supergrid cells (in created rows) that have not been initialized with text or have been initialized with _T(""). The reason for the popup (rather than using a cell Listbox) is for UI consistency with other cells which require more complex dialogs.
The workaround to this is to initialize all column cells with _T(" ") at row creation.
If anyone wants to look into this, let me know and I will put together a simple test case.
Regards;
Bill
|
|
|
|
 |
|
 |
Hi..
Can I use this control wrapped in managed user control in .net windows ???
I have tried it but i cannot get the display since DrawItem and MeasureItem is not called ... i think some message handler is corrupt or i have intialize it manually
can any one help
Chetan.M
|
|
|
|
 |
|
 |
I have been using this control for a while and it works nicely once you understand it, but it seems there is no way to sort on the root items. Try it in the example. You'll see that the top most root items don't sort. Only the children do.
I added some code to try to fix this problem, by calling CListView::SortItems() and then swapping the corresponding CTreeItem pointers among each LV_ITEM in the view. It does sort, but the children don't show correctly when the +/- signs are clicked.
Anyone figure this one out?
|
|
|
|
 |
|
 |
I'm sorry to say - but while I'm sure you've worked a lot on it, and the UI looks great -,
IT IS EXTREMELY HARD TO USE IN REAL APPS.
In fact, it made my life a nightmare to use (I've worked on a project that used this class, and needed to customize the UI).
I would suggest you provide a MUCH simpler interface . The current one is way too big, hard to understand, and error prone.
Especially, what really killed me, was the fact that when the user clicks a "Collapse" button, my list items are DELETED. Thus, I needed to create an extra wrapper to somewhere hold references to their text.
Then, I had to create a custom mechanism for uniquely identifying an item in such a Super Grid (since the item's index wouldn't work)
John Torjo
Freelancer
-- john@torjo.com
Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/
Professional Logging Solution for FREE
-- http://www.torjo.com/code/logging.zip (logging - C++)
-- http://www.torjo.com/logview/ (viewing/filtering - Win32)
-- http://www.torjo.com/logbreak/ (debugging - Win32)
(source code available)
|
|
|
|
 |
|
 |
>I'm sorry to say
hey don't be
>but while I'm sure you've worked a lot on it, and the UI looks great -,
I worked on this 3 weeks in 1999 and I am sorry I didn't factored the interface back then, I was in a hurry...and I figured perhaps someone else could use this code, so I uploaded it here...
>Especially, what really killed me, was the fact that when the user clicks >a "Collapse" button, my list items are DELETED
you actually did not take the time to read the article, did you now
>Then, I had to create a custom mechanism for uniquely identifying an item
I hope your nightmares are over .
I am sorry that you didn't get a free ride with this control here.
keep up the good work.
|
|
|
|
 |
|
 |
Sorry for the harsh words - I was very angry at that time. You must have put a lot of effort in it.
I still think the interface is too huge, and perhaps it could benefit greatly from templates
Best,
John
--
John Torjo, Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/ -v1.6.3 (Resource Splitter)
-- http://www.torjo.com/cb/ - Click, Build, Run!
|
|
|
|
 |
|
 |
[snipped a useless rant]
Nevermind! I'm stupid. and a jerk. Sorry. You must have spent a lot of time working on this and it does look great, when I can get it work. There is a little bit of overhead in getting this to work for in an application, but other than that I think it looks great.
However this question still stands. Also, what if you don't want images in the tree control?
I may fiddle with this and check. It seems whenver I eliminate the images the plus boxes also go away. Any attempt to doctor that space and the plus bozes get changed. Kinda a headache.
But good work! Thanks for sharing!
Thanks!
|
|
|
|
 |
|
 |
Not sure what I was thinking here. Yeah... would have been nice if I just posted the silly fix. Here is DrawItem. Look for the variable "m_NoImages". this variable is set by me if I have images or not. if not, I am commenting out code that deals with them. I've cut out some stuff to help with length. Hopefully it makes sense.
void CSuperGridCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if (lpDrawItemStruct->CtlType != ODT_LISTVIEW)
return;
if(lpDrawItemStruct->itemAction == ODA_DRAWENTIRE)
{
...
CRect rcClip = lpDrawItemStruct->rcItem;
if(m_NoImages)
rcClip.left -= 20;
rcClip.left += GetIndent(pSelItem) * m_cxImage + m_cxImage + 2;
if(rcClip.left > GetColumnWidth(0))
rcClip.left = GetColumnWidth(0);
ExtTextOut(pDC->GetSafeHdc(), 0, 0, ETO_OPAQUE, CRect(0, rcClip.top, rcClip.right, rcClip.bottom), NULL, 0, NULL);
if((nWidth=m_cxImage-nWidth) >-1) {
if(!m_NoImages)
{
ImageList_DrawEx(m_himl, lvi.iImage, pDC->m_hDC,
rc.left + (GetIndent(pSelItem) * m_cxImage),
nY,
nWidth,
m_cyImage,
CLR_DEFAULT,
CLR_DEFAULT,
uiFlags);
}
DrawTreeItem(pDC, pSelItem, nItem, rc);
}
...
GetItemRect(nItem, rcItem, LVIR_LABEL);
pszText = MakeShortString(pDC, szBuff, rcItem.right - rcItem.left, 2*OFFSET_FIRST);
rcLabel = rcItem;
pDC->SetBkColor (crBackground);
pDC->SetTextColor (crText);
rcLabel.left+=OFFSET_FIRST;
rcLabel.right-=OFFSET_FIRST;
if(m_NoImages)
rcLabel.left -= 20;
pDC->DrawText(pszText,-1, rcLabel,DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_EXTERNALLEADING);
...
}}
Here a screen clip
from an application i am currently designing that shows the grid without the icons.
i have been working with this control quite a bit and have a LOT of logic changes and bug fixes. If the author would like a copy of my files I will send them. It's hard to put everything into this comment board. Also, I forgot many of the changes I put in. I don't comment as much as I should.
|
|
|
|
 |
|
 |
brdavid wrote:
I have a fix for anyone who wants to eliminate the icons that appear in the listview control.
Nice screen shot, but where can i find the fix?
Would be great if you share it.
|
|
|
|
 |
|
 |
Is there an easy way to place this in a different app?
|
|
|
|
 |
|
 |
I want to open a file include some data ,and show it in the root item of list,any suggestion?
|
|
|
|
 |
|
 |
Hello,
This control don't work without SetImageList.
Is there a solution ?
Jimmy
|
|
|
|
 |
|
 |
Does anyone know how to get rid the flicker effect during resize of the columns. It is really annoying.
|
|
|
|
 |
|
 |
I do not have any flickering when I resize a columns. Is this reproducable with the Demo code?
Martin
|
|
|
|
 |
|
 |
It is reproducable. Just try to resize any of the columns and then the resized column will start to flicker while dragging.
|
|
|
|
 |
|
 |
Is this Super Grid a COM thing? Can i use it in my VB 6.0 application?
Pls advice
Sinex
|
|
|
|
 |
|
|
 |
|
 |
great work!
I want to fix the first column.
maybe someone want to fix any column.
|
|
|
|
 |
|
 |
Handle HDN_BEGINTRACK by yourself.
HTH
|
|
|
|
 |
|
 |
I tried but it never gets called. I think this is a bug in VC 6.0. There is supposed to be a work around by modifing ON_NOTIFY but I haven't gotten it to work yet. Anyone gotten this to work?
|
|
|
|
 |
|
 |
Raymond S wrote:
I tried but it never gets called. I think this is a bug in VC 6.0. There is supposed to be a work around by modifing ON_NOTIFY but I haven't gotten it to work yet. Anyone gotten this to work?
The handler must be placed in the message map of SuperGrid ctrl. The Header is a child of the List Ctrl and so all notifications are sent to the Supergrid Ctrl.
Martin
|
|
|
|
 |
|
 |
Yeah I knew that. Here is what I came up with in case someone else has been trying this: Go to CSuperGridCtrl, go to class wizard. Add OnNotify function. My OnNotify function looks like this:
BOOL CSuperGridCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
HD_NOTIFY *phdn = (HD_NOTIFY*)lParam;
switch (((NMHDR*)lParam)->code)
{
case HDN_BEGINTRACKW: //either standard or unicode
case HDN_BEGINTRACKA:
if (phdn->iItem == 1){
*pResult = true; // disable tracking for second column
return true; } // processed message
break;
case HDN_DIVIDERDBLCLICKW:
case HDN_DIVIDERDBLCLICKA:
if (phdn->iItem == 1){
*pResult = true; // disable tracking for second column
return true; } // processed message
break;
}
return CListCtrl::OnNotify(wParam, lParam, pResult);
}
This prevents the second column from being resize either by double click or click and drag. The first column can still be resized. This takes care of everything except that the mouse pointer still changes when you move the mouse over the devider but this can be fixed too....
|
|
|
|
 |
|
 |
Raymond S wrote:
Yeah I knew that. Here is what I came up with in case someone else has been trying this: Go to CSuperGridCtrl, go to class wizard. Add OnNotify function. My OnNotify function looks like this:
I should have said that I still don't know how to do this right (the class wizard added message mapped functions are still not called) but that this works....
|
|
|
|
 |