63 |
menu->AppendSeparator(); |
menu->AppendSeparator(); |
64 |
menu->Append(Menu_Quit, wxT("Quit application"), wxT("Terminates wxCpuThrottle") ); |
menu->Append(Menu_Quit, wxT("Quit application"), wxT("Terminates wxCpuThrottle") ); |
65 |
|
|
66 |
|
if (!mParent->GetWritable()) |
67 |
|
{ |
68 |
|
menu->Enable(Menu_Increase, false); |
69 |
|
menu->Enable(Menu_Decrease, false); |
70 |
|
} |
71 |
|
|
72 |
return menu; |
return menu; |
73 |
} |
} |
74 |
|
|
75 |
void TrayIcon::OnQuit( wxCommandEvent& event ) |
void TrayIcon::OnQuit( wxCommandEvent& event ) |
76 |
{ |
{ |
77 |
mParent->OnQuit(event); |
mParent->OnQuit(/*event*/); |
78 |
} |
} |
79 |
|
|
80 |
|
|
86 |
|
|
87 |
void TrayIcon::OnShowDialog( wxCommandEvent& event ) |
void TrayIcon::OnShowDialog( wxCommandEvent& event ) |
88 |
{ |
{ |
89 |
mParent->SetPosition(); |
ShowDialog(); |
|
mParent->Show( !mParent->IsShown() ); |
|
90 |
} |
} |
91 |
|
|
92 |
void TrayIcon::OnLeftClick(wxTaskBarIconEvent& WXUNUSED(event) ) |
void TrayIcon::OnLeftClick(wxTaskBarIconEvent& WXUNUSED(event) ) |
93 |
{ |
{ |
94 |
mParent->SetPosition(); |
ShowDialog(); |
|
mParent->Show( !mParent->IsShown() ); |
|
95 |
} |
} |
96 |
|
|
97 |
void TrayIcon::OnIncrease( wxCommandEvent& WXUNUSED( event ) ) |
void TrayIcon::OnIncrease( wxCommandEvent& WXUNUSED( event ) ) |
98 |
{ |
{ |
99 |
} |
AcpiParser* parser = mParent->GetParser(); |
100 |
|
int current = parser->GetCurrentState(); |
101 |
|
|
102 |
|
if (current < parser->GetStateCount() -1) |
103 |
|
parser->SetState( current +1 ); |
104 |
|
} |
105 |
|
|
106 |
void TrayIcon::OnDecrease( wxCommandEvent& WXUNUSED( event ) ) |
void TrayIcon::OnDecrease( wxCommandEvent& WXUNUSED( event ) ) |
107 |
{ |
{ |
108 |
|
AcpiParser* parser = mParent->GetParser(); |
109 |
|
int current = parser->GetCurrentState(); |
110 |
|
|
111 |
|
if ( current > 0) |
112 |
|
parser->SetState( current - 1 ); |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
void TrayIcon::ShowDialog() |
118 |
|
{ |
119 |
|
mParent->SetPosition(); |
120 |
|
mParent->Show( !mParent->IsShown() ); |
121 |
|
|
122 |
|
if (mParent->IsIconized()) |
123 |
|
mParent->Iconize( false ); |
124 |
} |
} |