changeset 15:81833f25b1aa

Added new Dynamic Windows build information to the DWEnv struct. It reports version numbers and build time/date.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 12 Jul 2001 20:31:26 +0000
parents 176cee043f1b
children ca7a8215487a
files dw.h gtk/dw.c os2/dw.c win/dw.c
diffstat 4 files changed, 47 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Wed Jul 11 21:57:56 2001 +0000
+++ b/dw.h	Thu Jul 12 20:31:26 2001 +0000
@@ -3,6 +3,11 @@
 #ifndef _H_DW
 #define _H_DW
 
+/* Dynamic Windows version numbers */
+#define DW_MAJOR_VERSION 0
+#define DW_MINOR_VERSION 5
+#define DW_SUB_VERSION 0
+
 #if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__)
 /* OS/2 or Windows */
 
@@ -486,10 +491,12 @@
 #endif
 
 typedef struct _dwenv {
-    /* Operating System Name */
-	char osName[30];
+	/* Operating System Name and DW Build Date/Time */
+	char osName[30], buildDate[30], buildTime[30];
 	/* Versions and builds */
 	short MajorVersion, MinorVersion, MajorBuild, MinorBuild;
+	/* Dynamic Window version */
+	short DWMajorVersion, DWMinorVersion, DWSubVersion;
 } DWEnv;
 
 
--- a/gtk/dw.c	Wed Jul 11 21:57:56 2001 +0000
+++ b/gtk/dw.c	Thu Jul 12 20:31:26 2001 +0000
@@ -3389,23 +3389,13 @@
 	DW_MUTEX_LOCK;
 	if(handle && GTK_IS_WINDOW(handle))
 	{
-		GdkWindow *parent = gdk_window_get_parent(handle->window);
 		int cx = (int)gtk_object_get_data(GTK_OBJECT(handle), "cx");
 		int cy = (int)gtk_object_get_data(GTK_OBJECT(handle), "cy");
 
 		_size_allocate(GTK_WINDOW(handle));
-#if 0
-		if(parent)
-		{
-			gdk_window_resize(parent, width, height);
-			gdk_window_move(parent, x, y);
-		}
-		else
-#endif
-		{
-			gtk_widget_set_uposition(handle, x, y);
-			gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy);
-		}
+
+		gtk_widget_set_uposition(handle, x, y);
+		gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy);
 	}
 	else if(handle && handle->window)
 	{
@@ -3495,11 +3485,13 @@
 
 	DW_MUTEX_LOCK;
 	for(z=0;z<256;z++)
+	{
 		if(!gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z))
 		{
 			DW_MUTEX_UNLOCK;
 			return z;
 		}
+	}
 
 	DW_MUTEX_UNLOCK;
 
@@ -3594,13 +3586,24 @@
  */
 void dw_notebook_pack(HWND handle, unsigned long pageid, HWND page)
 {
-	GtkWidget *label;
+	GtkWidget *label, *child, *oldlabel;
+	gchar *text = NULL;
 	int _locked_by_me = FALSE;
 
 	DW_MUTEX_LOCK;
-	label = gtk_label_new("");
-
-	gtk_notebook_append_page (GTK_NOTEBOOK(handle), page, label);
+	child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), pageid);
+	if(child)
+	{
+		oldlabel = gtk_notebook_get_tab_label(GTK_NOTEBOOK(handle), child);
+		if(oldlabel)
+			gtk_label_get(GTK_LABEL(oldlabel), &text);
+	}
+
+	label = gtk_label_new(text ? text : "");
+
+	gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, pageid);
+	if(child)
+		gtk_notebook_remove_page(GTK_NOTEBOOK(handle), pageid+1);
 	DW_MUTEX_UNLOCK;
 }
 
@@ -4105,6 +4108,12 @@
 
 	len = strlen(tempbuf);
 
+	strcpy(env->buildDate, __DATE__);
+	strcpy(env->buildTime, __TIME__);
+	env->DWMajorVersion = DW_MAJOR_VERSION;
+	env->DWMinorVersion = DW_MINOR_VERSION;
+	env->DWSubVersion = DW_SUB_VERSION;
+
 	for(z=1;z<len;z++)
 	{
 		if(tempbuf[z] == '.')
--- a/os2/dw.c	Wed Jul 11 21:57:56 2001 +0000
+++ b/os2/dw.c	Thu Jul 12 20:31:26 2001 +0000
@@ -1386,7 +1386,7 @@
 
 								WinQueryClassName(tmp->window, 99, classbuf);
 
-								if(id && strncmp(classbuf, "#6", 2)==0)
+								if(id && strncmp(classbuf, "#2", 2)==0)
 								{
 									char *buf2;
 
@@ -5424,6 +5424,11 @@
 		else if (i == 10)
 			env->MinorVersion = 1;
 	}
+	strcpy(env->buildDate, __DATE__);
+	strcpy(env->buildTime, __TIME__);
+	env->DWMajorVersion = DW_MAJOR_VERSION;
+	env->DWMinorVersion = DW_MINOR_VERSION;
+	env->DWSubVersion = DW_SUB_VERSION;
 }
 
 /*
--- a/win/dw.c	Wed Jul 11 21:57:56 2001 +0000
+++ b/win/dw.c	Thu Jul 12 20:31:26 2001 +0000
@@ -5329,6 +5329,12 @@
 		strcpy(env->osName, "Windows 95/98/ME");
 		env->MajorBuild =  0;
 	}
+
+	strcpy(env->buildDate, __DATE__);
+	strcpy(env->buildTime, __TIME__);
+	env->DWMajorVersion = DW_MAJOR_VERSION;
+	env->DWMinorVersion = DW_MINOR_VERSION;
+	env->DWSubVersion = DW_SUB_VERSION;
 }
 
 /*