Using delphi 7, I have a TCollection/TCollectionItem set of descendents. They are intended to be set up in Design-time only, and should never be modified in Run-time. How can I do this? Design-time should always allow whatever edits are needed, but in Run-time, I don't want to be able to Add, Remove, or Re-index any of the items in the collection. The properties of each of those items, yes, I do want them to be enabled. But changing the actual items around shall only be in design-time.
Delphi TCollection - Possible to prevent changing items in run-time?
694 Views Asked by Jerry Dodge At
1
There are 1 best solutions below
Related Questions in DELPHI
- How to not load all database records in my TListbox in Firemonkey Delphi XE8
- How to catch WM_DEVICECHANGE in a control other than TForm?
- show information with Rolling / moving messages delphi xe7
- What is the different between "Console target" and "GUI target" in DCC32 option?
- How to add new online ressources to RAD Studio help system
- C# and Delphi code have different behaviour when importing unmanaged dll
- Loop through records on a cxgrid and update a field/column
- Delphi 7 - Save to a Specific .INI Files Name
- TImagelist for large images
- how to modify a function so it returns an array of strings
- Checking for internet connection in runtime
- How can I make the main form align correctly after my control height is autosized and then I maximize the form?
- fetch data from web service to dataset in Delphi
- Load candlestick data from file
- Infinite loop in parsing a string using pointer math
Related Questions in DELPHI-7
- Delphi 7 - Save to a Specific .INI Files Name
- Auto clear default text in a TEdit
- Remove specific XML element in Delphi
- Delphi 7 object undefinedat
- Missing operator or semicolon in Delphi 7
- Converting Integer number into hexadecimal number in delphi 7
- Why Application.OnException never runs?
- Delphi 7, TFileStream cant open files with special characters
- Multi Line Memo in delphi
- How to run without debugging in Delphi 7?
- Delphi : Sleep without freeze and processmessages
- TIdHTTPServer Getting content-length when receiving the PostStream
- How to check if the Application.MainForm is valid?
- How to resume/retry a broken TADOConnection across the application?
- I want to create or change an event on a form, dynamically, how can i do that?
Related Questions in CUSTOM-COMPONENT
- JSF 2.2 ViewDeclarationLanguage createComponent passes attributes as String?
- What is a good approach to building and distributing a React Native iOS component that extends iOS functionality?
- Angular add attribute(directive) before directive compiled
- ASP.NET API Controller method custom route - Include current URL
- Firemonkey custom component
- Using Tedit Inside of a FireMonkey component
- How to pass data from JavaScript code to Polymer custom element?
- Toolbar buttons not working in Edit View Joomla Custom Component
- Tags input component with support for space in tagname
- Updating components inside a custom ui:component when it is used multiple times on same page
- Create custom renderer for UIInput
- Sencha-Touch 2 Progress Bar Extending from Component Class and not seeing second child
- Local value, submitted value and value
- PSCustomObject foreach
- Custom property flow reading error
Related Questions in READONLY
- How in vb.net can I insert a value on a read only property?
- EditorFor do not accept Readonly or Disabled
- C# RichTextBox ReadOnly Event
- why i can't edit anything in my DataGridView?
- in jquery can i add a readonly attribute to a input that the only property i can touch is a function?
- How to manipulate a Word 2013 document opened in read only mode
- Salesforce Custom field in Edit Page ONLY
- Failed to push refs on a multi-user GIT Server
- How to add tab icon (change title text decoration) for read only files in Sublime Text 3
- postgreSQL readonly user is not working
- Typescript: extending an interface and redeclaring the existing fields as readonly
- Make all fields in an interface readonly in a nested way
- Read-Only Field in Django Form
- Read-Only properties
- Setting a readonly property of a class for unit testing
Related Questions in TCOLLECTION
- for all/for each looping through a Delphi TCollection?
- Saving vcl objects references in dephi with Tcollection
- Serialization of a TCollection which is not declared in a TComponent?
- Delphi TCollection - Possible to prevent changing items in run-time?
- TOwnedCollection and using multiple inherited TCollectionItem
- Persistent Polymorphic Lists in Delphi
- How do I reorder items in a TCollection?
- delphi 7: How can I find item of object collection?
- delphi TCollection count not increasing after Add
- return TCollection or array of objects from Dll
- TCollection PropertyEditor with editable Columns
- Getting the index # of a TCollection Item when added to a TCollection
- Using TCollection with an already-defined class
- The Fastest Way to Load an Array DML in Delphi FireDAC
- Creating a component with named sub-components?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can override the
Assign()andNotify()methods ofTCollectionto be notified of adds and deletes, and override theSetIndex()method ofTCollectionItemto be notified of reindexings. For adds/deletes, throw an exception to reject the operation (in the case of add, you will have to free the new item that was added). For reindexing, just exit without doing anything.To differentiate between run-time and design-time, walk through the Owner chain of
TCollection(in case it is nested inside of other classes) until you find aTComponent, then you can check itsComponentStateproperty for thecsDesigningflag.