1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-11-21 23:39:26 +00:00
|
|
|
// File: wx/msw/taskbar.h
|
|
|
|
// Purpose: Defines wxTaskBarIcon class for manipulating icons on the
|
1998-05-20 14:12:05 +00:00
|
|
|
// Windows task bar.
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 24/3/98
|
|
|
|
// RCS-ID: $Id$
|
2001-11-21 23:39:26 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _TASKBAR_H_
|
|
|
|
#define _TASKBAR_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "taskbar.h"
|
|
|
|
#endif
|
|
|
|
|
2003-01-25 12:28:51 +00:00
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/icon.h"
|
|
|
|
|
|
|
|
class wxTaskBarIcon;
|
|
|
|
|
2003-01-30 01:48:11 +00:00
|
|
|
WX_DECLARE_EXPORTED_LIST(wxTaskBarIcon, wxTaskBarIconList);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2003-04-04 22:33:47 +00:00
|
|
|
class WXDLLEXPORT wxTaskBarIcon: public wxTaskBarIconBase
|
|
|
|
{
|
1998-11-22 04:20:32 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
|
1998-05-20 14:12:05 +00:00
|
|
|
public:
|
1998-11-22 04:20:32 +00:00
|
|
|
wxTaskBarIcon(void);
|
|
|
|
virtual ~wxTaskBarIcon(void);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// Accessors
|
|
|
|
inline WXHWND GetHWND() const { return m_hWnd; }
|
2003-04-04 22:33:47 +00:00
|
|
|
inline bool IsOk() const { return (m_hWnd != 0) ; }
|
1998-05-20 14:12:05 +00:00
|
|
|
inline bool IsIconInstalled() const { return m_iconAdded; }
|
|
|
|
|
|
|
|
// Operations
|
2002-12-04 14:11:26 +00:00
|
|
|
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString);
|
1998-05-20 14:12:05 +00:00
|
|
|
bool RemoveIcon(void);
|
1998-12-11 05:56:40 +00:00
|
|
|
bool PopupMenu(wxMenu *menu); //, int x, int y);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2003-04-04 22:33:47 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_2_4
|
|
|
|
wxDEPRECATED( bool IsOK() const );
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
// Overridables
|
1998-11-22 04:20:32 +00:00
|
|
|
virtual void OnMouseMove(wxEvent&);
|
|
|
|
virtual void OnLButtonDown(wxEvent&);
|
|
|
|
virtual void OnLButtonUp(wxEvent&);
|
|
|
|
virtual void OnRButtonDown(wxEvent&);
|
|
|
|
virtual void OnRButtonUp(wxEvent&);
|
|
|
|
virtual void OnLButtonDClick(wxEvent&);
|
|
|
|
virtual void OnRButtonDClick(wxEvent&);
|
2003-04-04 22:33:47 +00:00
|
|
|
#endif
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// Implementation
|
|
|
|
static wxTaskBarIcon* FindObjectForHWND(WXHWND hWnd);
|
|
|
|
static void AddObject(wxTaskBarIcon* obj);
|
|
|
|
static void RemoveObject(wxTaskBarIcon* obj);
|
|
|
|
static bool RegisterWindowClass();
|
|
|
|
static WXHWND CreateTaskBarWindow();
|
|
|
|
long WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam );
|
|
|
|
|
|
|
|
// Data members
|
|
|
|
protected:
|
|
|
|
WXHWND m_hWnd;
|
|
|
|
bool m_iconAdded;
|
2003-05-01 20:49:34 +00:00
|
|
|
wxIcon m_icon;
|
|
|
|
wxString m_strTooltip;
|
|
|
|
|
2003-01-25 12:28:51 +00:00
|
|
|
static wxTaskBarIconList sm_taskBarIcons;
|
1998-11-22 04:20:32 +00:00
|
|
|
|
2003-04-04 22:33:47 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_2_4
|
1998-12-11 05:56:40 +00:00
|
|
|
// non-virtual default event handlers to forward events to the virtuals
|
|
|
|
void _OnMouseMove(wxEvent&);
|
|
|
|
void _OnLButtonDown(wxEvent&);
|
|
|
|
void _OnLButtonUp(wxEvent&);
|
|
|
|
void _OnRButtonDown(wxEvent&);
|
|
|
|
void _OnRButtonUp(wxEvent&);
|
|
|
|
void _OnLButtonDClick(wxEvent&);
|
|
|
|
void _OnRButtonDClick(wxEvent&);
|
|
|
|
|
1998-11-25 12:01:23 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2003-04-04 22:33:47 +00:00
|
|
|
#endif
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2003-04-04 22:33:47 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_2_4
|
|
|
|
inline bool wxTaskBarIcon::IsOK() const { return IsOk(); }
|
|
|
|
#endif
|
1998-12-11 05:56:40 +00:00
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
// _TASKBAR_H_
|
|
|
|
|
1998-11-22 04:20:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|