Freeciv-3.3
Loading...
Searching...
No Matches
client
gui-qt
sidebar.h
Go to the documentation of this file.
1
/***********************************************************************
2
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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
14
#ifndef FC__SIDEBAR_H
15
#define FC__SIDEBAR_H
16
17
// Needed for the moc-generated meta file
18
#ifdef HAVE_CONFIG_H
19
#include <fc_config.h>
20
#endif
21
22
// Qt
23
#include <QEnterEvent>
24
#include <QWidget>
25
26
enum
{
SW_STD
= 0,
SW_TAX
= 1,
SW_INDICATORS
= 2 };
27
28
class
QPixmap
;
29
class
QVBoxLayout
;
30
31
typedef
void
(*
pfcn_bool
)(
bool
);
32
typedef
void
(*
pfcn
)(
void
);
33
34
void
side_blink_endturn
(
bool
do_restore
);
35
void
update_turn_done_tooltip
();
36
void
side_center_unit
();
37
void
side_disable_endturn
(
bool
do_restore
);
38
void
side_finish_turn
(
bool
nothing
);
39
void
side_indicators_menu
();
40
void
side_rates_wdg
(
bool
nothing
);
41
void
side_right_click_diplomacy
();
42
void
side_right_click_science
();
43
void
side_left_click_science
(
bool
nothing
);
44
void
side_show_map
(
bool
nothing
);
45
46
/***************************************************************************
47
Class representing single widget(icon) on sidebar
48
***************************************************************************/
49
class
fc_sidewidget
:
public
QWidget
50
{
51
Q_OBJECT
52
public
:
53
fc_sidewidget
(
QPixmap
*pix,
QString
label,
QString
pg
,
pfcn_bool
func
,
54
int
type
=
SW_STD
);
55
~fc_sidewidget
();
56
int
get_priority
();
57
QPixmap
*
get_pixmap
();
58
void
paint
(
QPainter
*
painter
,
QPaintEvent
*
event
);
59
void
resize_pixmap
(
int
width
,
int
height
);
60
void
set_custom_labels
(
QString
l
);
61
void
set_label
(
QString
str
);
62
void
set_left_click
(
pfcn_bool
func
);
63
void
set_pixmap
(
QPixmap
* pm);
64
void
set_right_click
(
pfcn
func
);
65
void
set_tooltip
(
QString
tooltip
);
66
void
set_wheel_down
(
pfcn
func
);
67
void
set_wheel_up
(
pfcn
func
);
68
void
update_final_pixmap
();
69
void
update_fonts
();
70
71
bool
blink
;
72
bool
keep_blinking
;
73
bool
disabled
;
74
int
standard
;
75
QString
page
;
76
public
slots
:
77
void
sblink
();
78
void
some_slot
();
79
protected
:
80
void
contextMenuEvent
(
QContextMenuEvent
*
event
);
81
#ifndef FC_QT5_MODE
82
void
enterEvent
(
QEnterEvent
*
event
);
83
#else
// FC_QT5_MODE
84
void
enterEvent
(QEvent *
event
);
85
#endif
// FC_QT5_MODE
86
void
leaveEvent
(QEvent *
event
);
87
void
mousePressEvent
(
QMouseEvent
*
event
);
88
void
paintEvent
(
QPaintEvent
*
event
);
89
void
wheelEvent
(
QWheelEvent
*
event
);
90
private
:
91
void
paint
();
92
bool
hover
;
93
pfcn
right_click
;
94
pfcn
wheel_down
;
95
pfcn
wheel_up
;
96
pfcn_bool
left_click
;
97
QFont
*
sfont
;
98
QFont
*
info_font
;
99
QPixmap
*
def_pixmap
;
100
QPixmap
*
final_pixmap
;
101
QPixmap
*
scaled_pixmap
;
102
QString
custom_label
;
103
QString
desc
;
104
QTimer
*
timer
;
105
};
106
107
108
/***************************************************************************
109
Freeciv sidebar
110
***************************************************************************/
111
class
fc_sidebar
:
public
QWidget
112
{
113
Q_OBJECT
114
public
:
115
fc_sidebar
();
116
~fc_sidebar
();
117
void
add_widget
(
fc_sidewidget
*
fsw
);
118
void
paint
(
QPainter
*
painter
,
QPaintEvent
*
event
);
119
void
resize_me
(
int
height
,
bool
force
=
false
);
120
void
update_fonts
();
121
QList<fc_sidewidget*>
objects
;
122
protected
:
123
void
paintEvent
(
QPaintEvent
*
event
);
124
private
:
125
QVBoxLayout
*
layout
;
126
};
127
128
#endif
// FC__SIDEBAR_H
str
#define str
Definition
astring.c:76
height
struct canvas int int struct sprite int int int int height
Definition
canvas_g.h:44
width
struct canvas int int struct sprite int int int width
Definition
canvas_g.h:44
fc_sidebar
Definition
sidebar.h:112
fc_sidebar::fc_sidebar
fc_sidebar()
Definition
sidebar.cpp:518
fc_sidebar::layout
QVBoxLayout * layout
Definition
sidebar.h:125
fc_sidebar::resize_me
void resize_me(int height, bool force=false)
Definition
sidebar.cpp:570
fc_sidebar::add_widget
void add_widget(fc_sidewidget *fsw)
Definition
sidebar.cpp:537
fc_sidebar::~fc_sidebar
~fc_sidebar()
Definition
sidebar.cpp:530
fc_sidebar::objects
QList< fc_sidewidget * > objects
Definition
sidebar.h:121
fc_sidebar::update_fonts
void update_fonts()
Definition
sidebar.cpp:612
fc_sidebar::paintEvent
void paintEvent(QPaintEvent *event)
Definition
sidebar.cpp:547
fc_sidebar::paint
void paint(QPainter *painter, QPaintEvent *event)
Definition
sidebar.cpp:559
fc_sidewidget
Definition
sidebar.h:50
fc_sidewidget::update_fonts
void update_fonts()
Definition
sidebar.cpp:132
fc_sidewidget::blink
bool blink
Definition
sidebar.h:71
fc_sidewidget::set_wheel_down
void set_wheel_down(pfcn func)
Definition
sidebar.cpp:287
fc_sidewidget::final_pixmap
QPixmap * final_pixmap
Definition
sidebar.h:100
fc_sidewidget::get_priority
int get_priority()
fc_sidewidget::info_font
QFont * info_font
Definition
sidebar.h:98
fc_sidewidget::wheel_down
pfcn wheel_down
Definition
sidebar.h:94
fc_sidewidget::custom_label
QString custom_label
Definition
sidebar.h:102
fc_sidewidget::sfont
QFont * sfont
Definition
sidebar.h:97
fc_sidewidget::keep_blinking
bool keep_blinking
Definition
sidebar.h:72
fc_sidewidget::~fc_sidewidget
~fc_sidewidget()
Definition
sidebar.cpp:99
fc_sidewidget::wheelEvent
void wheelEvent(QWheelEvent *event)
Definition
sidebar.cpp:319
fc_sidewidget::desc
QString desc
Definition
sidebar.h:103
fc_sidewidget::set_wheel_up
void set_wheel_up(pfcn func)
Definition
sidebar.cpp:295
fc_sidewidget::some_slot
void some_slot()
Definition
sidebar.cpp:356
fc_sidewidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event)
Definition
sidebar.cpp:258
fc_sidewidget::wheel_up
pfcn wheel_up
Definition
sidebar.h:95
fc_sidewidget::def_pixmap
QPixmap * def_pixmap
Definition
sidebar.h:99
fc_sidewidget::paintEvent
void paintEvent(QPaintEvent *event)
Definition
sidebar.cpp:204
fc_sidewidget::paint
void paint()
fc_sidewidget::page
QString page
Definition
sidebar.h:75
fc_sidewidget::set_custom_labels
void set_custom_labels(QString l)
Definition
sidebar.cpp:152
fc_sidewidget::standard
int standard
Definition
sidebar.h:74
fc_sidewidget::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition
sidebar.cpp:303
fc_sidewidget::set_left_click
void set_left_click(pfcn_bool func)
Definition
sidebar.cpp:271
fc_sidewidget::set_label
void set_label(QString str)
Definition
sidebar.cpp:176
fc_sidewidget::sblink
void sblink()
Definition
sidebar.cpp:335
fc_sidewidget::hover
bool hover
Definition
sidebar.h:92
fc_sidewidget::set_pixmap
void set_pixmap(QPixmap *pm)
Definition
sidebar.cpp:120
fc_sidewidget::resize_pixmap
void resize_pixmap(int width, int height)
Definition
sidebar.cpp:185
fc_sidewidget::timer
QTimer * timer
Definition
sidebar.h:104
fc_sidewidget::set_right_click
void set_right_click(pfcn func)
Definition
sidebar.cpp:279
fc_sidewidget::disabled
bool disabled
Definition
sidebar.h:73
fc_sidewidget::set_tooltip
void set_tooltip(QString tooltip)
Definition
sidebar.cpp:160
fc_sidewidget::leaveEvent
void leaveEvent(QEvent *event)
Definition
sidebar.cpp:244
fc_sidewidget::left_click
pfcn_bool left_click
Definition
sidebar.h:96
fc_sidewidget::enterEvent
void enterEvent(QEnterEvent *event)
Definition
sidebar.cpp:228
fc_sidewidget::update_final_pixmap
void update_final_pixmap()
Definition
sidebar.cpp:393
fc_sidewidget::scaled_pixmap
QPixmap * scaled_pixmap
Definition
sidebar.h:101
fc_sidewidget::get_pixmap
QPixmap * get_pixmap()
Definition
sidebar.cpp:168
fc_sidewidget::right_click
pfcn right_click
Definition
sidebar.h:93
incite_cost
char * incite_cost
Definition
comments.c:76
event
enum event_type event
Definition
events.c:81
tooltip
const char * tooltip
Definition
repodlgs.c:1315
type
GType type
Definition
repodlgs.c:1313
func
get_token_fn_t func
Definition
inputfile.c:128
slots
struct player_slot * slots
Definition
player.c:51
side_center_unit
void side_center_unit()
Definition
sidebar.cpp:649
side_show_map
void side_show_map(bool nothing)
Definition
sidebar.cpp:623
update_turn_done_tooltip
void update_turn_done_tooltip()
Definition
gui_main.c:1109
side_indicators_menu
void side_indicators_menu()
Definition
sidebar.cpp:701
side_left_click_science
void side_left_click_science(bool nothing)
Definition
sidebar.cpp:809
side_rates_wdg
void side_rates_wdg(bool nothing)
Definition
sidebar.cpp:639
pfcn_bool
void(* pfcn_bool)(bool)
Definition
sidebar.h:31
pfcn
void(* pfcn)(void)
Definition
sidebar.h:32
side_right_click_diplomacy
void side_right_click_diplomacy()
Definition
sidebar.cpp:715
side_finish_turn
void side_finish_turn(bool nothing)
Definition
sidebar.cpp:631
side_right_click_science
void side_right_click_science()
Definition
sidebar.cpp:760
side_blink_endturn
void side_blink_endturn(bool do_restore)
Definition
sidebar.cpp:689
side_disable_endturn
void side_disable_endturn(bool do_restore)
Definition
sidebar.cpp:676
SW_TAX
@ SW_TAX
Definition
sidebar.h:26
SW_INDICATORS
@ SW_INDICATORS
Definition
sidebar.h:26
SW_STD
@ SW_STD
Definition
sidebar.h:26
bool
#define bool
Definition
support.h:71
Generated on Sun Dec 22 2024 22:30:35 for Freeciv-3.3 by
1.9.8