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:
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);
}
and an event handler:
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);
}
the ****'s denote the incomplete code
hmm... it would be possible to specify a sequence of wxBitMaps in an XRC file as follows:
<resource>
<object class="wxBitmap" name="img1">images/image1.png</object>
<object class="wxBitmap" name="img2">images/image2.png</object>
etc...
</resource>
zip the XRC in with the images and manifest (using the relative paths for the images as in the xrc). Then after you call
Manager::LoadResource(_T("myplugin.zip");
you can access your images with
wxBitmap bmp;
// typedef
bmp = wxXmlResource::Get()->LoadBitmap(_T("img1"));
hmm... it would be possible to specify a sequence of wxBitMaps in an XRC file as follows:
<resource>
<object class="wxBitmap" name="img1">images/image1.png</object>
<object class="wxBitmap" name="img2">images/image2.png</object>
etc...
</resource>
zip the XRC in with the images and manifest (using the relative paths for the images as in the xrc). Then after you call
Manager::LoadResource(_T("myplugin.zip");
you can access your images with
wxBitmap bmp;
// typedef
bmp = wxXmlResource::Get()->LoadBitmap(_T("img1"));
After three hours of trying. I think I'll give this one up.
It doesn't complain, but it doesn't load the images either.
ThreadImages.xrc
<?xml version="1.0" encoding="utf-8"?>
<resource>
<object class="wxBitmap" name="findf"><bitmap>findf.png</bitmap></object>
<object class="wxBitmap" name="findfdisabled"><bitmap>findfdisabled.png</bitmap></object>
<object class="wxBitmap" name="options"><bitmap>options.png</bitmap></object>
<object class="wxBitmap" name="optionsdisabled"><bitmap>optionsdisabled.png</bitmap></object>
<object class="wxBitmap" name="stop"><bitmap>stop.png</bitmap></object>
<object class="wxBitmap" name="stopdisabled"><bitmap>stopdisabled.png</bitmap></object>
<object class="wxBitmap" name="ThreadSearch"><bitmap>ThreadSearch.png</bitmap></object>
<object class="wxBitmap" name="ThreadSearchoff"><bitmap>ThreadSearch-off.png</bitmap></object>
</resource>
Files in ThreadSearch.zip
findf.png
findfdisabled.png
manifest.xml
options.png
optionsdisabled.png
stop.png
stopdisabled.png
ThreadImages.xrc
ThreadSearch.png
ThreadSearch-off.png
if (!Manager::LoadResource(_T("ThreadSearch.zip")))
{
NotifyMissingFile(_T("ThreadSearch.zip"));
}
......
wxBitmap bmp = wxXmlResource::Get()->LoadBitmap(_T("findf"));
wxBitmapButton* pBtnSearch = new wxBitmapButton(toolBar, idBtnSearch, bmp);
It just seems to do nothing. Even when I change the name of the .png to one that doesn't exist, it doesn't even error out.
It always just shows the button without the bitmap.
Here are the diffs that allow the .zip to contain all the .png files.
Thank you dmoore
ThreadSearch.cpp
c:\Usr\Proj\ThreadSearch>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearch.cpp ThreadSearch.cpp
--- E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearch.cpp 2007-06-28 21:12:28.000000000 -0500
+++ ThreadSearch.cpp 2007-06-29 18:08:03.953125000 -0500
@@ -250,8 +250,7 @@
{
// set log image
wxBitmap bmp;
- wxString prefix = ConfigManager::GetDataFolder() + _T("/images/16x16/");
- bmp = cbLoadBitmap(prefix + _T("filefind.png"), wxBITMAP_TYPE_PNG);
+ bmp = wxXmlResource::Get()->LoadBitmap(_T("findf"));
m_ThreadSearchId = pMsgMan->AddLog(m_pThreadSearchView, _T("Thread search"), bmp);
}
@@ -501,13 +500,12 @@
m_pToolbar = toolBar;
m_pThreadSearchView->SetToolBar(toolBar);
- wxString prefix = ConfigManager::GetDataFolder() + _T("/images/16x16/");
wxComboBox* pCboSearchExpr = new wxComboBox (toolBar, idCboSearchExpr, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN);
- wxBitmapButton* pBtnSearch = new wxBitmapButton(toolBar, idBtnSearch, wxBitmap(prefix + wxT("findf.png"), wxBITMAP_TYPE_PNG));
- wxBitmapButton* pBtnOptions = new wxBitmapButton(toolBar, idBtnOptions, wxBitmap(prefix + wxT("options.png"), wxBITMAP_TYPE_PNG));
+ wxBitmapButton* pBtnSearch = new wxBitmapButton(toolBar, idBtnSearch, wxXmlResource::Get()->LoadBitmap(_T("findf")));
+ wxBitmapButton* pBtnOptions = new wxBitmapButton(toolBar, idBtnOptions, wxXmlResource::Get()->LoadBitmap(_T("options")));
- pBtnSearch->SetBitmapDisabled(wxBitmap(prefix + wxT("findfdisabled.png"), wxBITMAP_TYPE_PNG));
- pBtnOptions->SetBitmapDisabled(wxBitmap(prefix + wxT("optionsdisabled.png"), wxBITMAP_TYPE_PNG));
+ pBtnSearch->SetBitmapDisabled(wxXmlResource::Get()->LoadBitmap(_T("findfdisabled")));
+ pBtnOptions->SetBitmapDisabled(wxXmlResource::Get()->LoadBitmap(_T("optionsdisabled")));
toolBar->AddControl(pCboSearchExpr);
toolBar->AddControl(pBtnSearch);
ThreadSearchView.cpp
c:\Usr\Proj\ThreadSearch>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearchView.cpp ThreadSearchView.cpp
--- E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearchView.cpp 2007-06-28 21:46:04.000000000 -0500
+++ ThreadSearchView.cpp 2007-06-29 18:47:14.171875000 -0500
@@ -8,6 +8,8 @@
* License: GPL
**************************************************************/
+#include <wx/xrc/xmlres.h>
+
#include "messagemanager.h"
#include "configmanager.h"
#include "configurationpanel.h"
@@ -924,13 +926,13 @@
wxString prefix = ConfigManager::GetDataFolder() + _T("/images/16x16/");
- wxString searchButtonPathsEnabled[] = {prefix + wxT("findf.png"),
- prefix + wxT("stop.png") ,
- wxEmptyString};
-
- wxString searchButtonPathsDisabled[] = {prefix + wxT("findfdisabled.png"),
- prefix + wxT("stopdisabled.png") ,
- wxEmptyString};
+ wxString searchButtonPathsEnabled[] = {wxT("findf"),
+ wxT("stop") ,
+ wxEmptyString};
+
+ wxString searchButtonPathsDisabled[] = {wxT("findfdisabled"),
+ wxT("stopdisabled") ,
+ wxEmptyString};
// Gets toolbar search button pointer
wxBitmapButton* pToolBarSearchBtn = static_cast<wxBitmapButton*>(m_pToolBar->FindControl(idBtnSearch));
@@ -939,8 +941,8 @@
if ( label != skip )
{
m_pBtnSearch->SetLabel(searchButtonLabels[label]);
- pToolBarSearchBtn->SetBitmapLabel (wxBitmap(searchButtonPathsEnabled [label], wxBITMAP_TYPE_PNG));
- pToolBarSearchBtn->SetBitmapDisabled(wxBitmap(searchButtonPathsDisabled[label], wxBITMAP_TYPE_PNG));
+ pToolBarSearchBtn->SetBitmapLabel (wxXmlResource::Get()->LoadBitmap(searchButtonPathsEnabled [label]));
+ pToolBarSearchBtn->SetBitmapDisabled(wxXmlResource::Get()->LoadBitmap(searchButtonPathsDisabled [label]));
}
// Sets enable state
ThreadImages.xrc to be put in ThreadSearch.zip
<?xml version="1.0" encoding="utf-8"?>
<resource>
<object class="wxBitmap" name="findf">findf.png</object>
<object class="wxBitmap" name="findfdisabled">findfdisabled.png</object>
<object class="wxBitmap" name="options">options.png</object>
<object class="wxBitmap" name="optionsdisabled">optionsdisabled.png</object>
<object class="wxBitmap" name="stop">stop.png</object>
<object class="wxBitmap" name="stopdisabled">stopdisabled.png</object>
<object class="wxBitmap" name="ThreadSearch">ThreadSearch.png</object>
<object class="wxBitmap" name="ThreadSearchoff">ThreadSearch-off.png</object>
</resource>
Contents of ThreadSearch.zip
findf.png
findfdisabled.png
options.png
optionsdisabled.png
stop.png
stopdisabled.png
ThreadSearch.png
ThreadSearch-off.png
manifest.xml
ThreadImages.xrc
Post Build Step
zip -j9 .\ThreadSearch.zip manifest.xml *.png ThreadImages.xrc
zip -j9 ThreadSearch.cbplugin .\bin\debug\ThreadSearch.dll .\ThreadSearch.zip
Hi all !
So, now:
- Morten's bug fix (crash on plugin disable).
The naughty bug is FIXED :D :D :D :D :D
I had misunderstood a part of plugins management.
I tought that disable = uninstall without removing dll/zip but in fact, a plugin instance exists even it plugin is disabled.
The following OnRelease method solves the problem on XP. It see no reason why it could be different on Linux but it is not tested yet.
void ThreadSearch::OnRelease(bool appShutDown)
{
// do de-initialization for your plugin
// if appShutDown is false, the plugin is unloaded because Code::Blocks is being shut down,
// which means you must not use any of the SDK Managers
// NOTE: after this function, the inherited member variable
// m_IsAttached will be FALSE...
// Removes Thread search menu item from the View menu
RemoveMenuItems();
m_pToolbar = NULL;
// Saves configuration to default.conf
SaveConfig(m_ThreadSearchId != -1);
wxASSERT(m_pThreadSearchView != NULL);
if ( m_ThreadSearchId != -1 )
{
// As id is != from -1, ThreadSearchView is managed by MessageManager
// We remove it from the notebook
MessageManager* pMsgMan = Manager::Get()->GetMessageManager();
wxASSERT(pMsgMan != NULL);
pMsgMan->RemoveLog(m_pThreadSearchView);
m_ThreadSearchId = -1;
}
m_pThreadSearchView->Destroy();
m_pThreadSearchView = NULL;
}
Thanks to Pecan and Dmoore for pngs embedding code, i'll have a look at it.
I confirm the paste bug. The same happens with copy from the preview editor.
It does not work anymore with keyboard shortcuts but works with contextual menus.
EDIT: Paste works with default target (nightly build environment) but not with DevDebug target (debug development environment).
EDIT: Copy from preview editor does not works (whereas it did).
This is a regression but I don't see at first glance where it comes from.
Dje
Here are the diffs to work around the copy/paste bug in CB main.cpp and allow correct pasting in ThreadSearch.
However, it still will not allow the CB menu, menu hotkeys, or the toolbar icons to be used for copy paste because main.cpp is disabling those in its UpdateUI routine if the focus is not on an editor.
It will, however, allow Ctrl-C and Ctrl-V to work correctly.
ThreadSearchView.h
c:\Usr\Proj\ThreadSearch\ThreadSearch7>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr ThreadSearchView.h ..
--- ThreadSearchView.h 2007-06-26 10:02:52.000000000 -0500
+++ ../ThreadSearchView.h 2007-06-30 11:27:19.390625000 -0500
@@ -40,6 +40,8 @@
class ThreadSearchThread;
class ThreadSearchView: public MessageLog {
+
+ friend class ThreadSearch;
public:
// begin wxGlade: ThreadSearchView::ids
// end wxGlade
ThreadSearch.H
c:\Usr\Proj\ThreadSearch\ThreadSearch7>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr ThreadSearch.h ..
--- ThreadSearch.h 2007-06-28 20:30:16.000000000 -0500
+++ ../ThreadSearch.h 2007-06-30 11:11:56.515625000 -0500
@@ -233,6 +233,8 @@
* the 'Find implementation' item if possible
*/
int GetInsertionMenuIndex(const wxMenu* const pCtxMenu);
+ void OnEditPaste(wxCommandEvent& event);
+
// Member variables
wxString m_SearchedWord; // Word under cursor on right click
@@ -247,6 +249,8 @@
bool m_ShowDirControls; // True if user wants to display directory specific controls
bool m_DisplayLogHeaders;
bool m_DrawLogLines;
+ bool b_OnReleased;
+ wxComboBox* m_pCboSearchExpr;
DECLARE_EVENT_TABLE();
};
ThreadSearch.cpp
c:\Usr\Proj\ThreadSearch\ThreadSearch7>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr ThreadSearch.cpp ..
--- ThreadSearch.cpp 2007-06-28 21:12:28.000000000 -0500
+++ ../ThreadSearch.cpp 2007-06-30 12:13:47.640625000 -0500
@@ -18,6 +18,7 @@
#include <configurationpanel.h>
#include <editor_hooks.h>
#include <wx/wxFlatNotebook/wxFlatNotebook.h>
+#include <wx/clipbrd.h>
#include "ThreadSearch.h"
#include "ThreadSearchConfPanel.h"
@@ -32,6 +33,7 @@
PluginRegistrant<ThreadSearch> reg(_T("ThreadSearch"));
}
+int idEditPaste = XRCID("idEditPaste");
// events handling
BEGIN_EVENT_TABLE(ThreadSearch, cbPlugin)
@@ -44,6 +46,8 @@
EVT_BUTTON (idBtnOptions, ThreadSearch::OnBtnOptionsClick)
EVT_BUTTON (idBtnSearch, ThreadSearch::OnBtnSearchClick)
EVT_TEXT_ENTER(idCboSearchExpr, ThreadSearch::OnCboSearchExprEnter)
+ EVT_TEXT (idCboSearchExpr, ThreadSearch::OnCboSearchExprEnter)
+ EVT_MENU (idEditPaste, ThreadSearch::OnEditPaste)
END_EVENT_TABLE()
// constructor
@@ -57,7 +61,8 @@
m_ShowSearchControls(true),
m_ShowDirControls(false),
m_DisplayLogHeaders(true),
- m_DrawLogLines(false)
+ m_DrawLogLines(false),
+ m_pCboSearchExpr(0)
{
// Make sure our resources are available.
// In the generated boilerplate code we have no resources but when
@@ -99,6 +104,8 @@
// Shows/Hides search widgets on the Messages notebook ThreadSearch panel
m_pThreadSearchView->ShowSearchControls(m_ShowSearchControls);
+
+ b_OnReleased = false;
}
void ThreadSearch::OnRelease(bool appShutDown)
@@ -109,6 +116,12 @@
// NOTE: after this function, the inherited member variable
// m_IsAttached will be FALSE...
+ // --------------------------------------------------------------
+ // Carefull! This routine can be entered consecutive times
+ // --------------------------------------------------------------
+ if ( b_OnReleased ) return;
+ b_OnReleased = true;
+
// Removes Thread search menu item from the View menu
RemoveMenuItems();
@@ -594,7 +606,8 @@
// Runs a multi threaded search with combo text
wxComboBox* pCboBox = static_cast<wxComboBox*>(m_pToolbar->FindControl(idCboSearchExpr));
wxASSERT(pCboBox != NULL);
- RunThreadSearch(pCboBox->GetValue());
+ if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER )
+ RunThreadSearch(pCboBox->GetValue());
}
@@ -648,3 +661,75 @@
return wordFound;
}
+// ----------------------------------------------------------------------------
+void ThreadSearch::OnEditPaste(wxCommandEvent& event)
+// ----------------------------------------------------------------------------
+{
+ // Process clipboard data only if we have the focus
+
+ // ----------------------------------------------------------------
+ // NB: A bug in CB main.cpp causes a ctrl-v to always paste into the
+ // current editor. Here, we'll make checks to see if the paste
+ // is for our search combo boxes and paste the data there.
+ // If the focused window is one of ours that shouldn't get pasted
+ // data, we'll simply ignore it.
+ // If the window isn't one of ours, we'll event.Skip();
+ // ----------------------------------------------------------------
+
+ if ( !IsAttached() )
+ { event.Skip(); return; }
+
+ if (not m_IsAttached) {event.Skip(); return;}
+
+ wxWindow* pFocused = wxWindow::FindFocus();
+ if (not pFocused) { event.Skip(); return; }
+
+ wxString focusedStr = pFocused->GetName();
+ //DBGLOG(wxT("OnEditPaste:Focused[%p][%s]"), pFocused, focusedStr.c_str());
+
+ // don't allow paste when the following windows have the focus
+ if ( ( pFocused == m_pThreadSearchView->m_pSearchPreview )
+ || ( pFocused == m_pThreadSearchView->m_pListLog ) )
+ { return; }
+ if ( pFocused == m_pThreadSearchView->m_pListLog->GetListControl())
+ return;
+
+ // if the following window have the focus, own the paste.
+ if ( (pFocused != m_pCboSearchExpr)
+ && (pFocused != m_pThreadSearchView->m_pCboSearchExpr) )
+ { event.Skip(); return;}
+
+ if ( not wxTheClipboard->Open() )
+ {
+ //DBGLOG( wxT("ThreadSearch::OnPaste Can't open clipboard.") );
+ event.Skip();
+ return;
+ }
+ // -- Text Processing ----------------------------------------------------
+ if ( not wxTheClipboard->IsSupported(wxDF_TEXT) )
+ {
+ //DBGLOG( wxT("ThreadSearch::OnPaste:No text data on clipboard") );
+ wxTheClipboard->Close();
+ event.Skip();
+ return;
+ }
+
+ wxTextDataObject text;
+ if ( not wxTheClipboard->GetData(text) ) {
+ //DBGLOG( wxT("ThreadSearch::OnPaste:Can't get text from the clipboard") );
+ }
+ else { // Put text in search wxComboBoxes
+ wxString str = text.GetText();
+ // stuff the search boxes
+ if (pFocused == m_pCboSearchExpr)
+ m_pCboSearchExpr->SetValue(str);
+ if (pFocused == m_pThreadSearchView->m_pCboSearchExpr)
+ m_pThreadSearchView->m_pCboSearchExpr->SetValue(str);
+ }
+
+ wxTheClipboard->Close();
+ // If you Skip(), CB main.cpp will wrongly paste your text into the current editor
+ // because CB main.cpp thinks it owns the clipboard.
+ //- event.Skip();
+ return; //own the event
+}//OnEditPaste
@Pecan
My fault. I assumed an absolute temporary dir of "temp". Should have asked the system for the location of the trash directory.
I don't know if it is still necessary but this is my codesnippets.ini
ExternalEditor=Enter filename of external editor
SnippetFile=C:\\Documents and Settings\\Jerome\\Application Data\\codeblocks\\codesnippets.xml
ViewSearchBox=1
casesensitive=1
scope=2
SnippetFolder=Enter Snippets storage Folder
MouseDragSensitivity=8
MouseToLineRatio=30
MouseContextDelay=192
WindowState=External
WindowPosition=520 122 300 350
EditDlgXpos=235
EditDlgYpos=122
EditDlgWidth=500
EditDlgHeight=400
EditDlgMaximized=0
Note: on my XP, I have neither C:\temp nor C:\tmp directories.
I suppose you know it but if it is not the case... There are TEMP and TMP environment variables on Windows.
Both yield on my PC
C:\DOCUME~1\Jerome\LOCALS~1\Temp
I just replace External by Floating and it works.
Thanks for patch.
Do you think I should apply it or should it be fixed directly in C::B sources ?
Note that I can paste text in your code snippets text control, does the problem concern only combo boxes ?
Dje
Diffs to record and restore the position of the splitter sash accross CB runs.
ThreadSearchView.h
--- ThreadSearchview.h 2007-06-26 10:02:52.000000000 -0500
+++ ../ThreadSearchview.h 2007-06-30 19:11:38.718750000 -0500
@@ -87,6 +87,7 @@
/** Sets the splitter window sash position.
*/
void SetSashPosition(int position, const bool redraw = true) {m_pSplitter->SetSashPosition(position, redraw);}
+ int GetSashPosition() { return m_pSplitter->GetSashPosition(); }
/** PostThreadSearchEvent
ThreadSearch.h
--- ThreadSearch.h 2007-06-28 20:30:16.000000000 -0500
+++ ../ThreadSearch.h 2007-06-30 19:11:34.703125000 -0500
@@ -248,6 +249,9 @@
bool m_ShowDirControls; // True if user wants to display directory specific controls
bool m_DisplayLogHeaders;
bool m_DrawLogLines;
bool b_OnReleased;
wxComboBox* m_pCboSearchExpr;
+ int m_SplitterPosn; // position of splitter from config
DECLARE_EVENT_TABLE();
};
ThreadSearch.cpp
--- ThreadSearch.cpp 2007-06-28 21:12:28.000000000 -0500
+++ ../ThreadSearch.cpp 2007-06-30 19:11:57.968750000 -0500
@@ -102,8 +103,14 @@
m_pThreadSearchView->SetSashPosition(x/2);
m_pThreadSearchView->SetListColumns();
+ // Set the splitter posn from the config
+ if (m_SplitterPosn)
+ m_pThreadSearchView->SetSashPosition(m_SplitterPosn);
+
// Shows/Hides search widgets on the Messages notebook ThreadSearch panel
m_pThreadSearchView->ShowSearchControls(m_ShowSearchControls);
b_OnReleased = false;
}
void ThreadSearch::OnRelease(bool appShutDown)
@@ -509,6 +510,9 @@
m_FindData.SetSearchPath (pCfg->Read (wxT("/DirPath"), wxEmptyString));
m_FindData.SetSearchMask (pCfg->Read (wxT("/Mask"), wxT("*.cpp;*.c;*.h")));
+
+ m_SplitterPosn = pCfg->ReadInt(wxT("/SplitterPosn"), 0);
+
}
@@ -490,6 +509,8 @@
pCfg->Write(wxT("/DirPath"), m_FindData.GetSearchPath());
pCfg->Write(wxT("/Mask"), m_FindData.GetSearchMask());
+
+ pCfg->Write(wxT("/SplitterPosn"), m_pThreadSearchView->GetSashPosition() );
}
I never saw that on my Ubuntu 6.10.
Maybe should I use a "real" size instead of wxDefaultSize...
EDIT : can you undock it and resize it ?
Dje
Here it is undocked and with the downArrow clicked.
(http://img107.imageshack.us/img107/6126/191vi2.png)
Would you like me to change anything?
I put a debug statement as follow:
bool ThreadSearch::BuildToolBar(wxToolBar* toolBar)
....
toolBar->Realize();
#if wxCHECK_VERSION(2, 8, 0)
toolBar->SetInitialSize();
#else
toolBar->SetBestFittingSize();
#endif
int x, y;
m_pCboSearchExpr->GetSize(&x,&y);
DBGLOG(wxT("ThreadSearch ToolBar Size[%d][%d]"), x, y);
....
and got the following result:
[17:03:45.742]: ThreadSearch ToolBar Size[100][25]
Is this a little small for a wxcombo box? I though 25 pixels is almost closed.
I realize that search in file isn't possible, but just left it in to show the possibilities (I did take out the more complex multiple file/directory targets, which sends a list of a space separated files and directories that the user selected before right clicking)
It is quite easy to manage a list of items instead of one directory. I'd choose a '*' instead of space for separator because '*' can't be used in paths and avoid problems with 'Program files' or others.
yeah i guess that will save putting the names in quotes. to handle this case, your buildmodulemenu should look like this:
void InterpretedLangs::BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data)
{
...
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 && data->GetKind()==FileTreeData::ftdkVirtualGroup) //right clicked on multiple selections in file explorer
{
wxString paths=data->GetFolder(); //get folder contains a space separated list of the files/directories
...
}
Technically, nothing seems really difficult but:
Once you right-clicked an item, how do you get search text ? Sould it activate window, fill the directory path, check directory search check box and set focus to combo to set the search text ?
yes, that is how I would do it.
btw, it could have been something I did wrong, but I was getting a crash on exit (even without starting up a threadsearch)
I never had this problem. Could you be more precise on context ? Do you have any crash report ?
Dje
hasn't happened since so most likely was something i was doing wrong. If it happens again I'll post the report.
Here is the best I can do for a Makefile.am .
However, when I add it to the CB automake system, the compiles for the contribs are no longer invoked. Even with --enable-contribs . So I guess I'm not pointing to it correctly.
It does create a Makefile.in and a Makefile. The Makefile works and the .libs is created when I force the Makefile to run.
Someone else will have to figure out how to correctly plug it into the CB automake system.
INCLUDES = $(WX_CXXFLAGS) \
$(WX_GTK2_CFLAGS) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/include/wxscintilla/include \
-I$(top_srcdir)/src/include/wxFlatNotebook/include
libdir = $(pkgdatadir)/plugins
lib_LTLIBRARIES = libThreadSearch.la
libThreadSearch_la_LDFLAGS = -module -version-info 0:1:0 -shared -no-undefined -avoid-version
libThreadSearch_la_LIBADD = $(PLUGIN_WX_LIBS) ../../../sdk/libcodeblocks.la
libThreadSearch_la_SOURCES = DirectoryParamsPanel.cpp \
SearchInPanel.cpp \
TextFileSearcher.cpp \
TextFileSearcherRegEx.cpp \
TextFileSearcherText.cpp \
ThreadSearch.cpp \
ThreadSearchConfPanel.cpp \
ThreadSearchDefaultPanel.cpp \
ThreadSearchEvent.cpp \
ThreadSearchFindData.cpp \
ThreadSearchThread.cpp \
ThreadSearchTrace.cpp \
ThreadSearchView.cpp
noinst_HEADERS = DirectoryParamsPanel.h \
SearchInPanel.h \
TextFileSearcher.h \
TextFileSearcherRegEx.h \
TextFileSearcherText.h \
ThreadSearch.h \
ThreadSearchConfPanel.h \
ThreadSearchControlIds.h \
ThreadSearchDefaultPanel.h \
ThreadSearchEvent.h \
ThreadSearchFindData.h \
ThreadSearchThread.h \
ThreadSearchTrace.h \
ThreadSearchView.h
pkgdatadir = $(datadir)/@PACKAGE@/images/settings
dist_pkgdata_DATA = ThreadSearch.png \
ThreadSearch-off.png
EXTRA_DIST = manifest.xml
ThreadSearch.zip:
PWD=`pwd` cd $(srcdir) && zip $(PWD)/ThreadSearch.zip manifest.xml *.png *.xrc > /dev/null
install-data-local: ThreadSearch.zip
$(mkinstalldirs) $(DESTDIR)$(datadir)/@PACKAGE@/; \
if test -f $(srcdir)/ThreadSearch.zip; then p=$(srcdir)/ThreadSearch.zip; else p=ThreadSearch.zip; fi; \
$(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/@PACKAGE@/ThreadSearch.zip