2007-01-15 12:09:25 -08:00
|
|
|
/*
|
|
|
|
This file is part of Warzone 2100.
|
|
|
|
Copyright (C) 1999-2004 Eidos Interactive
|
2011-02-25 09:50:54 -08:00
|
|
|
Copyright (C) 2005-2011 Warzone 2100 Project
|
2007-01-15 12:09:25 -08:00
|
|
|
|
|
|
|
Warzone 2100 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.
|
|
|
|
|
|
|
|
Warzone 2100 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 Warzone 2100; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2008-03-21 08:40:23 -07:00
|
|
|
/** @file
|
|
|
|
* Definitions for Bar Graph functions.
|
2007-06-28 10:47:08 -07:00
|
|
|
*/
|
2008-03-21 08:40:23 -07:00
|
|
|
|
|
|
|
#ifndef __INCLUDED_LIB_WIDGET_BAR_H__
|
|
|
|
#define __INCLUDED_LIB_WIDGET_BAR_H__
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2008-03-23 12:08:49 -07:00
|
|
|
#include "widget.h"
|
|
|
|
|
2010-12-18 14:13:27 -08:00
|
|
|
struct W_BARGRAPH : public WIDGET
|
2010-01-18 11:10:17 -08:00
|
|
|
{
|
2010-12-19 07:16:17 -08:00
|
|
|
W_BARGRAPH(W_BARINIT const *init);
|
|
|
|
|
2010-12-22 06:02:14 -08:00
|
|
|
WBAR_ORIENTATION barPos; // Orientation of the bar on the widget
|
2007-06-28 10:47:08 -07:00
|
|
|
UWORD majorSize; // Percentage of the main bar that is filled
|
|
|
|
UWORD minorSize; // Percentage of the minor bar if there is one
|
|
|
|
UWORD iRange; // Maximum range
|
|
|
|
UWORD iValue; // Current value
|
2009-10-11 10:47:43 -07:00
|
|
|
UWORD iOriginal; // hack to keep uncapped value around
|
2010-12-18 11:01:09 -08:00
|
|
|
int denominator; // Denominator, 1 by default.
|
|
|
|
int precision; // Number of places after the decimal point to display, 0 by default.
|
2007-12-09 13:40:26 -08:00
|
|
|
PIELIGHT majorCol; // Colour for the major bar
|
|
|
|
PIELIGHT minorCol; // Colour for the minor bar
|
2011-11-06 11:50:32 -08:00
|
|
|
PIELIGHT textCol; // Colour for the text on the bar.
|
2007-06-04 12:52:07 -07:00
|
|
|
const char *pTip; // The tool tip for the graph
|
2011-11-06 11:50:32 -08:00
|
|
|
QString text; // Text on the bar.
|
2010-12-18 14:13:27 -08:00
|
|
|
};
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
/* Create a barGraph widget data structure */
|
2008-03-21 07:22:05 -07:00
|
|
|
extern W_BARGRAPH* barGraphCreate(const W_BARINIT* psInit);
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
/* Free the memory used by a barGraph */
|
|
|
|
extern void barGraphFree(W_BARGRAPH *psWidget);
|
|
|
|
|
|
|
|
/* Respond to a mouse moving over a barGraph */
|
|
|
|
extern void barGraphHiLite(W_BARGRAPH *psWidget, W_CONTEXT *psContext);
|
|
|
|
|
|
|
|
/* Respond to the mouse moving off a barGraph */
|
|
|
|
extern void barGraphHiLiteLost(W_BARGRAPH *psWidget);
|
|
|
|
|
|
|
|
/* The bar graph display function */
|
2007-12-09 08:09:23 -08:00
|
|
|
extern void barGraphDisplay(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours);
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
/* The double bar graph display function */
|
2007-12-09 08:09:23 -08:00
|
|
|
extern void barGraphDisplayDouble(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours);
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
/* The trough bar graph display function */
|
2007-12-09 08:09:23 -08:00
|
|
|
extern void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours);
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2008-03-21 08:40:23 -07:00
|
|
|
#endif // __INCLUDED_LIB_WIDGET_BAR_H__
|