Recent

Author Topic: Non-visual RTTI component?  (Read 1109 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Non-visual RTTI component?
« on: June 04, 2024, 05:32:20 am »
Is there any non-visual RTTI component? I want this to connect between frame/forms, so that I can minimize my code typing  :D

Of course, I can drop a visual component and set its visibility false. Just wondering whether there are any non-visual component.

jamie

  • Hero Member
  • *****
  • Posts: 6516
Re: Non-visual RTTI component?
« Reply #1 on: June 04, 2024, 11:19:55 pm »
DataModule ?

The only true wisdom is knowing you know nothing

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Re: Non-visual RTTI component?
« Reply #2 on: June 05, 2024, 02:50:53 am »
Hi jamie,

Datamodule is not exactly what I'm looking for, but your single comment gives me a great insight. Multiple forms containing rtti controls may share single datamodule and published property so that any change in one form is reflected in other forms automatically. This is really great. I forgot what I was looking for exactly :D   I'll think over again. Anyway thank you for kind comment.


jamie

  • Hero Member
  • *****
  • Posts: 6516
Re: Non-visual RTTI component?
« Reply #3 on: June 05, 2024, 03:21:10 am »
Controls/Classes that houses a TPersistent at the base of the classes have observers and observed where you can notify others
etc

 Just and idea, I use something close to it in an automation application, whereas other classes of the same can receive notification events automatically and vice versa.
The only true wisdom is knowing you know nothing

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Re: Non-visual RTTI component?
« Reply #4 on: June 05, 2024, 07:20:22 am »
What I wanted is to put a non-visual RTTI controls in a form, with its TIObject pointing to other components. So I thought setting the Rtticontrol invisible. And I can set other codes within the setter of the property of the TIObject (like showing / unshowing or limiting values, etc. to other forms).

As an example, I put a (invisible) TTIEdit in Form1, whose TIObject/TIPropertyName points to DataModule1/AIndex. Here, I can set Label1 of Form2, TIEdit of Form3, etc.

But I found simpler solution. I can create the rtticontrols within the form with code, and do not assign patent to it. Then it's invisible.

cdbc

  • Hero Member
  • *****
  • Posts: 1497
    • http://www.cdbc.dk
Re: Non-visual RTTI component?
« Reply #5 on: June 05, 2024, 07:45:13 am »
Hi
Why not just use unit 'TypInfo', write the rtti-code yourself and the use the 'Observer-pattern' for the notifications?!? It's not /that/ complicated...
Just saying my 2 cents worth...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Re: Non-visual RTTI component?
« Reply #6 on: June 05, 2024, 08:27:13 am »
Quote
Why not just use unit 'TypInfo', write the rtti-code yourself and the use the 'Observer-pattern' for the notifications?

Simply I don't want to learn any more :D

alpine

  • Hero Member
  • *****
  • Posts: 1240
Re: Non-visual RTTI component?
« Reply #7 on: June 05, 2024, 09:20:29 am »
As an example, I put a (invisible) TTIEdit in Form1, whose TIObject/TIPropertyName points to DataModule1/AIndex. Here, I can set Label1 of Form2, TIEdit of Form3, etc.
Only after a few days you'll wonder "from where the hell was that changing from?". I have that experience with the C# data/property bindings. But it is your call, actually.
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Re: Non-visual RTTI component?
« Reply #8 on: June 05, 2024, 10:16:20 am »
As an example, I put a (invisible) TTIEdit in Form1, whose TIObject/TIPropertyName points to DataModule1/AIndex. Here, I can set Label1 of Form2, TIEdit of Form3, etc.
Only after a few days you'll wonder "from where the hell was that changing from?". I have that experience with the C# data/property bindings. But it is your call, actually.

Yes.. I'm little afraid that. But trying to make regular pattern. Thank you for your comment, and please keep advising me. I'm trying several methods.

 

TinyPortal © 2005-2018