Building Dynamic Windows

I have a program where users can define their own record formats. That is, they can specify what fields are pertinent to a particular table. I need to be able to build a dynamic window with a variety of different control types. So, for example, one user record might need a checkbox, two text fields, a drop down, and another text field. Another user record might need three text fields and a drop down list.

Here’s the pseudo-code. Let me know if i’m on the right track!

Dim tempWin as New Window 'add some labels and fields 'display it 'close the dialog 'utilize the values entered

It will be used to populate a database.

So, how do I build that dynamic window?

Heres one possible way:

http://forums.realsoftware.com/viewtopic.php?f=1&t=46289

A property list listbox.
You can add as many rows as you like, and build up the list of fields dynamically.
Its a useful piece of work by Dave S of this forum, and deserves a donation if you do use it.

That looks exactly like what I need! Thank you so much for the heads-up!

I’ll see if I can implement it into my project today.

@Jeff Tullin, do you know where I can get support for this class library? When I drag and drop it into my project, I get a “Resolve Project Issues” error dialog, and I’m not sure what I’m supposed to do to resolve the issues. (I tried his web site, but there doesn’t seem to be any way to contact him or submit a request.)

Have you read what the issues are?
You should be able to resolve them yourself if the IDE is telling you about them.

Go to the build settings for Mac and set and bundle identifier. x.x.x is what I use for quickies.

[quote=312094:@Tim Parnell]Have you read what the issues are?
You should be able to resolve them yourself if the IDE is telling you about them.[/quote]

Yes, I’m asking because I don’t understand the issues well enough to know what’s going on.

I’m attaching a screenshot. I’m using Windows, so I’m not quite sure how Mac OS is relevant to me at this point.

Screenshot of Error Dialog

Thanks, Beatrix! I’ll give it a try!

That screen shot indicates OSX not Windows… and says to set the Bundle ID just as Beatrix mentioned

COCOA is not a WINDOWS feature… so intentionallly or not, you are building for OSX

Build Settings

Here’s what I’ve got for build settings when I open the pInspector file.

BTW, @Dave S , I clicked the “Play” button on Xojo and the sample project ran. Sorry about bothering you about that. I’m still a Xojo n00b at this point. :smiley:

You indicated you are running WINDOWS???]
Not sure then why the error messages are what they are…

  • App Framework updated to Cocoa for OS X builds… Ok… that might be fine
  • Update Bundle ID - DID YOU DO THAT?

This class was written (by me) years ago, so it was probably OSX Carbon (hence the first message aboe)

Bundle ID is a OSX only feature, but since Xojo is complaining about it… give it one

Bundle ID is using a reverse URL scheme.

com.mygreatcompany.mygreatapp

You make it yourself, “mygreatcompany” is your company’s name, and “mygreatapp” the name of the app. This is used internally by macOS to manage the app.

http://stackoverflow.com/questions/3436260/bundle-id-suffix-what-is-it

NOTE : the property inspector class I wrote (illustrated above) was written in 2012 (ie. 5 years ago), and due to my personal financial situation, I do not at this time have resources to provide help to anyone who might want to implement this in their own projects. You have access to the code, and are free to modifiy it as you require to support your own current project requirements.

The original version was written in the world of CARBON and non-Retina… and I don’t even know if I (or anyone else) ever ran it in a Windows project or not.

Its a useful bit of code. I recall sending Dave a donation for it back when, and I regularly use it today in Mac and Windows apps.
I did find one or two small oddities over the years and have addressed them to suit my own purpose.
So, as I mentioned above, if using the code, please consider sending Dave a ‘thank you’ donation. Its only fair.

And if you need support on the code itself (rather than just how to make an app run in Cocoa), feel free to send me a PM