Esempio n. 1
0
void disp_char(int index, char *ch)
{
  if (gcin_edit_display_ap_only())
    return;
  if (!top_bin)
    return;

//  dbg("disp_char %d %s\n", index, ch);
  create_char(index);
  GtkWidget *label = chars[index].label;

  if (label) {
    if (ch[0]==' ' && ch[1]==' ')
      set_label_space(label);
    else {
      gtk_label_set_text(GTK_LABEL(label), ch);
    }
  }

#if GTK_CHECK_VERSION(3,0,0)
    // bug in gtk3
    set_label_font_size(label, gcin_font_size);
#endif

  get_win0_geom();
  if (win_x + win_xl >= dpy_xl)
    move_win0(dpy_xl - win_xl, win_y);

  gtk_widget_show_all(chars[index].vbox);
}
Esempio n. 2
0
void disp_selections(int x, int y)
{
  if (!gwin1)
    p_err("disp_selections !gwin1");

  if (y < 0) {
	 int tx;
	 if (gcin_edit_display_ap_only())
		getRootXY(current_CS->client_win, current_CS->spot_location.x, current_CS->spot_location.y, &tx, &y);
	 else
		 y = win_y + win_yl;
  }

  int win1_xl, win1_yl;
  get_win_size(gwin1, &win1_xl, &win1_yl);

  if (x < 0) {
    x = win_x + win_xl - win1_xl;
    if (x < win_x)
      x = win_x;
  }

  if (x + win1_xl > dpy_xl)
    x = dpy_xl - win1_xl;

  if (y + win1_yl > dpy_yl)
    y = win_y - win1_yl;
    
  if (y < 0)
    y = 0;

  gtk_window_move(GTK_WINDOW(gwin1), x, y);

#if WIN32 && 1
  if (!GTK_WIDGET_VISIBLE(gwin1)) {
    gtk_widget_show(gwin1);
  }
#endif

#if WIN32 && 1
#if 0
  if (!timeout_handle)
    timeout_handle = g_timeout_add(100, timeout_minimize_win1, NULL);
#endif
  set_win_pos_size(gwin1, x, y, win1_xl, win1_yl);
  gtk_window_present(GTK_WINDOW(gwin1));
#endif

#if UNIX || 0
  if (!GTK_WIDGET_VISIBLE(gwin1)) {
    gtk_widget_show(gwin1);
  }
#endif
}
Esempio n. 3
0
void set_cursor_tsin(int index)
{
  GtkWidget *label = chars[index].label;

  if (!label)
    return;

  if (gcin_edit_display_ap_only())
    return;

  gtk_label_set_attributes(GTK_LABEL(label), attr_list);
}
Esempio n. 4
0
void disp_tsin_select(int index)
{
  int x,y;
#if WIN32
  if (test_mode)
    return;
#endif

  if (index < 0)
    return;

//  dbg("gcin_edit_display_ap_only() %d\n", gcin_edit_display_ap_only());

  if (gcin_edit_display_ap_only()) {
    getRootXY(current_CS->client_win, current_CS->spot_location.x, current_CS->spot_location.y, &x, &y);
  } else {
#if 1
    int i;
    // bug in GTK, widget position is wrong, repeat util find one
    for(i=index;i>=0; i--) {
      gtk_widget_show_now(chars[i].label);
      gtk_widget_show(chars[i].vbox);
      gtk_main_iteration_do(FALSE);

      int tx = get_widget_xy(gwin0, chars[i].vbox, &x, &y);

      if (tx>=0)
        break;
    }
#else
	get_widget_xy(gwin0, chars[index].vbox, &x, &y);
#endif
	get_win0_geom();
  }
  disp_selections(x, y);
}