]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/taskbar.cpp
1 /////////////////////////////////////////////////////////////////////////
3 // Purpose: Implements wxTaskBarIcon class for manipulating icons on
5 // Author: Julian Smart
6 // Modified by: Vaclav Slavik
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////
13 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
14 #pragma implementation "taskbar.h"
17 // For compilers that support precompilation, includes "wx.h".
18 #include "wx/wxprec.h"
26 #include "wx/window.h"
32 #if defined(__WIN95__)
35 #include "wx/taskbar.h"
37 #if WXWIN_COMPATIBILITY_2_4
38 BEGIN_EVENT_TABLE(wxTaskBarIcon
, wxTaskBarIconBase
)
39 EVT_TASKBAR_MOVE (wxTaskBarIcon::_OnMouseMove
)
40 EVT_TASKBAR_LEFT_DOWN (wxTaskBarIcon::_OnLButtonDown
)
41 EVT_TASKBAR_LEFT_UP (wxTaskBarIcon::_OnLButtonUp
)
42 EVT_TASKBAR_RIGHT_DOWN (wxTaskBarIcon::_OnRButtonDown
)
43 EVT_TASKBAR_RIGHT_UP (wxTaskBarIcon::_OnRButtonUp
)
44 EVT_TASKBAR_LEFT_DCLICK (wxTaskBarIcon::_OnLButtonDClick
)
45 EVT_TASKBAR_RIGHT_DCLICK (wxTaskBarIcon::_OnRButtonDClick
)
50 IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon
, wxEvtHandler
)
52 // ============================================================================
54 // ============================================================================
56 // ----------------------------------------------------------------------------
57 // wxTaskBarIconWindow: helper window
58 // ----------------------------------------------------------------------------
60 // NB: this class serves two purposes:
61 // 1. win32 needs a HWND associated with taskbar icon, this provides it
62 // 2. we need wxTopLevelWindow so that the app doesn't exit when
63 // last frame is closed but there still is a taskbar icon
64 class wxTaskBarIconWindow
: public wxFrame
67 wxTaskBarIconWindow(wxTaskBarIcon
*icon
)
68 : wxFrame(NULL
, wxID_ANY
, wxEmptyString
, wxDefaultPosition
, wxDefaultSize
, 0),
73 WXLRESULT
MSWWindowProc(WXUINT msg
,
74 WXWPARAM wParam
, WXLPARAM lParam
)
80 wxTaskBarIcon
*m_icon
;
83 // ----------------------------------------------------------------------------
85 // ----------------------------------------------------------------------------
87 wxTaskBarIcon::wxTaskBarIcon()
91 wxTaskBarIcon::~wxTaskBarIcon()
96 bool wxTaskBarIcon::SetIcon(const wxIcon
& icon
, const wxString
& tooltip
)
101 bool wxTaskBarIcon::RemoveIcon()
106 bool wxTaskBarIcon::PopupMenu(wxMenu
*menu
)
111 #if WXWIN_COMPATIBILITY_2_4
113 void wxTaskBarIcon::OnMouseMove(wxEvent
& e
) { e
.Skip(); }
114 void wxTaskBarIcon::OnLButtonDown(wxEvent
& e
) { e
.Skip(); }
115 void wxTaskBarIcon::OnLButtonUp(wxEvent
& e
) { e
.Skip(); }
116 void wxTaskBarIcon::OnRButtonDown(wxEvent
& e
) { e
.Skip(); }
117 void wxTaskBarIcon::OnRButtonUp(wxEvent
& e
) { e
.Skip(); }
118 void wxTaskBarIcon::OnLButtonDClick(wxEvent
& e
) { e
.Skip(); }
119 void wxTaskBarIcon::OnRButtonDClick(wxEvent
& e
) { e
.Skip(); }
121 void wxTaskBarIcon::_OnMouseMove(wxTaskBarIconEvent
& e
)
123 void wxTaskBarIcon::_OnLButtonDown(wxTaskBarIconEvent
& e
)
124 { OnLButtonDown(e
); }
125 void wxTaskBarIcon::_OnLButtonUp(wxTaskBarIconEvent
& e
)
127 void wxTaskBarIcon::_OnRButtonDown(wxTaskBarIconEvent
& e
)
128 { OnRButtonDown(e
); }
129 void wxTaskBarIcon::_OnRButtonUp(wxTaskBarIconEvent
& e
)
131 void wxTaskBarIcon::_OnLButtonDClick(wxTaskBarIconEvent
& e
)
132 { OnLButtonDClick(e
); }
133 void wxTaskBarIcon::_OnRButtonDClick(wxTaskBarIconEvent
& e
)
134 { OnRButtonDClick(e
); }
137 void wxTaskBarIcon::RegisterWindowMessages()
141 // ----------------------------------------------------------------------------
142 // wxTaskBarIcon window proc
143 // ----------------------------------------------------------------------------
145 long wxTaskBarIcon::WindowProc(unsigned int msg
,
146 unsigned int WXUNUSED(wParam
),