Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-qt/ratesdlg.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
ratesdlg.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2003 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__RATESDLG_H
14#define FC__RATESDLG_H
15
16// In this case we have to include fc_config.h from header file.
17// Some other headers we include demand that fc_config.h must be
18// included also. Usually all source files include fc_config.h, but
19// there's moc generated meta_ratesdlg.cpp file which does not.
20#ifdef HAVE_CONFIG_H
21#include <fc_config.h>
22#endif
23
24// Qt
25#include <QDialog>
26# include <QList>
27
28// common
29#include "government.h"
30
31// client
32#include "client_main.h"
33
34// gui-qt
35#include "dialogs.h"
36
37extern "C" {
38#include "ratesdlg_g.h"
39}
40
41class QMouseEvent;
42class QPaintEvent;
43class QPixmap;
44class QPushButton;
45class QSize;
46class QSlider;
47
48/**************************************************************************
49 * Custom slider with two settable values
50 *************************************************************************/
51 class fc_double_edge : public QWidget
52{
53 Q_OBJECT
54
55private:
56 double cursor_size;
57 double mouse_x;
58 int moved;
59 bool on_min;
60 bool on_max;
61 int max_rates;
62 QPixmap cursor_pix;
63public:
64 fc_double_edge(QWidget *parent = NULL);
65 ~fc_double_edge();
66 int current_min;
67 int current_max;
68 QSize sizeHint() const;
69protected:
70 void paintEvent(QPaintEvent *event);
71 void mousePressEvent(QMouseEvent *event);
72 void mouseMoveEvent(QMouseEvent *event);
73
74};
75
76/**************************************************************************
77 * Dialog used to change tax rates
78 *************************************************************************/
79 class tax_rates_dialog: public qfc_dialog
80{
81 Q_OBJECT
82
83 public:
84 tax_rates_dialog(QWidget *parent = 0);
85
86private:
87 fc_double_edge *fcde;
88private slots:
89 void slot_ok_button_pressed();
90 void slot_cancel_button_pressed();
91 void slot_apply_button_pressed();
92};
93
94/**************************************************************************
95 * Dialog used to change policies
96 *************************************************************************/
97 class multipler_rates_dialog: public QDialog
98{
99 Q_OBJECT
100
101public:
102 explicit multipler_rates_dialog(QWidget* parent = 0);
103private:
104 QList<QSlider*> slider_list;
105 QPushButton *cancel_button;
106 QPushButton *ok_button;
107private slots:
108 void slot_set_value(int i);
109 void slot_ok_button_pressed();
110 void slot_cancel_button_pressed();
111};
112
113
114void popup_multiplier_dialog(void);
115
116#endif // FC__RATESDLG_H
fc_double_edge
Definition ratesdlg.h:52
fc_double_edge::current_min
int current_min
Definition ratesdlg.h:66
fc_double_edge::max_rates
int max_rates
Definition ratesdlg.h:61
fc_double_edge::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event)
Definition ratesdlg.cpp:407
fc_double_edge::cursor_size
double cursor_size
Definition ratesdlg.h:56
fc_double_edge::paintEvent
void paintEvent(QPaintEvent *event)
Definition ratesdlg.cpp:332
fc_double_edge::moved
int moved
Definition ratesdlg.h:58
fc_double_edge::current_max
int current_max
Definition ratesdlg.h:67
fc_double_edge::sizeHint
QSize sizeHint() const
Definition ratesdlg.cpp:323
fc_double_edge::on_max
bool on_max
Definition ratesdlg.h:60
fc_double_edge::~fc_double_edge
~fc_double_edge()
Definition ratesdlg.cpp:316
fc_double_edge::mouse_x
double mouse_x
Definition ratesdlg.h:57
fc_double_edge::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition ratesdlg.cpp:387
fc_double_edge::cursor_pix
QPixmap cursor_pix
Definition ratesdlg.h:62
fc_double_edge::on_min
bool on_min
Definition ratesdlg.h:59
multipler_rates_dialog
Definition ratesdlg.h:98
multipler_rates_dialog::slot_cancel_button_pressed
void slot_cancel_button_pressed()
Definition ratesdlg.cpp:199
multipler_rates_dialog::ok_button
QPushButton * ok_button
Definition ratesdlg.h:106
multipler_rates_dialog::slot_set_value
void slot_set_value(int i)
Definition ratesdlg.cpp:184
multipler_rates_dialog::slot_ok_button_pressed
void slot_ok_button_pressed()
Definition ratesdlg.cpp:208
multipler_rates_dialog::slider_list
QList< QSlider * > slider_list
Definition ratesdlg.h:104
multipler_rates_dialog::cancel_button
QPushButton * cancel_button
Definition ratesdlg.h:105
qfc_dialog
Definition dialogs.h:74
tax_rates_dialog
Definition ratesdlg.h:80
tax_rates_dialog::fcde
fc_double_edge * fcde
Definition ratesdlg.h:87
tax_rates_dialog::slot_cancel_button_pressed
void slot_cancel_button_pressed()
Definition ratesdlg.cpp:101
tax_rates_dialog::slot_apply_button_pressed
void slot_apply_button_pressed()
Definition ratesdlg.cpp:120
tax_rates_dialog::slot_ok_button_pressed
void slot_ok_button_pressed()
Definition ratesdlg.cpp:109
client_main.h
incite_cost
char * incite_cost
Definition comments.c:74
event
enum event_type event
Definition events.c:81
government.h
popup_multiplier_dialog
void popup_multiplier_dialog(void)
Definition gamedlgs.c:383
dialogs.h
slots
struct player_slot * slots
Definition player.c:51
ratesdlg_g.h