5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.HexEdit.HexEditSearchReplaceWidget</h1> |
9 <h1>eric7.HexEdit.HexEditSearchReplaceWidget</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing a search and replace widget for the hex editor. |
11 Module implementing a search and replace widget for the hex editor. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
|
16 <table> |
15 <table> |
17 <tr><td>None</td></tr> |
16 <tr><td>None</td></tr> |
18 </table> |
17 </table> |
|
18 |
19 <h3>Classes</h3> |
19 <h3>Classes</h3> |
20 |
20 <table> |
21 <table> |
|
22 |
|
23 <tr> |
21 <tr> |
24 <td><a href="#HexEditSearchReplaceWidget">HexEditSearchReplaceWidget</a></td> |
22 <td><a href="#HexEditSearchReplaceWidget">HexEditSearchReplaceWidget</a></td> |
25 <td>Class implementing a search and replace widget for the hex editor.</td> |
23 <td>Class implementing a search and replace widget for the hex editor.</td> |
26 </tr> |
24 </tr> |
27 </table> |
25 </table> |
|
26 |
28 <h3>Functions</h3> |
27 <h3>Functions</h3> |
29 |
|
30 <table> |
28 <table> |
31 <tr><td>None</td></tr> |
29 <tr><td>None</td></tr> |
32 </table> |
30 </table> |
|
31 |
33 <hr /> |
32 <hr /> |
34 <hr /> |
33 <hr /> |
35 <a NAME="HexEditSearchReplaceWidget" ID="HexEditSearchReplaceWidget"></a> |
34 <a NAME="HexEditSearchReplaceWidget" ID="HexEditSearchReplaceWidget"></a> |
36 <h2>HexEditSearchReplaceWidget</h2> |
35 <h2>HexEditSearchReplaceWidget</h2> |
37 |
|
38 <p> |
36 <p> |
39 Class implementing a search and replace widget for the hex editor. |
37 Class implementing a search and replace widget for the hex editor. |
40 </p> |
38 </p> |
|
39 |
41 <h3>Derived from</h3> |
40 <h3>Derived from</h3> |
42 QWidget |
41 QWidget |
43 <h3>Class Attributes</h3> |
42 <h3>Class Attributes</h3> |
44 |
|
45 <table> |
43 <table> |
46 <tr><td>None</td></tr> |
44 <tr><td>None</td></tr> |
47 </table> |
45 </table> |
|
46 |
48 <h3>Class Methods</h3> |
47 <h3>Class Methods</h3> |
49 |
|
50 <table> |
48 <table> |
51 <tr><td>None</td></tr> |
49 <tr><td>None</td></tr> |
52 </table> |
50 </table> |
|
51 |
53 <h3>Methods</h3> |
52 <h3>Methods</h3> |
54 |
53 <table> |
55 <table> |
|
56 |
|
57 <tr> |
54 <tr> |
58 <td><a href="#HexEditSearchReplaceWidget.__init__">HexEditSearchReplaceWidget</a></td> |
55 <td><a href="#HexEditSearchReplaceWidget.__init__">HexEditSearchReplaceWidget</a></td> |
59 <td>Constructor</td> |
56 <td>Constructor</td> |
60 </tr> |
57 </tr> |
61 <tr> |
58 <tr> |
286 </dd> |
284 </dd> |
287 </dl> |
285 </dl> |
288 <a NAME="HexEditSearchReplaceWidget.__doReplace" ID="HexEditSearchReplaceWidget.__doReplace"></a> |
286 <a NAME="HexEditSearchReplaceWidget.__doReplace" ID="HexEditSearchReplaceWidget.__doReplace"></a> |
289 <h4>HexEditSearchReplaceWidget.__doReplace</h4> |
287 <h4>HexEditSearchReplaceWidget.__doReplace</h4> |
290 <b>__doReplace</b>(<i>searchNext</i>) |
288 <b>__doReplace</b>(<i>searchNext</i>) |
291 |
|
292 <p> |
289 <p> |
293 Private method to replace one occurrence of data. |
290 Private method to replace one occurrence of data. |
294 </p> |
291 </p> |
|
292 |
295 <dl> |
293 <dl> |
296 |
294 |
297 <dt><i>searchNext</i> (bool)</dt> |
295 <dt><i>searchNext</i> (bool)</dt> |
298 <dd> |
296 <dd> |
299 flag indicating to search for the next occurrence |
297 flag indicating to search for the next occurrence |
300 </dd> |
298 </dd> |
301 </dl> |
299 </dl> |
302 <a NAME="HexEditSearchReplaceWidget.__findByReturnPressed" ID="HexEditSearchReplaceWidget.__findByReturnPressed"></a> |
300 <a NAME="HexEditSearchReplaceWidget.__findByReturnPressed" ID="HexEditSearchReplaceWidget.__findByReturnPressed"></a> |
303 <h4>HexEditSearchReplaceWidget.__findByReturnPressed</h4> |
301 <h4>HexEditSearchReplaceWidget.__findByReturnPressed</h4> |
304 <b>__findByReturnPressed</b>(<i></i>) |
302 <b>__findByReturnPressed</b>(<i></i>) |
305 |
|
306 <p> |
303 <p> |
307 Private slot to handle a return pressed in the find combo. |
304 Private slot to handle a return pressed in the find combo. |
308 </p> |
305 </p> |
|
306 |
309 <a NAME="HexEditSearchReplaceWidget.__getContent" ID="HexEditSearchReplaceWidget.__getContent"></a> |
307 <a NAME="HexEditSearchReplaceWidget.__getContent" ID="HexEditSearchReplaceWidget.__getContent"></a> |
310 <h4>HexEditSearchReplaceWidget.__getContent</h4> |
308 <h4>HexEditSearchReplaceWidget.__getContent</h4> |
311 <b>__getContent</b>(<i>replace=False</i>) |
309 <b>__getContent</b>(<i>replace=False</i>) |
312 |
|
313 <p> |
310 <p> |
314 Private method to get the contents of the find/replace combo as |
311 Private method to get the contents of the find/replace combo as |
315 a bytearray. |
312 a bytearray. |
316 </p> |
313 </p> |
|
314 |
317 <dl> |
315 <dl> |
318 |
316 |
319 <dt><i>replace</i> (bool)</dt> |
317 <dt><i>replace</i> (bool)</dt> |
320 <dd> |
318 <dd> |
321 flag indicating to retrieve the replace contents |
319 flag indicating to retrieve the replace contents |
360 </dd> |
358 </dd> |
361 </dl> |
359 </dl> |
362 <a NAME="HexEditSearchReplaceWidget.__showFind" ID="HexEditSearchReplaceWidget.__showFind"></a> |
360 <a NAME="HexEditSearchReplaceWidget.__showFind" ID="HexEditSearchReplaceWidget.__showFind"></a> |
363 <h4>HexEditSearchReplaceWidget.__showFind</h4> |
361 <h4>HexEditSearchReplaceWidget.__showFind</h4> |
364 <b>__showFind</b>(<i>text=""</i>) |
362 <b>__showFind</b>(<i>text=""</i>) |
365 |
|
366 <p> |
363 <p> |
367 Private method to display this widget in find mode. |
364 Private method to display this widget in find mode. |
368 </p> |
365 </p> |
|
366 |
369 <dl> |
367 <dl> |
370 |
368 |
371 <dt><i>text</i> (str)</dt> |
369 <dt><i>text</i> (str)</dt> |
372 <dd> |
370 <dd> |
373 hex encoded text to be shown in the findtext edit |
371 hex encoded text to be shown in the findtext edit |
374 </dd> |
372 </dd> |
375 </dl> |
373 </dl> |
376 <a NAME="HexEditSearchReplaceWidget.__showReplace" ID="HexEditSearchReplaceWidget.__showReplace"></a> |
374 <a NAME="HexEditSearchReplaceWidget.__showReplace" ID="HexEditSearchReplaceWidget.__showReplace"></a> |
377 <h4>HexEditSearchReplaceWidget.__showReplace</h4> |
375 <h4>HexEditSearchReplaceWidget.__showReplace</h4> |
378 <b>__showReplace</b>(<i>text=""</i>) |
376 <b>__showReplace</b>(<i>text=""</i>) |
379 |
|
380 <p> |
377 <p> |
381 Private slot to display this widget in replace mode. |
378 Private slot to display this widget in replace mode. |
382 </p> |
379 </p> |
|
380 |
383 <dl> |
381 <dl> |
384 |
382 |
385 <dt><i>text</i> (str)</dt> |
383 <dt><i>text</i> (str)</dt> |
386 <dd> |
384 <dd> |
387 hex encoded text to be shown in the findtext edit |
385 hex encoded text to be shown in the findtext edit |
388 </dd> |
386 </dd> |
389 </dl> |
387 </dl> |
390 <a NAME="HexEditSearchReplaceWidget.__text2bytearray" ID="HexEditSearchReplaceWidget.__text2bytearray"></a> |
388 <a NAME="HexEditSearchReplaceWidget.__text2bytearray" ID="HexEditSearchReplaceWidget.__text2bytearray"></a> |
391 <h4>HexEditSearchReplaceWidget.__text2bytearray</h4> |
389 <h4>HexEditSearchReplaceWidget.__text2bytearray</h4> |
392 <b>__text2bytearray</b>(<i>txt, dataFormat</i>) |
390 <b>__text2bytearray</b>(<i>txt, dataFormat</i>) |
393 |
|
394 <p> |
391 <p> |
395 Private method to convert a text to a byte array. |
392 Private method to convert a text to a byte array. |
396 </p> |
393 </p> |
|
394 |
397 <dl> |
395 <dl> |
398 |
396 |
399 <dt><i>txt</i> (str)</dt> |
397 <dt><i>txt</i> (str)</dt> |
400 <dd> |
398 <dd> |
401 text to be converted |
399 text to be converted |
452 </dd> |
450 </dd> |
453 </dl> |
451 </dl> |
454 <a NAME="HexEditSearchReplaceWidget.keyPressEvent" ID="HexEditSearchReplaceWidget.keyPressEvent"></a> |
452 <a NAME="HexEditSearchReplaceWidget.keyPressEvent" ID="HexEditSearchReplaceWidget.keyPressEvent"></a> |
455 <h4>HexEditSearchReplaceWidget.keyPressEvent</h4> |
453 <h4>HexEditSearchReplaceWidget.keyPressEvent</h4> |
456 <b>keyPressEvent</b>(<i>event</i>) |
454 <b>keyPressEvent</b>(<i>event</i>) |
457 |
|
458 <p> |
455 <p> |
459 Protected slot to handle key press events. |
456 Protected slot to handle key press events. |
460 </p> |
457 </p> |
|
458 |
461 <dl> |
459 <dl> |
462 |
460 |
463 <dt><i>event</i> (QKeyEvent)</dt> |
461 <dt><i>event</i> (QKeyEvent)</dt> |
464 <dd> |
462 <dd> |
465 reference to the key press event |
463 reference to the key press event |
466 </dd> |
464 </dd> |
467 </dl> |
465 </dl> |
468 <a NAME="HexEditSearchReplaceWidget.on_closeButton_clicked" ID="HexEditSearchReplaceWidget.on_closeButton_clicked"></a> |
466 <a NAME="HexEditSearchReplaceWidget.on_closeButton_clicked" ID="HexEditSearchReplaceWidget.on_closeButton_clicked"></a> |
469 <h4>HexEditSearchReplaceWidget.on_closeButton_clicked</h4> |
467 <h4>HexEditSearchReplaceWidget.on_closeButton_clicked</h4> |
470 <b>on_closeButton_clicked</b>(<i></i>) |
468 <b>on_closeButton_clicked</b>(<i></i>) |
471 |
|
472 <p> |
469 <p> |
473 Private slot to close the widget. |
470 Private slot to close the widget. |
474 </p> |
471 </p> |
|
472 |
475 <a NAME="HexEditSearchReplaceWidget.on_findFormatCombo_currentIndexChanged" ID="HexEditSearchReplaceWidget.on_findFormatCombo_currentIndexChanged"></a> |
473 <a NAME="HexEditSearchReplaceWidget.on_findFormatCombo_currentIndexChanged" ID="HexEditSearchReplaceWidget.on_findFormatCombo_currentIndexChanged"></a> |
476 <h4>HexEditSearchReplaceWidget.on_findFormatCombo_currentIndexChanged</h4> |
474 <h4>HexEditSearchReplaceWidget.on_findFormatCombo_currentIndexChanged</h4> |
477 <b>on_findFormatCombo_currentIndexChanged</b>(<i>idx</i>) |
475 <b>on_findFormatCombo_currentIndexChanged</b>(<i>idx</i>) |
478 |
|
479 <p> |
476 <p> |
480 Private slot to handle a selection from the find format. |
477 Private slot to handle a selection from the find format. |
481 </p> |
478 </p> |
|
479 |
482 <dl> |
480 <dl> |
483 |
481 |
484 <dt><i>idx</i> (int)</dt> |
482 <dt><i>idx</i> (int)</dt> |
485 <dd> |
483 <dd> |
486 index of the selected entry |
484 index of the selected entry |
487 </dd> |
485 </dd> |
488 </dl> |
486 </dl> |
489 <a NAME="HexEditSearchReplaceWidget.on_findNextButton_clicked" ID="HexEditSearchReplaceWidget.on_findNextButton_clicked"></a> |
487 <a NAME="HexEditSearchReplaceWidget.on_findNextButton_clicked" ID="HexEditSearchReplaceWidget.on_findNextButton_clicked"></a> |
490 <h4>HexEditSearchReplaceWidget.on_findNextButton_clicked</h4> |
488 <h4>HexEditSearchReplaceWidget.on_findNextButton_clicked</h4> |
491 <b>on_findNextButton_clicked</b>(<i></i>) |
489 <b>on_findNextButton_clicked</b>(<i></i>) |
492 |
|
493 <p> |
490 <p> |
494 Private slot to find the next occurrence. |
491 Private slot to find the next occurrence. |
495 </p> |
492 </p> |
|
493 |
496 <a NAME="HexEditSearchReplaceWidget.on_findPrevButton_clicked" ID="HexEditSearchReplaceWidget.on_findPrevButton_clicked"></a> |
494 <a NAME="HexEditSearchReplaceWidget.on_findPrevButton_clicked" ID="HexEditSearchReplaceWidget.on_findPrevButton_clicked"></a> |
497 <h4>HexEditSearchReplaceWidget.on_findPrevButton_clicked</h4> |
495 <h4>HexEditSearchReplaceWidget.on_findPrevButton_clicked</h4> |
498 <b>on_findPrevButton_clicked</b>(<i></i>) |
496 <b>on_findPrevButton_clicked</b>(<i></i>) |
499 |
|
500 <p> |
497 <p> |
501 Private slot to find the previous occurrence. |
498 Private slot to find the previous occurrence. |
502 </p> |
499 </p> |
|
500 |
503 <a NAME="HexEditSearchReplaceWidget.on_findtextCombo_activated" ID="HexEditSearchReplaceWidget.on_findtextCombo_activated"></a> |
501 <a NAME="HexEditSearchReplaceWidget.on_findtextCombo_activated" ID="HexEditSearchReplaceWidget.on_findtextCombo_activated"></a> |
504 <h4>HexEditSearchReplaceWidget.on_findtextCombo_activated</h4> |
502 <h4>HexEditSearchReplaceWidget.on_findtextCombo_activated</h4> |
505 <b>on_findtextCombo_activated</b>(<i>idx</i>) |
503 <b>on_findtextCombo_activated</b>(<i>idx</i>) |
506 |
|
507 <p> |
504 <p> |
508 Private slot to handle a selection from the find history. |
505 Private slot to handle a selection from the find history. |
509 </p> |
506 </p> |
|
507 |
510 <dl> |
508 <dl> |
511 |
509 |
512 <dt><i>idx</i> (int)</dt> |
510 <dt><i>idx</i> (int)</dt> |
513 <dd> |
511 <dd> |
514 index of the selected entry |
512 index of the selected entry |
515 </dd> |
513 </dd> |
516 </dl> |
514 </dl> |
517 <a NAME="HexEditSearchReplaceWidget.on_findtextCombo_editTextChanged" ID="HexEditSearchReplaceWidget.on_findtextCombo_editTextChanged"></a> |
515 <a NAME="HexEditSearchReplaceWidget.on_findtextCombo_editTextChanged" ID="HexEditSearchReplaceWidget.on_findtextCombo_editTextChanged"></a> |
518 <h4>HexEditSearchReplaceWidget.on_findtextCombo_editTextChanged</h4> |
516 <h4>HexEditSearchReplaceWidget.on_findtextCombo_editTextChanged</h4> |
519 <b>on_findtextCombo_editTextChanged</b>(<i>txt</i>) |
517 <b>on_findtextCombo_editTextChanged</b>(<i>txt</i>) |
520 |
|
521 <p> |
518 <p> |
522 Private slot to enable/disable the find buttons. |
519 Private slot to enable/disable the find buttons. |
523 </p> |
520 </p> |
|
521 |
524 <dl> |
522 <dl> |
525 |
523 |
526 <dt><i>txt</i> (str)</dt> |
524 <dt><i>txt</i> (str)</dt> |
527 <dd> |
525 <dd> |
528 text of the find text combo |
526 text of the find text combo |
529 </dd> |
527 </dd> |
530 </dl> |
528 </dl> |
531 <a NAME="HexEditSearchReplaceWidget.on_replaceAllButton_clicked" ID="HexEditSearchReplaceWidget.on_replaceAllButton_clicked"></a> |
529 <a NAME="HexEditSearchReplaceWidget.on_replaceAllButton_clicked" ID="HexEditSearchReplaceWidget.on_replaceAllButton_clicked"></a> |
532 <h4>HexEditSearchReplaceWidget.on_replaceAllButton_clicked</h4> |
530 <h4>HexEditSearchReplaceWidget.on_replaceAllButton_clicked</h4> |
533 <b>on_replaceAllButton_clicked</b>(<i></i>) |
531 <b>on_replaceAllButton_clicked</b>(<i></i>) |
534 |
|
535 <p> |
532 <p> |
536 Private slot to replace all occurrences of data. |
533 Private slot to replace all occurrences of data. |
537 </p> |
534 </p> |
|
535 |
538 <a NAME="HexEditSearchReplaceWidget.on_replaceButton_clicked" ID="HexEditSearchReplaceWidget.on_replaceButton_clicked"></a> |
536 <a NAME="HexEditSearchReplaceWidget.on_replaceButton_clicked" ID="HexEditSearchReplaceWidget.on_replaceButton_clicked"></a> |
539 <h4>HexEditSearchReplaceWidget.on_replaceButton_clicked</h4> |
537 <h4>HexEditSearchReplaceWidget.on_replaceButton_clicked</h4> |
540 <b>on_replaceButton_clicked</b>(<i></i>) |
538 <b>on_replaceButton_clicked</b>(<i></i>) |
541 |
|
542 <p> |
539 <p> |
543 Private slot to replace one occurrence of data. |
540 Private slot to replace one occurrence of data. |
544 </p> |
541 </p> |
|
542 |
545 <a NAME="HexEditSearchReplaceWidget.on_replaceFormatCombo_currentIndexChanged" ID="HexEditSearchReplaceWidget.on_replaceFormatCombo_currentIndexChanged"></a> |
543 <a NAME="HexEditSearchReplaceWidget.on_replaceFormatCombo_currentIndexChanged" ID="HexEditSearchReplaceWidget.on_replaceFormatCombo_currentIndexChanged"></a> |
546 <h4>HexEditSearchReplaceWidget.on_replaceFormatCombo_currentIndexChanged</h4> |
544 <h4>HexEditSearchReplaceWidget.on_replaceFormatCombo_currentIndexChanged</h4> |
547 <b>on_replaceFormatCombo_currentIndexChanged</b>(<i>idx</i>) |
545 <b>on_replaceFormatCombo_currentIndexChanged</b>(<i>idx</i>) |
548 |
|
549 <p> |
546 <p> |
550 Private slot to handle a selection from the replace format. |
547 Private slot to handle a selection from the replace format. |
551 </p> |
548 </p> |
|
549 |
552 <dl> |
550 <dl> |
553 |
551 |
554 <dt><i>idx</i> (int)</dt> |
552 <dt><i>idx</i> (int)</dt> |
555 <dd> |
553 <dd> |
556 index of the selected entry |
554 index of the selected entry |
557 </dd> |
555 </dd> |
558 </dl> |
556 </dl> |
559 <a NAME="HexEditSearchReplaceWidget.on_replaceSearchButton_clicked" ID="HexEditSearchReplaceWidget.on_replaceSearchButton_clicked"></a> |
557 <a NAME="HexEditSearchReplaceWidget.on_replaceSearchButton_clicked" ID="HexEditSearchReplaceWidget.on_replaceSearchButton_clicked"></a> |
560 <h4>HexEditSearchReplaceWidget.on_replaceSearchButton_clicked</h4> |
558 <h4>HexEditSearchReplaceWidget.on_replaceSearchButton_clicked</h4> |
561 <b>on_replaceSearchButton_clicked</b>(<i></i>) |
559 <b>on_replaceSearchButton_clicked</b>(<i></i>) |
562 |
|
563 <p> |
560 <p> |
564 Private slot to replace one occurrence of data and search for the next |
561 Private slot to replace one occurrence of data and search for the next |
565 one. |
562 one. |
566 </p> |
563 </p> |
|
564 |
567 <a NAME="HexEditSearchReplaceWidget.on_replacetextCombo_activated" ID="HexEditSearchReplaceWidget.on_replacetextCombo_activated"></a> |
565 <a NAME="HexEditSearchReplaceWidget.on_replacetextCombo_activated" ID="HexEditSearchReplaceWidget.on_replacetextCombo_activated"></a> |
568 <h4>HexEditSearchReplaceWidget.on_replacetextCombo_activated</h4> |
566 <h4>HexEditSearchReplaceWidget.on_replacetextCombo_activated</h4> |
569 <b>on_replacetextCombo_activated</b>(<i>idx</i>) |
567 <b>on_replacetextCombo_activated</b>(<i>idx</i>) |
570 |
|
571 <p> |
568 <p> |
572 Private slot to handle a selection from the replace history. |
569 Private slot to handle a selection from the replace history. |
573 </p> |
570 </p> |
|
571 |
574 <dl> |
572 <dl> |
575 |
573 |
576 <dt><i>idx</i> (int)</dt> |
574 <dt><i>idx</i> (int)</dt> |
577 <dd> |
575 <dd> |
578 index of the selected entry |
576 index of the selected entry |
579 </dd> |
577 </dd> |
580 </dl> |
578 </dl> |
581 <a NAME="HexEditSearchReplaceWidget.show" ID="HexEditSearchReplaceWidget.show"></a> |
579 <a NAME="HexEditSearchReplaceWidget.show" ID="HexEditSearchReplaceWidget.show"></a> |
582 <h4>HexEditSearchReplaceWidget.show</h4> |
580 <h4>HexEditSearchReplaceWidget.show</h4> |
583 <b>show</b>(<i>text=""</i>) |
581 <b>show</b>(<i>text=""</i>) |
584 |
|
585 <p> |
582 <p> |
586 Public slot to show the widget. |
583 Public slot to show the widget. |
587 </p> |
584 </p> |
|
585 |
588 <dl> |
586 <dl> |
589 |
587 |
590 <dt><i>text</i> (str)</dt> |
588 <dt><i>text</i> (str)</dt> |
591 <dd> |
589 <dd> |
592 hex encoded text to be shown in the findtext edit |
590 hex encoded text to be shown in the findtext edit |