/** * \brief Change the state of the toggle. * \param b The new state. * \param activator The item that activates the toggle, if any. */ void bear::engine::with_toggle::toggle( bool b, base_item* activator ) { if ( b ) { if ( !is_on() ) toggle_on( activator ); } else if ( is_on() ) toggle_off( activator ); } // with_toggle::toggle()
void registerclass_scope_delayed::toggle_on(UINT p_style,WNDPROC p_wndproc,int p_clsextra,int p_wndextra,HICON p_icon,HCURSOR p_cursor,HBRUSH p_background,const TCHAR * p_class_name,const TCHAR * p_menu_name) { toggle_off(); WNDCLASS wc = {}; wc.style = p_style; wc.lpfnWndProc = p_wndproc; wc.cbClsExtra = p_clsextra; wc.cbWndExtra = p_wndextra; wc.hInstance = core_api::get_my_instance(); wc.hIcon = p_icon; wc.hCursor = p_cursor; wc.hbrBackground = p_background; wc.lpszMenuName = p_menu_name; wc.lpszClassName = p_class_name; WIN32_OP( (m_class = RegisterClass(&wc)) != 0); }