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-serv27505/src/DQSDSearchWiz

Modified Files:
        ChangeLog.txt DQSDSearchWiz.rc DQSDWizardDlg.cpp 
        DQSDWizardDlg.h SearchWizard.cpp SearchWizard.h frames.htm 
        test.htm 
Added Files:
        frames2.htm test2.htm test3.htm 
Log Message:
Added support for documents with frames; cleaned up some minor stuff; added some test 
documents

--- NEW FILE: frames2.htm ---
<html>
<frameset rows="50%, *">
<frame src="test2.htm">
<frame src="test3.htm">
</frameset>
</html>
--- NEW FILE: test2.htm ---
<html>

<head>
</head>

<body>
test2.htm
<form name="form1" method="GET" action="">

<p><input type="text" name="textfield"></p>
<p><input type="checkbox" name="checkbox1" value="ON" checked></p>
<p><input type="checkbox" name="checkbox2" value="ON"></p>
<p><select name="select1">
<option value="op1">Option 1</option>
<option value="op2" selected>Option 2</option>
</select></p>
<p>
<input type="radio" name="radio1" value="option1" checked>
<input type="radio" name="radio1" value="option2">
<input type="radio" name="radio1" value="option3"></p>

<textarea name="textarea1">
this is the value of the textarea
</textarea>

<input type="submit">

</form>
</body>

</html>

--- NEW FILE: test3.htm ---
<html>

<head>
</head>

<body>
test3.htm
<form name="form1" method="GET" action="">

<p><input type="text" name="textfield"></p>
<p><input type="checkbox" name="checkbox1" value="ON" checked></p>
<p><input type="checkbox" name="checkbox2" value="ON"></p>
<p><select name="select1">
<option value="op1">Option 1</option>
<option value="op2" selected>Option 2</option>
</select></p>
<p>
<input type="radio" name="radio1" value="option1" checked>
<input type="radio" name="radio1" value="option2">
<input type="radio" name="radio1" value="option3"></p>

<textarea name="textarea1">
this is the value of the textarea
</textarea>

<input type="submit">

</form>
</body>

</html>

Index: ChangeLog.txt
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/ChangeLog.txt,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ChangeLog.txt       12 Aug 2002 19:02:33 -0000      1.8
--- ChangeLog.txt       21 Aug 2002 05:53:40 -0000      1.9
***************
*** 1,2 ****
--- 1,7 ----
+ Version 0.5 (beta) - 21-Aug-2002
+ 
+ * Added support for documents with frames
+ * Minor cleanup
+ 
  Version 0.4 (beta) - 12-Aug-2002
  

Index: DQSDSearchWiz.rc
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/DQSDSearchWiz.rc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DQSDSearchWiz.rc    12 Aug 2002 19:02:33 -0000      1.12
--- DQSDSearchWiz.rc    21 Aug 2002 05:53:40 -0000      1.13
***************
*** 55,60 ****
  
  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION 0,0,4,0
!  PRODUCTVERSION 0,0,4,0
   FILEFLAGSMASK 0x3fL
  #ifdef _DEBUG
--- 55,60 ----
  
  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION 0,0,5,0
!  PRODUCTVERSION 0,0,5,0
   FILEFLAGSMASK 0x3fL
  #ifdef _DEBUG
***************
*** 72,78 ****
          BEGIN
              VALUE "Comments", "\0"
!             VALUE "CompanyName", "\0"
              VALUE "FileDescription", "Dave's Quick Search Deskbar Search Wizard\0"
!             VALUE "FileVersion", "0.4\0"
              VALUE "InternalName", "DQSDSearchWiz\0"
              VALUE "LegalCopyright", "Copyright (c) 2002 Glenn Carr; Distributed 
under the terms of the GNU General Public License, Version 2\0"
--- 72,78 ----
          BEGIN
              VALUE "Comments", "\0"
!             VALUE "CompanyName", "http://www.glenncarr.com/\0";
              VALUE "FileDescription", "Dave's Quick Search Deskbar Search Wizard\0"
