News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Plugin Settings Icons

Started by Pecan, July 02, 2007, 01:45:39 PM

Previous topic - Next topic

Pecan

Quote
4203     /     mandrav     0 minutes     * Binary .cbplugin files can now contain icons for the "Settings" dialogs. The two supported icon files should be named <plugin_name>.png and <plugin_name>-off.png.
* Updated all settings dialogs to locate icons through configmanager.
* If a settings icon for a plugin cannot be located, the generic-plugin icon will be used.

Beautiful!

thank you

Should the <plugin>.png's be loose in the .cbplugin file or zipped together in the <plugin>.zip along with the <plugin>.manifest.

mandrav

#1
Sample plugin (named TestPlugin) contents:


TestPlugin.cbplugin:
    TestPlugin.dll  <-- the plugin
    TestPlugin.zip  <-- its resources
    TestPlugin.png  <-- the highlighted settings icon
    TestPlugin-off.png  <-- the non-highlighted settings icon


These are the "easy" stuff to support, since they share a common base name (the plugin's name). To add support for, e.g. toolbar images, will take a little longer...

EDIT: for those wondering, the problem is not how to define additional files to be installed but rather how to know what files each plugin needs when exporting (saving).
Be patient!
This bug will be fixed soon...

mandrav

OK, done with it.
Now binary plugins (.cbplugin) can also contain extra files to be installed/uninstalled/exported. Just define them inside the plugin's manifest XML.
E.g.:


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_plugin_manifest_file>
    <SdkVersion major="1" minor="10" release="0" />
    <Plugin name="Autosave">
        <Value title="Autosave" />
        <Value version="0.1" />
        <Value description="Saves your work in regular intervals" />
        <Value author="Thomas Denk" />
        <Value authorEmail="" />
        <Value authorWebsite="http://www.codeblocks.org" />
        <Value thanksTo="" />
        <Value license="GPL" />
    </Plugin>
   
    <Extra file="images/16x16/bookmark_add.png" />
    <Extra file="images/16x16/editcopy.png" />

</CodeBlocks_plugin_manifest_file>



Just make sure you define only your plugin's extra files as there is no check if they're needed by other plugins when deleting them...
Be patient!
This bug will be fixed soon...

dmoore

until now, I've been keeping bitmaps in <Plugin-name>.zip
so long as they have an XRC associated with them, they are easy to load and manage.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

mandrav

Quote from: dmoore on July 02, 2007, 03:54:05 PM
until now, I've been keeping bitmaps in <Plugin-name>.zip
so long as they have an XRC associated with them, they are easy to load and manage.

Yes, most plugins are like that.
Be patient!
This bug will be fixed soon...

dmoore

well my only concern is that plugin writers will use <extra file> to unnecessarily pollute the shared folders because of the effort required to understand XRC.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

mandrav

Quote from: dmoore on July 02, 2007, 08:50:14 PM
well my only concern is that plugin writers will use <extra file> to unnecessarily pollute the shared folders because of the effort required to understand XRC.

Do you have any hints for people to understand XRC?
Be patient!
This bug will be fixed soon...

dmoore

sure (i walked into this one didn't I  :lol: ). I'll put a page up on the wiki...
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

mandrav

Quote from: dmoore on July 02, 2007, 09:16:07 PM
sure (i walked into this one didn't I  :lol: ). I'll put a page up on the wiki...

That'd be perfect, thanks :)
Be patient!
This bug will be fixed soon...

dmoore

I've made a start: http://wiki.codeblocks.org/index.php?title=Managing_Plug-in_Resources
(it will probably take a couple of weeks to complete because I have other pressing demands on my time :) )

Anyone reading this should feel free to contribute - I'm certain there are many mistakes
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

mandrav

Quote from: dmoore on July 05, 2007, 02:50:31 PM
I've made a start: http://wiki.codeblocks.org/index.php?title=Managing_Plug-in_Resources
(it will probably take a couple of weeks to complete because I have other pressing demands on my time :) )

Anyone reading this should feel free to contribute - I'm certain there are many mistakes

Thanks :)
Be patient!
This bug will be fixed soon...

killerbot

we once made the suggestion in a sticky post, to use CamelCase, could you adopt your wiki page to use that too please.

MyPlugIn ;-)

dje

Hi !

After many tests, I don't succeed in installing my plugin pngs  :oops:

My manifest.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_plugin_manifest_file>
    <SdkVersion major="1" minor="11"  release="10" />
    <Plugin name="ThreadSearch">
        <Value title="ThreadSearch" />
        <Value version="0.7" />
        <Value description="Multi-threaded 'Search in files' with preview window." />
        <Value author="Jerome ANTOINE" />
        <Value authorEmail="" />
        <Value authorWebsite="" />
        <Value thanksTo="wxWidgets team
Code::Blocks team
wxGlade team" />
        <Value license="GPL" />
    </Plugin>

    <Extra file="images/findf.png" />
    <Extra file="images/findfdisabled.png" />
    <Extra file="images/options.png" />
    <Extra file="images/optionsdisabled.png" />
    <Extra file="images/stop.png" />
    <Extra file="images/stopdisabled.png" />
</CodeBlocks_plugin_manifest_file>


My structure :
ThreadSearch.cbplugin
   findf.png
   findfdisabled.png
   options.png
   optionsdisabled.png
   stop.png
   stopdisabled.png
   ThreadSearch.dll
   ThreadSearch.png
   ThreadSearch-off.png
   ThreadSearch.zip
      manifest.xml

I also tried to put pngs (all except ThreadSearch.png and ThreadSearch-off.png) in ThreadSearch.zip but only settings pngs are copied.

Is there anything wrong ?

XP SP2, SVN 4229.

Dje

dmoore

show your image loading code...
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

dje

In fact, I just checked the tree.
extra pngs are not copied at the right (expected) place.

i first tried to copy them with <Extra file="images/ThreadSearch/findf.png" />
As it didn't work, I tried with <Extra file="images/findf.png" />
I also tried with <Extra file="images\ThreadSearch\findf.png" />

Shouldn't they be copied at install whatever my code is ?

It is
wxString prefix = ConfigManager::GetDataFolder() + _T("/images/ThreadSearch/");
...
pBtnSearch->SetBitmapDisabled(wxBitmap(prefix + wxT("findfdisabled.png"), wxBITMAP_TYPE_PNG));

@dmoore You already saw it isn't it ?

Dje