Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

How to hide a page in a ComponentBar?

How can I hide a page in a component bar?

In the previous versions, there were a property "Visible" to do this. In the current version, compiler raises an error indicating that property does not exist.

I'm working with LMD2020 (LMD VCL Complete 2020) in Embarcadero 10.4 (64 bits)

Comments

  • 6 Comments sorted by Votes Date Added
  • edited September 2020 Posts: 0Vote Up0Vote Down
    Unfortunately, hiding a page in component bar is not possible. Moreover, component bar page (TLMDCompBarPage) never had Visible property. There is Expanded property, but it does not completely hides the page.
  • In LMD 2012, exists that propery:

      TLMDCompBarPage = class
      private
        FBar:      TLMDComponentBar;
        FName:     TLMDString;
        FItems:    TList;
        FExpanded: Boolean;
        FVisible: Boolean;

        procedure InternalSetExpanded(AAutoCollapse, AUpdateLayout,
                                      AValue: Boolean);
        procedure InternalSetVisible(AUpdateLayout,
                                      AValue: Boolean);
        procedure CleanupItems;
        function  AddItem(AClass: TComponentClass;
                          AImageIndex: Integer): TLMDCompBarItem;
        procedure RemoveItem(AClass: TComponentClass);
        function  IndexOfItem(AClass: TComponentClass): Integer;
        function  GetCount: Integer;
        function  GetItems(AIndex: Integer): TLMDCompBarItem;
        procedure SetExpanded(const Value: Boolean);
        procedure SetVisible(const Value: Boolean);
      public
        constructor Create(ABar: TLMDComponentBar; const AName: TLMDString;
                           AIndex: Integer = -1);
        destructor Destroy; override;

        property Bar: TLMDComponentBar read FBar;
        property Name: TLMDString read FName;
        property Count: Integer read GetCount;
        property Items[AIndex: Integer]: TLMDCompBarItem read GetItems; default;
        property Expanded: Boolean read FExpanded write SetExpanded;
        property Visible: Boolean read FVisible write SetVisible;
      end;
  • I've just checked 2011, 2012 and 2013 years - no Visible property. You probably added it yourself. Can you send us your code, we'll think of the possibility to incorporate it.
  • I don't remember if I modified or not this component. It was a long time ago :)!!

    Attached you can find the source code with that property
  • Incorporated. Minor release is planned very soon.
  • Thank you very much !!!
Sign In or Register to comment.