diff options
-rw-r--r-- | Plugins/emoticons/emoticons.cpp | 30 | ||||
-rw-r--r-- | Plugins/emoticons/options.cpp | 2 |
2 files changed, 27 insertions, 5 deletions
diff --git a/Plugins/emoticons/emoticons.cpp b/Plugins/emoticons/emoticons.cpp index ae0ff90..b644041 100644 --- a/Plugins/emoticons/emoticons.cpp +++ b/Plugins/emoticons/emoticons.cpp @@ -804,12 +804,34 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) Dialog *dlg = dlgit->second;
+ BOOL rebuild = FALSE;
+ switch(msg)
+ {
+ case WM_KEYDOWN:
+ if ((!(GetKeyState(VK_CONTROL) & 0x8000) || (wParam != 'C' && wParam != 'X' && wParam != VK_INSERT))
+ && (!(GetKeyState(VK_SHIFT) & 0x8000) || wParam != VK_DELETE))
+ break;
+ case WM_CUT:
+ case WM_COPY:
+ {
+ STOP_RICHEDIT(dlg->input);
+ __old_sel.cpMax += RestoreInput(dlg->input, __old_sel.cpMin, __old_sel.cpMax);
+ START_RICHEDIT(dlg->input);
+
+ rebuild = TRUE;
+ break;
+ }
+ }
+
LRESULT ret = CallWindowProc(dlg->input.old_edit_proc, hwnd, msg, wParam, lParam);
switch(msg)
{
case WM_KEYDOWN:
{
+ if ((GetKeyState(VK_SHIFT) & 0x8000) && wParam == VK_DELETE)
+ break;
+
if (wParam != VK_DELETE && wParam != VK_BACK)
break;
}
@@ -885,13 +907,13 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break;
case EM_PASTESPECIAL:
case WM_PASTE:
- {
- ReplaceAllEmoticonsBackwards(dlg->input, NULL, dlg->module);
-
+ rebuild = TRUE;
break;
- }
}
+ if (rebuild)
+ ReplaceAllEmoticonsBackwards(dlg->input, NULL, dlg->module);
+
return ret;
}
diff --git a/Plugins/emoticons/options.cpp b/Plugins/emoticons/options.cpp index 6c888ac..e3639e5 100644 --- a/Plugins/emoticons/options.cpp +++ b/Plugins/emoticons/options.cpp @@ -127,7 +127,7 @@ static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA pd->max_height = 0;
pd->max_width = 0;
- srand(time(NULL));
+ srand((unsigned int) time(NULL));
int prob = (pd->pack->images.getCount() - 15) / 30 + 1;
for(int j = 0, count = 0; j < pd->pack->images.getCount() && count < 15; j++) {
if (rand() % prob != 0)
|