home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / BookmarksDialogs.cp next >
Encoding:
Text File  |  1998-04-08  |  2.8 KB  |  89 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "BookmarksDialogs.h"
  20. #include "PascalString.h"
  21. #include "macutil.h"
  22. #include "uapp.h"
  23.  
  24. CBookmarksFindDialog *CBookmarksFindDialog::sFindDialog = NULL;
  25.  
  26.  
  27. //===========================================================
  28. // CBookmarksFindDialog
  29. //===========================================================
  30. CBookmarksFindDialog::CBookmarksFindDialog( LStream* inStream ): LDialogBox( inStream )
  31. {
  32.     sFindDialog = this;
  33. }
  34.  
  35. CBookmarksFindDialog::~CBookmarksFindDialog()
  36. {
  37.     sFindDialog = NULL;
  38. }
  39.  
  40. void CBookmarksFindDialog::FinishCreateSelf()
  41. {
  42.     LDialogBox::FinishCreateSelf();
  43.     fCheckName = (LStdCheckBox*)this->FindPaneByID( 'Cnam' );
  44.     fCheckLocation = (LStdCheckBox*)this->FindPaneByID( 'Cloc' );
  45.     fCheckDescription = (LStdCheckBox*)this->FindPaneByID( 'Cdes' );
  46.     fMatchCase = (LStdCheckBox*)this->FindPaneByID( 'Ccas' );
  47.     fWholeWord = (LStdCheckBox*)this->FindPaneByID( 'Cwor' );
  48.     
  49.     fFindText = (LEditField*)this->FindPaneByID( 'Efnd' );
  50. }
  51.  
  52.  
  53. void CBookmarksFindDialog::ListenToMessage( MessageT inMessage, void* ioParam )
  54. {
  55.     switch ( inMessage )
  56.     {
  57.         case msg_OK:
  58.         {
  59. #if 0
  60. // THIS IS JUST LEFT HERE AS AN EXAMPLE OF HOW TO PULL THE RESULTS OUT OF
  61. // THE CONTROLS. THIS USES THE DEPRICATED BOOKMARKS API AND WILL BE REWRITTEN.
  62.             CStr255        tmp;
  63.             
  64.             fFindText->GetDescriptor( tmp );
  65.             if ( fFindInfo->textToFind )
  66.             {
  67.                 XP_FREE( fFindInfo->textToFind );
  68.                 fFindInfo->textToFind = NULL;
  69.             }
  70.             NET_SACopy( &fFindInfo->textToFind, tmp );
  71.             fFindInfo->checkName = fCheckName->GetValue();
  72.             fFindInfo->checkLocation = fCheckLocation->GetValue();
  73.             fFindInfo->checkDescription = fCheckDescription->GetValue();
  74.             fFindInfo->matchCase = fMatchCase->GetValue();
  75.             fFindInfo->matchWholeWord = fWholeWord->GetValue();
  76.             BM_DoFindBookmark( fContext, fFindInfo );
  77. #endif
  78.             ListenToMessage( cmd_Close, ioParam );
  79.         }
  80.         break;
  81.         case msg_Cancel:
  82.             ListenToMessage( cmd_Close, ioParam );
  83.         break;
  84.         default:
  85.             LDialogBox::ListenToMessage( inMessage, ioParam );
  86.         break;
  87.     }
  88. }
  89.