ARB
Classes | Macros | Functions
AWT_prompt.cxx File Reference
#include "awt_prompt.hxx"
#include <aw_window.hxx>
#include <aw_root.hxx>
#include <aw_awar.hxx>
Include dependency graph for AWT_prompt.cxx:

Go to the source code of this file.

Classes

struct  PromptData
 

Macros

#define PROMPT_AWAR_PREFIX   "tmp/prompt/"
 
#define AWAR_PROMPT_TEXT   PROMPT_AWAR_PREFIX "text"
 
#define AWAR_PROMPT_INPUT   PROMPT_AWAR_PREFIX "input"
 
#define AWAR_PROMPT_BUTTON   PROMPT_AWAR_PREFIX "button"
 
#define AWAR_PROMPT_ERROR   PROMPT_AWAR_PREFIX "error"
 

Functions

static GB_ERROR hidden_ok_pressed ()
 
static void ok_pressed (AW_window *aww, PromptData *pdata)
 
static void run_help_cb (AW_window *aww, const PromptData *pdata)
 
static void clear_input_cb (AW_window *aww)
 
void AWT_activate_prompt (const char *title, const char *prompt, const char *defaultResult, const char *button, const ResultHandler &handle_result, const char *helpfile, const char *srt)
 

Macro Definition Documentation

#define PROMPT_AWAR_PREFIX   "tmp/prompt/"

Definition at line 17 of file AWT_prompt.cxx.

#define AWAR_PROMPT_TEXT   PROMPT_AWAR_PREFIX "text"

Definition at line 19 of file AWT_prompt.cxx.

Referenced by AWT_activate_prompt().

#define AWAR_PROMPT_INPUT   PROMPT_AWAR_PREFIX "input"

Definition at line 20 of file AWT_prompt.cxx.

Referenced by AWT_activate_prompt(), clear_input_cb(), and ok_pressed().

#define AWAR_PROMPT_BUTTON   PROMPT_AWAR_PREFIX "button"

Definition at line 21 of file AWT_prompt.cxx.

Referenced by AWT_activate_prompt().

#define AWAR_PROMPT_ERROR   PROMPT_AWAR_PREFIX "error"

Definition at line 22 of file AWT_prompt.cxx.

Referenced by AWT_activate_prompt(), ok_pressed(), and run_help_cb().

Function Documentation

static GB_ERROR hidden_ok_pressed ( )
static

Definition at line 32 of file AWT_prompt.cxx.

Referenced by ok_pressed().

static void ok_pressed ( AW_window aww,
PromptData pdata 
)
static
static void run_help_cb ( AW_window aww,
const PromptData pdata 
)
static
static void clear_input_cb ( AW_window aww)
static
void AWT_activate_prompt ( const char title,
const char prompt,
const char defaultResult,
const char button,
const ResultHandler &  handle_result,
const char helpfile,
const char srt 
)

pops up an text input prompter

(macro-capable replacement for aw_input)

Parameters
titlewindow title
promptquestion or request shown above input field
defaultResultdefault value for input field
buttontext shown on "ENTER" button (maxlen: 7)
handle_resultcalled with entered result (even if empty)
helpfilecontext sensitive helpfile (defaults to NULp)
srtSRT command will be applied to userinput (defaults to NULp; should not be dynamic) Use e.g. to correct name-prefixes like "tree_" or "ali_"

Note that all activated prompts use the same window. Activating a second prompt (while the user did not answer the first one), will hide the first prompt.

Definition at line 62 of file AWT_prompt.cxx.

References AW_POPDOWN(), AW_REPOS_TO_MOUSE, AW_RESIZE_USER, AW_root::awar(), AWAR_PROMPT_BUTTON, AWAR_PROMPT_ERROR, AWAR_PROMPT_INPUT, AWAR_PROMPT_TEXT, AW_root::awar_string(), clear_input_cb(), PromptData::handler, PromptData::help_button, PromptData::helpfile, NULp, ok_pressed(), run_help_cb(), AW_root::set_active(), AW_awar::set_srt(), AW_root::SINGLETON, and AW_awar::write_string().

Referenced by askCopyMoveRuleset_cb(), config_rename_cb(), copy_rename_cb(), create_ali_cb(), createCopy_ClrTransTab_cb(), experiment_copy_cb(), experiment_create_cb(), experiment_rename_cb(), extended_rename_cb(), gene_copy_cb(), gene_extract_cb(), gene_rename_cb(), species_create_cb(), and species_rename_cb().