tFull support for gtk_clist_set_column_justification() under Win32. - vaccinewa… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 95b7df091125a4c0c86061013f44a3a7da85e59e | |
parent 9bdd4c619d23fefacbd8a82acde3cb3c70249d9e | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 26 Aug 2002 12:34:59 +0000 | |
Full support for gtk_clist_set_column_justification() under Win32. | |
Diffstat: | |
M src/gtkport/clist.c | 16 +++++++++++++++- | |
M src/gtkport/clist.h | 1 + | |
2 files changed, 16 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/src/gtkport/clist.c b/src/gtkport/clist.c | |
t@@ -137,6 +137,7 @@ GtkWidget *gtk_clist_new(gint columns) | |
clist->coldata[i].width = 0; | |
clist->coldata[i].visible = TRUE; | |
clist->coldata[i].resizeable = TRUE; | |
+ clist->coldata[i].justification = GTK_JUSTIFY_LEFT; | |
} | |
return GTK_WIDGET(clist); | |
t@@ -261,8 +262,20 @@ void gtk_clist_draw_row(GtkCList *clist, LPDRAWITEMSTRUCT… | |
if (i == clist->cols - 1) | |
rcCol.right = lpdis->rcItem.right; | |
if (row->text[i]) { | |
+ UINT align; | |
+ switch(clist->coldata[i].justification) { | |
+ case GTK_JUSTIFY_RIGHT: | |
+ align = DT_RIGHT; | |
+ break; | |
+ case GTK_JUSTIFY_CENTER: | |
+ align = DT_CENTER; | |
+ break; | |
+ default: | |
+ align = DT_LEFT; | |
+ break; | |
+ } | |
myDrawText(lpdis->hDC, row->text[i], -1, &rcCol, | |
- DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS); | |
+ align | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS); | |
} | |
} | |
} | |
t@@ -751,6 +764,7 @@ void gtk_clist_update_selection(GtkWidget *widget) | |
void gtk_clist_set_column_justification(GtkCList *clist, gint column, | |
GtkJustification justification) | |
{ | |
+ clist->coldata[column].justification = justification; | |
} | |
#else /* for systems with GTK+ */ | |
diff --git a/src/gtkport/clist.h b/src/gtkport/clist.h | |
t@@ -42,6 +42,7 @@ typedef gint (*GtkCListCompareFunc) (GtkCList *clist, gconst… | |
struct _GtkCListColumn { | |
gchar *title; | |
gint width; | |
+ GtkJustification justification; | |
guint visible:1; | |
guint resizeable:1; | |
guint auto_resize:1; |