lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5018] Add embryonic input-sequence editor


From: Greg Chicares
Subject: [lmi-commits] [5018] Add embryonic input-sequence editor
Date: Thu, 01 Jul 2010 17:31:38 +0000

Revision: 5018
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5018
Author:   chicares
Date:     2010-07-01 17:31:37 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Add embryonic input-sequence editor

Modified Paths:
--------------
    lmi/trunk/Makefile.am
    lmi/trunk/objects.make

Added Paths:
-----------
    lmi/trunk/datum_sequence.cpp
    lmi/trunk/datum_sequence.hpp
    lmi/trunk/input_sequence_entry.cpp
    lmi/trunk/input_sequence_entry.hpp

Modified: lmi/trunk/Makefile.am
===================================================================
--- lmi/trunk/Makefile.am       2010-06-25 01:31:35 UTC (rev 5017)
+++ lmi/trunk/Makefile.am       2010-07-01 17:31:37 UTC (rev 5018)
@@ -165,6 +165,7 @@
     icon_monger.cpp \
     illustration_document.cpp \
     illustration_view.cpp \
+    input_sequence_entry.cpp \
     main_common.cpp \
     main_wx.cpp \
     mec_document.cpp \
@@ -250,6 +251,7 @@
     database.cpp \
     datum_base.cpp \
     datum_boolean.cpp \
+    datum_sequence.cpp \
     datum_string.cpp \
     dbdict.cpp \
     dbnames.cpp \
@@ -615,6 +617,7 @@
   data_directory.cpp \
   database.cpp \
   datum_base.cpp \
+  datum_sequence.cpp \
   datum_string.cpp \
   dbdict.cpp \
   dbnames.cpp \
@@ -915,6 +918,7 @@
     database_view_editor.hpp \
     datum_base.hpp \
     datum_boolean.hpp \
+    datum_sequence.hpp \
     datum_string.hpp \
     dbdict.hpp \
     dbindex.hpp \
@@ -952,6 +956,7 @@
     input.hpp \
     input_seq_helpers.hpp \
     input_sequence.hpp \
+    input_sequence_entry.hpp \
     interest_rates.hpp \
     istream_to_string.hpp \
     ledger.hpp \

Added: lmi/trunk/datum_sequence.cpp
===================================================================
--- lmi/trunk/datum_sequence.cpp                                (rev 0)
+++ lmi/trunk/datum_sequence.cpp        2010-07-01 17:31:37 UTC (rev 5018)
@@ -0,0 +1,77 @@
+// Input-sequence class for wx data-transfer framework.
+//
+// Copyright (C) 2010 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+#ifdef __BORLANDC__
+#   include "pchfile.hpp"
+#   pragma hdrstop
+#endif // __BORLANDC__
+
+// The remainder of this initial version is just a copy of
+// 'datum_string.cpp' with 's/datum_string/datum_sequence/g'.
+
+#include "datum_sequence.hpp"
+
+#include "facets.hpp"
+
+datum_sequence::datum_sequence()
+{
+}
+
+datum_sequence::datum_sequence(std::string const& value)
+    :value_(value)
+{
+}
+
+datum_sequence::~datum_sequence()
+{
+}
+
+datum_sequence& datum_sequence::operator=(std::string const& s)
+{
+    value_ = s;
+    return *this;
+}
+
+std::string const& datum_sequence::value() const
+{
+    return value_;
+}
+
+std::istream& datum_sequence::read(std::istream& is)
+{
+    std::locale old_locale = is.imbue(blank_is_not_whitespace_locale());
+    is >> value_;
+    is.imbue(old_locale);
+    return is;
+}
+
+std::ostream& datum_sequence::write(std::ostream& os) const
+{
+    return os << value();
+}
+
+bool operator==(datum_sequence const& lhs, datum_sequence const& rhs)
+{
+    return lhs.value() == rhs.value();
+}
+


