def __init__(self, parent, event, entity): wx.PyControl.__init__(self, parent, style=wx.NO_BORDER | wx.TAB_TRAVERSAL) self.entity = entity self.event = str(event) event_id = servers.get_trigger_server().geteventtransientid(event) event_label = servers.get_trigger_server().geteventlabel(event_id) event_label = "On " + event_label.lower() self.staticbox_operations = wx.StaticBox(self, -1, event_label) self.list_operations = wx.ListBox(self, -1) self.button_add_cmd = wx.Button(self, -1, "Add cmd") self.button_add_script = wx.Button(self, -1, "Add script") self.button_remove = wx.Button(self, -1, "Remove") self.button_edit = wx.Button(self, -1, "Edit") self.label_execute = wx.StaticText(self, -1, "Execute") self.choice_execute = wx.Choice(self, -1, choices=['All', 'One', 'Some']) self.label_min_delay = wx.StaticText(self, -1, "Minimum delay") self.float_min_delay = floatctrl.FloatCtrl(self, size=wx.Size(50, -1), style=wx.TE_RIGHT) self.label_max_delay = wx.StaticText(self, -1, "Maximum delay") self.float_max_delay = floatctrl.FloatCtrl(self, size=wx.Size(50, -1), style=wx.TE_RIGHT) self.__set_properties() self.__do_layout() self.__bind_events()
def __init__(self, *args, **kwds): PrefsPanel.__init__(self, *args, **kwds) self.staticbox_angle_group = wx.StaticBox(self, -1, "Angle snapping") self.staticbox_size_group = wx.StaticBox(self, -1, "Size snapping") self.staticbox_grid_group = wx.StaticBox(self, -1, "Grid") self.label_grid_1 = wx.StaticText(self, -1, "Minor grid line every") self.float_grid_cell_size = floatctrl.FloatCtrl(self, size=wx.Size(40, -1), style=wx.TE_RIGHT) self.label_grid_2 = wx.StaticText(self, -1, "world units") self.label_grid_3 = wx.StaticText(self, -1, "Major grid line every") self.int_grid_line_grouping = intctrl.IntCtrl(self, size=wx.Size(40, -1), style=wx.TE_RIGHT) self.label_grid_4 = wx.StaticText(self, -1, "minor grid lines") self.label_grid_5 = wx.StaticText(self, -1, "Minor grid line color") self.color_grid_minor = wx.lib.colourselect.ColourSelect(self, -1) self.label_grid_6 = wx.StaticText(self, -1, "Major grid line color") self.color_grid_major = wx.lib.colourselect.ColourSelect(self, -1) self.label_angle_1 = wx.StaticText(self, -1, "Angle snap") self.float_angle = floatctrl.FloatCtrl(self, size=wx.Size(40, -1), style=wx.TE_RIGHT) self.label_angle_2 = wx.StaticText(self, -1, "degrees") self.label_size_1 = wx.StaticText(self, -1, "Size snap") self.float_size = floatctrl.FloatCtrl(self, size=wx.Size(40, -1), style=wx.TE_RIGHT) self.label_size_2 = wx.StaticText(self, -1, "world units") self.__set_properties() self.__do_layout() self.__bind_events()
def __init__(self, parent): wx.Dialog.__init__(self, parent, -1, "Generate terrain lightmap") self.label_classname = wx.StaticText(self, -1, "Class", style=wx.ALIGN_RIGHT) self.text_classname = wx.TextCtrl(self, -1, "") self.label_resolution = wx.StaticText(self, -1, "Lightmap resolution") self.choice_resolution = wx.Choice( self, -1, choices=["16", "32", "64", "128", "256", "512"], size=(50, -1)) self.label_resolution_shadowmap = wx.StaticText( self, -1, "Shadowmap resolution") self.choice_resolution_shadowmap = wx.Choice( self, -1, choices=["16", "32", "64", "128", "256", "512", "1024", "2048"], size=(50, -1)) self.label_resolution_globallightmap = wx.StaticText( self, -1, "Global lightmap resolution") self.choice_resolution_globallightmap = wx.Choice( self, -1, choices=["16", "32", "64", "128", "256", "512", "1024", "2048"], size=(50, -1)) self.label_distance = wx.StaticText(self, -1, "Distance") self.text_ctrl_distance = floatctrl.FloatCtrl(self, -1, size=(50, -1), style=wx.TE_RIGHT) self.label_offset_u = wx.StaticText(self, -1, "Offset u") self.text_ctrl_offset_u = floatctrl.FloatCtrl(self, -1, size=(50, -1), style=wx.TE_RIGHT) self.label_offset_v = wx.StaticText(self, -1, "Offset v") self.text_ctrl_offset_v = floatctrl.FloatCtrl(self, -1, size=(50, -1), style=wx.TE_RIGHT) self.label_aaliasing = wx.StaticText(self, -1, "A Aliasing disk size") self.text_ctrl_aaliasing = floatctrl.FloatCtrl(self, -1, size=(50, -1), style=wx.TE_RIGHT) self.checkbox_overwrite = wx.CheckBox(self, -1, "Overwrite") self.button_ok = wx.Button(self, -1, "&OK") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "&Cancel") self.__set_properties() self.__do_layout() self.__bind_events()
def __init__( self, parent, id, label="", value=0.0, min_value=-1.0, max_value=1.0, precision=1000.0, round_decimals=5, float_ctrl_size=(45,-1) ): textslider.TextSlider.__init__(self, parent, id) self.precision = precision self.round_decimals = 5 label_ctrl = wx.StaticText(self, -1, label, style=cfg.SLIDER_LABEL_ALIGN) slider_ctrl = slider.Slider( self, -1, self._value_to_slider(value), self._value_to_slider(min_value), self._value_to_slider(max_value) ) float_ctrl = floatctrl.FloatCtrl( parent=self, limited=True, value=self._value_to_text(value), min=self._value_to_text(min_value), max=self._value_to_text(max_value), size=float_ctrl_size, style=wx.TE_RIGHT, round_decimals=round_decimals ) self._create(value, label_ctrl, slider_ctrl, float_ctrl)
def __init__(self, *args, **kwds): editorpanel.EditorPanel.__init__(self, *args, **kwds) self.entity = None self.label = wx.StaticText(self, -1, "Bound spawners/spawn points:") self.list = wx.ListCtrl(self, -1, style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_SORT_ASCENDING) self.button_bind = wx.Button(self, -1, "Bind selected spawner(s)") self.button_unbind = wx.Button(self, -1, "Unbind spawner") self.button_select = wx.Button(self, -1, "Select spawner") self.label_probability = wx.StaticText(self, -1, "Probability:") self.float_probability = floatctrl.FloatCtrl(self, size=wx.Size(50, -1), style=wx.TE_RIGHT) self.__set_properties() self.__do_layout() self.__bind_events()
def __init__(self, *args, **kwds): editorpanel.EditorPanel.__init__(self, *args, **kwds) self.entity = None self.list_geom_lods = wx.ListCtrl( self, -1, style=wx.LC_REPORT|wx.LC_SINGLE_SEL ) self.label_geom_max = wx.StaticText( self, -1, "Maximum distance" ) self.float_geom_max = floatctrl.FloatCtrl( self, size=wx.Size(50,-1), style=wx.TE_RIGHT ) self.__set_properties() self.__do_layout() self.__bind_events()
def __init__(self, *args, **kwds): editorpanel.EditorPanel.__init__(self, *args, **kwds) self.entity = None self.getting_values = False self.choicebook_shape = wx.Choicebook(self, -1) self.panel_rectangle = wx.Panel(self.choicebook_shape, -1) self.sizer_shape_staticbox = wx.StaticBox(self, -1, "Shape") self.panel_circle = wx.Panel(self.choicebook_shape, -1) self.label_radius = wx.StaticText(self.panel_circle, -1, "Radius", style=wx.TE_RIGHT) self.float_radius = floatctrl.FloatCtrl(self.panel_circle, limited=True, value=5.0, min=1.0, max=10000.0, size=wx.Size(60, -1), style=wx.TE_RIGHT) self.label_circle_height = wx.StaticText(self.panel_circle, -1, "Height", style=wx.TE_RIGHT) self.float_circle_height = floatctrl.FloatCtrl(self.panel_circle, limited=True, value=0.0, min=0.0, max=10000.0, size=wx.Size(60, -1), style=wx.TE_RIGHT) self.label_length = wx.StaticText(self.panel_rectangle, -1, "Length", style=wx.TE_RIGHT) self.float_length = floatctrl.FloatCtrl(self.panel_rectangle, limited=True, value=5.0, min=1.0, max=10000.0, size=wx.Size(60, -1), style=wx.TE_RIGHT) self.label_width = wx.StaticText(self.panel_rectangle, -1, "Width", style=wx.TE_RIGHT) self.float_width = floatctrl.FloatCtrl(self.panel_rectangle, limited=True, value=5.0, min=1.0, max=10000.0, size=wx.Size(60, -1), style=wx.TE_RIGHT) self.label_polygon_height = wx.StaticText(self.panel_rectangle, -1, "Height", style=wx.TE_RIGHT) self.float_polygon_height = floatctrl.FloatCtrl(self.panel_rectangle, limited=True, value=0.0, min=0.0, max=10000.0, size=wx.Size(60, -1), style=wx.TE_RIGHT) self.text_info = wx.lib.ticker.Ticker(self, -1, "Set a 0 height for an infinite height. " \ "Polygon length and width may not display the real size, " \ "use them only to make the polygon a rectangle.", bgcolor=wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE), ppf=1, fps=50) self.input = triggerinput.TriggerInputCtrl(self, 'Perceivable events') self.__set_properties() self.__do_layout() self.__bind_events()
def __init__(self, win): text_box_size_for_metre_values = (65, -1) self.staticbox_terrain_details = wx.StaticBox( win, -1, "Terrain details" ) self.label_separation = wx.StaticText( win, -1, "Point separation" ) self.text_ctrl_separation = floatctrl.FloatCtrl( win, -1, size=text_box_size_for_metre_values, style=wx.TE_RIGHT ) self.label_separation_units = wx.StaticText( win, -1, "metres" ) self.label_resolution = wx.StaticText( win, -1, "Terrain size" ) self.choice_resolution = wx.Choice( win, -1, choices = ["17", "33", "65", "129", "257", "513", "1025", "2049"], size = (-1, -1), ) self.label_resolution_units = wx.StaticText( win, -1, "pixels" ) self.label_block = wx.StaticText( win, -1, "Block size" ) self.block_size_choices = ["9", "17", "33", "65", "129"] self.choice_block = wx.Choice( win, -1, choices = self.block_size_choices, size = (-1, -1), ) self.label_block_units = wx.StaticText( win, -1, "pixels" ) self.label_level_size = wx.StaticText( win, -1, "Level size" ) self.choice_level_size = wx.Choice( win, -1, choices = [ str( self.get_default_terrain_size() ) ], size = (-1, -1), style = wx.TE_RIGHT ) self.label_level_size_units = wx.StaticText( win, -1, "metres" ) #set up the terrain height group of controls self.staticbox_height = wx.StaticBox( win, -1, "Height" ) self.label_min = wx.StaticText( win, -1, "Minimum height" ) self.text_ctrl_min = floatctrl.FloatCtrl( win, -1, size=text_box_size_for_metre_values, style=wx.TE_RIGHT ) self.label_min_units = wx.StaticText( win, -1, "metres" ) self.label_max = wx.StaticText( win, -1, "Maximum height" ) self.text_ctrl_max = floatctrl.FloatCtrl( win, -1, size=text_box_size_for_metre_values, style=wx.TE_RIGHT ) self.label_max_units = wx.StaticText( win, -1, "metres" ) self.checkbox_flatten = wx.CheckBox( win, -1, "Flatten all at" ) self.text_ctrl_flatten = floatctrl.FloatCtrl( win, -1, size=text_box_size_for_metre_values, style=wx.TE_RIGHT ) self.label_flatten_units = wx.StaticText( win, -1, "metres" ) #set up the terrain materials group of controls self.staticbox_materials = wx.StaticBox( win, -1, "Materials and textures" ) self.label_weightmap = wx.StaticText( win, -1, "Weightmap resolution" ) self.choice_weightmap = wx.Choice( win, -1, choices = ["64", "128", "256", "512"], size = (-1, -1) ) self.label_weightmap_units = wx.StaticText( win, -1, "pixels" ) self.label_global_res = wx.StaticText( win, -1, "Global texture resolution" ) self.choice_global_res = wx.Choice( win, -1, choices = ["256", "512", "1024", "2048"], size = (-1, -1) ) self.label_global_res_units = wx.StaticText( win, -1, "pixels" ) #set up the vegetation group of controls self.staticbox_vegetation = wx.StaticBox( win, -1, "Vegetation" ) self.label_veg_cells_per_block = wx.StaticText( win, -1, "Cells per terrain block" ) self.choice_veg_cells_per_block = wx.Choice( win, -1, choices = ["1x1", "2x2", "4x4", "8x8", "16x16", "32x32"], size = (-1, -1) ) self.label_vegetation_res = wx.StaticText( win, -1, "Editor map resolution" ) self.choice_vegetation_res = wx.Choice( win, -1, choices = ["2", "4", "8", "16", "32", "64", "128", "256"], size = (-1, -1) ) self.label_vegetation_res_units = wx.StaticText( win, -1, "pixels per block" ) self.set_properties() win.Bind( wx.EVT_TEXT, self.on_change_separation, self.text_ctrl_separation ) win.Bind( wx.EVT_CHOICE, self.__on_choice_resolution, self.choice_resolution ) win.Bind( wx.EVT_CHOICE, self.on_change_block_size, self.choice_block ) win.Bind( wx.EVT_CHECKBOX, self.on_checkbox_flatten, self.checkbox_flatten )