Winboard and 'cls'

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Winboard and 'cls'

Postby xcomponent » 05 Mar 2010, 14:28

Hello, Friends!
I'm sorry if this is a stupid question, but is there any way to clear my ICS Interaction window, something like the ics 'cls' command trough winboard?
Thanks!
xcomponent
 
Posts: 10
Joined: 12 Apr 2009, 08:21

Re: Winboard and 'cls'

Postby matematiko » 05 Mar 2010, 15:30

xcomponent,

This request has been asked before, for more info you can read the last post on the first page and subsequent posts in the second page of this topic:
http://www.open-aurec.com/wbforum/viewtopic.php?f=2&t=50751

Cheers,
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas

Re: Winboard and 'cls'

Postby xcomponent » 05 Mar 2010, 16:21

Ok, thanks, it seems that i have to make a workaround.
xcomponent
 
Posts: 10
Joined: 12 Apr 2009, 08:21

Re: Winboard and 'cls'

Postby xcomponent » 05 Mar 2010, 18:53

Ok, here's the 'workaround' i made :)
It's a bit stupid, but works perfectly.

Code: Select all
#include <windows.h>
#include <Richedit.h>

int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR lpCmd,int nShow)
{
   HWND hwnd,hwndChild;
   char title[64];
   
   if((hwnd = FindWindow("WBConsole",NULL)) != INVALID_HANDLE_VALUE)
   {   //security check
      GetWindowText(hwnd, title, 64);
      if(strstr(title, "I C S Interaction:"))
      {   //the ICS interaction is the 1st child, so no worries:
         hwndChild = FindWindowEx(hwnd, NULL, "RICHEDIT", 0);
         //SetWindowText it's not going to work, it lacks the invoke of DefWindowProc()!
         SendMessage(hwndChild,WM_SETTEXT,0,(LPARAM)"");
         //Without invalidation, DefWindowProc() of the child will not update the buffer,so:
         InvalidateRect(hwndChild,0,TRUE);
      }
   }
   return 0;
}


here's a link:
[url]
http://pawny.netii.net/cls.zip
[/url]
xcomponent
 
Posts: 10
Joined: 12 Apr 2009, 08:21

Re: Winboard and 'cls'

Postby mocha1961 » 06 Mar 2010, 01:13

xcomponent wrote:Ok, here's the 'workaround' i made :)
It's a bit stupid, but works perfectly.

Code: Select all
#include <windows.h>
#include <Richedit.h>

int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR lpCmd,int nShow)
{
   HWND hwnd,hwndChild;
   char title[64];
   
   if((hwnd = FindWindow("WBConsole",NULL)) != INVALID_HANDLE_VALUE)
   {   //security check
      GetWindowText(hwnd, title, 64);
      if(strstr(title, "I C S Interaction:"))
      {   //the ICS interaction is the 1st child, so no worries:
         hwndChild = FindWindowEx(hwnd, NULL, "RICHEDIT", 0);
         //SetWindowText it's not going to work, it lacks the invoke of DefWindowProc()!
         SendMessage(hwndChild,WM_SETTEXT,0,(LPARAM)"");
         //Without invalidation, DefWindowProc() of the child will not update the buffer,so:
         InvalidateRect(hwndChild,0,TRUE);
      }
   }
   return 0;
}


here's a link:
[url]
http://pawny.netii.net/cls.zip
[/url]



how will you input this in the winboard ini to work....just curious
mocha1961
 
Posts: 12
Joined: 08 Jan 2010, 00:31

Re: Winboard and 'cls'

Postby xcomponent » 06 Mar 2010, 08:01

No, just click it and the Interaction window gets cleared. That's it.
xcomponent
 
Posts: 10
Joined: 12 Apr 2009, 08:21

Re: Winboard and 'cls'

Postby mocha1961 » 06 Mar 2010, 15:12

xcomponent wrote:No, just click it and the Interaction window gets cleared. That's it.


my ics window got cleared once but not always.
mocha1961
 
Posts: 12
Joined: 08 Jan 2010, 00:31

Re: Winboard and 'cls'

Postby H.G.Muller » 06 Mar 2010, 23:48

I think it should be trivial to declare the text-edit of the consoleuser-writable, rather than read-only, in the winboard.rc file. In that case you could clear it by Ctrl+A plus <Del>. And you could do much, much more, like drawing an ASCII picture of yourself.

The question could of course be: why would you want to?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard and 'cls'

Postby xcomponent » 07 Mar 2010, 08:12

H.G.Muller wrote:I think it should be trivial to declare the text-edit of the consoleuser-writable, rather than read-only, in the winboard.rc file. In that case you could clear it by Ctrl+A plus <Del>. And you could do much, much more, like drawing an ASCII picture of yourself.

The question could of course be: why would you want to?


But I like it read only. Besides, i don't want to recompile every time new version comes out. The thing is, that after couple of days online it gets filled badly and since clear window add is not planned, this is my personal solution and i like it - easy and separate.
xcomponent
 
Posts: 10
Joined: 12 Apr 2009, 08:21

Re: Winboard and 'cls'

Postby H.G.Muller » 07 Mar 2010, 10:08

Clearing is a form of writing, so you do NOT want it write-only. I stil think that making it editable is the most flexible solution, as it allows easy total clearing by two keystrokes, and would also allow selective clearing.

To solve the problem you have (accumulating output over many days) it would be much more logical to put a user-specifyable limit to the number of lines in the text field, and then automatically delete lines at the top when this size gets exceeded.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 8 guests