ARB
Classes | Macros | Enumerations | Functions | Variables
item_sel_list.h File Reference
#include <aw_select.hxx>
#include "items.h"
#include <string>
Include dependency graph for item_sel_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Itemfield_Selection
 
class  FieldSelDef
 

Macros

#define PSEUDO_FIELD_ANY_FIELD   "[any field]"
 
#define PSEUDO_FIELD_ALL_FIELDS   "[all fields]"
 
#define PSEUDO_FIELD_ANY_FIELD_REC   "[any recursive]"
 
#define PSEUDO_FIELD_ALL_FIELDS_REC   "[all recursive]"
 

Enumerations

enum  SelectableFields {
  SF_STANDARD = 0, SF_PSEUDO = 1, SF_HIDDEN = 2, SF_ALLOW_NEW = 4,
  SF_SHOW_TYPE = 8
}
 
enum  FailIfField {
  FIF_NAME_SELECTED = 1, FIF_NO_FIELD_SELECTED = 2, FIF_STANDARD = FIF_NAME_SELECTED|FIF_NO_FIELD_SELECTED, FIF_ALLOW_NONE = FIF_STANDARD^FIF_NO_FIELD_SELECTED,
  FIF_ALLOW_ID_CHANGE = FIF_STANDARD^FIF_NAME_SELECTED
}
 
enum  RescanMode { RESCAN_REFRESH = 1, RESCAN_SHOW_ALL = 2 }
 

Functions

Itemfield_Selectioncreate_itemfield_selection_list (AW_window *aws, const FieldSelDef &selDef, const char *at)
 
void create_itemfield_selection_button (AW_window *aws, const FieldSelDef &selDef, const char *at)
 
const charprepare_and_get_selected_itemfield (AW_root *awr, const char *awar_name, GBDATA *gb_main, const ItemSelector &itemtype, FailIfField failIf=FIF_STANDARD)
 
const charget_itemfield_type_awarname (const char *itemfield_awarname)
 
void species_field_selection_list_rescan (GBDATA *gb_main, RescanMode mode)
 
void gene_field_selection_list_rescan (GBDATA *gb_main, RescanMode mode)
 
void species_field_selection_list_unhide_all_cb (AW_window *, GBDATA *gb_main)
 
void species_field_selection_list_update_cb (AW_window *, GBDATA *gb_main)
 
void gene_field_selection_list_unhide_all_cb (AW_window *, GBDATA *gb_main)
 
void gene_field_selection_list_update_cb (AW_window *, GBDATA *gb_main)
 
void experiment_field_selection_list_unhide_all_cb (AW_window *, GBDATA *gb_main)
 
void experiment_field_selection_list_update_cb (AW_window *, GBDATA *gb_main)
 

Variables

CONSTEXPR long FIELD_FILTER_STRING = (1<<GB_STRING)
 
CONSTEXPR long FIELD_FILTER_STRING_WRITEABLE = (1<<GB_STRING)
 
CONSTEXPR long FIELD_FILTER_INT_WRITEABLE = (1<<GB_STRING) | (1<<GB_INT)
 
CONSTEXPR long FIELD_FILTER_BYTE_WRITEABLE = (1<<GB_STRING) | (1<<GB_INT) | (1<<GB_BYTE) | (1<<GB_FLOAT)
 
CONSTEXPR long FIELD_FILTER_FLOAT_WRITEABLE = (1<<GB_STRING) | (1<<GB_FLOAT)
 
CONSTEXPR long FIELD_FILTER_STRING_READABLE = (1<<GB_BYTE)|(1<<GB_INT)|(1<<GB_FLOAT)|(1<<GB_STRING)|(1<<GB_BITS)
 
CONSTEXPR long FIELD_UNFILTERED = -1L
 
CONSTEXPR long FIELD_FILTER_ANY_FIELD = (FIELD_UNFILTERED ^ (1<<GB_DB))
 
CONSTEXPR long FIELD_FILTER_NDS = FIELD_FILTER_STRING_READABLE
 

Macro Definition Documentation

#define PSEUDO_FIELD_ANY_FIELD   "[any field]"

Definition at line 27 of file item_sel_list.h.

Referenced by Itemfield_Selection::fill(), and SLOW_is_pseudo_key().

