Commit 10ca9c84 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Put the clist inside a scrolled window for the new CList api.

1998-11-23  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/dialog-cell-format.c (create_number_format_page): Put the
	clist inside a scrolled window for the new CList api.

	* src/dialog-define-names.c (dialog_define_names): ditto.

	* src/dialog-goto-cell.c (dialog_goto_cell): ditto
parent 82ad26e1
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
* src/dialog-define-names.c (dialog_define_names): ditto.
* src/dialog-goto-cell.c (dialog_goto_cell): ditto
1998-11-23 Marin Purgar <pmc@iskon.hr>
* src/dialog-cell-format.c: Style general was applied to more
than one cell in various cases.
1998-11-18 Bruno Unna <bruno@iac.com.mx>
* src/style.c: added the default italic font as helvetica-oblique.
......
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
* src/dialog-define-names.c (dialog_define_names): ditto.
* src/dialog-goto-cell.c (dialog_goto_cell): ditto
1998-11-23 Marin Purgar <pmc@iskon.hr>
* src/dialog-cell-format.c: Style general was applied to more
than one cell in various cases.
1998-11-18 Bruno Unna <bruno@iac.com.mx>
* src/style.c: added the default italic font as helvetica-oblique.
......
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
* src/dialog-define-names.c (dialog_define_names): ditto.
* src/dialog-goto-cell.c (dialog_goto_cell): ditto
1998-11-23 Marin Purgar <pmc@iskon.hr>
* src/dialog-cell-format.c: Style general was applied to more
than one cell in various cases.
1998-11-18 Bruno Unna <bruno@iac.com.mx>
* src/style.c: added the default italic font as helvetica-oblique.
......
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
* src/dialog-define-names.c (dialog_define_names): ditto.
* src/dialog-goto-cell.c (dialog_goto_cell): ditto
1998-11-23 Marin Purgar <pmc@iskon.hr>
* src/dialog-cell-format.c: Style general was applied to more
than one cell in various cases.
1998-11-18 Bruno Unna <bruno@iac.com.mx>
* src/style.c: added the default italic font as helvetica-oblique.
......
......@@ -1327,10 +1327,12 @@ cell_draw (Cell *cell, void *sv, GdkGC *gc, GdkDrawable *drawable, int x1, int y
else
do_multi_line = FALSE;
#if 0
if (cell->text)
text = cell->text->str;
else
text = "";
#endif
if (do_multi_line){
GList *lines, *l;
......
......@@ -91,7 +91,7 @@ format_list_fill (int n)
gtk_clist_clear (cl);
for (i = 0; texts [i]; i++){
char *t [1];
const gchar *t [1];
t [0] = _(texts [i]);
......@@ -211,7 +211,6 @@ my_clist_new (void)
cl = GTK_CLIST (gtk_clist_new (1));
gtk_clist_column_titles_hide (cl);
gtk_clist_set_policy (cl, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_clist_set_selection_mode (cl,GTK_SELECTION_SINGLE);
/* Configure the size */
......@@ -236,7 +235,7 @@ static GtkWidget *
create_number_format_page (GtkWidget *prop_win, CellList *cells)
{
StyleFormat *format;
GtkWidget *l;
GtkWidget *l, *scrolled_list;
GtkTable *t, *tt;
int i;
......@@ -257,7 +256,9 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
number_cat_list = my_clist_new ();
gtk_table_attach (t, number_cat_list, 0, 1, BOXES_LINE+1, BOXES_LINE+2,
scrolled_list = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_list), number_cat_list);
gtk_table_attach (t, scrolled_list, 0, 1, BOXES_LINE+1, BOXES_LINE+2,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 4, 0);
/* 1.1 Connect our signal handler */
......@@ -267,7 +268,7 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
/* 1.2 Fill the category list */
gtk_clist_freeze (GTK_CLIST (number_cat_list));
for (i = 0; cell_formats [i].name; i++){
char *text [1] = { _(cell_formats [i].name) };
const gchar *text [1] = { _(cell_formats [i].name) };
gtk_clist_append (GTK_CLIST (number_cat_list), text);
}
......@@ -296,11 +297,13 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
/* 3. Format codes */
number_format_list = my_clist_new ();
scrolled_list = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_list), number_format_list);
gtk_table_attach (t, l = gtk_label_new (_("Format codes")),
1, 2, BOXES_LINE, BOXES_LINE+1,
GTK_FILL | GTK_EXPAND, 0, 0, 0);
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
gtk_table_attach_defaults (t, number_format_list, 1, 2, BOXES_LINE + 1, BOXES_LINE + 2);
gtk_table_attach_defaults (t, scrolled_list, 1, 2, BOXES_LINE + 1, BOXES_LINE + 2);
format_list_fill (0);
/* 3.1 connect the signal handled for row selected */
......@@ -312,8 +315,7 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
if (format){
if (!format_find (format->format))
gtk_entry_set_text (GTK_ENTRY (number_input), format->format);
} else
gtk_clist_select_row (GTK_CLIST (number_format_list), 0, 0);
}
/* 4. finish */
......@@ -327,6 +329,9 @@ apply_number_formats (Style *style, Sheet *sheet, CellList *list)
{
char *str = gtk_entry_get_text (GTK_ENTRY (number_input));
if (!strcmp (str, ""))
return;
for (;list; list = list->next){
Cell *cell = list->data;
......
......@@ -15,7 +15,7 @@ void
dialog_define_names (Workbook *wb)
{
static GtkWidget *dialog;
GtkWidget *l, *box;
GtkWidget *l, *box, *swin;
GtkCList *clist;
GtkEntry *name, *refers;
......@@ -26,8 +26,11 @@ dialog_define_names (Workbook *wb)
_("Add"),
_("Remove"),
NULL);
swin = gtk_scrolled_window_new (NULL, NULL);
clist = (GtkCList *) gtk_clist_new (1);
gtk_container_add (GTK_CONTAINER (swin), GTK_WIDGET (clist));
gtk_clist_column_titles_hide (clist);
name = (GtkEntry *) gtk_entry_new ();
......@@ -40,7 +43,7 @@ dialog_define_names (Workbook *wb)
gtk_box_pack_start (GTK_BOX (box), l, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (name), TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (clist), TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (swin), TRUE, TRUE, 0);
l = gtk_label_new (_("Refers to"));
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
......
......@@ -31,12 +31,13 @@ dialog_goto_cell (Workbook *wb)
{
static GtkWidget *dialog;
static GtkWidget *clist;
static GtkWidget *swin;
static GtkWidget *entry;
char *text;
if (!dialog){
GtkWidget *box;
char *titles [2];
const gchar *titles [2];
titles [0] = _("Cell");
titles [1] = NULL;
......@@ -48,11 +49,10 @@ dialog_goto_cell (Workbook *wb)
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
swin = gtk_scrolled_window_new (NULL, NULL);
clist = gtk_clist_new_with_titles (1, titles);
gtk_clist_set_policy (GTK_CLIST (clist),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (swin), clist);
entry = gtk_entry_new ();
gtk_signal_connect (GTK_OBJECT (entry), "activate",
......@@ -63,7 +63,7 @@ dialog_goto_cell (Workbook *wb)
box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start_defaults (GTK_BOX (box), clist);
gtk_box_pack_start_defaults (GTK_BOX (box), swin);
gtk_box_pack_start_defaults (GTK_BOX (box), entry);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
......@@ -82,7 +82,7 @@ dialog_goto_cell (Workbook *wb)
if (*text){
if (workbook_parse_and_jump (wb, text)){
char *texts [1];
const gchar *texts [1];
texts [0] = text;
......
......@@ -91,7 +91,7 @@ format_list_fill (int n)
gtk_clist_clear (cl);
for (i = 0; texts [i]; i++){
char *t [1];
const gchar *t [1];
t [0] = _(texts [i]);
......@@ -211,7 +211,6 @@ my_clist_new (void)
cl = GTK_CLIST (gtk_clist_new (1));
gtk_clist_column_titles_hide (cl);
gtk_clist_set_policy (cl, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_clist_set_selection_mode (cl,GTK_SELECTION_SINGLE);
/* Configure the size */
......@@ -236,7 +235,7 @@ static GtkWidget *
create_number_format_page (GtkWidget *prop_win, CellList *cells)
{
StyleFormat *format;
GtkWidget *l;
GtkWidget *l, *scrolled_list;
GtkTable *t, *tt;
int i;
......@@ -257,7 +256,9 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
number_cat_list = my_clist_new ();
gtk_table_attach (t, number_cat_list, 0, 1, BOXES_LINE+1, BOXES_LINE+2,
scrolled_list = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_list), number_cat_list);
gtk_table_attach (t, scrolled_list, 0, 1, BOXES_LINE+1, BOXES_LINE+2,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 4, 0);
/* 1.1 Connect our signal handler */
......@@ -267,7 +268,7 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
/* 1.2 Fill the category list */
gtk_clist_freeze (GTK_CLIST (number_cat_list));
for (i = 0; cell_formats [i].name; i++){
char *text [1] = { _(cell_formats [i].name) };
const gchar *text [1] = { _(cell_formats [i].name) };
gtk_clist_append (GTK_CLIST (number_cat_list), text);
}
......@@ -296,11 +297,13 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
/* 3. Format codes */
number_format_list = my_clist_new ();
scrolled_list = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_list), number_format_list);
gtk_table_attach (t, l = gtk_label_new (_("Format codes")),
1, 2, BOXES_LINE, BOXES_LINE+1,
GTK_FILL | GTK_EXPAND, 0, 0, 0);
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
gtk_table_attach_defaults (t, number_format_list, 1, 2, BOXES_LINE + 1, BOXES_LINE + 2);
gtk_table_attach_defaults (t, scrolled_list, 1, 2, BOXES_LINE + 1, BOXES_LINE + 2);
format_list_fill (0);
/* 3.1 connect the signal handled for row selected */
......@@ -312,8 +315,7 @@ create_number_format_page (GtkWidget *prop_win, CellList *cells)
if (format){
if (!format_find (format->format))
gtk_entry_set_text (GTK_ENTRY (number_input), format->format);
} else
gtk_clist_select_row (GTK_CLIST (number_format_list), 0, 0);
}
/* 4. finish */
......@@ -327,6 +329,9 @@ apply_number_formats (Style *style, Sheet *sheet, CellList *list)
{
char *str = gtk_entry_get_text (GTK_ENTRY (number_input));
if (!strcmp (str, ""))
return;
for (;list; list = list->next){
Cell *cell = list->data;
......
......@@ -15,7 +15,7 @@ void
dialog_define_names (Workbook *wb)
{
static GtkWidget *dialog;
GtkWidget *l, *box;
GtkWidget *l, *box, *swin;
GtkCList *clist;
GtkEntry *name, *refers;
......@@ -26,8 +26,11 @@ dialog_define_names (Workbook *wb)
_("Add"),
_("Remove"),
NULL);
swin = gtk_scrolled_window_new (NULL, NULL);
clist = (GtkCList *) gtk_clist_new (1);
gtk_container_add (GTK_CONTAINER (swin), GTK_WIDGET (clist));
gtk_clist_column_titles_hide (clist);
name = (GtkEntry *) gtk_entry_new ();
......@@ -40,7 +43,7 @@ dialog_define_names (Workbook *wb)
gtk_box_pack_start (GTK_BOX (box), l, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (name), TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (clist), TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (swin), TRUE, TRUE, 0);
l = gtk_label_new (_("Refers to"));
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
......
......@@ -31,12 +31,13 @@ dialog_goto_cell (Workbook *wb)
{
static GtkWidget *dialog;
static GtkWidget *clist;
static GtkWidget *swin;
static GtkWidget *entry;
char *text;
if (!dialog){
GtkWidget *box;
char *titles [2];
const gchar *titles [2];
titles [0] = _("Cell");
titles [1] = NULL;
......@@ -48,11 +49,10 @@ dialog_goto_cell (Workbook *wb)
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
swin = gtk_scrolled_window_new (NULL, NULL);
clist = gtk_clist_new_with_titles (1, titles);
gtk_clist_set_policy (GTK_CLIST (clist),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (swin), clist);
entry = gtk_entry_new ();
gtk_signal_connect (GTK_OBJECT (entry), "activate",
......@@ -63,7 +63,7 @@ dialog_goto_cell (Workbook *wb)
box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start_defaults (GTK_BOX (box), clist);
gtk_box_pack_start_defaults (GTK_BOX (box), swin);
gtk_box_pack_start_defaults (GTK_BOX (box), entry);
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
......@@ -82,7 +82,7 @@ dialog_goto_cell (Workbook *wb)
if (*text){
if (workbook_parse_and_jump (wb, text)){
char *texts [1];
const gchar *texts [1];
texts [0] = text;
......
......@@ -26,7 +26,7 @@ typedef struct
static void
add_to_clist (PluginData *pd, GtkWidget *clist)
{
gchar *data[2];
const gchar *data[2];
gint row;
data [0] = pd->title;
......@@ -90,8 +90,8 @@ GtkWidget *
plugin_manager_new (void)
{
PluginManager *pm;
gchar *n_titles[2] = { N_("Name"), N_("File") };
gchar *titles[2] = { N_("Name"), N_("File") };
const gchar *n_titles[2] = { N_("Name"), N_("File") };
const gchar *titles[2] = { N_("Name"), N_("File") };
pm = g_new0 (PluginManager, 1);
if (!pm)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment