0
1
00:00:05,000 --> 00:00:07,020
<v Instructor>Hello again, in the previous lecture</v>
1

2
00:00:07,020 --> 00:00:12,020
we created our function for Exit Menu item right?
2

3
00:00:12,040 --> 00:00:14,020
And in this lesson what I want to do,
3

4
00:00:14,020 --> 00:00:19,020
I want to create here functions for Copy, Paste, Cut,
4

5
00:00:19,170 --> 00:00:21,940
and Clear All for Find, we are not going to do that,
5

6
00:00:21,940 --> 00:00:24,230
because it will be a little bit complicated.
6

7
00:00:24,230 --> 00:00:26,810
But for this guys, we are going to create
7

8
00:00:26,810 --> 00:00:28,150
a very simple functions okay?
8

9
00:00:28,150 --> 00:00:30,930
We are not going to create these functions in our
9

10
00:00:30,930 --> 00:00:34,400
main class, we are going to lambda functions
10

11
00:00:34,400 --> 00:00:35,560
to do that okay?
11

12
00:00:35,560 --> 00:00:39,350
So what I am going to do here, let's go back to find our
12

13
00:00:39,350 --> 00:00:42,820
edit menu item, it's here right?
13

14
00:00:42,820 --> 00:00:44,520
And here what I need to do,
14

15
00:00:44,520 --> 00:00:46,770
by the way we are here main menu right?
15

16
00:00:46,770 --> 00:00:47,603
And for
16

17
00:00:48,820 --> 00:00:52,810
Copy here, I will say command,
17

18
00:00:52,810 --> 00:00:53,643
okay?
18

19
00:00:53,643 --> 00:00:56,600
But as I said I will create here lambda functions okay?
19

20
00:00:56,600 --> 00:01:01,600
And I will say lambda:self.parent.texteditor,
20

21
00:01:03,837 --> 00:01:06,130
lambda:self.parent.texteditor,
21

22
00:01:08,940 --> 00:01:11,730
text editor, so what's wrong here?
22

23
00:01:11,730 --> 00:01:12,850
Let me look, I don't know
23

24
00:01:12,850 --> 00:01:15,630
texteditor and here I will use
24

25
00:01:15,630 --> 00:01:18,220
event generate, okay function
25

26
00:01:18,220 --> 00:01:22,490
and I will say event generate and here,
26

27
00:01:22,490 --> 00:01:26,080
I will create shortcuts, okay?
27

28
00:01:26,080 --> 00:01:29,733
And here what I need to say, I will say control,
28

29
00:01:31,190 --> 00:01:34,623
dash, sorry not dash control c,
29

30
00:01:36,210 --> 00:01:37,043
okay?
30

31
00:01:39,460 --> 00:01:42,780
Let me come here back, okay?
31

32
00:01:42,780 --> 00:01:46,350
And now, that's all okay.
32

33
00:01:46,350 --> 00:01:48,970
We are going to create event generate,
33

34
00:01:48,970 --> 00:01:53,280
and our key will be control C, okay?
34

35
00:01:53,280 --> 00:01:57,060
After that, this is for copy, for the paste I will do
35

36
00:01:57,060 --> 00:01:59,990
very simple, and similar: command
36

37
00:02:00,870 --> 00:02:02,770
is going to be lambda
37

38
00:02:05,220 --> 00:02:07,453
and here, : right?
38

39
00:02:08,300 --> 00:02:09,320
And I will say,
39

40
00:02:09,320 --> 00:02:12,830
self.parent.
40

41
00:02:12,830 --> 00:02:13,700
Self.parent
41

42
00:02:14,878 --> 00:02:15,711
texteditor
42

43
00:02:19,947 --> 00:02:21,193
.event_generate,
43

44
00:02:22,530 --> 00:02:24,730
and for paste what I need to do,
44

45
00:02:24,730 --> 00:02:29,100
here let's copy this guy, and paste it here okay
45

46
00:02:29,100 --> 00:02:32,973
and I will say control V right.
46

47
00:02:34,670 --> 00:02:36,367
This one will be control V.
47

48
00:02:36,367 --> 00:02:38,840
And the other one is cut, so I will say here
48

49
00:02:38,840 --> 00:02:39,890
command=
49

50
00:02:43,280 --> 00:02:48,050
lambda, and here :self.parent.texteditor.
50

51
00:02:52,590 --> 00:02:56,240
Right here I want to check, we named it texteditor. right?
51

52
00:02:56,240 --> 00:03:00,457
Its name is, so let me check it here somewhere.
52

