Commit bc4f0b73 authored by Claes Sjofors's avatar Claes Sjofors

Ge curve window, Period Markers added and buttons to move marker 2 with Click MB1

parent 7f93fb12
...@@ -94,6 +94,7 @@ ge_sTimeComboText curve_timecombo_text[] = { ...@@ -94,6 +94,7 @@ ge_sTimeComboText curve_timecombo_text[] = {
{"This Year", time_ePeriod_ThisYear}, {"This Year", time_ePeriod_ThisYear},
{"All Time", time_ePeriod_AllTime}, {"All Time", time_ePeriod_AllTime},
{"Edit", time_ePeriod_UserDefined}, {"Edit", time_ePeriod_UserDefined},
{"Markers", ge_ePeriod_Markers},
{"", time_ePeriod_}}; {"", time_ePeriod_}};
...@@ -289,8 +290,11 @@ void GeCurveGtk::activate_timecombo( GtkWidget *w, gpointer data) ...@@ -289,8 +290,11 @@ void GeCurveGtk::activate_timecombo( GtkWidget *w, gpointer data)
if ( period == time_ePeriod_UserDefined) if ( period == time_ePeriod_UserDefined)
curve->activate_edit(); curve->activate_edit();
else if ( period == ge_ePeriod_Markers)
curve->activate_period_markers();
else else
curve->activate_period( period); curve->activate_period( period);
curve->current_period = period;
} }
void GeCurveGtk::activate_background( GtkWidget *w, gpointer data) void GeCurveGtk::activate_background( GtkWidget *w, gpointer data)
...@@ -763,6 +767,7 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx, ...@@ -763,6 +767,7 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
const int nav_height = 120; const int nav_height = 120;
pwr_tFileName fname; pwr_tFileName fname;
float height_scale = 1; float height_scale = 1;
int nonav = 0;
if ( gc_width != 0) if ( gc_width != 0)
window_width = gc_width; window_width = gc_width;
...@@ -1099,13 +1104,17 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx, ...@@ -1099,13 +1104,17 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
gtk_box_pack_start( GTK_BOX(sea_timebox), GTK_WIDGET(curvebuttonbox), FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX(sea_timebox), GTK_WIDGET(curvebuttonbox), FALSE, FALSE, 0);
GtkWidget *w; GtkWidget *w;
grownames_main_widget = scrolledgrowwidgetgtk_new( init_grownames_cb, this, &w); grownames_main_widget = scrolledgrowwidgetgtk_new( init_grownames_cb, this, &w);
growcurve_main_widget = curvewidgetgtk_new( init_growcurve_cb, this); if ( nonav)
growcurve_main_widget = scrolledcurvewidgetgtk_new( init_growcurve_cb, this, &w);
else
growcurve_main_widget = curvewidgetgtk_new( init_growcurve_cb, this);
growaxis_main_widget = growwidgetgtk_new( init_growaxis_cb, this); growaxis_main_widget = growwidgetgtk_new( init_growaxis_cb, this);
nav_widget = curvenavwidgetgtk_new( growcurve_main_widget); if (!nonav)
nav_widget = curvenavwidgetgtk_new( growcurve_main_widget);
GtkWidget *hbox = gtk_hbox_new( FALSE, 0); GtkWidget *hbox = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(hbox), growaxis_main_widget, FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX(hbox), growaxis_main_widget, FALSE, FALSE, 0);
...@@ -1120,7 +1129,8 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx, ...@@ -1120,7 +1129,8 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
gtk_widget_show_all( vpaned1); gtk_widget_show_all( vpaned1);
gtk_paned_pack1( GTK_PANED(vpaned2), hbox, TRUE, TRUE); gtk_paned_pack1( GTK_PANED(vpaned2), hbox, TRUE, TRUE);
gtk_paned_pack2( GTK_PANED(vpaned2), nav_widget, FALSE, TRUE); if ( !nonav)
gtk_paned_pack2( GTK_PANED(vpaned2), nav_widget, FALSE, TRUE);
gtk_widget_show_all( vpaned2); gtk_widget_show_all( vpaned2);
GtkWidget *tools_box = gtk_hbox_new( FALSE, 0); GtkWidget *tools_box = gtk_hbox_new( FALSE, 0);
......
This diff is collapsed.
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
#define CURVE_MAX_COLS 101 #define CURVE_MAX_COLS 101
#define ge_ePeriod_Markers ((time_ePeriod)1000)
typedef enum { typedef enum {
curve_mOptions_FullScreen = 1 << 0, curve_mOptions_FullScreen = 1 << 0,
curve_mOptions_Maximize = 1 << 1, curve_mOptions_Maximize = 1 << 1,
...@@ -167,6 +169,10 @@ class GeCurve { ...@@ -167,6 +169,10 @@ class GeCurve {
grow_tObject curve_markobject1; grow_tObject curve_markobject1;
grow_tObject curve_markobject2; grow_tObject curve_markobject2;
GeCurveData *cd; GeCurveData *cd;
grow_tObject mark1_text;
grow_tObject mark2_text;
grow_tObject mark1_rect;
grow_tObject mark2_rect;
double axis_window_width; double axis_window_width;
int hide[CURVE_MAX_COLS]; int hide[CURVE_MAX_COLS];
grow_tObject name_rect[CURVE_MAX_COLS+1]; grow_tObject name_rect[CURVE_MAX_COLS+1];
...@@ -203,12 +209,16 @@ class GeCurve { ...@@ -203,12 +209,16 @@ class GeCurve {
double last_cursor_x; double last_cursor_x;
double last_mark1_x; double last_mark1_x;
double last_mark2_x; double last_mark2_x;
pwr_tTime last_mark1_time;
pwr_tTime last_mark2_time;
int deferred_configure_axes; int deferred_configure_axes;
CoWow *wow; CoWow *wow;
int center_from_window; int center_from_window;
unsigned int options; unsigned int options;
unsigned int layout_mask; unsigned int layout_mask;
int color_theme; int color_theme;
int selected_mark;
time_ePeriod current_period;
GeCurve( void *gc_parent_ctx, char *curve_name, GeCurve( void *gc_parent_ctx, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right, char *filename, GeCurveData *curve_data, int pos_right,
...@@ -254,6 +264,7 @@ class GeCurve { ...@@ -254,6 +264,7 @@ class GeCurve {
void activate_filledcurves( int set); void activate_filledcurves( int set);
void activate_help(); void activate_help();
void activate_period( time_ePeriod); void activate_period( time_ePeriod);
void activate_period_markers();
void activate_edit(); void activate_edit();
void activate_minmax_ok( double min_value, double max_value); void activate_minmax_ok( double min_value, double max_value);
void activate_minmax_save( double min_value, double max_value); void activate_minmax_save( double min_value, double max_value);
...@@ -263,6 +274,8 @@ class GeCurve { ...@@ -263,6 +274,8 @@ class GeCurve {
void set_center_from_window( int val) { center_from_window = val;} void set_center_from_window( int val) { center_from_window = val;}
void set_title( const char *str); void set_title( const char *str);
void update_color_theme( int ct); void update_color_theme( int ct);
void set_times_markers();
void update_times_markers();
static int growcurve_cb( GlowCtx *ctx, glow_tEvent event); static int growcurve_cb( GlowCtx *ctx, glow_tEvent event);
static int init_growcurve_cb( GlowCtx *fctx, void *client_data); static int init_growcurve_cb( GlowCtx *fctx, void *client_data);
......
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