view widgets/ExpandWidget.h @ 101:bc5b79e7b1d8

when adding a new pane, the pane stack is divided in equals parts
author lbajardsilogic
date Thu, 12 Jul 2007 07:25:32 +0000
parents a5175615d153
children 00cf9a7faa4d
line wrap: on
line source

/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */

/*   
	Sound Access
		EASAIER client application.
		Silogic 2007. Benoit Rigolleau.

	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 of the
	License, or (at your option) any later version.  See the file
	COPYING included with this distribution for more information.
*/

#ifndef _EXPAND_WIDGET_H
#define _EXPAND_WIDGET_H

#include <QApplication>
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLayout>
#include <QSplitter>
#include <QWidget>

class QPushButton;
class QSplitter;

class ExpandWidget : public QSplitter{
	Q_OBJECT	

	public:
		enum Location {
			Location_Top=0,
			Location_Right=1,
			Location_Bottom=2,
			Location_Left=3 
		};

		ExpandWidget(QWidget *parent=0);
        void setPanes(QWidget *newCenterPane, QWidget *newOtherPane);
		void setWidgetLocation(ExpandWidget::Location newWidgetLocation);

		void setPercentage(int a, int b);

	//signals:
      
	private slots:
		void changePaneSate();
    
	private:
		void refreshButtonIcone();

		QPushButton *m_button;
		QWidget *m_centerPane;
		QWidget *m_otherPane;
		QLayout *m_layout;
		ExpandWidget::Location m_widgetLocation;
		
		bool m_paneClosed;

};
#endif