53
00:03:01,640 --> 00:03:05,157
And here for example, not that one.
53

54
00:03:05,991 --> 00:03:08,933
texteditor okay that one, it's name is texteditor.
54

55
00:03:12,010 --> 00:03:16,083
And here, texteditor.event_generate,
55

56
00:03:17,520 --> 00:03:20,640
and here for cut I will say
56

57
00:03:22,360 --> 00:03:26,320
control x, okay I will copy and paste here
57

58
00:03:26,320 --> 00:03:30,050
and instead of v I will use x,
58

59
00:03:30,050 --> 00:03:33,360
and for clear all what I will do, I will use
59

60
00:03:33,360 --> 00:03:37,060
something else, okay, for clear all, and I will say here
60

61
00:03:37,060 --> 00:03:40,890
I'm not going to use a shortcut for clear all, okay.
61

62
00:03:40,890 --> 00:03:44,140
And here again I will create a lambda function,
62

63
00:03:44,140 --> 00:03:47,693
and I will say self.parent.texteditor.delete, okay?
63

64
00:03:53,470 --> 00:03:56,483
From first one until end.
64

65
00:03:57,910 --> 00:04:02,360
Okay, now if I run my application I can use these functions.
65

66
00:04:02,360 --> 00:04:04,410
Let me check this one, something's wrong.
66

67
00:04:05,410 --> 00:04:10,410
And, it looks fine actually self.parent.texteditor.delete.
67

68
00:04:15,530 --> 00:04:16,990
Let me run our application actually,
68

69
00:04:16,990 --> 00:04:19,233
it should be fine but.
69

70
00:04:26,170 --> 00:04:28,120
Let me run our application and see it,
70

71
00:04:28,120 --> 00:04:30,163
so something's wrong here.
71

72
00:04:31,380 --> 00:04:35,393
self.parent.delete, first, end.
72

73
00:04:40,149 --> 00:04:44,150
And actually we already create also, shortcuts,
73

74
00:04:44,150 --> 00:04:46,210
sorry, it's my mistake,
74

75
00:04:46,210 --> 00:04:48,123
and here what's wrong let's check it.
75

76
00:04:49,010 --> 00:04:53,010
Clear all, edit command is fine
76

77
00:04:53,010 --> 00:04:55,690
and clear all, command lambda
77

78
00:04:59,980 --> 00:05:04,640
and self.parent.texteditor.delete
78

79
00:05:06,120 --> 00:05:08,780
everything looks fine actually, so what is wrong
79

80
00:05:08,780 --> 00:05:11,950
I don't know, let me delete this guy, okay?
80

81
00:05:11,950 --> 00:05:15,140
Aah sorry here, I didn't say command, okay.
81

82
00:05:15,140 --> 00:05:19,880
So here, what I need to do is, I need to say command=lambda,
82

83
00:05:19,880 --> 00:05:21,630
okay, sorry for that.
83

84
00:05:21,630 --> 00:05:25,820
And here what we did, we create our function here, okay?
84

85
00:05:25,820 --> 00:05:27,670
And this is like shortcut,
85

86
00:05:27,670 --> 00:05:29,700
event generate we create here events,
86

87
00:05:29,700 --> 00:05:33,280
but for this one, we create our function here okay?
87

88
00:05:33,280 --> 00:05:38,063
Now if I run my application, and run here,
88

89
00:05:39,130 --> 00:05:40,900
let's say hello, okay?
89

90
00:05:40,900 --> 00:05:45,010
And here I will say edit, copy okay?
90

91
00:05:45,010 --> 00:05:47,650
Now I want to paste it, edit, paste, you see?
91

92
00:05:47,650 --> 00:05:51,600
Hello is here, edit let's paste again, hello is here.
92

93
00:05:51,600 --> 00:05:55,030
And also let's use cut, for cut I will say
93

94
00:05:57,210 --> 00:06:00,080
select all, cut, you see we can cut it also,
94

95
00:06:00,080 --> 00:06:01,220
again we can paste it.
95

96
00:06:01,220 --> 00:06:05,490
Let's use it, paste, you see, this function also works.
96

97
00:06:05,490 --> 00:06:07,730
And also let's use clear all,
97

98
00:06:07,730 --> 00:06:11,070
you see clear all also works well.
98

99
00:06:11,070 --> 00:06:13,640
And this is how we can create event generate,
99

100
00:06:13,640 --> 00:06:17,610
and also simple lambda functions for our application.
100

101
00:06:17,610 --> 00:06:19,473
For now that's all, see you next.
