Macro Mouse Cross/cs: Difference between revisions
(Updating to match new version of source page) |
Renatorivo (talk | contribs) No edit summary |
||
Line 8: | Line 8: | ||
{{clear}} |
{{clear}} |
||
== |
==How to use== |
||
# |
# Press the {{KEY|C}} button to activate the cross. |
||
# |
# Press the {{KEY|A}} button to activate the arrow. |
||
# Press the {{KEY|G}} button to activate the grid. |
|||
===Skript=== |
===Skript=== |
||
Line 42: | Line 43: | ||
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== |
||
The cursor can change appearance depending on the used Workbench, he must repeat the operation.<br /> |
|||
Kurzor může měnit vzhled v závislosti na používané pracovní ploše, musí opakovat funkci.<br /> |
|||
⚫ | |||
The grid is permanent.<br /> |
|||
⚫ | |||
The rest resident macro. |
The rest resident macro. |
||
[[Category:Poweruser Documentation |
[[Category:Poweruser Documentation/cs]] |
||
[[Category:Python Code |
[[Category:Python Code/cs]] |
||
<languages/> |
<languages/> |
Revision as of 18:24, 14 May 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.
- Press the G button to activate the grid.
Skript
Macro_Mouse_Cross.FCMacro
# -*- coding: utf-8 -*-
# mouse cursor to Cross or Arrow + Grig
from PyQt4 import QtCore, QtGui
from pivy import coin
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))
elif (self.pos.upper() == "G"):
# "wmayer" http://forum.freecadweb.org/viewtopic.php?f=3&t=1065&hilit=cross#p8818
# Create Grid
grid=coin.SoType.fromName("SoDrawingGrid").createInstance()
Gui.ActiveDocument.ActiveView.getSceneGraph().addChild(grid)
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
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 grid is permanent.
The rest resident macro.