void CAbstractTextEdit::OnButtonClick(int X, int Y, int Button, int Count)
{
	if(Button != KEY_MOUSE_1)
		return;
	
	if(m_DrawRect.IsInside(X, Y))
	{
		if(!m_Focus)
			OnFocusIn();
		
		m_TextCursor = TextRenderer()->GetTextCursorFromPosition(&m_TextCache, GetTextPosition(), ivec2(X, Y));
	}
	else if(m_Focus)
		OnFocusOut();
}
Beispiel #2
0
void Window::Update(void)
{
	XEvent event;

	// Obtenemos y procesamos los eventos de ventana
	long mascaraWindow = EnterWindowMask | LeaveWindowMask | FocusChangeMask | ResizeRedirectMask ; 
	while (XCheckMaskEvent(Small::Window::Instance().dpy,  mascaraWindow, &event))
	{
		switch(event.type)
		{
			case FocusIn:
				OnFocusIn();
				break;
			case FocusOut:
				OnFocusOut();
				break;
			case ConfigureNotify:
				OnResize(event.xconfigure.width, event.xconfigure.height);
				break;
		};
	};
};