Subject |
Author |
Date |
|
Krustys Donuts
|
Aug 25, 2005 - 6:07 PM
|
I really need to be able to add a sub category to another category, but would like Prof-UIS to honor the nIndexInsertBefore parameter. Currently, regardless of the index specified, the sub-category always appears in the first row below the main category. I actually need it to appear dynamically below a property value if its checkbox is checked. Thanks!
|
|
Technical Support
|
Aug 26, 2005 - 12:18 PM
|
The categorized property grid window is implemented in the the CExtPropertyGridWndCategorized class. Jus find this window in the CExtPropertyGridCtrl container window with the CExtPropertyGridCtrl::GetChildByRTC() method and set the m_bSortedCategories property of the categorized grid to false . This will allow the categories to be added as you request.
|
|
Krustys Donuts
|
Aug 26, 2005 - 12:47 PM
|
Wonderful! That totally works. Now, I just have an issue with deleting the category. I figured that if the category and its values are inserted at index X, when I want to remove the category and its value, I just call ItemRemove( X, 1).
However, when I do this, the application crashes at CExtPropertyGridWnd::PropertyItemFromTreeItem on ASSERT_VALID( pPropertyItem );
If I look at the line that caused the crash, it’s in ExtPropertyGridWnd.cpp on line 3598. Any ideas on what’s causing this?
|
|
Technical Support
|
Aug 26, 2005 - 1:07 PM
|
Please use one of the CExtPropertyGridWnd::PropertyItemRemove() overloaded methods to remove a property item from the particular grid window. This will allow you to avoid problems with an internal map object for mapping the CExtPropertyValue pointer to the HTREEITEM handle and vice versa. The property grid control synchronization with the CExtPropertyGridCtrl::PropertyStoreSynchronize() is a safe and painless way to make property grid windows inside the property grid control synchronized with values in the original property tree.
|
|
Krustys Donuts
|
Aug 29, 2005 - 8:15 AM
|
Thanks, that works fine, but now it crashes if I show the category, hide it, and then show it again. So I changed my code to use PropertyItemInsert instead of calling ItemInsert directly. However, when I do this and add the category dynamically nothing really happens. I can see the scrollbar update, but the contents of the main category remain the same. My code snippet looks like this in my property grid subclass:
GetActiveGrid()->PropertyItemInsert( pCategory); // pCategory is the subcategory I want to add at runtime
PropertyStoreSynchronize();
|
|
Krustys Donuts
|
Aug 29, 2005 - 8:30 AM
|
Correction to the above: I shouldn’t call PropertyItemInsert anyway, because I want to add a subcategory, and not a category. So it seems that I’d have to call the main category’s ItemInsert to get the subcategory (just like in your sample application).
Therefore, my only question is, why does my application crash when I add, remove, and then add the category again? When reproducing this problem, please add with ItemInsert, and remove with PropertyItemRemove.
Thank you!
|
|
Krustys Donuts
|
Aug 29, 2005 - 8:44 AM
|
If I set the insertion index to 0, then I can add, remove, and add again. However, the weird thing here is that when I re-add the sub-category, a duplicate is displayed as if the previous one wasn’t ever removed.
If I set the index back to what I used before (7), my application gives me the following error as soon as I call ItemInsert the second time:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
This happens on line 631 in ExtTreeGridWnd.cpp.
Thanks again!
|
|
Technical Support
|
Aug 29, 2005 - 10:46 AM
|
We may guess this is a result of inserting a property item which is not part of a property store currently used in the property grid control. If not, then we need your help in reproducing this problem. Could you send us your project or modified version of the PropertyGrid sample application? Alternatively, we could set up a web conference with secure remote access to your desktop.
|
|
Krustys Donuts
|
Aug 30, 2005 - 7:47 AM
|
Hello again, I’ve attached my application to an email to support@prof-uis.com. Please be sure to try a couple of different values for the index variable in CMyGrid::showSpecialProperties(). When index == 0, I can show and hide the subcategory a couple of times, but the second time I add the category, two copies show up, even though I deleted the previous one (supposedly). If I try to show a third time, the program crashes. When index == 2, I can show and hide only *once*, and the second time I try to show the subcategory, I get the stack corruption (?) message.
Also, I have a comment in stdafx regarding the specification of the prof-uis dll. I was previously told that this is unnecessary, but I can’t get the project to link without it. Can you please help me with that as well?
Thank you!
|
|
Technical Support
|
Aug 30, 2005 - 1:07 PM
|
We received your e-mail with the attached project. We will try to find a solution within 12 hours.
|
|
Krustys Donuts
|
Aug 30, 2005 - 1:23 PM
|
Hi, I received an email from you already -- should I still be expecting a solution? I was asked for more details about my application. Basically, I just want to dynamically add subcategories based on a user clicking various checkboxes.
|
|
Technical Support
|
Aug 31, 2005 - 10:35 AM
|
We it’s completely clear what you need exactly. Please give us 3-4 days for providing you with a ready-to-use solution.
|
|
Krustys Donuts
|
Sep 6, 2005 - 5:10 PM
|
|
|
Technical Support
|
Sep 7, 2005 - 12:49 PM
|
We have deadlines for implementing compound property values and this propblem. In any case, we will not release the next version until the problem with adding/removing the property value dynamically is resolved. Please let us know how much time we have additionally.
|
|
Krustys Donuts
|
Oct 10, 2005 - 7:44 AM
|
I’ve come back to a previous project where I needed to dynamically display properties if a checkbox in another property is checked. When testing under 2.43, my application still crashes. Do you have sample code that I can look at that demostrates this capability? It’s been about a month since my previous request.
|
|
Technical Support
|
Oct 10, 2005 - 10:41 AM
|
We’ve just sent a project that seems to be what you need by e-mail.
|
|
Krustys Donuts
|
Sep 8, 2005 - 4:35 PM
|
Well, I’d like to have this functionality today, but I understand that it’s not possible. Hopefully, you can have it fixed within a couple of weeks, though.
|