Property changes on: lmi/trunk/datum_sequence.cpp
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Added: lmi/trunk/datum_sequence.hpp
===================================================================
--- lmi/trunk/datum_sequence.hpp                                (rev 0)
+++ lmi/trunk/datum_sequence.hpp        2010-07-01 17:31:37 UTC (rev 5018)
@@ -0,0 +1,80 @@
+// Input-sequence class for wx data-transfer framework.
+//
+// Copyright (C) 2010 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+// The remainder of this initial version is just a copy of
+// 'datum_string.hpp' with 's/datum_string/datum_sequence/g'.
+
+#ifndef datum_sequence_hpp
+#define datum_sequence_hpp
+
+#include "config.hpp"
+
+#include "datum_base.hpp"
+
+#include "value_cast.hpp"
+
+#include <boost/operators.hpp>
+
+#include <string>
+
+// Implicitly-declared special member functions do the right thing.
+
+class datum_sequence
+    :public datum_base
+    ,private boost::equality_comparable<datum_sequence,datum_sequence>
+{
+  public:
+    datum_sequence();
+    explicit datum_sequence(std::string const&);
+    virtual ~datum_sequence();
+
+    datum_sequence& operator=(std::string const&);
+
+    std::string const& value() const;
+
+    // datum_base required implementation.
+    virtual std::istream& read (std::istream&);
+    virtual std::ostream& write(std::ostream&) const;
+
+  private:
+    std::string value_;
+};
+
+bool operator==(datum_sequence const&, datum_sequence const&);
+
+template<>
+inline datum_sequence value_cast<datum_sequence,std::string>
+    (std::string const& from)
+{
+    return datum_sequence(from);
+}
+
+template<>
+inline std::string value_cast<std::string,datum_sequence>
+    (datum_sequence const& from)
+{
+    return from.value();
+}
+
+#endif // datum_sequence_hpp
+


Property changes on: lmi/trunk/datum_sequence.hpp
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Added: lmi/trunk/input_sequence_entry.cpp
===================================================================
--- lmi/trunk/input_sequence_entry.cpp                          (rev 0)
+++ lmi/trunk/input_sequence_entry.cpp  2010-07-01 17:31:37 UTC (rev 5018)
@@ -0,0 +1,30 @@
+// Pop-up input-sequence editor.
+//
+// Copyright (C) 2010 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+#ifdef __BORLANDC__
+#   include "pchfile.hpp"
+#   pragma hdrstop
+#endif // __BORLANDC__
+
+#include "input_sequence_entry.hpp"
+


Property changes on: lmi/trunk/input_sequence_entry.cpp
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Added: lmi/trunk/input_sequence_entry.hpp
===================================================================
--- lmi/trunk/input_sequence_entry.hpp                          (rev 0)
+++ lmi/trunk/input_sequence_entry.hpp  2010-07-01 17:31:37 UTC (rev 5018)
@@ -0,0 +1,30 @@
+// Pop-up input-sequence editor.
+//
+// Copyright (C) 2010 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+#ifndef input_sequence_entry_hpp
+#define input_sequence_entry_hpp
+
+#include "config.hpp"
+
+#endif // input_sequence_entry_hpp
+


Property changes on: lmi/trunk/input_sequence_entry.hpp
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Modified: lmi/trunk/objects.make
===================================================================
--- lmi/trunk/objects.make      2010-06-25 01:31:35 UTC (rev 5017)
+++ lmi/trunk/objects.make      2010-07-01 17:31:37 UTC (rev 5018)
@@ -188,6 +188,7 @@
   database.o \
   datum_base.o \
   datum_boolean.o \
+  datum_sequence.o \
   datum_string.o \
   dbdict.o \
   dbnames.o \
@@ -306,6 +307,7 @@
   icon_monger.o \
   illustration_document.o \
   illustration_view.o \
+  input_sequence_entry.o \
   main_common.o \
   main_wx.o \
   mec_document.o \
@@ -375,6 +377,7 @@
   data_directory.o \
   database.o \
   datum_base.o \
+  datum_sequence.o \
   datum_string.o \
   dbdict.o \
   dbnames.o \
@@ -663,6 +666,7 @@
   data_directory.o \
   database.o \
   datum_base.o \
+  datum_sequence.o \
   datum_string.o \
   dbdict.o \
   dbnames.o \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]