Commit 207b4f59 authored by Claes Sjofors's avatar Claes Sjofors

Possibility to configure tooltip size in Ge graphs

parent 4172df2a
...@@ -156,4 +156,5 @@ ...@@ -156,4 +156,5 @@
091106 cs ge Different ways to show hot object added: linewith, light color, dark color. 091106 cs ge Different ways to show hot object added: linewith, light color, dark color.
091208 cs xtt New pixmap for weblink in helpwindow. 091208 cs xtt New pixmap for weblink in helpwindow.
091208 cs xtt EventSelectList exended to 40 elements. 091208 cs xtt EventSelectList exended to 40 elements.
100111 cs xtt Method Photo added to xtt toolbar. 100111 cs xtt Method Photo added to xtt toolbar.
\ No newline at end of file 100118 cs ge Possibility to configure the tooltip size in Ge graphs.
\ No newline at end of file
...@@ -1089,6 +1089,7 @@ typedef enum { ...@@ -1089,6 +1089,7 @@ typedef enum {
glow_eSave_Ctx_nav_zoom_factor_y = 136, glow_eSave_Ctx_nav_zoom_factor_y = 136,
glow_eSave_Ctx_version = 137, glow_eSave_Ctx_version = 137,
glow_eSave_Ctx_hot_indication = 138, glow_eSave_Ctx_hot_indication = 138,
glow_eSave_Ctx_tiptext_size = 139,
glow_eSave_Ctx_comment = 199, glow_eSave_Ctx_comment = 199,
glow_eSave_Array_a = 200, glow_eSave_Array_a = 200,
glow_eSave_NodeClass_nc_name = 300, glow_eSave_NodeClass_nc_name = 300,
......
...@@ -79,11 +79,11 @@ GlowCtx::GlowCtx( const char *ctx_name, double zoom_fact, int offs_x, int offs_y ...@@ -79,11 +79,11 @@ GlowCtx::GlowCtx( const char *ctx_name, double zoom_fact, int offs_x, int offs_y
default_hot_mode(glow_eHotMode_SingleObject), hot_found(0), default_hot_mode(glow_eHotMode_SingleObject), hot_found(0),
userdata_save_callback(0), userdata_open_callback(0), userdata_copy_callback(0), userdata_save_callback(0), userdata_open_callback(0), userdata_copy_callback(0),
version(GLOW_VERSION), inputfocus_object(0), is_component(0), comment(0), version(GLOW_VERSION), inputfocus_object(0), is_component(0), comment(0),
hot_indication(glow_eHotIndication_LightColor) hot_indication(glow_eHotIndication_LightColor), tiptext_size(2)
{ {
strcpy(name, ctx_name); strcpy(name, ctx_name);
memset( (void *)event_callback, 0, sizeof(event_callback)); memset( (void *)event_callback, 0, sizeof(event_callback));
tiptext = new GlowTipText( (GrowCtx *)this); tiptext = new GlowTipText( (GrowCtx *)this, tiptext_size);
} }
GlowCtx::~GlowCtx() GlowCtx::~GlowCtx()
...@@ -190,6 +190,7 @@ int GlowCtx::save( char *filename, glow_eSaveMode mode) ...@@ -190,6 +190,7 @@ int GlowCtx::save( char *filename, glow_eSaveMode mode)
fp << int(glow_eSave_Ctx_refcon_linewidth) << FSPACE << refcon_linewidth << endl; fp << int(glow_eSave_Ctx_refcon_linewidth) << FSPACE << refcon_linewidth << endl;
fp << int(glow_eSave_Ctx_version) << FSPACE << version << endl; fp << int(glow_eSave_Ctx_version) << FSPACE << version << endl;
fp << int(glow_eSave_Ctx_hot_indication) << FSPACE << hot_indication << endl; fp << int(glow_eSave_Ctx_hot_indication) << FSPACE << hot_indication << endl;
fp << int(glow_eSave_Ctx_tiptext_size) << FSPACE << tiptext_size << endl;
if ( ctx_type == glow_eCtxType_Grow) if ( ctx_type == glow_eCtxType_Grow)
{ {
fp << int(glow_eSave_Ctx_grow) << endl; fp << int(glow_eSave_Ctx_grow) << endl;
...@@ -328,6 +329,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode) ...@@ -328,6 +329,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode)
case glow_eSave_Ctx_refcon_linewidth: fp >> refcon_linewidth; break; case glow_eSave_Ctx_refcon_linewidth: fp >> refcon_linewidth; break;
case glow_eSave_Ctx_version: fp >> version; break; case glow_eSave_Ctx_version: fp >> version; break;
case glow_eSave_Ctx_hot_indication: fp >> tmp; hot_indication = (glow_eHotIndication)tmp; break; case glow_eSave_Ctx_hot_indication: fp >> tmp; hot_indication = (glow_eHotIndication)tmp; break;
case glow_eSave_Ctx_tiptext_size: fp >> tiptext_size; break;
case glow_eSave_Ctx_grow: case glow_eSave_Ctx_grow:
((GrowCtx *)this)->open_grow( fp); ((GrowCtx *)this)->open_grow( fp);
grow_loaded = 1; grow_loaded = 1;
...@@ -369,6 +371,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode) ...@@ -369,6 +371,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode)
clear( &mw); clear( &mw);
draw( &mw, 0, 0, mw.window_width, mw.window_height); draw( &mw, 0, 0, mw.window_width, mw.window_height);
nav_zoom(); nav_zoom();
tiptext->set_size( tiptext_size);
return 1; return 1;
} }
......
...@@ -823,6 +823,7 @@ class GlowCtx { ...@@ -823,6 +823,7 @@ class GlowCtx {
int is_component; //!< Ctx is a window component. int is_component; //!< Ctx is a window component.
CtxComment *comment; CtxComment *comment;
glow_eHotIndication hot_indication; //!< Specification of how hots object should be drawn. glow_eHotIndication hot_indication; //!< Specification of how hots object should be drawn.
int tiptext_size; //!< Size of tooltip text
//! Register scrollbar callback function //! Register scrollbar callback function
/*! /*!
......
...@@ -2825,6 +2825,11 @@ int grow_GetGraphAttrInfo( grow_tCtx ctx, grow_sAttrInfo **info, ...@@ -2825,6 +2825,11 @@ int grow_GetGraphAttrInfo( grow_tCtx ctx, grow_sAttrInfo **info,
attrinfo[i].type = glow_eType_HotIndication; attrinfo[i].type = glow_eType_HotIndication;
attrinfo[i++].size = sizeof( ctx->hot_indication); attrinfo[i++].size = sizeof( ctx->hot_indication);
strcpy( attrinfo[i].name, "TooltipTextsize");
attrinfo[i].value_p = &ctx->tiptext_size;
attrinfo[i].type = glow_eType_TextSize;
attrinfo[i++].size = sizeof( ctx->tiptext_size);
attrinfo[i].info_type = grow_eInfoType_End; attrinfo[i].info_type = grow_eInfoType_End;
*attr_cnt = i; *attr_cnt = i;
*info = attrinfo; *info = attrinfo;
......
...@@ -48,8 +48,8 @@ class GlowTipText { ...@@ -48,8 +48,8 @@ class GlowTipText {
/*! /*!
\param gctx Glow context. \param gctx Glow context.
*/ */
GlowTipText( GrowCtx *gctx) : ctx(gctx), text_object(0), active(false), timer_id(0), GlowTipText( GrowCtx *gctx, int tsize) : ctx(gctx), text_object(0), active(false), timer_id(0),
text_size(2) {} text_size(tsize) {}
//! Destructor //! Destructor
/*! Removes the timer if it is set. /*! Removes the timer if it is set.
...@@ -68,6 +68,12 @@ class GlowTipText { ...@@ -68,6 +68,12 @@ class GlowTipText {
void *timer_id; //!< Timer id. void *timer_id; //!< Timer id.
int text_size; //!< Text size. int text_size; //!< Text size.
//! Set text size.
/*!
\param tsize Text size.
*/
void set_size( int tsize) { text_size = tsize;}
//! Activate tooltip. //! Activate tooltip.
/*! /*!
\param e Object that owns the tiptext. \param e Object that owns the tiptext.
......
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