def HCI_InstON(self, m, i, idx, codes): """Appending the Instructions to follow the Next Target in "Target-Driven System" according to the current Tab""" ## -- Variable Declaration message = Label("", "Elephant 17", "orange", 0, 0.5, gtk.JUSTIFY_LEFT) self.container.attach(message, 1, 2, 0, 2) ## -- Label Update if all([codes[0] == "230", idx == 0]): message.set_text(m.replace(" Done", "come")) elif all([codes[0] == "230", idx == 1]): message.set_text(m.replace("Next", "First")) else: message.set_text(m) ## -- image widget cartoon = Image(i) cartoon.set_alignment(xalign=0.9, yalign=0.5) self.container.attach(cartoon, 0, 1, 0, 2) ## -- reset variables self.message = message self.cartoon = cartoon self.ready = True return False
def HCI_InstON(self, m, i, idx, codes): '''Appending the Instructions to follow the Next Target in "Target-Driven System" according to the current Tab''' ## -- Variable Declaration message = Label('', 'Elephant 17', 'orange', 0, 0.5, gtk.JUSTIFY_LEFT) self.container.attach(message, 1, 2, 0, 2) ## -- Label Update if all([codes[0] == '230', idx == 0]): message.set_text(m.replace(' Done', 'come')) elif all([codes[0] == '230', idx == 1]): message.set_text(m.replace('Next', 'First')) else: message.set_text(m) ## -- image widget cartoon = Image(i) cartoon.set_alignment(xalign = 0.9, yalign = 0.5) self.container.attach(cartoon, 0, 1, 0, 2) ## -- reset variables self.message = message self.cartoon = cartoon self.ready = True return False
def __init__(self): "Initial method to generate the Essex HCI" # ==================thread creation================= threading.Thread.__init__(self) # ================interface creation================ # (1) WINDOW ## -- window creation self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) ## --window configuration self.window.set_title("ESSEX Virtual Environment: Human-Computer Interface") background = gtk.gdk.color_parse(ground) self.window.modify_bg(gtk.STATE_NORMAL, background) self.window.set_border_width(7) self.window.set_resizable(True) self.window.resize(1275, 770) self.window.move(-1, -2) ## -- window events connection self.window.connect("destroy", self.destroy) # (2) TABLE: General widget container table = gtk.Table(3, 4, False) table.show() self.window.add(table) # (3) NOTEBOOK: General widget container ## -- notebook creation general_menu = gtk.Notebook() ## -- notebook configuration general_menu.set_show_border(True) general_menu.set_show_tabs(True) general_menu.set_size_request(1260, 705) style = general_menu.get_style().copy() style.bg[gtk.STATE_NORMAL] = general_menu.get_colormap().alloc_color(tab_bg) general_menu.set_style(style) ## -- 'necessities & desires' tab insertion nd_label = Label("Necessities&Desires ", small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) necessities = nd_menu() nd_table = necessities.nd_container() general_menu.append_page(nd_table, nd_label) ## -- 'mobility' tab insertion mob_label = Label("Mobility ", small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) mobility = mob_menu() mob_table = mobility.mob_container() general_menu.append_page(mob_table, mob_label) ## -- 'environment control' (EC) tab insertion EC_label = Label("EnvironmentControl ", small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) EC = EC_menu() EC_table = EC.EC_container() general_menu.append_page(EC_table, EC_label) ## -- 'messenger' tab insertion msg_label = Label("Messenger ", small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) messenger = msg_menu() msg_table = messenger.msg_container() general_menu.append_page(msg_table, msg_label) ## -- 'user-training' tab insertion ut_label = Label("User-Training ", small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) tutorial = UT_menu() ut_table = tutorial.UT_container() general_menu.append_page(ut_table, ut_label) ## -- notebook insertion to table table.attach(general_menu, 0, 4, 0, 1) general_menu.show() self.window.show() # (4) Copyright label = Label(" University of Essex ~ BCI Group", small_font, lblue, 0, 1, gtk.JUSTIFY_LEFT) table.attach(label, 0, 1, 1, 2) label = Label(" Luz Ma. Alonso Valerdi & Francisco Sepulveda", small_font, lblue, 0, 0.5, gtk.JUSTIFY_LEFT) table.attach(label, 0, 1, 2, 3) border = Image("Images\\Border.png") border.set_alignment(xalign=0.3, yalign=0.75) table.attach(border, 1, 3, 1, 3) logo = Image("Images\\logo.jpg") logo.set_alignment(xalign=0.95, yalign=1) table.attach(logo, 3, 4, 1, 3) general_menu.set_current_page(-1) # (5) Attribute assignation to enable them in following # methods ## -- main window self.general_menu = general_menu ## -- each instance corresponding to each tab self.necessities = necessities self.mobility = mobility self.EC = EC self.messenger = messenger self.tutorial = tutorial ## -- each widget container (table) corresponding to each tab self.TabTables = (nd_table, mob_table, EC_table, msg_table) self.quit = False
def __init__(self): 'Initial method to generate the Essex HCI' # ==================thread creation================= threading.Thread.__init__(self) # ================interface creation================ # (1) WINDOW ## -- window creation self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) ## --window configuration self.window.set_title("ESSEX Virtual Environment: Human-Computer Interface") background = gtk.gdk.color_parse(ground) self.window.modify_bg(gtk.STATE_NORMAL, background) self.window.set_border_width(7) self.window.set_resizable(True) self.window.resize(1275, 770) self.window.move(-1, -2) ## -- window events connection self.window.connect('destroy', self.destroy) # (2) TABLE: General widget container table = gtk.Table(3, 4, False) table.show() self.window.add(table) # (3) NOTEBOOK: General widget container ## -- notebook creation general_menu = gtk.Notebook() ## -- notebook configuration general_menu.set_show_border(True) general_menu.set_show_tabs(True) general_menu.set_size_request(1260, 705) style = general_menu.get_style().copy() style.bg[gtk.STATE_NORMAL] = general_menu.get_colormap().alloc_color(tab_bg) general_menu.set_style(style) ## -- 'necessities & desires' tab insertion nd_label = Label('Necessities&Desires ', small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) necessities = nd_menu() nd_table = necessities.nd_container() general_menu.append_page(nd_table, nd_label) ## -- 'mobility' tab insertion mob_label = Label('Mobility ', small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) mobility = mob_menu() mob_table = mobility.mob_container() general_menu.append_page(mob_table, mob_label) ## -- 'environment control' (EC) tab insertion EC_label = Label('EnvironmentControl ', small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) EC = EC_menu() EC_table = EC.EC_container() general_menu.append_page(EC_table, EC_label) ## -- 'messenger' tab insertion msg_label = Label('Messenger ', small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) messenger = msg_menu() msg_table = messenger.msg_container() general_menu.append_page(msg_table, msg_label) ## -- 'user-training' tab insertion ut_label = Label('User-Training ', small_font, orange, 0.5, 0.5, gtk.JUSTIFY_CENTER) tutorial = UT_menu() ut_table = tutorial.UT_container() general_menu.append_page(ut_table, ut_label) ## -- notebook insertion to table table.attach(general_menu, 0, 4, 0, 1) general_menu.show() self.window.show() # (4) Copyright label = Label(' University of Essex ~ BCI Group', small_font, lblue, 0, 1, gtk.JUSTIFY_LEFT) table.attach(label, 0, 1, 1, 2) label = Label(' Luz Ma. Alonso Valerdi & Francisco Sepulveda', small_font, lblue, 0, 0.5, gtk.JUSTIFY_LEFT) table.attach(label, 0, 1, 2, 3) border = Image('Images\\Border.png') border.set_alignment(xalign = 0.3, yalign = 0.75) table.attach(border, 1, 3, 1, 3) logo = Image('Images\\logo.jpg') logo.set_alignment(xalign = 0.95, yalign = 1) table.attach(logo, 3, 4, 1, 3) general_menu.set_current_page(-1) # (5) Attribute assignation to enable them in following # methods ## -- main window self.general_menu = general_menu ## -- each instance corresponding to each tab self.necessities = necessities self.mobility = mobility self.EC = EC self.messenger = messenger self.tutorial = tutorial ## -- each widget container (table) corresponding to each tab self.TabTables = (nd_table, mob_table, EC_table, msg_table) self.quit = False