Exemplo n.º 1
0
void
Widget::refocus(void)
{
	// Focus this window
	focused = true;
	on_focus();
}
Exemplo n.º 2
0
void UIWidget::mouse_down_func()
{
   if (disabled) return;

   // call this function on the children first
   for (auto &child : ElementID::recast_collection<UIWidget>(get_children()))
      child->mouse_down_func();

   // now do the execution of the function
   if (mouse_over)
   {
      mouse_down_on_over = true;
      on_mouse_down();
      focused = true;
      on_focus();
   }
   else
   {
      if (focused)
      {
         focused = false;
         on_blur();
      }
   }
}
Exemplo n.º 3
0
void Viewport::set_focus(bool value){	
	if(value == true){
		if(_focus == false){ on_focus(); }
	} else{
		if(_focus == true){ off_focus(); }
	}
	_focus = value;
	wrappee->set_focus(value);
}
Exemplo n.º 4
0
// iterates through all siblings and sets all parent's children to unfocused.
// if the widget is not already focused, then set to focused and on_focus() is called
void UIWidget::set_as_focused()
{
   if (disabled) return;

   // TODO: this will need to "unfocus" all other elements in the tree

   if (!is_focused())
   {
      focused=true;
      on_focus();
   }
}
Exemplo n.º 5
0
 virtual BOOL handle_focus(HELEMENT he, FOCUS_PARAMS &params)
 {
     return on_focus(he, params.target, params.cmd);
 }
Exemplo n.º 6
0
void kWindow::OnSetFocus(CWnd* )
{
 set_focused();
 on_focus();
}