+// wxVariant
+
+wxVariant::wxVariant(long val, const wxString& name)
+{
+ m_refData = new wxVariantDataLong(val);
+ m_name = name;
+}
+
+wxVariant::wxVariant(int val, const wxString& name)
+{
+ m_refData = new wxVariantDataLong((long)val);
+ m_name = name;
+}
+
+wxVariant::wxVariant(short val, const wxString& name)
+{
+ m_refData = new wxVariantDataLong((long)val);
+ m_name = name;
+}
+
+bool wxVariant::operator== (long value) const
+{
+ long thisValue;
+ if (!Convert(&thisValue))
+ return false;
+ else
+ return (value == thisValue);
+}
+
+bool wxVariant::operator!= (long value) const
+{
+ return (!((*this) == value));
+}
+
+void wxVariant::operator= (long value)
+{
+ if (GetType() == wxT("long") &&
+ m_refData->GetRefCount() == 1)
+ {
+ ((wxVariantDataLong*)GetData())->SetValue(value);
+ }
+ else
+ {
+ UnRef();
+ m_refData = new wxVariantDataLong(value);
+ }
+}
+
+long wxVariant::GetLong() const
+{
+ long value;
+ if (Convert(& value))
+ return value;
+ else
+ {
+ wxFAIL_MSG(wxT("Could not convert to a long"));
+ return 0;
+ }
+}