Accessing Designer.ObjectsTB1

I have a routine that I use to hide unwanted control from the toolbuttons.

Example:
for i := 0 to Designer.ObjectsTB1.ButtonCount - 1 do
begin
   if ( CompareText( Designer.ObjectsTB1.Buttons[i].Hint, 'Copy Format Tool' ) = 0 ) then 
      Designer.ObjectsTB1.Buttons[i].Visible := false;
   //...
end;

Works Ok, although I would have preferred to use the ClassName of some other property other than the Hint (suggestions welcome).
Question #1: What else can I use to figure out what class this is as they are all TToolButtons.

An other issue is when the user clicks on either the Code or Data tab (from the Page1 tab), the unwanted 'Copy Format Tool' control re-appears.
Question #2: How can I access the tab change event so I can call my routine again?

Custom Control

I created a custom control that my users can select when designing their reports. One of its properties is an enumerated type which gets displayed as a dropdown. So far so good. This property has a a "Get" and "Set" routine, when the user selects/changes the property the original value is used in the set routine (not the one I select). In fact, after trying to change a few more enumerated properties, none of them stick.

Question #3: What do I have to do to make the selected property change stick?

Richard

Comments

  • edited 12:28AM
    Anyone? Does anybody from FastReport monitor these posts?


    Richard17 wrote: »
    I have a routine that I use to hide unwanted control from the toolbuttons.

    Example:
    for i := 0 to Designer.ObjectsTB1.ButtonCount - 1 do
    begin
       if ( CompareText( Designer.ObjectsTB1.Buttons[i].Hint, 'Copy Format Tool' ) = 0 ) then 
          Designer.ObjectsTB1.Buttons[i].Visible := false;
       //...
    end;
    

    Works Ok, although I would have preferred to use the ClassName of some other property other than the Hint (suggestions welcome).
    Question #1: What else can I use to figure out what class this is as they are all TToolButtons.

    An other issue is when the user clicks on either the Code or Data tab (from the Page1 tab), the unwanted 'Copy Format Tool' control re-appears.
    Question #2: How can I access the tab change event so I can call my routine again?

    Custom Control

    I created a custom control that my users can select when designing their reports. One of its properties is an enumerated type which gets displayed as a dropdown. So far so good. This property has a a "Get" and "Set" routine, when the user selects/changes the property the original value is used in the set routine (not the one I select). In fact, after trying to change a few more enumerated properties, none of them stick.

    Question #3: What do I have to do to make the selected property change stick?

    Richard

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.