ARB
Classes | Typedefs | Functions | Variables
item_sel_list.cxx File Reference
#include "item_sel_list.h"
#include <arbdbt.h>
#include <ad_cb.h>
#include <arb_defs.h>
#include <arb_global_defs.h>
#include <aw_root.hxx>
#include <aw_awar.hxx>
#include <aw_msg.hxx>
#include <awt_sel_boxes.hxx>
#include <map>
Include dependency graph for item_sel_list.cxx:

Go to the source code of this file.

Classes

class  RegFieldSelection
 

Typedefs

typedef map< string,
RegFieldSelection
FieldSelectionRegistry
 

Functions

const charget_itemfield_type_awarname (const char *itemfield_awarname)
 
const charprepare_and_get_selected_itemfield (AW_root *awr, const char *awar_name, GBDATA *gb_main, const ItemSelector &itemtype, FailIfField failIf)
 
static void fieldname_changed_cb (AW_root *awr, RegFieldSelection *fsel)
 
static void fieldtype_changed_cb (AW_root *awr, RegFieldSelection *fsel)
 
static void popup_field_selection (AW_window *aw_parent, RegFieldSelection *fsel)
 
void create_itemfield_selection_button (AW_window *aws, const FieldSelDef &selDef, const char *at)
 
Itemfield_Selectioncreate_itemfield_selection_list (AW_window *aws, const FieldSelDef &selDef, const char *at)
 

Variables

const int FIELDNAME_VISIBLE_CHARS = 20
 
const int NEWFIELD_EXTRA_SPACE = 13
 
struct {
   GB_TYPES   type
 
   const char *   label
 
   const char *   mnemonic
 
   const char *   typeName
 
creatable []
 
static bool fieldtype_change_warning = true
 

Typedef Documentation

Definition at line 128 of file item_sel_list.cxx.

Function Documentation

const char* get_itemfield_type_awarname ( const char itemfield_awarname)

returns the corresponding type-awar for an itemfield_awarname. Only returns an awarname if

  • itemfield_awarname was used in create_itemfield_selection_button and
  • new fields are allowed there returns NULp otherwise.

Definition at line 215 of file item_sel_list.cxx.

References RegFieldSelection::find(), RegFieldSelection::get_type_awarname(), RegFieldSelection::new_fields_allowed(), NULp, and registered.

Referenced by SpeciesFlag::prepare_itemfield(), and setup_modify_fields_config().

const char* prepare_and_get_selected_itemfield ( AW_root awr,
const char awar_name,
GBDATA gb_main,
const ItemSelector itemtype,
FailIfField  failIf 
)

Reads awar used in create_itemfield_selection_button().

If the user selected to create a new itemfield, the changekey is created.

Parameters
awrapp root
awar_namename of awar used for create_itemfield_selection_button()
gb_maindatabase
itemtypeitem type
failIftoggles various error conditions (defaults to FIF_STANDARD)
Returns
name of the itemfield or NULp

When NULp is returned

