Hiding a published property from Structure View

Is it possible to prevent a given property being exposed in Structure View? (XE5)

More specifically: 

I have a component with a published TCollection property for which there is a registered custom editor. The collection should only be manipulated using the custom editor. However, Structure View exposes the collection and lists all its items. The user can select, alter and add new items using the default IDE collection editor features.

I do not want the collection property exposed like this in Structure View.
0
Brent
1/2/2014 9:51:33 PM
public.delphi.vcl.writing 510 articles. 0 followers. Follow

10 Replies
1143 Views

Similar Articles

[PageSpeed] 51

Brent,

| I have a component with a published TCollection property for which
| there is a registered custom editor.

How about making the property Protected instead of Published?  


-- 

   Q 

01/02/2014 16:46:40

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
1/3/2014 12:47:33 AM
That would prevent the collection being streamed to/from the DFM file, and also hide it from the Object Inspector. It must be published.

I want to edit the collection at design time using the custom editor - which happily overrides the default collection editor in the Object Inspector, but not in the Structure View (there is a loophole as it stands)... 

I know method UnlistPublishedProperty will hide a published property from the Object Inspector, so maybe there is something similar for Structure View?

> {quote:title=Quentin Correll wrote:}{quote}
> Brent,
> 
> | I have a component with a published TCollection property for which
> | there is a registered custom editor.
> 
> How about making the property Protected instead of Published?  
> 
> 
> -- 
> 
>    Q 
> 
> 01/02/2014 16:46:40
> 
> 1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Brent
1/3/2014 2:39:53 AM
Brent Rose wrote:
> That would prevent the collection being streamed to/from the DFM file, and also hide it from the Object Inspector. It must be published.
> 
> I want to edit the collection at design time using the custom editor - which happily overrides the default collection editor in the Object Inspector, but not in the Structure View (there is a loophole as it stands)... 
> 
> I know method UnlistPublishedProperty will hide a published property from the Object Inspector, so maybe there is something similar for Structure View?
> 
>> {quote:title=Quentin Correll wrote:}{quote}
>> Brent,
>>
>> | I have a component with a published TCollection property for which
>> | there is a registered custom editor.
>>
>> How about making the property Protected instead of Published?  
>>
>>
>> -- 
>>
>>    Q 
>>
>> 01/02/2014 16:46:40
>>
>> 1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]

You will probably have to write your own Sprig design time code and register it. 
  I haven't messed with anything but the design time IBX code so can't help much 
