wxPropGrid question

BlitzMax Forums/Brucey's Modules/wxPropGrid question

rs22(Posted 2009) [#1]
Is there a property type that is just a label in the first column, and then a button in the second?



If there isn't, is it possible to add one, either in the actual C source, or with BlitzMax? It baffles me.

Thanks!


Brucey(Posted 2009) [#2]
I suppose it's possible.

You want a "property" not to actually store a property but simply react to a button click?


Wiebo(Posted 2009) [#3]
I suggest you create a category with the options you want the user to edit. That way, he/she can collapse these options when not needed.
Why create an extra window with the properies you can already present in the wxPropGrid?
Maybe something like the screen I posted here? http://wiebo.wordpress.com/2009/01/22/particle-engine-additions/
In this picture, the particle has options you can show/hide the way you want them to.


rs22(Posted 2009) [#4]
Yes, Brucey, that's correct. When the user clicks the button, I want it to open a dialog box. I would do what Wiebo suggested, but I feel the options would be better presented in a dialog box.


Brucey(Posted 2009) [#5]
Oooh. Pretty :-)

I suggest you create a category with the options

Yes, that's the sort of thing I would do too.

I have to admit the documentation and examples are still lacking - nowhere near quality I would expect.


rs22(Posted 2009) [#6]
I read in the wxPropGrid documentation that you can create new editors by 'extending' wxPGProperty (I think), but when I tried, I could not get it to work.
Type MyProperty Extends wxPGProperty
	
	Field parent:wxPropertyGrid
	
	Method OnInit:wxPGEditor()
		Local button:wxButton = New wxButton.Create(parent, wxID_ANY)
		Return wxPGEditor(button)	
	EndMethod
		
EndType
I have probably done it completely wrong (obviously, since it doesn't compile), so please refrain from laughing at my pathetic attempt! :P

There's some stuff on it here, but aside from my attempt above, I can make neither head nor tail of it. Could someone else have a try? Pretty please?

Also, the propgrid.bmx sample does not compile. I deleted it from my BlitzMax folder and then did an SVN update, and that is the one that does not compile.


plash(Posted 2009) [#7]
I don't think you should be returning the button.


rs22(Posted 2009) [#8]
Yes, you're probably right. I tried changing it to return 'Self', but that doesn't work either. I'm looking really stupid here, aren't I? XD


Brucey(Posted 2009) [#9]
I'm afraid that it's just not that easy !

In C++, yes, but I haven't as yet created a Type for BlitzMax which you might use to "extend" your own properties.
Why not? Well, it's quite a complex process - getting the C++ and BlitzMax to play seamlessly together like that, especially in this context. Really :-p

Essentially what is required, is a base C++ extended property to which we need to sit on-top a BlitzMax layer which can be called by the framework to work as you intend - You would implement a set of defined methods on your extended type.

The "easy" way would be to create your extended property in C++ and wrap it (in BlitzMax)... but that's not very friendly with regards the amount of code that needs to be written.

Anyhoo... I hope you understand the current issues.


rs22(Posted 2009) [#10]
I'm afraid that it's just not that easy !

Thought not!

Ahhh... that sounds horribly complicated. I think I'll leave it for now! Thanks for explaining it to me.