19#include <QApplication>
24#include <QStyleFactory>
46 layout->setHorizontalSpacing(0);
47 layout->setVerticalSpacing(0);
48 layout->setContentsMargins(0, 3, 3, 0);
50 layout->setVerticalSpacing(0);
58 mw->setFixedSize(13, 13);
59 setMouseTracking(
true);
89 if (
gui()->interface_locked) {
93 if (
event->button() == Qt::LeftButton) {
94 QPoint
pos =
event->pos();
99 if (y > 0 && y < 25 && x >
width() - 25 && x <
width()) {
104 if (y > 0 && y < 5) {
113 event->setAccepted(
true);
123 if (
gui()->interface_locked) {
132 setCursor(Qt::ArrowCursor);
135 gui()->qt_settings.chat_fwidth =
static_cast<float>(
width())
136 /
gui()->mapview_wdg->width();
137 gui()->qt_settings.chat_fheight =
static_cast<float>(
height())
138 /
gui()->mapview_wdg->height();
139 gui()->qt_settings.chat_fx_pos =
static_cast<float>(p.x())
140 /
gui()->mapview_wdg->width();
141 gui()->qt_settings.chat_fy_pos =
static_cast<float>(p.y())
142 /
gui()->mapview_wdg->height();
154 if (
gui()->interface_locked) {
165 int newheight =
event->globalPosition().y() -
cursor.y() - geometry().y();
167 int newheight =
event->globalY() -
cursor.y() - geometry().y();
170 resize(
width(), this->geometry().
height()-newheight);
172 move(this->x(), to_move.y());
173 setCursor(Qt::SizeVerCursor);
175 }
else if (ex >
width() - 9 && ey > 0 && ey < 9) {
176 setCursor(Qt::SizeBDiagCursor);
179 setCursor(Qt::SizeHorCursor);
180 }
else if (ex >
width() - 5 && ex <
width()) {
181 setCursor(Qt::SizeHorCursor);
182 }
else if (ey > 0 && ey < 5) {
183 setCursor(Qt::SizeVerCursor);
184 }
else if (
resxy && (
event->buttons() & Qt::LeftButton)) {
187 int newheight =
event->globalPosition().y() -
cursor.y() - geometry().y();
189 int newheight =
event->globalY() -
cursor.y() - geometry().y();
192 resize(ex, this->geometry().
height()- newheight);
194 move(this->x(), to_move.y());
195 setCursor(Qt::SizeBDiagCursor);
198 setCursor(Qt::ArrowCursor);
201 event->setAccepted(
true);
221 mesg_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
222 mesg_table->verticalHeader()->setVisible(
false);
223 mesg_table->setSelectionMode(QAbstractItemView::SingleSelection);
224 mesg_table->horizontalHeader()->setStretchLastSection(
true);
225 mesg_table->horizontalHeader()->setVisible(
false);
228 layout->setContentsMargins(0, 0, 3, 3);
232 palette.setColor(QPalette::Highlight, QColor(0, 0, 0, 0));
233 palette.setColor(QPalette::HighlightedText, QColor(205, 206, 173));
234 palette.setColor(QPalette::Text, QColor(205, 206, 173));
238 SIGNAL(selectionChanged(
const QItemSelection &,
239 const QItemSelection &)),
241 const QItemSelection &)));
242 setMouseTracking(
true);
249 const QItemSelection &ds)
255 QModelIndexList indexes = sl.indexes();
256 QTableWidgetItem *
item;
258 if (indexes.isEmpty()) {
261 index = indexes.at(0);
264 if (i > -1 && pmsg != NULL) {
265 if (QApplication::mouseButtons() == Qt::LeftButton
266 || QApplication::mouseButtons() == Qt::RightButton) {
273 if (QApplication::mouseButtons() == Qt::LeftButton && pmsg->
location_ok) {
276 if (QApplication::mouseButtons() == Qt::RightButton && pmsg->
city_ok) {
279 if (QApplication::mouseButtons() == Qt::RightButton
280 && pmsg->
event == E_DIPLOMACY) {
281 j =
gui()->gimme_index_of(
"DDI");
282 gui()->game_tab_widget->setCurrentIndex(j);
297 setCursor(Qt::ArrowCursor);
305 setCursor(Qt::ArrowCursor);
313 painter->setBrush(QColor(0, 0, 0, 35));
346 QTableWidgetItem *
item;
348 item =
new QTableWidgetItem;
409 if (
gui()->infotab == NULL) {
412 gui()->infotab->msgwdg->clr();
414 for (i = 0; i < num; i++) {
416 gui()->infotab->msgwdg->msg(pmsg);
418 gui()->infotab->msgwdg->msg_update();
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
int default_size(int lines)
void mouseReleaseEvent(QMouseEvent *event)
info_tab(QWidget *parent)
void mousePressEvent(QMouseEvent *event)
void mouseMoveEvent(QMouseEvent *event)
void paintEvent(QPaintEvent *event)
void leaveEvent(QEvent *event)
void resizeEvent(QResizeEvent *event)
QTableWidget * mesg_table
void item_selected(const QItemSelection &sl, const QItemSelection &ds)
void enterEvent(QEnterEvent *event)
void paint(QPainter *painter, QPaintEvent *event)
messagewdg(QWidget *parent)
void msg(const struct message *pmsg)
#define mevent_gpos(__ev__)
void meswin_dialog_popup(bool raise)
void real_meswin_dialog_update(void *unused)
bool meswin_dialog_is_open(void)
void meswin_popup_city(int message_index)
void meswin_goto(int message_index)
int meswin_get_num_messages(void)
const struct message * meswin_get_message(int message_index)
void meswin_set_visited_state(int message_index, bool state)
struct sprite * get_event_sprite(const struct tileset *t, enum event_type event)