|
From: <pst...@us...> - 2008-03-30 13:41:22
|
Revision: 367
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=367&view=rev
Author: pstieber
Date: 2008-03-30 06:41:19 -0700 (Sun, 30 Mar 2008)
Log Message:
-----------
Added code to implement Save As...
Modified Paths:
--------------
trunk/jazz/src/TrackFrame.cpp
trunk/jazz/src/TrackFrame.h
Modified: trunk/jazz/src/TrackFrame.cpp
===================================================================
--- trunk/jazz/src/TrackFrame.cpp 2008-03-30 12:45:05 UTC (rev 366)
+++ trunk/jazz/src/TrackFrame.cpp 2008-03-30 13:41:19 UTC (rev 367)
@@ -72,6 +72,8 @@
EVT_MENU(wxID_OPEN, JZTrackFrame::OnFileOpen)
+ EVT_MENU(wxID_SAVEAS, JZTrackFrame::OnFileSaveAs)
+
EVT_MENU(wxID_EXIT, JZTrackFrame::OnFileExit)
EVT_MENU(ID_PLAY, JZTrackFrame::OnPlay)
@@ -452,6 +454,27 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+void JZTrackFrame::OnFileSaveAs(wxCommandEvent& Event)
+{
+ // wxFD_OVERWRITE_PROMPT - For save dialog only: prompt for a confirmation
+ // if a file will be overwritten.
+ wxFileDialog SaveAsDialog(
+ 0,
+ "Save MIDI File",
+ "",
+ "",
+ "*.mid",
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+ if (SaveAsDialog.ShowModal() == wxID_OK)
+ {
+ wxString FileName = SaveAsDialog.GetPath();
+ gpProject->Save(FileName);
+ SetTitle(FileName);
+ }
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZTrackFrame::OnFileExit(wxCommandEvent& Event)
{
if (OnClose() == false)
Modified: trunk/jazz/src/TrackFrame.h
===================================================================
--- trunk/jazz/src/TrackFrame.h 2008-03-30 12:45:05 UTC (rev 366)
+++ trunk/jazz/src/TrackFrame.h 2008-03-30 13:41:19 UTC (rev 367)
@@ -70,6 +70,8 @@
void OnFileOpen(wxCommandEvent& Event);
+ void OnFileSaveAs(wxCommandEvent& Event);
+
void OnFileExit(wxCommandEvent& Event);
void OnZoomIn(wxCommandEvent& Event);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|