  • an error IS ALWAYS exported if (failIf&FIF_NO_FIELD_SELECTED), which is included in FIF_STANDARD!
  • an error MAY BE exported otherwise (use GB_have_error() in that case)

Definition at line 230 of file item_sel_list.cxx.

References AW_root::awar(), MutableItemSelector::change_key_path, error(), FIF_NAME_SELECTED, FIF_NO_FIELD_SELECTED, RegFieldSelection::find(), GB_check_hkey(), GB_export_error(), GB_have_error(), GB_NONE, GBS_global_string(), GBT_add_new_changekey_to_keypath(), RegFieldSelection::get_def(), FieldSelDef::get_described_field(), RegFieldSelection::get_field_awarname(), RegFieldSelection::get_keytype(), RegFieldSelection::get_selected_type(), FieldSelDef::get_type_filter(), it_assert, RegFieldSelection::new_fields_allowed(), NO_FIELD_SELECTED, NULp, AW_awar::read_char_pntr(), and type.

Referenced by awtc_nn_search_all_listed(), calc_and_update_alignment_errors_cb(), mark_action(), mergeSimilarSpecies(), mg_check_field_cb(), modify_fields_of_queried_cb(), SpeciesFlag::prepare_itemfield(), set_field_of_queried_cb(), and st_check_cb().

static void fieldname_changed_cb ( AW_root awr,
RegFieldSelection fsel 
)
static
static void fieldtype_changed_cb ( AW_root awr,
RegFieldSelection fsel 
)
static
static void popup_field_selection ( AW_window aw_parent,
RegFieldSelection fsel 
)
static
void create_itemfield_selection_button ( AW_window aws,
const FieldSelDef selDef,
const char at 
)

Create a button that pops up a window allowing to select an item-field. Field may exist or not. Allows to specify type of the new field in the latter case.

Parameters
awsparent window
selDefspecifies details of field selection
atxfig label (ignored if NULp)

The length of the button is hardcoded and depends on whether new fields are possible or not. Nevertheless you may override its size by defining an at-label with 'to:'-position in xfig.

At start of field-writing code:

For each item written to:

Definition at line 534 of file item_sel_list.cxx.

References AW_window::at(), AW_window::button_length(), AW_window::callback(), AW_window::create_button(), GBS_global_string(), GBS_string_eval(), FieldSelDef::get_awarname(), RegFieldSelection::get_button_awarname(), AW_window::get_button_length(), RegFieldSelection::get_field_awarname(), AW_window::get_root(), FieldSelDef::new_fields_allowed(), popup_field_selection(), and RegFieldSelection::registrate().

Referenced by create_group_species_by_field_window(), create_mg_check_fields_window(), create_mg_merge_tagged_fields_window(), create_modify_fields_window(), create_next_neighbours_listed_window(), QUERY::create_query_box(), RefEntries::create_refentries_window(), create_writeFieldOfListed_window(), createDisplayField_window(), createMergeSimilarSpeciesWindow(), ItemFieldShader::customize(), ED4_configure_species_flags(), ED4_popup_detect_bad_alignment_window(), GEN_open_nds_window(), NDS_create_window(), NT_create_compare_taxonomy_window(), NT_create_resort_window(), NT_create_species_join_window(), popup_single_field_transfer_window(), and STAT_create_chimera_check_window().

Itemfield_Selection* create_itemfield_selection_list ( AW_window aws,
const FieldSelDef selDef,
const char at 
)

Create a selection list allowing to select an item-field. Similar to create_itemfield_selection_button().

Differences:

