Author Topic: C::B usage/download stats?  (Read 15592 times)

Offline macr0t0r

  • Single posting newcomer
  • *
  • Posts: 7
Re: C::B usage/download stats?
« Reply #15 on: June 20, 2013, 03:10:28 am »
Well, this is getting way off topic. Where is the best forum to discuss the Script engine?

Things that I'd like to take the time to update in the Wiki:

http://wiki.codeblocks.org/index.php?title=Scripting_commands
The "ConfigManager" section of the Scripting Commands is almost completely void of any useful information.  What "key" are we talking about?  Is this a global editor of Code::Block settings?  Project settings?  The code drills down multiple levels and has practically no commenting, and there is no examples in the Wiki, so I have yet to find a use for this section.  I'd love to know who implemented it!

We really need to flesh out the "wxFileName" class.  GetFullName vs GetFullPath vs GetLongPath vs GetPath....and the difference is?  Some give me the same result, so I'd like to know what the subtle differences are.  I may get the same results because of how my Project is configured or the platform I'm on, so it may not work for another user.

http://wiki.codeblocks.org/index.php?title=Script_plugins
When building a Script plugin, the example does not really define the type and contents of the "data" variable is in the "getModuleMenu(who,data)" function.  For instance, you can get the parent Project if you right-click on a file-tree file, or that you can get the path to the project file if you right-click on a project, etc.  A lot of it was trial & error.

Also, the sample does not explain when a function gets called.   "GetMenu" gets called once when the plugin is loaded.  "GetModuleMenu" is called EVERY TIME the user right-clicks the mouse on anything (important to know).  More importantly, the "OnModuleMenuClicked" will only give you the index of the menu items you created, so you must store the "who" and "data" information you will need into a class variable during "GetModuleMenu."  Seems obvious now that I've done it, but there was some head-scratching at the beginning.

Don't get me wrong, I understand that the scripting is probably an under-used feature in Code::Blocks.  However, I love the fact that it enables me to create some pretty rich plugin capability without the need to compile.  I can distribute the plugin with good confidence that it will run on multiple versions of the Code::Blocks, and a user can easily examine the code and make personal changes as they see fit.  It would be great if the scripting could be expanded enough that this was the new standard for Plug-ins!

In any case, I'm just glad that it's available.    Thanks, guys!  Now, to find an easy way to get the current selection when a user right-clicks on the editor.  The macro expansion of "ACTIVE_EDITOR_SELECTION" only updates after a "Tools" item is run. Speaking of which....that MACRO isn't listed in the Wiki either.  Again...I'm not going to complain since that is the nature of Open-Source.  Many developers will push new features without updating the docs, and it's impossible for the admin to catch it all!

- Jim

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: C::B usage/download stats?
« Reply #16 on: June 21, 2013, 06:51:50 am »
The macro expansion of "ACTIVE_EDITOR_SELECTION" only updates after a "Tools" item is run. Speaking of which....that MACRO isn't listed in the Wiki either.  Again...I'm not going to complain since that is the nature of Open-Source.  Many developers will push new features without updating the docs, and it's impossible for the admin to catch it all!
Its a WiKi - feel free to update the parts which lack information. The login is the same as your forum login for these purposes. That would be most helpful and appreciated, of course. 8)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