World: r3wp
[View] discuss view related issues
older newer | first last |
Pekr 23-Jun-2005 [1525x3] | when I want my window to react upon ESC, do I still need to use insert-event-func? |
can I give focus to button? | |
Or map enter key to the button? | |
Volker 23-Jun-2005 [1528] | hotkey? #"^/" ? |
Anton 23-Jun-2005 [1529] | view layout [button #"^M" [print "action done."]] |
Pekr 23-Jun-2005 [1530] | ah, missed the quotes :-) it is ^M |
Anton 23-Jun-2005 [1531] | Buttons can't be focused. You would have to stylize your own button to do this. I think it was Frank Sievertsen who long ago showed how to make CHECKs focusable and respond to keys: tab, space enter etc. |
Pekr 23-Jun-2005 [1532] | thanks a lot, Anton ... I also wonder about following I have two layouts, I have small search dialog, then I have grid displaying the result. I use button action block, when I call btn "search" [view lay2 focus f] - and I wonder - how is that the focus f part is executed? I am glad it works, just don't understand it, I thought that by view lay2 events will not allow processing focus f ... |
Anton 23-Jun-2005 [1533] | (Sorry, buttons *can* be focused, they just don't feel good about it :) |
Pekr 23-Jun-2005 [1534] | it is a task for VID 1.4 or 1.5 then - buttons have to be focusable! |
Anton 23-Jun-2005 [1535] | yeah, that would be nice. |
Pekr 23-Jun-2005 [1536] | :-) |
Anton 23-Jun-2005 [1537x2] | view layout [btn "search" [view/new center-face layout [h1 "results..." f: field] focus f]] |
view layout [btn "search" [view center-face layout [h1 "results..." f: field do [focus f]]]] | |
Pekr 23-Jun-2005 [1539x2] | well, don't want to have two windows, so I don't need view/new. Just wondering, that once I call view lay2 from lay1 and there is another function in button action block in lay1, it gets executed, although theoretically events should be in lay2 already, no? |
ah, maybe it does not, sorry ... | |
Anton 23-Jun-2005 [1541] | good question. looking into layout ... |
Pekr 23-Jun-2005 [1542] | yes, it really does, just tried it ... |
Anton 23-Jun-2005 [1543] | LAYOUT does not DO-EVENTS a second time, therefore it does not "break" a block of code being done by ... wake-event (I think). |
Volker 23-Jun-2005 [1544] | view only calls do-events when there is no window visible. in your button action it is, so view just returns and the 'focus is executed. (if that was your question). |
Pekr 23-Jun-2005 [1545] | yes, exactly. So everything in button action will be executed, right? |
Volker 23-Jun-2005 [1546] | yes. |
Pekr 23-Jun-2005 [1547] | I thought that if I have do [focus f] in lay1 and from lay2 button code I call view lay1, that it will be executed once again, but that "do" is somehow lost already ... |
Volker 23-Jun-2005 [1548x2] | yes, the do-prts are only executed on building. |
means on layouting. after that you have a big face and that initialisation-stuff is lost. | |
Anton 23-Jun-2005 [1550] | Yes, lay1 is obviously the window FACE. |
Pekr 23-Jun-2005 [1551] | does anyone has any quick effect for dialog box, when I press enter, and search criteria is not found in database, I don't want to display empty grid, but then I have user to notify, there was no search result. Don't want to use label, as I would have to refresh it from various places. Nor dialog box - so sound (is that easy to play some default Windows action sound?) or some few flashes of background or so :-) |
Volker 23-Jun-2005 [1552] | if you layout again, [ view layout lay1-source ], it would be executed again. but if i understand right, you do just [ view lay1 ] |
Pekr 23-Jun-2005 [1553] | exactly, Volker ... |
Volker 23-Jun-2005 [1554x2] | A while ago we had some fun "beeping" faces. IIRC Anton started that. He made an image! from some layout and played that as wave. Needs low memory in script, if you find a good one. |
How about graying the grid with an alpha-face in front? or shall it show the old content? | |
Pekr 23-Jun-2005 [1556] | there is no grid ... I have just search field, focused, Close and Search button for mouse. If something is found, new layout appears - a grid, plus "focused" close button, which gets you back to first layout ... |
Volker 23-Jun-2005 [1557x2] | flashing can be done by rate. change color, rate changes color back and disables itself. |
hmm, then using two layouts? one with grid, another with "sorry"-message? | |
Pekr 23-Jun-2005 [1559] | now the only thing missing is - close window upon ESC |
Volker 23-Jun-2005 [1560x2] | notify-func does not do it, and hotkey not too? |
long not dealed with such events.. | |
Pekr 23-Jun-2005 [1562] | I remember using insert-event-func to catch it on global level ... I have to find it - It was somewhere on rebolforces iirc ... |
Gabriele 23-Jun-2005 [1563] | sensor #"^[" [unview] |
Volker 23-Jun-2005 [1564] | should basically work loke closing on close-button - ah, i to late :) |
Pekr 23-Jun-2005 [1565] | what, ESC? :-) cool! |
Gabriele 23-Jun-2005 [1566x4] | (you'll use unview/only, or unview/all ... whatever you need) |
^(esc) works too | |
mroe readable maybe | |
*more | |
Pekr 23-Jun-2005 [1570] | hmm, when I call quit from lay1, I get back to lay2, instead of quitting :-) |
Volker 23-Jun-2005 [1571] | Hu? And you did not redefine quit? |
Pekr 23-Jun-2005 [1572x2] | no .... |
I will try to shorten my example .... | |
Anton 23-Jun-2005 [1574] | Volker, it playing images wasn't my idea at the time. It's cool though. |
older newer | first last |