  • returns Itemfield_Selection -> allows to query list of fields (e.g. used in "Reorder fields")
  • does not allow to select a new, not yet existing field

Definition at line 567 of file item_sel_list.cxx.

References AW_window::at(), FieldSelDef::build_sel(), AW_window::create_selection_list(), FieldSelDef::get_awarname(), AW_window::get_root(), it_assert, FieldSelDef::new_fields_allowed(), AW_selection::refresh(), and RegFieldSelection::registrate().

Referenced by create_field_convert_window(), DBUI::create_field_delete_window(), DBUI::create_fields_reorder_window(), and create_set_protection_window().

Variable Documentation

const int FIELDNAME_VISIBLE_CHARS = 20

Definition at line 113 of file item_sel_list.cxx.

const int NEWFIELD_EXTRA_SPACE = 13

Definition at line 114 of file item_sel_list.cxx.

GB_TYPES type

Definition at line 117 of file item_sel_list.cxx.

Referenced by AW_window::_create_option_entry(), References::add_dbid(), GB_MAIN_TYPE::add_hierarchy_cb(), aisc_collect_sets(), aisc_create(), aisc_debug_info(), aisc_get(), aisc_nput(), aisc_put(), aisc_talking_get(), aisc_talking_sets(), aps_correct_filename(), SelectedDatabase::arg_type(), ED4_block::autocorrect_type(), AW_widget_refresh_cb::AW_widget_refresh_cb(), awt_add_sequences_to_list(), AWT_getItemType(), awtc_nn_search_all_listed(), build_rule_from_awars(), calc_method_changed_cb(), calculate_sai_cb(), ED4_terminal::changed_by_database(), checkAndMergeFields(), colstat_2_gnuplot_cb(), CON_calc_max_freq(), copy_field_into_partial_alignments(), QUERY::copy_selection_list_2_query_box(), create_loadsave_colored_window(), create_new_species(), AW_window::create_selection_list(), RegFieldSelection::create_window(), detectLinkType(), di_save_matrix_cb(), diff_type_changed_cb(), BootstrapConfig::display_remark(), ED4_popup_search_window(), ed_submit_info_event(), edit_SAI_description(), AP_filter::enable_simplify(), FeatureLine::FeatureLine(), field_convert_update_typesel_cb(), field_create_cb(), filter_columnstat_SAIs(), filter_posvar_SAI_for_ali(), gb_copy_explicit(), GB_create(), gb_create_dictionaries(), gb_expect_type(), GB_find_subcontent_by_quark(), gb_find_value_equal(), gb_info(), gb_make_entry(), gb_parse_ascii_rek(), gb_read_bin_rek_V2(), gb_read_pntr_ts(), GB_request_undo_type(), gb_search_system_folder_rek(), gb_set_undo_type(), GB_type_2_char(), GB_TYPES_2_name(), gb_write_bin_rek(), GB_write_pntr(), gbcm_read_bin(), gbcms_talking_find(), GBL_IMPL::gbl_new_param(), gbl_read_seq_sai_or_species(), GBT_check_alignment(), GBT_get_type_of_changekey(), gbt_scan_db_rek(), gbt_scan_db_start(), GBT_searchOrCreate_itemfield_according_to_changekey(), gde_filter_weights(), ED4_root::generate_window(), ED4_SearchResults::get_first_at(), ED4_SearchResults::get_first_starting_after(), ED4_SearchResults::get_last_starting_before(), FINAL_TYPE< SEQTYPE >::get_NDS_Type(), ED4_SearchResults::get_shown_at(), ED4_block::get_type(), Ostring::get_type(), Parameter::get_type(), SelectedDatabase::get_type(), FINAL_TYPE< SEQTYPE >::get_type(), DI_GLOBAL_MATRIX::has_type(), has_unsaved_sons(), InitNASeq(), KeySorter::KeySorter(), load_search_paras_from_file(), FieldTransfer::Rule::makeFromConfig(), MG_save_cb(), MG_transfer_species(), nt_species_join(), parse_intype(), parse_outtype(), parse_type(), parseSection(), perform_query_cb(), prepare_and_get_selected_itemfield(), SpeciesFlag::prepare_itemfield(), SequenceHandler::read_char_pntr(), registerType(), FeatureLine::reinterpret_as_continued_line(), GB_MAIN_TYPE::remove_hierarchy_cb(), ReplaceArgs(), saicalc_edit_method_cb(), save_search_paras_to_file(), QUERY::search_duplicated_field_content(), EDB_root_bact::search_sequence_data_rek(), searchParamsChanged(), SequenceHandler::SequenceHandler(), GEN_graphic::set_display_style(), ED4_block::set_type(), ED4_SearchResults::setNewSearch(), split_data_into_parts(), SQ_add_changekeys(), sq_calc_seq_quality_cb(), FieldTransfer::str2type(), ED4_block::toggle_type(), RegFieldSelection::update_button_text(), and DBwriter::writeFeature().

const char* label
const char* mnemonic
const char* typeName

Definition at line 120 of file item_sel_list.cxx.

Referenced by RegFieldSelection::update_button_text().

struct { ... } creatable[]
Initial value:
= {
{ GB_INT, "Rounded numerical", "i", "INT" },
{ GB_FLOAT, "Floating-point n.", "F", "FLOAT" },
{ GB_STRING, "Ascii text", "s", "STRING" }
}
Definition: arbdb.h:67
Definition: arbdb.h:66

Referenced by RegFieldSelection::create_window(), RegFieldSelection::get_unmated_type(), and RegFieldSelection::update_button_text().

bool fieldtype_change_warning = true
static

Definition at line 376 of file item_sel_list.cxx.

Referenced by fieldtype_changed_cb(), and RegFieldSelection::init_awars().