add function of hideControlPanel and showControlPanel, and fix indents