Recent

Author Topic: Best way to exchange data between a form and a unit  (Read 35344 times)

cdbc

  • Hero Member
  • *****
  • Posts: 1160
    • http://www.cdbc.dk
Re: Best way to exchange data between a form and a unit
« Reply #165 on: April 08, 2024, 05:34:24 pm »
Hi
Code: Pascal  [Select][+][-]
  1.    _
  2.  ( ((
  3.   \ =\
  4.  __\_ `-\
  5. (____))(  \----   you're welcome :o)
  6. (____)) _  
  7. (____))
  8. (____))____/----
  9.  
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

Hansvb

  • Hero Member
  • *****
  • Posts: 625
Re: Best way to exchange data between a form and a unit
« Reply #166 on: April 14, 2024, 08:59:42 pm »
Hi,

Just as information.
I am now working on dynamically building components. This is done using a separate unit that is called from the model.
That all seems to work fine.
I still have some minor flaws when I abort a specific function, but I can't complain. (I'm figure it out).
This went better than expected.

cdbc

  • Hero Member
  • *****
  • Posts: 1160
    • http://www.cdbc.dk
Re: Best way to exchange data between a form and a unit
« Reply #167 on: April 14, 2024, 09:22:38 pm »
Hi
Quote
That all seems to work fine.
I still have some minor flaws when I abort a specific function, but I can't complain. (I'm figure it out).
This went better than expected.
Dang mate, this, I'm so glad to hear, Good on you  8-)
...and Yup, the model is king  :D allthough the presenter has a few tricks up its sleeve too  ;)
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

Hansvb

  • Hero Member
  • *****
  • Posts: 625
Re: Best way to exchange data between a form and a unit
« Reply #168 on: April 21, 2024, 05:28:58 pm »
It's weekend again so I'm doing some tinkering.

Quote
allthough the presenter has a few tricks up its sleeve too
I'll bite later :)

In the mainView I have placed a radio group with 3 options. I also have a number of stringgrids in the MainView.
Depending on the selected radio button, more or fewer columns are visible in the stringgrids. I do this switching on and off of the columns in the view. It's all visual, but I still doubt whether turning columns on/off shouldn't be moved to the Model. There will probably be more logic behind the radiogroup buttons later, which should certainly go to the Model.

What is wise?

Edit:
I think I already have my answer. I'm looking at one of the examples where you reset a progress bar. that's basically the same idea. it's all visual but still happens in the Model.
« Last Edit: April 21, 2024, 05:56:13 pm by Hansvb »

cdbc

  • Hero Member
  • *****
  • Posts: 1160
    • http://www.cdbc.dk
Re: Best way to exchange data between a form and a unit
« Reply #169 on: April 21, 2024, 06:41:13 pm »
Hi
Yup, that example seems to 'fit the bill', just had a look  ;)
Quote
allthough the presenter has a few tricks up its sleeve too
With that, I was mainly thinking of the 'TransactionManager' and friends...
One could say that, if Model is King, then Presenter is Queen(controlling the king)  :D
edit: Ps.: Tinkering can be a lot of fun & cool stuff, often comes from tinkering.
Regards Benny
« Last Edit: April 21, 2024, 06:48:53 pm by cdbc »
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

 

TinyPortal © 2005-2018