#define PSEUDO_FIELD_ALL_FIELDS   "[all fields]"

Definition at line 28 of file item_sel_list.h.

Referenced by Itemfield_Selection::fill(), and SLOW_is_pseudo_key().

#define PSEUDO_FIELD_ANY_FIELD_REC   "[any recursive]"

Definition at line 29 of file item_sel_list.h.

Referenced by Itemfield_Selection::fill(), and SLOW_is_pseudo_key().

#define PSEUDO_FIELD_ALL_FIELDS_REC   "[all recursive]"

Definition at line 30 of file item_sel_list.h.

Referenced by Itemfield_Selection::fill(), and SLOW_is_pseudo_key().

Enumeration Type Documentation

Enumerator
SF_STANDARD 
SF_PSEUDO 
SF_HIDDEN 
SF_ALLOW_NEW 
SF_SHOW_TYPE 

Definition at line 32 of file item_sel_list.h.

Enumerator
FIF_NAME_SELECTED 
FIF_NO_FIELD_SELECTED 
FIF_STANDARD 
FIF_ALLOW_NONE 
FIF_ALLOW_ID_CHANGE 

Definition at line 114 of file item_sel_list.h.

enum RescanMode
Enumerator
RESCAN_REFRESH 
RESCAN_SHOW_ALL 

Definition at line 129 of file item_sel_list.h.

Function Documentation

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().

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().

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

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().

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().

void species_field_selection_list_rescan ( GBDATA gb_main,
RescanMode  mode 
)
void gene_field_selection_list_rescan ( GBDATA gb_main,
RescanMode  mode 
)
void species_field_selection_list_unhide_all_cb ( AW_window ,
GBDATA gb_main 
)
void species_field_selection_list_update_cb ( AW_window ,
GBDATA gb_main 
)
void gene_field_selection_list_unhide_all_cb ( AW_window ,
GBDATA gb_main 
)

Definition at line 191 of file changekey.cxx.

References gene_field_selection_list_rescan(), and RESCAN_SHOW_ALL.

Referenced by GEN_create_field_items().

void gene_field_selection_list_update_cb ( AW_window ,
GBDATA gb_main 
)

Definition at line 192 of file changekey.cxx.

References gene_field_selection_list_rescan(), and RESCAN_REFRESH.

Referenced by GEN_create_field_items().

void experiment_field_selection_list_unhide_all_cb ( AW_window ,
GBDATA gb_main 
)

Definition at line 194 of file changekey.cxx.

References experiment_field_selection_list_rescan(), and RESCAN_SHOW_ALL.

Referenced by EXP_create_field_items().

void experiment_field_selection_list_update_cb ( AW_window ,
GBDATA gb_main 
)

Definition at line 195 of file changekey.cxx.

References experiment_field_selection_list_rescan(), and RESCAN_REFRESH.

Referenced by EXP_create_field_items().

Variable Documentation

CONSTEXPR long FIELD_FILTER_STRING = (1<<GB_STRING)
CONSTEXPR long FIELD_FILTER_STRING_WRITEABLE = (1<<GB_STRING)
CONSTEXPR long FIELD_FILTER_INT_WRITEABLE = (1<<GB_STRING) | (1<<GB_INT)
CONSTEXPR long FIELD_FILTER_BYTE_WRITEABLE = (1<<GB_STRING) | (1<<GB_INT) | (1<<GB_BYTE) | (1<<GB_FLOAT)

Definition at line 44 of file item_sel_list.h.

Referenced by ED4_configure_species_flags().

CONSTEXPR long FIELD_FILTER_FLOAT_WRITEABLE = (1<<GB_STRING) | (1<<GB_FLOAT)

Definition at line 45 of file item_sel_list.h.

CONSTEXPR long FIELD_FILTER_STRING_READABLE = (1<<GB_BYTE)|(1<<GB_INT)|(1<<GB_FLOAT)|(1<<GB_STRING)|(1<<GB_BITS)
CONSTEXPR long FIELD_UNFILTERED = -1L
CONSTEXPR long FIELD_FILTER_ANY_FIELD = (FIELD_UNFILTERED ^ (1<<GB_DB))

Definition at line 50 of file item_sel_list.h.

Referenced by popup_single_field_transfer_window().