oskusalerma / blyte

Screenplay writing program

This URL has Read+Write access

blyte / commandsdlg.py
100644 102 lines (72 sloc) 2.683 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
from wxPython.wx import *
from wxPython.html import *
 
class CommandsDlg(wxDialog):
    def __init__(self):
        wxDialog.__init__(self, None, -1, "Commands",
                          size = (650, 600),
                          style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
 
        self.Center()
        
        vsizer = wxBoxSizer(wxVERTICAL)
        self.SetSizer(vsizer)
 
        html = """
<html></head><body>
<pre>
<b>Mouse:</b>
 
Left click Position cursor
Left click + drag Select text
Right click Unselect
 
<b>Keyboard commands:</b>
 
<b>Editing:</b>
Left/Right/Up/Down Move
Home/End Move to start/end of line
CTRL + Up/Down Move one scene up/down
Page up / Page down Move one page up/down
CTRL + Home/End Move to start/end of script
 
Backspace Delete previous character
Delete Delete current character / selected text
 
ENTER Insert new element
 
TAB Change element's style or insert new element
SHIFT + TAB Change element's style
 
SHIFT/CTRL + ENTER Insert forced linebreak
 
CTRL + SPACE / Start selection
SHIFT + Movement
CTRL + A Select current scene
ESCAPE Unselect
 
CTRL + F Find / Replace
 
<b>In Find/Replace dialog:</b>
 
F Find
R Replace
 
<b>During Auto-Completion:</b>
 
Up/Down/Page up/ Move selection
Page down
Enter/Tab Complete selection, start new element
End Complete selection
ESCAPE Abort auto-completion
 
<b>Commands:</b>
 
CTRL + E Find next error in screenplay
 
Alt + S Change element to scene heading
Alt + A Change element to action
Alt + C Change element to character
Alt + P Change element to parenthetical
Alt + D Change element to dialogue
Alt + T Change element to transition
Alt + N Change element to note
 
CTRL + O Open file
CTRL + S Save file
 
CTRL + X Cut
CTRL + C Copy
CTRL + V Paste
 
CTRL + Q Quit program
</pre>
</body></html>
"""
        
        htmlWin = wxHtmlWindow(self)
        rep = htmlWin.GetInternalRepresentation()
        rep.SetIndent(0, wxHTML_INDENT_BOTTOM)
        htmlWin.SetPage(html)
        htmlWin.SetFocus()
        
        vsizer.Add(htmlWin, 1, wxEXPAND)
        
        self.Layout()
 
        EVT_CLOSE(self, self.OnCloseWindow)
 
    def OnCloseWindow(self, event):
        self.Destroy()