@@ -241,6 +241,7 @@ BEGIN_MESSAGE_MAP( CRegexAssistantDlg, CDialog )
241241 ON_BN_CLICKED( IDC_STATIC_GROUPBOX_TEST_TARGET_TEXT, &CRegexAssistantDlg::OnBnClickedStaticGroupboxTestTargetText )
242242 ON_BN_CLICKED( IDC_RESET_SAMPLE, &CRegexAssistantDlg::OnBnClickedResetSample )
243243 ON_BN_CLICKED( IDC_UNDO_EXPRESSION_CHANGE, &CRegexAssistantDlg::OnBnClickedUndoExpressionChange )
244+ ON_WM_DROPFILES()
244245END_MESSAGE_MAP()
245246
246247void CRegexAssistantDlg::OnSysCommand( UINT nID, LPARAM lParam )
@@ -1091,3 +1092,30 @@ void CRegexAssistantDlg::OnBnClickedUndoExpressionChange()
10911092 }
10921093 m_UndoExpressionChange_btn.EnableWindow ( m_RegexStatementChangesToUndo.empty () ? FALSE : TRUE );
10931094}
1095+
1096+
1097+ void CRegexAssistantDlg::OnDropFiles ( HDROP hDropInfo )
1098+ {
1099+ wchar_t FileName[256 ] = {0 };
1100+ DragQueryFile ( hDropInfo, 0 , FileName, sizeof ( FileName ) );
1101+
1102+ CStdioFile file;
1103+
1104+ if ( file.Open ( FileName, CFile::modeRead | CFile::typeText | CFile::shareDenyNone ) )
1105+ {
1106+ m_SampleText = _T ( " " );
1107+ CString Line;
1108+ while ( file.ReadString ( Line ) )
1109+ m_SampleText += Line + _T (" \n " );
1110+ if ( m_SampleText.GetLength () > 0 )
1111+ {
1112+ string strText = FXString::ToString ( m_SampleText.operator LPCWSTR () );
1113+ m_ScintillaWrapper.SendEditor ( SCI_CLEARALL );
1114+ m_ScintillaWrapper.SendEditor ( SCI_APPENDTEXT, strText.length (), reinterpret_cast <sptr_t >(strText.c_str ()) );
1115+ }
1116+ file.Close ();
1117+ }
1118+
1119+
1120+ CDialog::OnDropFiles ( hDropInfo );
1121+ }
0 commit comments