Commit f089a345 authored by claes's avatar claes

GrowWindow, GrowFolder, GrowTable and GrowScrollbar added

parent a2e42c23
......@@ -14,3 +14,4 @@ no_propagate <Don't propagate event handling> /info
fileopen <Unable to open file> /error
conselected <Connection is selected> /error
noselect <Nothing is selected> /error
groupclass <Unable to group this kind of object> /error
......@@ -1198,8 +1198,8 @@ static void ge_activate_group( Widget w, ge_tCtx gectx, XmAnyCallbackStruct *dat
sts = gectx->graph->group_select( &object, last_group);
if ( sts == GLOW__NOSELECT)
ge_message( gectx, 'E', "Select objects to form at group");
else if ( sts == GLOW__CONSELECTED)
ge_message( gectx, 'E', "A connection can not be included in a group");
else if ( sts == GLOW__GROUPCLASS)
ge_message( gectx, 'E', "Unable to group this kind of object");
else if ( sts == GE__RECALLDATA_FOUND) {
gectx->recover_object = object;
strcpy( gectx->recover_name, last_group);
......
......@@ -82,6 +82,7 @@ static attrnav_sEnumElement elem_dyn_type[] = {
{ (int) ge_mDynType_FastCurve , "FastCurve"},
{ (int) ge_mDynType_SliderBackground , "SliderBackground"},
{ (int) ge_mDynType_Video , "Video"},
{ (int) ge_mDynType_Table , "Table"},
{ 0, ""}};
static attrnav_sEnumElement elem_dyn_type_tone[] = {
......@@ -109,6 +110,7 @@ static attrnav_sEnumElement elem_dyn_type_tone[] = {
{ (int) ge_mDynType_FastCurve , "FastCurve"},
{ (int) ge_mDynType_SliderBackground , "SliderBackground"},
{ (int) ge_mDynType_Video , "Video"},
{ (int) ge_mDynType_Table , "Table"},
{ 0, ""}};
static attrnav_sEnumElement elem_action_type[] = {
......@@ -849,8 +851,8 @@ static attrnav_sEnumElement elem_anim_sequence[] = {
{ 0, ""}};
static attrnav_sEnumElement elem_limit_type[] = {
{ (int) ge_eLimitType_Gt, "GreaterThen"},
{ (int) ge_eLimitType_Lt, "LessThen"},
{ (int) ge_eLimitType_Gt, "GreaterThan"},
{ (int) ge_eLimitType_Lt, "LessThan"},
{ 0, ""}};
static attrnav_sEnumElement elem_relief[] = {
......@@ -858,6 +860,15 @@ static attrnav_sEnumElement elem_relief[] = {
{ (int) glow_eRelief_Down, "Down"},
{ 0, ""}};
static attrnav_sEnumElement elem_text_size[] = {
{ (int) glow_eTextSize_8, "8"},
{ (int) glow_eTextSize_10, "10"},
{ (int) glow_eTextSize_12, "12"},
{ (int) glow_eTextSize_14, "14"},
{ (int) glow_eTextSize_18, "18"},
{ (int) glow_eTextSize_24, "24"},
{ 0, ""}};
static attrnav_sEnum enum_types[] = {
{ (int) glow_eType_Direction, (attrnav_sEnumElement *) &elem_direction},
{ (int) glow_eType_Color, (attrnav_sEnumElement *) &elem_color},
......@@ -868,6 +879,7 @@ static attrnav_sEnum enum_types[] = {
{ (int) ge_eAttrType_AnimSequence, (attrnav_sEnumElement *) &elem_anim_sequence},
{ (int) ge_eAttrType_LimitType, (attrnav_sEnumElement *) &elem_limit_type},
{ (int) glow_eType_Relief, (attrnav_sEnumElement *) &elem_relief},
{ (int) glow_eType_TextSize, (attrnav_sEnumElement *) &elem_text_size},
{ (int) glow_eType_InputFocusMark, (attrnav_sEnumElement *) &elem_input_focus_mark},
{ 0, NULL}};
......@@ -930,6 +942,7 @@ int attrnav_attr_string_to_value( int type_id, char *value_str,
case glow_eType_MB3Action:
case glow_eType_InputFocusMark:
case glow_eType_Relief:
case glow_eType_TextSize:
case ge_eAttrType_DynType:
case ge_eAttrType_DynTypeTone:
case ge_eAttrType_ActionType:
......@@ -1007,6 +1020,7 @@ void attrnav_attrvalue_to_string( int type_id, void *value_ptr,
case glow_eType_MB3Action:
case glow_eType_InputFocusMark:
case glow_eType_Relief:
case glow_eType_TextSize:
case ge_eAttrType_AnimSequence:
case ge_eAttrType_LimitType:
{
......@@ -2062,6 +2076,7 @@ ItemLocal::ItemLocal( AttrNav *attrnav, char *item_name, char *attr,
case glow_eType_MB3Action:
case glow_eType_InputFocusMark:
case glow_eType_Relief:
case glow_eType_TextSize:
case ge_eAttrType_DynType:
case ge_eAttrType_DynTypeTone:
case ge_eAttrType_ActionType:
......
This diff is collapsed.
......@@ -29,6 +29,7 @@ extern "C" {
/*! \addtogroup GeDyn */
/*@{*/
#define TABLE_MAX_COL 12
#define DYN_FAST_MAX 10
#define FAST_CURVES 10
#define fast_mFunction_BeforeTrigg 4
......@@ -86,6 +87,7 @@ extern "C" {
ge_eDynPrio_Trend,
ge_eDynPrio_FastCurve,
ge_eDynPrio_AnalogText,
ge_eDynPrio_Table,
ge_eDynPrio_SliderBackground,
ge_eDynPrio_Video,
ge_eDynPrio_PopupMenu,
......@@ -137,7 +139,8 @@ extern "C" {
ge_mDynType_Video = 1 << 20,
ge_mDynType_FillLevel = 1 << 21,
ge_mDynType_FastCurve = 1 << 22,
ge_mDynType_AnalogText = 1 << 23
ge_mDynType_AnalogText = 1 << 23,
ge_mDynType_Table = 1 << 24
} ge_mDynType;
//! Action types.
......@@ -230,6 +233,7 @@ extern "C" {
ge_eSave_FillLevel = 27,
ge_eSave_FastCurve = 28,
ge_eSave_AnalogText = 29,
ge_eSave_Table = 30,
ge_eSave_PopupMenu = 50,
ge_eSave_SetDig = 51,
ge_eSave_ResetDig = 52,
......@@ -305,6 +309,42 @@ extern "C" {
ge_eSave_FillLevel_max_value = 2704,
ge_eSave_FastCurve_fast_object = 2800,
ge_eSave_AnalogText_super = 2900,
ge_eSave_Table_attribute1 = 3000,
ge_eSave_Table_format1 = 3001,
ge_eSave_Table_sel_attribute1 = 3002,
ge_eSave_Table_attribute2 = 3003,
ge_eSave_Table_format2 = 3004,
ge_eSave_Table_sel_attribute2 = 3005,
ge_eSave_Table_attribute3 = 3006,
ge_eSave_Table_format3 = 3007,
ge_eSave_Table_sel_attribute3 = 3008,
ge_eSave_Table_attribute4 = 3009,
ge_eSave_Table_format4 = 3010,
ge_eSave_Table_sel_attribute4 = 3011,
ge_eSave_Table_attribute5 = 3012,
ge_eSave_Table_format5 = 3013,
ge_eSave_Table_sel_attribute5 = 3014,
ge_eSave_Table_attribute6 = 3015,
ge_eSave_Table_format6 = 3016,
ge_eSave_Table_sel_attribute6 = 3017,
ge_eSave_Table_attribute7 = 3018,
ge_eSave_Table_format7 = 3019,
ge_eSave_Table_sel_attribute7 = 3020,
ge_eSave_Table_attribute8 = 3021,
ge_eSave_Table_format8 = 3022,
ge_eSave_Table_sel_attribute8 = 3023,
ge_eSave_Table_attribute9 = 3024,
ge_eSave_Table_format9 = 3025,
ge_eSave_Table_sel_attribute9 = 3026,
ge_eSave_Table_attribute10 = 3027,
ge_eSave_Table_format10 = 3028,
ge_eSave_Table_sel_attribute10 = 3029,
ge_eSave_Table_attribute11 = 3030,
ge_eSave_Table_format11 = 3031,
ge_eSave_Table_sel_attribute11 = 3032,
ge_eSave_Table_attribute12 = 3033,
ge_eSave_Table_format12 = 3034,
ge_eSave_Table_sel_attribute12 = 3035,
ge_eSave_PopupMenu_ref_object = 5000,
ge_eSave_SetDig_attribute = 5100,
ge_eSave_SetDig_instance = 5101,
......@@ -1784,6 +1824,49 @@ class GeFastCurve : public GeDynElem {
void set_attribute( grow_tObject object, char *attr_name, int *cnt);
};
//! Dynamics for a table object.
class GeTable : public GeDynElem {
public:
char attribute[TABLE_MAX_COL][120];
char format[TABLE_MAX_COL][80];
char sel_attribute[TABLE_MAX_COL][120];
int columns;
int rows;
char *p[TABLE_MAX_COL];
pwr_tSubid subid[TABLE_MAX_COL];
int size[TABLE_MAX_COL];
graph_eDatabase db[TABLE_MAX_COL];
bool first_scan;
char *old_value[TABLE_MAX_COL];
int type_id[TABLE_MAX_COL];
int elements[TABLE_MAX_COL];
pwr_tBoolean *sel_p[TABLE_MAX_COL];
pwr_tSubid sel_subid[TABLE_MAX_COL];
graph_eDatabase sel_db[TABLE_MAX_COL];
int sel_elements[TABLE_MAX_COL];
GeTable( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType_Table, (ge_mActionType) 0,
ge_eDynPrio_Table)
{ memset( attribute,0,sizeof(attribute)); memset( format,0,sizeof(format));
memset( sel_attribute,0,sizeof(sel_attribute)); memset(old_value,0,sizeof(old_value));
}
GeTable( const GeTable& x) :
GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio)
{ memcpy( attribute, x.attribute,sizeof(attribute)); memcpy( format, x.format, sizeof(format));
memcpy( sel_attribute, x.sel_attribute,sizeof(sel_attribute));}
void get_attributes( attr_sItem *attrinfo, int *item_count);
void save( ofstream& fp);
void open( ifstream& fp);
int connect( grow_tObject object, glow_sTraceData *trace_data);
int disconnect( grow_tObject object);
int scan( grow_tObject object);
int action( grow_tObject object, glow_tEvent event);
void set_attribute( grow_tObject object, char *attr_name, int *cnt);
};
//! Pulldown menu.
class GePulldownMenu : public GeDynElem {
public:
......
This diff is collapsed.
......@@ -851,7 +851,7 @@ class Graph {
is inverted (!), of type pwr_eType_String with size 80.
*/
graph_eDatabase parse_attr_name( char *name, char *parsed_name,
int *inverted, int *type, int *size);
int *inverted, int *type, int *size, int *elem = 0);
//! Get the default window size
/*!
......@@ -1062,6 +1062,30 @@ class Graph {
*/
void create_bar( grow_tObject *object, double x, double y);
//! Create a window object.
/*!
\param object Created bar object.
\param x x coordinate for object.
\param y y coordinate for object.
*/
void create_window( grow_tObject *object, double x, double y);
//! Create a table object.
/*!
\param object Created bar object.
\param x x coordinate for object.
\param y y coordinate for object.
*/
void create_table( grow_tObject *object, double x, double y);
//! Create a folder object.
/*!
\param object Created bar object.
\param x x coordinate for object.
\param y y coordinate for object.
*/
void create_folder( grow_tObject *object, double x, double y);
//! Create an axis object.
/*!
\param object Created axis object.
......
......@@ -151,6 +151,9 @@ menu Other
subgraph MenuBar pwr_exe:pwr_menubar.pwsg 6
subgraph PulldownMenu pwr_exe:pwr_pulldownmenu.pwsg 6
subgraph OptionMenu pwr_exe:pwr_optionmenu.pwsg 6
subgraph Window pwr_window.component 6
subgraph Table pwr_table.component 6
subgraph TabbedWindow pwr_folder.component 6
}
localsubgraphs Ssab ssab_exe:*.pwsg
menu Local
......
This diff is collapsed.
......@@ -40,6 +40,9 @@
#include "glow_growgroup.h"
#include "glow_growaxis.h"
#include "glow_growconglue.h"
#include "glow_growwindow.h"
#include "glow_growfolder.h"
#include "glow_growtable.h"
#include "glow_msg.h"
GlowArray::GlowArray( int allocate, int incr) : allocated( allocate),
......@@ -308,6 +311,56 @@ void GlowArray::copy_from( const GlowArray& array)
insert( n);
break;
}
case glow_eObjectType_GrowWindow:
{
GrowWindow *n = new GrowWindow(*(GrowWindow *)array.a[i]);
n->highlight = 0;
n->hot = 0;
// Fix, This should be done in the copy constructor !!!
if ( n->ctx->userdata_copy_callback)
(n->ctx->userdata_copy_callback)( n,
((GrowWindow *)array.a[i])->user_data, &n->user_data);
n->window_ctx = 0;
n->v_scrollbar = 0;
n->h_scrollbar = 0;
n->new_ctx();
n->configure_scrollbars();
insert( n);
break;
}
case glow_eObjectType_GrowFolder:
{
GrowFolder *n = new GrowFolder(*(GrowFolder *)array.a[i]);
n->highlight = 0;
n->hot = 0;
// Fix, This should be done in the copy constructor !!!
if ( n->ctx->userdata_copy_callback)
(n->ctx->userdata_copy_callback)( n,
((GrowFolder *)array.a[i])->user_data, &n->user_data);
n->window_ctx = 0;
n->v_scrollbar = 0;
n->h_scrollbar = 0;
n->new_ctx();
n->configure_scrollbars();
insert( n);
break;
}
case glow_eObjectType_GrowTable:
{
GrowTable *n = new GrowTable(*(GrowTable *)array.a[i]);
n->highlight = 0;
n->hot = 0;
// Fix, This should be done in the copy constructor !!!
if ( n->ctx->userdata_copy_callback)
(n->ctx->userdata_copy_callback)( n,
((GrowFolder *)array.a[i])->user_data, &n->user_data);
n->v_scrollbar = 0;
n->h_scrollbar = 0;
n->configure();
n->configure_scrollbars();
insert( n);
break;
}
default:
;
}
......@@ -929,6 +982,27 @@ void GlowArray::open( void *ctx, ifstream& fp)
insert( n);
break;
}
case glow_eSave_GrowWindow:
{
GrowWindow *n = new GrowWindow( (GlowCtx *) ctx, "");
n->open( fp);
insert( n);
break;
}
case glow_eSave_GrowTable:
{
GrowTable *n = new GrowTable( (GlowCtx *) ctx, "");
n->open( fp);
insert( n);
break;
}
case glow_eSave_GrowFolder:
{
GrowFolder *n = new GrowFolder( (GlowCtx *) ctx, "");
n->open( fp);
insert( n);
break;
}
case glow_eSave_GrowNode:
{
GrowNode *n = new GrowNode( (GlowCtx *) ctx, "", 0, 0, 0);
......
......@@ -166,6 +166,7 @@ class GlowArrayElem {
virtual void convert( glow_eConvert version) {};
virtual void set_rootnode( void *node) {};
virtual void set_linetype( glow_eLineType type) {};
virtual void set_input_focus( int focus) {};
virtual ~GlowArrayElem() {};
};
......
......@@ -5,7 +5,7 @@
#include <fstream.h>
#include "glow.h"
#include "glow_ctx.h"
#include "glow_growctx.h"
/*! \file glow_colpalctx.h
......@@ -22,7 +22,7 @@
When a color entry is activated, an event is sent to the registred callback routine for the event.
*/
class ColPalCtx : public GlowCtx {
class ColPalCtx : public GrowCtx {
public:
//! Constructor.
......@@ -31,7 +31,7 @@ class ColPalCtx : public GlowCtx {
\param zoom_fact Initial zoomfactor.
*/
ColPalCtx( char *ctx_name, double zoom_fact = 100) :
GlowCtx( ctx_name, zoom_fact), columns(30),
GrowCtx( ctx_name, zoom_fact), columns(30),
current_fill( glow_eDrawType_LineGray), current_border( glow_eDrawType_Line),
entry_width(0.3), entry_height(1), display_entry_width(3)
{ ctx_type = glow_eCtxType_ColPal; grid_on = 0; };
......
......@@ -64,7 +64,7 @@ GlowCtx::GlowCtx( char *ctx_name, double zoom_fact, int offs_x, int offs_y)
default_hot_mode(glow_eHotMode_SingleObject), hot_found(0),
double_buffered(0), double_buffer_on(0), draw_buffer_only(0),
userdata_save_callback(0), userdata_open_callback(0), userdata_copy_callback(0),
version(GLOW_VERSION), inputfocus_object(0)
version(GLOW_VERSION), inputfocus_object(0), is_component(0)
{
strcpy(name, ctx_name);
memset( (void *)event_callback, 0, sizeof(event_callback));
......@@ -517,11 +517,12 @@ void GlowCtx::set_defered_redraw()
void GlowCtx::redraw_defered()
{
defered_redraw_active--;
if ( !defered_redraw_active )
{
draw( defered_x_low, defered_y_low, defered_x_high, defered_y_high);
nav_draw( defered_x_low_nav, defered_y_low_nav, defered_x_high_nav,
defered_y_high_nav);
if ( !defered_redraw_active ) {
if ( defered_x_low < defered_x_high && defered_y_low < defered_y_high) {
draw( defered_x_low, defered_y_low, defered_x_high, defered_y_high);
nav_draw( defered_x_low_nav, defered_y_low_nav, defered_x_high_nav,
defered_y_high_nav);
}
}
}
......@@ -573,7 +574,8 @@ void GlowCtx::draw( int ll_x, int ll_y, int ur_x, int ur_y)
void GlowCtx::clear()
{
glow_draw_clear( this);
if ( !is_component)
glow_draw_clear( this);
}
void GlowCtx::cut()
......@@ -1819,7 +1821,7 @@ void GlowCtx::register_inputfocus( GlowArrayElem *object, int focus)
return;
if ( inputfocus_object)
((GrowNode *)inputfocus_object)->set_input_focus( 0);
inputfocus_object->set_input_focus( 0);
inputfocus_object = object;
if ( event_callback[glow_eEvent_InputFocusGained] ) {
......
......@@ -473,7 +473,7 @@ class GlowCtx {
/*! \param node Node. */
void redraw_node_cons( void *node);
//! Delete the connectsions connected to a specific node.
//! Delete the connections connected to a specific node.
/*! \param node Node.*/
void delete_node_cons( void *node);
......@@ -748,6 +748,7 @@ class GlowCtx {
int version; //!< Current glow version.
GlowTipText *tiptext; //!< Tip text object.
GlowArrayElem *inputfocus_object; //!< Object that has input focus.
int is_component; //!< Ctx is a window component.
//! Register scrollbar callback function
/*!
......
......@@ -677,8 +677,7 @@ int draw_event_handler( GlowCtx *ctx, XEvent event)
ctx->event_handler( glow_eEvent_MB1Down, event.xbutton.x, event.xbutton.y, 0, 0);
if ( draw_ctx->click_sensitivity & glow_mSensitivity_MB1Click &&
!(draw_ctx->click_sensitivity & glow_mSensitivity_MB1DoubleClick) &&
!(draw_ctx->click_sensitivity & glow_mSensitivity_MB1Press))
{
!(draw_ctx->click_sensitivity & glow_mSensitivity_MB1Press)) {
memcpy( &last_event, &event, sizeof(event));
button_pressed = 0;
button_clicked = 1;
......@@ -686,6 +685,15 @@ int draw_event_handler( GlowCtx *ctx, XEvent event)
last_press_y = event.xbutton.y;
return 1;
}
else if ( !(draw_ctx->click_sensitivity & glow_mSensitivity_MB1Click) &&
!(draw_ctx->click_sensitivity & glow_mSensitivity_MB1DoubleClick) &&
draw_ctx->click_sensitivity & glow_mSensitivity_MB1Press) {
memcpy( &last_event, &event, sizeof(event));
button_pressed = 1;
button_clicked = 0;
last_press_x = event.xbutton.x;
last_press_y = event.xbutton.y;
}
break;
case Button3:
ctx->event_handler( glow_eEvent_MB3Down, event.xbutton.x, event.xbutton.y, 0, 0);
......
This diff is collapsed.
......@@ -750,6 +750,19 @@ typedef GlowTraceData glow_sTraceData;
/*! \param ctx Grow context. */
void grow_ResetNodraw( grow_tCtx ctx);
//! Set defered redraw.
/*! \param ctx Grow context.
The redraw will be deferd until a call to redraw_defered() is made.
*/
void grow_SetDeferedRedraw( grow_tCtx ctx);
//! Execute the defered redrawings.
/*! \param ctx Grow context.
Execute redrawing the defered redrawing area since the call to set_defered_redraw().
*/
void grow_RedrawDefered( grow_tCtx ctx);
//! Redraw the window.
/*! \param ctx Grow context. */
void grow_Redraw( grow_tCtx ctx);
......@@ -909,6 +922,70 @@ typedef GlowTraceData glow_sTraceData;
int border, glow_eDrawType fill_draw_type, void *user_data,
grow_tObject *curve);
//! Create a window object, i.e an object of class GrowWindow.
/*!
\param ctx Grow context.
\param name Object name (max 31 char).
\param x x coordinate for position of lower left corner of the rectangle.
\param y y coordinate for position of lower left corner of the rectangle.
\param width Width of the rectangle.
\param height Height of the rectangle.
\param draw_type Border color.
\param line_width Line width of border.
\param display_level Display levels when the object is visible.
\param user_data User data.
\param bar Created GrowWindow object.
*/
void grow_CreateGrowWindow( grow_tCtx ctx, char *name,
double x, double y, double width, double height,
glow_eDrawType draw_type, int line_width,
glow_mDisplayLevel display_level, void *user_data,
grow_tObject *bar);
//! Create a table object, i.e an object of class GrowTable.
/*!
\param ctx Grow context.
\param name Object name (max 31 char).
\param x x coordinate for position of lower left corner of the rectangle.
\param y y coordinate for position of lower left corner of the rectangle.
\param width Width of the rectangle.
\param height Height of the rectangle.
\param draw_type Border color.
\param line_width Line width of border.
\param display_level Display levels when the object is visible.
\param user_data User data.
\param bar Created GrowWindow object.
*/
void grow_CreateGrowTable( grow_tCtx ctx, char *name,
double x, double y, double width, double height,
glow_eDrawType draw_type, int line_width,
int fill, glow_eDrawType fillcolor,
glow_mDisplayLevel display_level, void *user_data,
grow_tObject *bar);
//! Create a folder object, i.e an object of class GrowFolder.
/*!
\param ctx Grow context.
\param name Object name (max 31 char).
\param x x coordinate for position of lower left corner of the rectangle.
\param y y coordinate for position of lower left corner of the rectangle.
\param width Width of the rectangle.
\param height Height of the rectangle.
\param draw_type Border color.
\param line_width Line width of border.
\param selected_color Color of selected folder.
\param unselected_color Color of unseleced folder.
\param display_level Display levels when the object is visible.
\param user_data User data.
\param bar Created GrowFolder object.
*/
void grow_CreateGrowFolder( grow_tCtx ctx, char *name,
double x, double y, double width, double height,
glow_eDrawType draw_type, int line_width,
glow_eDrawType selected_color, glow_eDrawType unselected_color,
glow_mDisplayLevel display_level, void *user_data,
grow_tObject *bar);
//! Create a line, i.e an object of class GrowRect.
/*!
\param ctx Grow context.
......@@ -2579,6 +2656,46 @@ typedef GlowTraceData glow_sTraceData;
\param ctx Grow context.
\param version Version to convert to.
*/
//! Set parameters for a table object.
/*!
\param object Table object.
\param info Info struct.
*/
void grow_SetTableInfo( grow_tObject object, glow_sTableInfo *info);
//! Get parameters for a table object.
/*!
\param object Table object.
\param info Info struct.
*/
void grow_GetTableInfo( grow_tObject object, glow_sTableInfo *info);
//! Set value for a cell in a table object.
/*!
\param object Table object.
\param column Cell column.
\param row Cell row.
\param value Cell value.
*/
void grow_SetCellValue( grow_tObject object, int column, int row, char *value);
//! Set selected cell in a table object.
/*!
\param object Table object.
\param column Cell column.
\param row Cell row.
*/
void grow_SetSelectedCell( grow_tObject object, int column, int row);
//! Get selected cell in a table object.
/*!
\param object Table object.
\param column Cell column.
\param row Cell row.
*/
int grow_GetSelectedCell( grow_tObject object, int *column, int *row);
void grow_Convert( grow_tCtx ctx, glow_eConvert version);
//! Check if a nodeclass is extern.
......
......@@ -192,7 +192,7 @@ void GrowBar::draw( int *ll_x, int *ll_y, int *ur_x, int *ur_y)
int obj_ur_x = int( x_right * ctx->zoom_factor_x) - ctx->offset_x;
int obj_ll_x = int( x_left * ctx->zoom_factor_x) - ctx->offset_x;
int obj_ur_y = int( y_high * ctx->zoom_factor_y) - ctx->offset_y;
int obj_ll_y = int( y_low * ctx->zoom_factor_x) - ctx->offset_y;
int obj_ll_y = int( y_low * ctx->zoom_factor_y) - ctx->offset_y;
if ( *ll_x > *ur_x)
......
......@@ -30,6 +30,8 @@
#include "glow_growgroup.h"
#include "glow_growaxis.h"
#include "glow_growmenu.h"
#include "glow_growfolder.h"
#include "glow_growtable.h"
#include "glow_draw.h"
#include "glow_msg.h"
......@@ -520,6 +522,19 @@ int GrowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h)
break;
case glow_eEvent_ButtonMotion:
tiptext->remove();
for ( i = 0; i < a.a_size; i++) {
if ( a[i]->type() == glow_eObjectType_GrowWindow ||
a[i]->type() == glow_eObjectType_GrowTable ||
a[i]->type() == glow_eObjectType_GrowFolder) {
sts = a[i]->event_handler( glow_eEvent_ButtonMotion, x, y, fx, fy);
if ( sts) {
select_rect_active = 0;
node_movement_active = 0;
break;
}
}
}
if ( node_movement_active && edit_mode != grow_eMode_EditPolyLine)
{
int move_x, move_y;
......@@ -1944,6 +1959,7 @@ void GrowCtx::clear_all( int keep_paste)
cycle = glow_eCycle_Slow;
mb3_action = glow_eMB3Action_Close;
translate_on = 0;
inputfocus_object = 0;
nav_clear();
set_nodraw();
......@@ -1996,11 +2012,12 @@ void GrowCtx::clear_all( int keep_paste)
void GrowCtx::redraw_defered()
{
defered_redraw_active--;
if ( !defered_redraw_active )
{
draw( defered_x_low, defered_y_low, defered_x_high, defered_y_high);
nav_draw( defered_x_low_nav, defered_y_low_nav, defered_x_high_nav,
defered_y_high_nav);
if ( !defered_redraw_active ) {
if ( defered_x_low < defered_x_high && defered_y_low < defered_y_high) {
draw( defered_x_low, defered_y_low, defered_x_high, defered_y_high);
nav_draw( defered_x_low_nav, defered_y_low_nav, defered_x_high_nav,
defered_y_high_nav);
}
}
}
......@@ -2033,6 +2050,9 @@ void GrowCtx::draw( int ll_x, int ll_y, int ur_x, int ur_y)
#endif
glow_draw_set_clip_rectangle( this, ll_x, ll_y, ur_x, ur_y);
set_draw_buffer_only();
if ( redraw_callback)
(redraw_callback) ( redraw_data);
if ( double_buffer_on)
glow_draw_buffer_background( this);
for ( i = 0; i < a.a_size; i++) {
......@@ -2278,6 +2298,8 @@ void GrowCtx::flip_select( glow_eFlipDirection dir)
void GrowCtx::set_background( glow_eDrawType color)
{
if ( background_disabled)
return;
if ( enable_bg_pixmap && strcmp( background_image, "") != 0)
{
......@@ -2537,6 +2559,10 @@ void GrowCtx::set_select_textsize( int size)
((GrowText *)a_sel[i])->set_textsize( size);
else if ( a_sel[i]->type() == glow_eObjectType_GrowAxis)
((GrowAxis *)a_sel[i])->set_textsize( size);
else if ( a_sel[i]->type() == glow_eObjectType_GrowFolder)
((GrowFolder *)a_sel[i])->set_textsize( size);
else if ( a_sel[i]->type() == glow_eObjectType_GrowTable)
((GrowTable *)a_sel[i])->set_textsize( size);
}
}
......@@ -2547,6 +2573,10 @@ void GrowCtx::set_select_textbold( int bold)
((GrowText *)a_sel[i])->set_textbold( bold);
else if ( a_sel[i]->type() == glow_eObjectType_GrowAxis)
((GrowAxis *)a_sel[i])->set_textbold( bold);
else if ( a_sel[i]->type() == glow_eObjectType_GrowFolder)
((GrowFolder *)a_sel[i])->set_textbold( bold);
else if ( a_sel[i]->type() == glow_eObjectType_GrowTable)
((GrowTable *)a_sel[i])->set_textbold( bold);
}
}
......@@ -3282,6 +3312,31 @@ int GrowCtx::send_menu_callback( GlowArrayElem *object, int item, glow_eEvent ev
return 0;
}
int GrowCtx::send_table_callback( GlowArrayElem *object, glow_eEvent event,
double x, double y, int column, int row)
{
if ( event_callback[event] )
{
/* Send a table callback */
static glow_sEvent e;
e.event = event;
e.any.type = glow_eEventType_Table;
e.any.x_pixel = int( x * zoom_factor_x) - offset_x;
e.any.y_pixel = int( y * zoom_factor_y) - offset_y;
e.any.x = x;
e.any.y = y;
e.table.object_type = object->type();
e.table.object = object;
e.table.column = column;
e.table.row = row;
return event_callback[event]( this, &e);
}
return 0;
}
void GrowCtx::store_geometry()
{
stored_offset_x = offset_x;
......@@ -3334,10 +3389,13 @@ int GrowCtx::group_select( GlowArrayElem **group, char *last_group)
if ( a_sel.size() == 0)
return GLOW__NOSELECT;
// Connections in a group are not allowed
// Connections, windows and tables in a group are not allowed
for ( i = 0; i < a_sel.size(); i++) {
if ( a_sel[i]->type() == glow_eObjectType_Con)
return GLOW__CONSELECTED;
if ( a_sel[i]->type() == glow_eObjectType_Con ||
a_sel[i]->type() == glow_eObjectType_GrowWindow ||
a_sel[i]->type() == glow_eObjectType_GrowFolder ||
a_sel[i]->type() == glow_eObjectType_GrowTable)
return GLOW__GROUPCLASS;
}
strcpy( last_group, a_sel.get_last_group());
......
......@@ -59,7 +59,8 @@ class GrowCtx : public GlowCtx {
initial_position(glow_eDirection_Up), is_javaapplet(0),
is_javaapplication(0), cycle(glow_eCycle_Slow),
mb3_action(glow_eMB3Action_Close), scale_equal(0), translate_on(0),
input_focus_mark(glow_eInputFocusMark_Relief)
input_focus_mark(glow_eInputFocusMark_Relief), background_disabled(0),
redraw_callback(0), redraw_data(0)
{ ctx_type = glow_eCtxType_Grow;
strcpy( name, "");
strcpy( java_name, "");
......@@ -592,6 +593,21 @@ class GrowCtx : public GlowCtx {
int send_menu_callback( GlowArrayElem *object, int item, glow_eEvent event,
double x, double y);
//! Send a table callback if such a callback is registred.
/*!
\param object Menu object.
\param item Activated menu item.
\param event Menu event.
\param x x coordinate.
\param y y coordinate.
\param column Activated cell column.
\param row Activated cell row.
Send a table callback.
*/
int send_table_callback( GlowArrayElem *object, glow_eEvent event,
double x, double y, int column, int row);
//! Get configured scantimes.
/*!
\param time Scantime for slow cycle.
......@@ -794,9 +810,12 @@ class GrowCtx : public GlowCtx {
int is_javaapplication; //!< Graph is exported as a java frame.
glow_eCycle cycle; //!< Fast of slow cycle as default for subgraph.
glow_eMB3Action mb3_action; //!< Action performed when MB3 is clicked.
int scale_equal; //!< Scaleing of objects are equal in x and y direction.
int translate_on; //!< Send a translate callback to translate all texts of text objects and annotations.
int scale_equal; //!< Scaleing of objects are equal in x and y direction.
int translate_on; //!< Send a translate callback to translate all texts of text objects and annotations.
glow_eInputFocusMark input_focus_mark; //!< How to mark input focus for a subgraph.
int background_disabled; //!< Disable drawing of background.
void (*redraw_callback)( void *); //!< Backcall function before drawing (if ctx is window component).
void *redraw_data; //!< Data for redraw callback.
};
void grow_auto_scrolling( GrowCtx *ctx);
......@@ -806,3 +825,5 @@ void grow_auto_scrolling( GrowCtx *ctx);
This diff is collapsed.
#ifndef glow_growfolder_h
#define glow_growfolder_h
#include "glow_growwindow.h"
#include "glow_tracedata.h"
/*! \file glow_growfolder.h
\brief Contains the GrowFolder class. */
/*! \addtogroup Glow */
/*@{*/
#define MAX_FOLDERS 12
//! Class for drawing a folder object.
/*! A GrowFolder is a component that displays another graph, inside its borders.
The GrowFolder class contains function for drawing the object, and handle events when the
object is clicked on, moved etc.
*/
class GrowFolder : public GrowWindow {
public:
//! Constuctor
/*!
\param glow_ctx The glow context.
\param name Name (max 31 char).
\param x x coordinate for position.
\param y y coordinate for position.
\param w Width.
\param h Height.
\param border_d_type Border color.
\param line_w Linewidth of border.
\param display_lev Displaylevel when this object is visible.
\param nodraw Don't draw the object now.
*/
GrowFolder( GlowCtx *glow_ctx, char *name, double x = 0, double y = 0,
double w = 0, double h = 0,
glow_eDrawType border_d_type = glow_eDrawType_Line,
int line_w = 1, glow_eDrawType sel_color = glow_eDrawType_LightGray,
glow_eDrawType unsel_color = glow_eDrawType_MediumGray,
glow_mDisplayLevel display_lev = glow_mDisplayLevel_1,
int nodraw = 0);
//! Destructor
/*! Remove the object from context, and erase it from the screen.
*/
~GrowFolder();
//! Save the content of the object to file.
/*!
\param fp Ouput file.
\param mode Not used.
*/
void save( ofstream& fp, glow_eSaveMode mode);
//! Read the content of the object from file.
/*!
\param fp Input file.
*/
void open( ifstream& fp);
//! Erase the object
void erase()
{ erase( (GlowTransform *)NULL, hot, NULL);};
//! Erase the object in the navigator window.
void nav_erase()
{ nav_erase( (GlowTransform *)NULL, NULL);};
//! Draw the objects if any part is inside the drawing area.
/*!
\param ll_x Lower left x coordinate of drawing area.
\param ll_y Lower left y coordinate of drawing area.
\param ur_x Upper right x coordinate of drawing area.
\param ur_y Upper right y coordinate of drawing area.
*/
void draw( int ll_x, int ll_y, int ur_x, int ur_y);
//! Draw the objects if any part is inside the drawing area, and extends the drawing area.
/*!
\param ll_x Lower left x coordinate of drawing area.
\param ll_y Lower left y coordinate of drawing area.
\param ur_x Upper right x coordinate of drawing area.
\param ur_y Upper right y coordinate of drawing area.
If some part of object is inside the drawing area, and also outside the drawing area,
the drawingarea is extended so it contains the whole objects.
*/
void draw( int *ll_x, int *ll_y, int *ur_x, int *ur_y);
//! Drawing in the navigation window. See the corresponding draw function.
void nav_draw(int ll_x, int ll_y, int ur_x, int ur_y);
//! Set object highlight.
/*!
\param on If 1, set highlight. If 0, reset highlight.
*/
void set_highlight( int on);
//! Get the object type
/*!
\return The type of the object.
*/
glow_eObjectType type() { return glow_eObjectType_GrowFolder;};
int folders; //!< Number of folders.
int text_size; //!< Header text size.
glow_eDrawType text_drawtype; //!< Header text drawtype.
glow_eDrawType text_color_drawtype; //!< Header text color.
double header_height; //!< Header height.
char folder_file_names[MAX_FOLDERS][80]; //!< Filenames for the folders.
char folder_text[MAX_FOLDERS][80]; //!< Folder text.
double folder_scale[MAX_FOLDERS]; //!< Scale for each folder.
int folder_v_scrollbar[MAX_FOLDERS]; //!< Vertical scrollbar for each folder.
int folder_h_scrollbar[MAX_FOLDERS]; //!< Horizontal scrollbar for each folder.
int current_folder; //!< The currently selected folder.
glow_eDrawType color_selected; //!< Color of selected folder.
glow_eDrawType color_unselected; //!< Color of unselected folder.
//! Draw the object.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be zero.
The object is drawn with border, fill and shadow. If t is not zero, the current tranform is
multiplied with the parentnodes transform, to give the appropriate coordinates for the drawing.
*/
void draw( GlowTransform *t, int highlight, int hot, void *node, void *colornode);
//! Erase the object.
/*!
\param t Transform of parent node.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
*/
void erase( GlowTransform *t, int hot, void *node);
//! Redraw the area inside the objects border.
void draw();
//! Draw the object in the navigation window.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be zero.
*/
void nav_draw( GlowTransform *t, int highlight, void *node, void *colornode);
//! Erase the object in the navigation window.
/*!
\param t Transform of parent node.
\param node Parent node. Can be zero.
*/
void nav_erase( GlowTransform *t, void *node);
//! Export the object as a javabean.
/*!
\param t Transform of parent node. Can be zero.
\param node Parent node. Can be zero.
\param pass Export pass.
\param shape_cnt Current index in a shape vector.
\param node_cnt Counter used for javabean name. Not used for this kind of object.
\param in_nc Member of a nodeclass. Not used for this kind of object.
\param fp Output file.
The object is transformed to the current zoom factor, and GlowExportJBean is used to generate
java code for the bean.
*/
void export_javabean( GlowTransform *t, void *node,
glow_eExportPass pass, int *shape_cnt, int node_cnt, int in_nc, ofstream &fp);
//! Conversion between different versions of Glow
/*!
\param version Version to convert to.
*/
void convert( glow_eConvert version);
int event_handler( glow_eEvent event, int x, int y, double fx,
double fy);
//! Check if new filename
void update_attributes();
//! Set text size
/*!
\param size Size index 0-8.
*/
void set_textsize( int size);
//! Set text bold
/*!
\param bold Text is bold.
*/
void set_textbold( int bold);
//! Set original text color.
/*!
\param drawtype Text color.
*/
void set_original_text_color( glow_eDrawType drawtype)
{ text_color_drawtype = drawtype; draw();};
};
/*@}*/
#endif
......@@ -75,7 +75,7 @@ void GrowMenu::draw( int *ll_x, int *ll_y, int *ur_x, int *ur_y)
int obj_ur_x = int( x_right * ctx->zoom_factor_x) - ctx->offset_x;
int obj_ll_x = int( x_left * ctx->zoom_factor_x) - ctx->offset_x;
int obj_ur_y = int( y_high * ctx->zoom_factor_y) - ctx->offset_y;
int obj_ll_y = int( y_low * ctx->zoom_factor_x) - ctx->offset_y;
int obj_ll_y = int( y_low * ctx->zoom_factor_y) - ctx->offset_y;
if ( *ll_x > *ur_x)
......
This diff is collapsed.
#ifndef glow_growscrollbar_h
#define glow_growscrollbar_h
#include "glow_growrect.h"
#include "glow_tracedata.h"
/*! \file glow_growscrollbar.h
\brief Contains the GrowScrollBar class. */
/*! \addtogroup Glow */
/*@{*/
//! Class for handling a scrollbar object.
/*! A GrowScrollBar object makes it possible to change the viewed area in a window object.
The GrowScrollBar class contains function for drawing the object, and handle events when the
object is clicked on, moved etc.
*/
class GrowScrollBar : public GrowRect {
public:
//! Constuctor
/*!
\param glow_ctx The glow context.
\param name Name (max 31 char).
\param x x coordinate for position.
\param y y coordinate for position.
\param w Width.
\param h Height.
\param dir Direction.
\param border_d_type Border color.
\param line_w Linewidth of border.
\param display_lev Displaylevel when this object is visible.
\param fill_d_type Fill color.
\param bar_d_type Bar color.
\param nodraw Don't draw the object now.
*/
GrowScrollBar( GlowCtx *glow_ctx, char *name, double x = 0, double y = 0,
double w = 0, double h = 0, glow_eDir dir = glow_eDir_Vertical,
glow_eDrawType border_d_type = glow_eDrawType_Line,
int line_w = 1,
glow_mDisplayLevel display_lev = glow_mDisplayLevel_1,
glow_eDrawType fill_d_type = glow_eDrawType_Line,
glow_eDrawType bar_d_type = glow_eDrawType_LightGray, int nodraw = 0);
//! Destructor
/*! Remove the object from context, and erase it from the screen.
*/
~GrowScrollBar();
//! Save the content of the object to file.
/*!
\param fp Ouput file.
\param mode Not used.
*/
void save( ofstream& fp, glow_eSaveMode mode);
//! Read the content of the object from file.
/*!
\param fp Input file.
*/
void open( ifstream& fp);
//! Erase the object
void erase()
{ erase( (GlowTransform *)NULL, hot, NULL);};
//! Erase the object in the navigator window.
void nav_erase()
{ nav_erase( (GlowTransform *)NULL, NULL);};
//! Set object highlight.
/*!
\param on If 1, set highlight. If 0, reset highlight.
*/
void set_highlight( int on);
//! Get the object type
/*!
\return The type of the object.
*/
glow_eObjectType type() { return glow_eObjectType_GrowScrollBar;};
double max_value; //!< Max value for bar value
double min_value; //!< Min value for bar value
double bar_value; //!< Bar value
double bar_length; //!< Bar length
void *user_data; //!< User data.
glow_eDir direction; //!< Vertical or horizontal direction.
int movement_active; //!< The scrollbar i currently moved.
double start_pos; //!< Cursor start position for movement.
double start_value; //!< Bar value when movement is started.
void *callback_userdata; //!< Userdata in value change callback.
void (*value_changed_cb)( void *, double); //!< Callback when value is changed
glow_eDrawType bar_color; //!< Color of bar.
void register_value_changed_cb( void *userdata, void (*value_changed)(void *, double)) {
callback_userdata = userdata, value_changed_cb = value_changed; }
int event_handler( glow_eEvent event, int x, int y, double fx,
double fy);
//! Draw the object.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be zero.
The object is drawn with border, fill and shadow. If t is not zero, the current tranform is
multiplied with the parentnodes transform, to give the appropriate coordinates for the drawing.
*/
void draw( GlowTransform *t, int highlight, int hot, void *node, void *colornode);
//! Erase the object.
/*!
\param t Transform of parent node.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
*/
void erase( GlowTransform *t, int hot, void *node);
//! Redraw the area inside the objects border.
void draw() { draw(0,0,0,0,0);}
//! Draw the object in the navigation window.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be zero.
*/
void nav_draw( GlowTransform *t, int highlight, void *node, void *colornode);
//! Erase the object in the navigation window.
/*!
\param t Transform of parent node.
\param node Parent node. Can be zero.
*/
void nav_erase( GlowTransform *t, void *node);
//! Set the bar value
/*!
\param value Bar value.
\param length Bar length.
*/
void set_value( double value, double length) { bar_value = value; bar_length = length;
if ( !fill) erase();
draw();};
//! Set the range for the bar value
/*!
\param min Min value.
\param max Max value.
*/
void set_range( double min, double max);
//! Set user data.
/*!
\param data User data.
*/
void set_user_data( void *data) { user_data = data;};
//! Get user data.
/*!
\param data User data.
*/
void get_user_data( void **data) { *data = user_data;};
//! Export the object as a javabean.
/*!
\param t Transform of parent node. Can be zero.
\param node Parent node. Can be zero.
\param pass Export pass.
\param shape_cnt Current index in a shape vector.
\param node_cnt Counter used for javabean name. Not used for this kind of object.
\param in_nc Member of a nodeclass. Not used for this kind of object.
\param fp Output file.
The object is transformed to the current zoom factor, and GlowExportJBean is used to generate
java code for the bean.
*/
void export_javabean( GlowTransform *t, void *node,
glow_eExportPass pass, int *shape_cnt, int node_cnt, int in_nc, ofstream &fp);
//! Conversion between different versions of Glow
/*!
\param version Version to convert to.
*/
void convert( glow_eConvert version);
void set_position( double x, double y, double width, double height)
{ ll.posit(x,y); ur.posit(x+width,y+height);}
void set_colors( glow_eDrawType bg_color, glow_eDrawType b_color)
{ fill_drawtype = bg_color; bar_color = b_color;}
void set_shadow( int shadowval) { shadow = shadowval;}
};
/*@}*/
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef glow_growwindow_h
#define glow_growwindow_h
#include "glow_growrect.h"
#include "glow_tracedata.h"
/*! \file glow_growwindow.h
\brief Contains the GrowWindow class. */
/*! \addtogroup Glow */
/*@{*/
class GrowCtx;
class GrowScrollBar;
//! Class for drawing a bar object.
/*! A GrowWindow is a component that displays another graph, inside its borders.
The GrowWindow class contains function for drawing the object, and handle events when the
object is clicked on, moved etc.
*/
class GrowWindow : public GrowRect {
public:
//! Constuctor
/*!
\param glow_ctx The glow context.
\param name Name (max 31 char).
\param x x coordinate for position.
\param y y coordinate for position.
\param w Width.
\param h Height.
\param border_d_type Border color.
\param line_w Linewidth of border.
\param display_lev Displaylevel when this object is visible.
\param nodraw Don't draw the object now.
*/
GrowWindow( GlowCtx *glow_ctx, char *name, double x = 0, double y = 0,
double w = 0, double h = 0,
glow_eDrawType border_d_type = glow_eDrawType_Line,
int line_w = 1,
glow_mDisplayLevel display_lev = glow_mDisplayLevel_1,
int nodraw = 0);
//! Destructor
/*! Remove the object from context, and erase it from the screen.
*/
~GrowWindow();
//! Save the content of the object to file.
/*!
\param fp Ouput file.
\param mode Not used.
*/
void save( ofstream& fp, glow_eSaveMode mode);
//! Read the content of the object from file.
/*!
\param fp Input file.
*/
void open( ifstream& fp);
//! Erase the object
void erase()
{ erase( (GlowTransform *)NULL, hot, NULL);};
//! Erase the object in the navigator window.
void nav_erase()
{ nav_erase( (GlowTransform *)NULL, NULL);};
//! Draw the objects if any part is inside the drawing area.
/*!
\param ll_x Lower left x coordinate of drawing area.
\param ll_y Lower left y coordinate of drawing area.
\param ur_x Upper right x coordinate of drawing area.
\param ur_y Upper right y coordinate of drawing area.
*/
void draw( int ll_x, int ll_y, int ur_x, int ur_y);
//! Draw the objects if any part is inside the drawing area, and extends the drawing area.
/*!
\param ll_x Lower left x coordinate of drawing area.
\param ll_y Lower left y coordinate of drawing area.
\param ur_x Upper right x coordinate of drawing area.
\param ur_y Upper right y coordinate of drawing area.
If some part of object is inside the drawing area, and also outside the drawing area,
the drawingarea is extended so it contains the whole objects.
*/
void draw( int *ll_x, int *ll_y, int *ur_x, int *ur_y);
//! Drawing in the navigation window. See the corresponding draw function.
void nav_draw(int ll_x, int ll_y, int ur_x, int ur_y);
//! Set object highlight.
/*!
\param on If 1, set highlight. If 0, reset highlight.
*/
void set_highlight( int on);
//! Get the object type
/*!
\return The type of the object.
*/
glow_eObjectType type() { return glow_eObjectType_GrowWindow;};
char file_name[80]; //!< Graph file name.
char input_file_name[80]; //!< Filename inserted in attribute editor.
GlowTraceData trace; //!< Obsolete
void *user_data; //!< User data.
GrowCtx *window_ctx; //!< Window grow context.
int vertical_scrollbar; //!< Draw vertical scrollbar.
int horizontal_scrollbar; //!< Draw horizontal scrollbar.
double scrollbar_width; //!< Width of scrollbar objects.
GrowScrollBar *v_scrollbar; //!< Vertical scrollbar object.
GrowScrollBar *h_scrollbar; //!< Horizontal scrollbar object.
double v_value; //!< Value of vertical scrollbar.
double h_value; //!< Value of horizontal scrollbar.
double wctx_x0; //!< Coordinate for left border of window ctx.
double wctx_x1; //!< Coordinate for right border of window ctx.
double wctx_y0; //!< Coordinate for low border of window ctx.
double wctx_y1; //!< Coordiante for high border of window ctx.
glow_eDrawType scrollbar_color; //!< Color of scrollbar bar.
glow_eDrawType scrollbar_bg_color; //!< Color of scrollbar background.
double window_scale; //!< Scale of window ctx.
double y_low_offs; //!< y low offset.
//! Draw the object.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be zero.
The object is drawn with border, fill and shadow. If t is not zero, the current tranform is
multiplied with the parentnodes transform, to give the appropriate coordinates for the drawing.
*/
void draw( GlowTransform *t, int highlight, int hot, void *node, void *colornode);
//! Erase the object.
/*!
\param t Transform of parent node.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
*/
void erase( GlowTransform *t, int hot, void *node);
//! Redraw the area inside the objects border.
void draw();
//! Draw the object in the navigation window.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be zero.
*/
void nav_draw( GlowTransform *t, int highlight, void *node, void *colornode);
//! Erase the object in the navigation window.
/*!
\param t Transform of parent node.
\param node Parent node. Can be zero.
*/
void nav_erase( GlowTransform *t, void *node);
//! Scan trace
/*! Calls the trace scan callback for the object.
*/
void trace_scan();
//! Init trace
/*! Calls the trace connect callback for the object.
*/
int trace_init();
//! Close trace
/*! Calls the trace disconnect callback for the object.
*/
void trace_close();
//! Moves object to alignment line or point.
/*!
\param x x coordinate of alignment point.
\param y y coordinate of alignment point.
\param direction Type of alignment.
*/
void align( double x, double y, glow_eAlignDirection direction);
//! Set the range for the bar value
/*!
\param min Min value.
\param max Max value.
*/
//! Set user data.
/*!
\param data User data.
*/
void set_user_data( void *data) { user_data = data;};
//! Get user data.
/*!
\param data User data.
*/
void get_user_data( void **data) { *data = user_data;};
//! Export the object as a javabean.
/*!
\param t Transform of parent node. Can be zero.
\param node Parent node. Can be zero.
\param pass Export pass.
\param shape_cnt Current index in a shape vector.
\param node_cnt Counter used for javabean name. Not used for this kind of object.
\param in_nc Member of a nodeclass. Not used for this kind of object.
\param fp Output file.
The object is transformed to the current zoom factor, and GlowExportJBean is used to generate
java code for the bean.
*/
void export_javabean( GlowTransform *t, void *node,
glow_eExportPass pass, int *shape_cnt, int node_cnt, int in_nc, ofstream &fp);
//! Conversion between different versions of Glow
/*!
\param version Version to convert to.
*/
void convert( glow_eConvert version);
int event_handler( glow_eEvent event, int x, int y, double fx,
double fy);
//! Check if new filename
void update_attributes();
//! Create a new grow context
void new_ctx();
// Configure the scrollbars
void configure_scrollbars();
void set_transform_from_stored( GlowTransform *t);
void set_fill( int fillval) {}
void set_fill_color( glow_eDrawType drawtype) {}
void set_original_fill_color( glow_eDrawType drawtype) {}
void set_rotation( double angel, double x0, double y0,
glow_eRotationPoint type) {}
void flip( double x0, double y0, glow_eFlipDirection dir) {}
void set_transform( GlowTransform *t) {}
void draw_background();
void set_shadow( int shadowval) { shadow = shadowval; configure_scrollbars(); draw();}
void zoom();
static void v_value_changed_cb( void *o, double value);
static void h_value_changed_cb( void *o, double value);
static void redraw_cb( void *o);
};
/*@}*/
#endif
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