]> git.saurik.com Git - wxWidgets.git/commitdiff
Added, documented and used wxGridCellChoiceEditor
authorMattia Barbon <mbarbon@cpan.org>
Thu, 11 Sep 2003 21:11:01 +0000 (21:11 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Thu, 11 Sep 2003 21:11:01 +0000 (21:11 +0000)
taking wxArrayString.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/gridedit.tex
include/wx/generic/grid.h
src/generic/grid.cpp
utils/configtool/src/propeditor.cpp

index 01bbf9db1dd3342f39b4b7d131b4a3da835de4b6..8d1dc603ded725a3770bfb8c713b17dd89ed1631 100644 (file)
@@ -53,6 +53,8 @@ The editor for string data allowing to choose from a list of strings.
 
 \func{}{wxGridCellChoiceEditor}{\param{size\_t }{count = 0}, \param{const wxString }{choices[] = NULL}, \param{bool }{allowOthers = false}}
 
+\func{}{wxGridCellChoiceEditor}{\param{const wxArrayString& }{choices}, \param{bool }{allowOthers = false}}
+
 \docparam{count}{Number of strings from which the user can choose.}
 \docparam{choices}{An array of strings from which the user can choose.}
 \docparam{allowOthers}{If allowOthers if true, the user can type a string not in choices array.}
index 608f31e6353d62224fc2423c8c9f5dc90c0f3610..8996aed1bcf9a54740317235a37f990952a663a8 100644 (file)
@@ -567,6 +567,8 @@ public:
     wxGridCellChoiceEditor(size_t count = 0,
                            const wxString choices[] = NULL,
                            bool allowOthers = FALSE);
+    wxGridCellChoiceEditor(const wxArrayString& choices,
+                           bool allowOthers = FALSE);
 
     virtual void Create(wxWindow* parent,
                         wxWindowID id,
index cfea196c38546f0cdf0f6e2d6a104e0309139b6e..de4327dcdb2831a48936cdc038d5debbd0730f30 100644 (file)
@@ -1364,6 +1364,11 @@ wxString wxGridCellBoolEditor::GetValue() const
 // wxGridCellChoiceEditor
 // ----------------------------------------------------------------------------
 
+wxGridCellChoiceEditor::wxGridCellChoiceEditor(const wxArrayString& choices,
+                                               bool allowOthers)
+    : m_choices(choices),
+      m_allowOthers(allowOthers) { }
+
 wxGridCellChoiceEditor::wxGridCellChoiceEditor(size_t count,
                                                const wxString choices[],
                                                bool allowOthers)
index 94220446def3d11ebeffda69692eaf0da5494b1e..1bf8c2023e19f242c4297fb3993447de72e3ccc0 100644 (file)
@@ -313,12 +313,16 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly
     // Set the value type
     if (prop->GetEditorType() == _T("choice"))
     {
+#if 0
         wxString* strArr = prop->GetChoices().GetStringArray();
 
         m_attributeEditorGrid->SetCellEditor(row, 1,
                 new wxGridCellChoiceEditor(prop->GetChoices().GetCount(), strArr));
 
         delete[] strArr;
+#endif
+        m_attributeEditorGrid->SetCellEditor(row, 1,
+                new wxGridCellChoiceEditor(prop->GetChoices()));
     }
     else if (prop->GetEditorType() == _T("integer") || prop->GetVariant().GetType() == _T("long"))
     {