!             VALUE "FileVersion", "0.5\0"
              VALUE "InternalName", "DQSDSearchWiz\0"
              VALUE "LegalCopyright", "Copyright (c) 2002 Glenn Carr; Distributed 
under the terms of the GNU General Public License, Version 2\0"
***************
*** 81,85 ****
              VALUE "PrivateBuild", "\0"
              VALUE "ProductName", "Dave's Quick Search Deskbar Search Wizard\0"
!             VALUE "ProductVersion", "0.4\0"
              VALUE "SpecialBuild", "(beta)\0"
          END
--- 81,85 ----
              VALUE "PrivateBuild", "\0"
              VALUE "ProductName", "Dave's Quick Search Deskbar Search Wizard\0"
!             VALUE "ProductVersion", "0.5\0"
              VALUE "SpecialBuild", "(beta)\0"
          END

Index: DQSDWizardDlg.cpp
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/DQSDWizardDlg.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** DQSDWizardDlg.cpp   12 Aug 2002 19:02:33 -0000      1.21
--- DQSDWizardDlg.cpp   21 Aug 2002 05:53:40 -0000      1.22
***************
*** 137,141 ****
        
        lvc.pszText = _T("action");
!       lvc.cx = 250;
        lvc.iOrder = 1;
        ctlFormList2.SendMessage( LVM_INSERTCOLUMN, 1, (LPARAM)&lvc );
--- 137,141 ----
        
        lvc.pszText = _T("action");
!       lvc.cx = 500;
        lvc.iOrder = 1;
        ctlFormList2.SendMessage( LVM_INSERTCOLUMN, 1, (LPARAM)&lvc );
