ASSERT(Msg->ID == IPCMSG_FOCUSWINDOW);
// Don't allow the focus to be changed unless the client has the focus
- if(!gpWM_FocusedWindow) return 1;
- if(gpWM_FocusedWindow->Client != Client) return 1;
+// if(!gpWM_FocusedWindow) return 1;
+// if(gpWM_FocusedWindow->Client != Client) return 1;
win = IPC_int_GetWindow(Client, Msg->Window);
if(!win) return 1;
Window->W, (info->DispLines-i)*info->LineHeight,
info->DefaultBG
);
+
+ // TODO: Text cursor
+ if( info->CursorRow >= info->FirstVisRow && info->CursorRow < info->FirstVisRow + info->DispLines )
+ {
+ if( info->CursorCol >= info->FirstVisCol && info->CursorCol < info->FirstVisCol + info->DispCols )
+ {
+ // TODO: Kill hardcoded 8 with cached text distance
+ WM_Render_FillRect(Window,
+ (info->CursorCol - info->FirstVisCol) * 8,
+ (info->CursorRow - info->FirstVisRow) * info->LineHeight,
+ 1,
+ info->LineHeight,
+ info->DefaultFG
+ );
+ }
+ }
}
int Renderer_RichText_HandleIPC_SetAttr(tWindow *Window, size_t Len, const void *Data)
case _ATTR_DEFFG:
info->DefaultFG = msg->Value;
break;
+ case _ATTR_CURSORPOS:
+ info->CursorRow = msg->Value >> 12;
+ info->CursorCol = msg->Value & 0xFFF;
+ break;
case _ATTR_SCROLL:
// TODO: Set scroll flag
break;
if(Len < sizeof(*msg)) return -1;
info->DispLines = msg->H / info->LineHeight;
return 1; }
+ case WNDMSG_KEYDOWN:
+ case WNDMSG_KEYUP:
+ case WNDMSG_KEYFIRE:
+ return 1;
}
return 0;
}
{
struct sWndMsg_Bool _msg;
+ _SysDebug("WM_FocusWindow(%p)", Destination);
+
if( gpWM_FocusedWindow == Destination )
return ;
if( Destination && !(Destination->Flags & WINFLAG_SHOW) )