News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

can any one give me some suggestions in developping my plugin?

Started by luckyzhangwei, November 18, 2009, 03:05:45 AM

Previous topic - Next topic

luckyzhangwei

hi, all.
recently i want to add a plugin in the codeblocks for personal usage.
this is what the plugin i want do:

1.the config panel:
  see the attachment.
  i don't know how to post the pic here.

2.when the user change the config panel.it will automaticlly insert(if there is no code yet in the specific parts of source file)/change(if the code had already existed) the related codes of the source file;

for example:
in the main.cpp:
    when i insert a new parameter,let it called a and with default value 1.0, it will insert a statement "float a = 1.0;"
    when i change the parameter name to b,and its default value to 2.0, the previous generated staments will be changed to "float b = 2.0;"

3.i want the source file's  some lines can not changed by the user, these lines are only permitted changing by the config panel.
but other lines are editable by user.


i thought this is realted 3 parts:
1) the plugin mechanism of codeblocks:
  i had read the "wiki.codeblocks.org" 's plugin development parts.and try to add a helloworld plugin and menu plugin.
  but it seems that resource is not enough for me.
  i am still don't quite clear on how should i do it.

2) how can interact with the editor?
  this is the key point here. interactive with the editor.i know the editor is using the wxscintllia.
  is there any resource or puglin sources to show how to interate with the editor.

3)how should i let some lines block can't change.while other lines can change.

i am a newbee about wxwidgets and codeblock plugin development.
so can any one tell me how to achieve these feature?
i mean just the steps and what should i pay attention to.
and if there is any good plugin examples is welcomed.

thank u very much.
i think this will save lots of time for me.

[attachment deleted by admin]

blueshake

Quote2) how can interact with the editor?
   this is the key point here. interactive with the editor.i know the editor is using the wxscintllia.
   is there any resource or puglin sources to show how to interate with the editor.

I think you can read the codes in codecompletion.h and codecompleiton.cpp in codecomplition plugin.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

ollydbg

Quote from: luckyzhangwei on November 18, 2009, 03:05:45 AM

2) how can interact with the editor?
  this is the key point here. interactive with the editor.i know the editor is using the wxscintllia.
  is there any resource or puglin sources to show how to interate with the editor.

Hi, it seems we come from the same country. :D

code like below:

// Get the editor
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();

// Then call the functions

ed->XXXXX()


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.