Recent

Author Topic: Better Ideas are welcome to proxy controls to dynamically created TPAGES.  (Read 280 times)

jamie

  • Hero Member
  • *****
  • Posts: 7827
So I have this.

TMAINFORM
  TTABCONTROL
  TVSCROLLBAR
  THSCROLLBAR
  TNOTEBOOK
        //Dynamically created Sub Classed TPAGES.
       TPAGE......
           //Only one is selected at any given time of course.
//--------------//

This is the issue:
   All TPage subclasses need access to the TVSCROLLBAR, TVHSCROLLBAR and TTABCONTROL because I don't allow scrollbars on the TPAGES, they sit
outside on the main form. You can think of this as a portal window.

 This is what I've come up with to overcome this problem of Proxying these controls to all of the created TPages.
 
 I have a Data record which contains all items with their instance object pointers, and I use a USER message to post this to each TPAGE as it gets created.
 when the Page is selected, I update the ONSCROLL messages events to target so that these single scrollbars will get serviced to the correct TPAGE/

Is there any other way logical way to do this, or maybe I missed something?

P.S.
  The Tpages must also be able to adjust the TabControl and sliders so it's a two-way street.

BTW:
 I was going to use the LM_COPYDATA/WM_COPYDATA message but you guys don't have that, you skip over it?
$004A is it.

maybe we could add that to the Lmessages.Pas file ?


Jamie


 

         
« Last Edit: May 25, 2026, 02:30:24 am by jamie »
The only true wisdom is knowing you know nothing

cdbc

  • Hero Member
  • *****
  • Posts: 2855
    • http://www.cdbc.dk
Hi jamie
I do the same(ish) message-forwarding in one of my apps, it works nicely  ;D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

jamie

  • Hero Member
  • *****
  • Posts: 7827
I just thought of something! :o

 And I should of known since I suggest this to many also! USE A TAG!

I can create or point to a data center via the TAG property that lives in the base of the TPAGE and thus accessible to all inherited classes!

on the same note, there are child spowned classes from there on which also benefit from this Data block.

Quote of the day:

 I am not as good as I once was, but I am good at least once as I was! %)

Jamie

The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018