Update heartbeat.cpp to use wxWidgets functions