diff os2/dw.c @ 819:2dd7638a7719

Fix for some dw_container_change_item() misbehavior... was functioning the same as dw_container_set_item(). Also added dw_container_change_row_title() which performs the same task as dw_container_set_row_title() on inserted items.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 26 Mar 2011 12:49:59 +0000
parents 388f2a48aaae
children eaaef18d5b21
line wrap: on
line diff
--- a/os2/dw.c	Sat Mar 26 05:24:01 2011 +0000
+++ b/os2/dw.c	Sat Mar 26 12:49:59 2011 +0000
@@ -7275,6 +7275,34 @@
 }
 
 /*
+ * Changes the title of a row already inserted in the container.
+ * Parameters:
+ *          handle: Handle to the container window (widget).
+ *          row: Zero based row of data being set.
+ *          title: String title of the item.
+ */
+void API dw_container_change_row_title(HWND handle, int row, char *title)
+{
+   PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+   int count = 0;
+
+   while(pCore)
+   {
+      if(count == row)
+      {
+         pCore->pszIcon = title;
+         pCore->pszName = title;
+         pCore->pszText = title;
+
+         WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_NOREPOSITION | CMA_TEXTCHANGED));
+         return;
+      }
+      pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+      count++;
+   }
+}
+
+/*
  * Sets the title of a row in the container.
  * Parameters:
  *          handle: Handle to the container window (widget).