mIRC Home    About    Download    Register    News    Help

Print Thread
#59288 06/11/03 02:39 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
how can i clear an text id when its clicked on? im sure there ie some way


http://MTec89Net.com
irc.freenode.net #MTec89Net
#59289 06/11/03 05:03 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
$mouse >:P There isn't a click event for a text control, so that's ur only bet


-KingTomato
#59290 06/11/03 07:23 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
on *:dialog:dialogname:sclick:dialogid:{ do action }

/help on DIALOG


--------
mIRC - fun for all the family (except grandma and grandpa)
#59291 06/11/03 12:44 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
dont work


http://MTec89Net.com
irc.freenode.net #MTec89Net
#59292 06/11/03 12:45 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
allright i guess on mouse over the text id clear it? or what? isnt there on focus or something?


http://MTec89Net.com
irc.freenode.net #MTec89Net
#59293 07/11/03 11:21 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
on *:dialog:test:sclick:10:{
did -r test 12
}


Assuming you have a dialog named "test" and you single click (with left mouse button) on the ID 10 item (say, a radio button), and dialog ID 12 is a textbox/editbox or whatever, this will remove all text.

Like I said, /help on DIALOG

I haven't actually used the mouse event, but i'm sure something like this would also work:
on *:dialog:test:mouse:10:{
did -r test 12
}


--------
mIRC - fun for all the family (except grandma and grandpa)
#59294 07/11/03 12:50 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
alright i will say this again.
doesnt work... want proof? test it.. more proof?

Quote:
$mouse >:P There isn't a click event for a text control, so that's ur only bet


http://MTec89Net.com
irc.freenode.net #MTec89Net
#59295 07/11/03 04:13 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
neo basically is saying have a sclick event on ANOTHER ID trigger a clear event..

Neo: that;s not what he wants, he wants the text in the textbox to clear on click, like some form objects on webpages. >:D


-KingTomato
#59296 07/11/03 09:04 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
ok heres the dialog, im not very good with using pixels and x and y and mouse position.
im trying to clear these two text IDs (i guess on mouse over) but if the text is default when unmouse over i want the text to go back in there

Code:
dialog toolbar {
  title "Toolbar"
  size -1 -1 500 6
  option dbu
  edit "Google..", 1, -2 -2 100 10
  edit "Define..", 3, 122 -2 100 10
}


http://MTec89Net.com
irc.freenode.net #MTec89Net
#59297 07/11/03 10:10 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
No mouse event for that, so you'd need to use a timer (to catch the mouse being over the edit controls), $dbu<w|h> (in case you're using dbu dimensions), then calculate them along with $dialog().<x|y|w|h|cw|ch> and $mouse.<x|y> to be sure that any relative OS default dimensions wouldn't mess the whole calculation. That wouldn't be easy..

Edit: I'd suggest having the whole thing on focus, instead of on mouse over.. you could use a timer and $dialog().focus for this.

Last edited by cold; 07/11/03 10:16 PM.

* cold edits his posts 24/7
#59298 08/11/03 06:36 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
What I suggested should work, but due to some stupid thing, it isn't. I've been trying to do it for sometime now.

What really sucks, is that sclick doesn't appear to work in a textbox. How the [censored] could that be overlooked?


What cheeses me off, is that the help file "suggests" (not directly) that it is possible to use an sclick event in any dialog item.


--------
mIRC - fun for all the family (except grandma and grandpa)
#59299 08/11/03 03:55 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
so can someone help me code for this event?


http://MTec89Net.com
irc.freenode.net #MTec89Net
#59300 08/11/03 08:12 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Heres a sort of very messy and ugly way. It has faults, such as moving mouse up from the editbox won't restore it, nor will it be restored if the mouse moves out of it downwards or to the left of ID1 (both of those are mostly caused by the dialog body being smaller than the edit controls :tongue:).
Code:
dialog toolbar {
  title "Toolbar"
  size -1 -1 500 6
  option dbu
  edit "Google..", 1, -2 -2 100 10
  edit "Define..", 3, 122 -2 100 10
}
on *:dialog:toolbar:mouse:1,3,0:{
  if $did == 0 {
    if $var(%tb.mouse.*,0) {
      did -ra toolbar 1 $iif($(%tb.did.1,2),$ifmatch,Google..)
      did -ra toolbar 3 $iif($(%tb.did.3,2),$ifmatch,Define..)
      unset %tb.mouse.?
    }
  }
  elseif !$($+(%,tb.mouse.,$did),2) {
    inc %tb.mouse. $+ $did
    if $istok(Google.. Define..,$did($did),32) { did -r toolbar $did }
    did -f toolbar $did
  }
}
on *:dialog:toolbar:edit:1,3:{
  set %tb.did. $+ $did $did($did)
}
on *:dialog:toolbar:close:*:{
  unset %tb.did.*
}

Using this table overcomes the mouse out problems above, unless the mouse is moved out too quickly grin.
Code:
dialog toolbar {
  title "Toolbar"
  size -1 -1 500 10
  option dbu
  edit "Google..", 1, 1 1 100 8
  edit "Define..", 3, 122 1 100 8
}

#59301 08/11/03 08:57 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
alright ill take ur suggestion dialog is bigger.
how can i completely make the text IDs black? im using mdx but i dont think theres a feature for that..


http://MTec89Net.com
irc.freenode.net #MTec89Net

Link Copied to Clipboard