Re: PATCH: Compose Coordinates *FINAL 3*
- From: christophe barbe <christophe barbe ml online fr>
- To: Ali Akcaagac <ali akcaagac stud fh-wilhelmshaven de>
- Cc: balsa-list gnome org
- Subject: Re: PATCH: Compose Coordinates *FINAL 3*
- Date: Tue, 21 Aug 2001 23:34:23 +0200
Ali,
I've tested your patch. It's really nice except that I've a 800x600 screen
and I can't see the first cell.
The problem is that you have used usize to set the cell size (and they are
oversize).
This is a big problem because I can't resize the compose window to my
prefered size and the window is two times larger that the width needed for
the text (for my settings, my font choice).
So I prefer the new look buf I hate usize and then I prefer the previous
patch.
I understand this was a hard work (It takes me several days to add a little
option in the preferences DB) but I think you prefer to know it now.
Would it be possible to decrease the cell size?
Ideally avoid usize and if not possible use the width of "Words: 8888" ....
Would it be possible to put tha status bar in a container to allow the user
to resize its compose window up to 0 even if the whole status bar can be
displayed ?
Thank you for your work and sorry for my feedback,
I really appreciate it,
Christophe
Le 2001.08.21 21:32:59 +0200, Ali Akcaagac a écrit :
> hi,
>
> no big comments, just look at the windowcapture and apply
> the patch to the most recent CVS you get :)
>
> comments, hints, ideas, wishes, ..... you know what to do :)
>
> /me has the feeling that this aint be the last patch :)
>
> --
> Name....: Ali Akcaagac
> Status..: Student Of Computer & Economic Science
> E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
> WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
>
> --- /mnt/private/temp/cvstree/balsa/src/sendmsg-window.c Tue Aug
> 21 15:06:23 2001
> +++ balsa/src/sendmsg-window.c Tue Aug 21 21:21:07 2001
> @@ -76,6 +76,12 @@
>
> #define GNOME_MIME_BUG_WORKAROUND 1
>
> +/* setup statusbar related things */
> +GnomeAppBar *appbar2;
> +
> +GtkWidget *frame1, *frame2, *frame3, *frame4, *frame5, *frame6;
> +GtkWidget *label1, *label2, *label3, *label4, *label5, *label6;
> +
> static gchar *read_signature(BalsaSendmsg *msg);
> static gint include_file_cb(GtkWidget *, BalsaSendmsg *);
> static gint send_message_cb(GtkWidget *, BalsaSendmsg *);
> @@ -118,6 +124,8 @@
>
> static void sw_size_alloc_cb(GtkWidget * window, GtkAllocation * alloc);
>
> +static gint balsa_key_press_event_cb(GtkWidget *widget, GdkEventKey
> *event, gpointer data);
> +
> /* Standard DnD types */
> enum {
> TARGET_URI_LIST,
> @@ -1160,6 +1168,12 @@
> GtkWidget *table;
>
> msg->text = gtk_text_new(NULL, NULL);
> +
> + gtk_signal_connect_after(GTK_OBJECT(msg->text), "key_press_event",
> + GTK_SIGNAL_FUNC(balsa_key_press_event_cb),
> msg);
> + gtk_signal_connect_after(GTK_OBJECT(msg->text), "map_event",
> + GTK_SIGNAL_FUNC(balsa_key_press_event_cb),
> msg);
> +
> gtk_text_set_editable(GTK_TEXT(msg->text), TRUE);
> gtk_text_set_word_wrap(GTK_TEXT(msg->text), TRUE);
> balsa_spell_check_set_text(BALSA_SPELL_CHECK(msg->spell_checker),
> @@ -1176,6 +1190,132 @@
> return table;
> }
>
> +static gint
> +balsa_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer
> data)
> +{
> + gchar *message = NULL;
> + gchar *symbol = NULL;
> + gchar *statustext = NULL;
> + gchar *charstext = NULL;
> + gchar *sizetext = NULL;
> + gchar *wordstext = NULL;
> + gchar *linestext = NULL;
> + gchar *indextext = NULL;
> + gchar *coordstext = NULL;
> +
> + gint index = 0;
> +
> + int lines = 1;
> + int rows = 1;
> + int words = 0;
> + int size = 0;
> + int x = 1;
> + int y = 1;
> +
> + int hexval = 0;
> + int wordflag = 0;
> +
> + /* initialize the power-ascii-table for chars < 0x20 */
> + gchar *lowsymbols[] = {
> + N_("Null"), N_("Start of Heading"),
> + N_("Start of Text"), N_("End of Text"),
> + N_("End of Transmission"), N_("Enquiry"),
> + N_("Acknowledge"), N_("Bell"),
> + N_("Backspace"), N_("Horizontal Tabulation"),
> + N_("Line Feed"), N_("Vertical Tabulation"),
> + N_("Form Feed"), N_("Carriage Return"),
> + N_("Shift Out"), N_("Shift In"),
> + N_("Data Link Escape"), N_("Device Control 1"),
> + N_("Device Control 2"), N_("Device Control 3"),
> + N_("Device Control 4"), N_("Negative
> Acknowledge"),
> + N_("Synchronous Idle"), N_("End of Transmission
> Block"),
> + N_("Cancel"), N_("End of Medium"),
> + N_("Substitute"), N_("Escape"),
> + N_("File Separator"), N_("Group Separator"),
> + N_("Record Separator"), N_("Unit Separator")
> + };
> +
> + /* get the message body */
> + message = gtk_editable_get_chars(GTK_EDITABLE(GTK_TEXT(((BalsaSendmsg
> *) data)->text)), 0, -1);
> +
> + /* get the index of the cursor */
> + index = gtk_editable_get_position(GTK_EDITABLE(GTK_TEXT(((BalsaSendmsg
> *) data)->text)));
> +
> + /* lines: get the total lines of the message */
> + /* words: get the total words of the message */
> + /* size: get the total size of the message */
> + /* x/y: get the x/y origin within the message */
> + while (message[size] != '\0') {
> + if (message[size] == '\n') {
> + lines++;
> + rows = 1;
> + } else {
> + rows++;
> + }
> +
> + if (message[size] == '\n' || message[size] == '\t'||
> message[size] == ' ') {
> + wordflag = 0;
> + } else if (wordflag == 0) {
> + wordflag = 1;
> + words++;
> + }
> +
> + if (size < (int)index) {
> + x = rows;
> + y = lines;
> + }
> +
> + size++;
> + }
> +
> + /* get the symbol within the text and the hexval */
> + hexval = message[(int)index];
> + symbol = g_strdup_printf("%c", hexval);
> +
> + if (hexval <= 0x1f && hexval >= 0x00) {
> + g_free(symbol);
> + symbol = lowsymbols[hexval];
> + }
> +
> + /* output the stuff to the appbar */
> + if (hexval <= 0x1f && hexval >= 0x00) {
> + statustext = g_strdup_printf(_("%s"), symbol);
> + charstext = g_strdup_printf(_("Char: 0x%X"), hexval);
> + } else {
> + statustext = g_strdup("");
> + charstext = g_strdup_printf(_("Char: 0x%X => '%s'"), hexval,
> symbol);
> + }
> +
> + gnome_appbar_set_default(appbar2, statustext);
> + gtk_label_set(GTK_LABEL(label1), charstext);
> +
> + sizetext = g_strdup_printf(_("Size: %d bytes"), size);
> + gtk_label_set(GTK_LABEL(label2), sizetext);
> +
> + wordstext = g_strdup_printf(_("Words: %d"), words);
> + gtk_label_set(GTK_LABEL(label3), wordstext);
> +
> + linestext = g_strdup_printf(_("Lines: %d"), lines);
> + gtk_label_set(GTK_LABEL(label4), linestext);
> +
> + indextext = g_strdup_printf(_("Index: %d"), (int)index);
> + gtk_label_set(GTK_LABEL(label5), indextext);
> +
> + coordstext = g_strdup_printf(_("X/Y: %d/%d"), x, y);
> + gtk_label_set(GTK_LABEL(label6), coordstext);
> +
> + g_free(message);
> + g_free(statustext);
> + g_free(charstext);
> + g_free(sizetext);
> + g_free(wordstext);
> + g_free(linestext);
> + g_free(indextext);
> + g_free(coordstext);
> +
> + return TRUE;
> +}
> +
> /* continueBody ---------------------------------------------------------
> a short-circuit procedure for the 'Continue action'
> basically copies the text over to the entry field.
> @@ -1523,6 +1663,76 @@
> /* create text area for the message */
> gtk_paned_add2(GTK_PANED(paned), create_text_area(msg));
>
> + /* FIXME: create statusbar, this is only temporarely and needs fix
> */
> + appbar2 = GNOME_APPBAR(gnome_appbar_new(FALSE, TRUE,
> GNOME_PREFERENCES_USER));
> + gnome_app_set_statusbar(GNOME_APP(window), GTK_WIDGET(appbar2));
> +
> + /* FIXME: set a new statusbarcell */
> + frame1 = gtk_frame_new(NULL);
> + gtk_frame_set_shadow_type(GTK_FRAME(frame1), GTK_SHADOW_IN);
> + label1 = gtk_label_new("");
> + gtk_misc_set_alignment(GTK_MISC(label1), 0.5, 0.5);
> + gtk_widget_set_usize(GTK_WIDGET(label1),
> gdk_string_width(gtk_widget_get_style(GTK_WIDGET(label1))->font,
> "####################"), -1);
> + gtk_container_add(GTK_CONTAINER(frame1), GTK_WIDGET(label1));
> + gtk_box_pack_start(GTK_BOX(appbar2), GTK_WIDGET(frame1), FALSE,
> TRUE, 0);
> + gtk_widget_show(frame1);
> + gtk_widget_show(label1);
> +
> + /* FIXME: set a new statusbarcell */
> + frame2 = gtk_frame_new(NULL);
> + gtk_frame_set_shadow_type(GTK_FRAME(frame2), GTK_SHADOW_IN);
> + label2 = gtk_label_new("");
> + gtk_misc_set_alignment(GTK_MISC(label2), 0.5, 0.5);
> + gtk_widget_set_usize(GTK_WIDGET(label2),
> gdk_string_width(gtk_widget_get_style(GTK_WIDGET(label2))->font,
> "####################"), -1);
> + gtk_container_add(GTK_CONTAINER(frame2), GTK_WIDGET(label2));
> + gtk_box_pack_start(GTK_BOX(appbar2), GTK_WIDGET(frame2), FALSE,
> TRUE, 0);
> + gtk_widget_show(frame2);
> + gtk_widget_show(label2);
> +
> + /* FIXME: set a new statusbarcell */
> + frame3 = gtk_frame_new(NULL);
> + gtk_frame_set_shadow_type(GTK_FRAME(frame3), GTK_SHADOW_IN);
> + label3 = gtk_label_new("");
> + gtk_misc_set_alignment(GTK_MISC(label3), 0.5, 0.5);
> + gtk_widget_set_usize(GTK_WIDGET(label3),
> gdk_string_width(gtk_widget_get_style(GTK_WIDGET(label3))->font,
> "###############"), -1);
> + gtk_container_add(GTK_CONTAINER(frame3), GTK_WIDGET(label3));
> + gtk_box_pack_start(GTK_BOX(appbar2), GTK_WIDGET(frame3), FALSE,
> TRUE, 0);
> + gtk_widget_show(frame3);
> + gtk_widget_show(label3);
> +
> + /* FIXME: set a new statusbarcell */
> + frame4 = gtk_frame_new(NULL);
> + gtk_frame_set_shadow_type(GTK_FRAME(frame4), GTK_SHADOW_IN);
> + label4 = gtk_label_new("");
> + gtk_misc_set_alignment(GTK_MISC(label4), 0.5, 0.5);
> + gtk_widget_set_usize(GTK_WIDGET(label4),
> gdk_string_width(gtk_widget_get_style(GTK_WIDGET(label4))->font,
> "###############"), -1);
> + gtk_container_add(GTK_CONTAINER(frame4), GTK_WIDGET(label4));
> + gtk_box_pack_start(GTK_BOX(appbar2), GTK_WIDGET(frame4), FALSE,
> TRUE, 0);
> + gtk_widget_show(frame4);
> + gtk_widget_show(label4);
> +
> + /* FIXME: set a new statusbarcell */
> + frame5 = gtk_frame_new(NULL);
> + gtk_frame_set_shadow_type(GTK_FRAME(frame5), GTK_SHADOW_IN);
> + label5 = gtk_label_new("");
> + gtk_misc_set_alignment(GTK_MISC(label5), 0.5, 0.5);
> + gtk_widget_set_usize(GTK_WIDGET(label5),
> gdk_string_width(gtk_widget_get_style(GTK_WIDGET(label5))->font,
> "###############"), -1);
> + gtk_container_add(GTK_CONTAINER(frame5), GTK_WIDGET(label5));
> + gtk_box_pack_start(GTK_BOX(appbar2), GTK_WIDGET(frame5), FALSE,
> TRUE, 0);
> + gtk_widget_show(frame5);
> + gtk_widget_show(label5);
> +
> + /* FIXME: set a new statusbarcell */
> + frame6 = gtk_frame_new(NULL);
> + gtk_frame_set_shadow_type(GTK_FRAME(frame6), GTK_SHADOW_IN);
> + label6 = gtk_label_new("");
> + gtk_misc_set_alignment(GTK_MISC(label6), 0.5, 0.5);
> + gtk_widget_set_usize(GTK_WIDGET(label6),
> gdk_string_width(gtk_widget_get_style(GTK_WIDGET(label6))->font,
> "###############"), -1);
> + gtk_container_add(GTK_CONTAINER(frame6), GTK_WIDGET(label6));
> + gtk_box_pack_start(GTK_BOX(appbar2), GTK_WIDGET(frame6), FALSE,
> TRUE, 0);
> + gtk_widget_show(frame6);
> + gtk_widget_show(label6);
> +
> /* fill in that info: */
>
> /* To: */
>
--
Christophe Barbé <christophe.barbe@online.fr>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]