**Date: 2009-12-14 12:35** Subject: scroll and splitpane - handle_keys ( +widgets) ------------------------------------------------------- new container widgets need to trap handle_keys, not just motion but passing to contained object, e.g. if contained is **editable**. * * * **2009-10-13 00:16** ## subwins to pad copying ## 1. `overwrite()` from subwin to pad (both are same dimensions) was returning -1. 2. I increased dimensions of pad by 2, return 0, but no effect. 3. `copywin` works from subwin to pad (last 2 dimensions given are one less than height and width) So in tabbedpanes, i can use subwindows. When user switches I can write onto a pad. Whenevr he enters a tab, i refresh from pad. Else, the best alternative is that I actually write to pad directly and refresh the subwin on each update or open-pad. However, we need to make an underlying pad class that the user is unaware of. * * * **2009-10-11 22:42** ## copywin, subwins etc ## Okay, so i've got `copywin` working with pads and subwins but `copywin` is very sensitive to dimensions and returns a -1 (ERR) generously. `overwrite` with a pad and root window was fine, but the source goes completely onto the window. Can't scroll etc. I found even `prefresh` returning a -1 at times. `prefresh` does *not* require any `update_panel` or `wrefresh` it seems, and `touchln` was clearing it off. `copywin` _does_ require `wrefresh` and `update_panel`. See * * * **2009-10-11 09:48** ## Create pad class ## We need a pad class like window. perhaps Pad < Window. Only then can it be slipped in where Window was used. * * * **2009-10-11 09:43** ## Table to use subwin and or pad ## table with its scrolling should have used a pad, right ? Currently I repaint each time. However note that tables are editable. subwin will prevent overwriting windows. NOTE: subwin have an issue with panels. You cannot bring a panel up etc. Have to repaint the whole thing. * * * 2009-10-03 11:05 1. make compliant with 1.9.1 Note: TODO_OLD relates to the Application generator I was writing. There's a lot that works there. Given a table name you can do CRUD functions against it. However, that uses the ncurses fields and forms. After creating fields in ruby, i've ditched that, and will perhaps redo that with rbcurses. This todo relates to rbcurse, our own ruby fields, forms, widgets and application related goodies. APPS TO DO: DONE: sql viewer: this will properly test tables with each query sending totally different data struct or just diff rows. Also, we can address empty tables. DONE: Something like Pilot file browser - wip, two paned. Add multiple select operations to Finder Add construct to sqlc. MUST DO: ======== +----------+ | TO FIX | +----------+ listscrollable: search mor than one match in line ! messagebox width of input is 30, how to increase! List selection methods not firing any changed event on table. Perhaps: M-; should be select with M-: as add to selection. Like mouse click and Cmd+click Should navigation select ?? Table: if cell_selection_allowed not true we should be able to select row as a whole (which should be default). Textview search: work on case, and wrap around. TextView's set_form_col does not scroll horiz. That has to be done prior, so set_form_col cannot be used as is expecting that to happen. And example is in C-e. Listbox search: since this search sets form col too, it messes with form col here. Gen: when binding, we should check if that event is fireable. So widgets shold register their events first. Table: newlines scrood up display (select name, sql from sqlite_master) TextArea: remove_all (should it not be clear() ) -- should be set_text with blank handle_keys logic: some cases can return unhandled in which case we must still check furhter. So else should be taken and put outside the loop and run if no one handled (a flag) In some cases will use a flag (like textarea, where you don't wanna match old val) TEXTAREA : test with a wide box, larger than width of rows Give option of no wrap, and panning EDITING TABLES: Page down keeps selection on 3rd row from last. This happens since bounds_check tries to keep table full. If you delete a row, then selections get messed, since row selectoin uses indexes into table also, user may put a hook on on_leave, shoud check for exception and not proceed. Unlike a field, a field or editing comp in a table can have many exit paths - page up down, up down, next col prev col etc. We need to validate the field in each case and disallow navigation if error raised. - searching DONE 2009-01-26 22:20 however, check boxes etc should have auto editing. WHEN we delete a row, what happens. Is its on_leave still fired ? XXX Or the on_leave of the next row! in such case no on_leave should happen. EDITING LISTS: make the keys definable as in table clean up handle_keys - done to some extent. Not ideal though. - We are not calling on_leave and on_enter of cell_editor component ?? POPUP LIST: make edits such (calling editor) so it can defined on a key. In Finder, we press Enter to get into edit mode. separate methods in utils for get_selected_color, get_focussed_color etc Don;t update other widgets unless datachanged or properties changed. As in table. Properties: redraw only when property change or data change, not each time. Esp for label. TODO for field and buttons. fire_handler LIST_COMBO_SELECT <-- nope this is a bad name taken from Tk. LIST_SELECTION_EVENT is proper. textarea check if print border in initialize. NOPE> - can't call down up etc directly, since post_key still needs to be called. have to call handle_key KEY_UP etc. check if this is still true. 1. popup lists/combo lists: correct inconsistency in firing of event. RETURN vs SELECT sizing of messageboxes - scrollable Field and List and TextArea/View. programmatic scrolling setScrollOffset, making a row visible set_buffer alias set_text or setvalue ? Action: setting enabled should affect component. Listeners and event firing. ----------- ## ISSUES ----------- Some possible bugs in TextArea wrapping. When a word is carried dowm, it shold gt carried back up too if i pt a space inside. However, even vim does not do this, btw. Textarea bug: if line inserted is gt maxlen then it is split but when writing to disk a space will be added. This is a bug only if the line has NO SPACE in it. +----------+ | TO ADD | +----------+ TABLE: auto resizeing of columns so they expand to fill total width - recursively add one to each till max_width reached or total filled. LISTBOX EDITING: option to edit on a key: is_editing stuff EDITING IN TABLES: Sorting of tables using intermediate view that maps jtable to model - not imp TABBED: FORM: on_enter, on_exit - currently the on_enter and leave is for widgets as in ncurses. - Listbox : status or detail, row m or n. Search up and down - DONE - Text Area: INS/OVW - TextArea: choice of word wrap, col wrap or no wrap. - TextView: choice of word wrap, col wrap or no wrap. 3. Field and TextArea: OVERWRITE mode, FIELD justification mode (after tabout), FIELD - auto_skip (after reaching end), managing_focus() : true means it will eat a tab (insert a tab in case of textarea). Tabbedpane needs to look okay if change colors. At least should be able to switch to reverse. if there is no next, should onleave be fired ? focus_traversable - bool: tabbing won't get focus, but can be focussed by Enter (default) or hotkey. FileChooser, FileSaver RECENTLY DONE: -------------- WE need to clean up that space between cells also when panning, just in case. Table doesn't know how many cols displayed, e,g editing, tabbing - DONE WHEN scrolling, cancel editing. Table: adhoc queries, need to fill up width TextView lacks backward and forward searching, search messagebox should have checkbox for backward. TextArea - that stupid newline i put. DONE but more testing DefaultListSelectionModel does not fire a ListSelectionEvent - done 2009-02-14 00:27 Table - if more columns than displayable, how about panning ? Tabbed Pane may want to add OK, or OK_CANCEL buttons. - done Tabledemo: testtable.rb: checkboxes not showing X (true) when row not focussed! - Done, rel as 0.1.1 Menuitem: disabled, what if no action (not armed). disabled - cyan color. If no action, that's okay since we can have listeners that will act on index selected. LABEL to take ampersand also. ?? No there could be legit ampersands. Also only if label_for. Each widget coukd hve its own popup menu (like right click) with its own options. Hey, we don't have a popup menu. 2009-01-21 Delete does not result in any on_enter event firing. But then we are dealing with row??? OUCH - on_enter reqired otherwise editor has old value! COMBO: either choice of disabling arrow keys for table. or have sep editing option for table so some fields not accidentally changed. - unbind COMBO: case insensitive search (llist.combo etc) 2009-01-18 22:13 cell_editors created on demand, not in beginning. thus, we can't attach a hook to a field. No, there is a simple way as done in testtable modified should be a method, in most cases will check orig value. Field: ESC to put back original value. OK. Needed dup! if selected index is not visible, it needs to scroll down and make that visible - done 2009-01-17 13:36 globally replace RVariable with Variable and remove Variable - 2009-01-17 12:13 listbox searching - done 2009-01-14 13:30 Cancelling edits in lists. DONE. C-c or ESC 2009-01-13 22:12 EDITING IN TABLES: issue with auto_editing is how to go to next col since arrows are required in editing fields. currently using alt-tab for next_col - We are not calling on_leave and on_enter of cell_editor component -done 01-16 on_leave stop any editor that may be active - DONE 2009-01-16 23:55 some cols editable, some not (as in Finder). - TO TEST - DONE 2009-01-16 23:55 >>> Keep option of editing live as in Listbox. add option of automatic editing on enter on_enter_cell on_leave_cell and other events Now that lists have editable field/combo/check, try editing multicolumn tables. All that i need to do, is put celleditor and cellrenderer in TableColumn, and use that as done in list. actually there's more: moving into cells. TAB is strictly for movement across fields. Listbox. when cursor enters, cursor should be shown on selected row which could be another row, if we tabbed out earlier. Curently, always shows on row 0 when entering a list. DONE Form was setting cursor after calling on_enter. REDO Listbox, TextArea and TextView withuth scrollable, selectable. Field: if set_buffer sets numeric or float we should be intelligent and return edited values in same way, and not crash. For toggle, checkbutton etc it is variable, not textvariable Field to also have change event. Moved Textarea and Textview to Listscrollabel and now both paint only when modified. 2. cleanup scrollable code esp repaint method. Its okay to have scrollable and selectable, but call methods in them, rather than pass handlekey to them. Also don't delegate paint to them. Actually passing handle_key was an okay idea. TextView, how about wrapping option ? 2009-01-08 20:56 Newlistbox : if select_mode is single then clear previous selections. Also move to next selection and previous. if no focusable widget, stack overflow. XXX Make next_field safer. DONE 2009-01-08 12:58 text components: get set add keymap, get action for keystroke etc or will this make each widget heavy? TextArea/View may require for attaching actions/movement etc menu's Exit, throws close without destroying menu (i suspect). It should close menu then app. 2009-01-01 13:16 if text_variable, when updateing value also puts object name, then it can multiplex across many objcts like a set of checkboxes, like a model ? One such object can be used fr all fields and inside it update a hash. Save data from TextArea and see whether we've scrood it up or not. With changes to Listbox (model) now list_variable seems useless. Add tabbed pane to test2.rb and integrate so i see how it actually integrates. Togglebutton - selected (bool) Label should be able to take height and wrap. - DONE 2008-12-30 23:52 alert, confirm boxes in single line. put in test2 - done 2008-12-30 23:53 - TextView and Area: current row, col. INS/OVW - TextArea : show a $ if newline at end of line. DONE TextArea: recursive wrap till end of para, otherwise words go out of buffer area. 2008-12-28 cursor position in button, cb and radio - 2008-12-25 19:21 Used ACS_ codes to make better boxes, wonder why I didn't do that before. Was going the lynx way. Widget - event LEAVE and CHANGED should be separate. Currently validations happen on LEAVE. - Done. test more. combo attr for position below, above, centered, on. - DONE textarea and textview eating alt-keys! - DONE. textarea - CHANGE Event must give meaningful details such as offset start/end of change, text added or removed, type of change (ADD/REM/CHANGE) as in Listbox. DONE. Combo - list of 3 is showing only 2 in max visible, need to scroll down for 3rd/: @height helps - quick dialogs for alert, confirm, etc ========= Thoughts: ========= if repaint gets a handle for form.window then it neednt worry about getting initialized with form/window. in other words, when a widget needs a window ref it shd be given one.. Similaryl how can we remove haing to pass Form. That way one can create independent fields/widgets. text_variable etc: when set should class register with text_variable to be updated on change so it can repaint. or should it always repaint by default, if based on Variable. error messages - should they be popped up ? or choice of status bar and pop up. - create and fire events only if someones listening. ?? - make a sample data entry form (CRUD), so we can see how things really work. - filechooser - simple date widget YYYY-MM-DD using 3 fields - Action classes (like Java swing) which can be passed to a menu, button, or key. Also, disabling will disable for all. - toolbar ? - application class as per QT http://doc.trolltech.com/4.4-snapshot/mainclasses.html - status bar, main window ? - allow user to access history and enter from it, for field