Commit fb8d0072 authored by Claes Sjofors's avatar Claes Sjofors

Ge fix, multiline annotations wasn't editable in object editor

parent 1ae17e72
......@@ -16398,9 +16398,10 @@ int GePulldownMenu::action( grow_tObject object, glow_tEvent event)
int sts;
double scale;
glow_eFont text_font;
glow_eAnnotType annot_type;
sts = grow_GetObjectAnnotInfo( object, 1, &text_size, &text_drawtype, &text_color,
&bg_color, &scale, &text_font);
&bg_color, &scale, &text_font, &annot_type);
if ( EVEN(sts)) {
text_size = 2;
text_drawtype = glow_eDrawType_TextHelveticaBold;
......@@ -17206,9 +17207,10 @@ int GeOptionMenu::action( grow_tObject object, glow_tEvent event)
int sts;
double scale;
glow_eFont text_font;
glow_eAnnotType annot_type;
sts = grow_GetObjectAnnotInfo( object, 1, &tsize, &text_drawtype, &text_color, &bg_color,
&scale, &text_font);
&scale, &text_font, &annot_type);
if ( EVEN(sts)) {
tsize = 2;
text_drawtype = glow_eDrawType_TextHelveticaBold;
......@@ -18085,9 +18087,10 @@ int GeMethodPulldownMenu::action( grow_tObject object, glow_tEvent event)
int text_size;
double scale;
glow_eFont text_font;
glow_eAnnotType annot_type;
sts = grow_GetObjectAnnotInfo( object, 1, &text_size, &text_drawtype, &text_color,
&bg_color, &scale, &text_font);
&bg_color, &scale, &text_font, &annot_type);
if ( EVEN(sts)) {
text_size = 2;
text_drawtype = glow_eDrawType_TextHelveticaBold;
......
......@@ -640,11 +640,13 @@ void GrowAnnot::convert( glow_eConvert version)
}
void GrowAnnot::get_annotation_info( void *node, int *t_size, glow_eDrawType *t_drawtype,
glow_eDrawType *t_color, glow_eFont *t_font)
glow_eDrawType *t_color, glow_eFont *t_font,
glow_eAnnotType *t_type)
{
*t_color = ((GrowCtx *)ctx)->get_drawtype( color_drawtype, glow_eDrawType_LineHighlight,
0, (GrowNode *)node, 2);
0, (GrowNode *)node, 2);
*t_size = text_size;
*t_type = annot_type;
if ( node && ((GrowNode *)node)->text_font != glow_eFont_No) {
*t_font = ((GrowNode *)node)->text_font;
*t_drawtype = ((GrowNode *)node)->text_type;
......
......@@ -191,7 +191,7 @@ class GrowAnnot : public GlowAnnot {
\param t_color Annotation text color.
*/
void get_annotation_info( void *node, int *t_size, glow_eDrawType *t_drawtype,
glow_eDrawType *t_color, glow_eFont *font);
glow_eDrawType *t_color, glow_eFont *font, glow_eAnnotType *t_type);
int get_text_size( GlowTransform *t, double *tsize);
void get_text_extent( GlowTransform *t, void *node, double *width, double *height);
......
......@@ -2839,13 +2839,23 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
sprintf( annot_name, "A%d", j);
if ( (name = growapi_translate( transtab, annot_name)))
{
int a_size;
glow_eDrawType a_drawtype, a_color, a_bgcolor;
double a_scale;
glow_eFont a_font;
glow_eAnnotType a_type;
op->get_annotation_info( j, &a_size, &a_drawtype, &a_color, &a_bgcolor, &a_scale,
&a_font, &a_type);
strcpy( attrinfo[i].name, name);
attrinfo[i].value_p = malloc( 80);
attrinfo[i].value_p = malloc( 1024);
attrinfo[i].type = glow_eType_String;
attrinfo[i].size = 80;
attrinfo[i].size = 1024;
attrinfo[i].info_type = grow_eInfoType_Annot;
attrinfo[i].number = j;
op->get_annotation( j, (char *)attrinfo[i].value_p, 80);
if ( a_type == glow_eAnnotType_MultiLine)
attrinfo[i].multiline = 1;
op->get_annotation( j, (char *)attrinfo[i].value_p, 1024);
i++;
}
}
......@@ -5176,10 +5186,10 @@ void grow_GetBarChartConf( grow_tObject object, int *bar_num, int *barsegment_nu
int grow_GetObjectAnnotInfo( grow_tObject object, int num, int *text_size, glow_eDrawType *text_drawtype,
glow_eDrawType *text_color, glow_eDrawType *bg_color, double *scale,
glow_eFont *font)
glow_eFont *font, glow_eAnnotType *type)
{
return ((GrowNode *)object)->get_annotation_info( num, text_size, text_drawtype, text_color, bg_color,
scale, font);
scale, font, type);
}
void grow_GetMenuChar( grow_tObject menu, int *t_size, glow_eDrawType *fill_color, glow_eDrawType *t_drawtype,
......
......@@ -3041,7 +3041,7 @@ extern "C" {
*/
int grow_GetObjectAnnotInfo( grow_tObject object, int num, int *text_size, glow_eDrawType *text_drawtype,
glow_eDrawType *text_color, glow_eDrawType *bg_color, double *scale,
glow_eFont *text_font);
glow_eFont *text_font, glow_eAnnotType *type);
//! Get color, textsize and text colors for a menu.
/*!
......
......@@ -2522,6 +2522,7 @@ void GrowCtx::clear_all( int keep_paste)
cycle = glow_eCycle_Slow;
mb3_action = glow_eMB3Action_PopupMenu;
translate_on = 0;
strcpy( color_theme, "");
inputfocus_object = 0;
x0 = y0 = x1 = y1 = 0;
......
......@@ -2101,7 +2101,8 @@ void GrowNode::annot_input_event( glow_eEvent event, int keycode)
}
int GrowNode::get_annotation_info( int num, int *t_size, glow_eDrawType *t_drawtype, glow_eDrawType *t_color,
glow_eDrawType *bg_color, double *scale, glow_eFont *t_font)
glow_eDrawType *bg_color, double *scale, glow_eFont *t_font,
glow_eAnnotType *t_type)
{
int sts;
......@@ -2109,7 +2110,7 @@ int GrowNode::get_annotation_info( int num, int *t_size, glow_eDrawType *t_drawt
if ( EVEN(sts))
*bg_color = glow_eDrawType_No;
sts = nc->get_annotation_info( (void*)this, num, t_size, t_drawtype, t_color, t_font);
sts = nc->get_annotation_info( (void*)this, num, t_size, t_drawtype, t_color, t_font, t_type);
*scale = trf.vertical_scale(0);
return sts;
}
......
......@@ -955,7 +955,8 @@ class GrowNode : public GlowNode {
\return 0 if annotation doesn't exist, else 1.
*/
int get_annotation_info( int num, int *t_size, glow_eDrawType *t_drawtype, glow_eDrawType *t_color,
glow_eDrawType *bg_color, double *scale, glow_eFont *font);
glow_eDrawType *bg_color, double *scale, glow_eFont *font,
glow_eAnnotType *t_type);
int get_annotation_text_size( int num, double *tsize);
void set_annotation_text_offset( int num, double x, double y);
void get_annotation_text_extent( int num, double *width, double *height);
......
......@@ -748,14 +748,15 @@ int GlowNodeClass::find_nc( GlowArrayElem *nodeclass)
}
int GlowNodeClass::get_annotation_info( void *node, int num, int *t_size, glow_eDrawType *t_drawtype,
glow_eDrawType *t_color, glow_eFont *t_font)
glow_eDrawType *t_color, glow_eFont *t_font,
glow_eAnnotType *t_type)
{
int i;
for ( i = 0; i < a.a_size; i++) {
if ( a.a[i]->type() == glow_eObjectType_GrowAnnot &&
((GrowAnnot *)a.a[i])->number == num) {
((GrowAnnot *)a.a[i])->get_annotation_info( node, t_size, t_drawtype, t_color, t_font);
((GrowAnnot *)a.a[i])->get_annotation_info( node, t_size, t_drawtype, t_color, t_font, t_type);
return 1;
}
}
......
......@@ -366,7 +366,7 @@ class GlowNodeClass : public GlowArrayElem {
\return 0 if annotation doesn't exist, else 1.
*/
int get_annotation_info( void *node, int num, int *t_size, glow_eDrawType *t_drawtype,
glow_eDrawType *t_color, glow_eFont *t_font);
glow_eDrawType *t_color, glow_eFont *t_font, glow_eAnnotType *t_type);
int get_annotation_text_size( GlowTransform *t, int num, double *tsize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment