コード例 #1
0
 def __draw_input_fields(self, arg, element, type):        
     for i in xrange(len(arg)):
         if type == "in":                            
             label = "label_in%d" % i
         else:
             label = "label_out%d" % i
             
         if arg[i] == 'i':
             element.append(pg.wxIntProperty('Integer', label))
             self.cmds_pg.Append(element[i])
         elif arg[i] == 'f':
             element.append(pg.wxFloatProperty('Float', label))
             self.cmds_pg.Append(element[i])
         elif arg[i] == 's':
             if type == "in":
                 element.append(pg.wxStringCallBackProperty('String', 
                                 label, '' ))
                 self.cmds_pg.Append(element[i])
                 dlg = browser.create_dialog(self, True)
                 element[i].SetCallBackDialog(dlg)
             else:                    
                 element.append(pg.wxStringProperty('String', label, ''))
                 self.cmds_pg.Append(element[i])
         elif arg[i] == 'b':
             element.append(pg.wxEnumProperty('Boolean', 
                                label,['True','False'],[1,0],2,0 ))
             self.cmds_pg.Append(element[i])
         elif arg[i] == 'o':
             if type == "in":
                 element.append(pg.wxStringCallBackProperty( 'Object', 
                                     label, '' ))
                 self.cmds_pg.Append(element[i])
                 dlg = browser.create_dialog(self, True)        
                 element[i].SetCallBackDialog(dlg)  
             else:
                 element.append(pg.wxStringProperty('Object', label, ''))
                 self.cmds_pg.Append(element[i])
         elif arg[i] == 'l':
             if type == "in":
                 element.append(pg.wxStringProperty('List', label, ''))
                 self.cmds_pg.Append(element[i])
             else:
                 element.append(pg.wxArrayStringProperty('List', label, ''))
                 self.cmds_pg.Append(element[i])
             
         else:
             element.append(pg.wxStringProperty('String', label,
                                                    'Unknow type!!!'))
             self.cmds_pg.Append(element[i])
コード例 #2
0
def draw_input_fields(inspector_win, arg, element, type):        
    for i in xrange(len(arg)):
        if type == "in":                            
            label = "label_in%d" % i
        else:
            label = "label_out%d" % i
            
        if arg[i] == 'i':
            element.append(pg.wxIntProperty('Integer', label))
            inspector_win.cmds_pg.Append(element[i])
        elif arg[i] == 'f':
            element.append(pg.wxFloatProperty('Float', label))
            inspector_win.cmds_pg.Append(element[i])
        elif arg[i] == 's':
            if type == "in":
                element.append(pg.wxStringCallBackProperty('String', 
                                label, '' ))
                inspector_win.cmds_pg.Append(element[i])
                dlg = browser.create_dialog(inspector_win, True)
                element[i].SetCallBackDialog(dlg)                                               
            else:                    
                element.append(pg.wxStringProperty('String', label, ''))
                inspector_win.cmds_pg.Append(element[i])
        elif arg[i] == 'b':
            element.append(pg.wxEnumProperty('Boolean', 
                               label,['True','False'],[1,0],2 ))
            inspector_win.cmds_pg.Append(element[i])
        elif arg[i] == 'o':
            if type == "in":
                element.append(pg.wxStringCallBackProperty( 'Object', 
                                    label, '' ))
                inspector_win.cmds_pg.Append(element[i])
                dlg = browser.create_dialog(inspector_win, True)        
                element[i].SetCallBackDialog(dlg)  
            else:
                element.append(pg.wxStringProperty('Object', label, ''))
                inspector_win.cmds_pg.Append(element[i])
        elif arg[i] == 'l':
            if type == "in":
                element.append(pg.wxStringProperty('List', label, ''))
                inspector_win.cmds_pg.Append(element[i])
            else:
                element.append(pg.wxArrayStringProperty('List', label, ''))
                inspector_win.cmds_pg.Append(element[i])
            
        else:
            element.append(pg.wxStringProperty('String', label,
                                                   'Unknow type!!!'))
            inspector_win.cmds_pg.Append(element[i])
コード例 #3
0
def check_string_subtypes(subtype, param_name, label):
    if subtype is not "":
        if "asset" == subtype:
            directory = mangle_path("wc:export/assets") + "\\"
            element = pg.wxFileProperty(param_name, label, directory)
        elif "texture" == subtype:
            directory = mangle_path("wc:export/textures") + "\\"
            element = pg.wxFileProperty(param_name, label, directory)
        elif "shader" == subtype:
            directory = mangle_path("wc:export/shader") + "\\"
            element = pg.wxFileProperty(param_name, label, directory)
        elif "file" == subtype:
            directory = mangle_path("wc:")
            element = pg.wxFileProperty(param_name, label, directory)
        elif "directory" == subtype:
            directory = mangle_path("home:")
            element = pg.wxDirProperty(param_name, label, directory)
        elif "entityobject" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '')
            dlg = browser.create_dialog(True, "/sys/nobject/nentityobject")
            element.SetCallBackDialog(dlg)
        elif "nroot" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '')
            dlg = browser.create_dialog(True, "/")
            element.SetCallBackDialog(dlg)
        elif "entityclass" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '')
            dlg = grimoire.create_dialog(True)
            element.SetCallBackDialog(dlg)
        elif "nobjectclass" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '')
            dlg = entitybrowser.create_dialog(self)
            element.SetCallBackDialog(dlg)
    else:
        # No subtype
        element = pg.wxStringProperty(param_name, label, '')

    return element
