[GRASS-SVN] r40128 - grass/branches/develbranch_6/vector/v.digit

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 24 15:42:00 EST 2009


Author: marisn
Date: 2009-12-24 15:41:58 -0500 (Thu, 24 Dec 2009)
New Revision: 40128

Added:
   grass/branches/develbranch_6/vector/v.digit/open.c
Modified:
   grass/branches/develbranch_6/vector/v.digit/form.c
   grass/branches/develbranch_6/vector/v.digit/proto.h
Log:
Reverting to local form start as it's not worth to fix lib/forms. Should fix issue #843

Modified: grass/branches/develbranch_6/vector/v.digit/form.c
===================================================================
--- grass/branches/develbranch_6/vector/v.digit/form.c	2009-12-24 12:10:10 UTC (rev 40127)
+++ grass/branches/develbranch_6/vector/v.digit/form.c	2009-12-24 20:41:58 UTC (rev 40128)
@@ -13,6 +13,7 @@
 #include <grass/gis.h>
 #include <grass/dbmi.h>
 #include <grass/form.h>
+#include "proto.h"
 
 /* Structure to store column names and values */
 typedef struct

Copied: grass/branches/develbranch_6/vector/v.digit/open.c (from rev 38953, grass/branches/develbranch_6/vector/v.digit/open.c)
===================================================================
--- grass/branches/develbranch_6/vector/v.digit/open.c	                        (rev 0)
+++ grass/branches/develbranch_6/vector/v.digit/open.c	2009-12-24 20:41:58 UTC (rev 40128)
@@ -0,0 +1,58 @@
+#include <stdlib.h>
+#include <string.h>
+#include <grass/gis.h>
+#include <grass/dbmi.h>
+#include "global.h"
+#include "proto.h"
+
+int first = 1;
+
+/* Open new form
+ *
+ *  returns: 0 success
+ */
+int F_open(char *title, char *html)
+{
+    int len;
+    char *buf;
+
+    if (first) {
+	Tcl_Eval(Toolbox, "init_form");
+	first = 0;
+    }
+
+    G_debug(2, "PARENT HTML:\n%s\n", html);
+
+    len = strlen(title) + strlen(html) + 20;
+    buf = G_malloc(len);
+    sprintf(buf, "open_form {%s} {%s}", title, html);
+    Tcl_Eval(Toolbox, buf);
+    G_free(buf);
+
+    return 0;
+}
+
+/* Clear old forms from window
+ *
+ */
+void F_clear(void)
+{
+    G_debug(2, "F_clear()");
+
+    if (first)
+	return;
+
+    Tcl_Eval(Toolbox, "clear_form");
+}
+
+void F_close(void)
+{
+    G_debug(2, "F_close()");
+
+    if (first)
+	return;
+
+    Tcl_Eval(Toolbox, "done_form");
+
+    first = 1;
+}

Modified: grass/branches/develbranch_6/vector/v.digit/proto.h
===================================================================
--- grass/branches/develbranch_6/vector/v.digit/proto.h	2009-12-24 12:10:10 UTC (rev 40127)
+++ grass/branches/develbranch_6/vector/v.digit/proto.h	2009-12-24 20:41:58 UTC (rev 40128)
@@ -141,3 +141,6 @@
 int reset_values(ClientData, Tcl_Interp *, int, char **);
 int set_value(ClientData, Tcl_Interp *, int, char **);
 int submit(ClientData, Tcl_Interp *, int, char **);
+int F_open(char *, char *);
+void F_clear(void);
+void F_close(void);



More information about the grass-commit mailing list