From: <kr_...@us...> - 2003-03-26 22:10:35
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv14592/port/src/cbits/GTK Modified Files: Button.c EditBox.c Label.c Log Message: The font attribute from Literate class is implemented Index: Button.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Button.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Button.c 26 Mar 2003 00:41:47 -0000 1.4 --- Button.c 26 Mar 2003 22:09:54 -0000 1.5 *************** *** 1,46 **** ! #include "Button.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! ! WindowHandle osCreateButton(WindowHandle window) ! { ! GtkWidget *button; ! ! button = gtk_button_new_with_mnemonic(""); ! gtk_signal_connect (GTK_OBJECT(button), "clicked", ! GTK_SIGNAL_FUNC(handleControlCommand), ! NULL); ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GetSW(window)->child)->child), button, 0, 0); ! gtk_widget_show(button); ! ! return button; ! }; ! ! void osGetButtonReqSize(WindowHandle button, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(button, &w,&h); ! gtk_widget_set_size_request(button, -1,-1); ! gtk_widget_size_request(button, &requisition); ! gtk_widget_set_size_request(button, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! } ! ! char *osGetButtonText(WindowHandle button) ! { ! return fromMnemonicString(gtk_button_get_label(GTK_BUTTON(button))); ! }; ! ! void osSetButtonText(WindowHandle button, char *txt) ! { ! gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_toplevel(button); ! gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); ! rfree(szText); ! }; --- 1,52 ---- ! #include "Button.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! ! WindowHandle osCreateButton(WindowHandle window) ! { ! GtkWidget *button; ! ! button = gtk_button_new_with_mnemonic(""); ! gtk_signal_connect (GTK_OBJECT(button), "clicked", ! GTK_SIGNAL_FUNC(handleControlCommand), ! NULL); ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GetSW(window)->child)->child), button, 0, 0); ! gtk_widget_show(button); ! ! return button; ! }; ! ! void osGetButtonReqSize(WindowHandle button, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(button, &w,&h); ! gtk_widget_set_size_request(button, -1,-1); ! gtk_widget_size_request(button, &requisition); ! gtk_widget_set_size_request(button, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! } ! ! char *osGetButtonText(WindowHandle button) ! { ! return fromMnemonicString(gtk_button_get_label(GTK_BUTTON(button))); ! }; ! ! void osSetButtonText(WindowHandle button, char *txt) ! { ! gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_toplevel(button); ! gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); ! rfree(szText); ! }; ! ! void osChangeButtonFont(WindowHandle button, FontHandle font) ! { ! gtk_widget_modify_font(button, font->font_descr); ! handleWindowReLayout(gtk_widget_get_toplevel(button)); ! }; Index: EditBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/EditBox.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EditBox.c 26 Mar 2003 19:18:12 -0000 1.6 --- EditBox.c 26 Mar 2003 22:09:56 -0000 1.7 *************** *** 56,57 **** --- 56,64 ---- return gtk_entry_get_visibility(GTK_ENTRY(entry)); } + + void osChangeEditBoxFont(WindowHandle entry, FontHandle font) + { + gtk_widget_modify_font(entry, font->font_descr); + // pango_layout_set_font_description(gtk_entry_get_layout(GTK_ENTRY(entry)), font->font_descr); + handleWindowReLayout(gtk_widget_get_toplevel(entry)); + }; Index: Label.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Label.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Label.c 10 Feb 2003 22:42:09 -0000 1.3 --- Label.c 26 Mar 2003 22:09:56 -0000 1.4 *************** *** 1,44 **** ! #include <Types.h> ! #include <Label.h> ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! ! WindowHandle osCreateLabel(WindowHandle window) ! { ! GtkWidget *text; ! ! text = gtk_label_new(""); ! gtk_label_set_line_wrap(GTK_LABEL(text), gtk_false()); ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GetSW(window)->child)->child), text, 0, 0); ! gtk_widget_show(text); ! return text; ! }; ! ! void osGetLabelReqSize(WindowHandle label, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(label, &w,&h); ! gtk_widget_set_size_request(label, -1,-1); ! gtk_widget_size_request(label, &requisition); ! gtk_widget_set_size_request(label, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! } ! ! char *osGetLabelText(WindowHandle label) ! { ! return fromMnemonicString(gtk_label_get_text(GTK_LABEL(label))); ! }; ! ! void osSetLabelText(WindowHandle label, char *txt) ! { ! gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_toplevel(label); ! gtk_label_set_text_with_mnemonic(GTK_LABEL(label), szText); ! handleWindowReLayout(window); ! rfree(szText); ! }; --- 1,51 ---- ! #include <Types.h> ! #include <Label.h> ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! ! WindowHandle osCreateLabel(WindowHandle window) ! { ! GtkWidget *text; ! ! text = gtk_label_new(""); ! gtk_label_set_line_wrap(GTK_LABEL(text), gtk_false()); ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GetSW(window)->child)->child), text, 0, 0); ! gtk_widget_show(text); ! return text; ! }; ! ! void osGetLabelReqSize(WindowHandle label, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(label, &w,&h); ! gtk_widget_set_size_request(label, -1,-1); ! gtk_widget_size_request(label, &requisition); ! gtk_widget_set_size_request(label, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! } ! ! char *osGetLabelText(WindowHandle label) ! { ! return fromMnemonicString(gtk_label_get_text(GTK_LABEL(label))); ! }; ! ! void osSetLabelText(WindowHandle label, char *txt) ! { ! gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_toplevel(label); ! gtk_label_set_text_with_mnemonic(GTK_LABEL(label), szText); ! handleWindowReLayout(window); ! rfree(szText); ! }; ! ! void osChangeLabelFont(WindowHandle label, FontHandle font) ! { ! gtk_widget_modify_font(label, font->font_descr); ! //pango_layout_set_font_description(gtk_label_get_layout(GTK_LABEL(label)), font->font_descr); ! handleWindowReLayout(gtk_widget_get_toplevel(label)); ! }; |