World: r3wp
[!RebGUI] A lightweight alternative to VID
older newer | first last |
Graham 16-Apr-2007 [6042] | I haven't found the on-fkey handler yet, but I am hoping that function keys are not defined at the face level. I use function keys at the application level ... and modify their behaviour depending on which tab has focus. |
Ashley 16-Apr-2007 [6043x2] | do %rebgui.r ctx-rebgui/on-fkey/f3: make function! [face] [print "Hi"] ... display ... ... do-events |
The handlers are global, the face argument is the face of the display which was active when the key was pressed (see %display.r for the processing logic). | |
Graham 16-Apr-2007 [6045] | I tried this with no luck. |
Ashley 16-Apr-2007 [6046] | What REBOL version? |
Graham 16-Apr-2007 [6047x3] | >> rebol/version == 1.3.2.3.1 |
>> do %rebgui.r Script: "Untitled" (none) >> ctx-rebgui/on-fkey/f3: make function! [face] [print "Hi"] display "" [ text "hello" ] do-events | |
nothing happens when I have focus on the window and press f3 | |
Ashley 16-Apr-2007 [6050x2] | Works here, and I'm running the same View version. |
ctx-rebgui/build? | |
Graham 16-Apr-2007 [6052x7] | hand built :( |
A merge of my changes with your latest | |
checking out a new version now | |
BTW, would it be okay to add caret support to spinner so that we can change a single character? | |
At present we have to highlight, erase and then type over | |
Function keys working now :) | |
Must have screwed up the merge I did | |
Ashley 16-Apr-2007 [6059] | You mean add the 'caret attribute to spinner? |
Graham 16-Apr-2007 [6060] | if that is what it takes |
Ashley 16-Apr-2007 [6061x2] | OK. In your outcome example change the size to 1x5 and add color: red to see what is happening. |
text (derived from label) is trying to protect you from: text 10 "A really long bit of text that should wrap even though I didn't specify 10x-1" but the problem is that if you specify 10x5 then it should honor that regardless of whether the text fits or not. The solution, I think, is to change the default size from -1x5 to -1x-1 but ensure that size/y is always a min of sizes/line. | |
Graham 16-Apr-2007 [6063x2] | I get a red line, which is deeper than specified |
I want to hide the widget so, I really want to set it to 0x0 | |
Ashley 16-Apr-2007 [6065] | what about: text "blah" false |
Graham 16-Apr-2007 [6066x2] | Hmm. That works |
Can I put that in the widget definition? | |
Ashley 16-Apr-2007 [6068] | show?: false |
Graham 16-Apr-2007 [6069x2] | I'm using these hidden widgets to controll the low, high range of acceptable values in a widget, and to provide them with database field names |
ie.form validation and not field validation | |
Ashley 16-Apr-2007 [6071] | Seems an obscure way of doing it ... |
Graham 16-Apr-2007 [6072x3] | It allows a user to define a template like this: label "Tender joint count? (0-28)" outcome "tender28" ifield low-range "0" hi-range "28" return |
so, outcome refers to the database field, and the user has integer field for the data, with a low range of 0, and a high range of 28 | |
I guess I could use a custom widget and use options instead | |
Ashley 16-Apr-2007 [6075] | or a spinner? |
Graham 16-Apr-2007 [6076x3] | takes too many clicks |
you have to highlight a spinner and type over it | |
extra work | |
Ashley 16-Apr-2007 [6079] | then add spinner to hilight-on-focus and they can just type overtype the value directly. |
Graham 16-Apr-2007 [6080x2] | I think I created this dialect pre-spinner days :) |
Does a spinner allow blank field to start off with ? Trying to avoid users accepting default values | |
Ashley 16-Apr-2007 [6082] | Not at the moment. Should it? And if so, should it let them leave the widget without entering a value? |
Graham 16-Apr-2007 [6083x5] | Well, I don't want to present a template with prefilled values |
because then the user doesn't know which ones they filled in or not | |
Hmm. Adding show?: false to the widget definition is not helping. | |
I guess the other reason I don't like using spinners in data entry forms is that it forces the user to switch from keyboard to mouse | |
Unless the spinner also accepts cursor keys | |
Ashley 16-Apr-2007 [6088] | Agreed. It's one of the things my users have asked for (especially on drop-list/edit-list). |
Graham 16-Apr-2007 [6089] | Guess my fix is going to be to add 'false to all the templates I have to hide the widgets in question |
Ashley 16-Apr-2007 [6090] | show?: false *should* work, haven't tracked down why not yet. Also, if you're going to be placing "hidden" widgets consider using box with a 0x0 size. This involved less processing and lets you use the data facet without having to "hide" the widget per sa. e.g. box 0x0 data "Text" does what you want. |
Graham 16-Apr-2007 [6091] | it would mean changing all the form processing logic which currenlty looks at the text facet |
older newer | first last |