MCPcopy Create free account
hub / github.com/TankOs/SFGUI / GrabFocus

Method GrabFocus

src/SFGUI/Widget.cpp:102–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void Widget::GrabFocus( Ptr widget ) {
103 // Notify old focused widget.
104 if( focus_widget.lock() ) {
105 focus_widget.lock()->GetSignals().Emit( OnLostFocus );
106 focus_widget.lock()->HandleFocusChange( widget );
107 }
108
109 focus_widget = widget;
110
111 if( focus_widget.lock() ) {
112 focus_widget.lock()->GetSignals().Emit( OnGainFocus );
113 focus_widget.lock()->HandleFocusChange( widget );
114 }
115}
116
117bool Widget::HasFocus( PtrConst widget ) {
118 if( focus_widget.lock() == widget ) {

Callers

nothing calls this directly

Calls 2

EmitMethod · 0.80
HandleFocusChangeMethod · 0.45

Tested by

no test coverage detected