***************
*** 296,300 ****
        if ( bstrSearchName.Length() == 0 )
        {
!               MessageBox( _T("Enter a search name"), _T("DQSD Search Wizard"), 
MB_OK|MB_ICONWARNING );
                ctlSearchName.SetFocus();
                return 0;
--- 296,300 ----
        if ( bstrSearchName.Length() == 0 )
        {
!               MessageBox( _T("Please enter a search name."), _T("DQSD Search 
Wizard"), MB_OK|MB_ICONWARNING );
                ctlSearchName.SetFocus();
                return 0;
***************
*** 306,310 ****
        if ( bstrSearchTitle.Length() == 0 )
        {
!               MessageBox( _T("Enter a search title"), _T("DQSD Search Wizard"), 
MB_OK|MB_ICONWARNING );
                ctlSearchTitle.SetFocus();
                return 0;
--- 306,310 ----
        if ( bstrSearchTitle.Length() == 0 )
        {
!               MessageBox( _T("Please enter a search title."), _T("DQSD Search 
Wizard"), MB_OK|MB_ICONWARNING );
                ctlSearchTitle.SetFocus();
                return 0;
***************
*** 321,325 ****
        if ( !bChecked && cItems > 0 )
        {
!               MessageBox( _T("Select one or more of the FORMs"), _T("DQSD Search 
Wizard"), MB_OK|MB_ICONWARNING );
                ctlFormList.SetFocus();
                return 0;
--- 321,325 ----
        if ( !bChecked && cItems > 0 )
        {
!               MessageBox( _T("Please select one or more forms."), _T("DQSD Search 
Wizard"), MB_OK|MB_ICONWARNING );
                ctlFormList.SetFocus();
                return 0;

Index: DQSDWizardDlg.h
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/DQSDWizardDlg.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DQSDWizardDlg.h     12 Aug 2002 13:25:01 -0000      1.12
--- DQSDWizardDlg.h     21 Aug 2002 05:53:40 -0000      1.13
***************
*** 29,32 ****
--- 29,33 ----
  BEGIN_MSG_MAP(CDQSDWizardDlg)
        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+       MESSAGE_HANDLER(WM_HELP, OnHelp)
        COMMAND_ID_HANDLER(IDOK, OnOK)
        COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
***************
*** 41,44 ****
--- 42,51 ----
  
        LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+       LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+       {
+               LPHELPINFO lphi = (LPHELPINFO)lParam;
+ 
+               return 0;
+       }
  
        LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);

Index: SearchWizard.cpp
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/SearchWizard.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SearchWizard.cpp    12 Aug 2002 13:25:01 -0000      1.4
--- SearchWizard.cpp    21 Aug 2002 05:53:40 -0000      1.5
***************
*** 40,43 ****
--- 40,84 ----
        HR(spDispDoc->QueryInterface(&spDoc2));
  
+       HWND hwndBrowser = NULL;
+       HR(spWB2->get_HWND(reinterpret_cast<long *>(&hwndBrowser)));
+ 
+ 
+       // If there are frames, then get the document for the active frame
+       
+       long cFrames = 0;
+       BOOL bCreateEmpty = FALSE;
+       CComPtr< IHTMLFramesCollection2 > spFrameCollection;
+       if ( SUCCEEDED( spDoc2->get_frames( &spFrameCollection ) ) && 
+spFrameCollection )
+       {
+               if ( SUCCEEDED( spFrameCollection->get_length( &cFrames ) ) && cFrames 
+> 0 )
+               {
+                       CComPtr<IHTMLDocument2> spActiveFrameDoc = GetActiveFrame( 
+spDoc2 );
+                       if ( spActiveFrameDoc )
+                       {
+                               CComPtr< IUnknown > spActiveFrameDocUnk = 
+spActiveFrameDoc;
+                               CComPtr< IUnknown > spMainDocUnk = spDoc2;
+                               if ( spMainDocUnk.IsEqualObject( spActiveFrameDocUnk ) 
+)
+                               {
+                                       if ( IDNO == ::MessageBox( hwndBrowser, 
+                                                                                      
+    _T("There are multiple frames in the current document, none of which are active.  
+"
+                                                                                      
+           "Would you like to continue and create an empty search template?  "
+                                                                                      
+           "If no, click in a frame or field to activate the frame, then try 
+again."), 
+                                                                                      
+    _T("DQSD Search Wizard"), MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 ) )
+                                       {
+                                               return S_OK;
+                                       }
+                                       else
+                                       {
+                                               bCreateEmpty = TRUE;
+                                       }
+                               }
+                               else
+                               {
+                                       spDoc2 = spActiveFrameDoc;
+                               }
+                       }
+               }
+       }
+ 
        // Get the forms
  
***************
*** 51,84 ****
        COptions options;
  
! 
!       HWND hwndBrowser = NULL;
!       HR(spWB2->get_HWND(reinterpret_cast<long *>(&hwndBrowser)));
!       
!       if ( 0 == cForms )
        {
!               if ( IDNO == ::MessageBox( hwndBrowser, 
!                                                                  _T("Sorry, no FORMs 
were found in the current document.  "
!                                                                         "Would you 
like to continue and create an empty search template?"), 
!                                                                  _T("DQSD Search 
Wizard"), MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 ) )
                {
!                       return S_OK;
                }
!       }
!       else if ( options.WarnNotActive() )
!       {
!               // Give the user a chance to select a FORM field
!               CComPtr< IHTMLElement > spActiveElement;
!               spDoc2->get_activeElement( &spActiveElement );
!               CComPtr< IHTMLInputElement > spActiveInputElement;
!               if ( !spActiveElement || FAILED( spActiveElement.QueryInterface( 
&spActiveInputElement ) ) )
                {
!                       if ( IDNO == ::MessageBox( hwndBrowser, 
!                                                          _T("No fields have been 
selected.  Selecting or clicking in the field which contains the search "
!                                                                 "string will add 
some helpful information to the search and make "
!                                                                 "it more 
complete.\r\n\r\n"
!                                                                 "Would you like to 
continue anyway?"), 
!                                                          _T("DQSD Search Wizard"), 
MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 ) )
                        {
!                               return S_OK;
                        }
                }
--- 92,125 ----
        COptions options;
  
!       if ( !bCreateEmpty )
        {
!               if ( 0 == cForms )
                {
!                       string strMsg = string( _T("Sorry, no FORMs were found in the 
current ") ) + 
!                                                                         ( ( cFrames 
> 0 ) ? _T("frame") : _T("document") ) +
!                                                       string( _T(".  Would you like 
to continue and create an empty search template?") );
!                       if ( IDNO == ::MessageBox( hwndBrowser, strMsg.c_str(),
!                                                                          _T("DQSD 
Search Wizard"), MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 ) )
!                       {
!                               return S_OK;
!                       }
                }
!               else if ( options.WarnNotActive() )
                {
!                       // Give the user a chance to select a FORM field
!                       CComPtr< IHTMLElement > spActiveElement;
!                       spDoc2->get_activeElement( &spActiveElement );
!                       CComPtr< IHTMLInputElement > spActiveInputElement;
!                       if ( !spActiveElement || FAILED( 
spActiveElement.QueryInterface( &spActiveInputElement ) ) )
                        {
!                               if ( IDNO == ::MessageBox( hwndBrowser, 
!                                                                  _T("No fields have 
been selected.  Selecting or clicking in the field which contains the search "
!                                                                         "string will 
add some helpful information to the search and make "
!                                                                         "it more 
complete.\r\n\r\n"
!                                                                         "Would you 
like to continue anyway?"), 
!                                                                  _T("DQSD Search 
Wizard"), MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 ) )
!                               {
!                                       return S_OK;
!                               }
                        }
                }
***************
*** 91,92 ****
--- 132,160 ----
        return S_OK;
  }
+ 
+ CComPtr<IHTMLDocument2> CSearchWizard::GetActiveFrame( CComPtr<IHTMLDocument2>& 
+spDoc )
+ {
+       CComPtr< IHTMLElement > spActiveElement;
+       if ( SUCCEEDED( spDoc->get_activeElement( &spActiveElement ) ) && 
+spActiveElement )
+       {
+               CComQIPtr< IHTMLFrameElement > spFrameElement( spActiveElement );
+               if ( spFrameElement )
+               {
+                       CComQIPtr< IWebBrowser2 > spWebBrowser( spFrameElement );
+                       if ( spWebBrowser )
+                       {
+                               CComPtr< IDispatch > spDisp;
+                               if ( SUCCEEDED( spWebBrowser->get_Document( &spDisp ) 
+) && spDisp )
+                               {
+                                       CComPtr< IHTMLDocument2 > spFrame;
+                                       if ( SUCCEEDED( spDisp.QueryInterface( 
+&spFrame ) ) && spFrame )
+                                       {
+                                               return GetActiveFrame( spFrame );
+                                       }
+                               }
+                       }
+               }
+       }
+ 
+       return spDoc;
+ }
\ No newline at end of file

Index: SearchWizard.h
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/SearchWizard.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SearchWizard.h      12 Aug 2002 13:25:01 -0000      1.2
--- SearchWizard.h      21 Aug 2002 05:53:40 -0000      1.3
***************
*** 32,35 ****
--- 32,39 ----
        STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD 
prgCmds[], OLECMDTEXT* pCmdText);
        STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* 
pvaOut);
+ 
+ private:
+       CComPtr<IHTMLDocument2> GetActiveFrame( CComPtr<IHTMLDocument2>& spDoc );
+ 
  };
  

Index: frames.htm
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/frames.htm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** frames.htm  19 Aug 2002 19:16:02 -0000      1.1
--- frames.htm  21 Aug 2002 05:53:40 -0000      1.2
***************
*** 2,6 ****
  <frameset cols="50%, *">
  <frame src="test.htm">
! <frame src="test.htm">
  </frameset>
  </html>
--- 2,6 ----
  <frameset cols="50%, *">
  <frame src="test.htm">
! <frame src="frames2.htm">
  </frameset>
  </html>

Index: test.htm
===================================================================
RCS file: /cvsroot/dqsd/dqsd/src/DQSDSearchWiz/test.htm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test.htm    10 Aug 2002 13:11:25 -0000      1.2
--- test.htm    21 Aug 2002 05:53:40 -0000      1.3
***************
*** 5,8 ****
--- 5,9 ----
  
  <body>
+ test.htm
  <form name="form1" method="GET" action="">
  




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
DQSD-CVS mailing list
https://lists.sourceforge.net/lists/listinfo/dqsd-cvs
DQSD CVS repository:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Reply via email to