around it (I wrote it in the D6 days and haven't had to touch it since) and it 
is not documented.  You can start by looking at TreeIntf.pas.  Grep the source 
on Sprig and you will see multiple examples, but that is about as documented as 
sprigs ever got I think.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
1/3/2014 5:45:24 AM
Brent,

| I know method UnlistPublishedProperty will hide a published property
| from the Object Inspector, so maybe there is something similar for
| Structure View?

Damifino, over my head.

-- 

   Q 

01/02/2014 22:33:44

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
1/3/2014 6:34:10 AM
> {quote:title=Quentin Correll wrote:}
> | I know method UnlistPublishedProperty will hide a published property
> | from the Object Inspector, so maybe there is something similar for
> | Structure View?
{quote}

From what I know (and I've searched a lot on this subject), the UnlistPublishedProperty method is the unique way to hide a previously published property from object inspector. Here is a sample of how unregister the Color property from an edit box:

{code}
namespace Tmyedit
{
    void __fastcall PACKAGE Register()
    {
         TComponentClass classes[1] = {__classid(TMyEdit)};
         RegisterComponents(L"TMyControls", classes, 0);

        ::UnlistPublishedProperty(__classid(TMyEdit), "Color");
    }
}
{code}

I never tested, but I suppose to completely disable a property, it should be declared as protected (if it is still used internally), or private, in addition to being unregistered from object inspector.
0
Jean
1/3/2014 3:52:32 PM
Jean-Milost Reymond wrote:
>> {quote:title=Quentin Correll wrote:}
>> | I know method UnlistPublishedProperty will hide a published property
>> | from the Object Inspector, so maybe there is something similar for
>> | Structure View?
> {quote}
> 
> From what I know (and I've searched a lot on this subject), the UnlistPublishedProperty method is the unique way to hide a previously published property from object inspector. Here is a sample of how unregister the Color property from an edit box:
> 
> {code}
> namespace Tmyedit
> {
>     void __fastcall PACKAGE Register()
>     {
>          TComponentClass classes[1] = {__classid(TMyEdit)};
>          RegisterComponents(L"TMyControls", classes, 0);
> 
>         ::UnlistPublishedProperty(__classid(TMyEdit), "Color");
>     }
> }
> {code}
> 
> I never tested, but I suppose to completely disable a property, it should be declared as protected (if it is still used internally), or private, in addition to being unregistered from object inspector.

The Structure pane is totally different than the object inspector.  Unlist... is 
a OI only thing.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
1/3/2014 6:23:09 PM
Jean,

Thanks for that info!!!  

Hope it works for Brent's issue!  


-- 

   Q 

01/03/2014 10:23:23

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
1/3/2014 6:24:29 PM
Thanks Jeff. I see what you mean with TSprig... but a wee reality check makes me doubt the efficacy of attempting such a low level approach to prune this tree.

Far easier, I think, just to live with the proviso "don't mess with the collection in Structure View!" and lump it instead ;-)
0
Brent
1/3/2014 9:41:06 PM
Brent Rose wrote:
> Thanks Jeff. I see what you mean with TSprig... but a wee reality check makes me doubt the efficacy of attempting such a low level approach to prune this tree.
> 
> Far easier, I think, just to live with the proviso "don't mess with the collection in Structure View!" and lump it instead ;-)

You might just try registering a nil TSprig for that class and it might 
disappear from the structure pane.  If that works great, if not shouldn't take 
but a few minutes to test.  Sprigs are registered like

   RegisterSprigType(TIBSQL, TIBSQLSprig);

in your Register procedure.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
1/3/2014 10:10:25 PM
Brilliant - thanks Jeff!!

Registering a nil sprig for the collection class worked perfectly (I thought I would need to develop a custom sprig and get into all sorts of strife...). The collections tree node (sprig) is removed, and a dbl-click or context menu from the component node in Structure View opens the component editor.

   RegisterSprigType(TMyCollection, nil);

Appreciate your persistence in providing help :-)
0
Brent
1/4/2014 1:00:09 AM
Reply:

Similar Artilces:

Register Property to view in Delphi IDE Structure Window
Hi People, all fine? Guys, I have a many components that meet certain requirements created for our company. The Delphi have a old bug about the collections, as QC (http://qc.embarcadero.com/wc/qcmain.aspx?d=55558) that I posted a few years ago. There are two solutions for this problem, the first is to remove items from the collection by the Structure window of the Delphi IDE, the other, is to access the DFM file and delete itens from the collection. Thus, I would like to know how do I register so that my property (TCollection) appears in the IDE Structure. Example of this,...

hiding published property
hello one and all, i have a descendent class and i want to hide certain published properties from its ancestor. i thought if i re-declared it under protected or public it would do the trick, but no avail. how do i do that? thanx in advance. lucas stephen lukacs wrote: > i have a descendent class and i want to hide certain published > properties from its ancestor You cannot reduce visibility. If you can inherit from a TCustomxxx, then you may be able to achieve your goal. Another option would be to not inherit from, but contain an instance of, the class of interest. T...

Hiding published properties of parent
Hi, I've created some custom grids from a parent grid. I'd like to be able to "hide" some of its parents' published properties. For instance, one of my child grids will only be 2 columns wide.In this case I'd like to hide its published ColCount property. I will ignore the behaviour by overriding the parent functionality. Is this even possible? Thanks On 2010-12-01 18:48:08 +0000, dal 2 said: > I've created some custom grids from a parent grid. I'd like to be able > to "hide" some of its parents' published properties. For ins...

Hide subcomponents in structure view?
Hi :) I'm trying to write a visual component descended from TPanel. I've defined two private subcomponents (a TPanel and a TImage). The problem is that when I drop it on a form I can see these private subcomponents in the structure view, alter their properties, even delete them! I don't want to expose these subcomponents except through properties. Am I missing something obvious here? I'm new to Delphi XE, previously I've used Delphi 7 where this doesn't happen. I've tried searching the net and these forums but there doesn't seem to be any discussion of this...

