Source: /app/hbasic/hbasic/gui_db_access/rsizehandle.h


Annotated List
Files
Globals
Hierarchy
Index
/* **************************************************************************
 File: rsizehandle.h
 Desc: 
 ----------------------------------------------------------------------------
	copyright            : (C) 2001 HBasic project (Marcus Engels)
 ***************************************************************************/

/* **************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

/* ----------------------------------------------------------------------- */
/* Classlist: List of classes that will be defined in this source file.    */
/* ----------------------------------------------------------------------- */

/* ----------------------------------------------------------------------- */
/* Changelog: Description of important changes within this file.           */
/*            Please report with date, maintainer and change description.  */
/* ----------------------------------------------------------------------- */

#ifndef RSIZEHANDLE_H
#define RSIZEHANDLE_H

#include 
#include 
#include 

class QMouseEvent;
class CReportEditorWidget;
class RWidgetSelection;
class QPaintEvent;

class RSizeHandle : public QWidget
{
    Q_OBJECT

public:
    enum Direction { LeftTop, Top, RightTop, Right, RightBottom, Bottom, LeftBottom, Left };

    RSizeHandle( CReportEditorWidget *parent, Direction d, RWidgetSelection *s );
    void setWidget( QWidget *w );
    void setActive( bool a );
    void updateCursor();

    void setEnabled( bool ) {}

protected:
    void paintEvent( QPaintEvent *e );
    void mousePressEvent( QMouseEvent *e );
    void mouseMoveEvent( QMouseEvent *e );
    void mouseReleaseEvent( QMouseEvent *e );

private:
    void trySetGeometry( QWidget *w, int x, int y, int width, int height );
    void tryResize( QWidget *w, int width, int height );

private:
    QWidget *widget;
    Direction dir;
    QPoint oldPressPos;
    CReportEditorWidget *formWindow;
    RWidgetSelection *sel;
    QRect geom, origGeom;
    bool active;
};

class RWidgetSelection
{
public:
    RWidgetSelection( CReportEditorWidget *parent, QPtrDict *selDict );

    void setWidget( QWidget *w, bool updateDict = TRUE );
    bool isUsed() const;

    void updateGeometry();
    void hide();
    void show();
    void update();
    
    QWidget *widget() const;

protected:
    QIntDict handles;
    QWidget *wid;
    CReportEditorWidget *formWindow;
    QPtrDict *selectionDict;

};

#endif

Generated by: root on linux on Sun Jul 13 18:06:35 2003, using kdoc 2.0a54.