changeset 355:3a71623fc219

Changes to implement justification on container columns.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 18 Apr 2003 09:28:27 +0000
parents 3a51ecc8383a
children fb2667339e9f
files gtk/dw.c win/dw.c
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Thu Apr 17 21:50:51 2003 +0000
+++ b/gtk/dw.c	Fri Apr 18 09:28:27 2003 +0000
@@ -4294,6 +4294,7 @@
 	char numbuf[10];
 	int z, multi;
 	int _locked_by_me = FALSE;
+	GtkJustification justification;
 
 	DW_MUTEX_LOCK;
     clist = gtk_clist_new_with_titles(count, (gchar **)titles);
@@ -4324,6 +4325,13 @@
 			gtk_clist_set_column_width(GTK_CLIST(clist), z, 50);
 		sprintf(numbuf, "%d", z);
 		gtk_object_set_data(GTK_OBJECT(clist), numbuf, (gpointer)flags[z]);
+		if(flags[z]&DW_CFA_RIGHT)
+			justification = GTK_JUSTIFY_RIGHT;
+		else if(flags[z]&DW_CFA_CENTER)
+			justification = GTK_JUSTIFY_CENTER;
+		else
+			justification = GTK_JUSTIFY_LEFT;
+		gtk_clist_set_column_justification(GTK_CLIST(clist),z,justification);
 	}
 
 	DW_MUTEX_UNLOCK;
--- a/win/dw.c	Thu Apr 17 21:50:51 2003 +0000
+++ b/win/dw.c	Fri Apr 18 09:28:27 2003 +0000
@@ -6018,7 +6018,7 @@
 	ContainerInfo *cinfo = (ContainerInfo *)GetWindowLong(handle, GWL_USERDATA);
 	int z, l = 0;
 	unsigned long *tempflags = calloc(sizeof(unsigned long), count + 2);
-	LV_COLUMN lvc;
+	LVCOLUMN lvc;
 
 	if(separator == -1)
 	{
@@ -6036,10 +6036,15 @@
 	{
 		if(titles[z])
 		{
-			lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
+			lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_FMT;
 			lvc.pszText = titles[z];
 			lvc.cchTextMax = strlen(titles[z]);
-			lvc.fmt = flags[z];
+			if(flags[z] & DW_CFA_RIGHT)
+				lvc.fmt = LVCFMT_RIGHT;
+			else if(flags[z] & DW_CFA_CENTER)
+				lvc.fmt = LVCFMT_CENTER;
+			else
+				lvc.fmt = LVCFMT_LEFT;
 			lvc.cx = 75;
 			lvc.iSubItem = count;
 			SendMessage(handle, LVM_INSERTCOLUMN, (WPARAM)z + l, (LPARAM)&lvc);