Create Control by Name
Hi,
It is possible creating a control by his name
For example like
Control ct = new Control(„Button“)
It is possible creating a control by his name
For example like
Control ct = new Control(„Button“)
Re: Create Control by Name
Yes, there is an internal factory available for that. Please, indicate us more information about what you need and also the language you are using.
Re: Create Control by Name
HI,
thanks, for your reply. At runtime (C++) I need to create buttons and other controls. A client sends a Message to my C++ GUI App like "Listbox01.add.Button:btn01",
and the GUI-App now should find the control with the name "Listbox01", create a new Button with the name "btn01", set die Clickevent to my standard eventhandler "DefaultButtonClick" which progess all button clicks in the Gui-App and finally append this new Button at the Listbox "Listbox01".
thanks, for your reply. At runtime (C++) I need to create buttons and other controls. A client sends a Message to my C++ GUI App like "Listbox01.add.Button:btn01",
and the GUI-App now should find the control with the name "Listbox01", create a new Button with the name "btn01", set die Clickevent to my standard eventhandler "DefaultButtonClick" which progess all button clicks in the Gui-App and finally append this new Button at the Listbox "Listbox01".
Re: Create Control by Name
You can use the C++ factory for that:
Code: Select all
#include <NsCore/Factory.h>
Ptr<BaseComponent> CreateByName(const char* name)
{
return Factory::CreateComponent(Symbol(name));
}
Who is online
Users browsing this forum: Semrush [Bot] and 67 guests