 |
|
 |
To make the treenode backcolor to change, I add
"afx_msg void OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult);",
"ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnNMCustomdraw)" and
"void CCheckTreeCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
{
AfxMessageBox("hello OnNMCustomdraw");
}
I add breakpoint to "AfxMessageBox", but no any effect.
what reason?
could you help me?
|
|
|
|
 |
|
 |
I tried to use this Control in the Toolbar, but i failed. The Control stays disabled. Is there a workaround how to use it in the toolbar?
|
|
|
|
 |
|
 |
Hi,
I just found this control and it is great stuff. I simplified it from multi check to single check because that was what I needed.
So far so good. What I want next is to update a textcontrol in the parent dialogbox including the string at the checkmark and I want it to update immediately after the checkmark is set or removed.
How do I do that?
I am rather new to programming the windows messaging system so please have patience with me.
Kind regards
Johannes P. Hansen
|
|
|
|
 |
|
 |
I was wondering if I can
force the CCheckComboBox to have only one check at a time. Do you think it is possible?
Thank you.
|
|
|
|
 |
|
 |
I implement DeleteString(nIndex) to update text as the following.
Here we go.
/*
* in .h
*/
public:
// Implement it to signal that the text need updating
int DeleteString(UINT nIndex);
/*
* in .cpp
*/
// Implement it to signal that the text need updating
int CCheckComboBox::DeleteString(UINT nIndex)
{
// Signal that the text need updating
m_bTextUpdated = FALSE;
// Redraw the window
Invalidate(FALSE);
return CComboBox::DeleteString(nIndex);
}
Scott Su
7th July,2005
|
|
|
|
 |
|
 |
In CheckComboBox.cpp:
This is combo tree control is very nicely done.
I was able to easily modify it to do exactly what I wanted.
Add Bold code below to add mouse wheel support to the
drop down window.
LRESULT CALLBACK CCheckComboBox::ParentWindowProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
//## CHECK Message
switch (nMsg){
case WM_MOUSEWHEEL:
if(m_pwndActiveDropDown)
m_pwndActiveDropDown->SendMessage( nMsg, wParam, lParam);
break;
case WM_COMMAND:
case WM_SYSCOMMAND:
case WM_SYSKEYDOWN:
case WM_LBUTTONDOWN:
case WM_NCLBUTTONDOWN:
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
//## FILTER Messages
if (IsMsgOK(hWnd, nMsg,/* wParam,*/ lParam)) break;
.
.
.
|
|
|
|
 |
|
 |
I try to build the sample, and all i get is:
error C2660: 'CTreeCtrl::CreateEx' : function does not take 8 parameters
in file CheckComboBox.h, line 301.
What to do?
|
|
|
|
 |
|
 |
Well, i got it to work. Just add CWnd::CreateEx instead of plain CreateEx.
It looks very good. To bad that it is not a very dynamic solution.
It would be good if the tree could behave more like a real CTreeCtrl.
Would this be possible to see in a update?
|
|
|
|
 |
|
 |
Hi
A very cool control indeed.
The following minor improvements might make the control even more useful:
1) If you add an item after you have expanded the tree control the item won't show up
2) I'd like a Remove item method and a RemoveAllItems method
/Göran
|
|
|
|
 |
|
 |
The GetDesktopWindow() as a parent is the problem.
Do you solve that?
|
|
|
|
 |
|
 |
When the text is too long to display, a tool tip should appear.
When you expand the tree enough to get a scroll-bar "San Franscisco" doesn't completely show.
|
|
|
|
 |
|
 |
Well done Cosmin! When can we expect you to make it more configurable (i.e. the initialization of the tree in BOOL CSampleDlg::OnInitDialog() to be done by reading a text file or a XML file)? just kidding around, you did enough .. if we want more we just have to adapt it by ourself !
Tom
|
|
|
|
 |
|
 |
I solved the previous 2 problems found by Ismail PAZARBASI and Boris Ilijic.
|
|
|
|
 |
|
 |
Yep, very good control Liked it
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
 |
|
 |
Hi,
first of all thank you for this control, it is very useful. I think I have found a bug. Actually, I have not tried to fix it, but I will be looking after I post this.
When adding a string into combo with a given level greater than next item's level (e.g. previous node is ROOT_LEVEL+1, current node is ROOT_LEVEL+2, and next node is ROOT_LEVEL+1 again), combo does not let check items in the list except of this child node. * checks that child node also.
If you insert more than 1 item, which will have children, you will be able to check those items, and their children. You can also check multiple child items under one parent, which is not root.
Following code can produce this error:
#include "CheckComboBox.h"
class CMyDialog : public CDialog
{
....
protected:
CCheckComboBox m_folders;
....
};
BOOL CMyDialog::OnInitDialog()
{
m_folders.AddString(TEXT("Test1"), 1); // Will not be checked
m_folders.AddString(TEXT("Test2"), 2); // Will be checked with its children
m_folders.AddString(TEXT("Test3"), 3, ROOT_LEVEL+2); Will be checked
m_folders.AddString(TEXT("Test4"), 4); // Will be checkde with its children
m_folders.AddString(TEXT("Test5"), 5, ROOT_LEVEL+2); // Will be checked
m_folders.AddString(TEXT("Test6"), 6, ROOT_LEVEL+2); // Will be checked
m_folders.AddString(TEXT("Test7"), 7, ROOT_LEVEL+2); // Will be checked
// You can add more.
return TRUE;
}
If you try to check items prior than Test3, control will not mark them checked. * checks only Test3.
I will try to fix this today. If I find something, I will post it here.
Thank you again,
Best regards.
Face the thing that should not be!
|
|
|
|
 |
|
 |
Hi
Your control is exelent, but I found a small bug in it.
The bug only happens when I use a control without ImageList.
If I set CheckAll(TRUE), the items in control are not checked (this happens only first time when I clicked on control).
|
|
|
|
 |
|
 |
Useful and very handy!!
Good Job!!
William
|
|
|
|
 |