2008-04-24 14:49:12 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
CTabStrip.h
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
(c) 2000-2009 Benoît Minisini <gambas@users.sourceforge.net>
|
2008-04-24 14:49:12 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2008-04-24 14:49:12 +02:00
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __CTABSTRIP_H
|
|
|
|
#define __CTABSTRIP_H
|
|
|
|
|
|
|
|
#include "gambas.h"
|
|
|
|
|
|
|
|
#include "CWidget.h"
|
|
|
|
#include "CContainer.h"
|
|
|
|
#include "CPicture.h"
|
|
|
|
|
2009-07-15 01:10:30 +02:00
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QTabBar>
|
2008-04-24 14:49:12 +02:00
|
|
|
#include <QEvent>
|
|
|
|
|
|
|
|
#ifndef __CTABSTRIP_CPP
|
|
|
|
extern GB_DESC CTabStripDesc[];
|
|
|
|
extern GB_DESC CTabDesc[];
|
|
|
|
extern GB_DESC CTabChildrenDesc[];
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define QTABWIDGET(object) ((MyTabWidget *)((CWIDGET *)object)->widget)
|
|
|
|
|
|
|
|
#define WIDGET QTABWIDGET(_object)
|
|
|
|
#define THIS OBJECT(CTABSTRIP)
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
int child;
|
|
|
|
bool init;
|
|
|
|
}
|
|
|
|
CTABSTRIP_ENUM;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
CWIDGET widget;
|
|
|
|
QWidget *container;
|
|
|
|
CARRANGEMENT arrangement;
|
|
|
|
int index;
|
|
|
|
int id;
|
|
|
|
unsigned geom : 1;
|
|
|
|
unsigned lock : 1;
|
|
|
|
}
|
|
|
|
CTABSTRIP;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2008-05-01 01:08:02 +02:00
|
|
|
class CTab;
|
|
|
|
|
2008-04-24 14:49:12 +02:00
|
|
|
class MyTabWidget : public QTabWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2008-05-01 01:08:02 +02:00
|
|
|
QList<CTab *> stack;
|
|
|
|
|
2008-04-24 14:49:12 +02:00
|
|
|
MyTabWidget(QWidget *parent);
|
2009-09-01 03:14:13 +02:00
|
|
|
virtual ~MyTabWidget();
|
2008-04-24 14:49:12 +02:00
|
|
|
virtual void setEnabled(bool e);
|
|
|
|
void forceLayout();
|
|
|
|
|
2008-05-01 01:08:02 +02:00
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual bool eventFilter(QObject *, QEvent *);
|
2008-04-24 14:49:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CTabStrip : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
static CTabStrip manager;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2008-04-29 15:40:55 +02:00
|
|
|
void currentChanged(int);
|
2008-04-24 14:49:12 +02:00
|
|
|
};
|
|
|
|
|
2010-01-10 14:40:48 +01:00
|
|
|
void CTABSTRIP_arrange(void *_object);
|
|
|
|
|
2008-04-24 14:49:12 +02:00
|
|
|
#endif
|