Author Topic: Codeblocks ported to sqrat  (Read 33918 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Codeblocks ported to sqrat
« Reply #15 on: March 25, 2014, 09:10:50 pm »
Why are you adding wxMessageBox as cbMessageBox is preferred?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #16 on: March 25, 2014, 09:13:30 pm »
i missed that cbMessageBox exists -.- i will revert this...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #17 on: March 25, 2014, 09:20:16 pm »

 i added also:
* the possibility to use c::b events
* Test script to test c::b events
* Test script to test user dialogs

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #18 on: April 06, 2014, 11:06:07 pm »
New added:
* XRC Dialogs can now be loaded and shown modal and not modal
* "any" wxWidgets Dialog event can now be processed in script
* The possibility to create also nested menus from a script
* Menus get cleared after unregistering a plugin
* Add function UnRegsiterPlugin to the script binding
* The "Plugin Configuration Dialog" shows now also script plugins, and they can be uninstalled (for now only unregistered) from there
* Test plugin for XRC dialogs
* Test plugin for menus
* Updated all test plugins to appear only in the Plugin/Test submenu
* Add more wxString bindings

!!!! The old script plugin samples and also the wiki are wrong. In the consructor of the plugin there needs to be the line
Code
info = PluginInfo();
if this line isn't present all plugins share the same info field and the names get overwritten every time a new plugin gets created.
For reference: http://www.squirrel-lang.org/doc/squirrel3.html#d0e1672

still needs some testers with different compiler versions...
greetings

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Codeblocks ported to sqrat
« Reply #19 on: April 07, 2014, 12:18:27 am »
I hope you know you can edit the wiki yourself (use the login details for the forum).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #20 on: April 07, 2014, 01:07:27 am »
I hope you know you can edit the wiki yourself (use the login details for the forum).
Yes, i edited the wiki a lot in the past ;)
in the actual implementation of c::b and squirrel this makes no difference but in the implementation with sqrat it wont work...
I will update the wiki, as soon as the sqrat port will go into trunk...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #21 on: April 09, 2014, 01:12:19 am »
* Add some basic wx controls functionality (didn't had time to test)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #22 on: April 16, 2014, 01:14:34 am »
* Add more controls. Now implemented:
wxEvent, wxTextCtrl, wxButton, wxAnimationCtrl, wxCommandLinkButton, wxCheckBox, wxChoice, wxCollapsiblePane, wxComboBox, wxRadioBox, wxGauge, wxHyperlinkCtrl, wxRadioButton, wxListBox, wxCheckListBox, wxStaticText, wxSlider, wxToggleButton, wxSearchCtrl, wxColourPickerCtrl, wxDirPickerCtrl, wxFilePickerCtrl, wxTimer, wxSpinButton, wxSpinCtrl

i haven't exported all functions, only the important one.(Almost) All functions are documented with doxygen (markdown). The controls can't be created on "runtime", only imported from xrc files.

You can test the implemented controls with the xrc-test-plugin.
instruction:
Code
 1.a) Download https://github.com/bluehazzard/codeblocks_sf and compile it
 1) Open Script console
 2) Open "scripts/test/xrc-test-plugin.script"
 3) Start test with Plugins->Test scripting-> Test XRC
 4) open "scripts/test/xrc_test.xrc
 5) test the controls and discover the gimmicks/bugs ;)

my plan for the future:
* implement wxPropertyGrid (next main goal)
* implement the possibility to install script plugins with the Plugin->Manage Plugins-> install
* encapsulate script plugins in .cbplugin container (for delivering xrc and script files ins one container)
* implement wxFrame
* implement wxTreeCtrl

i think the main controls are implemented now. I don't know if tabs and ScrollBars are necessary...

