diff --git a/README b/README
index ccb1d13..67e4e2d 100644
--- a/README
+++ b/README
@@ -2,9 +2,9 @@
Summary
==================
-cbDiff is a plugin for Code::Blocks IDE,
+cbDiff is a plugin for Code::Blocks IDE,
which can show visually the difference
-between two files.
+between two files.
==================
License
@@ -37,16 +37,14 @@ if(Manager::Get()->GetPluginManager()->FindPluginByName(_T("cbDiff")) != NULL)
// is library loaded
if(element->library->IsLoaded())
{
- typedef void (*cbDiffFunc) (const wxString&, const wxString&, int mode, const wxString&);
+ typedef void (*cbDiffFunc) (const wxString&, const wxString&, int viewmode);
cbDiffFunc difffunc = (cbDiffFunc)element->library->GetSymbol(_("DiffFiles"));
if(difffunc != NULL)
{
- // Call the function with the two files,
- // the viewing mode (TABLE, UNIFIED or SIDEBYSIDE) and the Highlightlanguage
- difffunc(firstfile, secondfile, viewmode, hlang);
+ difffunc(firstfile, secondfile, -1);
}
}
}
-
+
diff --git a/cbDiff.cbp b/cbDiff.cbp
index c4e6a9b..474cd70 100644
--- a/cbDiff.cbp
+++ b/cbDiff.cbp
@@ -11,6 +11,7 @@
+
@@ -57,10 +58,13 @@
-
+
+
-
+
+
+
@@ -77,10 +81,10 @@
-
-
-
+
+
+
@@ -88,12 +92,11 @@
-
+
-
-
+
@@ -157,6 +160,9 @@
+
+
+
diff --git a/cbDiff_wx30.cbp b/cbDiff_wx30.cbp
new file mode 100644
index 0000000..1a1be12
--- /dev/null
+++ b/cbDiff_wx30.cbp
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/cbDiff.cpp b/src/cbDiff.cpp
index fa9da8b..d8c3c54 100644
--- a/src/cbDiff.cpp
+++ b/src/cbDiff.cpp
@@ -24,10 +24,9 @@ namespace
/// Function for other plugins
EXPORT_FFP void DiffFiles(const wxString& firstfile,
const wxString& secondfile,
- int viewmode,
- wxString hlang)
+ int viewmode)
{
- new cbDiffEditor(firstfile, secondfile, viewmode, hlang);
+ new cbDiffEditor(firstfile, secondfile, viewmode);
}
// events handling
@@ -53,6 +52,26 @@ cbDiff::~cbDiff()
void cbDiff::OnAttach()
{
+ m_prevSelectionValid = false;
+ wxString m_prevFileName = wxEmptyString;
+
+ wxCmdLineParser& parser = *Manager::GetCmdLineParser();
+ parser.AddOption( _T("diff1"), _T("diff1"),_T("first file to compare"));
+ parser.AddOption( _T("diff2"), _T("diff2"),_T("second file to compare"));
+
+ Manager::Get()->RegisterEventSink(cbEVT_APP_STARTUP_DONE, new cbEventFunctor(this, &cbDiff::OnAppDoneStartup));
+ Manager::Get()->RegisterEventSink(cbEVT_APP_CMDLINE, new cbEventFunctor(this, &cbDiff::OnAppCmdLine));
+}
+
+void cbDiff::OnAppDoneStartup(CodeBlocksEvent& event)
+{
+ EvalCmdLine();
+ event.Skip();
+}
+void cbDiff::OnAppCmdLine(CodeBlocksEvent& event)
+{
+ EvalCmdLine();
+ event.Skip();
}
void cbDiff::OnRelease(bool appShutDown)
@@ -123,24 +142,38 @@ void cbDiff::BuildMenu(wxMenuBar* menuBar)
_("Shows the differences between two files"));
}
-void cbDiff::BuildModuleMenu(const ModuleType type,
- wxMenu* menu,
- const FileTreeData* data)
+void cbDiff::BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data)
{
- if(type == mtProjectManager && data != 0 &&
- data->GetKind() == FileTreeData::ftdkFile)
+ if ( type == mtProjectManager && data != 0 && data->GetKind() == FileTreeData::ftdkFile )
+ {
+ ProjectFile *prjFile = data->GetProjectFile();
+ if( prjFile )
+ {
+ wxMenu *diffmenu = new cbDiffMenu(this, prjFile->file.GetFullPath(), m_prevSelectionValid, m_prevFileName, MenuIds);
+ menu->AppendSubMenu(diffmenu, _("Diff with"));
+ }
+ }
+ else if ( type == mtEditorManager && Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() )
+ {
+ wxString filename = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()->GetFilename();
+ wxMenu *diffmenu = new cbDiffMenu(this, filename, m_prevSelectionValid, m_prevFileName, MenuIds);
+ menu->AppendSubMenu(diffmenu, _("Diff with"));
+ }
+ else if ( type == mtEditorTab && Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() )
{
- menu->AppendSubMenu(new cbDiffMenu(this,
- data->GetProjectFile()->file.GetFullPath()),
- _("Diff with"));
+ wxString filename = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()->GetFilename();
+ wxMenu *diffmenu = new cbDiffMenu(this, filename, m_prevSelectionValid, m_prevFileName, MenuIds);
+ menu->AppendSubMenu(diffmenu, _("Diff with"));
}
- else if(type == mtEditorManager &&
- Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor())
+ else if ( type == mtUnknown ) // assuming FileExplorer
{
- menu->AppendSubMenu(new cbDiffMenu(this,
- Manager::Get()->GetEditorManager()->
- GetBuiltinActiveEditor()->GetFilename()),
- _("Diff with"));
+ if ( data && (data->GetKind() == FileTreeData::ftdkFile) )
+ {
+ wxFileName f(data->GetFolder());
+ wxString filename=f.GetFullPath();
+ wxString name=f.GetFullName();
+ menu->AppendSubMenu(new cbDiffMenu(this, name, m_prevSelectionValid, m_prevFileName, MenuIds), _("Diff with"));
+ }
}
}
@@ -157,7 +190,21 @@ void cbDiff::OnDiff(wxCommandEvent& event)
{
new cbDiffEditor(sdf.GetFromFile(),
sdf.GetToFile(),
- sdf.GetViewingMode(),
- sdf.GetHighlightLanguage());
+ sdf.GetViewingMode());
}
}
+
+void cbDiff::EvalCmdLine()
+{
+ wxString file1, file2;
+ wxCmdLineParser& parser = *Manager::GetCmdLineParser();
+
+ if ( parser.Found(_T("diff1"), &file1) && parser.Found(_T("diff2"), &file2 ) )
+ {
+ if ( wxFile::Exists(file1) && wxFile::Exists(file2) )
+ {
+ new cbDiffEditor(file1, file2, cbDiffEditor::SIDEBYSIDE);
+ }
+ }
+}
+
diff --git a/src/cbDiff.h b/src/cbDiff.h
index 7f4d1f5..de8722b 100644
--- a/src/cbDiff.h
+++ b/src/cbDiff.h
@@ -12,7 +12,7 @@ class cbConfigurationPanel;
#define EXPORT_FFP WXIMPORT
#endif
-extern "C" EXPORT_FFP void DiffFiles(const wxString& firstfile, const wxString& secondfile, int viewmode, wxString hlang);
+extern "C" EXPORT_FFP void DiffFiles(const wxString& firstfile, const wxString& secondfile, int viewmode);
class cbDiff : public cbPlugin
{
@@ -113,6 +113,13 @@ class cbDiff : public cbPlugin
virtual void OnRelease(bool appShutDown);
void OnDiff(wxCommandEvent& event);
+ void OnAppDoneStartup(CodeBlocksEvent& event);
+ void OnAppCmdLine(CodeBlocksEvent& event);
+ void EvalCmdLine();
+ bool m_prevSelectionValid;
+ wxString m_prevFileName;
+ std::vector MenuIds;
+
private:
DECLARE_EVENT_TABLE();
};
diff --git a/src/cbDiffConfigPanel.cpp b/src/cbDiffConfigPanel.cpp
index 1e74845..7ec468c 100644
--- a/src/cbDiffConfigPanel.cpp
+++ b/src/cbDiffConfigPanel.cpp
@@ -40,7 +40,6 @@ cbDiffConfigPanel::cbDiffConfigPanel(wxWindow* parent)
{
//(*Initialize(cbDiffConfigPanel)
wxStaticBoxSizer* StaticBoxSizer2;
- wxStaticBoxSizer* StaticBoxSizer5;
wxBoxSizer* BoxSizer2;
wxStaticText* StaticText1;
wxStaticBoxSizer* StaticBoxSizer3;
@@ -91,10 +90,6 @@ cbDiffConfigPanel::cbDiffConfigPanel(wxWindow* parent)
RBViewing = new wxRadioBox(this, ID_RADIOBOX1, _("Displaytype:"), wxDefaultPosition, wxDefaultSize, 3, __wxRadioBoxChoices_1, 1, wxRA_VERTICAL, wxDefaultValidator, _T("ID_RADIOBOX1"));
RBViewing->SetSelection(0);
StaticBoxSizer4->Add(RBViewing, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- StaticBoxSizer5 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Language:"));
- CHHLang = new wxChoice(this, ID_CHOICE2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE2"));
- StaticBoxSizer5->Add(CHHLang, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- StaticBoxSizer4->Add(StaticBoxSizer5, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer1->Add(StaticBoxSizer4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SetSizer(BoxSizer1);
BoxSizer1->Fit(this);
@@ -103,16 +98,12 @@ cbDiffConfigPanel::cbDiffConfigPanel(wxWindow* parent)
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&cbDiffConfigPanel::OnColAddClick);
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&cbDiffConfigPanel::OnColRemClick);
Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&cbDiffConfigPanel::OnColCarClick);
- Connect(ID_RADIOBOX1,wxEVT_COMMAND_RADIOBOX_SELECTED,(wxObjectEventFunction)&cbDiffConfigPanel::OnViewModeChange);
- Connect(ID_CHOICE2,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&cbDiffConfigPanel::OnHLangChange);
//*)
BColAdd->SetBackgroundColour(wxColour(0,255,0,50));
BColRem->SetBackgroundColour(wxColour(255,0,0,50));
CHCaret->SetSelection(0);
BColCar->SetBackgroundColour(wxColour(122,122,0));
- CHHLang->Append(cbDiffUtils::GetAllHighlightLanguages());
-
ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("cbdiffsettings"));
if (cfg)
{
@@ -124,9 +115,6 @@ cbDiffConfigPanel::cbDiffConfigPanel(wxWindow* parent)
BColCar->SetBackgroundColour(cfg->ReadColour(_T("caretline"), wxColor(122,122,0)));
SLCarAlpha->SetValue(cfg->ReadInt(_T("caretlinealpha"), 50));
RBViewing->SetSelection(cfg->ReadInt(_T("viewmode"), 0));
- if(RBViewing->GetSelection() == 1)
- CHHLang->Enable(false);
- CHHLang->SetStringSelection(cfg->Read(_T("hlang"), _("Plain Text")));
}
BColAdd->SetLabel(BColAdd->GetBackgroundColour().GetAsString());
@@ -166,7 +154,6 @@ void cbDiffConfigPanel::OnApply()
cfg->Write(_T("caretline"), BColCar->GetBackgroundColour());
cfg->Write(_T("caretlinealpha"), SLCarAlpha->GetValue());
cfg->Write(_T("viewmode"), RBViewing->GetSelection());
- cfg->Write(_T("hlang"), CHHLang->GetStringSelection());
}
}
@@ -211,23 +198,3 @@ void cbDiffConfigPanel::OnColCarClick(wxCommandEvent& event)
BColCar->SetLabel(dialog.GetColourData().GetColour().GetAsString());
}
}
-
-void cbDiffConfigPanel::OnViewModeChange(wxCommandEvent& event)
-{
- if(RBViewing->GetSelection() == 1)
- {
- m_lasthlang = CHHLang->GetStringSelection();
- CHHLang->SetStringSelection(_("Diff/Patch"));
- CHHLang->Disable();
- }
- else
- {
- CHHLang->Enable();
- CHHLang->SetStringSelection(m_lasthlang);
- }
-}
-
-void cbDiffConfigPanel::OnHLangChange(wxCommandEvent& event)
-{
- m_lasthlang = event.GetString();
-}
diff --git a/src/cbDiffConfigPanel.h b/src/cbDiffConfigPanel.h
index f4350aa..f7e29fc 100644
--- a/src/cbDiffConfigPanel.h
+++ b/src/cbDiffConfigPanel.h
@@ -41,7 +41,6 @@ class cbDiffConfigPanel: public cbConfigurationPanel
wxSlider* SLRemAlpha;
wxButton* BColAdd;
wxButton* BColCar;
- wxChoice* CHHLang;
//*)
//(*Identifiers(cbDiffConfigPanel)
@@ -63,11 +62,8 @@ class cbDiffConfigPanel: public cbConfigurationPanel
void OnColAddClick(wxCommandEvent& event);
void OnColRemClick(wxCommandEvent& event);
void OnColCarClick(wxCommandEvent& event);
- void OnViewModeChange(wxCommandEvent& event);
- void OnHLangChange(wxCommandEvent& event);
//*)
- wxString m_lasthlang;
DECLARE_EVENT_TABLE()
};
diff --git a/src/cbDiffCtrl.h b/src/cbDiffCtrl.h
index 190a107..0a80ff8 100644
--- a/src/cbDiffCtrl.h
+++ b/src/cbDiffCtrl.h
@@ -22,7 +22,6 @@ class cbDiffCtrl: public wxPanel
}
virtual ~cbDiffCtrl() { wxDELETE(m_theme); }
virtual void Init(cbDiffColors colset) = 0;
- virtual void SetHlang(wxString lang) = 0;
virtual void ShowDiff(wxDiff diff) = 0;
protected:
EditorColourSet* m_theme;
diff --git a/src/cbDiffEditor.cpp b/src/cbDiffEditor.cpp
index 40c0256..6a28529 100644
--- a/src/cbDiffEditor.cpp
+++ b/src/cbDiffEditor.cpp
@@ -24,8 +24,7 @@ END_EVENT_TABLE()
cbDiffEditor::cbDiffEditor(const wxString& firstfile,
const wxString& secondfile,
- int viewmode,
- wxString hlang)
+ int viewmode)
: EditorBase((wxWindow*)Manager::Get()->GetEditorManager()->GetNotebook(),
firstfile + secondfile),
m_diffctrl(0)
@@ -58,12 +57,13 @@ cbDiffEditor::cbDiffEditor(const wxString& firstfile,
if(viewmode == DEFAULT)
{
viewmode = cfg->ReadInt(_T("viewmode"), 0) + TABLE;
- hlang = cfg->Read(_T("hlang"), _("Plain Text"));
}
}
- m_colorset.m_hlang = hlang;
+ HighlightLanguage hl = Manager::Get()->GetEditorManager()->GetColourSet()->GetLanguageForFilename(firstfile);
+ if (hl != HL_NONE)
+ m_colorset.m_hlang = Manager::Get()->GetEditorManager()->GetColourSet()->GetLanguageName(hl);
- cbDiffToolbar* difftoolbar = new cbDiffToolbar(this, viewmode, hlang);
+ cbDiffToolbar* difftoolbar = new cbDiffToolbar(this, viewmode);
wxBoxSizer* BoxSizer = new wxBoxSizer(wxVERTICAL);
BoxSizer->Add(difftoolbar, 0, wxALL|wxEXPAND|wxALIGN_CENTER, 0);
@@ -186,13 +186,6 @@ void cbDiffEditor::SetMode(int mode)
m_viewingmode = mode;
}
-void cbDiffEditor::SetHlang(wxString lang)
-{
- m_colorset.m_hlang = lang;
- m_diffctrl->SetHlang(lang);
-}
-
-
void cbDiffEditor::CloseAllEditors()
{
EditorsSet s = m_AllEditors;
diff --git a/src/cbDiffEditor.h b/src/cbDiffEditor.h
index 790979b..0855c3f 100644
--- a/src/cbDiffEditor.h
+++ b/src/cbDiffEditor.h
@@ -32,8 +32,7 @@ class cbDiffEditor : public EditorBase
cbDiffEditor(const wxString& firstfile,
const wxString& secondfile,
- int diffmode = DEFAULT,
- wxString hlang = wxEmptyString);
+ int diffmode = DEFAULT);
virtual ~cbDiffEditor();
@@ -54,12 +53,10 @@ class cbDiffEditor : public EditorBase
void SetMode(int mode);
- void SetHlang(wxString lang);
-
enum
{
DEFAULT = -1,
- TABLE = wxID_HIGHEST+125,
+ TABLE = 0,
UNIFIED,
SIDEBYSIDE
};
diff --git a/src/cbDiffMenu.cpp b/src/cbDiffMenu.cpp
index 87425aa..d28e0cd 100644
--- a/src/cbDiffMenu.cpp
+++ b/src/cbDiffMenu.cpp
@@ -1,104 +1,157 @@
-#include "cbDiffMenu.h"
-
-#include
-
-#include "cbDiffUtils.h"
-#include "cbDiffEditor.h"
-
-#include
-#include
-#include
-#include
-
-#define IDSTART (wxID_HIGHEST + 20000)
-
-using namespace cbDiffUtils;
-
-BEGIN_EVENT_TABLE(cbDiffMenu, wxMenu)
-END_EVENT_TABLE()
-
-cbDiffMenu::cbDiffMenu(wxEvtHandler* parent, wxString basefile) : wxMenu()
-{
- m_basefile = basefile;
- m_localid = IDSTART;
-
- // the project or NULL
- ProjectFile* file = IsFileInActiveProject(basefile);
- wxArrayString shortnames = GetActiveProjectFilesRelative(file);
- m_projectfilenames = GetActiveProjectFilesAbsolute(file);
-
- // project open?
- if(shortnames.GetCount())
- {
- wxMenu* projmenu = new wxMenu();
- for(unsigned int i = 0; i < shortnames.GetCount(); i++, m_localid++)
- projmenu->Append(m_localid, shortnames[i]);
- AppendSubMenu(projmenu, _("Project files"));
- }
-
- shortnames = cbDiffUtils::GetOpenFilesShort(basefile);
- m_openfilenames = cbDiffUtils::GetOpenFilesLong(basefile);
-
- // files open?
- if(shortnames.GetCount())
- {
- wxMenu* openmenu = new wxMenu();
- for(unsigned int i = 0; i < shortnames.GetCount(); i++, m_localid++)
- openmenu->Append(m_localid, shortnames[i]);
- AppendSubMenu(openmenu, _("Open files"));
- }
-
- Append(m_localid, _("Local file..."));
-
- // On MSW the only way to get our events is to catch all events
- // so we use this "global" connect and then we look if the event is for us
- parent->Connect(wxEVT_COMMAND_MENU_SELECTED,
- (wxObjectEventFunction)&cbDiffMenu::OnSelect, NULL, this);
-}
-
-cbDiffMenu::~cbDiffMenu()
-{
- Destroy(FindItem(_("Project files")));
- Destroy(FindItem(_("Open files")));
-}
-
-void cbDiffMenu::OnSelect(wxCommandEvent& event)
-{
- if(event.GetId() < IDSTART || event.GetId() > m_localid)
- return event.Skip();
-
- if(!wxFileExists(m_basefile))
- return;
-
- // want to select a local file
- if(event.GetId() == m_localid)
- {
- wxFileDialog selfile(Manager::Get()->GetAppWindow(), _("Select file"),
- wxEmptyString, wxEmptyString,
- wxFileSelectorDefaultWildcardStr,
- wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_PREVIEW);
- if(selfile.ShowModal() == wxID_OK)
- new cbDiffEditor(m_basefile, selfile.GetPath());
- return;
- }
-
- // helpers to differentiate between project and openfiles menuids
- int realid = event.GetId() - IDSTART;
- int idbreak = m_projectfilenames.GetCount();
- int realopenid = realid - idbreak;
-
- // projectfile selected
- if(realid < idbreak &&
- wxFileExists(m_projectfilenames[realid]))
- {
- new cbDiffEditor(m_basefile,
- m_projectfilenames[realid]);
- }
- // openfile selected
- else if(realid >= idbreak &&
- wxFileExists(m_openfilenames[realopenid]))
- {
- new cbDiffEditor(m_basefile,
- m_openfilenames[realopenid]);
- }
-}
+#include "cbDiffMenu.h"
+
+#include
+
+#include "cbDiffUtils.h"
+#include "cbDiffEditor.h"
+
+#include
+#include
+#include
+#include
+
+#define IDSTART (wxID_HIGHEST + 20000)
+
+using namespace cbDiffUtils;
+
+namespace
+{
+ const long ID_SELECT_FIRST = wxNewId();
+ const long ID_SELECT_SECOND = wxNewId();
+ const long ID_SELECT_LOCAL = wxNewId();
+}
+
+
+BEGIN_EVENT_TABLE(cbDiffMenu, wxMenu)
+END_EVENT_TABLE()
+
+cbDiffMenu::cbDiffMenu(wxEvtHandler* parent, wxString basefile, bool &prevSelectionValid, wxString &prevFileName, std::vector &ids):
+ wxMenu(),
+ m_basefile(basefile),
+ m_ids(ids),
+ m_prevValid(prevSelectionValid),
+ m_prevFileName(prevFileName)
+{
+ if(m_prevValid == false)
+ {
+ Append(ID_SELECT_FIRST, _("Compare to"));
+
+ parent->Connect(ID_SELECT_FIRST, wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&cbDiffMenu::OnSelectFirst, NULL, this);
+ }
+ else
+ {
+ Append(ID_SELECT_SECOND, _("Compare"));
+ Append(ID_SELECT_FIRST, _("Reselect first"));
+
+ parent->Connect(ID_SELECT_SECOND, wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&cbDiffMenu::OnSelectSecond, NULL, this);
+ parent->Connect(ID_SELECT_FIRST, wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&cbDiffMenu::OnSelectFirst, NULL, this);
+ }
+
+ // the project or NULL
+ ProjectFile* file = IsFileInActiveProject(basefile);
+ m_projectfilenames = GetActiveProjectFilesAbsolute(file);
+ m_openfilenames = cbDiffUtils::GetOpenFilesLong(basefile);
+
+ unsigned int projectFiles = m_projectfilenames.GetCount();
+ unsigned int openFiles = m_openfilenames.GetCount();
+
+ wxArrayString shortnames = GetActiveProjectFilesRelative(file);
+
+
+
+ while (m_ids.size() < projectFiles + openFiles)
+ m_ids.push_back(wxNewId());
+
+ // project open?
+ if(projectFiles)
+ {
+ wxMenu* projmenu = new wxMenu();
+ for(unsigned int i = 0; i < shortnames.GetCount(); ++i)
+ {
+ projmenu->Append(m_ids[i], shortnames[i]);
+ parent->Connect(m_ids[i],wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&cbDiffMenu::OnSelectProject, NULL, this);
+ }
+ AppendSubMenu(projmenu, _("Project files"));
+ }
+
+
+ shortnames = cbDiffUtils::GetOpenFilesShort(basefile);
+ // files open?
+ if(openFiles)
+ {
+ wxMenu* openmenu = new wxMenu();
+ for(unsigned int i = 0; i < openFiles; i++)
+ {
+ openmenu->Append(m_ids[i+projectFiles], shortnames[i]);
+ parent->Connect(m_ids[i+projectFiles],wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&cbDiffMenu::OnSelectOpen, NULL, this);
+ }
+ AppendSubMenu(openmenu, _("Open files"));
+ }
+
+
+
+
+ Append(ID_SELECT_LOCAL, _("Local file..."));
+ parent->Connect(ID_SELECT_LOCAL, wxEVT_COMMAND_MENU_SELECTED,
+ (wxObjectEventFunction)&cbDiffMenu::OnSelectLocal, NULL, this);
+
+}
+
+cbDiffMenu::~cbDiffMenu()
+{
+ Destroy(FindItem(_("Project files")));
+ Destroy(FindItem(_("Open files")));
+}
+
+void cbDiffMenu::OnSelectOpen(wxCommandEvent& event)
+{
+
+}
+
+void cbDiffMenu::OnSelectProject(wxCommandEvent& event)
+{
+ if(!wxFileExists(m_basefile))
+ return;
+
+ unsigned int idx = 0;
+ std::vector::iterator it;
+ for( it = m_ids.begin() ; it < m_ids.end(); ++it )
+ {
+ if (*it == event.GetId())
+ break;
+ }
+ if ( it == m_ids.end() ) return;
+
+ if(idx < m_projectfilenames.GetCount() && wxFileExists(m_projectfilenames[idx]))
+ new cbDiffEditor(m_basefile, m_projectfilenames[idx]);
+}
+
+void cbDiffMenu::OnSelectLocal(wxCommandEvent& event)
+{
+ if(!wxFileExists(m_basefile))
+ return;
+
+ wxFileDialog selfile(Manager::Get()->GetAppWindow(), _("Select file"),
+ wxEmptyString, wxEmptyString,
+ wxFileSelectorDefaultWildcardStr,
+ wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_PREVIEW);
+
+ if(selfile.ShowModal() == wxID_OK)
+ new cbDiffEditor(m_basefile, selfile.GetPath());
+}
+
+void cbDiffMenu::OnSelectFirst(wxCommandEvent& event)
+{
+ m_prevFileName = m_basefile;
+ m_prevValid = true;
+
+}
+
+void cbDiffMenu::OnSelectSecond(wxCommandEvent& event)
+{
+ if ( m_prevValid )
+ {
+ new cbDiffEditor(m_prevFileName, m_basefile);
+ }
+ m_prevValid = false;
+}
diff --git a/src/cbDiffMenu.h b/src/cbDiffMenu.h
index d0e6359..dcf4e79 100644
--- a/src/cbDiffMenu.h
+++ b/src/cbDiffMenu.h
@@ -2,20 +2,28 @@
#define CBDIFFMENU_H
#include
+#include
class cbDiffMenu : public wxMenu
{
public:
- cbDiffMenu(wxEvtHandler* parent, wxString basefile);
+ cbDiffMenu(wxEvtHandler* parent, wxString basefile, bool &prevSelected, wxString &prevFileName, std::vector &ids);
virtual ~cbDiffMenu();
private:
wxString m_basefile;
wxArrayString m_projectfilenames;
wxArrayString m_openfilenames;
- int m_localid;
+ std::vector &m_ids;
- void OnSelect(wxCommandEvent& event);
+ bool &m_prevValid;
+ wxString &m_prevFileName;
+
+ void OnSelectProject(wxCommandEvent& event);
+ void OnSelectOpen(wxCommandEvent& event);
+ void OnSelectLocal(wxCommandEvent& event);
+ void OnSelectFirst(wxCommandEvent& event);
+ void OnSelectSecond(wxCommandEvent& event);
DECLARE_EVENT_TABLE();
};
diff --git a/src/cbDiffSelectFiles.cpp b/src/cbDiffSelectFiles.cpp
index 5bb310f..5f48259 100644
--- a/src/cbDiffSelectFiles.cpp
+++ b/src/cbDiffSelectFiles.cpp
@@ -29,13 +29,11 @@ const long cbDiffSelectFiles::ID_BSFROM = wxNewId();
const long cbDiffSelectFiles::ID_TCTO = wxNewId();
const long cbDiffSelectFiles::ID_BSTO = wxNewId();
const long cbDiffSelectFiles::ID_RADIOBOX1 = wxNewId();
-const long cbDiffSelectFiles::ID_CHOICE1 = wxNewId();
//*)
BEGIN_EVENT_TABLE(cbDiffSelectFiles,wxDialog)
//(*EventTable(cbDiffSelectFiles)
//*)
- EVT_RADIOBOX(ID_RADIOBOX1, cbDiffSelectFiles::OnRadioBox)
END_EVENT_TABLE()
cbDiffSelectFiles::cbDiffSelectFiles(wxWindow* parent,wxWindowID id)
@@ -44,7 +42,6 @@ cbDiffSelectFiles::cbDiffSelectFiles(wxWindow* parent,wxWindowID id)
wxStaticBoxSizer* StaticBoxSizer2;
wxBoxSizer* BoxSizer2;
wxStaticBoxSizer* StaticBoxSizer3;
- wxStaticBoxSizer* StaticBoxSizer4;
wxBoxSizer* BoxSizer1;
wxStdDialogButtonSizer* StdDialogButtonSizer1;
@@ -72,10 +69,6 @@ cbDiffSelectFiles::cbDiffSelectFiles(wxWindow* parent,wxWindowID id)
RBViewing = new wxRadioBox(this, ID_RADIOBOX1, _("Displaytype:"), wxDefaultPosition, wxDefaultSize, 3, __wxRadioBoxChoices_1, 1, wxRA_VERTICAL, wxDefaultValidator, _T("ID_RADIOBOX1"));
RBViewing->SetSelection(0);
BoxSizer2->Add(RBViewing, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- StaticBoxSizer4 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Language:"));
- CHHLang = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
- StaticBoxSizer4->Add(CHHLang, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- BoxSizer2->Add(StaticBoxSizer4, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer1->Add(BoxSizer2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StdDialogButtonSizer1 = new wxStdDialogButtonSizer();
StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_OK, wxEmptyString));
@@ -89,21 +82,12 @@ cbDiffSelectFiles::cbDiffSelectFiles(wxWindow* parent,wxWindowID id)
Connect(ID_BSFROM,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&cbDiffSelectFiles::OnSelectFrom);
Connect(ID_BSTO,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&cbDiffSelectFiles::OnSelectTo);
- Connect(ID_CHOICE1,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&cbDiffSelectFiles::OnHLangChange);
//*)
- CHHLang->Append(cbDiffUtils::GetAllHighlightLanguages());
-
ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("cbdiffsettings"));
if (cfg)
{
RBViewing->SetSelection(cfg->ReadInt(_T("viewmode"), 0));
- CHHLang->SetStringSelection(cfg->Read(_T("hlang"), _("Plain Text")));
- if(RBViewing->GetSelection() == 1)
- {
- CHHLang->Enable(false);
- CHHLang->SetStringSelection(_("Diff/Patch"));
- }
}
}
@@ -129,26 +113,6 @@ void cbDiffSelectFiles::OnSelectTo(wxCommandEvent& event)
}
}
-void cbDiffSelectFiles::OnRadioBox(wxCommandEvent& event)
-{
- if(RBViewing->GetSelection() == 1)
- {
- m_lasthlang = CHHLang->GetStringSelection();
- CHHLang->SetStringSelection(_("Diff/Patch"));
- CHHLang->Disable();
- }
- else
- {
- CHHLang->Enable();
- CHHLang->SetStringSelection(m_lasthlang);
- }
-}
-
-void cbDiffSelectFiles::OnHLangChange(wxCommandEvent& event)
-{
- m_lasthlang = event.GetString();
-}
-
wxString cbDiffSelectFiles::GetFromFile()
{
return TCFromFile->GetValue();
@@ -164,7 +128,3 @@ int cbDiffSelectFiles::GetViewingMode()
return RBViewing->GetSelection() + cbDiffEditor::TABLE;
}
-wxString cbDiffSelectFiles::GetHighlightLanguage()
-{
- return CHHLang->GetStringSelection();
-}
diff --git a/src/cbDiffSelectFiles.h b/src/cbDiffSelectFiles.h
index a849025..8d94add 100644
--- a/src/cbDiffSelectFiles.h
+++ b/src/cbDiffSelectFiles.h
@@ -28,8 +28,6 @@ class cbDiffSelectFiles: public wxDialog
wxString GetToFile();
int GetViewingMode();
-
- wxString GetHighlightLanguage();
protected:
private:
//(*Declarations(cbDiffSelectFiles)
@@ -39,7 +37,6 @@ class cbDiffSelectFiles: public wxDialog
wxTextCtrl* TCToFile;
wxButton* BSelectFrom;
wxFileDialog* SelectFile;
- wxChoice* CHHLang;
//*)
//(*Identifiers(cbDiffSelectFiles)
@@ -48,17 +45,13 @@ class cbDiffSelectFiles: public wxDialog
static const long ID_TCTO;
static const long ID_BSTO;
static const long ID_RADIOBOX1;
- static const long ID_CHOICE1;
//*)
//(*Handlers(cbDiffSelectFiles)
void OnSelectTo(wxCommandEvent& event);
void OnSelectFrom(wxCommandEvent& event);
- void OnRadioBox(wxCommandEvent& event);
- void OnHLangChange(wxCommandEvent& event);
//*)
- wxString m_lasthlang;
DECLARE_EVENT_TABLE()
};
diff --git a/src/cbDiffToolbar.cpp b/src/cbDiffToolbar.cpp
index bbc0d3b..4feee3e 100644
--- a/src/cbDiffToolbar.cpp
+++ b/src/cbDiffToolbar.cpp
@@ -14,28 +14,36 @@
#include "../images/unified.h"
#include "../images/sidebyside.h"
+namespace {
+ /// IDs
+ const long int ID_BBRELOAD = wxNewId();
+ const long int ID_BBSWAP = wxNewId();
+ const long int ID_BUTTON_TABLE = wxNewId();
+ const long int ID_BUTTON_UNIFIED = wxNewId();
+ const long int ID_BUTTON_SIDEBYSIDE = wxNewId();
+
+};
BEGIN_EVENT_TABLE(cbDiffToolbar, wxEvtHandler)
END_EVENT_TABLE()
cbDiffToolbar::cbDiffToolbar(cbDiffEditor* parent,
- int viewmode,
- wxString hlang)
+ int viewmode)
: wxPanel(parent), m_parent(parent)
{
- BBTable = new wxBitmapButton(this, cbDiffEditor::TABLE,
+ BBTable = new wxBitmapButton(this, ID_BUTTON_TABLE,
wxGetBitmapFromMemory(table),
wxDefaultPosition,
wxDefaultSize,
wxBU_AUTODRAW);
BBTable->SetToolTip(_("Display as a table"));
- BBUnified = new wxBitmapButton(this, cbDiffEditor::UNIFIED,
+ BBUnified = new wxBitmapButton(this, ID_BUTTON_UNIFIED,
wxGetBitmapFromMemory(unified),
wxDefaultPosition,
wxDefaultSize, wxBU_AUTODRAW);
BBUnified->SetToolTip(_("Display as unified diff"));
- BBSideBySide = new wxBitmapButton(this, cbDiffEditor::SIDEBYSIDE,
+ BBSideBySide = new wxBitmapButton(this, ID_BUTTON_SIDEBYSIDE,
wxGetBitmapFromMemory(sidebyside),
wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW);
BBSideBySide->SetToolTip(_("Display side by side"));
@@ -51,13 +59,6 @@ cbDiffToolbar::cbDiffToolbar(cbDiffEditor* parent,
wxBU_AUTODRAW);
BBSwap->SetToolTip(_("Swap files"));
- CHLang = new wxChoice(this, ID_CHLANG);
- CHLang->Append(cbDiffUtils::GetAllHighlightLanguages());
- if(hlang == wxEmptyString)
- CHLang->SetStringSelection(_("Plain text"));
- else
- CHLang->SetStringSelection(hlang);
-
wxBoxSizer* boxsizer = new wxBoxSizer(wxHORIZONTAL);
boxsizer->Add(BBTable, 0, wxALL|wxALIGN_CENTER, 5);
boxsizer->Add(BBUnified, 0, wxALL|wxALIGN_CENTER, 5);
@@ -66,7 +67,6 @@ cbDiffToolbar::cbDiffToolbar(cbDiffEditor* parent,
boxsizer->Add(BBReload, 0, wxALL|wxALIGN_CENTER, 5);
boxsizer->Add(BBSwap, 0, wxALL|wxALIGN_CENTER, 5);
boxsizer->Add(-1,-1,0, wxALL|wxALIGN_CENTER, 5);
- boxsizer->Add(CHLang, 0, wxALL|wxALIGN_CENTER, 5);
SetSizer(boxsizer);
boxsizer->Layout();
@@ -87,8 +87,6 @@ cbDiffToolbar::cbDiffToolbar(cbDiffEditor* parent,
Connect(wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction)&cbDiffToolbar::OnButton);
- Connect(wxEVT_COMMAND_CHOICE_SELECTED,
- (wxObjectEventFunction)&cbDiffToolbar::OnChoice);
}
cbDiffToolbar::~cbDiffToolbar()
@@ -103,41 +101,40 @@ void cbDiffToolbar::OnButton(wxCommandEvent& event)
m_parent->Swap();
return;
}
- else if(event.GetId() != m_parent->GetMode() &&
- (event.GetId() == cbDiffEditor::TABLE ||
- event.GetId() == cbDiffEditor::UNIFIED ||
- event.GetId() == cbDiffEditor::SIDEBYSIDE))
+ else
{
- BBTable->Enable();
- BBUnified->Enable();
- BBSideBySide->Enable();
- CHLang->Enable();
- CHLang->SetStringSelection(m_lasthlang);
- m_parent->SetMode(event.GetId());
- m_parent->SetHlang(m_lasthlang);
- switch (event.GetId())
+ if (event.GetId() == ID_BUTTON_TABLE)
+ {
+ if ( m_parent->GetMode() != cbDiffEditor::TABLE)
+ {
+ m_parent->SetMode(cbDiffEditor::TABLE);
+ BBTable->Enable(false);
+ BBUnified->Enable();
+ BBSideBySide->Enable();
+ }
+ }
+ else if (event.GetId() == ID_BUTTON_UNIFIED)
{
- case cbDiffEditor::TABLE:
- BBTable->Enable(false);
- break;
- case cbDiffEditor::UNIFIED:
- BBUnified->Enable(false);
- m_lasthlang = CHLang->GetStringSelection();
- CHLang->SetStringSelection(_T("Diff/Patch"));
- CHLang->Disable();
- break;
- case cbDiffEditor::SIDEBYSIDE:
- BBSideBySide->Enable(false);
- break;
- default:
- break;
+ if ( m_parent->GetMode() != cbDiffEditor::UNIFIED)
+ {
+ m_parent->SetMode(cbDiffEditor::UNIFIED);
+ BBTable->Enable();
+ BBUnified->Enable(false);
+ BBSideBySide->Enable();
+ }
+ }
+ else if (event.GetId() == ID_BUTTON_SIDEBYSIDE)
+ {
+ if ( m_parent->GetMode() != cbDiffEditor::SIDEBYSIDE)
+ {
+ m_parent->SetMode(cbDiffEditor::SIDEBYSIDE);
+ BBTable->Enable();
+ BBUnified->Enable();
+ BBSideBySide->Enable(false);
+ }
}
}
+
m_parent->Reload();
}
-void cbDiffToolbar::OnChoice(wxCommandEvent& event)
-{
- m_lasthlang = event.GetString();
- m_parent->SetHlang(event.GetString());
-}
diff --git a/src/cbDiffToolbar.h b/src/cbDiffToolbar.h
index 7243c7e..42537f8 100644
--- a/src/cbDiffToolbar.h
+++ b/src/cbDiffToolbar.h
@@ -12,27 +12,16 @@ class cbDiffEditor;
class cbDiffToolbar : public wxPanel
{
public:
- cbDiffToolbar(cbDiffEditor* parent, int viewmode, wxString hlang);
+ cbDiffToolbar(cbDiffEditor* parent, int viewmode);
virtual ~cbDiffToolbar();
protected:
private:
- /// IDs
- enum
- {
- ID_BBRELOAD = 1545,
- ID_BBSWAP,
- ID_CHLANG
- };
cbDiffEditor* m_parent;
wxBitmapButton* BBTable;
wxBitmapButton* BBUnified;
wxBitmapButton* BBSideBySide;
- wxChoice* CHLang;
-
- wxString m_lasthlang;
void OnButton(wxCommandEvent& event);
- void OnChoice(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
diff --git a/src/cbDiffUtils.cpp b/src/cbDiffUtils.cpp
index b13ac14..aded668 100644
--- a/src/cbDiffUtils.cpp
+++ b/src/cbDiffUtils.cpp
@@ -73,24 +73,6 @@ namespace cbDiffUtils
return NULL;
}
- wxArrayString GetAllHighlightLanguages()
- {
- static wxArrayString langs;
- // Get them once, as they shouldn't change during App run
- if(langs.GetCount() == 0)
- {
- EditorColourSet *theme =
- new EditorColourSet(Manager::Get()->GetConfigManager(_T("editor"))->
- Read(_T("/colour_sets/active_colour_set"),
- COLORSET_DEFAULT));
- if (theme)
- langs = theme->GetAllHighlightLanguages();
- langs.Insert(_("Plain Text"), 0);
- wxDELETE(theme);
- }
- return langs;
- }
-
wxBitmap _wxGetBitmapFromMemory(const unsigned char *data, int length)
{
wxMemoryInputStream is(data, length);
diff --git a/src/cbDiffUtils.h b/src/cbDiffUtils.h
index f4c53ab..34dd599 100644
--- a/src/cbDiffUtils.h
+++ b/src/cbDiffUtils.h
@@ -17,7 +17,6 @@ namespace cbDiffUtils
ProjectFile* IsFileInActiveProject(wxString filename);
wxArrayString GetOpenFilesShort(wxString excludefile);
wxArrayString GetOpenFilesLong(wxString excludefile);
- wxArrayString GetAllHighlightLanguages();
wxBitmap _wxGetBitmapFromMemory(const unsigned char *data, int length);
}
#endif // CBDIFFUTILS_H
diff --git a/src/cbSideBySideCtrl.cpp b/src/cbSideBySideCtrl.cpp
index f4de6f7..d57860a 100644
--- a/src/cbSideBySideCtrl.cpp
+++ b/src/cbSideBySideCtrl.cpp
@@ -137,12 +137,6 @@ void cbSideBySideCtrl::Init(cbDiffColors colset)
m_theme->Apply(m_theme->GetHighlightLanguage(colset.m_hlang), TCRight);
}
-void cbSideBySideCtrl::SetHlang(wxString lang)
-{
- m_theme->Apply(m_theme->GetHighlightLanguage(lang), TCLeft);
- m_theme->Apply(m_theme->GetHighlightLanguage(lang), TCRight);
-}
-
void cbSideBySideCtrl::ShowDiff(wxDiff diff)
{
wxArrayInt right_added = diff.GetAddedLines();
diff --git a/src/cbSideBySideCtrl.h b/src/cbSideBySideCtrl.h
index a86ea76..74cea64 100644
--- a/src/cbSideBySideCtrl.h
+++ b/src/cbSideBySideCtrl.h
@@ -12,7 +12,6 @@ class cbSideBySideCtrl : public cbDiffCtrl
cbSideBySideCtrl(wxWindow* parent);
virtual ~cbSideBySideCtrl();
virtual void Init(cbDiffColors colset);
- virtual void SetHlang(wxString lang);
virtual void ShowDiff(wxDiff diff);
void Synchronize();
private:
diff --git a/src/cbTableCtrl.cpp b/src/cbTableCtrl.cpp
index 794f329..b61b1c8 100644
--- a/src/cbTableCtrl.cpp
+++ b/src/cbTableCtrl.cpp
@@ -44,11 +44,6 @@ void cbTableCtrl::Init(cbDiffColors colset)
m_theme->Apply(m_theme->GetHighlightLanguage(colset.m_hlang), m_txtctrl);
}
-void cbTableCtrl::SetHlang(wxString lang)
-{
- m_theme->Apply(m_theme->GetHighlightLanguage(lang), m_txtctrl);
-}
-
void cbTableCtrl::ShowDiff(wxDiff diff)
{
wxArrayInt right_added = diff.GetAddedLines();
diff --git a/src/cbTableCtrl.h b/src/cbTableCtrl.h
index c0f261b..7e357ae 100644
--- a/src/cbTableCtrl.h
+++ b/src/cbTableCtrl.h
@@ -11,7 +11,6 @@ class cbTableCtrl : public cbDiffCtrl
cbTableCtrl(wxWindow* parent);
virtual ~cbTableCtrl();
virtual void Init(cbDiffColors colset);
- virtual void SetHlang(wxString lang);
virtual void ShowDiff(wxDiff diff);
private:
cbStyledTextCtrl* m_txtctrl;
diff --git a/src/cbUnifiedCtrl.cpp b/src/cbUnifiedCtrl.cpp
index c5c6a02..b93f25f 100644
--- a/src/cbUnifiedCtrl.cpp
+++ b/src/cbUnifiedCtrl.cpp
@@ -31,11 +31,6 @@ void cbUnifiedCtrl::Init(cbDiffColors colset)
m_theme->Apply(_T("DiffPatch"), m_txtctrl);
}
-void cbUnifiedCtrl::SetHlang(wxString lang)
-{
- // Nothing todo, because the highlight language is always DiffPatch
-}
-
void cbUnifiedCtrl::ShowDiff(wxDiff diff)
{
m_txtctrl->SetReadOnly(false);
diff --git a/src/cbUnifiedCtrl.h b/src/cbUnifiedCtrl.h
index 5ed6a94..d3a4232 100644
--- a/src/cbUnifiedCtrl.h
+++ b/src/cbUnifiedCtrl.h
@@ -11,7 +11,6 @@ class cbUnifiedCtrl : public cbDiffCtrl
cbUnifiedCtrl(wxWindow* parent);
virtual ~cbUnifiedCtrl();
virtual void Init(cbDiffColors colset);
- virtual void SetHlang(wxString lang);
virtual void ShowDiff(wxDiff diff);
private:
cbStyledTextCtrl* m_txtctrl;
diff --git a/wxsmith/cbDiffConfigPanel.wxs b/wxsmith/cbDiffConfigPanel.wxs
index 2cbe53f..73486e6 100644
--- a/wxsmith/cbDiffConfigPanel.wxs
+++ b/wxsmith/cbDiffConfigPanel.wxs
@@ -136,22 +136,6 @@
wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
5
-
wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
5
diff --git a/wxsmith/cbDiffSelectFiles.wxs b/wxsmith/cbDiffSelectFiles.wxs
index b78e207..1a51a99 100644
--- a/wxsmith/cbDiffSelectFiles.wxs
+++ b/wxsmith/cbDiffSelectFiles.wxs
@@ -67,21 +67,6 @@
wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
5
-
-
-
-
-
- 0
-
- wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
- 5
-
-
-
- wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
- 5
-
wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
5