]>
git.saurik.com Git - wxWidgets.git/blob - samples/taskbar/tbtest.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTaskBarIcon demo
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
23 #include "wx/msw/taskbar.h"
27 MyDialog
*dialog
= NULL
;
31 bool MyApp::OnInit(void)
33 wxIcon
icon("mondrian_icon");
35 if (!m_taskBarIcon
.SetIcon(icon
, "wxTaskBarIcon Sample"))
36 wxMessageBox("Could not set icon.");
38 // Create the main frame window
39 dialog
= new MyDialog(NULL
, -1, "wxTaskBarIcon Test Dialog", wxPoint(-1, -1), wxSize(365, 290), wxDIALOG_MODELESS
|wxDEFAULT_DIALOG_STYLE
);
46 BEGIN_EVENT_TABLE(MyDialog
, wxDialog
)
47 EVT_BUTTON(wxID_OK
, MyDialog::OnOK
)
48 EVT_BUTTON(wxID_EXIT
, MyDialog::OnExit
)
51 MyDialog::MyDialog(wxWindow
* parent
, const wxWindowID id
, const wxString
& title
,
52 const wxPoint
& pos
, const wxSize
& size
, const long windowStyle
):
53 wxDialog(parent
, id
, title
, pos
, size
, windowStyle
)
58 void MyDialog::OnOK(wxCommandEvent
& event
)
63 void MyDialog::OnExit(wxCommandEvent
& event
)
68 void MyDialog::OnCloseWindow(wxCloseEvent
& event
)
73 void MyDialog::Init(void)
75 int dialogWidth
= 365;
76 int dialogHeight
= 290;
78 wxStaticText
* stat
= new wxStaticText(this, -1, "Press OK to hide me, Exit to quit.",
81 wxStaticText
* stat2
= new wxStaticText(this, -1, "Double-click on the taskbar icon to show me again.",
84 wxButton
*okButton
= new wxButton(this, wxID_OK
, "OK", wxPoint(100, 230), wxSize(80, 25));
85 wxButton
*exitButton
= new wxButton(this, wxID_EXIT
, "Exit", wxPoint(185, 230), wxSize(80, 25));
86 okButton
->SetDefault();
91 void MyTaskBarIcon::OnMouseMove(void)
95 void MyTaskBarIcon::OnLButtonDown(void)
99 void MyTaskBarIcon::OnLButtonUp(void)
103 void MyTaskBarIcon::OnRButtonDown(void)
107 void MyTaskBarIcon::OnRButtonUp(void)
111 void MyTaskBarIcon::OnLButtonDClick(void)
116 void MyTaskBarIcon::OnRButtonDClick(void)