Logo Search packages:      
Sourcecode: sailcut version File versions  Download package

rigdef-panel.h

/*
 * Copyright (C) 1993-2005 Robert & Jeremy Lainé
 * See AUTHORS file for a full list of contributors.
 * 
 * $Id: rigdef-panel.h,v 1.5 2005/09/03 14:28:58 jeremy_laine Exp $
 * 
 * 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.
 * 
 * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef RIGDEF_PANEL_H
#define RIGDEF_PANEL_H

#include "rigdef.h"

#include <QWidget>

class QGroupBox;
class QTabWidget;
class QLabel;
class QLineEdit;
class QPushButton;


/**
 * A widget for displaying info about a CVector3d.
 */
00039 class CVector3dWidget : public QWidget
{
    Q_OBJECT

public:
    CVector3dWidget(QWidget *parent);
    virtual ~CVector3dWidget()
    {}
    ;

    CVector3d getVector();
    void setVector(const CVector3d &v);

protected:
    /** The text boxes. */
00054     vector<QLineEdit *>txtBox;
};

/** A widget for displaying information about a rigsail.
 */
00059 class CRigSailWidget : public QWidget
{
    Q_OBJECT

public:
    CRigSailWidget(QWidget *parent);
    virtual ~CRigSailWidget()
    {}
    ;

    void setRigSail(const CRigSail &newsail);

public slots:
    virtual void languageChange();

signals:
    /** Signals that the user hit the "Remove" button. */
    void signalRemove();
    /** Signals that the rigsail was modified. */
    void signalUpdate(const CRigSail& newsail);

protected slots:
    void slotReload();
    void slotRemove();
    void slotUpdate();

protected:
    /** the rigsail we are operating on */
00087     CRigSail rigsail;

    /** groupbox for the sail info */
00090     QGroupBox* grpInfo;

    /** label for the filename */
00093     QLabel* lblFile;
    /** label for the sail name */
00095     QLineEdit* txtName;
    /** static label saying "file" */
00097     QLabel* lblFileStatic;
    /** static label saying "name" */
00099     QLabel* lblNameStatic;

    /** widget for the origin */
00102     CVector3dWidget *wdgOrigin;

    /** button to accept changes to the CRigSail */
00105     QPushButton *btnUpdate;
    /** button to reload this sail from file */
00107     QPushButton *btnReload;
    /** button to remove this CRigSail */
00109     QPushButton *btnRemove;

};


/** A panel displaying one tab per rigsail of a given
 *  rig definition.
 */
00117 class CRigDefPanel : public QWidget
{
    Q_OBJECT

public:
    CRigDefPanel(QWidget *parent);

    void setRigDef(const CRigDef &newdef);

public slots:
    virtual void languageChange();
    virtual void slotRemove();
    virtual void slotUpdate(const CRigSail& newsail);

signals:
    /**  Signals that the rig definition was modified. */
    void signalUpdate(const CRigDef& newdef);

protected:
    /** the tabbed widget, with one tab per rigsail */
00137     QTabWidget *tabs;

    /** the widgets for the rigsail parameters */
00140     vector <CRigSailWidget*> sailwidget;

    /** the rig definition we are operating one */
00143     CRigDef rigdef;
};

#endif

Generated by  Doxygen 1.6.0   Back to index