Author Topic: New plugin: CodePaste  (Read 12149 times)

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
New plugin: CodePaste
« 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/.

A screenshot (attached) shows the configurable settings.

[attachment deleted by admin]
« Last Edit: June 11, 2012, 11:47:38 pm by ptDev »

Offline tibsi

  • Single posting newcomer
  • *
  • Posts: 3
Re: New plugin: CodePaste
« Reply #1 on: March 18, 2011, 02:43:23 pm »
thanx could you post the *.cbplugin file too?

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: New plugin: CodePaste
« Reply #2 on: March 18, 2011, 03:42:23 pm »
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.

Offline tibsi

  • Single posting newcomer
  • *
  • Posts: 3
Re: New plugin: CodePaste
« Reply #3 on: March 21, 2011, 09:39:46 am »
well i guessed so

than can you help me compile this i always get some errors

Quote
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 ===|

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New plugin: CodePaste
« Reply #4 on: March 21, 2011, 10:15:59 am »
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tibsi

  • Single posting newcomer
  • *
  • Posts: 3
Re: New plugin: CodePaste
« Reply #5 on: March 21, 2011, 11:24:20 am »
ok thanx

Now i use the v2.8.11 but i still get one of those

Quote
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 ===|

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: New plugin: CodePaste
« Reply #6 on: March 21, 2011, 11:36:30 am »
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.


« Last Edit: March 22, 2011, 01:20:38 pm by ptDev »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: New plugin: CodePaste
« Reply #7 on: June 07, 2012, 07:46:22 am »
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 ....

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: New plugin: CodePaste
« Reply #8 on: June 11, 2012, 11:29:18 pm »
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/.
« Last Edit: June 11, 2012, 11:48:22 pm by ptDev »