Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Inform & keyboard

 [1/4] from: philb:upnaway at: 10-Jul-2002 21:09


Hi Guys, I have a problem with Rebol & Dialog boxes. I want to put up a dialog box and press Escape to cancel it or Enter to confirm it. But it looks like inform isnt compatible with keyboard input. Sensors dont seem to work and keyboard shortcuts on buttons dont work either. Its not a showstopper but would make my program more user friendly. Any ideas .... or does anyone have some example for me to study? Cheers Phil

 [2/4] from: nitsch-lists::netcologne::de at: 10-Jul-2002 16:44


Am Mittwoch, 10. Juli 2002 16:09 schrieb [philb--upnaway--com]:
> Hi Guys, > I have a problem with Rebol & Dialog boxes.
<<quoted lines omitted: 5>>
> Its not a showstopper but would make my program more user friendly. > Any ideas .... or does anyone have some example for me to study?
hotkeys are evaluated in system/view/window-feel. and that is set automatic by 'view only for the first window. one can set it by hand. try: lay: layout [ tf: title "press control-t" 400 button "test" #"^t" [ tf/text: "you pressed the button or the key" show tf ] ] lay/feel: system/view/window-feel inform lay
> Cheers Phil
Cheers Volker

 [3/4] from: gscottjones:mchsi at: 10-Jul-2002 10:18


From: Phil
> I want to put up a dialog box and press Escape > to cancel it or Enter to confirm it. > > But it looks like inform isnt compatible with keyboard input. > Sensors dont seem to work and keyboard shortcuts on buttons dont work
either.
> Its not a showstopper but would make my program more user friendly. > > Any ideas .... or does anyone have some example for me to study?
Hi, Phil, I'm sure that there are several ways. One way is demonstrated as follows: l: layout [ text "Press Return or Escape" key keycode #"^M" [ t/text: "Return" show t unview l ] key keycode escape [ t/text: "Escape" show t unview l ] ] view layout [ t: text 100x16 "none" button "Get Dialog" [ view/new/offset l 100x100 do-events ] ] Hope this helps. (Gotta keep that great email client as user friendly as possible!! :-) --Scott Jones

 [4/4] from: philb:upnaway at: 11-Jul-2002 0:56


Hi Scott/Volker, Based on Volkers example I tried this .... no as nice as RT's request (the size of the text field is hard coded for example) but does the job I need .... rebol [title: "OK Cancel Dialog box with keboard shortcuts"] inform-kb: func [ip-text /local lay lv-ok] [ lay: layout [ space 5 origin 5x5 at 5x5 vtext ip-text bold 300x24 return across button "OK" #"^M" [lv-ok: true hide-popup] button "Cancel" #"^[" [lv-ok: false hide-popup] ] lay/feel: system/view/window-feel inform lay [system/view/screen-face/size - lay/size / 2] lv-ok ] print inform-kb "This is a dialog box - Escape = Cancel Enter = OK" halt Cheers Phil === Original Message === Am Mittwoch, 10. Juli 2002 16:09 schrieb [philb--upnaway--com]:
> Hi Guys, > I have a problem with Rebol & Dialog boxes.
<<quoted lines omitted: 5>>
> Its not a showstopper but would make my program more user friendly. > Any ideas .... or does anyone have some example for me to study?
hotkeys are evaluated in system/view/window-feel. and that is set automatic by 'view only for the first window. one can set it by hand. try: lay: layout [ tf: title "press control-t" 400 button "test" #"^t" [ tf/text: "you pressed the button or the key" show tf ] ] lay/feel: system/view/window-feel inform lay
> Cheers Phil
Cheers Volker

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted