86 if (filename.IsEmpty())
87 m_Filename =
realpath(CreateUniqueFilename());
106 if (!
Manager::Get()->GetEditorManager()->GetEditor(tmp) &&
117 m_IsBuiltinEditor(false),
136 event.SetEditor(
this);
165 toolTip +=
_(
"\nProject: ") + prj->GetTitle();
185 msg.
Printf(
_(
"File %s is modified...\nDo you want to save the changes?"),
GetFilename().c_str());
216 return (
Manager::Get()->GetEditorManager()->GetEditorsCount() > 1);
230 if (!other || other ==
this)
338 const wxMenuItemList &popupItems = popup->
GetMenuItems();
339 if (popupItems.GetCount() > 0)
341 wxMenuItem *last = popupItems[popupItems.GetCount() - 1];
365 clientpos = ScreenToClient(position);
369 PopupMenu(popup, clientpos);
385 const int id =
event.GetId();
const int idCloseAllOthers
bool CloseAllInTabCtrlExcept(EditorBase *editor, bool dontsave=false)
Closes all editors in the same tab control as the active editor, except the editor passed as paramete...
virtual const wxString & GetShortName() const
Returns the editor's short name.
const long idCPlusPlusCom
int WordEndPosition(int pos, bool onlyWordCharacters)
Get position of end of word.
PluginManager * GetPluginManager() const
const int idSwitchFileMax
bool CloseAllInTabCtrl(bool dontsave=false)
Closes all editors in the same tab control as the active editor.
void Assign(const wxFileName &filepath)
virtual const wxString & GetTitle()
The editor's title.
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
virtual bool QueryClose()
Can this be closed (destroyed)?
bool SetPageText(size_t page, const wxString &text)
bool wxFileExists(const wxString &filename)
virtual bool IsReadOnly() const
Is the editor read-only?
EditorBaseInternalData(EditorBase *owner)
DLLIMPORT bool NormalizePath(wxFileName &f, const wxString &base)
virtual void Activate()
Activate this editor.
void wxRegisterId(int id)
EditorBaseInternalData * m_pData
Use this to add new vars/functions w/out breaking the ABI.
void SetActiveEditor(EditorBase *ed)
DLLIMPORT wxString URLEncode(const wxString &str)
bool Close(const wxString &filename, bool dontsave=false)
A generic Code::Blocks event.
EditorBase(wxWindow *parent, const wxString &filename)
const long idStackOverflow
virtual bool ThereAreOthers() const
Are there other editors besides this?
void SetFolder(const wxString &folder)
int WordStartPosition(int pos, bool onlyWordCharacters)
Get position of start of word.
EditorManager * GetEditorManager() const
virtual void SetModified(bool=true)
Set the modification status.
wxString GetSelectedText()
Retrieve the selected text.
ProjectManager * GetProjectManager() const
Functions returning pointers to the respective sub-manager instances.
PluginManager manages plugins.
virtual bool Close()
Close this editor.
virtual const wxString & GetFilename() const
Get the editor's filename (if applicable).
DLLIMPORT wxString UnixFilename(const wxString &filename, wxPathFormat format=wxPATH_NATIVE)
EVTIMPORT const wxEventType cbEVT_EDITOR_CLOSE
Represents a Code::Blocks project.
virtual void InitFilename(const wxString &filename)
Initializes filename data.
cbStyledTextCtrl * GetControl() const
Returns a pointer to the underlying cbStyledTextCtrl object (which itself is the wxWindows implementa...
ModuleType
The type of module offering a context menu.
int FindPageFromEditor(EditorBase *eb)
wxPoint PointFromPosition(int pos)
Retrieve the point in the window where a position is displayed.
void AddCustomEditor(EditorBase *eb)
cbEditor * GetBuiltinActiveEditor()
const wxPoint wxDefaultPosition
Base class that all "editors" should inherit from.
int GetCurrentPos() const
Returns the position of the caret.
virtual bool IsBuiltinEditor() const
Is this a built-in editor?
void NotifyPlugins(CodeBlocksEvent &event)
void RemoveCustomEditor(EditorBase *eb)
static bool Access(const wxString &name, wxFile::OpenMode mode)
const wxString & _(const wxString &string)
EditorBase * GetEditor(int index)
virtual bool GetModified() const
Is it modified?
bool SetPageToolTip(size_t page, const wxString &text)
int GetPageIndex(wxWindow *page_wnd) const
void MarkReadOnly(int page, bool readOnly=true)
virtual void SetTitle(const wxString &newTitle)
Set the editor's title.
cbAuiNotebook * GetNotebook()
wxString GetFullName() const
A notebook class This class is derived from wxAuiNotebook, to enhance its abilities.
cbProject * FindProjectForFile(const wxString &file, ProjectFile **resultFile, bool isRelative, bool isUnixFilename)
Return the project which has the file in it, also return the pointer to the ProjectFile object...
bool wxLaunchDefaultBrowser(const wxString &url, int flags=0)
int Printf(const wxString &pszFormat,...)
const int EditorMaxSwitchTo
wxString GetFullPath(wxPathFormat format=wxPATH_NATIVE) const
virtual bool Save()
Save contents.
int editorbase_RegisterId(int id)
bool wxGetKeyState(wxKeyCode key)
static wxString Format(const wxString &format,...)
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
virtual wxString CreateUniqueFilename()
Creates unique filename when asking to save the file.
DLLIMPORT wxString realpath(const wxString &path)