1 |
/* wptClipEditDlg.cpp - Clipboard Editor dialog |
/* wptClipEditDlg.cpp - Clipboard Editor dialog |
2 |
* Copyright (C) 2000-2004 Timo Schulz |
* Copyright (C) 2000-2005 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
30 |
#include "../resource.h" |
#include "../resource.h" |
31 |
|
|
32 |
|
|
33 |
|
/* Dialog box procedure for the clipboard editor. */ |
34 |
BOOL CALLBACK |
BOOL CALLBACK |
35 |
clip_edit_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
clip_edit_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
36 |
{ |
{ |
57 |
} |
} |
58 |
clipmem = GetClipboardData (CF_TEXT); |
clipmem = GetClipboardData (CF_TEXT); |
59 |
if (clipmem == NULL) { |
if (clipmem == NULL) { |
60 |
center_window (dlg); |
center_window (dlg, NULL); |
61 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
62 |
CloseClipboard (); |
CloseClipboard (); |
63 |
return FALSE; |
return FALSE; |
75 |
CloseClipboard (); |
CloseClipboard (); |
76 |
SetDlgItemText (dlg, IDC_CLIPEDIT_CLIPTEXT2, p); |
SetDlgItemText (dlg, IDC_CLIPEDIT_CLIPTEXT2, p); |
77 |
free_if_alloc (p); |
free_if_alloc (p); |
78 |
center_window (dlg); |
center_window (dlg, NULL); |
79 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
80 |
return TRUE; |
return TRUE; |
81 |
|
|
93 |
case IDC_CLIPEDIT_SEND: |
case IDC_CLIPEDIT_SEND: |
94 |
if (IsDlgButtonChecked (dlg, IDC_CLIPEDIT_QUOTE)) { |
if (IsDlgButtonChecked (dlg, IDC_CLIPEDIT_QUOTE)) { |
95 |
gpgme_data_t txt; |
gpgme_data_t txt; |
96 |
gpgme_data_new_from_clipboard (&txt); |
gpg_data_new_from_clipboard (&txt, 0); |
97 |
gpgme_data_mail_quote (&txt); |
gpg_data_mail_quote (&txt); |
98 |
gpgme_data_release_and_set_clipboard (txt); |
gpg_data_release_and_set_clipboard (txt, 0); |
99 |
SendMessage (dlg, WM_INITDIALOG, 0, 0); |
SendMessage (dlg, WM_INITDIALOG, 0, 0); |
100 |
return TRUE; |
return TRUE; |
101 |
} |
} |
122 |
open.lStructSize = sizeof (OPENFILENAME); |
open.lStructSize = sizeof (OPENFILENAME); |
123 |
open.hInstance = glob_hinst; |
open.hInstance = glob_hinst; |
124 |
open.lpstrTitle = _("File Open"); |
open.lpstrTitle = _("File Open"); |
125 |
open.lpstrFilter = (char *)_("All Files (*.*)\0*.*"); |
open.lpstrFilter = (char *)_("All Files (*.*)\0*.*\0\0"); |
126 |
open.hwndOwner = dlg; |
open.hwndOwner = dlg; |
127 |
open.lpstrFile = file; |
open.lpstrFile = file; |
128 |
open.nMaxFile = sizeof (file)-1; |
open.nMaxFile = sizeof (file)-1; |
129 |
open.Flags = 0; |
open.Flags = OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST; |
130 |
if (GetOpenFileName (&open)) { |
if (GetOpenFileName (&open)) { |
131 |
if( (size=get_file_size( file )) > MAX_CLIPTEXT_SIZE ) { |
if( (size=get_file_size( file )) > MAX_CLIPTEXT_SIZE ) { |
132 |
id = msg_box( dlg, _("The file you want to add is very large.\n" |
id = msg_box( dlg, _("The file you want to add is very large.\n" |
158 |
open.lStructSize = sizeof (OPENFILENAME); |
open.lStructSize = sizeof (OPENFILENAME); |
159 |
open.hInstance = glob_hinst; |
open.hInstance = glob_hinst; |
160 |
open.lpstrTitle = _("File Save"); |
open.lpstrTitle = _("File Save"); |
161 |
open.lpstrFile = (char *)_("All Files (*.*)\0*.*"); |
open.lpstrFile = (char *)_("All Files (*.*)\0*.*\0\0"); |
162 |
open.hwndOwner = dlg; |
open.hwndOwner = dlg; |
163 |
open.lpstrFile = file; |
open.lpstrFile = file; |
164 |
open.nMaxFile = sizeof (file) - 1; |
open.nMaxFile = sizeof (file) - 1; |
165 |
|
open.Flags = OFN_OVERWRITEPROMPT; |
166 |
|
|
167 |
if( GetSaveFileName( &open ) ) { |
if( GetSaveFileName( &open ) ) { |
168 |
if( file_exist_check( file ) == 0 ) { |
if( file_exist_check( file ) == 0 ) { |
194 |
} |
} |
195 |
|
|
196 |
return FALSE; |
return FALSE; |
197 |
} /* clip_edit_dlg_proc */ |
} |
198 |
|
|