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 the for..in 
syntax to iterate thru the list.
    Link: 
http://francois-piette.blogspot.com/2012/12/writing-iterator-for-container.html

Happy New Year!
-- 
Francois PIETTE
Embarcadero MVP
http://www.overbyte.be
0
Francois
12/31/2012 7:41:38 AM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

1 Replies
863 Views

Similar Articles

[PageSpeed] 19
Get it on Google Play
Get it on Apple App Store

Francois wrote:

> 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.

The first article claims:

"I came to the conclusion that no code was readily available for the purpose"

The first thing that comes to my mind when designtime accessibility and DFM 
streaming are concerned is T(Owned)Collection.  You could define a TCollectionItem 
descendant that has an Integer property value, and then the standard TCollection 
designer can add integers to a TCollection-based property at design-time 
without having to write a bunch of custom code (although the condensed DFM 
data is nicer).


--
Remy Lebeau (TeamB)
0
Remy
12/31/2012 6:26:03 PM
Reply:

Similar Artilces:

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 ...

Attaching a property editor to a UnicodeString property, XE3
Like subject states, I'm trying to attach a custom property editor to a published UnicodeString property. What I've done, is following the example as listed in the help for RegisterPropertyEditor. Specifically, I've added the following: {code} PTypeInfo TypeInfo; PPropInfo PropInfo =GetPropInfo(__typeinfo(TForm), "BorderStyle"); if (PropInfo) TypeInfo = *(PropInfo->PropType); {code} and changed "BorderStyle" to "Caption, since I want the delphi type info for a string, and not an enumerated type. The help file clearly states that this met...

Custom property editor accessing other component properties
I have a component which has a custom property editor for one of its properties. The custom property editor is derived from TStringProperty and works as expected. I need to, however, modify the editor to show a number of user selectable items which depends on the value of another property in the same component. How do you design a property editor for a component that can reference other properties of the component besides the one that it is designed to edit? I am using BCB6. Regards FarmerJo John wrote: > I have a component which has a custom property editor for one of its &...

Objects and properties of properties
Okay, this should be an easy object oriented C# question, but for some reason I have been unable to find the answer yet. I am creating an object of my own called JAddress. And basically I want to be able to do the following: JAddress.ZipCode.Text JAddress.ZipCode.MyId I am unsure on how to create the second level of properties! Doing only a first level is really easy.....public string ZipCode { get { return m_ZipCode; } set { m_ZipCode = value; } }Does anyone know how to do this? Thanks in advance, csdietrich You would have its own ZipCode type (class) which...

Attaching a property editor to a UnicodeString property, XE3 [Edit]
Like subject states, I'm trying to attach a custom property editor to a published UnicodeString property. What I've done, is following the example as listed in the help for RegisterPropertyEditor. Specifically, I've added the following: {code} PTypeInfo TypeInfo; PPropInfo PropInfo =GetPropInfo(__typeinfo(TForm), "BorderStyle"); if (PropInfo) TypeInfo = *(PropInfo->PropType); {code} and changed "BorderStyle" to "Caption, since I want the delphi type info for a string, and not an enumerated type. The help file clearly states that this met...

How to make a simple AnsiString Property Editor for a FleName Property?
Hello, does anybody now how to make a simple AnsiString Property Editor for a FleName Property? Is there any example for this. thanks in advance <Hans Martin Brueckmann> wrote in message news:7985@forums.codegear.com... > does anybody now how to make a simple AnsiString Property > Editor for a FleName Property? This has been asked and answered many times before. Please go to http://www.deja.com and search the archives of the old Borland newsgroups. Gambit ...

Property Accessing other properties
 hello i am new to asp.net and also c# and trying to learn some basic concepts now. I am reading article about the font propertyI am a little confused here. My question is Font property belong to WebControl class Font properties belong to FontUnit Class. How does the Font property access the font properties in the FontUnit ClassPlease if somebody could clarify this point for methanx Hi, As far as I can see, FontUnit represents the size of a font. So please look the following code.         Button bt = new Button(); // we create  a ...