greetings

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Codeblocks ported to sqrat
« Reply #23 on: April 16, 2014, 09:47:57 am »
Hello,
I unfortunately do not currently have the time to test your excellent work.
It's a pity, because I have "wxTranslatepluginForCB" transpose.
I recouped "https://github.com/bluehazzard/codeblocks_sf" by Tortoise.
Sincerely
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Codeblocks ported to sqrat
« Reply #24 on: April 16, 2014, 11:41:47 pm »
Two patches, so far:
http://cmpt.benbmp.org/codeblocks/patches/sqrat/0001-scripting-no-pch-build-fix.patch
http://cmpt.benbmp.org/codeblocks/patches/sqrat/0002-scripting-Fix-compilation-it-seems-that-Play-doesn-t.patch

I'm trying to make the thing to compile with autotools and noPCH.
And I'm hitting a road block:

Code

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../../../src/sdk/scripting/bindings -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../../../src/include -I../../../../../src/sdk/wxscintilla/include -I../../../../../src/include/scripting/squirrel -I../../../../../src/include/scripting/bindings -I../../../../../src/include/scripting/sqrat -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -fPIC -DPIC -fexceptions -MT sq_wx/sq_wxBaseControls.lo -MD -MP -MF sq_wx/.deps/sq_wxBaseControls.Tpo -c ../../../../../src/sdk/scripting/bindings/sq_wx/sq_wxBaseControls.cpp  -fPIC -DPIC -o sq_wx/.libs/sq_wxBaseControls.o
In file included from ../../../../../src/include/scripting/sqrat/sqrat/sqratTypes.h:39:0,
                 from ../../../../../src/include/scripting/sqrat/sqrat/sqratAllocator.h:35,
                 from ../../../../../src/include/scripting/sqrat/sqrat/sqratObject.h:34,
                 from ../../../../../src/include/scripting/sqrat/sqrat/sqratTable.h:34,
                 from ../../../../../src/include/scripting/sqrat/sqrat.h:33,
                 from ../../../../../src/include/scripting/bindings/sq_wx/sq_wx_type_handler.h:5,
                 from ../../../../../src/include/scripting/bindings/sq_wx/sq_wxBaseControls.h:4,
                 from ../../../../../src/sdk/scripting/bindings/sq_wx/sq_wxBaseControls.cpp:2:
../../../../../src/include/scripting/sqrat/sqrat/sqratClassType.h: In instantiation of ‘void* Sqrat::ClassTypeData<C, B>::Cast(SQUserPointer, SQUserPointer) [with C = wxSpinCtrl; B = wxSpinButton; SQUserPointer = void*]’:
../../../../../src/sdk/scripting/bindings/sq_wx/sq_wxBaseControls.cpp:1104:1:   required from here
../../../../../src/include/scripting/sqrat/sqrat/sqratClassType.h:64:13: error: invalid static_cast from type ‘wxSpinCtrl*’ to type ‘wxSpinButton*’
../../../../../src/include/scripting/sqrat/sqrat/sqratClassType.h: In instantiation of ‘void* Sqrat::ClassTypeData<C, B>::Cast(SQUserPointer, SQUserPointer) [with C = wxGauge; B = wxGaugeBase; SQUserPointer = void*]’:
../../../../../src/sdk/scripting/bindings/sq_wx/sq_wxBaseControls.cpp:1104:1:   required from here
../../../../../src/include/scripting/sqrat/sqrat/sqratClassType.h:64:13: error: invalid static_cast from type ‘wxGauge*’ to type ‘wxGaugeBase*’
../../../../../src/include/scripting/sqrat/sqrat/sqratClassType.h: In instantiation of ‘void* Sqrat::ClassTypeData<C, B>::Cast(SQUserPointer, SQUserPointer) [with C = wxComboBox; B = wxChoice; SQUserPointer = void*]’:
../../../../../src/sdk/scripting/bindings/sq_wx/sq_wxBaseControls.cpp:1104:1:   required from here
../../../../../src/include/scripting/sqrat/sqrat/sqratClassType.h:64:13: error: invalid static_cast from type ‘wxComboBox*’ to type ‘wxChoice*’
Makefile:477: recipe for target 'sq_wx/sq_wxBaseControls.lo' failed
make[4]: *** [sq_wx/sq_wxBaseControls.lo] Error 1

