mIRC Homepage

Combo box help needed please

Posted By: OzExcalibur

Combo box help needed please - 12/06/08 03:31 AM

I am trying to make a drop down combo box and when I click on a category it opens up the page in mIRC, I am just having trouble with the sclick code...

The combo box...
Code:
  combo 10, 10 41 40 100, drop



To populate the combo box...
Code:
alias view.cat {
  did -a connx 10 Computing
  did -a connx 10 City Chats
  did -a connx 10 Fun & Games
  did -a connx 10 General
  did -a connx 10 Interests
  did -a connx 10 Lifestyles
  did -a connx 10 News
  did -a connx 10 Peers
  did -a connx 10 Religion
  did -a connx 10 Roleplay
  did -a connx 10 Romance
  did -a connx 10 Sports
  did -a connx 10 Teens
}


What I want to happen on a click in the combo box is it will list the categories for that chat network.

The alias to open the categories is /_list

Code:
alias _list {
  var %dll = $+(",$mircdirdlls\nHTMLn_2.95.dll")
  var %cat = $+(http://www.network.net/category.php?cat=,$1)
  if ($window(@CHATRoomList)) { window -c @CHATRoomList }
  window -pk0 @CHATRoomList
  echo -a $dll(%dll,attach,$window(@CHATRoomList).hwnd)
  echo -a $dll(%dll,handler,_list.handler)
  echo -a $dll(%dll,navigate,%cat)
}



So e.g. to open the Computing category the alias is /_list CP, to open the City Chats category is /_list CC etc etc

I *think* it needs to look something like this...
Code:
on *:dialog:connx:sclick:10: { did -c connx 10 $computing $did(10) /_list CP }


But I am lost, I have tried a hundred different ideas, and nothing is working for me.

TIA for any help.
Posted By: RusselB

Re: Combo box help needed please - 12/06/08 06:19 AM

You need another location where the category codes are stored, as the combobox only shows the category names. There are many ways of doing this, and you may already have it.

Presuming that you create a 2nd combobox (11) with the category codes in it, and that the codes match up with the category names in combobox (10), then you should use something like
Code:
on *:dialog:connx:sclick:10:{
  _list $did(11,$did(10).sel)
}


If you have the codes stored in another manner, post how they are stored, and this code can be re-written.
Posted By: OzExcalibur

Re: Combo box help needed please - 12/06/08 07:34 AM

Hi Russel,
thanks for the reply, that works perfectly.

I didn't have the codes stored anywhere, I don't know what I was thinking with that now, I have tried so many things I just had a huge mess.

I don't really want another combo box, it will just confuse the issue having 2 of them for the same thing, what I have done for now though is create a combo box like you suggested and just gave it a size of 0 0 so it isn't seen.

combo 11, 0 0 0 0,

I am assuming that there is going to be a better way of doing that though?

Thanks again,
Rick
Posted By: RusselB

Re: Combo box help needed please - 14/06/08 06:06 PM

use combo 11, x y w h, hide
Then you can place or size the combo box as you want it, including in the same location and size as your combo 10 box
Posted By: OzExcalibur

Re: Combo box help needed please - 19/06/08 03:11 AM

Thank you grin
© 2019 mIRC Discussion Forums