Macro Mouse Cross/cs: Difference between revisions
(Created page with "{{Macro|Icon=Text-x-python|Name=Macro_Mouse_Cross|Description=Toto malé makro mění šipku kurzoru myši na jemný křížek.|Shortcut="C" "A" |Author=Mario52}}") |
(Created page with "===Skript===") |
||
Line 12: | Line 12: | ||
# Press the {{KEY|A}} button to activate the arrow. |
# Press the {{KEY|A}} button to activate the arrow. |
||
== |
===Skript=== |
||
Macro_Mouse_Cross.FCMacro |
Macro_Mouse_Cross.FCMacro |
||
Revision as of 17:42, 6 February 2014
File:Text-x-python Macro_Mouse_Cross |
Description |
---|
Toto malé makro mění šipku kurzoru myši na jemný křížek. Author: Mario52 |
Author |
Mario52 |
Download |
None |
Links |
Macros recipes How to install macros How to customize toolbars |
Macro Version |
1.0 |
Date last modified |
None |
FreeCAD Version(s) |
None |
Default shortcut |
"C" "A" |
See also |
None |
Popis
Toto malé makro mění šipku kurzoru myši na jemný křížek.
Malý příklad použití třídy ViewObserver() a použití klávesnice SoKeyboardEvent
How to use
- Press the C button to activate the cross.
- Press the A button to activate the arrow.
Skript
Macro_Mouse_Cross.FCMacro
# -*- coding: utf-8 -*-
# Macro_Mouse_Cross mouse cursor to cross or arrow
from PyQt4 import QtCore, QtGui
class ViewObserver:
def logPosition(self, info):
self.pos = info["Key"]
if (self.pos.upper() == "C"):
# change the cursor cross ( + )
QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.CrossCursor))
elif (self.pos.upper() == "A"):
# change the cursor Arrow
QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
v=Gui.activeDocument().activeView()
o = ViewObserver()
c = v.addEventCallback("SoKeyboardEvent",o.logPosition)
Cursors that can be used
ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IBeamCursor, SizeVerCursor, SizeHorCursor SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor PointingHandCursor, ForbiddenCursor, OpenHandCursor, ClosedHandCursor, WhatsThisCursor, BusyCursor, BitmapCursor
Limitation
The cursor can change appearance depending on the used Workbench, he must repeat the operation.
The cursor can be subtituer to the other sliders (ex: expansion of a window, corner...).
The rest resident macro.