This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_msgcontrol.cpp
508 lines (457 loc) · 17.5 KB
/
ui_msgcontrol.cpp
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
/*
Konnekt UI
Okna dialogowe.
*/
#include "stdafx.h"
#pragma hdrstop
#include "ui_main.h"
#include "resource_ui.h"
#include "ui_cntlist.h"
#include "ui_msgcontrol.h"
#include "ui_ui.h"
#include "ui_actions.h"
cMsgControl::cMsgControl(sUIAction act , int x , int y , int w , int h , HWND parent , HMENU id) {
this->act = act;
sUIActionNotify_createWindow cw;
cw.act = act;
cw.x = x;
cw.y = y;
cw.w = w;
cw.h = h;
cw.hwndParent = parent;
Act(act).call(&cw);
Act(act).handle = cw.hwnd;
this->hwnd = cw.hwnd;
SetWindowLong(this->hwnd , GWL_ID , IDC_MSG);
}
cMsgControl::~cMsgControl() {
/*sUIActionNotify_destroyWindow dw;
dw.act = act; // ¯eby CNT siê zgadza³o
Act(act).call(&dw);
this->hwnd = 0;*/
}
void cMsgControl::clear() {
Act(act).call(Konnekt::UI::Notify::clear,0,0,act.cnt);
}
void cMsgControl::lock() {
Act(act).call(Konnekt::UI::Notify::lock,0,0,act.cnt);
}
void cMsgControl::unlock() {
Act(act).call(Konnekt::UI::Notify::unlock,0,0,act.cnt);
}
//__inline int cMsgControl::parentMessageProc(HWND hwnd , UINT message, WPARAM wParam, LPARAM lParam);
void cMsgControl::msgInsert(cMessage * m , const char * display , bool scroll) {
if (!m) return;
Konnekt::UI::Notify::_insertMsg im(m , display , scroll);
im.act = act;
Act(act).call(&im);
}
void cMsgControl::statusInsert(int status , CStdString info) {
Konnekt::UI::Notify::_insertStatus is(status , info);
is.act = act;
Act(act).call(&is);
}
void cMsgControlRich::actionProcess(sUIActionNotify_base * anBase) {
using namespace Konnekt::UI;
switch (anBase->code) {
case Notify::clear: this->clear(); break;
case Notify::lock: this->lock(); break;
case Notify::unlock: this->unlock(); break;
case Notify::insertMsg: {
Notify::_insertMsg * im = static_cast<Notify::_insertMsg*>(anBase);
this->msgInsert(im->_message , im->_display , im->_scroll);
break;}
case Notify::insertStatus: {
Notify::_insertStatus * is = static_cast<Notify::_insertStatus*>(anBase);
this->statusInsert(is->_status , is->_info);
break;}
}
}
cMsgControlRich::cMsgControlRich(int x , int y , int w , int h , HWND parent , HMENU id) {
this->hwnd = CreateWindowEx(0 , RICHEDIT_CLASS , "" , WS_CHILD|WS_VISIBLE|ES_MULTILINE | ES_AUTOVSCROLL |
ES_READONLY | WS_VSCROLL | WS_TABSTOP
,x,y,w,h,parent,id , 0 , 0);
SetProp(hwnd , "cMsgControl*" , (HANDLE)this);
this->_oldwndproc = (WNDPROC) SetWindowLong(hwnd , GWL_WNDPROC , (LONG)WndProc);
SendMessage(this->hwnd , EM_AUTOURLDETECT , 1 , 0);
SendMessage(this->hwnd , EM_SETEVENTMASK , 0 , ENM_SELCHANGE | ENM_LINK);
CHARFORMAT cf;
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_SIZE;
cf.yHeight = 20;
SendMessage(this->hwnd , EM_SETCHARFORMAT , SCF_ALL , (LPARAM)&cf);
LOGFONTEX lfe = StrToLogFont(GETSTR(CFG_UIF_MSG));
SendMessage(this->hwnd , EM_SETBKGNDCOLOR , 0 , lfe.bgColor);
HideCaret(this->hwnd);
// SendMessage(item , EM_SETFONTSIZE , 200 , 0);
_lock = 0;
}
cMsgControlRich::~cMsgControlRich() {
// if (hwnd) DestroyWindow(hwnd);
}
void cMsgControlRich::clear() {
SendMessage(this->hwnd , WM_SETTEXT , 0 , (LPARAM)"");
}
void cMsgControlRich::lock() {
if (!_lock)
SendMessage(this->hwnd , WM_SETREDRAW , 0,0);
_lock++;
}
void cMsgControlRich::unlock() {
if (_lock) _lock --;
else return;
if (!_lock) {
SendMessage(this->hwnd , WM_SETREDRAW , 1,0);
RepaintWindow(this->hwnd);
}
}
int cMsgControlRich::parentMessageProc(HWND hwnd , UINT message, WPARAM wParam, LPARAM lParam) {
/* switch (message) {
}*/
return 0;
}
#define RE_PREPARE() memset(&cf , 0 , sizeof(cf));memset(&pf , 0 , sizeof(pf));pf.cbSize = sizeof(pf);cf.cbSize = sizeof(cf); \
{int ndx = GetWindowTextLength (hwnd); SendMessage(hwnd , EM_SETSEL , ndx, ndx);}
#define RE_ALIGNMENT(al) pf.dwMask = PFM_ALIGNMENT;pf.wAlignment = al;SendMessage(hwnd , EM_SETPARAFORMAT , 0 , (LPARAM)&pf)
#define RE_FACE(fac) cf.dwMask = CFM_FACE;strcpy(cf.szFaceName , fac);SendMessage(hwnd , EM_SETCHARFORMAT , SCF_SELECTION , (LPARAM)&cf)
#define RE_SIZE(siz) cf.dwMask = CFM_SIZE;cf.yHeight = (siz);SendMessage(hwnd , EM_SETCHARFORMAT , SCF_SELECTION , (LPARAM)&cf)
#define RE_BOLD(bo) cf.dwMask = CFM_BOLD;cf.dwEffects = bo?CFM_BOLD:0;SendMessage(hwnd , EM_SETCHARFORMAT , SCF_SELECTION , (LPARAM)&cf)
#define RE_COLOR(co) cf.dwMask = CFM_COLOR;cf.crTextColor = co;SendMessage(hwnd , EM_SETCHARFORMAT , SCF_SELECTION , (LPARAM)&cf)
#define RE_ADD(txt) SendMessage(hwnd , EM_REPLACESEL , 0 , (LPARAM)(string(txt).c_str()))
#define RE_ADDLINE(txt) RE_ADD(string(txt) + "\r\n")
// Wczytuje z bazy danych definicje fonta
#define RE_SETEXFONT(id) \
{ \
LOGFONTEX lfe = StrToLogFont(GETSTR(id));\
cf.dwMask = CFM_FACE | CFM_SIZE | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | /*CFM_BACKCOLOR |*/ CFM_CHARSET;\
strcpy(cf.szFaceName , lfe.lf.lfFaceName);\
cf.yHeight = (-lfe.lf.lfHeight) * 15 ;\
cf.dwEffects = (lfe.lf.lfWeight>=FW_BOLD?CFE_BOLD:0) \
| (lfe.lf.lfItalic?CFE_ITALIC:0)\
| (lfe.lf.lfUnderline?CFE_UNDERLINE:0);\
cf.crTextColor = lfe.color; \
/*cf.crBackColor = lfe.bgColor;*/\
cf.bCharSet = lfe.lf.lfCharSet;\
SendMessage(hwnd , EM_SETCHARFORMAT , SCF_SELECTION , (LPARAM)&cf);\
cf.crTextColor;\
}
void cMsgControlRich::SetStyleCB(const CStdString & token , const CStdString & styleClass , cRichEditFormat::cSetStyle & ss) {
/*TODO: Wstawiæ formatowanie MARK */
HTMLInfoStyleCB(token , styleClass , ss);
if (styleClass == "mark") {
LOGFONTEX lfe = StrToLogFont(GETSTR(CFG_UIF_MSGMARK));
ss.cf.dwMask |= CFM_FACE | CFM_COLOR | CFM_BACKCOLOR | CFM_SIZE | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE;
ss.cf.crTextColor = lfe.color;
ss.cf.crBackColor = lfe.bgColor;
/* Wysokoœæ w lfe jest najczêœciej ujemna... * 15 daje m/w dobry rozmiar czcionki */
ss.cf.yHeight = -lfe.lf.lfHeight * 15;
strcpy(ss.cf.szFaceName , lfe.lf.lfFaceName);
if (lfe.lf.lfItalic)
ss.cf.dwEffects |= CFE_ITALIC;
if (lfe.lf.lfWeight >= FW_BOLD)
ss.cf.dwEffects |= CFE_ITALIC;
if (lfe.lf.lfUnderline)
ss.cf.dwEffects |= CFE_UNDERLINE;
}
}
#define COLOR_SWAP(c) ((c & 0x00FF0000)>>16) | (c&0xFF00) | ((c & 0x00FF)<<16)
void cMsgControlRich::insertHTML(CStdString body , int defColor) {
cRichEditHtml::InsertHTML(this->hwnd , body , SetStyleCB);
}
void cMsgControlRich::msgInsert(cMessage * m , const char * display , bool scroll){
CHARFORMAT2 cf;
PARAFORMAT2 pf;
RE_PREPARE();
// Ustawiamy paragraf.
pf.dwMask = PFM_SPACEBEFORE | PFM_SPACEAFTER | PFM_STARTINDENT;
pf.dySpaceBefore = 50;
pf.dySpaceAfter = 0;
pf.dxStartIndent = 0;
SendMessage(hwnd , EM_SETPARAFORMAT , 0 , (LPARAM)&pf);
// RE_ADDLINE("\nCHECK\n");
string from;
int cnt = m->flag & MF_SEND?0 : ICMessage(IMC_CNT_FIND , m->net , (int)m->fromUid);
from = GetExtParam(m->ext , MEX_DISPLAY);
if (from.empty()) {
if (display) from=display;
else
from = GETCNTC(cnt , CNT_DISPLAY);
}
if (from.empty()) from = (m->flag & MF_SEND)?"JA" : m->fromUid;
CStdString body = m->body;
if (m->type == MT_FILE) {
m->flag |= MF_HTML;
body = "Plik:\t\t<b>" + GetExtParam(m->ext , MEX_FILE_PATH) + "</b>";
if (m->flag & MF_SEND)
body += "<br/><b>Wysy³any</b>";
else
body += "<br/><b>Odbierany</b>";
double size = atof(GetExtParam(m->ext , MEX_FILE_SIZE).c_str());
if (size > 0)
body += stringf("<br/>Rozmiar:\t<b>%.2f KB</b>" , size / 1024);
double transfered = atof(GetExtParam(m->ext , MEX_FILE_TRANSFERED).c_str());
if (transfered > 0)
body += stringf("<br/>Przes³ano:\t<b>%.2f KB</b>" , transfered / 1024);
int time = atoi(GetExtParam(m->ext , MEX_FILE_TRANSFER_TIME).c_str());
if (time)
body += stringf("<br/>Czas:\t\t<b>%d</b>m <b>%d</b> s" , time / 60 , time % 60);
if (time && size > 0)
body += stringf("<br/>Transfer:\t<b>%.2f KB/s</b>" , transfered / 1024 / time);
string error = GetExtParam(m->ext , MEX_FILE_ERROR);
if (!error.empty())
body += "<br/><br/>B³¹d:\t\t<b>" + error + "</b>";
}
if (m->type != MT_QUICKEVENT && (!from.empty() || m->time)) {
RE_SETEXFONT(CFG_UIF_MSGCNT);
if (!from.empty()) {RE_BOLD(1);RE_ADD(from+": ");RE_BOLD(0);}
cTime64 dtime(m->time);
if (m->time/* && m->type==MT_MESSAGE*/) {
if (dtime.sec / 86400 != _time64(0) / 86400)
RE_ADD(dtime.strftime(" (%a %d-%m'%y %H:%M) "));
else
RE_ADD(dtime.strftime(" (%H:%M) "));
}
CStdString AddInfo = GetExtParam(m->ext , MEX_ADDINFO);
if (!AddInfo.empty()) RE_ADD(" "+AddInfo);
RE_ADD(" \r\n");
}
if (m->type == MT_QUICKEVENT) {RE_SETEXFONT(m->flag & MF_QE_NORMAL?CFG_UIF_MSG: CFG_UIF_MSGINFO);}
else if(m->flag & MF_SEND) {RE_SETEXFONT(CFG_UIF_MSGSEND);}
else {RE_SETEXFONT(CFG_UIF_MSGRCV);}
pf.dwMask = PFM_STARTINDENT | PFM_OFFSET | PFM_SPACEBEFORE;
pf.dxStartIndent = 100;
pf.dxOffset = 0;
pf.dySpaceBefore = 0;
SendMessage(hwnd , EM_SETPARAFORMAT , 0 , (LPARAM)&pf);
// Dodajemy BODY -------------------------------------------------
if (m->flag & MF_HTML) {
insertHTML(body + "<br>", cf.crTextColor);
} else {
RE_ADD(body + "\r\n");
}
// RE_SIZE(40);
// RE_ADD("\r\n");
// if (m->flag & MF_SEND) RE_COLOR(GETINT(CFG_UIC_MSGTXT));
// SetWindowText(GetDlgItem(hwnd,IDC_MSG) , body.c_str());
if (scroll) {
SendMessage(hwnd , WM_VSCROLL , SB_BOTTOM , 0);
if (SendMessage(hwnd , EM_GETFIRSTVISIBLELINE , 0 , 0) == SendMessage(hwnd , EM_GETLINECOUNT , 0 , 0)-1) SendMessage(hwnd , EM_SCROLL , SB_PAGEUP , 0);
}
// delete [] buff;
}
void cMsgControlRich::statusInsert(int status , CStdString info) {
CHARFORMAT2 cf;
PARAFORMAT2 pf;
RE_PREPARE();
// Ustawiamy paragraf.
pf.dwMask = PFM_SPACEBEFORE | PFM_SPACEAFTER | PFM_STARTINDENT;
pf.dySpaceBefore = 50;
pf.dySpaceAfter = 50;
pf.dxStartIndent = 0;
SendMessage(hwnd , EM_SETPARAFORMAT , 0 , (LPARAM)&pf);
RE_SETEXFONT(CFG_UIF_MSG);
CStdString txt = cTime64(true).strftime("[%H:%M] status ");
RE_ADD(txt);
RE_BOLD(1);
RE_ADD(getStatusName(status) + (info.empty()?"\r\n":""));
RE_BOLD(0);
if (!info.empty()) RE_ADD(" \""+info+"\"\r\n");
SendMessage(hwnd , WM_VSCROLL , SB_BOTTOM , 0);
if (SendMessage(hwnd , EM_GETFIRSTVISIBLELINE , 0 , 0) == SendMessage(hwnd , EM_GETLINECOUNT , 0 , 0)-1) SendMessage(hwnd , EM_SCROLL , SB_PAGEUP , 0);
}
#undef RE_PREPARE
#undef RE_ALIGNMENT
#undef RE_BOLD
#undef RE_COLOR
#undef RE_ADD
#undef RE_ADDLINE
#undef RE_SETEXFONT
void cMsgControlRich::contextMenu(int x , int y) {
HMENU mainMenu = LoadMenu(Ctrl->hDll() , MAKEINTRESOURCE(IDM_MSG));
HMENU menu = GetSubMenu(mainMenu , 0);
// jedziem
int ret = TrackPopupMenu(menu,TPM_NONOTIFY | TPM_RETURNCMD ,
x,y,0,this->hwnd , 0);
switch (ret) {
case ID_MSG_COPY:
SendMessage(hwnd , WM_COPY , 0 , 0);
break;
case ID_MSG_SELECTALL:
SendMessage(hwnd , EM_SETSEL , 0 , 0x7FFFFFFF);
break;
case ID_MSG_CLEAR:
SetWindowText(hwnd , "");
break;
}
// robim
DestroyMenu(mainMenu);
}
int CALLBACK cMsgControlRich::WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
// static char str_buff2 [MAX_STRBUFF];
cMsgControlRich * MC;
MC = (cMsgControlRich*)GetProp(hwnd , "cMsgControl*");
if (!MC) return 0;
static int mouseState = 0;
switch (message)
{
case WM_CONTEXTMENU: {
MC->contextMenu(LOWORD(lParam) , HIWORD(lParam));
break;}
case WM_DESTROY: {
delete MC;
SetProp(hwnd , "cMsgControl*" , 0);
MC = 0;
}
case WM_LBUTTONDOWN:
mouseState = 1;
break;
case WM_MOUSEMOVE:
if (mouseState == 1) {
mouseState = 2;
}
break;
case WM_LBUTTONUP:
if (mouseState == 2 && GETINT(CFG_UIMSGVIEW_COPY)) {
mouseState = 0;
int start , end;
SendMessage(hwnd , EM_GETSEL , (WPARAM)&start , (LPARAM)&end);
if (start == end) break;
SendMessage(hwnd , WM_COPY , 0 , 0);
SendMessage(hwnd , EM_SETSEL , -1 , 0);
MessageBeep(MB_OK);
} else mouseState = 0;
break;
}
if (!MC) return 0;
return CallWindowProc(MC->_oldwndproc , hwnd , message , wParam , lParam);
}
// -------------------------------------------------------------
int ActionMsgEditMenuProc(sUIActionNotify_base * anBase) {
sUIActionNotify_2params * an = static_cast<sUIActionNotify_2params*>(anBase);
sUIAction actSend = sUIAction(IMIG_MSGWND, UI::ACT::msg_ctrlsend, an->act.cnt);
unsigned int cntId = an->act.cnt;
switch (an->act.id) {
case UI::ACT::msg_ctrlsend_menu_copy: case UI::ACT::msg_ctrlsend_menu_cut:
if (an->code == ACTN_CREATE) {
UI::Notify::_getSelection gs;
gs.act = actSend;
UIActionCall(&gs);
UIActionSetStatus(an->act, (gs._start==gs._end) ? -1 : 0 , ACTS_DISABLED);
} else if (an->code == ACTN_ACTION) {
SendMessage((HWND)UIActionHandle(actSend),
(an->act.id == UI::ACT::msg_ctrlsend_menu_copy ? WM_COPY : WM_CUT), 0, 0);
}
break;
case UI::ACT::msg_ctrlsend_menu_delete:
if (an->code == ACTN_ACTION) {
UI::Notify::_getSelection gs;
gs.act = actSend;
UIActionCall(&gs);
if (gs._start == gs._end) {
gs.code = UI::Notify::setSelection;
gs._start = 0;
gs._end = 0x7FFFFFFF;
UIActionCall(&gs);
}
UI::Notify::_insertText it;
it.act = actSend;
it._isHtml = false;
it._position = -1;
it._text = "";
UIActionCall(&it);
}
break;
case UI::ACT::msg_ctrlsend_menu_select:
if (an->code == ACTN_ACTION) {
UI::Notify::_getSelection gs;
gs.act = actSend;
gs.code = UI::Notify::setSelection;
gs._start = 0;
gs._end = 0x7FFFFFFF;
UIActionCall(&gs);
}
break;
case UI::ACT::msg_ctrlsend_menu_undo: case UI::ACT::msg_ctrlsend_menu_redo:
if (an->code == ACTN_CREATE) {
int bits = SendMessage((HWND)UIActionHandle(actSend),
(an->act.id == UI::ACT::msg_ctrlsend_menu_undo ? EM_CANUNDO : EM_CANREDO), 0, 0) ? 0 : -1;
UIActionSetStatus(an->act, bits , an->act.id == UI::ACT::msg_ctrlsend_menu_undo ? ACTS_DISABLED : ACTS_HIDDEN);
} else if (an->code == ACTN_ACTION) {
SendMessage((HWND)UIActionHandle(actSend),
(an->act.id == UI::ACT::msg_ctrlsend_menu_undo ? EM_UNDO : EM_REDO), 0, 0);
}
break;
case UI::ACT::msg_ctrlsend_menu_paste:
case UI::ACT::msg_ctrlsend_menu_paste_nf:
case UI::ACT::msg_ctrlsend_menu_paste_qt: {
bool formatting = Act(actSend).call(UI::Notify::supportsFormatting, 0, 0);
// formatting = true;
actSend.cnt = cntId;
HWND wndSend = (HWND)Act(actSend).handle;
bool canPaste = SendMessage(wndSend, EM_CANPASTE, CF_TEXT, 0);
int cfRTF = RegisterClipboardFormat(CF_RTF);
bool pasteRTF = canPaste && SendMessage(wndSend, EM_CANPASTE, cfRTF, 0);
if (an->code == ACTN_CREATE) {
// wszystkie za³atwiamy za jednym razem...
UIActionSetStatus(sUIAction(an->act.parent, UI::ACT::msg_ctrlsend_menu_paste, cntId)
, ((canPaste)?0:ACTS_DISABLED) | ((!formatting && pasteRTF)?ACTS_HIDDEN:0) , ACTS_DISABLED | ACTS_HIDDEN);
UIActionSetStatus(sUIAction(an->act.parent, UI::ACT::msg_ctrlsend_menu_paste_nf, cntId)
, ((pasteRTF)?0:ACTS_HIDDEN) , ACTS_HIDDEN);
UIActionSetStatus(sUIAction(an->act.parent, UI::ACT::msg_ctrlsend_menu_paste_qt, cntId)
, ((canPaste)?0:ACTS_HIDDEN) , ACTS_HIDDEN);
} else if (an->code == ACTN_ACTION) {
switch (an->act.id) {
case UI::ACT::msg_ctrlsend_menu_paste:
SendMessage(wndSend, EM_PASTESPECIAL, pasteRTF ? cfRTF : CF_TEXT, 0);
break;
case UI::ACT::msg_ctrlsend_menu_paste_nf:
SendMessage(wndSend, EM_PASTESPECIAL, CF_TEXT, 0);
break;
case UI::ACT::msg_ctrlsend_menu_paste_qt:
if (OpenClipboard(0)) {
HANDLE clipHandle = (char*) GetClipboardData(CF_TEXT);
if (clipHandle) {
const char * clip = (const char *) GlobalLock(clipHandle);
if (clip) {
CStdString text = " \"<i>" + string(clip) + "</i>\" ";
GlobalUnlock(clipHandle);
UI::Notify::_insertText it;
it.act = actSend;
it._isHtml = true;
it._position = -1;
it._text = text;
UIActionCall(&it);
}
}
CloseClipboard();
}
break;
}
}
break;
}
case UI::ACT::msg_ctrlsend_menu_hist_previous: case UI::ACT::msg_ctrlsend_menu_hist_next:
if (an->code == ACTN_CREATE) {
UIActionSetStatus(an->act, Cnt[an->act.cnt].haveMsgHistory(an->act.id == UI::ACT::msg_ctrlsend_menu_hist_next) ? 0 : -1 , ACTS_HIDDEN);
} else if (an->code == ACTN_ACTION) {
Cnt[an->act.cnt].useMsgHistory(an->act.id == UI::ACT::msg_ctrlsend_menu_hist_next);
}
break;
case UI::ACT::msg_ctrlsend_menu_hist_clear:
if (an->code == ACTN_CREATE) {
UIActionSetStatus(an->act, (Cnt[an->act.cnt].msgHistory.size() > 1) ? 0 : -1 , ACTS_HIDDEN);
} else if (an->code == ACTN_ACTION) {
Cnt[an->act.cnt].clearMsgHistory();
}
break;
}
/*
const int msg_ctrlsend_menu_paste = 262;
const int msg_ctrlsend_menu_paste_nf = 263;
const int msg_ctrlsend_menu_paste_qt = 264;
const int msg_ctrlsend_menu_hist_previous = 270;
const int msg_ctrlsend_menu_hist_next = 271;
const int msg_ctrlsend_menu_hist_clear = 272;
*/
return 0;
}