コード例 #4
0
def check_string_subtypes(subtype, param_name, label):
    if subtype is not "":
        if "asset" == subtype:
            directory = mangle_path("wc:export/assets") + "\\"
            element = pg.wxFileProperty(param_name, label, directory)
        elif "texture" == subtype:
            directory = mangle_path("wc:export/textures") + "\\"
            element = pg.wxFileProperty(param_name, label, directory)
        elif "shader" == subtype:
            directory = mangle_path("wc:export/shader") + "\\"
            element = pg.wxFileProperty(param_name, label, directory)
        elif "file" == subtype:
            directory = mangle_path("wc:")
            element = pg.wxFileProperty(param_name, label, directory)
        elif "directory" == subtype:
            directory = mangle_path("home:")
            element = pg.wxDirProperty(param_name, label, directory)
        elif "entityobject" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '' )
            dlg = browser.create_dialog(True, "/sys/nobject/nentityobject")
            element.SetCallBackDialog(dlg)
        elif "nroot" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '' )
            dlg = browser.create_dialog(True, "/")                            
            element.SetCallBackDialog(dlg)
        elif "entityclass" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '' )
            dlg = grimoire.create_dialog(True)                            
            element.SetCallBackDialog(dlg)
        elif "nobjectclass" == subtype:
            element = pg.wxStringCallBackProperty(param_name, label, '' )
            dlg = entitybrowser.create_dialog(self)
            element.SetCallBackDialog(dlg)
    else:
        # No subtype
        element = pg.wxStringProperty(param_name, label, '')

    return element
コード例 #5
0
 def __get_subtype_property(self, subtype, name, label):
     if "asset" == subtype:
         directory = servers.get_file_server().manglepath("wc:export/assets") + "\\"
         prop = pg.wxFileProperty(name, label, directory)
     elif "texture" == subtype:
         directory = servers.get_file_server().manglepath("wc:export/textures") + "\\"
         prop = pg.wxFileProperty(name, label, directory)
     elif "image" == subtype:
         directory = servers.get_file_server().manglepath("wc:export/textures") + "\\"
         prop = pg.wxAdvImageFileProperty(name, label)
     elif "shader" == subtype:
         directory = servers.get_file_server().manglepath("wc:export/shader") + "\\"
         prop = pg.wxFileProperty(name, label, directory)
     elif "file" == subtype:
         directory = servers.get_file_server().manglepath("wc:")
         prop = pg.wxFileProperty(name, label, directory)
     elif "material" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '')
         dlg = nodelibdlg.NodeLibDialog( self, nodelibdlg.SELECT,
             'material', 'Material', "/usr/materials")
         prop.SetCallBackDialog(dlg)
     elif "directory" == subtype:
         directory = servers.get_file_server().manglepath("home:")
         prop = pg.wxDirProperty(name, label, directory)
     elif "entityobjectclass" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = objbrowserwindow.create_dialog(
                     self, 
                     True, 
                     "/sys/nobject/nentityobject"
                     )
         prop.SetCallBackDialog(dlg)
         prop = pg.wxStringProperty(name, label, '')
     elif "nroot" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = objbrowserwindow.create_dialog(
                     self, 
                     True, 
                     "/"
                     )
         prop.SetCallBackDialog(dlg)
     elif "entityclass" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = grimoire.create_dialog(self, True)
         prop.SetCallBackDialog(dlg)
     elif "entityobject" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = entitybrowser.create_dialog(self)
         prop.SetCallBackDialog(dlg)
     elif "musicsample" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = musictabledlg.dialog_for_music_sample_selection(self)
         prop.SetCallBackDialog(dlg)
     elif "musicmood" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = musictabledlg.dialog_for_music_mood_selection(self)
         prop.SetCallBackDialog(dlg)
     elif "musicstyle" == subtype:
         prop = pg.wxStringCallBackProperty(name, label, '' )
         dlg = musictabledlg.dialog_for_music_style_selection(self)
         prop.SetCallBackDialog(dlg)
     else:
         print "Bad subtype"
         prop = pg.wxStringProperty(name, label, '')
 
     return prop