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

ThreadSearch 0.7 release

<< < (2/16) > >>

dje:
Hi Rick !


--- Quote from: rickg22 on June 29, 2007, 12:39:41 am ---It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.

--- End quote ---

I did not really know how to proceed. I first thought about including them in manifest/.cbplugin. I was told it should be like that but not implemented.

As I saw 16x16 in C::B toolbar management and my code use 2 existing C::B icons, I chose to put them there.
If it is better to place them in an images\ThreadSearch directory, I'll do it next on next release.

Dje

dmoore:
dje: I want to implement a "search directory" context menu action in your plugin (it will respond to right clicks on directories in the File Explorer in my Interpreted Languages plugin). I have most of the code in place, BUT your ThreadSearchView doesn't publicly expose a means to set the FindData in the view. If you can expose this functionality I will send you a complete patch.

besides the missing member declarations/event handling gunk, adding the feature is as simple as adding some extra code to BuildModuleMenu:


--- Code: ---void ThreadSearch::BuildModuleMenu(const ModuleType type, wxMenu* pMenu, const FileTreeData* data)
{
...
    if ( (type == mtEditorManager) && (m_CtxMenuIntegration == true) )
...
    if(type==mtUnknown) //Assuming file explorer -- fileexplorer fills the filetreedata with ftdkFile or ftdkFolder as "kind", the folder is the full path of the entry
    if(data)
    {
            size_t sep_pos=pMenu->GetMenuItemCount();
            size_t added=0;
            if(data->GetKind()==FileTreeData::ftdkFile)  //right clicked on file in file explorer
            {
                wxFileName f(data->GetFolder());
                wxString filename=f.GetFullPath();
                //**** Could do a search within a file here...****
            }
            if(data->GetKind()==FileTreeData::ftdkFolder) //right clicked on folder in file explorer
            {
                wxFileName f(data->GetFolder());
                wxString filename=f.GetFullPath();
                wxString sText = wxT("Search Directory...");
                m_SearchDirectory=filename;
pMenuItem = pMenu->Append(idMenuDirThreadSearch, sText);
                pMenuItem->Enable(!m_pThreadSearchView->IsSearchRunning());
                added++;
            }
            if(added>0)
                pMenu->InsertSeparator(sep_pos);
    }

--- End code ---

and an event handler:


--- Code: ---void ThreadSearch::OnMnuDirThreadSearch(wxCommandEvent &event)
{
if ( !IsAttached() )
return;

    ThreadSearchFindData findData=m_FindData; //****Alternative pull findData from the actual logpanel****
    findData.SetScope(ScopeDirectoryFiles);
    findData.SetSearchPath(m_SearchDirectory);
    findData.SetRecursiveSearch(true);

//**** Need to update the Log Panel with the contents of findData****

    AddAndShowThreadSearchLogPanel(true);
}

--- End code ---

the ****'s denote the incomplete code

dmoore:

--- Quote from: dje on June 29, 2007, 03:52:38 pm ---Hi Rick !


--- Quote from: rickg22 on June 29, 2007, 12:39:41 am ---It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.

--- End quote ---

I did not really know how to proceed. I first thought about including them in manifest/.cbplugin. I was told it should be like that but not implemented.

As I saw 16x16 in C::B toolbar management and my code use 2 existing C::B icons, I chose to put them there.
If it is better to place them in an images\ThreadSearch directory, I'll do it next on next release.

Dje

--- End quote ---

take a look at the post build steps of most contrib plugins (there's a zip command) (or alternatively look at my win32 InterpretedLangs project file from my cbilplugins project on berlios)

you should use the #cb global variable to setup the paths to your project includes, libraries and other dependencies. remove the path specifiers in the link libraries put the paths in library search paths.

You shouldn't need separate build and debug targets if youre build is set up to output your dll and zip files to the devel directory (this is where the debug build of codeblocks goes). when you run update.bat your files will be included in the stripped binaries in the output folder.

MortenMacFly had other good advice for me in this post: http://forums.codeblocks.org/index.php/topic,6297.msg48251.html#msg48251

Pecan:

--- Quote from: rickg22 on June 29, 2007, 12:39:41 am ---It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.

--- End quote ---

To my knowledge, there is currently no way that .cbplugin images get copied to the necessary CB share directories.

So leaving the images in the zip file will not work.

However, since I was also working on the problem for another plugin, I'll also write it so images can be loaded from /share/codeblocks/<plugin>.zip by the plugin itself and make a call to cbLoadBitmap() if necessary.

I'll use ThreadSearch a the guinea pig if that's ok with dje.


dmoore:

--- Quote from: Pecan on June 29, 2007, 04:32:37 pm ---To my knowledge, there is currently no way that .cbplugin images get copied to the necessary CB share directories.

So leaving the images in the zip file will not work.

--- End quote ---

Pecan: can you explain this in more detail? I have an xrc toolbar in my Python plugin that loads a bunch of images. those images are all stored in the PyPlugin.zip along with the xrc file and the manifest and it *appears* to work fine.... So you must be talking about a different case?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version