I am using a custom control… it basically is nested set of container controls with the lowest level being dynamic and added using EmbedWithin. [Note… I did not write this, but its pretty cool [StackControl 1.07 by Martin Trippese]]
What I need is to add some more event handling, Each of the embedded container controls can be customized any way you like… but what I need is to have each subclass be able to raise an event to pass a message to the application level somehow.
Could I create a global method [Sub gotTheMessage(msg as string)]
and somehow have each of those embedded classes call it some how?
AddressOf? if so how?
Nobody have any insight on how to pass an event/message/data from a control (textfield, popup etc) on an embedded container control to the application level? I have dozens of embedded controls and each needs to pass information about its particular controls to a central routine to be processed.
Dave, do you mean like the Apple Pages property panel? So you select a text and get all the properties of the selected text in the property panel and can you change them?
Never seen that page… but this is taking the Property Inspector in your Stack demo and attempting to make it a working control. I have defined about a dozen specialized views (each for a different type of property) and I need to be able to populate from a external source, and then react in REALTIME when any control on any view is modified.
But yeah (I just fired up Pages), and its the same idea as the Xojo Property Inspector
So basically… I need to take a control event from a “VIEW” and be able to promote it (or something) to the window that enclosed the StackControl
Dave I will build you a small example in the course of the day, hoping that I have understood you correctly.
Just so that I understand it correctly and don’t work for nothing, it’s about you having a ListBox, for example, that shows objects with different properties. If you now select an entry in the ListBox, the correct dashboard should appear dynamically for it, in which you can change the properties of the selected object in real time, right?
to keep the terms straight… by LISTBOX I hope you mean STACKCONTROL (yours)
say I have a StackControl, and that stack control contains 3 Views (inserted using ADDVIEW, so a DYNAMIC window)
(for example, but not limited to )
- View #1 has a textfield
- View #2 has two buttons
- View #3 has a slider
If Textfield is changed, OR either button is Clicked, OR the slider is moved, an event of some type needs to be exposed to the application.
I would like it to be a single “event” and not a specific event for every single control, something where I can send a “message” with embedded information
- View#1 (for example) - SENDMESSAGE(“TEXTFIELD”,“CHANGED”,textfield1.text)
- View#2 (for example) - SENDMESSAGE(“BUTTON”,“CLICKED”,index)
- View#3 (for example) - SENDMESSAGE(“SLIDER”,“CHANGED”,str(slider1.value))
where it all ends up in ONE METHOD exposed to the application
So, why dont just do that?
Create an event, call raiseevent with whatever params you want
I built you a little example 56324 - RaiseEvent from an array of Controls (StackView). As Ivan suggests, the whole thing works through events.
For the demo I have recreated the Xojo Inspector for TextFields. Just select one of the three TextFields on the left side and its properties will be displayed on the right side, which you can change in realtime. You only have to replace the StackView folder with your licensed version!
I hope this helps. Send me a mail with a screenshot, as it looks in your program (I know what you’re working on)
That seems to be fine for a STATIC Stackcontrol. So the event path can also be static.
but I need to do it with a DYNAMIC one. a VIEW created with EMBEDWITHIN has NO PARENT to put the event handler on.
Martin… I sent you my test project