Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Disable object inspector in designer window

edited November 2008 in End User
Hi,

We have an end user implementation but we don't want to allow the end
users access to the object inspector. Is there a way to disable parts of
the OI or the whole thing? Specifically we don't really want them to be
able to alter anything apart from things like pen and brush properties for
the selected object (which can be done with the right click menu anyway).

Also, on the preview tab we only have one button showing. To access the
others the user has to click the little down arrow and another menu pops
up with things like zoom settings and a print button. How do we get it so
all of these appear on the menu bar instead of just the last button clicked?

I have searched the forum first but I'm unable to find answers to these
questions.

Thanks.



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited December 2008
    Hi,

    1. Take a look at the following rbWiki article.

    http://www.digital-metaphors.com/rbWiki/End-User/Designer/How_To...Hide_Object_Inspector_Properties

    2. Which version of ReportBuilder are you using? Are you using the
    built-in previewer? The built-in previewer does not require a drop down
    arrow to access the menu items. Take a look at the ppPreview.pas file for
    how the toolbar items are placed on the top toolbar for the default preview
    window.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2008
    re: removing the items from the object inspector

    This works...but anything I remove from, say, the 'Storage' menu gets
    added to a new 'Miscellaneous' menu!



    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2008
    Ignore this message, I found the solution: add the items to the 'Ignore'
    section and they don't end up in the Miscellaneous menu.



    --- posted by geoForum on http://delphi.newswhat.com
  • edited October 2009
    Hello,
    when I'm trying to hide some categories of the object inspector, I see my
    changes only next time.
    That's the same in the example form the rbWiki:

    - I click at "Design" -> "EmailSettings" is visible under "User interface"
    - I close the designer and click at "Hide Categories" -> click at
    "Design" -> "EmailSettings" is still visible under "User interface"
    - I close the designer and click at "Design" again afterwards -> now
    "EmailSettings" isn't visible anymore...

    If I restart the demo application and click at "Hide Categories" first and
    then at "Designer", then "EmailSettings" isn't visible either.

    Because of the renaming of the RootNode of the DataTree (see my other entry
    about it), I call my procedure *after* showing the Designer. Here I probably
    would have to call it *before*... A bit confusing...
    In my case the second call happens after the whole form is freed and created
    again, so looks like a potential issue of saving of such properties to the
    RBuilderIni or so. Just a guess...

    What is wrong here? What can I do?

    Also the unanswered question again: how can I hide the whole object
    inspector completely and leave the ReportTree only?

    Regards,
    Mark


  • edited October 2009
    Hi Mark,

    The example is primarily to show how the feature works, not to be used in a
    real-world application. The inspector was not really designed to be able to
    hide and show categories on demand.

    What exactly would you like to happen in your application? Typically you
    would set up how you would like your designer to look once before calling
    Show.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,


    Hm, then I don't understand the purpose, I fear. You say that it's a feature
    and show how it works, but it shouldn't be used?


    Actually that wasn't even what I wanted to do originally. I wanted just to
    hide the ObjectInspector only, i.e. completely. Then I saw the articles
    about hiding of categories and thought, that I could use this too maybe.
    If it's not to be used, it's fine (but bummer, actually), but in any case I
    still would like to know, how to hide the ObjectInspector itself. It's
    possible via the contextmenu, but I didn't find a way to accomplish that...

    As for configuring the designer *before* showing:
    that was what I was doing originally, but if you remember the other
    news-entry from me, at least for renaming of the top-node in the DataTree, I
    had to do it either in the OnShow event or after showing. Or I need to split
    my configuring procedure into two part: one for the call before showing, one
    for the call after showing. The part for the renaming of the DataTree node
    has even to be called everytime OnTabChange either, as you stated.
  • edited October 2009
    Hi Mark,

    I understand what you are describing now. I will research this and get back
    to you as soon as possible.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Mark,

    It seems the example was only half completed. Once you remove the property
    from a given category, it needs to be added to the "Ignore" category so it
    does not display in the Miscellaneous category. Something like the
    following

    var
    lPropertyCategory: TppPropertyCategory;
    liIndex: Integer;
    begin
    lPropertyCategory :=
    TppPropertyCategoryManager.PropertyCategories.ItemByName['User Interface'];

    liIndex := lPropertyCategory.PropertyNames.IndexOf('EmailSettings');

    lPropertyCategory.PropertyNames.Delete(liIndex);

    lPropertyCategory :=
    TppPropertyCategoryManager.PropertyCategories.ItemByName['Ignore'];

    lPropertyCategory.PropertyNames.Add('EmailSettings');

    end;

    I will update the example on the Wiki.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,
    I'm pretty sure that's exactly the example how it is / was on the Wiki
    already.

    I copied it from there and tried it out. It doesn't work correctly. The
    behaviour is how I did describe it.
    I don't see anything different in my code compatred to what you do in yours.

    Mark

  • edited October 2009
    Hmm, it appears my local example did not match up with the Wiki example.

    Ok, disregard my last post. Re-reading your first post, I am still unclear
    about when you are calling the code to hide an inspector property. I
    understand you are changing the capiton of the DataTree in the OnShow event.
    Why is it not possible to hide the inspector property before this?

    It doesn't look like the inspector or inspector panel are exposed so they
    can be manually hidden. I will do this for the next release.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Looking at it further, there is no need to expose the inspector to hide it.
    You can set the visibility of the inspector using the SetInspectorVisible
    routine.

    var
    lLayoutManager: TppDesignLayoutManager;
    lToolManager: TppDesignToolManager;
    lReportTree: TppReportTreeWindow;
    begin

    lLayoutManager := ppDesigner1.Form.LayoutManager;
    lToolManager := lLayoutManager.ToolManager;
    lReportTree :=
    TppReportTreeWindow(lToolManager.ToolWindows.ItemsByName['ReportTreeWindow']);

    lReportTree.SetInspectorVisible(False);

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    > Ok, disregard my last post. Re-reading your first post, I am still

    It is possible of course :)
    When I started, I thought that it's correct to configure the designer first
    and then show it. It worked so far, until the "issues" with the first node
    of the DataTree came up. For that it was necessary to call my routine in
    OnShow or after showing and that was my last status.

    On the other side a few cases came up, where configuring the designer after
    showing or in OnShow didn't work well (like the ObejctInspector thing etc.).
    In one of my last replies I was already guessing, that I would probably have
    to split the routine in two parts. That's what I did now and it seems to
    work, finally.

    And then there is the Wiki example, which added some confusion too somehow:
    ------------------------------------------
    1) When I click at "Design" -> "EmailSettings" is visible under "User
    interface"
    2) Then I close the designer and click at "Hide Categories" -> then click at
    "Design" -> "EmailSettings" is still visible under "User interface"
    3) Afterwards I close the designer again and click at "Design" again -> now
    "EmailSettings" isn't visible anymore...

    - If I restart the demo application and click at "Hide Categories" *first*
    and *then* at "Designer", then "EmailSettings" isn't visible either.
    ------------------------------------------

    But well, it seems to work inmy application now and that's the important
    thing :)


    Sounds good, thank you for that and for your help!

    Kind reagrds,
    Mark
  • edited October 2009
    Oops, that was easy...

    Was looking for something like
    lReportTree.ObjectInspector.Visible
    or so, but should have found the SetInspectorVisible routine too.

    Thank you, Nico!

This discussion has been closed.