Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
GUILineEdit Class Reference
Inheritance diagram for GUILineEdit:
GUIGroup GUIElement

Public Member Functions

def focus_text
 
def __init__
 
def getText
 
def undraw
 
def keyDown
 
- Public Member Functions inherited from GUIGroup
def __init__
 
def show
 
def hide
 
def draw
 
def undraw
 
def redraw
 
def onMessage
 
- Public Member Functions inherited from GUIElement
def __init__
 
def __str__
 
def __repr__
 
def show
 
def hide
 
def notifyNeedRedraw
 
def draw
 
def undraw
 
def redraw
 
def onMessage
 
def onClick
 
def onShow
 
def onHide
 
def onDraw
 
def onUndraw
 
def onRedraw
 
def focus
 
def setModal
 
def isInteractive
 

Data Fields

 text
 
 focusbutton
 
 index
 
 action
 
 canceled
 
- Data Fields inherited from GUIGroup
 children
 
- Data Fields inherited from GUIElement
 room
 
 owner
 
 visible
 
 redrawPreservesZ
 
 id
 

Detailed Description

Definition at line 996 of file GUI.py.

Constructor & Destructor Documentation

def __init__ (   self,
  action,
  room,
  index,
  text,
  location,
  color,
  fontsize = 1.0,
  bgcolor = None,
  focusbutton = None,
  kwarg 
)

Definition at line 1001 of file GUI.py.

1002  def __init__(self,action,room,index,text,location,color,fontsize=1.0,bgcolor=None,focusbutton=None,**kwarg):
1003  GUIGroup.__init__(self,room,**kwarg)
1004  self.text = GUIStaticText(room,index,' '+text+'-',location,color,fontsize,bgcolor,**kwarg)
1005  self.children.append(self.text)
1006  if focusbutton:
1007  self.focusbutton = GUIButton(room,"XXXFocus Element",str(index)+'focus',{'*':None},location,
1008  clickHandler=self.focus_text)
1009  self.children.append(self.focusbutton)
1010  (x,y,w,h) = location.getNormalXYWH()
1011  (uw,uh) = GUIRect(0,0,10,10).getNormalWH()
1012  self.index=index
1013  Base.TextBox(room.getIndex(), str(self.index)+'line1', '---', x, y, (x+w, y+uh, 1),
1014  color.getRGB(), color.getAlpha(), color.getRGB())
1015  Base.TextBox(room.getIndex(), str(self.index)+'line2', '!', x, y, (x-uw, y+h, 1),
1016  color.getRGB(), color.getAlpha(), color.getRGB())
1017  Base.TextBox(room.getIndex(), str(self.index)+'line3', '---', x, y-h, (x+w, y+uh, 1),
1018  color.getRGB(), color.getAlpha(), color.getRGB())
1019  Base.TextBox(room.getIndex(), str(self.index)+'line4', '!', x+w, y, (x+uw, y+h, 1),
1020  color.getRGB(), color.getAlpha(), color.getRGB())
1021  if _doWhiteHack != 0:
1022  """ ugly hack, needed to counter a stupid bug """
1023  Base.TextBox(self.room.getIndex(),str(self.index)+"_white_hack","", -100.0, -100.0, (0.01, 0.01, 1), (0,0,0), 0, GUIColor.white().getRGB())
1024  self.action=action
1025  self.draw()
1026  self.canceled = False

Member Function Documentation

def focus_text (   self,
  button,
  params 
)

Definition at line 998 of file GUI.py.

References GUIElement.focus(), Tokenizer.index, ListReader.index, GUIRoom.index, GUIStaticImage.index, GUIStaticText.index, and GUILineEdit.index.

999  def focus_text(self,button,params):
1000  print 'focusing',self.index
self.focus(True)
def getText (   self)

Definition at line 1027 of file GUI.py.

1028  def getText(self):
1029  return self.text.getText()[1:-1]
def keyDown (   self,
  key 
)

Definition at line 1039 of file GUI.py.

References GUILineEdit.action, GUILineEdit.canceled, GUIStaticText.getText(), GUILineEdit.getText(), and locale.str().

1040  def keyDown(self,key):
1041  print "got key: %i" % key
1042  if key == 13 or key == 10: #should be some kind of return
1043  self.action(self)
1044  elif key == 27: #escape is always 27, isn't it?
1045  self.canceled = True
1046  self.action(self)
1047  elif key == 127 or key == 8: #avoid specifying the platform by treating del and backspace alike
1048  self.text.setText(' ' + self.getText()[:-1] + '-')
1049  elif key<127 and key>0:
1050  try:
1051  self.text.setText(' '+self.getText() + ('%c' % key) + '-');
1052  except:
1053  print "Character value too high "+str(key)
1054  #self.notifyNeedRedraw()
1055 
1056 """------------------------------------------------------------------"""
1057 """ """
1058 """ GUITextInputDialog - a little dialog in which you can enter text """
1059 """ """
1060 """------------------------------------------------------------------"""
1061 
def undraw (   self)

Definition at line 1030 of file GUI.py.

References Tokenizer.index, ListReader.index, GUIRoom.index, GUIStaticImage.index, GUIStaticText.index, GUILineEdit.index, and locale.str().

1031  def undraw(self):
1032  Base.EraseObj(self.room.getIndex(),str(self.index)+"line1")
1033  Base.EraseObj(self.room.getIndex(),str(self.index)+"line2")
1034  Base.EraseObj(self.room.getIndex(),str(self.index)+"line3")
1035  Base.EraseObj(self.room.getIndex(),str(self.index)+"line4")
1036  if _doWhiteHack != 0:
1037  Base.EraseObj(self.room.getIndex(),self.index+"_white_hack")
1038  GUIGroup.undraw(self)

Field Documentation

action

Definition at line 1023 of file GUI.py.

canceled

Definition at line 1025 of file GUI.py.

focusbutton

Definition at line 1006 of file GUI.py.

index

Definition at line 1011 of file GUI.py.

text

Definition at line 1003 of file GUI.py.


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