2009-08-17 12:41:51 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
gtabstrip.h
|
|
|
|
|
2011-03-21 01:04:10 +01:00
|
|
|
(c) 2000-2011 Benoît Minisini <gambas@users.sourceforge.net>
|
2009-08-17 12:41:51 +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
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
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
|
2011-06-03 02:51:09 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA.
|
2009-08-17 12:41:51 +02:00
|
|
|
|
|
|
|
***************************************************************************/
|
2007-12-30 17:41:49 +01:00
|
|
|
#ifndef __GTABSTRIP_H
|
|
|
|
#define __GTABSTRIP_H
|
|
|
|
|
|
|
|
class gTabStripPage;
|
|
|
|
|
|
|
|
class gTabStrip : public gContainer
|
|
|
|
{
|
|
|
|
friend class gTabStripPage;
|
|
|
|
|
|
|
|
public:
|
|
|
|
gTabStrip(gContainer *parent);
|
|
|
|
~gTabStrip();
|
|
|
|
|
|
|
|
//"Properties"
|
2010-08-01 02:09:06 +02:00
|
|
|
int count() const { return _pages->len; }
|
2007-12-30 17:41:49 +01:00
|
|
|
int index();
|
|
|
|
int orientation();
|
|
|
|
void setOrientation(int vl);
|
|
|
|
bool tabEnabled(int ind);
|
|
|
|
gPicture* tabPicture(int ind);
|
|
|
|
bool tabVisible(int ind);
|
|
|
|
char *tabText(int ind);
|
|
|
|
int tabCount(int ind);
|
|
|
|
gControl *tabChild(int ind, int n);
|
|
|
|
|
|
|
|
bool setCount(int vl);
|
|
|
|
void setIndex(int vl);
|
|
|
|
void setTabPicture(int ind, gPicture *pic);
|
|
|
|
void setTabEnabled(int ind, bool vl);
|
|
|
|
void setTabText(int ind, char *txt);
|
|
|
|
void setTabVisible(int ind, bool vl);
|
|
|
|
bool removeTab(int ind);
|
2010-08-01 02:09:06 +02:00
|
|
|
void setClosable(bool v);
|
|
|
|
bool isClosable() const { return _button_pixbuf_normal != NULL; }
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
virtual int childCount();
|
|
|
|
virtual gControl *child(int index);
|
|
|
|
|
|
|
|
virtual void setRealBackground(gColor color);
|
|
|
|
virtual void setRealForeground(gColor color);
|
2009-02-12 17:43:25 +01:00
|
|
|
|
|
|
|
virtual void setFont(gFont *ft);
|
|
|
|
|
2010-06-27 18:31:05 +02:00
|
|
|
gFont *textFont();
|
|
|
|
void setTextFont(gFont *ft);
|
|
|
|
|
|
|
|
//"Events"
|
2007-12-30 17:41:49 +01:00
|
|
|
void (*onClick)(gTabStrip *sender);
|
2010-08-01 02:09:06 +02:00
|
|
|
void (*onClose)(gTabStrip *sender, int index);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
//"Private"
|
|
|
|
virtual GtkWidget *getContainer();
|
2010-11-07 12:41:59 +01:00
|
|
|
int getRealIndex(GtkWidget *page);
|
2010-08-01 02:09:06 +02:00
|
|
|
|
|
|
|
GdkPixbuf *_button_pixbuf_normal;
|
|
|
|
GdkPixbuf *_button_pixbuf_disabled;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
GPtrArray *_pages;
|
2010-06-27 18:31:05 +02:00
|
|
|
gFont *_textFont;
|
2007-12-30 17:41:49 +01:00
|
|
|
gTabStripPage *get(int ind);
|
2010-06-27 18:31:05 +02:00
|
|
|
void updateFont();
|
2007-12-30 17:41:49 +01:00
|
|
|
void destroyTab(int ind);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|