Commit 81fe9f73 authored by Claes Sjofors's avatar Claes Sjofors

Xtt show existance of event moretext in alarmlist (refs #143)

parent fd961039
#define xnav_bitmap_info10_width 10
#define xnav_bitmap_info10_height 10
static unsigned char xnav_bitmap_info10_bits[] = {
0x55, 0x03, 0x30, 0x02, 0x31, 0x02, 0x00, 0x02, 0x31, 0x02, 0x30, 0x02,
0x31, 0x02, 0x30, 0x02, 0x01, 0x02, 0xff, 0x03};
#define xnav_bitmap_info12_width 12
#define xnav_bitmap_info12_height 12
static unsigned char xnav_bitmap_info12_bits[] = {
0x55, 0x0d, 0x60, 0x08, 0x61, 0x08, 0x00, 0x08, 0x61, 0x08, 0x60, 0x08,
0x61, 0x08, 0x60, 0x08, 0x61, 0x08, 0x00, 0x08, 0xff, 0x0f, 0x00, 0x00};
#define xnav_bitmap_info14_width 14
#define xnav_bitmap_info14_height 14
static unsigned char xnav_bitmap_info14_bits[] = {
0x55, 0x35, 0x00, 0x20, 0xc1, 0x20, 0xc0, 0x20, 0x01, 0x20, 0xc0, 0x20,
0xc1, 0x20, 0xc0, 0x20, 0xc1, 0x20, 0xc0, 0x20, 0xc1, 0x20, 0xc0, 0x20,
0x01, 0x20, 0xff, 0x3f};
#define xnav_bitmap_info16_width 16
#define xnav_bitmap_info16_height 16
static unsigned char xnav_bitmap_info16_bits[] = {
0x55, 0xd5, 0x00, 0x80, 0xc1, 0x81, 0xc0, 0x81, 0xc1, 0x81, 0x00, 0x80,
0xc1, 0x81, 0xc0, 0x81, 0xc1, 0x81, 0xc0, 0x81, 0xc1, 0x81, 0xc0, 0x81,
0xc1, 0x81, 0xc0, 0x81, 0x01, 0x80, 0xff, 0xff};
#define xnav_bitmap_info18_width 18
#define xnav_bitmap_info18_height 18
static unsigned char xnav_bitmap_info18_bits[] = {
0x55, 0x55, 0x03, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x03, 0x02,
0x81, 0x03, 0x02, 0x80, 0x03, 0x02, 0x01, 0x00, 0x02, 0x80, 0x03, 0x02,
0x81, 0x03, 0x02, 0x80, 0x03, 0x02, 0x81, 0x03, 0x02, 0x80, 0x03, 0x02,
0x81, 0x03, 0x02, 0x80, 0x03, 0x02, 0x81, 0x03, 0x02, 0x80, 0x03, 0x02,
0x01, 0x00, 0x02, 0xff, 0xff, 0x03};
#define xnav_bitmap_info20_width 20
#define xnav_bitmap_info20_height 20
static unsigned char xnav_bitmap_info20_bits[] = {
0x55, 0x55, 0x0d, 0xaa, 0xaa, 0x0e, 0x01, 0x00, 0x0c, 0x02, 0x07, 0x0c,
0x01, 0x07, 0x0c, 0x02, 0x07, 0x0c, 0x01, 0x00, 0x0c, 0x02, 0x07, 0x0c,
0x01, 0x07, 0x0c, 0x02, 0x07, 0x0c, 0x01, 0x07, 0x0c, 0x02, 0x07, 0x0c,
0x01, 0x07, 0x0c, 0x02, 0x07, 0x0c, 0x01, 0x07, 0x0c, 0x02, 0x07, 0x0c,
0x01, 0x07, 0x0c, 0x02, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f};
#define xnav_bitmap_info24_width 24
#define xnav_bitmap_info24_height 24
static unsigned char xnav_bitmap_info24_bits[] = {
0x55, 0x55, 0xd5, 0xaa, 0xaa, 0xea, 0x01, 0x00, 0xc0, 0x02, 0x00, 0xc0,
0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0, 0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0,
0x01, 0x00, 0xc0, 0x02, 0x00, 0xc0, 0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0,
0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0, 0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0,
0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0, 0x01, 0x3c, 0xc0, 0x02, 0x3c, 0xc0,
0x01, 0x00, 0xc0, 0x02, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
#define xnav_bitmap_info8_width 8
#define xnav_bitmap_info8_height 8
static unsigned char xnav_bitmap_info8_bits[] = {
0xdd, 0x98, 0x81, 0x98, 0x99, 0x98, 0x99, 0xff};
......@@ -349,12 +349,14 @@ void CoWowGtk::DisplayError( const char *title, const char *text)
*
*************************************************************************/
static void displaytext_ok_cb( GtkWidget *w, gint arg1, gpointer data)
static void displaytext_close_cb( GtkWidget *w, gint arg1, gpointer data)
{
while( !GTK_IS_WINDOW(w))
w = gtk_widget_get_parent( w);
gtk_widget_destroy( w);
}
void CoWowGtk::DisplayText( const char *title, const char *text)
void CoWowGtk::DisplayText( const char *title, const char *text, int width, int height)
{
GtkWidget *parent = m_parent;
if ( parent) {
......@@ -362,16 +364,49 @@ void CoWowGtk::DisplayText( const char *title, const char *text)
parent = gtk_widget_get_parent( parent);
}
if ( width == 0)
width = 400;
if ( height == 0)
height = 150;
// Create a displaytext window
GtkWidget *dialog = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", height,
"default-width", width,
"title", CoWowGtk::translate_utf8(title),
NULL);
g_signal_connect( dialog, "delete_event", G_CALLBACK(displaytext_close_cb), dialog);
char *textutf8 = g_convert( text, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(parent),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_OTHER,
GTK_BUTTONS_CLOSE, textutf8);
GtkWidget *displaytext_label = gtk_label_new(textutf8);
g_free( textutf8);
g_signal_connect( dialog, "response",
G_CALLBACK(displaytext_ok_cb), NULL);
gtk_window_set_title( GTK_WINDOW(dialog), title);
GtkWidget *displaytext_image = (GtkWidget *)g_object_new( GTK_TYPE_IMAGE,
"stock", GTK_STOCK_DIALOG_INFO,
"icon-size", GTK_ICON_SIZE_DIALOG,
"xalign", 0.5,
"yalign", 1.0,
NULL);
GtkWidget *displaytext_close = gtk_button_new_with_label( CoWowGtk::translate_utf8("Close"));
gtk_widget_set_size_request( displaytext_close, 70, 25);
g_signal_connect( displaytext_close, "clicked",
G_CALLBACK(displaytext_close_cb), dialog);
GtkWidget *displaytext_hboxtext = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(displaytext_hboxtext), displaytext_image, FALSE, FALSE, 15);
gtk_box_pack_start( GTK_BOX(displaytext_hboxtext), displaytext_label, TRUE, TRUE, 15);
GtkWidget *displaytext_hboxbuttons = gtk_hbox_new( TRUE, 40);
gtk_box_pack_end( GTK_BOX(displaytext_hboxbuttons), displaytext_close, FALSE, FALSE, 0);
GtkWidget *displaytext_vbox = gtk_vbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(displaytext_vbox), displaytext_hboxtext, TRUE, TRUE, 30);
gtk_box_pack_start( GTK_BOX(displaytext_vbox), gtk_hseparator_new(), FALSE, FALSE, 0);
gtk_box_pack_end( GTK_BOX(displaytext_vbox), displaytext_hboxbuttons, FALSE, FALSE, 15);
gtk_container_add( GTK_CONTAINER(dialog), displaytext_vbox);
gtk_widget_show_all( dialog);
}
/************************************************************************
......
......@@ -123,7 +123,7 @@ class CoWowGtk : public CoWow {
void (* questionbox_cancel) ( void *, void *),
void *data);
void DisplayError( const char *title, const char *text);
void DisplayText( const char *title, const char *text);
void DisplayText( const char *title, const char *text, int width = 0, int height = 0);
void CreateInputDialog( void *ctx, const char *title, const char *text,
void (* inputdialogbox_ok) ( void *, void *, char *),
void (* inputdialogbox_cancel) ( void *, void *),
......
......@@ -116,7 +116,7 @@ class CoWow {
void (* questionbox_cancel) ( void *, void *),
void *data) {}
virtual void DisplayError( const char *title, const char *text) {}
virtual void DisplayText( const char *title, const char *text) {}
virtual void DisplayText( const char *title, const char *text, int width = 0, int height = 0) {}
virtual void CreateInputDialog( void *ctx, const char *title, const char *text,
void (* inputdialogbox_ok) ( void *, void *, char *),
void (* inputdialogbox_cancel) ( void *, void *),
......
......@@ -112,7 +112,8 @@ typedef enum {
flow_eObjectType_AnnotPixmap,
flow_eObjectType_Radiobutton,
flow_eObjectType_Frame,
flow_eObjectType_Image
flow_eObjectType_Image,
flow_eObjectType_AnnotPixmapButton
} flow_eObjectType;
typedef enum {
......@@ -214,7 +215,8 @@ typedef enum {
flow_eEventType_Object,
flow_eEventType_AnnotationInput,
flow_eEventType_Radiobutton,
flow_eEventType_SelectConPoint
flow_eEventType_SelectConPoint,
flow_eEventType_PixmapButton,
} flow_eEventType;
typedef enum {
......@@ -260,6 +262,7 @@ typedef enum {
flow_eEvent_ObjectDeleted,
flow_eEvent_AnnotationInput,
flow_eEvent_Radiobutton,
flow_eEvent_PixmapButton,
flow_eEvent_Key_Return,
flow_eEvent_Key_Up,
flow_eEvent_Key_Down,
......@@ -351,6 +354,18 @@ typedef struct {
int value;
} flow_sEventRadiobutton, *flow_tEventRadiobutton;
typedef struct {
flow_eEvent event;
flow_eEventType type;
int x_pixel;
int y_pixel;
double x;
double y;
flow_eObjectType object_type;
void *object;
int number;
} flow_sEventPixmapButton, *flow_tEventPixmapButton;
typedef union {
flow_eEvent event;
flow_sEventAny any;
......@@ -358,6 +373,7 @@ typedef union {
flow_sEventConCreate con_create;
flow_sEventAnnotInput annot_input;
flow_sEventRadiobutton radiobutton;
flow_sEventPixmapButton pixmapbutton;
} flow_sEvent, *flow_tEvent;
typedef enum {
......@@ -399,6 +415,7 @@ typedef enum {
flow_eSave_AnnotPixmap = 16,
flow_eSave_Radiobutton = 17,
flow_eSave_Frame = 18,
flow_eSave_AnnotPixmapButton = 19,
flow_eSave_End = 99,
flow_eSave_Ctx_zoom_factor = 100,
flow_eSave_Ctx_base_zoom_factor = 101,
......
......@@ -260,21 +260,28 @@ void FlowAnnotPixmap::nav_erase( void *pos, void *node)
int FlowAnnotPixmap::event_handler( void *pos, flow_eEvent event, int x, int y,
void *node)
{
FlowPoint *p;
p = (FlowPoint *) pos;
/**
if ( p1.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x < x &&
x < p2.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x &&
p1.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y < y &&
y < p2.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y)
#if 0
if ( !((FlowNode *) node)->annotpixmapv[number])
return 0;
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (pixmap_size + 4) -
4);
if ( idx < 0)
return 0;
idx = MIN( idx, DRAW_TYPE_SIZE-1);
if ( p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x < x &&
x < p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x + ((FlowNode *) node)->annotpixmapv[number]->pixmap_data[idx].width &&
p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y < y &&
y < p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y + ((FlowNode *) node)->annotpixmapv[number]->pixmap_data[idx].height)
{
cout << "Event handler: Hit in text" << endl;
cout << "Event handler: Hit in pixmap" << endl;
return 1;
}
else
***/
return 0;
#endif
return 0;
}
void FlowAnnotPixmap::get_borders( double pos_x, double pos_y, double *x_right,
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#include "flow_std.h"
#include <iostream>
#include <stdlib.h>
#include "flow_annotpixmapbutton.h"
#include "flow_node.h"
#include "flow_draw.h"
#include "flow_browctx.h"
#include "flow_msg.h"
int FlowAnnotPixmapButton::event_handler( void *pos, flow_eEvent event, int x, int y,
void *node)
{
if ( !((FlowNode *) node)->annotpixmapv[number])
return 0;
int sts;
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (pixmap_size + 4) -
4);
if ( idx < 0)
return 0;
idx = MIN( idx, DRAW_TYPE_SIZE-1);
if ( p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x < x &&
x < p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x + ((FlowNode *) node)->annotpixmapv[number]->pixmap_data[idx].width &&
p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y < y &&
y < p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y + ((FlowNode *) node)->annotpixmapv[number]->pixmap_data[idx].height)
{
switch ( event)
{
case flow_eEvent_MB1Click:
// cout << "Event handler: Hit in pixmapbutton" << endl;
// Call backcall function
sts = ctx->pixmapbutton_cb( (FlowArrayElem *)node, number);
if ( sts == FLOW__DESTROYED)
return sts;
return FLOW__NO_PROPAGATE;
break;
default:
;
}
return 1;
}
else
return 0;
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef flow_annotpixmapbutton_h
#define flow_annotpixmapbutton_h
#include <iostream>
#include "flow.h"
#include "flow_ctx.h"
#include "flow_point.h"
#include "flow_array_elem.h"
#include "flow_annotpixmap.h"
class FlowAnnotPixmapButton : public FlowAnnotPixmap {
public:
FlowAnnotPixmapButton( FlowCtx *flow_ctx, int num,
double x = 0, double y = 0,
flow_eDrawType d_type = flow_eDrawType_Line, int size = 2, int rel_pos = 0) :
FlowAnnotPixmap(flow_ctx, num, x, y, d_type, size, rel_pos) {}
FlowAnnotPixmapButton( const FlowAnnotPixmapButton& p) : FlowAnnotPixmap(p) {}
flow_eObjectType type() { return flow_eObjectType_AnnotPixmapButton;};
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
};
#endif
......@@ -56,6 +56,7 @@
#include "flow_array.h"
#include "flow_pixmap.h"
#include "flow_annotpixmap.h"
#include "flow_annotpixmapbutton.h"
#include "flow_radiobutton.h"
#include "flow_msg.h"
......@@ -198,6 +199,12 @@ void FlowArray::copy_from( const FlowArray& array)
insert( n);
break;
}
case flow_eObjectType_AnnotPixmapButton:
{
FlowAnnotPixmapButton *n = new FlowAnnotPixmapButton(*(FlowAnnotPixmapButton *)array.a[i]);
insert( n);
break;
}
case flow_eObjectType_Radiobutton:
{
FlowRadiobutton *n = new FlowRadiobutton(*(FlowRadiobutton *)array.a[i]);
......@@ -695,6 +702,13 @@ void FlowArray::open( void *ctx, ifstream& fp)
insert( n);
break;
}
case flow_eSave_AnnotPixmapButton:
{
FlowAnnotPixmapButton *n = new FlowAnnotPixmapButton( (FlowCtx *) ctx, 0);
n->open( fp);
insert( n);
break;
}
case flow_eSave_Radiobutton:
{
FlowRadiobutton *n = new FlowRadiobutton( (FlowCtx *) ctx);
......
......@@ -50,6 +50,7 @@
#include "flow_text.h"
#include "flow_pixmap.h"
#include "flow_annotpixmap.h"
#include "flow_annotpixmapbutton.h"
#include "flow_image.h"
#include "flow_pushbutton.h"
#include "flow_array_elem.h"
......@@ -412,6 +413,15 @@ void brow_AddAnnotPixmap( brow_tNodeClass nc, int number,
((FlowNodeClass *)nc)->insert( annotpixmap);
}
void brow_AddAnnotPixmapButton( brow_tNodeClass nc, int number,
double x, double y, flow_eDrawType draw_type, int size, int relative_pos)
{
FlowAnnotPixmapButton *annotpixmap = new FlowAnnotPixmapButton(
((FlowNodeClass *)nc)->ctx, number, x, y, draw_type,
size, relative_pos);
((FlowNodeClass *)nc)->insert( annotpixmap);
}
void brow_AddRadiobutton( brow_tNodeClass nc, double x, double y,
double width, double height, int number,
flow_eDrawType draw_type, int line_width)
......
......@@ -166,6 +166,8 @@ void brow_AddAnnot( brow_tNodeClass nc, double x, double y, int number,
int relative_pos);
void brow_AddAnnotPixmap( brow_tNodeClass nc, int number,
double x, double y, flow_eDrawType draw_type, int size, int relative_pos);
void brow_AddAnnotPixmapButton( brow_tNodeClass nc, int number,
double x, double y, flow_eDrawType draw_type, int size, int relative_pos);
void brow_AddRadiobutton( brow_tNodeClass nc, double x, double y,
double width, double height, int number,
flow_eDrawType draw_type, int line_width);
......
......@@ -1927,6 +1927,27 @@ int FlowCtx::radiobutton_cb( FlowArrayElem *object, int number,
return 1;
}
int FlowCtx::pixmapbutton_cb( FlowArrayElem *object, int number)
{
if ( event_callback[flow_eEvent_PixmapButton] )
{
/* Send an pixmapbutton callback */
static flow_sEvent e;
e.event = flow_eEvent_PixmapButton;
e.any.type = flow_eEventType_PixmapButton;
e.any.x_pixel = 0;
e.any.y_pixel = 0;
e.any.x = 0;
e.any.y = 0;
e.pixmapbutton.object_type = object->type();
e.pixmapbutton.object = object;
e.pixmapbutton.number = number;
return event_callback[flow_eEvent_PixmapButton]( this, &e);
}
return 1;
}
int FlowCtx::get_next_object( FlowArrayElem *object, flow_eDirection dir,
FlowArrayElem **next)
......
......@@ -322,6 +322,7 @@ class FlowCtx {
char *text);
int radiobutton_cb( FlowArrayElem *object, int number,
int value);
int pixmapbutton_cb( FlowArrayElem *object, int number);
int type() { return ctx_type;};
void move_widgets( int x, int y) { if ( widget_cnt) a.move_widgets( x, y);};
int display_level;
......
......@@ -207,21 +207,24 @@ void FlowPixmap::nav_erase( void *pos, void *node)
int FlowPixmap::event_handler( void *pos, flow_eEvent event, int x, int y,
void *node)
{
FlowPoint *p;
#if 0
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (pixmap_size + 4) -
4);
if ( idx < 0)
return 0;
p = (FlowPoint *) pos;
/**
if ( p1.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x < x &&
x < p2.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x &&
p1.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y < y &&
y < p2.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y)
if ( p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x < x &&
x < p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x + pixmap_data[idx].width &&
p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y < y &&
y < p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y + pixmap_data[idx].height)
{
cout << "Event handler: Hit in text" << endl;
cout << "Event handler: Hit in pixmap" << endl;
return 1;
}
else
***/
return 0;
#endif
return 0;
}
void FlowPixmap::get_borders( double pos_x, double pos_y, double *x_right,
......
......@@ -296,6 +296,7 @@ EvGtk::EvGtk( void *ev_parent_ctx,
eve->name_to_alias_cb = &ev_name_to_alias_cb;
eve->popup_menu_cb = &ev_popup_menu_cb;
eve->selection_changed_cb = &eve_selection_changed_cb;
eve->help_event_cb = &help_event_cb;
// Toolbar
GtkToolbar *tools = (GtkToolbar *) g_object_new(GTK_TYPE_TOOLBAR, NULL);
......@@ -586,6 +587,7 @@ EvGtk::EvGtk( void *ev_parent_ctx,
ala->popup_menu_cb = &ev_popup_menu_cb;
ala->sound_cb = &ev_sound_cb;
ala->selection_changed_cb = &ala_selection_changed_cb;
ala->help_event_cb = &help_event_cb;
// Toolbar
GtkToolbar *tools = (GtkToolbar *) g_object_new(GTK_TYPE_TOOLBAR, NULL);
......
......@@ -348,6 +348,7 @@ EvAlaGtk::EvAlaGtk( void *ev_parent_ctx,
ala->name_to_alias_cb = &ala_name_to_alias_cb;
ala->popup_menu_cb = &ala_popup_menu_cb;
ala->sound_cb = &ala_sound_cb;
ala->help_event_cb = &help_event_cb;
ala->selection_changed_cb = &ala_selection_changed_cb;
// Toolbar
......
......@@ -429,6 +429,7 @@ HistGtk::HistGtk( void *hist_parent_ctx,
hist->start_trace_cb = &hist_start_trace_cb;
hist->display_in_xnav_cb = &hist_display_in_xnav_cb;
hist->popup_menu_cb = &hist_popup_menu_cb;
hist->help_event_cb = &help_event_cb;
gtk_paned_pack1( GTK_PANED(hist_pane), GTK_WIDGET(sea_vbox), TRUE, TRUE);
gtk_paned_pack2( GTK_PANED(hist_pane), GTK_WIDGET(hist_widget), TRUE, TRUE);
......
......@@ -524,21 +524,21 @@ OpGtk::OpGtk( void *op_parent_ctx,
gtk_container_add( GTK_CONTAINER(tools_alarmlist),
gtk_image_new_from_file( fname));
g_signal_connect(tools_alarmlist, "clicked", G_CALLBACK(activate_alarmlist), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_alarmlist, CoWowGtk::translate_utf8("AlarmList"), "");
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_alarmlist, CoWowGtk::translate_utf8("Alarm List"), "");
GtkWidget *tools_eventlist = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_eventlist.png");
gtk_container_add( GTK_CONTAINER(tools_eventlist),
gtk_image_new_from_file( fname));
g_signal_connect(tools_eventlist, "clicked", G_CALLBACK(activate_eventlist), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_eventlist, CoWowGtk::translate_utf8("EventList"), "");
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_eventlist, CoWowGtk::translate_utf8("Event List"), "");
GtkWidget *tools_eventlog = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_eventlog.png");
gtk_container_add( GTK_CONTAINER(tools_eventlog),
gtk_image_new_from_file( fname));
g_signal_connect(tools_eventlog, "clicked", G_CALLBACK(activate_eventlog), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_eventlog, CoWowGtk::translate_utf8("EventLog"), "");
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_eventlog, CoWowGtk::translate_utf8("Event Log"), "");
GtkWidget *tools_blocklist = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_blocklist.png");
......
......@@ -211,6 +211,19 @@ void Ev::sala_close_cb( void *ctx, EvAla *sala)
ev->sala_cnt--;
}
void Ev::help_event_cb( void *ctx, void *item)
{
ItemAlarm *aitem = (ItemAlarm *)item;
switch ( aitem->type) {
case evlist_eItemType_Alarm:
((Ev *)ctx)->wow->DisplayText( "Event MoreText", aitem->eventmoretext);
break;
default:
return;
}
}
void Ev::eve_activate_print()
{
char title[80];
......
......@@ -174,6 +174,7 @@ class Ev {
static int sala_acknowledge_cb( void *ctx, mh_sEventId *id);
static void sala_copy_list_cb( void *ctx, EvList *evl);
static void sala_close_cb( void *ctx, EvAla *sala);
static void help_event_cb( void *ctx, void *item);
static pwr_tStatus mh_ack_bc( mh_sAck *MsgP);
static pwr_tStatus mh_return_bc( mh_sReturn *MsgP);
......
......@@ -149,6 +149,19 @@ char *EvAla::ala_name_to_alias_cb( void *ctx, char *name)
return ((EvAla *)ctx)->name_to_alias_cb( ((EvAla *)ctx)->parent_ctx, name);
}
void EvAla::help_event_cb( void *ctx, void *item)
{
ItemAlarm *aitem = (ItemAlarm *)item;
switch ( aitem->type) {
case evlist_eItemType_Alarm:
((EvAla *)ctx)->wow->DisplayText( "Event MoreText", aitem->eventmoretext);
break;
default:
return;
}
}
void EvAla::ala_activate_print()
{
char title[80];
......
......@@ -133,6 +133,7 @@ class EvAla {
static void ala_selection_changed_cb( void *ctx);
static char *ala_name_to_alias_cb( void *ctx, char *name);
static void ala_init_cb( void *ctx);
static void help_event_cb( void *ctx, void *item);
};
#endif
This diff is collapsed.
......@@ -158,6 +158,7 @@ class EvListBrow {
flow_sAnnotPixmap *pixmap_eventalarm;
flow_sAnnotPixmap *pixmap_eventacked;
flow_sAnnotPixmap *pixmap_eventreturn;
flow_sAnnotPixmap *pixmap_info;
flow_sAnnotPixmap *pixmap_blockr;
flow_sAnnotPixmap *pixmap_blockl;
......@@ -194,6 +195,7 @@ class EvList {
int (*sound_cb)( void *, pwr_tAttrRef *);
void (*selection_changed_cb)( void *);
void (*init_cb)( void *);
void (*help_event_cb)( void *, void *);
double acc_beep_time;
double beep_interval;
pwr_tAttrRef aalarm_sound;
......
......@@ -122,6 +122,19 @@ void Hist::hist_popup_menu_cb( void *ctx, pwr_sAttrRef attrref,
utility, arg, x, y);
}
void Hist::help_event_cb( void *ctx, void *item)
{
ItemAlarm *aitem = (ItemAlarm *)item;
switch ( aitem->type) {
case evlist_eItemType_Alarm:
((Hist *)ctx)->wow->DisplayText( "Event MoreText", aitem->eventmoretext);
break;
default:
return;
}
}
void Hist::hist_display_in_xnav_cb( void *ctx, pwr_sAttrRef *arp)
{
if ( ((Hist *)ctx)->display_in_xnav_cb)
......
......@@ -145,6 +145,7 @@ class Hist {
static void hist_popup_menu_cb( void *ctx, pwr_sAttrRef attrref,
unsigned long item_type, unsigned long utility,
char *arg, int x, int y);
static void help_event_cb( void *ctx, void *item);
};
#else
......
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