NO

Author Topic: Propertygrid  (Read 9105 times)

Offline DMac

  • Member
  • *
  • Posts: 258
Propertygrid
« 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.



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.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1758
Re: Propertygrid
« Reply #1 on: May 04, 2010, 09:10:06 am »
Excellent, very good job.

Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #2 on: May 07, 2010, 06:07:30 pm »
Thanks.
No one cares how much you know,
until they know how much you care.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1893
Re: Propertygrid
« Reply #3 on: May 07, 2010, 06:44:28 pm »
Nice!!

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

Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #4 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
No one cares how much you know,
until they know how much you care.

Offline MrBcx

  • Global Moderator
  • Member
  • *****
  • Posts: 61
    • http://www.bcxgurus.com/
Re: Propertygrid
« Reply #5 on: May 08, 2010, 03:32:59 am »
Useful, educational, and a great article!

Thank you very much for sharing this David.


Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #6 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.
No one cares how much you know,
until they know how much you care.

Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #7 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
No one cares how much you know,
until they know how much you care.

Offline lingo

  • Member
  • *
  • Posts: 27
Re: Propertygrid
« Reply #8 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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1893
Re: Propertygrid
« Reply #9 on: November 15, 2013, 09:30:11 am »
Problem is in simpleGrid.c in line 2399 inst.editstring = _T("");
Just comment it out.
May the source be with you

Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #10 on: November 15, 2013, 06:07:08 pm »
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?

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.

Offline lingo

  • Member
  • *
  • Posts: 27
Re: Propertygrid
« Reply #11 on: November 15, 2013, 08:01:38 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

Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #12 on: November 15, 2013, 08:49:15 pm »
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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1893
Re: Propertygrid
« Reply #13 on: November 15, 2013, 08:51:19 pm »
In main.c Item is bogus in x64.
Code: [Select]
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
Code: [Select]
/// @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)
Code: [Select]
        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
Code: [Select]
        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (DWORD_PTR)GetProp(hwnd, WPRC));
« Last Edit: November 16, 2013, 10:30:13 am by timovjl »
May the source be with you

Offline DMac

  • Member
  • *
  • Posts: 258
Re: Propertygrid
« Reply #14 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
No one cares how much you know,
until they know how much you care.