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

Code snippet plugin

<< < (7/12) > >>

Pecan:

--- Quote from: artoj on August 15, 2006, 04:42:43 pm ---OK, thanks, but could you wait untill I get my first patch integrated in to the source tree. Some of the code needs to moved, mainly the XML saving etc. to the main tree ctrl subclass. Currently the code is floating in the CodeSnippetsWindow class.

--- End quote ---

Of course. I'm not being pushy I hope.


--- Quote ---It would also be nice to see a "peek" of the snippet when the tree item is selected. (This is either a feature request or a "pecan todo" if you dont have time.)

Yes, I agree, killerbot mentioned about this too. I thinked about tooltips first but after reading the wxWidgets docs it seems that they are only supported on Windows (or I'm reading the docs incorrectly). Another way would be to add some text control under the tree control, while I am not fundamentally against this, I don't think this is a good solution.

--- End quote ---

You might want to look at a "timed" wxMiniFrame. Something like a CB popUpWindow as used in infoWindow.cpp, but using a miniFram. It's cross-platform and the CB code is practically clonable.

Pecan:
Arto,

Included in the attached file (see URL below) is a standalone version of your CodeSnippets plugin.

I've included the code I promised except for the internal drag/dropping of tree item. I tried it, but the sort just put 'em back in place. I'll work on that though.

I've include the following features:

* drag and drop out of a tree item
* support for the clipboard
* saving a snippet to a file
* editing a snippet as a file (snippet file)
* editing a snippet as a tree item(snippet text)
* specifying an external editor to use on snippets
* addition of a description field to the snippet
* addition of properties viewer with editing
Please see the Help->About text for additional information.

You are welcome to use any of the code that you find to be a good addition to CodeSnippets.
You might find the program as a useful utility to prototype additions to the CodeSnippet plugin. It's so much easier to debug.





SnipList011.zip
http://savefile.com/files/77784

Direct download
http://dl1u.savefile.com/52c868ef5691ba18226eb86bbd4f9147-4af2299f6f5f8bed86bf10f1b2f39cb0/SnipList011.zip

Thank you for such a nice plugin.

pecan

artoj:
Thank you very much Pecan! :)

I'll try to integrate the features to the next version of Code Snippets.

I've created a patch which I mentioned earlier; it cleans up the code / UI.

Changes:


--- Code: ---
* Added visual feedback to the searchbox: if no items can be found, the
   background is painted light red and the root item is selected

* Changed menu functionality / structure:

      - "Import from file" is now called "Load from file", it first
         deletes all the current items and then loads the file

      - "Export to XML" is now called "Save to file", with no
         functionality changed

      - To append items from file, hold down Shift while right clicking the root item,
         you should then see a "Load from file (append)" item in the menu

      - Added "Remove all" menu item

* Removed some parts of the documentation which are now obsolete

* Some code refactoring

* Removed some of the debug messages


--- End code ---

The append menu system might change in the future; however I don't like to stack the pop up menu full of items.

Full source

Patch (against latest SVN version)

Pecan:

--- Quote from: artoj on September 17, 2006, 11:13:24 am ---
I'll try to integrate the features to the next version of Code Snippets.

I've created a patch which I mentioned earlier; it cleans up the code the UI.
...<snip>...

Full source

Patch (against latest SVN version)


--- End quote ---

Arto,

You should be able to apply your patches directly to the CodeBlocks svn sources at berlios.

If he hasn't already, in a Personal Message, ask Mandrav for permission to update your own sources.

szczepan:
I don't seem to be able to figure out how to actually edit code snippets. When I right-click on a snippet node there are only two menu items, "Apply" and "Remove".

Is editing the XML file really the only way?

Does this plugin do variable substitutions? If so, what is the markup for a variable placeholder in snippet body?

Thanks in advance

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version