rfm2  22.0
A python-based rewrite of RenderMan for Maya
rfm2.ui.text_field.TextField Class Reference
+ Inheritance diagram for rfm2.ui.text_field.TextField:
+ Collaboration diagram for rfm2.ui.text_field.TextField:

Public Member Functions

def __init__ (self, name=None, **kwargs)
 
def showSubstitutedString (self)
 
def setText (self, text)
 
def getText (self)
 
def on_attr_changed (self)
 
def on_node_name_changed (self)
 
def setNodeAttr (self, nattr)
 
def setupScriptJobs (self, retry=False)
 
def updateExpressionButton (self)
 
def setDirty (self)
 
def setClean (self)
 
def setAttr (self)
 
def eventFilter (self, obj, event)
 
def focusOutEvent (self, event)
 
def focusInEvent (self, event)
 
def keyPressEvent (self, event)
 
def scrollContentsBy (self, *args)
 
def contextMenuEvent (self, event)
 
def set_change_cmd (self, closure)
 

Public Attributes

 nattr
 
 dirty
 
 blockDirty
 
 expr
 
 scriptJob
 
 fileName
 
 label
 
 labelWidth
 
 change_cmd
 
 previous_text
 
 syntax
 
 last_node_uuid
 
 previewButton
 
 highlighter
 
 cursor_pos
 
 cursor_anchor
 
 focus_stolen
 
 mod_down
 
 ctlname
 

Static Public Attributes

string DEFAULT_SYNTAX = 'filepath'
 

Detailed Description

Replacement for maya's textFieldGrp control.

Constructor & Destructor Documentation

◆ __init__()

def rfm2.ui.text_field.TextField.__init__ (   self,
  name = None,
**  kwargs 
)

Member Function Documentation

◆ contextMenuEvent()

def rfm2.ui.text_field.TextField.contextMenuEvent (   self,
  event 
)
Create a contextual menu to display/insert tokens in the field.

◆ eventFilter()

def rfm2.ui.text_field.TextField.eventFilter (   self,
  obj,
  event 
)
The whole purpose of this event filter is to prevent focus stealing
when the widget is in the HyperShade.
See code for more infos.
+ Here is the call graph for this function:

◆ focusInEvent()

def rfm2.ui.text_field.TextField.focusInEvent (   self,
  event 
)
Called when the widget gets focus.
+ Here is the call graph for this function:

◆ focusOutEvent()

def rfm2.ui.text_field.TextField.focusOutEvent (   self,
  event 
)
Re-implements QWidget.focusOutEvent(). Will be called when the widget
looses focus. This will be our signal to save a dirty buffer.

NOTE: we have to save the cursor position on focusOut, as the focus is
lost when the contectual menu is displayed and somehow the cursor
position is incorrectly reset to 0. To avoid this, we save it here and
re-position it in contextMenuEvent().
+ Here is the call graph for this function:

◆ getText()

def rfm2.ui.text_field.TextField.getText (   self)
Return the contents of the editor
+ Here is the caller graph for this function:

◆ keyPressEvent()

def rfm2.ui.text_field.TextField.keyPressEvent (   self,
  event 
)
Called when a key is pressed.
+ Here is the call graph for this function:

◆ on_attr_changed()

def rfm2.ui.text_field.TextField.on_attr_changed (   self)
Update the text field anytime the connected attribute changes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_node_name_changed()

def rfm2.ui.text_field.TextField.on_node_name_changed (   self)
update the plug name, assuming the uuid hasn't changed, and update
the scriptJobs
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scrollContentsBy()

def rfm2.ui.text_field.TextField.scrollContentsBy (   self,
args 
)
disable scrolling and ask the underlying document to redraw. This will
force a refresh of the whole line instead of just a few characters
around the cursor.

◆ set_change_cmd()

def rfm2.ui.text_field.TextField.set_change_cmd (   self,
  closure 
)
Set a command to be executed when the field's contents changes.

◆ setAttr()

def rfm2.ui.text_field.TextField.setAttr (   self)
Set the connected attribute to the field's value.
+ Here is the caller graph for this function:

◆ setClean()

def rfm2.ui.text_field.TextField.setClean (   self)
Clear the dirty flag and re-instate the clean palette.
+ Here is the caller graph for this function:

◆ setDirty()

def rfm2.ui.text_field.TextField.setDirty (   self)
Marks the contents of the editor as dirty so we know it should be
saved next time it looses focus.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNodeAttr()

def rfm2.ui.text_field.TextField.setNodeAttr (   self,
  nattr 
)
Associate the editor with a specific node attr and sets the editor
value to the attribute's current value.
+ Here is the call graph for this function:

◆ setText()

def rfm2.ui.text_field.TextField.setText (   self,
  text 
)
sets the content of the editor to text. If the editor is associated
to a node attribute, the contents will not be saved to the attribute.
+ Here is the caller graph for this function:

◆ setupScriptJobs()

def rfm2.ui.text_field.TextField.setupScriptJobs (   self,
  retry = False 
)
cleanup old script jobs if need be and create new ones to check if
an attribute changes or the node gets renamed.
If the job cleanup fails, the retry flag will be used to try again on
the next idle event.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSubstitutedString()

def rfm2.ui.text_field.TextField.showSubstitutedString (   self)
Toggle between the original string and the substituted version,
based on the preview button's state.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateExpressionButton()

def rfm2.ui.text_field.TextField.updateExpressionButton (   self)
Shows/hides the button based on the existence of a string match.
+ Here is the caller graph for this function:

Member Data Documentation

◆ blockDirty

rfm2.ui.text_field.TextField.blockDirty

◆ change_cmd

rfm2.ui.text_field.TextField.change_cmd

◆ ctlname

rfm2.ui.text_field.TextField.ctlname

◆ cursor_anchor

rfm2.ui.text_field.TextField.cursor_anchor

◆ cursor_pos

rfm2.ui.text_field.TextField.cursor_pos

◆ DEFAULT_SYNTAX

string rfm2.ui.text_field.TextField.DEFAULT_SYNTAX = 'filepath'
static

◆ dirty

rfm2.ui.text_field.TextField.dirty

◆ expr

rfm2.ui.text_field.TextField.expr

◆ fileName

rfm2.ui.text_field.TextField.fileName

◆ focus_stolen

rfm2.ui.text_field.TextField.focus_stolen

◆ highlighter

rfm2.ui.text_field.TextField.highlighter

◆ label

rfm2.ui.text_field.TextField.label

◆ labelWidth

rfm2.ui.text_field.TextField.labelWidth

◆ last_node_uuid

rfm2.ui.text_field.TextField.last_node_uuid

◆ mod_down

rfm2.ui.text_field.TextField.mod_down

◆ nattr

rfm2.ui.text_field.TextField.nattr

◆ previewButton

rfm2.ui.text_field.TextField.previewButton

◆ previous_text

rfm2.ui.text_field.TextField.previous_text

◆ scriptJob

rfm2.ui.text_field.TextField.scriptJob

◆ syntax

rfm2.ui.text_field.TextField.syntax

The documentation for this class was generated from the following file: