Skip to content

XE3 Visual LiveBindings: Hiding and showing components

This post describes how to specify which components show on the LiveBindings designer.

Hide/Show Component Classes

To reduce clutter, the LiveBindings designer hides many classes of components. The default settings show most visual control classes and hide most non-visual components classes except for data sources.

The settings are in Tools/Options/LiveBindings:

If there is a component class that you always want to see on the LiveBindings designer, add it to the "Included Items:" field. For example, if you use FireMonkey 3D controls then you’ll probably want to add "TControl3D".

This setting will cause components derived from TControl3D, like TText3D, to show in the LiveBindings designer.

Hide/Show Component instances

To hide a specific component, right click on the component in the LiveBindings designer and choose "Hide Elements(s)".

To show a hidden component, use the object inspector to change the LiveBindings Designer properties for the component.

LiveBindings Designer properties for a components supersede the settings for the component’s class in Tools/Options. LiveBindings Designer properties for components are saved in unitname.vlb file with other LiveBindings designer state information.

Link to TForm

The LiveBindings designer can be configured to show the TCustomForm class, but the form instance will not show in the designer until the form is linked.

To configure the LiveBindings designer to show TCustomForm, prepend the "Included Items:" setting with "TCustomForm;".

A link can be created to a TLabel and then modified using the object inspector.

  1. New FireMonkey application
  2. Drop a TEdit and TLabel on the form
  3. In the LiveBindings designer, link TEdit.Text to TLabel.Text
  4. Select the link component by clicking on the line between the components
  5. In the object inspector, change the "ComponentProperty" property to blank
  6. Change the "Component" property to "Form1"
  7. Change the "ComponentProperty" property to "Caption"
  8. Delete the TLabel component

{ 7 } Comments

  1. C Johnson | October 3, 2012 at 6:16 pm | Permalink

    Too bad the layers & hide feature seem useless - they aren’t streamed with the form, so anything you do with them vanish all the time. The designer seems half baked, and that worries me about the whole visual bindings feature.

  2. Jim Tierney | October 3, 2012 at 6:51 pm | Permalink

    Properties are streamed to a .vlb file rather than to the .dfm or .fmx files.,

  3. Marius | October 3, 2012 at 11:23 pm | Permalink

    No experiences yet with LB but because of this its better to create those bindings in code i think.
    In my first impression (just 15 minutes) i was unable to bind a edit.text to form.caption property. Too complicated?

  4. ObjectMethodology.co | October 4, 2012 at 6:56 am | Permalink

    Awesome, thx.

  5. Jim Tierney | October 4, 2012 at 9:06 am | Permalink

    Steps to link TEdit.Text and TForm.Caption added.

  6. C Johnson | October 5, 2012 at 8:30 pm | Permalink

    Ah, I see the problem. I never got past the fact that it tosses out any changes when you switch the form to source view (alt-f12) instead of saving it. When you return from the dfm source to the designer view, it reloads the last thing saved (if anything. New forms obvious have nothing so it tosses everything out.)

    Still seems half baked to me, and a compelling point that it should be in the dfm not a seperate file.

  7. Jim Tierney | October 9, 2012 at 7:32 am | Permalink

    I see the problem too. The LiveBindings designer display settings from the last saved .vlb file are restored when toggling text/form. This issue can be fixed without resorting to .dfm storage. If we can avoid it, we do not store design time settings in runtime files.

Post a Comment

Your email is never published nor shared. Required fields are marked *

Bad Behavior has blocked 26 access attempts in the last 7 days.

Close