Update of /cvsroot/simspark/simspark/contrib/rsgedit
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4460
Modified Files:
Tag: RSGEDIT_SCINTILLA
sparkedit.cpp sparkedit.h
Log Message:
- added method UpdateTitles() and Savemodified()
Index: sparkedit.cpp
===================================================================
RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.cpp,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** sparkedit.cpp 23 Jun 2007 10:13:45 -0000 1.1.2.10
--- sparkedit.cpp 23 Jun 2007 11:09:45 -0000 1.1.2.11
***************
*** 313,316 ****
--- 313,329 ----
}
+ void SparkEdit::UpdateTitles(wxFlatNotebook* notebook)
+ {
+ for (
+ TEditMap::iterator iter = mEditMap.begin();
+ iter != mEditMap.end();
+ ++iter
+ )
+ {
+ wxScintilla* edit = (*iter).first;
+ UpdateTitle(notebook, edit);
+ }
+ }
+
void SparkEdit::UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit)
{
***************
*** 331,334 ****
--- 344,377 ----
}
+ void SparkEdit::SaveModified()
+ {
+ for (
+ TEditMap::iterator iter = mEditMap.begin();
+ iter != mEditMap.end();
+ ++iter
+ )
+ {
+ wxScintilla* edit = (*iter).first;
+ if (! edit->GetModify())
+ {
+ continue;
+ }
+
+ EditEntry& entry = (*iter).second;
+ SaveFile(edit, entry);
+ }
+ }
+
+ void SparkEdit::SaveFile(wxScintilla* edit, const EditEntry& entry)
+ {
+ if (edit == 0)
+ {
+ assert(false);
+ return;
+ }
+
+ edit->SaveFile(entry.fname);
+ }
+
void SparkEdit::SaveFile(wxScintilla* edit)
{
***************
*** 338,344 ****
return;
}
!
const EditEntry& entry = (*iter).second;
! edit->SaveFile(entry.fname);
}
--- 381,387 ----
return;
}
!
const EditEntry& entry = (*iter).second;
! SaveFile(edit, entry);
}
Index: sparkedit.h
===================================================================
RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.h,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** sparkedit.h 23 Jun 2007 10:13:45 -0000 1.1.2.7
--- sparkedit.h 23 Jun 2007 11:09:45 -0000 1.1.2.8
***************
*** 67,73 ****
--- 67,75 ----
static wxScintilla* GetEdit(const wxString& fname, wxFlatNotebook* notebook, bool select);
static void PutEdit(wxScintilla* edit);
+ static void UpdateTitles(wxFlatNotebook* notebook);
static void UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit);
static void UpdateIcons(wxFlatNotebook* notebook);
static void SaveFile(wxScintilla* edit);
+ static void SaveModified();
static void SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit);
static wxScintilla* GetStartScript();
***************
*** 86,89 ****
--- 88,93 ----
static int GetImageIndex(const wxScintilla* edit, const EditEntry& entry);
+ static void SaveFile(wxScintilla* edit, const EditEntry& entry);
+
protected:
static TEditMap mEditMap;
|