-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClipboard.cpp
More file actions
67 lines (56 loc) · 1.97 KB
/
Copy pathClipboard.cpp
File metadata and controls
67 lines (56 loc) · 1.97 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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Clipboard.h"
#include "MainExchange.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TfClipboard *fClipboard;
//---------------------------------------------------------------------------
__fastcall TfClipboard::TfClipboard(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfClipboard::FormShow(TObject *Sender)
{
(void)Sender;
this->Caption = STR_CLIPBOARD_CAP;
this->bSend->Caption = CAP_CLIPBOARD_BTN;
this->mText->Hint = STR_MEMO_HINT;
}
//---------------------------------------------------------------------------
void __fastcall TfClipboard::bSendClick(TObject *Sender)
{
(void)Sender;
if (MainForm->edtIp->Text != "" || MainForm->lbLocalNet->ItemIndex >= 0) {
if (this->eText->Text != "") {
this->mText->Lines->Add(MSG_SEND_MSG_INIT);
this->mText->Lines->Add(this->eText->Text);
MainForm->SendMessage(this->eText->Text);
this->eText->Clear();
}
} else
ShowMessage(MSG_SEND_IP_ERR);
}
//---------------------------------------------------------------------------
void __fastcall TfClipboard::mTextMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
(void)Sender;
(void)X;
(void)Y;
if (Button == mbLeft && Shift.Contains(ssCtrl)) {
this->mText->Lines->Clear();
this->eText->Clear();
}
}
//---------------------------------------------------------------------------
void __fastcall TfClipboard::eTextKeyPress(TObject *Sender, System::WideChar &Key)
{
(void)Sender;
if (Key == VK_RETURN)
this->bSend->Click();
}
//---------------------------------------------------------------------------