Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: ptDev on March 07, 2011, 02:46:03 pm
-
I made a simple plugin that adds the "Paste online" option to the edit menu. It allows to paste code online on pastebin.com, which is useful for people who exchange source code snippets frequently. I recently added a number of features that should make it useful. The source code (Windows only so far) is attached to this post. Extract the files to (your C::B source directory)\plugins\contrib\CodePaste before building.
UPDATE: Can now be checked out from http://codepaste-plugin-codeblocks.googlecode.com/svn/trunk/ (http://codepaste-plugin-codeblocks.googlecode.com/svn/trunk/).
A screenshot (attached) shows the configurable settings.
[attachment deleted by admin]
-
thanx could you post the *.cbplugin file too?
-
My configuration is not binary compatible with the configuration used by the C::B Team, hence my .cbplugin file will not even run with a nightly build... For this reason, I'm sorry I don't provide this file. If you can compile it, however, it's possible to export a .cbplugin archive from the plugins manager dialog.
-
well i guessed so
than can you help me compile this i always get some errors
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp||In member function 'virtual void CodePaste::BuildMenu(wxMenuBar*)':|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|72|warning: 'wxString wxMenuItemBase::GetLabel() const' is deprecated (declared at C:\wxWidgets-2.9.1\include/wx/menuitem.h:177)|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp||In member function 'virtual void CodePaste::BuildModuleMenu(ModuleType, wxMenu*, const FileTreeData*)':|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|96|warning: 'wxString wxMenuItemBase::GetLabel() const' is deprecated (declared at C:\wxWidgets-2.9.1\include/wx/menuitem.h:177)|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtProjectManager' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtLogManager' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtOpenFilesList' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtUnknown' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp||In member function 'void CodePaste::OnPasteBin(wxCommandEvent&)':|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|180|warning: comparison between signed and unsigned integer expressions|
.objs\CodePasteConfig.o||In function `ZNK14wxCheckBoxBase9IsCheckedEv':|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|69|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|70|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|69|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|70|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|69|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|70|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|69|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\checkbox.h|70|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
.objs\CodePasteConfig.o:C:\Users\Tibsi_\Desktop\CodePaste\CodePasteConfig.cpp|27|undefined reference to `_imp___ZN15wxItemContainer5ClearEv'|
.objs\CodePasteConfig.o||In function `ZN15wxItemContainer11InsertItemsERK21wxArrayStringsAdapterjPPv16wxClientDataType':|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|145|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|147|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|147|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|154|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|154|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
.objs\CodePasteConfig.o:C:\Users\Tibsi_\Desktop\CodePaste\CodePasteConfig.cpp|32|undefined reference to `_imp___ZN15wxItemContainer5ClearEv'|
.objs\CodePasteConfig.o||In function `ZN15wxItemContainer11InsertItemsERK21wxArrayStringsAdapterjPPv16wxClientDataType':|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|145|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|147|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|147|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|154|undefined reference to `_imp__wxTheAssertHandler'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|154|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
.objs\CodePasteConfig.o||In function `ZN15wxItemContainer6InsertERK8wxStringj':|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|145|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
C:\wxWidgets-2.9.1\include\wx\ctrlsub.h|145|undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_PKw'|
.objs\CodePasteConfig.o||In function `wxPanel':|
C:\wxWidgets-2.9.1\include\wx\generic\panelg.h|33|undefined reference to `_imp___ZN18wxControlContainerC1Ev'|
.objs\CodePasteConfig.o||In function `~wxControlContainerBase':|
C:\wxWidgets-2.9.1\include\wx\containr.h|48|undefined reference to `_imp___ZTV22wxControlContainerBase'|
.objs\CodePasteConfig.o||In function `wxGet_wxConvLibc':|
C:\wxWidgets-2.9.1\include\wx\strconv.h|574|undefined reference to `_imp__wxConvLibcPtr'|
C:\wxWidgets-2.9.1\include\wx\strconv.h|574|undefined reference to `_imp___Z19wxGet_wxConvLibcPtrv'|
C:\wxWidgets-2.9.1\include\wx\strconv.h|574|undefined reference to `_imp__wxConvLibcPtr'|
.objs\CodePasteConfig.o||In function `ZN8wxString7ImplStrEPKcRK8wxMBConv':|
C:\wxWidgets-2.9.1\include\wx\string.h|536|undefined reference to `_imp__wxConvLibcPtr'|
C:\wxWidgets-2.9.1\include\wx\string.h|536|undefined reference to `_imp___ZN8wxString4nposE'|
C:\wxWidgets-2.9.1\include\wx\string.h|536|undefined reference to `_imp___ZN8wxString10ConvertStrEPKcjRK8wxMBConv'|
.objs\CodePasteConfig.o||In function `ZN22wxScopedCharTypeBufferIwE11GetNullDataEv':|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
.objs\CodePasteConfig.o||In function `wxPanel':|
C:\wxWidgets-2.9.1\include\wx\generic\panelg.h|33|undefined reference to `_imp___ZN18wxControlContainerC1Ev'|
.objs\CodePasteConfig.o||In function `~wxControlContainerBase':|
C:\wxWidgets-2.9.1\include\wx\containr.h|48|undefined reference to `_imp___ZTV22wxControlContainerBase'|
.objs\CodePasteConfig.o||In function `wxGet_wxConvLibc':|
C:\wxWidgets-2.9.1\include\wx\strconv.h|574|undefined reference to `_imp__wxConvLibcPtr'|
C:\wxWidgets-2.9.1\include\wx\strconv.h|574|undefined reference to `_imp___Z19wxGet_wxConvLibcPtrv'|
C:\wxWidgets-2.9.1\include\wx\strconv.h|574|undefined reference to `_imp__wxConvLibcPtr'|
.objs\CodePasteConfig.o||In function `ZN8wxString7ImplStrEPKcRK8wxMBConv':|
C:\wxWidgets-2.9.1\include\wx\string.h|536|undefined reference to `_imp__wxConvLibcPtr'|
C:\wxWidgets-2.9.1\include\wx\string.h|536|undefined reference to `_imp___ZN8wxString4nposE'|
C:\wxWidgets-2.9.1\include\wx\string.h|536|undefined reference to `_imp___ZN8wxString10ConvertStrEPKcjRK8wxMBConv'|
.objs\CodePasteConfig.o||In function `ZN22wxScopedCharTypeBufferIwE11GetNullDataEv':|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
C:\wxWidgets-2.9.1\include\wx\buffer.h|185|undefined reference to `_imp___ZN9wxPrivate18GetUntypedNullDataEv'|
.objs\CodePasteConfig.o||In function `~wxControlContainerBase':|
C:\wxWidgets-2.9.1\include\wx\containr.h|48|undefined reference to `_imp___ZTV22wxControlContainerBase'|
C:\wxWidgets-2.9.1\include\wx\containr.h|48|undefined reference to `_imp___ZTV22wxControlContainerBase'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 7 warnings ===|
-
than can you help me compile this i always get some errors
First you should start with using the right wxWidgets version. v2.9.1 is experimental! The proposed version for C::B development is either v2.8.10 or v2.8.11.
-
ok thanx
Now i use the v2.8.11 but i still get one of those
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp||In member function 'virtual void CodePaste::BuildModuleMenu(ModuleType, wxMenu*, const FileTreeData*)':|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtProjectManager' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtLogManager' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtOpenFilesList' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|87|warning: enumeration value 'mtUnknown' not handled in switch|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp||In member function 'void CodePaste::OnPasteBin(wxCommandEvent&)':|
C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|180|warning: comparison between signed and unsigned integer expressions|
.objs\CodePaste.o:C:\Users\Tibsi_\Desktop\CodePaste\CodePaste.cpp|156|undefined reference to `_imp___ZN11wxScintilla15GetSelectedTextEv'|
||=== Build finished: 1 errors, 5 warnings ===|
-
UPDATE: I just successfully rebuilt it here. It compiles and links fine. The problem seems to be that you're using an older version of the SDK. You should checkout the source code from the svn trunk and try again.
- Make sure your build of wx2.8.11 was cleanly rebuilt (I think you have it ok).
- Is your C::B source code from the trunk? Recently, wxScintilla was changed from a dynamic to a static library. If you're not using the trunk version, update your copy.
- Make sure you clean and rebuild Code::Blocks from scratch. In order to rebuild the SDK, you don't need to to rebuild the "contrib plugins" workspace. To be sure, clean the "devel" and "output" folders before doing the rebuild.
-
HI, is the latest code for this available ?
I would like to try it out, bring it also to linux (if possible), and when it looks table enough, maybe make a contrib plug-in out of it ....
-
HI, is the latest code for this available ?
I would like to try it out, bring it also to linux (if possible), and when it looks table enough, maybe make a contrib plug-in out of it ....
Hi,
I just recently had a chance to look again at it.
I don't recall ever making a *-unix.cbp project for it, but I believe the code is perfectly portable.
I'll upload it to a server and provide you with an svn link to checkout from...
EDIT: I just changed the first post, the url for checking out is http://codepaste-plugin-codeblocks.googlecode.com/svn/trunk/.