THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/07/2008 at 06:35, xxxxxxxx wrote:
Why not store the text in member variable of the dialog class? Something like this:
> \> // (c) 1989-2004 MAXON Computer GmbH, all rights reserved // \> ///////////////////////////////////////////////////////////// \> \> // example code for usage of listview elements \> \> // be sure to use a unique ID obtained from www.plugincafe.com \> #define ID_LISTVIEWTEST 1000452 \> \> #include "c4d.h" \> #include "c4d_symbols.h" \> \> class ListViewDialog : public GeDialog \> { \> private: \> String mytext; \> public: \> ListViewDialog(void); \> virtual ~ListViewDialog(void); \> \> virtual Bool CreateLayout(void); \> \> void SetMyText(String text) { mytext = text; }; \> }; \> \> ListViewDialog::ListViewDialog(void) \> { \> mytext = ""; \> } \> \> ListViewDialog::~ListViewDialog(void) \> { \> } \> \> Bool ListViewDialog::CreateLayout(void) \> { \> // first call the parent instance \> Bool res = GeDialog::CreateLayout(); \> \> res = LoadDialogResource(DLG_LISTVIEW,NULL,0); \> \> if (res) \> { \> SetString(GADGET_MYTEXT, mytext); \> } \> \> return res; \> } \> \> class ListViewTest : public CommandData \> { \> private: \> ListViewDialog dlg; \> public: \> virtual Bool Execute(BaseDocument \*doc); \> virtual LONG GetState(BaseDocument \*doc); \> virtual Bool RestoreLayout(void \*secret); \> }; \> \> LONG ListViewTest::GetState(BaseDocument \*doc) \> { \> return CMD_ENABLED; \> } \> \> Bool ListViewTest::Execute(BaseDocument \*doc) \> { \> dlg.SetMyText("hello world"); \> return dlg.Open(TRUE,ID_LISTVIEWTEST,-1,-1); \> } \> \> Bool ListViewTest::RestoreLayout(void \*secret) \> { \> return dlg.RestoreLayout(ID_LISTVIEWTEST,0,secret); \> } \> \> Bool RegisterListView(void) \> { \> // decide by name if the plugin shall be registered - just for user convenience \> String name=GeLoadString(IDS_LISTVIEW); if (!name.Content()) return TRUE; \> return RegisterCommandPlugin(ID_LISTVIEWTEST,name,0,NULL,String(),gNew ListViewTest); \> } \>
cheers,
Matthias