View the DQSD CVS repository here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/
Update of /cvsroot/dqsd/dqsd/src/DQSDSearchWiz
In directory usw-pr-cvs1:/tmp/cvs-serv12355/src/DQSDSearchWiz
Modified Files:
DQSDSearchWiz.rc DQSDWizardDlg.cpp DQSDWizardDlg.h StdAfx.h
Log Message:
Display FORM content when selected.
Index: DQSDSearchWiz.rc
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/DQSDSearchWiz.rc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DQSDSearchWiz.rc 3 Aug 2002 06:05:00 -0000 1.1
--- DQSDSearchWiz.rc 4 Aug 2002 07:09:11 -0000 1.2
***************
*** 125,129 ****
COMBOBOX IDC_Category,53,38,102,127,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
! RTEXT "&Contributor:",IDC_STATIC,6,56,45,8
EDITTEXT IDC_Contributor,53,53,102,14,ES_AUTOHSCROLL
RTEXT "&Email:",IDC_STATIC,6,72,45,8
--- 125,129 ----
COMBOBOX IDC_Category,53,38,102,127,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
! RTEXT "C&ontributor:",IDC_STATIC,6,56,45,8
EDITTEXT IDC_Contributor,53,53,102,14,ES_AUTOHSCROLL
RTEXT "&Email:",IDC_STATIC,6,72,45,8
***************
*** 135,147 ****
EDITTEXT IDC_Switches,205,47,102,39,ES_MULTILINE | ES_WANTRETURN |
WS_VSCROLL
! LTEXT "FORM elements in the current page:",IDC_STATIC,6,95,115,
! 8
CONTROL "List2",IDC_FormList2,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER |
! WS_TABSTOP,6,104,356,43
! GROUPBOX "FORM fields:",IDC_STATIC,6,151,356,66
! EDITTEXT IDC_FormFields,12,161,344,49,ES_MULTILINE |
! ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT
! WS_TABSTOP
DEFPUSHBUTTON "OK",1,312,6,50,14
PUSHBUTTON "Cancel",2,312,23,50,14
--- 135,145 ----
EDITTEXT IDC_Switches,205,47,102,39,ES_MULTILINE | ES_WANTRETURN |
WS_VSCROLL
! LTEXT "&FORMs:",IDC_STATIC,6,91,27,8
CONTROL "List2",IDC_FormList2,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER |
! WS_TABSTOP,6,100,356,47
! LTEXT "&HTML for selected FORM:",IDC_STATIC,6,150,84,8
! EDITTEXT IDC_FormFields,6,158,356,59,ES_MULTILINE |
! ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
DEFPUSHBUTTON "OK",1,312,6,50,14
PUSHBUTTON "Cancel",2,312,23,50,14
Index: DQSDWizardDlg.cpp
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/DQSDWizardDlg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DQSDWizardDlg.cpp 3 Aug 2002 06:05:00 -0000 1.1
--- DQSDWizardDlg.cpp 4 Aug 2002 07:09:11 -0000 1.2
***************
*** 11,17 ****
USES_CONVERSION;
! CenterWindow( GetActiveWindow() );
! // Get the base URL
CComBSTR bstrURL;
--- 11,17 ----
USES_CONVERSION;
! CenterWindow( GetActiveWindow() ); // ??? should probably use the actual
browser window
! // Get the base URL and put it in the 'Link' element
CComBSTR bstrURL;
***************
*** 29,33 ****
_tcsncpy( szBaseURL, uc.lpszScheme, dwLength );
szBaseURL[ dwLength ] = _T('\0');
!
memset( szScheme, 0, sizeof szScheme );
_tcsncpy( szScheme, uc.lpszScheme, uc.dwSchemeLength + 3 );
--- 29,33 ----
_tcsncpy( szBaseURL, uc.lpszScheme, dwLength );
szBaseURL[ dwLength ] = _T('\0');
!
memset( szScheme, 0, sizeof szScheme );
_tcsncpy( szScheme, uc.lpszScheme, uc.dwSchemeLength + 3 );
***************
*** 36,39 ****
--- 36,42 ----
ctl.SetWindowText( szBaseURL );
}
+
+ // Save the base URL for later use
+
szBaseURL[ _tcslen( szBaseURL ) - 1 ] = _T('\0');
***************
*** 94,114 ****
}
LVITEM lvi;
memset( &lvi, 0, sizeof lvi );
! lvi.mask = LVIF_TEXT;
lvi.iItem = 256;
lvi.pszText = const_cast<LPTSTR>(strName.c_str());
int iPos = ctlFormList2.SendMessage( LVM_INSERTITEM, 0,
(LPARAM)&lvi );
- lvi.pszText = const_cast<LPTSTR>(strAction.c_str());
lvi.mask = LVIF_TEXT;
lvi.iItem = iPos;
lvi.iSubItem = 1;
lvi.pszText = const_cast<LPTSTR>(strAction.c_str());
! ctlFormList2.SendMessage( LVM_SETITEMTEXT, iPos, (LPARAM)&lvi
);
! CComQIPtr< IHTMLFormElement > spFormElement( spFormDisp );
! long cFormElements = 0;
! HR( spFormElement->get_length( &cFormElements ) );
}
--- 97,129 ----
}
+ // Get the content of each form
+
+ CComBSTR* pbstrHTML = new CComBSTR;
+ BSTR bstr = NULL;
+ if ( SUCCEEDED( spForm->get_innerHTML( &bstr) ) )
+ {
+ pbstrHTML->Attach( bstr );
+ m_vecFormHTMLs.push_back( pbstrHTML );
+ }
+
+ // Add the form information to the list
LVITEM lvi;
memset( &lvi, 0, sizeof lvi );
!
! lvi.mask = LVIF_TEXT|LVIF_PARAM;
lvi.iItem = 256;
lvi.pszText = const_cast<LPTSTR>(strName.c_str());
+ lvi.lParam = reinterpret_cast<LPARAM>(pbstrHTML);
int iPos = ctlFormList2.SendMessage( LVM_INSERTITEM, 0,
(LPARAM)&lvi );
lvi.mask = LVIF_TEXT;
lvi.iItem = iPos;
lvi.iSubItem = 1;
lvi.pszText = const_cast<LPTSTR>(strAction.c_str());
! ctlFormList2.SendMessage( LVM_SETITEM, iPos, (LPARAM)&lvi );
! // CComQIPtr< IHTMLFormElement > spFormElement( spFormDisp );
! // long cFormElements = 0;
! // HR( spFormElement->get_length( &cFormElements ) );
}
***************
*** 117,119 ****
--- 132,169 ----
return 1; // Let the system set the focus
+ }
+
+ LRESULT CDQSDWizardDlg::OnFormListItemChanged(int idCtrl, LPNMHDR pNMHDR, BOOL&
+bHandled)
+ {
+ USES_CONVERSION;
+
+ NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
+
+ if ( pNMListView->uNewState != 3 )
+ return 1;
+
+ CWindow ctlFormList = GetDlgItem( IDC_FormList2 );
+ const int cSelected = ctlFormList.SendMessage( LVM_GETSELECTEDCOUNT, 0, 0 );
+ if ( cSelected > 0 )
+ {
+ const int cItems = ctlFormList.SendMessage( LVM_GETITEMCOUNT, 0, 0 );
+ for ( int i = 0; i < cItems; i++ )
+ {
+ if ( ctlFormList.SendMessage( LVM_GETITEMSTATE, i,
+LVIS_SELECTED ) )
+ {
+ LVITEM lvi;
+ memset( &lvi, 0, sizeof lvi );
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = i;
+ ctlFormList.SendMessage( LVM_GETITEM, i, (LPARAM)&lvi
+);
+ CComBSTR* pbstrHTML =
+reinterpret_cast<CComBSTR*>(lvi.lParam);
+
+ CWindow ctlForm = GetDlgItem( IDC_FormFields );
+ ctlForm.SetWindowText( W2T( *pbstrHTML ) );
+ return 1;
+ }
+ }
+ }
+
+ return 1;
}
Index: DQSDWizardDlg.h
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/DQSDWizardDlg.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DQSDWizardDlg.h 3 Aug 2002 06:05:00 -0000 1.1
--- DQSDWizardDlg.h 4 Aug 2002 07:09:11 -0000 1.2
***************
*** 19,22 ****
--- 19,25 ----
~CDQSDWizardDlg()
{
+ vector< CComBSTR* >::iterator it = m_vecFormHTMLs.begin();
+ for ( ; it != m_vecFormHTMLs.end(); it++ )
+ delete *it;
}
***************
*** 27,30 ****
--- 30,34 ----
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
+ NOTIFY_HANDLER(IDC_FormList2, LVN_ITEMCHANGED, OnFormListItemChanged)
END_MSG_MAP()
// Handler prototypes:
***************
*** 47,52 ****
--- 51,61 ----
}
+ LRESULT OnFormListItemChanged(int idCtrl, LPNMHDR pNMHDR, BOOL& bHandled);
+
public:
CComPtr<IHTMLDocument2> m_spDoc2;
+
+ private:
+ vector< CComBSTR* > m_vecFormHTMLs;
};
Index: StdAfx.h
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/StdAfx.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StdAfx.h 3 Aug 2002 06:05:00 -0000 1.1
--- StdAfx.h 4 Aug 2002 07:09:11 -0000 1.2
***************
*** 27,30 ****
--- 27,31 ----
#include <string>
+ #include <vector>
using namespace std;
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-CVS mailing list
https://lists.sourceforge.net/lists/listinfo/dqsd-cvs
DQSD CVS repository:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/