News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Propertygrid

Started by DMac, May 03, 2010, 06:53:07 PM

Previous topic - Next topic

DMac

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.



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

Win32 SDK Propertygrid Made Easy

Regards,
DMac
No one cares how much you know,
until they know how much you care.

frankie

Excellent, very good job.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

DMac

No one cares how much you know,
until they know how much you care.

TimoVJL

Nice!!

BTW:
Is it possible to insert ComboBox etc. to SDK DataGrid too ??
May the source be with you

DMac

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
No one cares how much you know,
until they know how much you care.

MrBcx

Useful, educational, and a great article!

Thank you very much for sharing this David.

Bcx Basic to C/C++ Translator
https://www.bcxbasiccoders.com

DMac

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.
No one cares how much you know,
until they know how much you care.

DMac

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
No one cares how much you know,
until they know how much you care.

lingo

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

TimoVJL

Problem is in simpleGrid.c in line 2399 inst.editstring = _T("");
Just comment it out.
May the source be with you

DMac

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
No one cares how much you know,
until they know how much you care.

lingo

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

DMac

Ok,  thanks for the info.  I'll try to reproduce this.
No one cares how much you know,
until they know how much you care.

TimoVJL

#13
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));
May the source be with you

DMac

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
No one cares how much you know,
until they know how much you care.