Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
All Data Structures Namespaces Files Functions Variables
DialogBox.List Class Reference
Inheritance diagram for DialogBox.List:
DialogBox.Item

Public Member Functions

def __init__
 
def height
 
def getValues
 
def scrollUp
 
def create
 
def draw
 
- Public Member Functions inherited from DialogBox.Item
def __init__
 
def height
 
def width
 
def getValues
 
def create
 
def draw
 
def undraw
 

Data Fields

 items
 
 numlines
 
 scroll
 
 gui_element
 
 picker
 
- Data Fields inherited from DialogBox.Item
 gui_element
 
 idname
 
 id
 

Additional Inherited Members

- Static Public Attributes inherited from DialogBox.Item
int next_id = 0
 

Detailed Description

Definition at line 122 of file dialog_box.py.

Constructor & Destructor Documentation

def __init__ (   self,
  id,
  items 
)

Definition at line 123 of file dialog_box.py.

124  def __init__(self,id,items):
125  self.items=items
126  self.numlines=len(items)
127  self.scroll=False
128  if self.numlines>10:
129  self.scroll=True
130  self.numlines=10
DialogBox.Item.__init__(self,id)

Member Function Documentation

def create (   self,
  owner,
  room,
  x,
  y,
  wid,
  hei 
)

Definition at line 142 of file dialog_box.py.

References dialog_box.makeRect().

143  def create(self,owner,room,x,y,wid,hei):
144  screen_loc = makeRect(x,y-.5*text_height,wid-0.05,hei-text_height)
145  self.gui_element=GUI.GUIGroup(room)
147  self.picker=GUI.GUISimpleListPicker(room,'XXXPicker',self.idname+'p', screen_loc,
148  textcolor =input_color , textbgcolor =screen_bgcolor,
149  selectedbgcolor=screen_bgcolor_nc, selectedcolor=screen_color, owner=owner,
150  textfontsize =font_size)
151  self.picker.items=[ GUI.GUISimpleListPicker.listitem(el,el) for el in self.items ]
152  self.gui_element.children.append(self.picker)
153 
154  if self.scroll:
155  screen_loc = makeRect(x+wid-0.05, y, 0.05, text_height)
156  scroll_up=GUI.GUIButton(room,'Scroll Up',self.idname+'u',{'*':None},screen_loc,
157  clickHandler=lambda b,p:self.picker.viewMove(-3),textfontsize=font_size)
158  scroll_up.setCaption(' /\\ ')
159  self.gui_element.children.append(scroll_up)
160 
161  screen_loc = makeRect(x+wid-0.05, y-hei+1.5*text_height, 0.05, text_height)
162  scroll_down=GUI.GUIButton(room,'Scroll Down',self.idname+'d',{'*':None},screen_loc,
163  clickHandler=lambda b,p:self.picker.viewMove(3), textfontsize=font_size)
164  scroll_down.setCaption(' \\/ ')
165  self.gui_element.children.append(scroll_down)
166 
return self.gui_element
def draw (   self)

Definition at line 167 of file dialog_box.py.

168  def draw(self):
169  DialogBox.Item.draw(self)
class Text(Item):
def getValues (   self,
  values 
)

Definition at line 133 of file dialog_box.py.

References DialogBox.Item.id.

134  def getValues(self,values):
135  values.append(self.id)
136  sel = self.picker.selection
137  if sel is None:
138  values.append('')
139  else:
values.append(self.picker.items[sel].data)
def height (   self)

Definition at line 131 of file dialog_box.py.

References DialogBox.List.numlines.

132  def height(self):
return (self.numlines+1) * (text_height+0.005) #fudge factor
def scrollUp (   self,
  button,
  params 
)

Definition at line 140 of file dialog_box.py.

141  def scrollUp(self,button,params):
self.picker.scroll('up')

Field Documentation

gui_element

Definition at line 144 of file dialog_box.py.

items

Definition at line 124 of file dialog_box.py.

numlines

Definition at line 125 of file dialog_box.py.

picker

Definition at line 146 of file dialog_box.py.

scroll

Definition at line 126 of file dialog_box.py.


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