Get usernick from userlist into context menu?

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Ferus
Posts: 29
Joined: 2003-11-12 14:57
Location: Sthlm, Sweden

Get usernick from userlist into context menu?

Post by Ferus » 2003-11-21 13:27

I had an idea while twisting around in bed last night... to make it clear, this is what I want:

E.g. Let's say I right-clik user [ADSL]Annoyer in the userlist and the context menu appears... in the context menu, I have an "ignore user"/"Unignore user" alternative. Instead of "Ignore user" i'd like to grab the marked usernick into the context menu so it says "ignore [ADSL]Annoyer" instead. Just a neat GUI look & feel feature, but nice I thought, and i'm determined to find out how.

But if there is a soul out there, willing to supply me with the necassery need-to-knows for the implementation of this, I'd be very greatful.

Some codesnippets would be awesome... and what files that are concerned etc.

EDIT::forgot to mention, still dancing in the .PDC++ project :)

Regards,

Ferus

Twink
Posts: 436
Joined: 2003-04-01 04:31
Location: New Zealand

Post by Twink » 2003-11-21 21:53

yeah that's possible, what what would you do if multiple ppl are selected

Ferus
Posts: 29
Joined: 2003-11-12 14:57
Location: Sthlm, Sweden

Post by Ferus » 2003-11-21 22:24

add an IF statement that would make it say only "ingore users"

yeah that's possible


ok shoot....

Twink
Posts: 436
Joined: 2003-04-01 04:31
Location: New Zealand

Post by Twink » 2003-11-21 22:39

so maybe

Code: Select all

      string user = (ctrlUsers.GetSelectedCount() > 1) ? " Users" : " " + (((UserInfo*)ctrlUsers.GetItemData(ctrlUsers.GetNextItem(-1, LVNI_SELECTED)))->user)->getNick();            
      userMenu.ModifyMenu(IDC_IGNORE, MF_BYCOMMAND, IDC_IGNORE,(CSTRING(IGNORE_USER) + user).c_str());
      userMenu.ModifyMenu(IDC_UNIGNORE, MF_BYCOMMAND, IDC_UNIGNORE,(CSTRING(UNIGNORE_USER) + user).c_str());


before the line
prepareMenu(userMenu, UserCommand::CONTEXT_CHAT, client->getServer(), client->getOp());

in hubframe.cpp ?

Ferus
Posts: 29
Joined: 2003-11-12 14:57
Location: Sthlm, Sweden

Post by Ferus » 2003-11-21 23:09

Marvellous!!

Many thanks to you, Twink :)

Who is online

Users browsing this forum: Google [Bot] and 0 guests