Crossfire Server, Trunk  R20513
CRERandomMapPanel.cpp
Go to the documentation of this file.
1 #include <QLabel>
2 #include <QTextEdit>
3 
4 #include "CRERandomMapPanel.h"
5 #include "CRERandomMap.h"
6 #include "CREMapInformation.h"
7 
9 {
10  QGridLayout* layout = new QGridLayout(this);
11  layout->addWidget(new QLabel(tr("Source map:"), this), 0, 0);
12  layout->addWidget(mySource = new QLabel(this), 0, 1);
13  layout->addWidget(new QLabel(tr("Parameters:"), this), 1, 0, 1, 2);
14  layout->addWidget(myInformation = new QTextEdit(this), 2, 0, 1, 2);
15  myInformation->setReadOnly(true);
16 }
17 
19 {
21  char* text = stringbuffer_finish(sb);
22  myInformation->setText(text);
23  free(text);
24 
25  mySource->setText(tr("%1 [%2, %3]").arg(map->map()->displayName()).arg(map->x()).arg(map->y()));
26 }
const CREMapInformation * map() const
int x() const
virtual void setItem(const CRERandomMap *map)
const QString & displayName() const
const RMParms * parameters() const
StringBuffer * write_map_parameters_to_string(const RMParms *RP)
Creates a suitable message for exit from RP.
Definition: random_map.c:735
int y() const
A buffer that will be expanded as content is added to it.
Definition: stringbuffer.c:25
QTextEdit * myInformation
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
Definition: stringbuffer.c:76
Definition: main.c:88