31
33
#include "manager.h"
32
34
#include "version.h"
33
35
#include "snippetsconfig.h"
36
#include "seditormanager.h"
38
// CodeSnippetsApp main menu id, but referenced in snippetproperty.cpp
39
// So each has an extern to the definition here.
40
//-int idMenuProperties = wxNewId();
35
42
// anchor to global configuration
36
43
CodeSnippetsConfig* g_pConfig = 0;
37
44
CodeSnippetsConfig* GetConfig(){return g_pConfig;}
38
int g_activeMenuId = 0;
45
void SetConfig( CodeSnippetsConfig* p) {g_pConfig = p;}
47
int g_activeMenuId = 0;
39
48
int GetActiveMenuId(){return g_activeMenuId;}
40
void SetActiveMenuId(int menuId)
41
{ g_activeMenuId = menuId;
49
void SetActiveMenuId(int menuId) { g_activeMenuId = menuId; }
44
51
// ------------------------------------
45
52
// UTF8 conversion routines
69
76
// ----------------------------------------------------------------------------
73
AppVersion SnippetVersion;
80
AppVersion SnippetVersion;
75
82
AppName = wxEmptyString;
79
86
pSnippetsTreeCtrl = 0;
80
87
pSnippetsSearchCtrl = 0;
83
SettingsExternalEditor = wxEmptyString;
84
SettingsSnippetsCfgFullPath = wxEmptyString;
85
SettingsSnippetsXmlFullPath = wxEmptyString;
86
SettingsSnippetsFolder = wxEmptyString;
89
SettingsExternalEditor = wxEmptyString;
90
SettingsSnippetsCfgPath = wxEmptyString;
91
SettingsSnippetsXmlPath = wxEmptyString;
92
SettingsSnippetsFolder = wxEmptyString;
93
SettingsCBConfigPath = wxEmptyString;
87
94
SettingsSearchBox = false;
95
SettingsEditorsStayOnTop = true;
96
SettingsToolTipsOption = true;
88
97
m_SearchConfig.caseSensitive = false;
89
98
m_SearchConfig.scope = SCOPE_BOTH;
98
107
m_VersionStr = SnippetVersion.GetVersion();
99
108
m_sWindowHandle = wxEmptyString;
100
SettingsWindowState = wxT("Floating");
101
m_pEvtCloseConnect = 0;
109
m_SettingsWindowState = wxT("Floating");
102
110
m_bWindowStateChanged = false;
111
m_pOpenFilesList = 0;
112
m_pThreadSearchPlugin = 0;
113
m_pDragScrollPlugin = 0;
115
m_AppParent = wxEmptyString;
105
119
// ----------------------------------------------------------------------------
106
120
CodeSnippetsConfig::~CodeSnippetsConfig()
107
121
// ----------------------------------------------------------------------------
110
delete m_pCfgFile; // Valgrind complaint about it not being freed
114
125
// ----------------------------------------------------------------------------
115
126
void CodeSnippetsConfig::SettingsLoad()
116
127
// ----------------------------------------------------------------------------
123
134
wxString fn(__FUNCTION__, wxConvUTF8);
124
135
LOGIT( _T("--- [%s] ---"),fn.c_str() );
125
LOGIT(wxT("Loading Settings File[%s]"),SettingsSnippetsCfgFullPath.c_str());
136
LOGIT(wxT("Loading Settings File[%s]"),SettingsSnippetsCfgPath.c_str());
128
// wxFileConfig cfgFile(wxEmptyString, // appname
129
// wxEmptyString, // vendor
130
// SettingsSnippetsCfgFullPath, // local filename
131
// wxEmptyString, // global file
132
// wxCONFIG_USE_LOCAL_FILE);
135
{ // if we dont do this, we only get in-memory cache
136
// and we want the new physical file data.
141
m_pCfgFile = new wxFileConfig(
139
wxFileConfig cfgFile(
142
140
wxEmptyString, // appname
143
141
wxEmptyString, // vendor
144
SettingsSnippetsCfgFullPath,// local filename
142
SettingsSnippetsCfgPath,// local filename
145
143
wxEmptyString, // global file
146
144
wxCONFIG_USE_LOCAL_FILE);
148
wxFileConfig& cfgFile = *GetCfgFile();
150
146
cfgFile.Read( wxT("ExternalEditor"), &SettingsExternalEditor, wxEmptyString ) ;
151
cfgFile.Read( wxT("SnippetFile"), &SettingsSnippetsXmlFullPath, wxEmptyString ) ;
147
cfgFile.Read( wxT("SnippetFile"), &SettingsSnippetsXmlPath, wxEmptyString ) ;
152
148
cfgFile.Read( wxT("SnippetFolder"), &SettingsSnippetsFolder, wxEmptyString ) ;
153
149
cfgFile.Read( wxT("ViewSearchBox"), &GetConfig()->SettingsSearchBox, true ) ;
154
cfgFile.Read( wxT("casesensitive"), &m_SearchConfig.caseSensitive, true ) ;
150
cfgFile.Read( wxT("casesensitive"), &m_SearchConfig.caseSensitive, true ) ;
156
152
cfgFile.Read( wxT("scope"), &nScope, SCOPE_BOTH ) ;
157
153
m_SearchConfig.scope = (SearchScope)nScope;
159
// read mouse DragScrolling settings
160
//cfgFile.Read(_T("MouseDragScrollEnabled"), &MouseDragScrollEnabled ) ;
161
//cfgFile.Read(_T("MouseEditorFocusEnabled"), &MouseEditorFocusEnabled ) ;
162
//cfgFile.Read(_T("MouseFocusEnabled"), &MouseFocusEnabled ) ;
163
//cfgFile.Read(_T("MouseDragDirection"), &MouseDragDirection ) ;
164
//cfgFile.Read(_T("MouseDragKey"), &MouseDragKey ) ;
165
cfgFile.Read(_T("MouseDragSensitivity"), &MouseDragSensitivity, 8 ) ;
166
cfgFile.Read(_T("MouseToLineRatio"), &MouseToLineRatio, 30 ) ;
167
cfgFile.Read(_T("MouseContextDelay"), &MouseContextDelay, 192 );
155
// read Editors Stay-On-Top of main window option
156
cfgFile.Read( _T("EditorsStayOnTop"), &SettingsEditorsStayOnTop, true);
157
// read Editors ToolTips option
158
cfgFile.Read( _T("ToolTipsOption"), &SettingsToolTipsOption, true);
160
// Read External App state. Launched App will see it as false because
161
// plugin has not set it true yet, so if this is launched App, set it true
162
cfgFile.Read( wxT("ExternalPersistentOpen"), &m_IsExternalPersistentOpen, false ) ;
163
if ( IsApplication() ) SetExternalPersistentOpen(true);
169
165
// read user specified window state (External, Floating, or Docked)
170
cfgFile.Read( wxT("WindowState"), &SettingsWindowState, wxT("Floating") );
171
LOGIT( _T("WindowState[%s]"), SettingsWindowState.c_str() );
166
cfgFile.Read( wxT("WindowState"), &m_SettingsWindowState, wxT("Floating") );
168
LOGIT( _T("WindowState[%s]"), GetSettingsWindowState().c_str() );
173
170
// read last window position
175
172
cfgFile.Read( wxT("WindowPosition"), &winPos, wxEmptyString) ;
193
190
LOGIT( _T("WindowPosition[%s]"),winPos.c_str() );
196
LOGIT( _T("SettingsExternalEditor[%s]"),SettingsExternalEditor.c_str() );
197
LOGIT( _T("SettingsSnippetsXmlFullPath[%s]"),SettingsSnippetsXmlFullPath.c_str() );
198
LOGIT( _T("SettingsSnippetsFolder[%s]"),SettingsSnippetsFolder.c_str() );
199
LOGIT( _T("SettingsSearchBox[%d]"),SettingsSearchBox );
200
LOGIT( _T("caseSensitive[%d]"),m_SearchConfig.caseSensitive );
201
LOGIT( _T("SettingsSnippetsXmlFullPath[%s]"),SettingsSnippetsXmlFullPath.c_str() );
193
LOGIT( _T("SettingsExternalEditor[%s]"), SettingsExternalEditor.c_str() );
194
LOGIT( _T("SettingsSnippetsXmlPath[%s]"),SettingsSnippetsXmlPath.c_str() );
195
LOGIT( _T("SettingsSnippetsFolder[%s]"), SettingsSnippetsFolder.c_str() );
196
LOGIT( _T("SettingsSearchBox[%d]"), SettingsSearchBox );
197
LOGIT( _T("caseSensitive[%d]"), m_SearchConfig.caseSensitive );
198
LOGIT( _T("SettingsSnippetsXmlPath[%s]"), SettingsSnippetsXmlPath.c_str() );
199
LOGIT( _T("SettingsEditorsStayOnTop[%s]"), SettingsEditorsStayOnTop?_T("True"):_T("False") );
200
LOGIT( _T("SettingsToolTipsOption[%s]"), SettingsToolTipsOption?_T("True"):_T("False") );
201
LOGIT( _T("ExternalPersistentOpen[%s]"), IsExternalPersistentOpen()?_T("True"):_T("False") );
204
// read windowHandle. Will be empty if this is first instance
205
cfgFile.Read( wxT("WindowHandle"), &m_sWindowHandle, wxEmptyString) ;
204
// read windowHandle of last or current pgm instance that ran
205
// CodeSnippetsApp will check if it's actually running
206
if ( cfgFile.Exists( wxT("WindowHandle")))
207
cfgFile.Read( wxT("WindowHandle"), &m_sWindowHandle, wxEmptyString) ;
207
209
// set a global snippets xml file path
208
if (SettingsSnippetsXmlFullPath.IsEmpty())
209
SettingsSnippetsXmlFullPath = stdPaths.GetUserDataDir() + wxFILE_SEP_PATH + AppName+ _T(".xml");
210
wxFileName SettingsFullPath(SettingsSnippetsCfgPath);
211
if (SettingsSnippetsXmlPath.IsEmpty())
212
SettingsSnippetsXmlPath = SettingsFullPath.GetPath() + wxFILE_SEP_PATH + AppName + _T(".xml");
212
215
// ----------------------------------------------------------------------------
219
222
wxString fn(__FUNCTION__, wxConvUTF8);
220
223
LOGIT( _T("--- [%s] ---"),fn.c_str() );
221
LOGIT(wxT("Saving Settings File[%s]"),SettingsSnippetsCfgFullPath.c_str());
224
LOGIT(wxT("Saving Settings File[%s]"),SettingsSnippetsCfgPath.c_str());
224
// wxFileConfig cfgFile(wxEmptyString, // appname
225
// wxEmptyString, // vendor
226
// SettingsSnippetsCfgFullPath, // local filename
227
// wxEmptyString, // global file
228
// wxCONFIG_USE_LOCAL_FILE);
227
wxFileConfig cfgFile(wxEmptyString, // appname
228
wxEmptyString, // vendor
229
SettingsSnippetsCfgPath, // local filename
230
wxEmptyString, // global file
231
wxCONFIG_USE_LOCAL_FILE);
230
wxFileConfig& cfgFile = *GetCfgFile();
233
//-wxFileConfig& cfgFile = *GetCfgFile();
232
235
cfgFile.Write( wxT("ExternalEditor"), SettingsExternalEditor ) ;
233
cfgFile.Write( wxT("SnippetFile"), SettingsSnippetsXmlFullPath ) ;
236
cfgFile.Write( wxT("SnippetFile"), SettingsSnippetsXmlPath ) ;
234
237
cfgFile.Write( wxT("SnippetFolder"), SettingsSnippetsFolder ) ;
235
238
cfgFile.Write( wxT("ViewSearchBox"), SettingsSearchBox ) ;
236
239
cfgFile.Write( wxT("casesensitive"), m_SearchConfig.caseSensitive ) ;
237
cfgFile.Write( wxT("scope"), m_SearchConfig.scope );
239
// Write Mouse DragScrolling settings
240
cfgFile.Write( wxT("MouseDragSensitivity"), MouseDragSensitivity ) ;
241
cfgFile.Write( wxT("MouseToLineRatio"), MouseToLineRatio );
242
cfgFile.Write( wxT("MouseContextDelay"), MouseContextDelay );
240
cfgFile.Write( wxT("scope"), int(m_SearchConfig.scope) );
241
cfgFile.Write( wxT("EditorsStayOnTop"),SettingsEditorsStayOnTop );
242
cfgFile.Write( wxT("ToolTipsOption"), SettingsToolTipsOption );
244
{ // Write ExternalPersistent for plugin use only
245
cfgFile.Write( wxT("ExternalPersistentOpen"),IsExternalPersistentOpen() );
247
//LOGIT( _T("ExternalPersistentOpen is[%s]"), IsExternalPersistentOpen()?_T("true"):_T("false"));
244
251
//wxString lastWindowState = wxT("External");
245
252
//if ( IsFloatingWindow() ) {lastWindowState = wxT("Floating");}
246
253
//if ( IsDockedWindow() ) {lastWindowState = wxT("Docked");}
247
LOGIT( _T("WindowState[%s]"), SettingsWindowState.c_str() );
248
cfgFile.Write( wxT("WindowState"), SettingsWindowState );
255
LOGIT( _T("WindowState[%s]"), m_SettingsWindowState.c_str() );
257
cfgFile.Write( wxT("WindowState"), m_SettingsWindowState );
250
259
if (IsApplication())
251
{ // record the current window position and size
252
// here, use the main frame, not the snippets window
253
wxWindow* pwin = (wxWindow*)GetMainFrame();;
254
int winXposn, winYposn, winWidth, winHeight;
255
pwin->GetPosition( &winXposn, &winYposn );
256
pwin->GetSize( &winWidth, &winHeight );
260
if ( GetMainFrame() && GetMainFrame()->IsShown() )
261
{ // record the current window position and size
262
// here, use the main frame, not the snippets window
263
wxWindow* pwin = (wxWindow*)GetMainFrame();;
264
int winXposn, winYposn, winWidth, winHeight;
265
pwin->GetPosition( &winXposn, &winYposn );
266
pwin->GetSize( &winWidth, &winHeight );
259
winPos = wxString::Format(wxT("%d %d %d %d"), winXposn,winYposn,winWidth,winHeight);
260
cfgFile.Write(wxT("WindowPosition"), winPos) ;
261
LOGIT( _T("Saving WindowPosition[%s]"), winPos.c_str() );
269
winPos = wxString::Format(wxT("%d %d %d %d"), winXposn,winYposn,winWidth,winHeight);
270
cfgFile.Write(wxT("WindowPosition"), winPos) ;
271
LOGIT( _T("Saving WindowPosition[%s]"), winPos.c_str() );
265
275
// ----------------------------------------------------------------------------
271
281
// ALL entries are re-written to the conf, overwritting any put there
272
282
// by an external pgm.
274
// wxFileConfig cfgFile(wxEmptyString, // appname
275
// wxEmptyString, // vendor
276
// SettingsSnippetsCfgFullPath, // local filename
277
// wxEmptyString, // global file
278
// wxCONFIG_USE_LOCAL_FILE);
279
wxFileConfig& cfgFile = *GetCfgFile();
284
wxFileConfig cfgFile(wxEmptyString, // appname
285
wxEmptyString, // vendor
286
SettingsSnippetsCfgPath, // local filename
287
wxEmptyString, // global file
288
wxCONFIG_USE_LOCAL_FILE);
281
290
cfgFile.Write( settingName, settingValue ) ;
304
313
wxString CodeSnippetsConfig::GetSettingsWindowState()
305
314
// ----------------------------------------------------------------------------
307
SettingsWindowState = SettingsReadString(wxT("WindowState"));
316
m_SettingsWindowState = SettingsReadString(wxT("WindowState"));
308
317
//LOGIT( _T("GetSettingsWindowState[%s]"),GetConfig()->SettingsWindowState.c_str() );
309
return GetConfig()->SettingsWindowState;
318
return m_SettingsWindowState;
320
// ----------------------------------------------------------------------------
321
void CodeSnippetsConfig::SetSettingsWindowState(const wxString windowState)
322
// ----------------------------------------------------------------------------
324
m_SettingsWindowState = windowState;
325
SettingsSaveString( _T("WindowState"), m_SettingsWindowState );
326
//LOGIT( _T("SetSettingsWindowState[%s]"),GetSettingsWindowState.c_str() );
312
329
// ----------------------------------------------------------------------------
313
330
void CodeSnippetsConfig::SettingsSaveWinPosition()
314
331
// ----------------------------------------------------------------------------
317
334
// It should only be called on floating windows just before the window is undocked/hidden
318
335
// else the mainframe position will be recorded instead of the floating window.
320
// wxFileConfig cfgFile(wxEmptyString, // appname
321
// wxEmptyString, // vendor
322
// SettingsSnippetsCfgFullPath, // local filename
323
// wxEmptyString, // global file
324
// wxCONFIG_USE_LOCAL_FILE);
325
wxFileConfig& cfgFile = *GetCfgFile();
337
wxFileConfig cfgFile(wxEmptyString, // appname
338
wxEmptyString, // vendor
339
SettingsSnippetsCfgPath, // local filename
340
wxEmptyString, // global file
341
wxCONFIG_USE_LOCAL_FILE);
327
343
// record the current window position and size
328
344
// here use the snippets windows' parent, not the main frame
345
361
// ----------------------------------------------------------------------------
346
void CodeSnippetsConfig::CenterChildOnParent(wxWindow* child)
362
void CodeSnippetsConfig::CenterChildOnParent(wxWindow* child, wxWindow* parentParam )
347
363
// ----------------------------------------------------------------------------
349
365
//For docked window we cannot get its position. Just move
350
366
// the window over the last known parent position
351
if ( GetConfig()->IsPlugin() )
352
{ wxPoint parentPosn( GetConfig()->windowXpos+(GetConfig()->windowWidth>>1),
368
int displayX; int displayY;
369
::wxDisplaySize(&displayX, &displayY);
372
// Now using Plugin code for both app and plugin
373
//if ( GetConfig()->IsPlugin() ) // //(pecan 2008/5/04)
375
wxPoint parentPosn( GetConfig()->windowXpos+(GetConfig()->windowWidth>>1),
353
376
GetConfig()->windowYpos+(GetConfig()->windowHeight>>1) );
377
do { // place bottomLeft child at bottomLeft of parent window
379
int parentsizex,parentsizey;
380
int childsizex,childsizey;
381
wxWindow* parent = child->GetParent();
382
if (parentParam) parent = parentParam;
383
if (not parent) break;
384
parent->GetScreenPosition(&parentx,&parenty);
385
parent->GetSize(&parentsizex,&parentsizey);
386
child->GetSize(&childsizex,&childsizey);
387
parentPosn.x = parentx+20;
388
parentPosn.y = parenty+parentsizey-childsizey;
389
// Make sure child is not off right/bottom of screen
390
if ( (parentPosn.x+childsizex) > displayX)
391
parentPosn.x = displayX-childsizex;
392
if ( (parentPosn.y+childsizey) > displayY)
393
parentPosn.y = displayY-childsizey;
394
// Make sure child is not off left/top of screen
395
if ( parentPosn.x < 1) parentPosn.x = 1;
396
if ( parentPosn.y < 1) parentPosn.y = 1;
354
398
child->Move( parentPosn.x, parentPosn.y);
358
// If application window
359
// Put Top left corner in center of parent (if possible)
363
int displayX; int displayY;
364
wxWindow* mainFrame = child->GetParent();
365
if (not mainFrame) return;
367
// move upper left dialog corner to center of parent
368
::wxDisplaySize(&displayX, &displayY);
369
mainFrame->GetPosition(&x, &y );
370
mainFrame->ClientToScreen(&x, &y );
371
if ((x == 0) || (y == 0))
372
if (GetConfig()->pMainFrame)
373
GetConfig()->pMainFrame->GetPosition(&x, &y );
374
mainFrame->GetClientSize(&w,&h);
376
// move child underneath the mouse pointer
377
wxPoint movePosn = ::wxGetMousePosition();
378
movePosn.x = x+(w>>2);
379
movePosn.y = y+(h>>2);
381
// Make child is not off the screen
382
wxSize size = child->GetSize();
383
//-LOGIT( _T("X[%d]Y[%d]width[%d]height[%d]"), x,y,w,h );
385
if ( (movePosn.x+size.GetWidth()) > displayX)
386
movePosn.x = displayX-size.GetWidth();
387
if ( (movePosn.y+size.GetHeight()) > displayY)
388
movePosn.y = displayY-size.GetHeight();
390
child->Move(movePosn.x, movePosn.y);
393
404
// ----------------------------------------------------------------------------
445
460
wxWindow* pwSnippet = (wxWindow*)GetSnippetsWindow();
446
461
if ( not pwSnippet ) return false;
448
//LOGIT( _T("IsFloating[%p][%s]"), pwSnippet, pwSnippet->GetName().c_str() );
449
463
while (pwSnippet->GetParent())
451
465
pwSnippet = pwSnippet->GetParent();
452
LOGIT( _T("IsFloating[%p][%s]"), pwSnippet, pwSnippet->GetName().c_str() );
467
//-LOGIT( _T("IsFloating Parent[%p][%s]"), pwSnippet, pwSnippet->GetName().c_str() );
469
// break out after we get a pointer to any parent frame
453
470
if (pwSnippet->GetName() == wxT("frame")) break;
455
472
// Get CodeBlocks main window
456
473
//wxWindow* pwCodeBlocks = Manager::Get()->GetAppWindow();
457
wxWindow* pwCodeBlocks = wxTheApp->GetTopWindow();
474
wxWindow* pwCodeBlocks = GetConfig()->GetMainFrame();
458
475
//LOGIT( _T("IsFloating pwSnippet[%p]pwCodeBlocks[%p]"),pwSnippet,pwCodeBlocks );
459
476
//LOGIT( _T("IsFloating pwSnippet[%s]pwCodeBlocks[%s]"),pwSnippet->GetName().c_str(),pwCodeBlocks->GetName().c_str() );
461
478
// Floating windows have different parents than their original MainFrame
462
// if parent window == CodeBlocks MainFrame, then floating, not docked
479
// if parent window == CodeBlocks MainFrame, then docked
463
480
if ( pwSnippet == pwCodeBlocks )
465
483
//LOGIT( _T("IsFloating[%s]"),wxT("false"));
489
//LOGIT( _T("IsFloating[%s]"),wxT("true"));
469
492
// Have floating window, point to reparented focused window
470
493
wxWindow* pmf = pwSnippet;
471
494
if (pWindowRequest) *pWindowRequest = pmf;
499
522
return temp_folder;
525
// ----------------------------------------------------------------------------
526
wxFrame* CodeSnippetsConfig::GetEditorManagerFrame(const int index)
527
// ----------------------------------------------------------------------------
530
SEditorManager* edMgr;
531
if ( (index < 0) or (index > GetEditorManagerCount()) )
533
// iterate over all the elements in the class
534
EdManagerMapArray::iterator it;
536
for( it = m_EdManagerMapArray.begin(); it != m_EdManagerMapArray.end(); ++it )
548
// ----------------------------------------------------------------------------
549
SEditorManager* CodeSnippetsConfig::GetEditorManager(const int index)
550
// ----------------------------------------------------------------------------
553
SEditorManager* edMgr;
554
if ( (index < 0) or (index > GetEditorManagerCount()) )
556
// iterate over all the elements in the class
557
EdManagerMapArray::iterator it;
559
for( it = m_EdManagerMapArray.begin(); it != m_EdManagerMapArray.end(); ++it )
571
// ----------------------------------------------------------------------------
572
int CodeSnippetsConfig::GetEditorManagerCount()
573
// ----------------------------------------------------------------------------
575
return m_EdManagerMapArray.size();
577
// ----------------------------------------------------------------------------
578
SEditorManager* CodeSnippetsConfig::GetEditorManager(wxWindow* frame)
579
// ----------------------------------------------------------------------------
581
return GetEditorManager((wxFrame*) frame);
583
// ----------------------------------------------------------------------------
584
SEditorManager* CodeSnippetsConfig::GetEditorManager(wxFrame* frame)
585
// ----------------------------------------------------------------------------
587
// Return the EditorManager belonging to this frame.
589
EdManagerMapArray::iterator it = m_EdManagerMapArray.find(frame);
590
if (it not_eq m_EdManagerMapArray.end() )
594
while (p->GetParent())
597
if ( not p->IsTopLevel() ) continue;
598
it = m_EdManagerMapArray.find(frame);
599
if (it not_eq m_EdManagerMapArray.end() )
602
//LOGIT( _T("GetEditorManager frame[%p]Mgr[%p]"), frame, it->second);
610
// ----------------------------------------------------------------------------
611
void CodeSnippetsConfig::RegisterEditorManager(wxFrame* frame, SEditorManager* edMgr)
612
// ----------------------------------------------------------------------------
614
EdManagerMapArray::iterator it = m_EdManagerMapArray.find(frame);
615
if ( it == m_EdManagerMapArray.end() )
616
m_EdManagerMapArray[frame] = edMgr;
618
LOGIT( _T("RegisterEditorManager frame[%p]Mgr[%p]"), frame, edMgr);
621
// ----------------------------------------------------------------------------
622
void CodeSnippetsConfig::RemoveEditorManager(wxFrame* frame)
623
// ----------------------------------------------------------------------------
625
m_EdManagerMapArray.erase(frame);
627
// ----------------------------------------------------------------------------
628
wxEvtHandler* CodeSnippetsConfig::GetDragScrollEvtHandler()
629
// ----------------------------------------------------------------------------
631
// if app, return resident DragScroll pointer
632
if (IsApplication() ) return (wxEvtHandler*)m_pDragScrollPlugin;
634
// If this is CodeSnippets plugin, verify that DragScroll still exists
635
m_pDragScrollPlugin = (cbDragScroll*)(Manager::Get()->GetPluginManager()->FindPluginByName(_T("cbDragScroll")));
636
if (m_pDragScrollPlugin)
637
return (wxEvtHandler*)m_pDragScrollPlugin;
639
m_pDragScrollPlugin = (cbDragScroll*)GetMainFrame();
640
return (wxEvtHandler*)m_pDragScrollPlugin;
642
// ----------------------------------------------------------------------------