summaryrefslogtreecommitdiff
path: root/qt-recordmydesktop/src/rmdFrame.py
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-04-27 02:45:30 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-04-27 02:45:30 +0000
commitbabee5fe38026e5b6210fa381aace3a19a89785f (patch)
treef9b6d82d7373c81c7420acdbb8c692bbff57fe2b /qt-recordmydesktop/src/rmdFrame.py
parentde6c6f26c88d6f961f9e450edb337510d7c893f9 (diff)
This commit was generated by cvs2svn to compensate for changes in r312,
which included commits to RCS files with non-trunk default branches. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@313 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'qt-recordmydesktop/src/rmdFrame.py')
-rw-r--r--qt-recordmydesktop/src/rmdFrame.py98
1 files changed, 98 insertions, 0 deletions
diff --git a/qt-recordmydesktop/src/rmdFrame.py b/qt-recordmydesktop/src/rmdFrame.py
new file mode 100644
index 0000000..ef05fc6
--- /dev/null
+++ b/qt-recordmydesktop/src/rmdFrame.py
@@ -0,0 +1,98 @@
+#/******************************************************************************
+#* qt-recordMyDesktop *
+#*******************************************************************************
+#* *
+#* Copyright (C) 2007 John Varouhakis *
+#* *
+#* *
+#* 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 *
+#* *
+#* *
+#* *
+#* For further information contact me at johnvarouhakis@gmail.com *
+#******************************************************************************/
+from PyQt4 import QtGui,QtCore
+
+class rmdFrame:
+ borderwidth=6
+ outlinewidth=1
+
+ def __init__(self,x,y,w,h):
+ self.window=QtGui.QWidget(None,QtCore.Qt.X11BypassWindowManagerHint|QtCore.Qt.WindowStaysOnTopHint)
+ self.x=x
+ self.y=y
+ self.w=w
+ self.h=h
+
+ self.mask = QtGui.QBitmap(self.w+self.borderwidth*2,
+ self.h+self.borderwidth*2)
+ self.mask.fill(QtCore.Qt.color1)
+
+ self.window.paintEvent=self.paintEvent
+ self.window.setWindowTitle("qt-recordMyDesktop frame")
+
+ self.window.setFixedSize(self.w+self.borderwidth*2,
+ self.h+self.borderwidth*2)
+
+ self.window.move(self.x-self.borderwidth,
+ self.y-self.borderwidth)
+ self.window.show()
+
+ def paintEvent(self,Event):
+
+ painterw= QtGui.QPainter(self.window)
+ painterw.fillRect(0,0,self.w+self.borderwidth*2,
+ self.h+self.borderwidth*2,
+ QtGui.QBrush(QtCore.Qt.white,
+ QtCore.Qt.SolidPattern))
+ painterw.fillRect(self.outlinewidth,
+ self.outlinewidth,
+ self.w+(self.borderwidth-
+ self.outlinewidth)*2,
+ self.h+(self.borderwidth-
+ self.outlinewidth)*2,
+ QtGui.QBrush(QtCore.Qt.black,
+ QtCore.Qt.SolidPattern))
+ painterw.fillRect(self.borderwidth-self.outlinewidth,
+ self.borderwidth-self.outlinewidth,
+ self.w+self.outlinewidth*2,
+ self.h+self.outlinewidth*2,
+ QtGui.QBrush(QtCore.Qt.white,
+ QtCore.Qt.SolidPattern))
+ if self.window.mask().isEmpty():
+ painter = QtGui.QPainter(self.mask)
+ painter.fillRect(self.borderwidth,
+ self.borderwidth,
+ self.w,self.h,
+ QtGui.QBrush(QtCore.Qt.color0,
+ QtCore.Qt.SolidPattern))
+ self.window.setMask(self.mask)
+ def pass_e(self):
+ pass
+
+ def destroy(self):
+ #self.area.destroy()
+ try:
+ self.window.close()
+ except:
+ pass
+
+if __name__ == "__main__":
+ import sys
+
+ app=QtGui.QApplication(sys.argv)
+ app.values=[[-1,-1,-1,-1]]
+ w = rmdFrame(100,100,340,260)
+ app.exec_()
© All Rights Reserved