Is there any real reason you have to bind the wxXXXBase class? This is an implementation detail the wx user shouldn't care!

Other notes:
1. There is an include for sqplus in a lot of places, still.
2. sqrat/sqrat looks ugly, I'd prefer if you remove one of the levels.
3. It will be good if all public headers for scripting could be included without the need of additional paths
4. Please keep filename only with lower case letters and underscores.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #25 on: April 19, 2014, 10:38:46 pm »
Hello,
I unfortunately do not currently have the time to test your excellent work.
It's a pity, because I have "wxTranslatepluginForCB" transpose.
I recouped "https://github.com/bluehazzard/codeblocks_sf" by Tortoise.
Sincerely
remember if you want to try your plugin you have to add the line
Code
info = PluginInfo();
in your constructor and to run the converter script like i described in my first post.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #26 on: April 19, 2014, 10:53:02 pm »
Two patches, so far:
http://cmpt.benbmp.org/codeblocks/patches/sqrat/0001-scripting-no-pch-build-fix.patch
http://cmpt.benbmp.org/codeblocks/patches/sqrat/0002-scripting-Fix-compilation-it-seems-that-Play-doesn-t.patch

I'm not at my main pc so i can't test. Thanks for the work, because i never did something with PCH...

1. There is an include for sqplus in a lot of places, still.
2. sqrat/sqrat looks ugly, I'd prefer if you remove one of the levels.
3. It will be good if all public headers for scripting could be included without the need of additional paths
4. Please keep filename only with lower case letters and underscores.

1. Hmm... i will search and remove them
2. indeed this is really ugly, but i don't wanted to change the sqrat code (the code in sqrat.h) and leave it simple to update sqrat, by only coping the sqrat folder
3. It shouldn't be necessary to use additional paths outside the scripting internal stuff. Inside scripting (like the wx thing) i used additional paths, because it was a lot work to keep in sync all include directories over all project files. I will again look into it. Thanks for pointing it out.
4. Will look into it,

Is there any real reason you have to bind the wxXXXBase class? This is an implementation detail the wx user shouldn't care!
I tried to compile the code on linux today and hit the same errors. Sqrat needs the base classes for its internal type checking. I think there are needed some #ifdef because some wx controls don't have a base on linux... Still some work... ;(

greetings

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Codeblocks ported to sqrat
« Reply #27 on: April 21, 2014, 12:10:36 pm »
2. indeed this is really ugly, but i don't wanted to change the sqrat code (the code in sqrat.h) and leave it simple to update sqrat, by only coping the sqrat folder
I don't see what the problem will be. Now you have sqrat/sqrat.h and sqrat/sqrat/* if you remove the top folder you'll have sqrat.h and sqrat/* and I don't see how this will make the updating of sqrat tough and problematic.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Codeblocks ported to sqrat
« Reply #28 on: April 21, 2014, 08:14:07 pm »
just uploaded a fix for the unix build... (not pretty but functional, and i don't think there is a better solution, because of the different implementation on every platform...)

greetings

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Codeblocks ported to sqrat
« Reply #29 on: April 27, 2014, 11:51:35 am »
Code
/home/obfuscated/projects/codeblocks/git/src/sdk/menuitemsmanager.cpp|118|warning: deleting object of abstract class type ‘Menu_point_base’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]|
This is pretty bad warning/error, please fix!

Edit:
Code
/home/obfuscated/projects/codeblocks/git/src/sdk/menuitemsmanager.cpp|201|warning: unused variable ‘sub_menu’ [-Wunused-variable]|
This one seems like a bug, too.
« Last Edit: April 27, 2014, 12:10:04 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]