Update of /cvsroot/audacity/audacity-src/src/widgets
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30518

Modified Files:
        Grid.cpp 
Log Message:
Re-add TimeTextCtrl time extraction so it makes more sense.

Index: Grid.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Grid.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- Grid.cpp    6 Jun 2009 18:05:42 -0000       1.13
+++ Grid.cpp    6 Jun 2009 19:08:26 -0000       1.14
@@ -695,8 +695,36 @@
       wxString n = mGrid->GetColLabelValue(col);
       wxString v = mGrid->GetCellValue(row, col);
       if (v.IsEmpty()) {
-         v = wxT("empty");
+         v = _("Empty");
+      }
+
+      // Hack to provide a more intelligible response
+      TimeEditor *d =
+         (TimeEditor *)mGrid->GetDefaultEditorForType(GRID_VALUE_TIME);
+      TimeEditor *c =
+         (TimeEditor *)mGrid->GetCellEditor(row, col);
+
+      if (c && d && c == d) {
+         double value;
+         v.ToDouble(&value);
+
+         TimeTextCtrl tt(mGrid,
+                         wxID_ANY,
+                         wxT(""),
+                         value,
+                         c->GetRate(),
+                         wxPoint(10000, 10000),  // create offscreen
+                         wxDefaultSize,
+                         true);
+         tt.SetFormatString(tt.GetBuiltinFormat(c->GetFormat()));
+         v = tt.GetTimeString();
       }
+
+      if (c)
+         c->DecRef();
+      if (d)
+         d->DecRef();
+
       *name = n + wxT(" ") + v;
    }
 


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to