home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / button.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.7 KB  |  77 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. // button.h : header file
  20. //
  21.  
  22. #ifndef _BUTTON_H_
  23. #define _BUTTON_H_
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. /////////////////////////////////////////////////////////////////////////////
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CNetscapeButton Class
  29.  
  30. class CNetscapeButton: public CButton
  31. {
  32.     DECLARE_DYNAMIC(CNetscapeButton)
  33.  
  34. protected:
  35.     MWContext * m_Context;
  36.     LO_FormElementStruct * m_Form;
  37.     XP_Bool m_bDepressed;
  38.     CEdit * m_pwndEdit;
  39.     XP_Bool m_callBase;
  40.     CPaneCX * m_pPaneCX;
  41.  
  42.     // Construction
  43. public:
  44.     CNetscapeButton(MWContext * context, LO_FormElementStruct * form, CWnd* pParent = NULL);   // standard constructor
  45.     inline void RegisterForm(LO_FormElementStruct * form) { m_Form = form; }
  46.     inline void RegisterEdit(CEdit * pEdit) { m_pwndEdit = pEdit; }
  47.     inline void RegisterContext(MWContext * context)    { m_Context = context; }
  48.  
  49.     // Attributes
  50.     LO_FormElementStruct*    GetElement() const {return m_Form;}
  51.  
  52.     // needs to be seen by closure
  53.     LO_FormElementStruct *m_pLastSelectedRadio;
  54.  
  55. // Implementation
  56. protected:
  57.     CWnd      * m_Parent;
  58.  
  59.     // Generated message map functions
  60.     afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  61.     afx_msg void OnSetFocus(CWnd * pOldWnd);
  62.     afx_msg void OnKillFocus(CWnd * pNewWnd);
  63.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  64.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  65.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  66.     afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
  67.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  68.     afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  69.     DECLARE_MESSAGE_MAP()
  70.     
  71. public:
  72.     void Click(UINT nFlags, BOOL bOnChar /*= FALSE*/, BOOL &bReturnImmediately);
  73.     void OnButtonEvent(CL_EventType type, UINT nFlags, CPoint point);
  74. };
  75.  
  76. #endif /* _BUTTON_H_ */
  77.