Delphi VCL components properties history articles
Hi, i would like to know where i can found Delphi VCL components properties history information because i need to know from wich Delphi version a property exists or from wich version a protected procedure was marcked with "virtual" command from a standard component. Thanks, Maurício "Julio Pião" <=?Utf-8?Q?Julio_Pi=C3=A3o?=> wrote in message news:292952@forums.embarcadero.com... > i would like to know where i can found Delphi VCL components > properties history information AFAIK, that kind of list does not exist anywhere. > i ...

Published properties and property editor... how to?
+Sorry if these questios are already answered.... i'm pretty sure i've seen somewhat related but after 40 mins of searching i'm unable to find it.+ Working with BDS2006 I have a component, derived from another not developed by me, that need to show some properties in the Inspector. They are: - FONT (the standard Font thing: the ancestor does not have this property, and basically i need to "expose" the Font of a TLabel. 2 pictures ("OnPicture" and "OffPicture"). I'm just unable to make these properties appears in the Object inspector, and ...

View Propertie/Query Propertie bug
Hi, please see my view code: SELECT b.Carteira, b.LastroID, b.Data, MIN( b.RegUnificacao ) RegUnificacao, SUM( b.Quantidade * o.ZasMA) Quantidade, SUM( b.Valor * o.ZasMA ) Valor, ISNULL( SUM( cmp.Quantidade ),0 ) QtdCompras, ISNULL( SUM( cmp.Valor ),0 ) ValorCompras FROM MC4Boleta b ( INDEX = MC4Boleta_IE4 ), Operacao o, MC4Boleta cmp WHERE o.ID = b.Operacao AND b.Tipo = 1 AND b.DataRetorno IS NULL AND b.bEstornado IS NULL AND b.RegEstorno IS NULL AND cmp.Operacao = 100 AND cmp.DataRetorno IS NULL AND cmp.bEstornado IS NULL AND cmp.RegEstorno IS NULL AND cmp.Carteira =* b....

superreview granted: [Bug 289366] editorOverlay inserts a second menupopup into message compose view show/hide menu : [Attachment 180449] Do not use editorOverlay for view menu Show/Hide
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has granted Justin Wood (irc: Callek) <bugspam.Callek@gmail.com>'s request for superreview: Bug 289366: editorOverlay inserts a second menupopup into message compose view show/hide menu https://bugzilla.mozilla.org/show_bug.cgi?id=289366 Attachment 180449: Do not use editorOverlay for view menu Show/Hide https://bugzilla.mozilla.org/attachment.cgi?id=180449&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> >diff -u -r1.279 messengercompose.xul...

superreview requested: [Bug 289366] editorOverlay inserts a second menupopup into message compose view show/hide menu : [Attachment 180449] Do not use editorOverlay for view menu Show/Hide
Justin Wood (irc: Callek) <bugspam.Callek@gmail.com> has asked neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> for superreview: Bug 289366: editorOverlay inserts a second menupopup into message compose view show/hide menu https://bugzilla.mozilla.org/show_bug.cgi?id=289366 Attachment 180449: Do not use editorOverlay for view menu Show/Hide https://bugzilla.mozilla.org/attachment.cgi?id=180449&action=edit ------- Additional Comments from Justin Wood (irc: Callek) <bugspam.Callek@gmail.com> Yes that first line change is a BOM, according to bz anyway t...

ANN: Gnostice PDFtoolkit VCL v3.3 released
Gnostice Information Technologies is pleased to announce the release of PDFtoolkit Version 3.3. Highlights of this release are the ability to add digital signatures to PDFs, viewing and printing optimizations, and support for Delphi 2010. Whether you are creating your PDFs using eDocEngine or other tools or just processing PDF documents input from different sources, now you can equip your applications to generate PDF documents that the users of the documents can establish the authenticity of. This is achieved by PDFtoolkit's new capability to digitally sign PDF documents. Hist...

