1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/* Sound Player
Copyright (C) 1997 by Jung woo-jae */
#include <qlist.h>
#include <qpainter.h>
#include <qtablevw.h>
class MFile
{
public:
MFile(const char *string)
{str=strdup(string);selected=false;};
~MFile();
const char *string(void){return str;};
void Select(int num){selected=num;};
int IsSelected(void){return selected;};
private:
const char *str;
int selected;
};
class MSelect : public QTableView
{
Q_OBJECT
public:
MSelect(QWidget* parent=0,const char* name=0);
~MSelect();
void Clearfilelist();
void Appendfilelist(const char *str);
void Donefilelist();
const char* Cellstring(int fileindex);
void Select(int fileindex,bool select);
int IsSelected(int fileindex);
int Getselectedfilenumber() {return selectednumber;};
int Gettotalfilenumber() {return listnumber;};
signals:
void clicked();
void doubleclicked();
protected:
void paintCell(QPainter*,int fileindex,int);
void mousePressEvent(QMouseEvent* e);
void mouseDoubleClickEvent(QMouseEvent* e);
void focusInEvent(QFocusEvent*);
void focusOutEvent(QFocusEvent*);
private:
QList<MFile> *filelist;
int currentfileindex;
int currentselectnum;
int listnumber,selectednumber;
};
|