Permalink
Browse files

SymbolList now using EditorFrame and EditorCtrl through interfaces.

  • Loading branch information...
adamv committed May 1, 2009
1 parent 1e344e9 commit 80e2f01811b533addc61719e0d232d7f1dcc1780
Showing with 34 additions and 12 deletions.
  1. +1 −1 src/EditorFrame.cpp
  2. +1 −5 src/EditorFrame.h
  3. +4 −2 src/IFrameEditorService.h
  4. +11 −0 src/IFrameSymbolService.h
  5. +12 −3 src/SymbolList.cpp
  6. +1 −1 src/SymbolList.h
  7. +4 −0 src/e.vcproj
View
@@ -2992,7 +2992,7 @@ void EditorFrame::ShowSymbolList() {
if (m_symbolList) return; // already shown
// Create the pane
- m_symbolList = new SymbolList(*this, *this);
+ m_symbolList = new SymbolList(*this);
wxAuiPaneInfo paneInfo;
paneInfo.Name(wxT("Symbols")).Right().Caption(_("Symbols")).BestSize(wxSize(150,50)); // defaults
View
@@ -32,6 +32,7 @@
#include "key_hook.h"
#include "IFrameEditorService.h"
+#include "IFrameSymbolService.h"
#ifdef __WXMSW__
#include "IEHtmlWin.h"
@@ -154,11 +155,6 @@ enum {
MENU_BOOKMARK_CLEAR
};
-class IFrameSymbolService : public IFrameEditorService {
-public:
- virtual void CloseSymbolList() = 0;
-};
-
class EditorFrame : public KeyHookable<wxFrame>,
public IFrameSymbolService {
public:
@@ -3,10 +3,12 @@
// EditorFrame implements this interface, which gathers functions
// used to query & modify the state of, and retreive pointers to, the active editor.
+
+// The editor return type is actually class EditorCtrl*, but we're trying to minimize the dependency on that header.
+
class IFrameEditorService {
public:
- virtual EditorCtrl* GetEditorCtrl() = 0;
- virtual EditorCtrl* GetEditorAndChangeType(const EditorChangeState& lastChangeState, EditorChangeType& newStatus) = 0;
+ virtual wxControl* GetEditorAndChangeType(const EditorChangeState& lastChangeState, EditorChangeType& newStatus) = 0;
virtual void FocusEditor() = 0;
};
View
@@ -0,0 +1,11 @@
+#ifndef __IFRAMESYMBOLSERVICE_H__
+#define __IFRAMESYMBOLSERVICE_H__
+
+#include "IFrameEditorService.h"
+
+class IFrameSymbolService : public IFrameEditorService {
+public:
+ virtual void CloseSymbolList() = 0;
+};
+
+#endif //__IFRAMESYMBOLSERVICE_H__
View
@@ -12,7 +12,16 @@
******************************************************************************/
#include "SymbolList.h"
-#include "EditorFrame.h"
+#include "IFrameSymbolService.h"
+
+// STL can't compile with Level 4
+#ifdef __WXMSW__
+ #pragma warning(push, 1)
+#endif
+#include <algorithm>
+#ifdef __WXMSW__
+ #pragma warning(pop)
+#endif
// Ctrl id's
enum {
@@ -27,8 +36,8 @@ BEGIN_EVENT_TABLE(SymbolList, wxPanel)
EVT_LISTBOX_DCLICK(CTRL_ALIST, SymbolList::OnAction)
END_EVENT_TABLE()
-SymbolList::SymbolList(wxWindow& parent, IFrameSymbolService& services)
-: wxPanel((wxWindow*)&parent, wxID_ANY),
+SymbolList::SymbolList(IFrameSymbolService& services)
+: wxPanel(dynamic_cast<wxWindow*>(&services), wxID_ANY),
m_parentFrame(services), m_editorSymbols(NULL) {
// Create ctrls
m_searchCtrl = new wxTextCtrl(this, CTRL_SEARCH, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
View
@@ -32,7 +32,7 @@ class IFrameSymbolService;
class SymbolList : public wxPanel {
public:
- SymbolList(wxWindow& parent, IFrameSymbolService& services);
+ SymbolList(IFrameSymbolService& services);
bool Destroy();
View
@@ -1703,6 +1703,10 @@
RelativePath=".\IFrameEditorService.h"
>
</File>
+ <File
+ RelativePath=".\IFrameSymbolService.h"
+ >
+ </File>
<File
RelativePath=".\IPrintableDocument.h"
>

0 comments on commit 80e2f01

Please sign in to comment.