Atlas control properties not showing up in the properties view
I tried following the tutorials when I installed the Atlas Control Toolkit by creating a new Atlas website and adding the Atlas controls to the toolbox and dragging a confirmation extender to the Default.aspx and then I attempted to edit the Confirmation Text in the properties panel, but the only properties available to me was Enable View State, Data-Expressions, Misc-ID and scriptpath. Does anyone have an idea what is wrong, with my Atlas Installation? TIA, Dale Sides Select the control you're extending, not the extender itself.  I know this is confusing - we're working through ...

Writing a TIntegerList property with his property editor and enumerator
Hi ! I wrote a blog article about writing a class to implement a list of integers suitable as a component property (TList<Integer> isn't suitable for such use) having his own property editor. This TIntegerList merely looks like TStringList but has integers instead of strings. Using the object inspector, you can edit the list of integers. Link: http://francois-piette.blogspot.com/2012/12/tintegerlist-property-and-property.html I wrote a second article explaining how to add an enumerator or iterator to TIntegerList class. Having an enumerator allows you to use th...

Delphi 2009: missing View | Delphi Class Explorer
As far as I know, I'm supposed to have a menu item View | Delphi Class Explorer in Delphi 2009 Pro. But I cannot find it. I don't even see it as an option in the menu Customize commands. All available features were selected when Delphi was installed. What have I done to lose the Class Explorer? Steve Troxell > {quote:title=Steve Troxell wrote:}{quote} > As far as I know, I'm supposed to have a menu item View | Delphi Class > Explorer in Delphi 2009 Pro. But I cannot find it. I don't even see it > as an option in the menu Customize commands. All av...

How to get the properties box to display properties while in source view mode?
The book shows that it's like automatically done and assumed that my VWD is set up to do this. I have never seen this working, can't figure out how to get the properties window to display properties via the pages source view. I have always seen it via details view.How can I enable this feature?   http://weblogs.asp.net/scottgu/archive/2006/12/19/html-source-editing-performance-improvements-in-vs-2005-sp1.aspx Remember to check "Show all settings" Regards,PrashantDont forget to click "Mark as Answer" on the post that helped you. Thank you so...

Web resources about - Hiding a published property from Structure View - public.delphi.vcl.writing

List of anonymously published works - Wikipedia, the free encyclopedia
Throughout the history of literature , since the creation of bound texts in the forms of books and codices , various works have been published ...

Facebook IPO Primer Published
Someone wrote a whole book dedicated to Facebook’s initial public offer ? That’s like asking whether there’s a whole blog dedicated to Facebook. ...

Now it's official! It has been published in the media. Facebook has just release - Facebook-Hilfeforum ...
Now it's official! It has been published in the media. Facebook has just released the entry price: $5.99 to keep the subscription of your status ...

Meet Phineas Gage... Or how flickr changed our life *New photograph of Gage published! - Flickr - Photo ...
... We have corresponded and collaborated with the world's leading authority on Gage. Amazingly we have also written an article that will be published ...

Dexter Holland Discusses His Recently Published Paper 3/22/2013 - YouTube
The Offspring's Dexter Holland talks about the paper he recently published for his doctorate: Identification of Human MicroRNA-Like Sequences ...

Indonesia demands explanation from Australia over WikiLeaks-published court order
The Australian government&#8217;s attempts to protect international relations by suppressing details of a sensitive court case in Victoria appeared ...

Ashley Madison hack: Blackmail warning after user data published on the internet
The leak of cheating website Ashley Madison's database leaves Australian security researcher Troy Hunt in no doubt that the information will ...

Australian man wins defamation case against Google over images published online
AN Australian man has won a landmark defamation case against Google after images of him were published alongside gangland figures including drug ...

Secrets behind James Bond revealed on 60th anniversary of first book being published
IT IS one of the most famous lines in cinema history, but the legendary introduction, "Bond&#8201;.&#8201;.&#8201;. James Bond", might never ...

Tolkien's first prose to be published
The first prose piece by Lord of the Rings author J.R.R. Tolkien, written in 1914-1915 will be published.

Resources last updated: 11/26/2015 9:34:36 PM