Pelles C forum

C language => User contributions => Topic started by: DMac on May 03, 2010, 06:53:07 PM

Title: Propertygrid
Post by: DMac on May 03, 2010, 06:53:07 PM
Pelles C forum,

I have published a message based property grid control that is designed with a view toward being easy to use in Pelles C projects.

Here's a screen shot.

(http://www.codeproject.com/KB/combobox/Win32SDKPropertygrid/Figure1.png)

It can be found with accompanying article (a usage referance) at the code project.

Win32 SDK Propertygrid Made Easy (http://www.codeproject.com/KB/combobox/Win32SDKPropertygrid.aspx)

Regards,
DMac
Title: Re: Propertygrid
Post by: frankie on May 04, 2010, 09:10:06 AM
Excellent, very good job.
Title: Re: Propertygrid
Post by: DMac on May 07, 2010, 06:07:30 PM
Thanks.
Title: Re: Propertygrid
Post by: TimoVJL on May 07, 2010, 06:44:28 PM
Nice!!

BTW:
Is it possible to insert ComboBox etc. to SDK DataGrid too ??
Title: Re: Propertygrid
Post by: DMac on May 08, 2010, 02:52:24 AM
Timovjl,

After completing this I thought the same thing.  It would be a time consuming task and would involve changing the control's data structures to resemble the property grid's.  I'm not sure when I might get around to that now that work is picking up again.

regards,
DMac
Title: Re: Propertygrid
Post by: MrBcx on May 08, 2010, 03:32:59 AM
Useful, educational, and a great article!

Thank you very much for sharing this David.

Title: Re: Propertygrid
Post by: DMac on May 10, 2010, 06:08:12 PM
Thanks Kevin,

When it came to putting the article together the real challenge was deciding what to discuss and what to pass over.  As a field for professional topics Win32/64 SDK is still wide open.
Title: Re: Propertygrid
Post by: DMac on November 13, 2013, 12:52:14 AM
Hello All,

I finally got around to updating the property grid so it draws some of the editors more consistently in Windows 7.

Regards,
DMAC
Title: Re: Propertygrid
Post by: lingo on November 15, 2013, 08:19:47 AM
Hi DMac,

thanks a lot for Your contribution.

Just want you to know, that it don't work as a 64-bit program here.
Many crashes. I  had some on processing (e.g. click checkbox), and
on exit also.

Sorry! Lingo
Title: Re: Propertygrid
Post by: TimoVJL on November 15, 2013, 09:30:11 AM
Problem is in simpleGrid.c in line 2399 inst.editstring = _T("");
Just comment it out.
Title: Re: Propertygrid
Post by: DMac on November 15, 2013, 06:07:08 PM
Quote from: lingo on November 15, 2013, 08:19:47 AM
Hi DMac,

thanks a lot for Your contribution.

Just want you to know, that it don't work as a 64-bit program here.
Many crashes. I  had some on processing (e.g. click checkbox), and
on exit also.

Sorry! Lingo

Did you find this bug in the PropertyGrid or the SimpleGrid?

Quote from: timovjl on November 15, 2013, 09:30:11 AM
Problem is in simpleGrid.c in line 2399 inst.editstring = _T("");
Just comment it out.

Thanks Timo,
I try to be diligent about these things and still miss a big one.  Turns out I don't even use that var anymore (holdover from BABYGRID) I thought I cleaned all that stuff out.

I appreciate all feedback.

Regards,
DMac
Title: Re: Propertygrid
Post by: lingo on November 15, 2013, 08:01:38 PM
Quote from: DMac on November 15, 2013, 06:07:08 PM

Did you find this bug in the PropertyGrid or the SimpleGrid?


DMac!

Bugs are in PropertyGrid.
Hints:
- Take your demo. Convert to 64-bit. You must convert the manifest also, for sure.
- Uncheck a checkbox. Check it again -> Crash.

There were more crashes, as I test it. But don't remember exactly when, and can't
try it at the moment, because this is a mac, I'm currently using.

HTH
Lingo
Title: Re: Propertygrid
Post by: DMac on November 15, 2013, 08:49:15 PM
Ok,  thanks for the info.  I'll try to reproduce this.
Title: Re: Propertygrid
Post by: TimoVJL on November 15, 2013, 08:51:19 PM
In main.c Item is bogus in x64.
static BOOL Main_OnNotify(HWND hwnd, INT id, LPNMHDR pnm)
{
...
LPPROPGRIDITEM Item = PropGrid_GetItemData(pnm->hwndFrom, lpnmp->iIndex);
problem was (DWORD) cast in PropGrid_GetItemData macro/// @returns A pointer to a PROPGRIDITEM object.
#define PropGrid_GetItemData(hwndCtl,index) ((LPPROPGRIDITEM)SendMessage((hwndCtl),LB_GETITEMDATA,(WPARAM)(int)(index),0))
In propertyGrid.c line 4171 wrong cast (DWORD)
        case WM_DESTROY: //Unsubclass the listbox Control
        {
            SetWindowLongPtr(hList, GWLP_WNDPROC,
                (DWORD_PTR)GetProp(hList, WPRC));
            RemoveProp(hList, WPRC);
            return 0;
        }
and in line 838, 966, 1139, 1257, 1510
        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (DWORD_PTR)GetProp(hwnd, WPRC));
Title: Re: Propertygrid
Post by: DMac on November 16, 2013, 02:50:00 AM
Timo,

You beat me to it!  :) I intended to the convert project to X64 at home and test it there tonight.

I hope to post the updated code this weekend.

Thanks again,

DMac
Title: Re: Propertygrid
Post by: DMac on November 16, 2013, 07:10:11 PM
Hello All,

Thanks to a bug report from lingo and input from timovjl, I fixed some issues that caused problems when compiled to X64.  New update now available on Code Project.

Regards,
DMAC