| 2419 | |
| 2420 | |
| 2421 | class HelpDialog(tkinter.Toplevel): |
| 2422 | |
| 2423 | def __init__(self, culebron): |
| 2424 | self.culebron = culebron |
| 2425 | self.parent = culebron.window |
| 2426 | tkinter.Toplevel.__init__(self, self.parent) |
| 2427 | # self.transient(self.parent) |
| 2428 | self.title("%s: help" % Culebron.APPLICATION_NAME) |
| 2429 | |
| 2430 | self.text = tkinter.scrolledtext.ScrolledText(self, width=60, height=40) |
| 2431 | self.text.insert(tkinter.INSERT, ''' |
| 2432 | Special keys |
| 2433 | ------------ |
| 2434 | |
| 2435 | F1: Help |
| 2436 | F5: Refresh |
| 2437 | |
| 2438 | Mouse Buttons |
| 2439 | ------------- |
| 2440 | <1>: Touch the underlying View |
| 2441 | |
| 2442 | Commands |
| 2443 | -------- |
| 2444 | Ctrl-A: Generates startActivity() call on output script |
| 2445 | Ctrl-D: Drag dialog |
| 2446 | Ctrl-F: Take snapshot and save to file |
| 2447 | Ctrl-K: Control Panel |
| 2448 | Ctrl-L: Long touch point using PX |
| 2449 | Ctrl-I: Touch using DIP |
| 2450 | Ctrl-P: Touch using PX |
| 2451 | Ctrl-Q: Quit |
| 2452 | Ctrl-S: Generates a sleep() on output script |
| 2453 | Ctrl-T: Toggle generating test condition |
| 2454 | Ctrl-V: Verifies the content of the screen dump |
| 2455 | Ctrl-Z: Touch zones |
| 2456 | ''') |
| 2457 | self.text.grid(row=1, column=1) |
| 2458 | |
| 2459 | self.buttonBox() |
| 2460 | |
| 2461 | def buttonBox(self): |
| 2462 | # add standard button box. override if you don't want the |
| 2463 | # standard buttons |
| 2464 | |
| 2465 | box = tkinter.Frame(self) |
| 2466 | |
| 2467 | w = tkinter.Button(box, text="Dismiss", width=10, command=self.onDismiss, default=tkinter.ACTIVE) |
| 2468 | w.grid(row=1, column=1, padx=5, pady=5) |
| 2469 | |
| 2470 | self.bind("<Return>", self.onDismiss) |
| 2471 | self.bind("<Escape>", self.onDismiss) |
| 2472 | |
| 2473 | box.grid(row=2, column=1) |
| 2474 | |
| 2475 | def onDismiss(self, event=None): |
| 2476 | # put focus back to the parent window's canvas |
| 2477 | self.culebron.canvas.focus_set() |
| 2478 | self.destroy() |