[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [glob2-devel] hopefully a simple thing to add
From: |
Leo Wandersleb |
Subject: |
Re: [glob2-devel] hopefully a simple thing to add |
Date: |
Mon, 02 Jan 2006 09:29:22 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.7 (X11/20050923) |
i'm working on that right now. i suggest to first check for
relevant nicks and then for other words if that's wanted.
i had to modify GUITextInput.h.
added void setCursorPos(size_t pos){cursPos=pos;};
as setText sets the cursor position to 0 what is very
unconvinient when typeing a nick.
did i use it in some wrong way or can i savely add
setCursorPos(text.length()) to the end of setText? or maybe
remove cursPos=0 from its beginning?
greetings, Leo Wandersleb
p.s.: so far i have added the following very ugly codelines
to YOGScreen.cpp:221. it's not finished and most likely it
will not even compile as i didn't compile for several
changes now. :
else if (action==TEXT_MODIFIED)
{
std::string message = textInput->getText();
int i=message.length()-1;
if ((message[i] == 9 ))
{
message=message.substr(0,message.length()-1);
std::string beginningOfNick;
beginningOfNick=message[i-1];
bool noWhiteSpace=true;
while((i>0) && noWhiteSpace)
{
if(message[--i] != " ")
beginningOfNick=message[--i]+beginningOfNick;
else
noWhiteSpace=false;
}
std::string foundNick;
for (std::list<YOG::Client>::iterator
client=yog->clients.begin(); client!=yog->clients.end();
++client)
{
if(client->userName.find(beginnigOfNick,0))
{
foundNick=client->userName;
message += " " + foundNick;
}
}
message += " hallo";
textInput->setText(message);
textInput->setCursorPos(message.length());
//yog->sendMessage(textInput->getText());
//irc.sendCommand(textInput->getText());
}
}
Kyle Lutze wrote:
Stéphane Magnenat wrote:
On Sunday 01 January 2006 18:16, Kyle Lutze wrote:
how hard would it be to add tab completion in the lounge?
Not that hard. But making it clean is not completly trivial. If you
want to do so, I suggest adding a list of autocompletable words in the
TextInput object (libgag/include/GUITextInput.h and
libgag/src/GUITextInput.cpp). When a tab is pressed, the text input
should look if the letters before the cursor down to a space or a tab
correspond to a word in the autocompletion list. If so, those letters
should be replaced by the word. If not, the tab character should be
added. If the letters correspond exactly to the word (i.e. the word is
already there), a tab should be inserted.
If everyone want it and I get some time, I can add it later, when I've
finish working on a color themed and bitmapped GUI (what I'm doing now).
Steph
err, I meant tab completion for nicks, aka, if I type app and press tab,
appleboy would show :)
_______________________________________________
glob2-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/glob2-devel
--
Dipl.-Math. Univ.
Leo Wandersleb
Kolumbusstr.2
81543 München
Tel.: 0179-7748888