Go to the documentation of this file.00001 import BigWorld, GUI
00002
00003 from Button import Button
00004
00005 class CheckBox( Button ):
00006
00007 factoryString = "PyGUI.CheckBox"
00008
00009 def __init__( self, component ):
00010 Button.__init__( self, component )
00011 self.buttonStyle = Button.CHECKBOX_STYLE
00012
00013 def onBound( self ):
00014 self.buttonIcon = self.component.box
00015 self.buttonLabel = self.component.label
00016 self._updateVisualState()
00017
00018
00019 @staticmethod
00020 def createInternal( texture, text="", **kwargs ):
00021 c = GUI.Window( "" )
00022 c.materialFX = "BLEND"
00023 c.widthMode = 'CLIP'
00024 c.heightMode = 'CLIP'
00025 c.horizontalPositionMode = 'CLIP'
00026 c.verticalPositionMode = 'CLIP'
00027
00028 box = GUI.Simple( texture )
00029 box.size = (0,0)
00030 box.horizontalPositionMode = "CLIP"
00031 box.verticalPositionMode = "CLIP"
00032 box.horizontalAnchor = "LEFT"
00033 box.position.x = -1
00034 box.materialFX = "BLEND"
00035 box.widthMode = "PIXEL"
00036 box.heightMode = "PIXEL"
00037 box.width = 20
00038 box.height = 20
00039
00040 c.addChild( box, "box" )
00041
00042 label = GUI.Text( text )
00043 label.horizontalPositionMode = "CLIP"
00044 label.verticalPositionMode = "CLIP"
00045 label.horizontalAnchor = "RIGHT"
00046 label.position.x = 1
00047 label.colour = (128, 128, 128, 255)
00048
00049 c.addChild( label, "label" )
00050
00051
00052
00053 return c
00054
00055 @staticmethod
00056 def create( texture, text="", **kwargs ):
00057 b = CheckBox( CheckBox.createInternal( texture, text, **kwargs), **kwargs )
00058 return b.component
00059
00060
00061