hi your control is excellent..!!! that saved me right now... then how can i set a data to the list control item so that i want to retrieve that data later ( like the SetItemData and GetItemData()) please help me thanks in advance dhanya
ReplyOriginally posted by: ken
second, third columns attached with bitmap show text of first column.
I create a listview with 3 columns. First column show text, and second, third show bitmap. It's OK under win2k and winxp, but under win9x, text show in secord and third column too, why?
Originally posted by: alan
I posted a bunch of questions in the CodeGuru forumns after discovering that this thing swamps Windows98 and Millenium after 400 or so GDI objects are created with the AttachBitmapCell() (..CTColumnBitmap)
I had about 100 rows with about 4 bitmaps for each row.
Someone suggested using a DIB instead of DDB. I'm not real knowledgable about these but it might be an improvement.
ReplyOriginally posted by: Sriram
Hello,
Let me appreciate your code first. It is very neat and professional.
I ahve a question for you.
Can i progrmmatically select specific list items?
Let us say I want to differnetiate Group A and B due to certain conditions. Can i use SelectItem()?
How can i do it?
Please mail me the solution
Thanks in Advnace
Sriram
Originally posted by: Stefan
Hello,
I would like to implement the CMultiTreeCtrl class
in a non-diagloge based application.
I tried to use the Create function but this doesn't
seem to work.
Please let me know if anybody knows how to handle this
problem.
Thx.
ReplyOriginally posted by: Konermann
In the Methode CTreeMultiColumnCtrl::DrawCell
1) Resoucen-Error:
- set the &-Key by penGray:
CPen* pOldPen = (CPen*)pDC->SelectObject(&penGray);
- Select the pOldPen
...
drawRect.left = x + 2;
pDC->SelectObject(pOldPen);
pDC->SelectClipRgn(NULL);
...
In the CLASS CTsyslistviewex
2) Size-Error
- Set in the Tsyslistviewex.h:
...
int m_nHeightRel;
BOOL m_nHeightRel_aktiv;
CMap<int,int, CTColumnBitmap*, CTColumnBitmap*>_bmpColumns;
...
- set the varible m_n_HeightRel_aktiv in CTsyslistviewex::CTsyslistviewex false
...
m_nHeightRel = nHeightRel;
m_nHeightRel_aktiv = false;
m_bSorted = false;
...
- change the Methode
void CTsyslistviewex::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
if (m_nHeightRel_aktiv==false) {
m_nHeightRel_aktiv=true;
lpMeasureItemStruct->itemHeight += m_nHeightRel;
}
}
Reply
Originally posted by: Mike Philis
Check this out: http://www.exontrol.com/sg.jsp?content=products/extree
Features include:
Mike
Are you looking for a cool tree control?
ActiveX hosting, events from contained components are fired through to your program using the exact same model used in VB6 for components added at run time, data bounding, multiple columns, and more
www.exontrol.com
Originally posted by: alan
I'm using a nested while loop which does the correct insert for all child nodes on the call m_treeCrtl.SetItemText(item, subitem, text)
but,when the loop is done, the very FIRST item inserted has 2nd column text of the last item inserted (which is a subitem). Follow this?
Again, I'm putting text where the check boxes are in the sample but only for the child 'nodes'. And the problem is that the first parent node has the text of the last subitem when it should have nothing.
If I do this to clear it:
it clears it,
but this does not:
The former does what I need to fix it but not sure what is happening. Sorry this is so long.
I don't know if this is a bug or me doing something wrong.
I'm trying to set the text in the second column for child items only.
m_treeCtrl.SetItemText(0, 1, " ");
m_treeCtrl.RedrawWindow();
for(int x = 0; x < nNumParentEntries; x++){
nItem = m_treeCtrl.GetNextItem(x,LVNI_ALL);
m_treeCtrl.SetItemText( x, 1, " ");
}
m_treeCtrl.RedrawWindow();
Originally posted by: Jed
You cannot add text to any cell, except the first column, in the top level rows in the TreeCtrlMultiColumn. Only subrows can have data beyond the first column. Is this a bug or a feature?
Originally posted by: Danny
Steps for GridCtrl.cpp:
// To double click on the grid an send a message to the owner of the grid
2. In function void CGridCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
else if (m_MouseMode == MOUSE_NOTHING)
Steps for GridCtrl.h:
1. Add a #define WM_DOUBLECLICKGRID WM_USER+1
That's all.
Danny
Hi,well I made my own solution. It is actually very simple.
1. In the constructor CGridCtrl::CGridCtrl(int nRows, int nCols, int nFixedRows, int nFixedCols)
add the following code :
// the owner first has to tell the grid it wants to receive the message
// This is done by this member var which is set by a helperfunction.
// See for the implementation CGridCtrl::OnLButtonDblClk
m_bReturnDblClickMsg = FALSE;
{
if (m_LeftClickDownCell.row >= m_nFixedRows &&
IsValid(m_LeftClickDownCell) &&
m_LeftClickDownCell.col >= m_nFixedCols)
{
OnEditCell(m_idCurrentCell.row, m_idCurrentCell.col, VK_LBUTTON);
}
else if (m_bListMode)
{
CCellID cell = GetCellFromPt(point);
if (!IsValid(cell)) return;
if (cell.row >= m_nFixedRows && cell.col < GetFixedColumnCount())
OnEditCell(cell.row, cell.col, VK_LBUTTON);
}
// *****************
// The following code is new
if ( m_bReturnDblClickMsg )
{
CWnd *pWnd = this->GetOwner();
if ( IsWindow(pWnd->GetSafeHwnd()) )
pWnd->SendMessage( WM_DOUBLECLICKGRID );
}
// *****************
}
CWnd::OnLButtonDblClk(nFlags, point);
}
2. Add a public helperfunction to CGridCtrl
void SetReturnDblClickGridMessage( BOOL bValue ) { m_bReturnDblClickMsg = bValue; }
3. Add a protected memberbar BOOL m_bReturnDblClickMsg;
Okay and now in you code that uses the grid:
1. Add ON_MESSAGE(WM_DOUBLECLICKGRID, OnDblClickGrid) to your dialog's/view's BEGIN_MESSAGE_MAP
2. Add function LRESULT CYourView::OnDblClickGrid(WPARAM wParam, LPARAM lParam)
{
OnModify();
return 0L;
}
2. Add to header : afx_msg LRESULT OnDblClickGrid(WPARAM wParam, LPARAM lParam);
3. And finally let the grid know you want to be able to doubleclick a row by
m_Grid.SetReturnDblClickGridMessage( TRUE );