Beispiel #1
0
static void disable_correct_hbox()
{
    int is_rgb = get_checked("combine_bands_into_rgb_radiobutton");
    enable_widget("single_band_as_greyscale_hbox", !is_rgb);
    enable_widget("combine_bands_into_rgb_hbox", is_rgb);
    enable_widget("lut_optionmenu", !is_rgb);
}
Beispiel #2
0
static void update_gs_map_settings()
{
  int on;

  on = get_checked("rb_gs_custom");
  enable_widget("hbox_gs_custom_range", on);
  on = get_checked("gs_ignore_range_checkbutton");
  enable_widget("hbox_gs_ignore_range", on);
  on = get_checked("gs_ignore_value_checkbutton");
  enable_widget("hbox_gs_ignore_value", on);
}
Beispiel #3
0
void setup_bands_tab(meta_parameters *meta)
{
    //int multilook, multiband;

    if (!meta ||
            meta->general->band_count == 1 ||
            meta->general->band_count == MAGIC_UNSET_INT ||
            !meta->general->bands ||
            strlen(meta->general->bands) == 0 ||
            strcmp(meta->general->bands, MAGIC_UNSET_STRING) == 0)
    {
        single_band(meta->general->bands);
        //multiband = FALSE;
    }
    else {
        // populate band selectors
        //enable_widget("single_band_as_greyscale_hbox", TRUE);
        //enable_widget("combine_bands_into_rgb_hbox", TRUE);
        populate_combo_csv("red_combobox",
                           meta->general->bands, curr->band_cfg.band_r);
        populate_combo_csv("green_combobox",
                           meta->general->bands, curr->band_cfg.band_g);
        populate_combo_csv("blue_combobox",
                           meta->general->bands, curr->band_cfg.band_b);
        populate_combo_csv("single_band_as_greyscale_combobox",
                           meta->general->bands, curr->band_cfg.band_gs);

        multi_band(meta->general->bands);

        set_checked("combine_bands_into_rgb_radiobutton",
                    curr->band_cfg.is_rgb);
        set_checked("single_band_as_greyscale_radiobutton",
                    !curr->band_cfg.is_rgb);

        disable_correct_hbox();
        //multiband = TRUE;
    }

    //set_checked("multilook_checkbutton", FALSE);
    if (!meta->sar || meta->sar->multilook) {
        //multilook = FALSE;
        enable_widget("multilook_checkbutton", FALSE);
    } else {
        //multilook = TRUE;
        enable_widget("multilook_checkbutton", TRUE);
    }

    //show_widget("hbox_bands_buttons", multilook || multiband);
}
void
test_wheel_axes (gconstpointer data)
{
    GtkWidget *button;
    gint widget_value;
    const gchar *widget_name;
    WheelAxisAssertFunction assert_function;

    widget_name = gcut_data_get_string(data, "widget-name");
    assert_function = gcut_data_get_pointer(data, "assert-function");

    enable_widget("wheel_emulation_box");

    button = get_widget(widget_name);
    cut_assert_true(GTK_IS_CHECK_BUTTON(button));

    cut_assert_equal_int(4, get_scroll_axes_property_of_xinput());
    widget_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
    assert_function(widget_value);

    gtk_test_widget_click(button, 1, 0);
    wait_action();
    cut_assert_equal_int(4, get_scroll_axes_property_of_xinput());
    widget_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
    assert_function(widget_value);
}
void
test_scale (gconstpointer data)
{
    GtkWidget *scale;
    gint widget_value;
    gint xinput_value;
    const gchar *widget_name;
    const gchar *xinput_name;
    const gchar *box_name;

    widget_name = gcut_data_get_string(data, "widget-name");
    xinput_name = gcut_data_get_string(data, "xinput-name");
    box_name = gcut_data_get_string(data, "box-name");

    enable_widget(box_name);

    scale = get_widget(widget_name);
    cut_assert_true(GTK_IS_RANGE(scale));

    xinput_value = get_int_property_of_xinput(xinput_name);
    widget_value = gtk_test_slider_get_value(scale);
    cut_assert_equal_int(xinput_value, widget_value);

    gtk_test_slider_set_perc(scale, 50.0);
    wait_action();
    xinput_value = get_int_property_of_xinput(xinput_name);
    widget_value = gtk_test_slider_get_value(scale);
    cut_assert_equal_int(xinput_value, widget_value);
}
Beispiel #6
0
static void update_save_subset_info()
{
    // "load subset" option is disabed (and set unchecked) when choosing
    // csv, unless we think Excel or some such will be available
    const char *csv = detect_csv_assoc();
    int have_csv_viewer = csv && strlen(csv) > 0;
    int enabled = get_format()!=FORMAT_CSV || have_csv_viewer;
    if (!enabled)
        set_checked("load_saved_subset_checkbutton", FALSE);
    enable_widget("load_saved_subset_checkbutton", enabled);

    // "strict boundary" option is disabled (and set unchecked) when
    // polygon only has 2 points in it (line)
    enabled = g_poly->n > 1;
    if (!enabled)
        set_checked("strict_boundary_checkbutton", FALSE);
    enable_widget("strict_boundary_checkbutton", enabled);
}
Beispiel #7
0
static void
emit_signal_handler (GtkWidget * widget, gpointer data)
{
  ArrayParams *dlg = ARRAY_PARAMS (data);

  if (GTK_TOGGLE_BUTTON (dlg->use_ArrayParams)->active)
    enable_widget (dlg->no_params);
  else
    disable_widget (dlg->no_params);
}
Beispiel #8
0
void
ArrayParams_load_config (ArrayParams * newdlg, tpca_t * test)
{
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (newdlg->use_ArrayParams),
      test->nArrayParSize > 0);
  gtk_adjustment_set_value (GTK_ADJUSTMENT (GTK_SPIN_BUTTON (newdlg->
	      no_params)->adjustment),
      test->nArrayParSize < 10 ? 10 : test->nArrayParSize);

  if (!test->nArrayParSize)
    disable_widget (newdlg->no_params);
  else
    enable_widget (newdlg->no_params);

  newdlg->test = test;
}
void
Snes9xNetplayDialog::update_state ()
{
    if (get_check ("host_radio"))
    {
        enable_widget ("connect_box", FALSE);
        enable_widget ("default_port_box", TRUE);
        enable_widget ("sync_reset", TRUE);
        enable_widget ("send_image", TRUE);
    }

    else
    {
        enable_widget ("connect_box", TRUE);
        enable_widget ("default_port_box", FALSE);
        enable_widget ("sync_reset", FALSE);
        enable_widget ("send_image", FALSE);
    }
}
void
test_wheel_emulation_button (void)
{
    GtkWidget *combo;
    GObject *list_store;
    GtkTreeIter iter;
    GValue value = {0};
    gint widget_value;
    gint xinput_value;

    enable_widget("wheel_emulation_box");

    combo = get_widget("wheel_emulation_button");
    cut_assert_true(GTK_IS_COMBO_BOX(combo));

    xinput_value = get_int_property_of_xinput("Evdev Wheel Emulation Button");
    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
    list_store = get_object("wheel_emulation_button_list_store");
    gtk_tree_model_get_value(GTK_TREE_MODEL(list_store),
                             &iter,
                             0,
                             &value);
    widget_value = g_value_get_int(&value);
    g_value_unset(&value);
    cut_assert_equal_int(xinput_value, widget_value);

    gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 9);
    wait_action();
    xinput_value = get_int_property_of_xinput("Evdev Wheel Emulation Button");
    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
    gtk_tree_model_get_value(GTK_TREE_MODEL(list_store),
                             &iter,
                             0,
                             &value);
    widget_value = g_value_get_int(&value);
    g_value_unset(&value);
    cut_assert_equal_int(xinput_value, widget_value);
}
Beispiel #11
0
void disable_map_tabs(ImageInfo *ii)
{
  if (ii->data_ci->data_type == GREYSCALE_FLOAT ||
      ii->data_ci->data_type == GREYSCALE_BYTE)
  {
    enable_widget("greyscale_label", TRUE);
    enable_widget("greyscale_vbox", TRUE);

    enable_widget("red_label", FALSE);
    enable_widget("red_vbox", FALSE);
    enable_widget("green_label", FALSE);
    enable_widget("green_vbox", FALSE);
    enable_widget("blue_label", FALSE);
    enable_widget("blue_vbox", FALSE);
  }
  else {
    enable_widget("greyscale_label", FALSE);
    enable_widget("greyscale_vbox", FALSE);

    enable_widget("red_label", TRUE);
    enable_widget("red_vbox", TRUE);
    enable_widget("green_label", TRUE);
    enable_widget("green_vbox", TRUE);
    enable_widget("blue_label", TRUE);
    enable_widget("blue_vbox", TRUE);
  }
}