+
+ // TODO size + onResize
+
+ addLabel("Search: ", 5, 3);
+ @SuppressWarnings("unused")
+ TField field = new TField(this, 15, 3, 5, true) {
+ @Override
+ public void onKeypress(TKeypressEvent keypress) {
+ super.onKeypress(keypress);
+ TKeypress key = keypress.getKey();
+ if (key.isFnKey() && key.getKeyCode() == TKeypress.ENTER) {
+ TuiReaderMainWindow.this.filter = getText();
+ TuiReaderMainWindow.this.refreshStories();
+ }
+ }
+ };
+
+ addLabel("Sort by: ", 5, 1);
+ // -1 = no default index (0 means first,...) 1=height when visible, null
+ // = action
+ List<String> data = Arrays.asList("(show all)", "Source", "Name",
+ "Author");
+ // must be last so to be able to draw over the rest
+ // TODO: make it so we cannot add manual entries
+ // TODO: how to select the item via keyboard? why double-click via
+ // mouse?
+ addComboBox(15, 1, 12, data, 0,
+ Math.min(data.size() + 1, getHeight() - 1 - 1), null);
+
+ list = addList(listItems, 0, 7, getWidth(), getHeight(), new TAction() {