Custom property editor that can access other properties of a component.
I have a component that has a custom property editor for one of its properties. The editor provides a drop-down list of items that the user can select, this works as expected. I would like to modify the editor so that the list of items in the drop-down list depends also on the value of another property in the same component. How do I design a custom property editor that can access a property of a component other than the property for which the editor is registered? Regards FarmerJo John wrote: > How do I design a custom property editor that can access a property > of a compo...

Attaching a property editor to a UnicodeString property, XE3 [Edit]
Like subject states, I'm trying to attach a custom property editor to a published UnicodeString property. What I've done, is following the example as listed in the help for RegisterPropertyEditor. Specifically, I've added the following: {code} PTypeInfo TypeInfo; PPropInfo PropInfo =GetPropInfo(__typeinfo(TForm), "BorderStyle"); if (PropInfo) TypeInfo = *(PropInfo->PropType); {code} and changed "BorderStyle" to "Caption, since I want the delphi type info for a string, and not an enumerated type. The help file clearly states that this met...

Attaching a property editor to a UnicodeString property, XE3 [Edit] #2
Like subject states, I'm trying to attach a custom property editor to a published UnicodeString property. What I've done, is following the example as listed in the help for RegisterPropertyEditor. Specifically, I've added the following: {code} PTypeInfo TypeInfo; PPropInfo PropInfo =GetPropInfo(__typeinfo(TForm), "BorderStyle"); if (PropInfo) TypeInfo = *(PropInfo->PropType); {code} and changed "BorderStyle" to "Caption, since I want the delphi type info for a string, and not an enumerated type. The help file clearly states that this met...

Attaching a property editor to a UnicodeString property, XE3 [Edit] #2
Like subject states, I'm trying to attach a custom property editor to a published UnicodeString property. What I've done, is following the example as listed in the help for RegisterPropertyEditor. Specifically, I've added the following: {code} PTypeInfo TypeInfo; PPropInfo PropInfo =GetPropInfo(__typeinfo(TForm), "BorderStyle"); if (PropInfo) TypeInfo = *(PropInfo->PropType); {code} and changed "BorderStyle" to "Caption, since I want the delphi type info for a string, and not an enumerated type. The help file clearly states that this met...

Large text input in property Property grid editor part
In the propertygrideditorpart is there a way to have a textarea there, as in a multi lined textbox. I have a user control and on it there is a label that will be about a paragraph (4 - 8 lines) long and i want a user to be able to put their text into there. I was wondering if there was a better way of doing this with web parts, all ideas are welcome.Micky BIntranet Developer I've found the answer, all you have to do is override the EditorPart Class, this means that you have to do a bit more coding but you get what you want :)Micky BIntranet Developer...

Attaching a property editor to a UnicodeString property, XE3 [Edit] #2
Like subject states, I'm trying to attach a custom property editor to a published UnicodeString property. What I've done, is following the example as listed in the help for RegisterPropertyEditor. Specifically, I've added the following: {code} PTypeInfo TypeInfo; PPropInfo PropInfo =GetPropInfo(__typeinfo(TForm), "BorderStyle"); if (PropInfo) TypeInfo = *(PropInfo->PropType); {code} and changed "BorderStyle" to "Caption, since I want the delphi type info for a string, and not an enumerated type. The help file clearly states that this met...

Using VS CssClass Property Editor for custom control CssClass property
I am developing a custom composite control, which includes a Title and a Description label (among other things) I want to allow the user to define the CSS Class names for the control's components using specific properties, such as TitleCssClass, DescriptionCssClass.  At design time, I would like to provide the same editing experience offered by VS for the control CssClass, i.e. a dropdown list enumerating the available styles in the solution. How can I do that? I thought I could use some custom property attributes, to tell VS that a given control's property is in ...

Web resources about - Writing a TIntegerList property with his property editor and enumerator - embarcadero.delphi.general

Resources last updated: 12/7/2015 10:02:59 PM