Source: /app/hbasic/hbasic/lib_calc_sheet/diagram_wgt.h
|
|
|
|
/* **************************************************************************
File: diagram_wgt.h
Desc: Widget to display result of diagram data
----------------------------------------------------------------------------
copyright : (C) 2001 HBasic project (Marcus Engels)
***************************************************************************/
/* **************************************************************************
* *
* 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. *
* *
***************************************************************************/
/* ----------------------------------------------------------------------- */
/* Classlist: List of classes that will be defined in this source file. */
/* ----------------------------------------------------------------------- */
/*
* class CDiagramWidget: Diagram widget.
*/
/* ----------------------------------------------------------------------- */
/* Changelog: Description of important changes within this file. */
/* Please report with date, maintainer and change description. */
/* ----------------------------------------------------------------------- */
#ifndef DIAGRAM_H
#define DIAGRAM_H
#include
class QComboBox;
class QPushButton;
#include "structs.h"
#include "window_list.h"
#include "../hbdata/hbdatatable.h"
#define GRAPH_TYPE_BOX 0
#define GRAPH_TYPE_LINE 1
#define GRAPH_TYPE_LINE_FILL 2
#define GRAPH_TYPE_BOX3D 3
class CDiagramWidget : public QWidget
{
Q_OBJECT
public:
CDiagramWidget( QWidget *parent, HBDataTable *new_data );
/**
* Set the type of graph to be used to display the data values.
*/
void setGraphType( int new_type );
private:
HBDataTable *data_ptr;
long data_line_length;
int chart_type;
int draw_frame;
int dot_picture;
int data_xstart;
int data_ystart;
int data_xend;
int data_yend;
int entry_width;
int entry_distance;
int pic_xstart;
int pic_ystart;
int pic_width;
int pic_height;
/* Size of the table */
int data_columns;
int data_rows;
/* pointer to tables of min and maxvalues */
double data_min_value;
double data_max_value;
double data_difference;
double xdata_difference;
double data_offset;
void paintEvent( QPaintEvent *evt );
void showFrame( QPainter *p );
};
/**
* class CDiagramWidget : widget to display diagram data
*/
class CDiagramWindow : public CWindowListChild
{
Q_OBJECT
public:
CDiagramWindow( QWidget *parent, HBDataTable *new_data );
private:
HBDataTable *data_ptr;
QPushButton *btn_print;
CDiagramWidget *display_wgt;
QComboBox *lb_select_graph;
void resizeEvent( QResizeEvent *evt );
private slots:
void slotGraphChanged( int index );
void slotPrintDiagram( void );
};
#endif
Generated by: root on linux on Sun Jul 13 18:06:35 2003, using kdoc 2.0a54. |