Mercurial > urwid-satext
comparison urwid_satext/sat_widgets.py @ 88:c95462c21966
primitivus (menu): MENU_ROLLER_(UP,DOWN) are not transmitted to next widget anymore
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 08 Sep 2014 15:42:23 +0200 |
parents | 9f683df69a4c |
children | 2141f07b5fdd |
comparison
equal
deleted
inserted
replaced
87:a0dbf973befa | 88:c95462c21966 |
---|---|
838 self.columns.contents[0] = (current_name, ('given', name_len, False)) | 838 self.columns.contents[0] = (current_name, ('given', name_len, False)) |
839 self.columns.contents[1] = (current_menu, ('weight', 1, False)) | 839 self.columns.contents[1] = (current_menu, ('weight', 1, False)) |
840 | 840 |
841 def keypress(self, size, key): | 841 def keypress(self, size, key): |
842 if key==a_key['MENU_ROLLER_UP']: | 842 if key==a_key['MENU_ROLLER_UP']: |
843 if self.columns.get_focus_column()==0 and self.selected > 0: | 843 if self.columns.get_focus_column()==0: |
844 self.selected -= 1 | 844 if self.selected > 0: |
845 self._showSelected() | 845 self.selected -= 1 |
846 self._showSelected() | |
846 return | 847 return |
847 elif key==a_key['MENU_ROLLER_DOWN']: | 848 elif key==a_key['MENU_ROLLER_DOWN']: |
848 if self.columns.get_focus_column()==0 and self.selected < len(self.name_list)-1: | 849 if self.columns.get_focus_column()==0: |
849 self.selected += 1 | 850 if self.selected < len(self.name_list)-1: |
850 self._showSelected() | 851 self.selected += 1 |
852 self._showSelected() | |
851 return | 853 return |
852 elif key==a_key['MENU_ROLLER_RIGHT']: | 854 elif key==a_key['MENU_ROLLER_RIGHT']: |
853 if self.columns.get_focus_column()==0 and \ | 855 if self.columns.get_focus_column()==0 and \ |
854 (isinstance(self.columns.contents[1][0], urwid.Text) or \ | 856 (isinstance(self.columns.contents[1][0], urwid.Text) or \ |
855 self.menus[self.name_list[self.selected]].getMenuSize()==0): | 857 self.menus[self.name_list[self.selected]].getMenuSize()==0): |