ecere/gui/DropBox: Added lastRow property
[sdk] / ecere / src / gui / controls / DropBox.ec
index 2baae53..9f56dbf 100644 (file)
@@ -102,7 +102,7 @@ public:
             {
                char tempString[4096];
                if(currentRow)
-                  editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
+                  editBox.contents = ((const char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
                else
                   editBox.contents = "";
             }
@@ -121,7 +121,8 @@ public:
       get { return currentRow; }
    };
    property DataRow firstRow { get { return this ? listBox.firstRow : null; } };
-   property char * contents { property_category $"Data" set { if(editBox) editBox.contents = value; } get { return editBox ? editBox.contents : null; } };
+   property DataRow lastRow { get { return this ? listBox.lastRow : null; } };
+   property const char * contents { property_category $"Data" set { if(editBox) editBox.contents = value; } get { return editBox ? editBox.contents : null; } };
    property bool editText
    {
       property_category $"Behavior"
@@ -217,7 +218,7 @@ public:
    virtual bool Window::NotifySelect(DropBox dropBox, DataRow row, Modifiers mods);
    virtual bool Window::NotifyClose(DropBox dropBox);
    virtual bool Window::NotifyHighlight(DropBox dropBox, DataRow row, Modifiers mods);
-   virtual bool Window::NotifyTextEntry(DropBox dropBox, char * string, bool confirmed);
+   virtual bool Window::NotifyTextEntry(DropBox dropBox, const char * string, bool confirmed);
 
    virtual Window OnDropDown()
    {
@@ -243,7 +244,7 @@ public:
    }
 
    // Methods
-   DataRow AddStringf(char * format, ...)
+   DataRow AddStringf(const char * format, ...)
    {
       if(this)
       {
@@ -264,7 +265,7 @@ public:
       return null;
    }
 
-   DataRow AddString(char * string)
+   DataRow AddString(const char * string)
    {
       if(this)
       {
@@ -304,12 +305,7 @@ public:
 
    any_object GetData(DataField field)
    {
-      if(this)
-      {
-         // TODO: Fix this shouldn't be required (memguard?)
-         return (void *)currentRow.GetData(field);
-      }
-      return null;
+      return this ? currentRow.GetData(field) : null;
    }
 
    void Sort(DataField field, int order)
@@ -406,7 +402,7 @@ public:
          {
             char tempString[4096];
             if(currentRow)
-               editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
+               editBox.contents = ((const char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
             else
                editBox.contents = "";
          }
@@ -582,7 +578,7 @@ private:
                {
                   char tempString[4096];
                   if(currentRow)
-                     editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
+                     editBox.contents = ((const char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
                   else
                      editBox.contents = "";
                }
@@ -879,7 +875,7 @@ private:
          {
             char tempString[4096];
             if(currentRow)
-               editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
+               editBox.contents = ((const char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
             else
                editBox.contents = "";
             if(active)