30 #define SLIDERFIELDWIDTH 5 // width of numeric input fields with slider
31 #define SLIDERWIDTH 200 // with of the slider itself
33 #define AWAR_GDE_ALIGNMENT AWAR_PREFIX_GDE_TEMP "/alignment"
34 #define AWAR_GDE_FILTER_NAME AWAR_PREFIX_GDE_TEMP "/filter/name"
43 if (gmenuitem->
help) {
47 aw_message(
"Sorry - no help available (please report to devel@arb-home.de)");
59 free(gmenuitem_label);
100 AW_window_simple *aws =
new AW_window_simple;
104 aws->init(aw_root, wid, title);
107 aws->load_xfig(
"sel_box.fig");
111 aws->create_button(
"CLOSE",
"CLOSE",
"C");
139 for (
int i=0; i<gmenuitem->
numargs; i++) {
146 for (
int i=0; i<gmenuitem->
numargs; i++) {
169 char seqtype = gmenuitem->
seqtype;
171 if (!gmenuitem->
aws) {
172 AW_window_simple *aws =
new AW_window_simple;
173 aws->init(aw_root, bf, bf);
177 if (seqtype ==
'-') aws->load_xfig(
"gdeitem_simple.fig");
178 else aws->load_xfig(
"gdeitem.fig");
183 aws->load_xfig(
"gde3item.fig");
187 aws->button_length(10);
189 aws->auto_space(0, 10);
193 aws->create_button(
"GDE_HELP",
"HELP",
"H");
197 aws->create_button(
"GO",
"GO",
"O");
201 aws->create_button(
"CLOSE",
"CLOSE",
"C");
211 if (seqtype !=
'-') {
212 aws->at(
"which_alignment");
213 const char *ali_filter = seqtype ==
'A' ?
"pro=:ami=" : (seqtype ==
'N' ?
"dna=:rna=" :
"*=");
216 aws->at(
"which_species");
218 aws->insert_toggle (
"all",
"a", 0);
219 aws->insert_default_toggle(
"marked",
"m", 1);
220 aws->update_toggle_field();
222 if (seqtype !=
'N') {
223 aws->at(
"stop_codon");
224 aws->label(
"Cut stop-codon");
231 aws->at(
"topk"); aws->create_toggle(
"gde/top_area_kons");
232 aws->at(
"middlek"); aws->create_toggle(
"gde/middle_area_kons");
233 aws->at(
"topr"); aws->create_toggle(
"gde/top_area_remark");
234 aws->at(
"middler"); aws->create_toggle(
"gde/middle_area_remark");
235 aws->at(
"top"); aws->create_toggle(
"gde/top_area");
236 aws->at(
"topsai"); aws->create_toggle(
"gde/top_area_sai");
237 aws->at(
"toph"); aws->create_toggle(
"gde/top_area_helix");
238 aws->at(
"middle"); aws->create_toggle(
"gde/middle_area");
239 aws->at(
"middlesai"); aws->create_toggle(
"gde/middle_area_sai");
240 aws->at(
"middleh"); aws->create_toggle(
"gde/middle_area_helix");
244 if (seqtype !=
'-') {
245 aws->at(
"compression");
251 aws->update_option_menu();
253 aws->button_length(12);
254 aws->at(
"filtername");
270 for (
int i=0; i<gmenuitem->
numargs; i++) {
274 const char *linefeed = strchr(label,
'\n');
278 lablen = linefeed-
label;
279 if (lablen>labellength) {
280 labellength = lablen;
283 linefeed = strchr(label,
'\n');
286 lablen = strlen(label);
287 if (lablen>labellength) {
288 labellength = lablen;
291 aws->label_length(labellength);
292 aws->auto_space(0, 0);
294 for (
int i=0; i<gmenuitem->
numargs; i++) {
302 int(itemarg.
min) == itemarg.
min &&
303 int(itemarg.
max) == itemarg.
max)
312 aws->label(itemarg.
label);
322 bool curr_value_legal =
false;
326 if ((strcasecmp(itemarg.
choice[0].
label,
"no") == 0) ||
331 aws->create_toggle_field(newawar, itemarg.
label, orientation);
334 if (strcmp(itemarg.
choice[j].
method, curr_value) == 0) curr_value_legal =
true;
345 aws->update_toggle_field();
353 bool curr_value_legal =
false;
355 if (itemarg.
label[0]) aws->label(itemarg.
label);
357 aws->create_option_menu(newawar);
360 if (strcmp(itemarg.
choice[j].
method, curr_value) == 0) curr_value_legal =
true;
365 aws->update_option_menu();
372 aws->label(itemarg.
label);
374 aws->create_input_field(newawar, itemarg.
textwidth);
383 aws->label(itemarg.
label);
385 aws->create_input_field(name_awar, 40);
387 aws->create_button(
"",
"Browse");
427 gmenuitem->
aws = aws;
429 return gmenuitem->
aws;
447 bool topicInserted =
false;
449 for (
long nmenu = 0; nmenu<
num_menus; nmenu++) {
451 const char *menuname = menu[nmenu].
label;
453 if (strcmp(menulabel, menuname)) {
458 hotkey[0] = menu[nmenu].
meta;
463 long num_items = menu[nmenu].
numitems;
464 for (
long nitem=0; nitem<num_items; nitem++) {
467 hotkey[0] = menuitem->
meta;
469 if (!menuitem->
popup) {
473 topicInserted =
true;
481 if (!topicInserted && menulabel && strcmp(menulabel,
"User") != 0) {
482 fprintf(stderr,
"GDE-Warning: Could not find any topics for menu '%s' \n", menulabel);
498 aw_root->
awar_int(
"gde/top_area_kons", 1, aw_def);
499 aw_root->
awar_int(
"gde/top_area_remark", 1, aw_def);
500 aw_root->
awar_int(
"gde/middle_area_kons", 1, aw_def);
501 aw_root->
awar_int(
"gde/middle_area_remark", 1, aw_def);
502 aw_root->
awar_int(
"gde/top_area", 1, aw_def);
503 aw_root->
awar_int(
"gde/top_area_sai", 1, aw_def);
504 aw_root->
awar_int(
"gde/top_area_helix", 1, aw_def);
505 aw_root->
awar_int(
"gde/middle_area", 1, aw_def);
506 aw_root->
awar_int(
"gde/middle_area_sai", 1, aw_def);
507 aw_root->
awar_int(
"gde/middle_area_helix", 1, aw_def);
508 aw_root->
awar_int(
"gde/bottom_area", 1, aw_def);
509 aw_root->
awar_int(
"gde/bottom_area_sai", 1, aw_def);
510 aw_root->
awar_int(
"gde/bottom_area_helix", 1, aw_def);
void awt_create_filter_awars(AW_root *aw_root, AW_default aw_def, const char *awar_filtername, const char *awar_mapto_alignment)
static char * GDE_makeawarname_in(GmenuItem *gmenuitem, long i, const char *awar_root)
AW_DB_selection * awt_create_SAI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const SaiSelectionlistFilterCallback &fcb)
void add(const char *awar_name, const char *config_name)
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
#define AWAR_GDE_COMPRESSION
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
static void refresh_weights_sellist_cb(AW_root *, AW_DB_selection *saisel)
static void GDE_showhelp_cb(UNFIXED, GmenuItem *gmenuitem)
void AW_create_standard_fileselection(AW_window *aws, const char *awar_prefix)
char * ARB_strdup(const char *str)
void AWT_insert_config_manager(AW_window *aww, AW_default default_file_, const char *id, const StoreConfigCallback &store_cb, const RestoreConfigCallback &load_or_reset_cb, const char *macro_id, const AWT_predefined_config *predef)
#define AWAR_DEFAULT_ALIGNMENT
AW_awar * set_minmax(float min, float max)
AW_DB_selection * awt_create_TREE_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname)
void AW_POPDOWN(AW_window *window)
char * GBS_string_2_key(const char *str)
AW_awar * add_callback(const RootCallback &cb)
struct Unfixed_cb_parameter * UNFIXED
char * GDE_maketmpawarname(GmenuItem *gmenuitem, long i)
GB_ERROR GDE_init(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main, GDE_get_sequences_cb get_sequences, GDE_format_alignment_cb format_ali, gde_window_type window_type)
bool shall_store_in_config(const GmenuItemArg &itemarg)
gde_window_type window_type
void GDE_load_menu(AW_window *awm, AW_active, const char *menulabel)
#define AWAR_GDE_CUTOFF_STOPCODON
#define AWAR_GDE_FILTER_NAME
#define AWAR_GDE_ALIGNMENT
void GDE_startaction_cb(AW_window *aw, GmenuItem *gmenuitem)
static AW_window * GDE_menuitem_cb(AW_root *aw_root, GmenuItem *gmenuitem)
AW_awar * awar_float(const char *var_name, float default_value=0.0, AW_default default_file=AW_ROOT_DEFAULT)
GDE_get_sequences_cb get_sequences
struct gde_database_access db_access
char * GDE_makeawarname(GmenuItem *gmenuitem, long i)
GBDATA * GB_get_root(GBDATA *gbd)
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
adfiltercbstruct * awt_create_select_filter(AW_root *aw_root, GBDATA *gb_main, const char *def_name)
AW_window * awt_create_select_filter_win(AW_root *aw_root, adfiltercbstruct *acbs)
char * read_string() const
GDE_format_alignment_cb format_ali
AW_awar * awar(const char *awar)
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
static AW_window_menu_modes_opengl * awm
AW_DB_selection * awt_create_ALI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const char *ali_type_match)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
#define IF_ASSERTION_USED(x)
GB_ERROR(* GDE_format_alignment_cb)(GBDATA *gb_main, const char *ali_name)
AW_awar * map(const char *awarn)
static char * gde_filter_weights(GBDATA *gb_sai)
static void setup_gde_config_def(AWT_config_definition &cdef, GmenuItem *gmenuitem)
#define AWAR_PREFIX_GDE_TEMP
static WindowCallback makeWindowPopper(const CreateWindowCallback &cwcb)
void aw_message(const char *msg)
static AW_window * GDE_create_filename_browser_window(AW_root *aw_root, const char *awar_prefix, const char *title)
void AW_help_popup(UNFIXED, const char *help_file)
GB_ERROR write_string(const char *aw_string)
bool ARB_strBeginsWith(const char *str, const char *with)
char * GBT_get_default_alignment(GBDATA *gb_main)
char *(* GDE_get_sequences_cb)(GBDATA **&the_species, uchar **&the_names, uchar **&the_sequences, long &numberspecies, long &maxalignlen)
bool want_config_manager(GmenuItem *gmenuitem)
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
bool GBS_string_matches(const char *str, const char *expr, GB_CASE case_sens)
GB_CSTR GBT_get_name_or_description(GBDATA *gb_item)
gde_iteminfo(GmenuItem *item_, int idx_)
static int info[maxsites+1]
long GBS_read_hash(const GB_HASH *hs, const char *key)
GBDATA * GB_entry(GBDATA *father, const char *key)
char * GBS_global_string_copy(const char *templat,...)
static void GDE_popup_filename_browser(AW_window *aw, gde_iteminfo *info, const char *title)
GB_HASH * GBS_create_hash(long estimated_elements, GB_CASE case_sens)
adfiltercbstruct * agde_filter