📄 cdrawingarea.h
字号:
/*************************************************************************** CDrawingArea.h (c) 2000-2005 Beno顃 Minisini <gambas@users.sourceforge.net> 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.***************************************************************************/#ifndef __CDRAWINGAREA_H#define __CDRAWINGAREA_H#include "gambas.h"#include <qevent.h>#include <qframe.h>#include "CWidget.h"#include "CContainer.h"#ifndef __CDRAWINGAREA_CPPextern GB_DESC CDrawingAreaDesc[];#else#define THIS ((CDRAWINGAREA *)_object)#define WIDGET ((MyDrawingArea *)((CWIDGET *)_object)->widget)#define CDRAWINGAREA_PROPERTIES CWIDGET_PROPERTIES \ ",Cached,Tracking,Border" /*Cached,Transparent"*/#endiftypedef struct { CWIDGET widget; QWidget *container; } CDRAWINGAREA;class MyDrawingArea : public QFrame{ Q_OBJECTpublic: MyDrawingArea(QWidget *parent); ~MyDrawingArea(); //void setTransparent(bool); //bool isTransparent(void) { return transparent; } void setCached(bool); bool isCached(void) { return _background != 0; } //QPixmap *getCache(void) { return cache; } //void refreshCache(void) { if (cache) setBackgroundPixmap(*cache); } void setBackground(void); void clearBackground(void); QPixmap *background() const { return _background; } void refreshBackground(); void setFrozen(bool f); bool isFrozen() { return _frozen; }protected: virtual void resize(int w, int h); virtual void paintEvent(QPaintEvent *); //virtual void drawContents(QPainter *p); virtual void setGeometry(int x, int y, int w, int h);private: QPixmap *_background; bool _frozen; long _event_mask; void doResize(int w, int h);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -