Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

wxSmith development

<< < (2/34) > >>

David Perfors:
Thanks, I didn't see it :)

byo:
Ok, here are basics about wxSmith (I'll try to prepare some moredetailed doc, but need some time).

Main plugin's class is wxSmith - it's purpose is to: initialize and shutdown plugin (as all plugins shoud ;) ), process global events and signals inside plugin. These currently are: events from Code::Blocks and notifications from resource browser. I'll add other features (widget selection and event handler creation should also get thoiugh this I think). Other purpose of wxSmith class is to keep wxsProject class for each cbProject one. This association can be found using wxSmith::GetSmithProject and wxSmith::GetCBProject members. Currently it has also pointer to resource browser tree but it will be changed to singleton object soon.

Each cbProject has associated wxsProject class - associations are updated automatically so there's no need to care about that. wxsProject can be in three states - NotBinded (wxsProject has not been connected with cbPrject - it's set for a short time just after creation), NotWxsProject (set when there's no wxSmith configuration inside project) and Integrated (associated cbPrject use wxxSmith). Each wxsProject has list of different resources (currently only dialogs). These are automatically read from wxSmith's 'private' directory called of course 'wxsmith' - currently it must be located in same dir where C::B's .cbp file is found. wxSmith data is stored inside 'wxsmith/wxsmith.cfg' file - it's just a list of resources and files which handle them.

Resource is represented throughclass derived from wxsResource. I've decided to place these classes inside 'resources' directory. Currently there's one called wxsDialogRes. It can load and save xrc-like files.

Dialog is made of wxsWidget and wxsContainer classes (wxsContainer is derived from wxsWidget but adds abilities to handle child widgets). wxsWidget is the biggest class in wxSmith (maybe even too big but most of it's features can be just skipped in case of usual widgets). I'll deescribe each feature a little bit:
* Preview system - these are member functions operating on preview. MyCreatePreview() should create widget's preview and MyUpdate should update it's content, MyDeletePreview() should delete preview - but simple delete operator is enough. Currently change of any property value causes all dialog to be recreated (I tried to recreate or update separate widgets only but it didn't worked properly)
* Properties system - wxsWidget class has PropertiesObject (class: wxsProperties) - this object keeps list of all properties and manages them automatically. It is handling many default properties (like size, id etc) - this will be described later. If non-deefautl property should be added - this can be made by overriding wxsWidget::CreateObjectProperties function (wxample inside wxsButton class :) ).
* Default properties - all dedfautls are kept inside protected BaseParams variable (type: wxsWidgetBaseParams). Derived class can choose properties which are really used by passing pType param to constructor). It will mask properties shown inside properties window and all default values saved to and readeed from Xml.
* Xml saving / loading - XmlLoad loads whole tree structure for widget, XmlSave saves it. By deefault base params are laded and saved. To load/save other parametrs, MyXmlLoad and MyXmlSave can be overriden. Inside these funnctions XmlGetXXX and XmlSetXXX function can be used to read/save non-default properties.
* Code generation - currently not fully developed. GetProducingCode - this should produce code creating given widget, GetFinalizingCode - code add after creating children of this widget (may be usefull inside sizers etc) GetDeclarationCode - code declaring variable for this widget.
* Support for additional widget - I tried to add feature which would allow to use non-standard widgets. These could be supplied in library or even a source code for them could be given. It won't be developen now so should be considered as a dead code ;)

Each widget shoud have it's manager - such manager should be able to create and delete widget. There could be more managers currently loaded, but all shuold be registered insided wxsWidgetFactory class.
wxsWidgetFactory is a main clas producing and deleting widgets. All widget object MUST be created through it and MUST be deleted usind wxsWidgetFactory::Kill() function. wxsWidgetFactory is a singleton object.

Hope this will clarify a little bit how my plugin works. If You have any questions: just ask :)

cyberkoa:

--- Quote from: DreadNot ---
What problems is cyberkoa having with the compile?
--- End quote ---


I manage to compile C::B using wxwidgets-2.4.2 but when I run from windows explorer , it give the common error "the program is causing error" and never able to run.

I try to run from C::B , then choose target "src" , it gives the same problem also .

I have try to reinstall MingW , reinstall wx-widgets2.4.2 , delete CVS and redownload again , recompile wxwidgets , then compile C::B . It give me the same problem ..  :cry:

Still do not hv idea what had happened bcos I try again to follow exactly the way in wiki to set up also give me the same problem.

I am not sure whether do I need to register the DLL file or not ?

rickg22:
cyberkoa: Remember that in TortoiseCVS you can "update special", and pick a specific TAG (C::B version) to use. It's better if you work on the 1.0beta-final, so at least we can be sure that it's not C::B source code that's causing the problems. (OH - and delete all the plugin dlls from both the devel and output subdirectories).

DreadNot:
OK!  So now that I've got everything compiling (for now & until a new CVS), how do I make a really cool 8) screenshot of the C::B running the wxSmith plugin?  When I ran it, all I got was blank screens.
1. I created a wxWidgets project, but nothing shows (blank) in the Project tree (disturbing).
2. Nothing in Symbols and Watches.
3. I see the Resource tab with Property and Events tabs.  The top has "Resources->wxWidgets application".  Properties and Events are blank.
4. I see the Widgets tab at the bottom of the screen and it displays the basics.
Now what?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version