home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / navigate.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.6 KB  |  100 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. //
  20. // Handle navigation specific tasks in the frame
  21. //
  22.  
  23. #include "stdafx.h"
  24.  
  25. #include "mainfrm.h"
  26. #include "prefapi.h"
  27. /////////////////////////////////////////////////////////////////////////////
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Handle and give visual cues to user about forward and back
  30. //
  31.  
  32. //
  33. // Pull up the Netscape Communications Home Page
  34. //
  35. void CMainFrame::OnNetscapeHome()
  36. {
  37.     if(GetMainContext())    {
  38.         GetMainContext()->NormalGetUrl("http://home.netscape.com/");
  39.     }
  40. }
  41.  
  42. void CMainFrame::LoadShortcut(int iShortcutID)
  43. {
  44.     char * url=NULL;
  45.     int bOK = PREF_CopyIndexConfigString("toolbar.places.item",iShortcutID, "url",&url);
  46.     if (bOK == PREF_NOERROR) {
  47.         if(GetMainContext())    {
  48.             GetMainContext()->NormalGetUrl(url);
  49.         }
  50.     }
  51.     if (url) XP_FREE(url);
  52. }
  53.  
  54. // If you click the guide button it will load a default url.
  55. // If you hold it down it will display a menu
  56. void CMainFrame::OnGuide()
  57. {
  58.     char * url=NULL;
  59.     int bOK = PREF_CopyConfigString("toolbar.places.default_url",&url);
  60.     if (bOK == PREF_NOERROR) {
  61.         if(GetMainContext())    {
  62.             GetMainContext()->NormalGetUrl(url);
  63.         }
  64.     }
  65.     if (url) XP_FREE(url);
  66. }
  67.  
  68. //
  69. // Load a local help file
  70. //
  71. void CMainFrame::OnLocalHelp()
  72. {
  73.     if(GetMainContext())    {
  74.         CString file;
  75.       
  76.         file = theApp.GetProfileString("Main", "Local Help File", szLoadString(IDS_LOCAL_HELP));
  77.         GetMainContext()->NormalGetUrl(file);
  78.     }
  79. }
  80.  
  81. //
  82. // Goto hardcoded security page
  83. //                             
  84. void CMainFrame::OnHelpSecurity()
  85. {
  86.     if(GetMainContext())    {
  87.           GetMainContext()->NormalGetUrl(szLoadString(IDS_HELP_SECURITY));
  88.     }
  89. }
  90.  
  91. //
  92. // show hardcoded plugins help page
  93. //                             
  94. void CMainFrame::OnAboutPlugins()
  95. {
  96.     if(GetMainContext())    {
  97.           GetMainContext()->NormalGetUrl(szLoadString(IDS_ABOUT_PLUGINS));
  98.     }
  99. }
  100.