Creating new object

Hi!

I have 2 questions:

First, I would like to create a new object named “MyCombo”, a DesktopTextField with a DesktopCheckBox on his side
Where can i read about this on documentation, and also, is that any video with examples?

Second, is it possible to edit (show or hide) some object behavior from code?
like this:
if a DesktopTextField i set on behavior’s type “A”, it shows (or hide) some behaviors
if a DesktopTextField i set on behavior’s type “B”, it shows (or hide) other behaviors

Thank you very much.

Alex

Hi Alex,

You could do this with a ContainerControl (now named DesktopContainer).

There is an example project located at Example Projects/Platforms/Desktop/Custom Controls/OKCancelContainer.xojo_binary_project that shows how you can make a custom control using a container.

Take a look at the computed properties to see how you can execute code on the container when a property is set. This will allow you to change, show, or hide behaviors when you set the type to “A” or “B”.

After you take a look at this example project and experiment with building your own, let us know if you have any specific questions!

Best wishes,
Tim

3 Likes

… omg… of course! containers! lol

thank you!

about the computed properties, i’ll not work for me.
i’ll try to explain more detailed later.
thank you!

talking about behavior, how to create a “popup menu” option there?

like this one?

From custom controls documentation:

Other features of the Inspector Behavior dialog

The Inspector Behavior dialog allows you to control all aspects of what appears in the Inspector. You can:

  • Add or remove group headings: Use the “+” or “-” buttons below the list or use the contextual menu.
  • Change the order of the properties, including moving them to different groups: Drag properties around as needed.
  • Set or modify default values: Double-click in the Default Value column for the property to set or modify the default value.
  • Change whether a property is shown or hidden: Check the property to display it; uncheck it to hide it.
  • Add enumerations: Use the Enumerations control on the right to add values that the user can select from a list.

Hi!

Not this one, right?

This one i didn’t figured out how to add values…

If you change MaskType from String to Integer (for example) you can create an enumeration like:

thanks!

where can i find this information on documentation?

I posted the link and what the documentation says above.

This is for enumerations:

1 Like