home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / navbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  78 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. #ifndef NAVMENUBAR_H
  20. #define NAVMENUBAR_H
  21.  
  22. #include "htrdf.h"
  23. #include "usertlbr.h"
  24.  
  25. #define NAVBAR_HEIGHT 23
  26. #define NAVBAR_CLOSEBOX    15
  27.  
  28. class CSelectorButton;
  29.  
  30. class CNavMenuButton : public CLinkToolbarButton
  31. {
  32. protected:
  33.     HT_View m_HTView; // Pointer to HT_View if one exists.
  34.     
  35. public:
  36.     CNavMenuButton();
  37.  
  38.     void UpdateView(HT_View v);
  39.     void UpdateButtonText(CRect target);
  40.  
  41.     afx_msg LRESULT OnDragMenuOpen(WPARAM wParam, LPARAM lParam);
  42.     afx_msg BOOL OnCommand(UINT wParam, LONG lParam);
  43.  
  44.     DECLARE_MESSAGE_MAP()
  45. };
  46.  
  47.  
  48. class CNavMenuBar : public CWnd
  49. {
  50.     CNavMenuButton* m_pMenuButton;    // Pointer to the button
  51.     CSelectorButton* m_pSelectorButton; // Selector button
  52.     BOOL m_bHasFocus;    // Determines what colors to use for the caption
  53.     CPoint m_PointHit;    // MouseDown tracking
  54.  
  55. public:
  56.     CNavMenuBar();
  57.     ~CNavMenuBar();
  58.  
  59.     void UpdateView(CSelectorButton* pButton, HT_View view); 
  60.     void NotifyFocus(BOOL hasFocus) { m_bHasFocus = hasFocus; Invalidate(); }
  61.  
  62.     //{{AFX_MSG(CNavMenuBar)
  63.     
  64.         // NOTE - the ClassWizard will add and remove member functions here.
  65.         //    DO NOT EDIT what you see in these blocks of generated code!
  66.     afx_msg void OnPaint();
  67.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  68.     afx_msg void OnLButtonDown (UINT nFlags, CPoint point );
  69.     afx_msg void OnLButtonUp (UINT nFlags, CPoint point );
  70.     afx_msg void OnMouseMove (UINT nFlags, CPoint point );
  71.     afx_msg void OnSize( UINT nType, int cx, int cy );
  72.     //}}AFX_MSG
  73.     DECLARE_MESSAGE_MAP()
  74. };
  75.  
  76. #endif // NAVBAR_H
  77.  
  78.