home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / animbar2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  113 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 _ANIMBAR2_H
  20. #define _ANIMBAR2_H
  21.  
  22. #include "apicx.h"
  23.  
  24. class CAnimation2: public CWnd
  25. {
  26. protected:
  27.     LPMWCONTEXT m_pIMWContext;
  28.  
  29.     SIZE m_iconSize;
  30.     int m_iFrameCount;
  31.  
  32.     HBITMAP m_hAnimBitmap;
  33.     int m_iAnimationCount;
  34.     UINT m_uAnimationClock;
  35.     BOOL m_bInited;
  36.     BOOL m_bCaptured, m_bDepressed;
  37.  
  38.     static HBITMAP m_hSmall;
  39.     static HBITMAP m_hBig;
  40.  
  41.     static ULONG m_uRefCount;
  42.     CNSToolTip2 m_ToolTip;
  43.     BOOL m_bHaveFocus;
  44.     UINT m_hFocusTimer;
  45.  
  46. protected:
  47.     void AnimateIcon();
  48.  
  49. public:
  50.     CAnimation2( CWnd *pParent, LPUNKNOWN pUnk = NULL);
  51.     ~CAnimation2();
  52.     
  53.     void StopAnimation();
  54.     void StartAnimation();
  55.  
  56.     void Initialize( LPUNKNOWN pUnk);
  57.     
  58.     void SetBitmap( BOOL bSmall = TRUE );
  59.     HBITMAP GetBitmap( BOOL bSmall = TRUE );    
  60.  
  61.     void GetSize( CSize &size );
  62.     void RemoveButtonFocus();
  63.  
  64. protected:
  65.     afx_msg BOOL OnEraseBkgnd( CDC* pDC );
  66.     afx_msg void OnPaint();
  67.     afx_msg void OnTimer(UINT);
  68.     afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
  69.     afx_msg void OnMouseMove( UINT nFlags, CPoint point );
  70.     afx_msg void OnLButtonUp( UINT nFlags, CPoint point );
  71.     afx_msg void OnDestroy();
  72.     afx_msg BOOL OnSetCursor( CWnd *, UINT, UINT );
  73.     
  74.     DECLARE_MESSAGE_MAP()
  75. };
  76.  
  77. #define CAnimationBar2Parent CWnd
  78.  
  79. class CAnimationBar2: public CAnimationBar2Parent
  80. {
  81. protected:
  82.     LPUNKNOWN m_pUnk;
  83.     POINT m_iconPt;
  84.     CAnimation2 *m_wndAnimation;
  85.  
  86. public:
  87.     CAnimationBar2(LPUNKNOWN pUnk = NULL);
  88.     ~CAnimationBar2();
  89.  
  90.     void StopAnimation();
  91.     void StartAnimation();
  92.  
  93.     void Initialize( LPUNKNOWN pUnk);
  94.  
  95.     void SetBitmap( BOOL bSmall = TRUE ) { m_wndAnimation->SetBitmap( bSmall ); }
  96.     
  97.     void GetSize( CSize &size, BOOL bSmall = TRUE );
  98.     
  99. protected:
  100. #ifdef XP_WIN32
  101. // Attributes
  102. //    virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  103. #endif
  104.  
  105.     afx_msg int OnCreate( LPCREATESTRUCT lpCreateStruct );
  106.     afx_msg void OnSize( UINT nType, int cx, int cy );
  107.     afx_msg BOOL OnEraseBkgnd( CDC* pDC );
  108.     DECLARE_MESSAGE_MAP()
  109. };
  110.  
  111.  
  112. #endif
  113.