MCPcopy Create free account
hub / github.com/cmauri/eviacam / SetClickMode

Method SetClickMode

src/pointeraction.cpp:266–306  ·  view source on GitHub ↗

Return true is the change has been applied, or false otherwise

Source from the content-addressed store, hash-verified

264
265// Return true is the change has been applied, or false otherwise
266bool CPointerAction::SetClickMode(CPointerAction::EClickMode mode, bool silent, wxWindow* parent)
267{
268 if (mode!= m_clickMode) {
269 if (!silent) {
270 if (mode== CPointerAction::NONE) {
271 wxMessageDialog dlg (parent, _("This action will disable eViacam click generation.\nAre you sure?"), _T("Enable Viacam"), wxICON_EXCLAMATION | wxYES_NO );
272 if (dlg.ShowModal()!= wxID_YES) return false;
273 }
274 else {
275 wxMessageDialog dlg (parent, _("This action will change the click generation method.\nAre you sure?"), _T("Enable Viacam"), wxICON_EXCLAMATION | wxYES_NO );
276 if (dlg.ShowModal()!= wxID_YES) return false;
277 }
278 }
279
280 switch (mode) {
281 case CPointerAction::NONE:
282 // Disable dwell and gesture click
283 m_pGestureClick->SetEnabled(false);
284 m_pDwellClick->SetEnabled(false);
285 break;
286 case CPointerAction::DWELL:
287 // disable gesture click if enabled
288 m_pGestureClick->SetEnabled(false);
289 // Enable dwell click
290 if (m_enabled) m_pDwellClick->SetEnabled(true);
291 break;
292 case CPointerAction::GESTURE:
293 // Enable gesture click
294 m_pDwellClick->SetEnabled(false);
295 // enable gesture click
296 if (m_enabled) m_pGestureClick->SetEnabled(true);
297 break;
298 default:
299 assert (false);
300 break;
301 }
302 m_clickMode= mode;
303 }
304
305 return true;
306}
307
308void CPointerAction::ResetCounters()
309{

Calls 1

SetEnabledMethod · 0.45

Tested by

no test coverage detected