Macro Mouse Cross/cs: Difference between revisions

From FreeCAD Documentation
(Created page with "===Kurzory, které mohou být používány===")
(Created page with "==Omezení== Kurzor může měnit vzhled v závislosti na používané pracovní ploše, musí opakovat funkci.<br /> The cursor can be subtitued to the other sliders (ex: ex...")
Line 38: Line 38:
SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor
SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor
PointingHandCursor, ForbiddenCursor, OpenHandCursor, ClosedHandCursor, WhatsThisCursor, BusyCursor, BitmapCursor
PointingHandCursor, ForbiddenCursor, OpenHandCursor, ClosedHandCursor, WhatsThisCursor, BusyCursor, BitmapCursor
==Limitation==
==Omezení==
Kurzor může měnit vzhled v závislosti na používané pracovní ploše, musí opakovat funkci.<br />
The cursor can change appearance depending on the used Workbench, he must repeat the operation.<br />

The cursor can be subtituer to the other sliders (ex: expansion of a window, corner...).<br />
The cursor can be subtitued to the other sliders (ex: expansion of a window, corner...).<br />
The rest resident macro.
The rest resident macro.



Revision as of 17:46, 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
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

Macro_Mouse_Cross

How to use

  1. Press the C button to activate the cross.
  2. 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)

Kurzory, které mohou být používány

ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IBeamCursor, SizeVerCursor, SizeHorCursor SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor PointingHandCursor, ForbiddenCursor, OpenHandCursor, ClosedHandCursor, WhatsThisCursor, BusyCursor, BitmapCursor

Omezení

Kurzor může měnit vzhled v závislosti na používané pracovní ploše, musí opakovat funkci.

The cursor can be subtitued to the other sliders (ex: expansion of a window, corner...).
The rest resident macro.