19 memset((
char*)
this, 0,
sizeof(
AW_at));
28 char to_position[100];
29 memset(to_position, 0,
sizeof(to_position));
35 if (!xfig_data)
GBK_terminatef(
"no xfig-data loaded, can't position at(\"%s\")", at_id);
43 sprintf(to_position,
"X:%s", at_id);
48 sprintf(to_position,
"Y:%s", at_id);
53 sprintf(to_position,
"XY:%s", at_id);
58 if (!pos)
GBK_terminatef(
"ID '%s' does not exist in xfig file", at_id);
60 at((pos->
x - xfig->
minx), (pos->
y - xfig->
miny - this->get_root()->font_height - 9));
63 sprintf(to_position,
"to:%s", at_id);
67 sprintf(to_position,
"to:X:%s", at_id);
72 sprintf(to_position,
"to:Y:%s", at_id);
77 sprintf(to_position,
"to:XY:%s", at_id);
128 GBK_terminate(
"neither auto_space nor auto_increment activated while using at_newline");
136 if (!xfig)
return false;
143 sprintf(buffer,
"XY:%s", at_id_);
183 if (x)
at_x(attach_x ? width+x : x);
184 if (y)
at_y(attach_y ? height+y : y);
315 bool to_position_exists;
327 to_position_exists(
false),
341 if (to_position_exists) {
354 if (to_position_exists) {
396 enum { INC, SPACE, OFF } type;
398 int xfn, xfnb, yfnb, bhob;
400 AW_at_auto() : type(OFF), x(0), y(0), xfn(0), xfnb(0), yfnb(0), bhob(0) {}
460 int AW_window::calculate_string_width(
int columns)
const {
470 int AW_window::calculate_string_height(
int rows,
int offset)
const {
480 char *AW_window::align_string(
const char *label_text,
int columns) {
484 const char *lf = strchr(label_text,
'\n');
490 int len = strlen(label_text);
491 if (len>columns) len = columns;
493 memcpy(result, label_text, len);
494 if (len<columns) memset(result+len,
' ', columns-len);
499 char *aligned1 = align_string(part1, columns);
500 char *aligned2 = align_string(lf+1, columns);
void get_at_position(int *x, int *y) const
void button_length(int length)
int get_at_xposition() const
void store(const AW_at &at) OVERRIDE
void store(const AW_at &at) OVERRIDE
short length_of_label_for_inputfield
void at_shift(int x, int y)
void GBK_terminatef(const char *templat,...)
void restore(AW_at &at) const OVERRIDE
char * ARB_strpartdup(const char *start, const char *end)
void restore(AW_at &at) const OVERRIDE
char buffer[MESSAGE_BUFFERSIZE]
TYPE * ARB_alloc(size_t nelem)
void increment_at_commands(int width, int height)
void GBK_terminate(const char *error) __ATTR__NORETURN
char * helptext_for_next_button
void store(const AW_at &at) OVERRIDE
int get_button_length() const
static AW_at_storage * make(AW_window *aww, AW_at_storage_type type)
int biggest_height_of_buttons
const int XFIG_DEFAULT_FONT_WIDTH
unsigned long int background_color
void auto_space(int xspace, int yspace)
void at_attach(int x, int y)
void auto_increment(int dx, int dy)
bool at_ifdef(const char *id)
char * label_for_inputfield
void store_at_to(AW_at_storage &storage)
int get_at_yposition() const
void label_length(int length)
int correct_for_at_center
void at_attach_to(bool attach_x, bool attach_y, int xoff, int yoff)
long GBS_read_hash(const GB_HASH *hs, const char *key)
void get_window_size(int &width, int &height)
void restore(AW_at &at) const OVERRIDE
char * GBS_global_string_copy(const char *templat,...)
const int XFIG_DEFAULT_FONT_HEIGHT
GB_write_int const char s