THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/08/2009 at 07:18, xxxxxxxx wrote:
Heres the source code, if it helps...
Nothing fancy, just a slightly modified version of an example i found here.
I naively just did what the documentation suggested. What am I missing?
> class StringSubDialog : public iCustomGui \> { \> INSTANCEOF(StringSubDialog, iCustomGui) \> private: \> BaseContainer m_settings; \> \> String m_str; \> Bool m_tristate; \> \> public: \> StringSubDialog(const BaseContainer &settings;, CUSTOMGUIPLUGIN \*plugin) \> : iCustomGui(settings, plugin), m_str("[default"), m_tristate(false), m_settings(settings) { } \> \> virtual Bool CreateLayout (void) \> { \> AddEditText(1000, BFH_SCALEFIT, 75, 20, 0); \> \> return TRUE; \> } \> \> virtual void LayoutModeChanged() \> { \> if (GetLayoutMode() == LAYOUTMODE_MAXIMIZED) \> { \> HideElement(1000, FALSE); \> } \> else \> { \> HideElement(1000, TRUE); \> } \> } \> \> virtual Bool SupportLayoutSwitch() \> { \> return TRUE; \> } \> \> virtual Bool InitValues() \> { \> return TRUE; \> } \> \> virtual LONG Message(const BaseContainer& msg, BaseContainer& result) \> { \> return SUPER::Message(msg, result); \> } \> \> virtual Bool Command(LONG id, const BaseContainer& msg) \> { \> return TRUE; \> } \> \> virtual Bool SetData(const TriState<GeData> &tristate;) \> { \> m_str = tristate.GetValue().GetString(); \> m_tristate = tristate.GetTri(); \> \> return InitValues(); \> } \> \> virtual TriState<GeData> GetData() \> { \> GetString(1000, m_str); \> return GeData(m_str); \> } \> }; \> \> \> class StringGui : public CustomGuiData \> { \> public: \> virtual LONG GetId() { return SOME_PLUGIN_ID; } \> \> virtual CDialog\* Alloc(const BaseContainer &settings;) \> { \> StringSubDialog\* dlg = gNew StringSubDialog(settings, GetPlugin()); \> if (!dlg) return NULL; \> \> CDialog \*cdlg = dlg->Get(); \> if (!cdlg) return NULL; \> \> return cdlg; \> } \> \> virtual void Free(CDialog \*dlg, void \*userdata) \> { \> if (!dlg || !userdata) return; \> StringSubDialog \*sub = static_cast<StringSubDialog\*>(userdata); \> gDelete(sub); \> } \> \> virtual CHAR \*GetResourceSym() \> { \> return "STRINGTEST"; \> } \> \> virtual LONG GetResourceDataType(LONG \*&table;) \> { \> table = restypetable; \> return sizeof(restypetable)/sizeof(LONG); \> } \> }; \> \> \> Bool RegisterTestGUI() \> { \> static BaseCustomGuiLib mylib; \> ClearMem(&mylib;,sizeof(mylib)); \> FillBaseCustomGui(mylib); \> \> return InstallLibrary(SOME_PLUGIN_ID, &mylib;, 1000, sizeof(mylib)) \> \> && \> \> RegisterCustomGuiPlugin("My String GUI", 0\*PLUGINFLAG_HIDE, gNew StringGui); \> }
thanks 