Author Topic: wxSmith development  (Read 104764 times)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
wxSmith development
« on: May 26, 2005, 02:38:44 am »
I hope that we will discuss here things related to wxSmith :).

First of all I'll try to explain how wxSmith works :D

Waiting for any questions  (related to wxSmith of course :wink:)

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
wxSmith development
« Reply #1 on: May 26, 2005, 05:15:07 am »
I am interested but my still struggle to compile my codeblock properly. After I success the code::blocks ,compilation ,  I shall try to have a look on the code before asking question. Hope that you won't mind if it is  silly question .

Offline DreadNot

  • Multiple posting newcomer
  • *
  • Posts: 47
    • http://www.utdallas.edu/atescomp
wxSmith development
« Reply #2 on: May 26, 2005, 06:48:49 am »
I'm onboard.  Successfully compiled C::B-wx2.6.0 and wxSmith.  As per my other posts, I'd like to see some kind of outline for the projects and items to tackle.  Also, to look at other RADs to form a common basis for implementation.

What problems is cyberkoa having with the compile?
There are two ways to code: watertight & bulletproof!

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxSmith development
« Reply #3 on: May 26, 2005, 06:53:58 am »
I think I missed it, but where could I download wxSmith?
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline DreadNot

  • Multiple posting newcomer
  • *
  • Posts: 47
    • http://www.utdallas.edu/atescomp
wxSmith development
« Reply #4 on: May 26, 2005, 07:04:23 am »
When you CVS checkout of C::B, make sure you get all revisions (if no matching revision, use most recent one).  The wxSmith project is in the ...\codeblocks\src\plugins\contrib\wxSmith dir.
There are two ways to code: watertight & bulletproof!

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxSmith development
« Reply #5 on: May 26, 2005, 07:27:05 am »
Thanks, I didn't see it :)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
wxSmith development
« Reply #6 on: May 26, 2005, 11:59:11 am »
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 :)

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
wxSmith development
« Reply #7 on: May 26, 2005, 04:48:40 pm »
Quote from: DreadNot

What problems is cyberkoa having with the compile?


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 ?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxSmith development
« Reply #8 on: May 26, 2005, 05:35:09 pm »
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).

Offline DreadNot

  • Multiple posting newcomer
  • *
  • Posts: 47
    • http://www.utdallas.edu/atescomp
wxSmith development
« Reply #9 on: May 26, 2005, 10:36:50 pm »
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?
There are two ways to code: watertight & bulletproof!

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
wxSmith development
« Reply #10 on: May 26, 2005, 10:42:37 pm »
Hi, there's one thing currently missing inside plugin - there's currently no abitily to automatically expand C::B project to use wxSmith. But You can open wxSmith - it got one dialog where You can test wxSmith :) (Just click on in inside resource tree on the left side)

Offline DreadNot

  • Multiple posting newcomer
  • *
  • Posts: 47
    • http://www.utdallas.edu/atescomp
wxSmith development
« Reply #11 on: May 26, 2005, 11:11:47 pm »
I just made a semi-decently-looking-but-not-yet-way-cool screenshot:



How about that!  Now, give me an easy action item so I can get up to speed helping code this thing.
There are two ways to code: watertight & bulletproof!

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxSmith development
« Reply #12 on: May 27, 2005, 12:41:00 am »
OK how about fixing the scrollbar in the properties? We need an horizontal scrollbar there. And if you can fix the length of those input boxes, even better. Being sticked to the right doesn't look fine.

Second, you might try replacing the buttons on the widgets pane for actual iconized buttons :)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
wxSmith development
« Reply #13 on: May 27, 2005, 02:38:32 am »
Quote from: rickg22
OK how about fixing the scrollbar in the properties? We need an horizontal scrollbar there. And if you can fix the length of those input boxes, even better.


Tried to fix that and I think I've made it. There were two problems with that: long names of styles - I have just cut them and put '...' at the end, but I think that it should be changed. Any Ideas ? :). Second problem was that properties panel has been stretching edit boxes changing their minimum size. Now it's fixed, should work fine.
If anybody has any idea how to improove properties panel I would be grateful :) (Maybe wxPropertiesPanel should be some solution but it currently works under wx 2.6 - not officially supporteed in C::B)

Quote from: rickg22
Second, you might try replacing the buttons on the widgets pane for actual iconized buttons :)


Someone could help here. I'm poor graphic designe so I'm waiting for Your arts (or maybe if You wanna some B&W child-style buttons I will do this  :wink: ). In fact each widget / sizer / dialog etc. should have two icons - first (big one about 32x32) for buttons inside widgets palette, second one - (small 16x16) inside resource tree. I've thought about these images before and wxSmith has currently structures which could hold a bit of art :).

I've also started working on easier widget definition system. Look at defwidgets/wxscheckbox.cpp and .h - I think that it should be something like this (It hasn't been finished so curently there's no ability to add wxChecckBox but I'll fix that soon)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxSmith development
« Reply #14 on: May 27, 2005, 04:27:58 am »
Quote from: byo


If anybody has any idea how to improove properties panel I would be grateful :) (Maybe wxPropertiesPanel should be some solution but it currently works under wx 2.6 - not officially supporteed in C::B)


Maybe we could try converting wxPropertiesPanel to 2.4.2 :D (hope it's not hard *gulp*)


Quote from: byo

Quote from: rickg22
Second, you might try replacing the buttons on the widgets pane for actual iconized buttons :)


Someone could help here. I'm poor graphic designe so I'm waiting for Your arts


Why not just grab upCase's? :wink: