62 lines
1.3 KiB
C++
62 lines
1.3 KiB
C++
#ifndef UTILS_H
|
|
#define UTILS_H
|
|
|
|
#include <stddef.h>
|
|
#include <qpushbutton.h>
|
|
#include <qlineedit.h>
|
|
#include <qlabel.h>
|
|
#include <qstring.h>
|
|
#include <qstringlist.h>
|
|
#include <qtextedit.h>
|
|
#include <qevent.h>
|
|
#include <qpixmap.h>
|
|
#include <qpen.h>
|
|
|
|
#define N_SEACOLORS 138
|
|
|
|
class FlatButton: public QLabel {
|
|
Q_OBJECT
|
|
public:
|
|
FlatButton(const QString &label, QWidget *parent, const char *name=0);
|
|
signals:
|
|
void clicked();
|
|
void mousePressed();
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *e);
|
|
void mouseReleaseEvent(QMouseEvent *e);
|
|
private:
|
|
int x, y;
|
|
};
|
|
|
|
void ShrinkButton(QPushButton *b);
|
|
void SetEraseColor(QWidget *widget, QWidget *from, bool inclBgr = false);
|
|
|
|
double DoubleTime(void);
|
|
|
|
QPen thisPen(long i, int w = 0);
|
|
|
|
const QPixmap *thisPixmap(long i, int w = 0);
|
|
|
|
long Convert2ColorIndex(const QString &color);
|
|
|
|
bool Convert2ColorName(long i, QString &result);
|
|
|
|
// my own textedit, making paragraphs for newlines, but with single line spacing
|
|
class MyTextEdit: public QTextEdit {
|
|
Q_OBJECT
|
|
public:
|
|
MyTextEdit(QWidget * parent, const char *name=0);
|
|
void appendHtml(QString text);
|
|
void appendText(QString text);
|
|
void setBuffered(bool arg);
|
|
private:
|
|
bool buffered;
|
|
QString linebuffer;
|
|
QStringList buffer;
|
|
};
|
|
|
|
|
|
char *strtoupper(const char *str);
|
|
|
|
#endif
|