|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.HexEdit.HexEditUndoStack</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.HexEdit.HexEditUndoStack</h1> |
|
23 <p> |
|
24 Module implementing the Undo stack for the hex edit widget. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#HexEditCommand">HexEditCommand</a></td> |
|
34 <td>Class implementing the edit comands.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#HexEditUndoCommand">HexEditUndoCommand</a></td> |
|
37 <td>Class implementing the Undo command.</td> |
|
38 </tr><tr> |
|
39 <td><a href="#HexEditUndoStack">HexEditUndoStack</a></td> |
|
40 <td>Class implementing an Undo stack for the hex edit widget.</td> |
|
41 </tr> |
|
42 </table> |
|
43 <h3>Functions</h3> |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /><hr /> |
|
48 <a NAME="HexEditCommand" ID="HexEditCommand"></a> |
|
49 <h2>HexEditCommand</h2> |
|
50 <p> |
|
51 Class implementing the edit comands. |
|
52 </p> |
|
53 <h3>Derived from</h3> |
|
54 Enum |
|
55 <h3>Class Attributes</h3> |
|
56 <table> |
|
57 <tr><td>Insert</td></tr><tr><td>Overwrite</td></tr><tr><td>RemoveAt</td></tr> |
|
58 </table> |
|
59 <h3>Class Methods</h3> |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <h3>Methods</h3> |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Static Methods</h3> |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 |
|
72 <div align="right"><a href="#top">Up</a></div> |
|
73 <hr /><hr /> |
|
74 <a NAME="HexEditUndoCommand" ID="HexEditUndoCommand"></a> |
|
75 <h2>HexEditUndoCommand</h2> |
|
76 <p> |
|
77 Class implementing the Undo command. |
|
78 </p> |
|
79 <h3>Derived from</h3> |
|
80 QUndoCommand |
|
81 <h3>Class Attributes</h3> |
|
82 <table> |
|
83 <tr><td>None</td></tr> |
|
84 </table> |
|
85 <h3>Class Methods</h3> |
|
86 <table> |
|
87 <tr><td>None</td></tr> |
|
88 </table> |
|
89 <h3>Methods</h3> |
|
90 <table> |
|
91 <tr> |
|
92 <td><a href="#HexEditUndoCommand.__init__">HexEditUndoCommand</a></td> |
|
93 <td>Constructor</td> |
|
94 </tr><tr> |
|
95 <td><a href="#HexEditUndoCommand.id">id</a></td> |
|
96 <td>Public method to get the ID of this undo command class.</td> |
|
97 </tr><tr> |
|
98 <td><a href="#HexEditUndoCommand.mergeWith">mergeWith</a></td> |
|
99 <td>Public method to merge this command with another one.</td> |
|
100 </tr><tr> |
|
101 <td><a href="#HexEditUndoCommand.redo">redo</a></td> |
|
102 <td>Public method to redo the command.</td> |
|
103 </tr><tr> |
|
104 <td><a href="#HexEditUndoCommand.undo">undo</a></td> |
|
105 <td>Public method to undo the command.</td> |
|
106 </tr> |
|
107 </table> |
|
108 <h3>Static Methods</h3> |
|
109 <table> |
|
110 <tr><td>None</td></tr> |
|
111 </table> |
|
112 <a NAME="HexEditUndoCommand.__init__" ID="HexEditUndoCommand.__init__"></a> |
|
113 <h4>HexEditUndoCommand (Constructor)</h4> |
|
114 <b>HexEditUndoCommand</b>(<i>chunks, cmd, pos, newByte, parent=None</i>) |
|
115 <p> |
|
116 Constructor |
|
117 </p><dl> |
|
118 <dt><i>chunks</i> (HexEditChunks)</dt> |
|
119 <dd> |
|
120 reference to the data container |
|
121 </dd><dt><i>cmd</i> (HexEditCommand)</dt> |
|
122 <dd> |
|
123 edit command |
|
124 </dd><dt><i>pos</i> (int)</dt> |
|
125 <dd> |
|
126 edit position |
|
127 </dd><dt><i>newByte</i> (int (range 0 to 255))</dt> |
|
128 <dd> |
|
129 new byte value |
|
130 </dd><dt><i>parent</i> (QUndoCommand)</dt> |
|
131 <dd> |
|
132 reference to the parent command |
|
133 </dd> |
|
134 </dl><a NAME="HexEditUndoCommand.id" ID="HexEditUndoCommand.id"></a> |
|
135 <h4>HexEditUndoCommand.id</h4> |
|
136 <b>id</b>(<i></i>) |
|
137 <p> |
|
138 Public method to get the ID of this undo command class. |
|
139 </p><dl> |
|
140 <dt>Returns:</dt> |
|
141 <dd> |
|
142 ID of the undo command class |
|
143 </dd> |
|
144 </dl><dl> |
|
145 <dt>Return Type:</dt> |
|
146 <dd> |
|
147 int |
|
148 </dd> |
|
149 </dl><a NAME="HexEditUndoCommand.mergeWith" ID="HexEditUndoCommand.mergeWith"></a> |
|
150 <h4>HexEditUndoCommand.mergeWith</h4> |
|
151 <b>mergeWith</b>(<i>command</i>) |
|
152 <p> |
|
153 Public method to merge this command with another one. |
|
154 </p><dl> |
|
155 <dt><i>command</i> (QUndoCommand)</dt> |
|
156 <dd> |
|
157 reference to the command to merge with |
|
158 </dd> |
|
159 </dl><dl> |
|
160 <dt>Returns:</dt> |
|
161 <dd> |
|
162 flag indicating a successful merge |
|
163 </dd> |
|
164 </dl><dl> |
|
165 <dt>Return Type:</dt> |
|
166 <dd> |
|
167 bool |
|
168 </dd> |
|
169 </dl><a NAME="HexEditUndoCommand.redo" ID="HexEditUndoCommand.redo"></a> |
|
170 <h4>HexEditUndoCommand.redo</h4> |
|
171 <b>redo</b>(<i></i>) |
|
172 <p> |
|
173 Public method to redo the command. |
|
174 </p><a NAME="HexEditUndoCommand.undo" ID="HexEditUndoCommand.undo"></a> |
|
175 <h4>HexEditUndoCommand.undo</h4> |
|
176 <b>undo</b>(<i></i>) |
|
177 <p> |
|
178 Public method to undo the command. |
|
179 </p> |
|
180 <div align="right"><a href="#top">Up</a></div> |
|
181 <hr /><hr /> |
|
182 <a NAME="HexEditUndoStack" ID="HexEditUndoStack"></a> |
|
183 <h2>HexEditUndoStack</h2> |
|
184 <p> |
|
185 Class implementing an Undo stack for the hex edit widget. |
|
186 </p> |
|
187 <h3>Derived from</h3> |
|
188 QUndoStack |
|
189 <h3>Class Attributes</h3> |
|
190 <table> |
|
191 <tr><td>None</td></tr> |
|
192 </table> |
|
193 <h3>Class Methods</h3> |
|
194 <table> |
|
195 <tr><td>None</td></tr> |
|
196 </table> |
|
197 <h3>Methods</h3> |
|
198 <table> |
|
199 <tr> |
|
200 <td><a href="#HexEditUndoStack.__init__">HexEditUndoStack</a></td> |
|
201 <td>Constructor</td> |
|
202 </tr><tr> |
|
203 <td><a href="#HexEditUndoStack.insert">insert</a></td> |
|
204 <td>Public method to insert a byte.</td> |
|
205 </tr><tr> |
|
206 <td><a href="#HexEditUndoStack.insertByteArray">insertByteArray</a></td> |
|
207 <td>Public method to insert bytes.</td> |
|
208 </tr><tr> |
|
209 <td><a href="#HexEditUndoStack.overwrite">overwrite</a></td> |
|
210 <td>Public method to replace a byte.</td> |
|
211 </tr><tr> |
|
212 <td><a href="#HexEditUndoStack.overwriteByteArray">overwriteByteArray</a></td> |
|
213 <td>Public method to replace bytes.</td> |
|
214 </tr><tr> |
|
215 <td><a href="#HexEditUndoStack.removeAt">removeAt</a></td> |
|
216 <td>Public method to remove bytes.</td> |
|
217 </tr> |
|
218 </table> |
|
219 <h3>Static Methods</h3> |
|
220 <table> |
|
221 <tr><td>None</td></tr> |
|
222 </table> |
|
223 <a NAME="HexEditUndoStack.__init__" ID="HexEditUndoStack.__init__"></a> |
|
224 <h4>HexEditUndoStack (Constructor)</h4> |
|
225 <b>HexEditUndoStack</b>(<i>chunks, parent=None</i>) |
|
226 <p> |
|
227 Constructor |
|
228 </p><dl> |
|
229 <dt><i>chunks</i> (HexEditChunks)</dt> |
|
230 <dd> |
|
231 reference to the data container |
|
232 </dd><dt><i>parent</i> (QObject)</dt> |
|
233 <dd> |
|
234 reference to the parent object |
|
235 </dd> |
|
236 </dl><a NAME="HexEditUndoStack.insert" ID="HexEditUndoStack.insert"></a> |
|
237 <h4>HexEditUndoStack.insert</h4> |
|
238 <b>insert</b>(<i>pos, data</i>) |
|
239 <p> |
|
240 Public method to insert a byte. |
|
241 </p><dl> |
|
242 <dt><i>pos</i> (int)</dt> |
|
243 <dd> |
|
244 position to insert at |
|
245 </dd><dt><i>data</i> (int (range 0 to 255))</dt> |
|
246 <dd> |
|
247 byte to be inserted |
|
248 </dd> |
|
249 </dl><a NAME="HexEditUndoStack.insertByteArray" ID="HexEditUndoStack.insertByteArray"></a> |
|
250 <h4>HexEditUndoStack.insertByteArray</h4> |
|
251 <b>insertByteArray</b>(<i>pos, byteArray</i>) |
|
252 <p> |
|
253 Public method to insert bytes. |
|
254 </p><dl> |
|
255 <dt><i>pos</i> (int)</dt> |
|
256 <dd> |
|
257 position to insert at |
|
258 </dd><dt><i>byteArray</i> (byteArray or QByteArray)</dt> |
|
259 <dd> |
|
260 data to be inserted |
|
261 </dd> |
|
262 </dl><a NAME="HexEditUndoStack.overwrite" ID="HexEditUndoStack.overwrite"></a> |
|
263 <h4>HexEditUndoStack.overwrite</h4> |
|
264 <b>overwrite</b>(<i>pos, data</i>) |
|
265 <p> |
|
266 Public method to replace a byte. |
|
267 </p><dl> |
|
268 <dt><i>pos</i> (int)</dt> |
|
269 <dd> |
|
270 position to replace the byte at |
|
271 </dd><dt><i>data</i> (int (range 0 to 255))</dt> |
|
272 <dd> |
|
273 byte to replace with |
|
274 </dd> |
|
275 </dl><a NAME="HexEditUndoStack.overwriteByteArray" ID="HexEditUndoStack.overwriteByteArray"></a> |
|
276 <h4>HexEditUndoStack.overwriteByteArray</h4> |
|
277 <b>overwriteByteArray</b>(<i>pos, length, byteArray</i>) |
|
278 <p> |
|
279 Public method to replace bytes. |
|
280 </p><dl> |
|
281 <dt><i>pos</i> (int)</dt> |
|
282 <dd> |
|
283 position to replace the bytes at |
|
284 </dd><dt><i>length</i> (int)</dt> |
|
285 <dd> |
|
286 amount of bytes to replace |
|
287 </dd><dt><i>byteArray</i> (bytearray or QByteArray)</dt> |
|
288 <dd> |
|
289 bytes to replace with |
|
290 </dd> |
|
291 </dl><a NAME="HexEditUndoStack.removeAt" ID="HexEditUndoStack.removeAt"></a> |
|
292 <h4>HexEditUndoStack.removeAt</h4> |
|
293 <b>removeAt</b>(<i>pos, length=1</i>) |
|
294 <p> |
|
295 Public method to remove bytes. |
|
296 </p><dl> |
|
297 <dt><i>pos</i> (int)</dt> |
|
298 <dd> |
|
299 position to remove bytes from |
|
300 </dd><dt><i>length</i> (int)</dt> |
|
301 <dd> |
|
302 amount of bytes to remove |
|
303 </dd> |
|
304 </dl> |
|
305 <div align="right"><a href="#top">Up</a></div> |
|
306 <hr /> |
|
307 </body></html> |