Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double sclick for checkbox control
Author Message
Travis Offline
Junior Member
**

Posts: 27
Joined: Jan 2009
Reputation: 0
Post: #1
Double sclick for checkbox control
Doubling sclick in checkboxes.

When I click on things I see it doing everything twice in the callback alias so one click will turn on then turn off the switch. What I have done is set a variable after the first click, then at the beginning of the call back alias, unset the variable and return. It's really cheesy and ghey to do this. Am I doing something wrong or is this a bug.


Here is the callback echo when clicking a checkbox. (327)

> cmd mouse 327
> cmd lbdown 327
> cmd lbup 327
> cmd sclick 327
> cmd mouse 327
> cmd sclick 327
> cmd mouse 327
01-14-2009 10:17 PM
Find all posts by this user Quote this message in a reply
twig Offline
Administrator
*******

Posts: 123
Joined: Nov 2008
Reputation: 1
Post: #2
RE: Double sclick for checkbox control
hi travis,

no its not a bug. its just winapi doing its thing.
i dont beleive there is a dclick event for the checkbox though, it just wouldnt make sense

My little side venture: ThatAwesomeShirt!
01-14-2009 10:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Travis Offline
Junior Member
**

Posts: 27
Joined: Jan 2009
Reputation: 0
Post: #3
RE: Double sclick for checkbox control
Yeah I dont want a dclick event. I want a single sclick event without using my work around which is kinda like jerry rigging my dialogs.

Does everyone have this issue?
01-15-2009 02:13 AM
Find all posts by this user Quote this message in a reply
twig Offline
Administrator
*******

Posts: 123
Joined: Nov 2008
Reputation: 1
Post: #4
RE: Double sclick for checkbox control
could u provide some sample code?
i'm a little confused as what you're trying to do

My little side venture: ThatAwesomeShirt!
01-15-2009 02:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Travis Offline
Junior Member
**

Posts: 27
Joined: Jan 2009
Reputation: 0
Post: #5
RE: Double sclick for checkbox control
Hi twig,

I want it to not have two sclicks when I only click it once.
(This post was last modified: 01-15-2009 09:00 AM by Travis.)
01-15-2009 02:24 AM
Find all posts by this user Quote this message in a reply
Travis Offline
Junior Member
**

Posts: 27
Joined: Jan 2009
Reputation: 0
Post: #6
RE: Double sclick for checkbox control
I'll try this again.

When I click a checkbox it does TWO sclick events.

> cmd mouse 327
> cmd lbdown 327
> cmd lbup 327
> cmd sclick 327
> cmd mouse 327
> cmd sclick 327
> cmd mouse 327

This callback echo is the result of clicking checkbox 327 once. Why are there two sclicks? This happens on every checkbox.
02-02-2009 10:40 PM
Find all posts by this user Quote this message in a reply
dJabba Offline
Member
***

Posts: 100
Joined: Jan 2009
Reputation: 0
Post: #7
RE: Double sclick for checkbox control
(02-02-2009 10:40 PM)Travis Wrote:  I'll try this again.

When I click a checkbox it does TWO sclick events.

> cmd mouse 327
> cmd lbdown 327
> cmd lbup 327
> cmd sclick 327
> cmd mouse 327
> cmd sclick 327
> cmd mouse 327

This callback echo is the result of clicking checkbox 327 once. Why are there two sclicks? This happens on every checkbox.


as already said, this is the winapi that does this. not much the staff here really can do about it. just use a code similar to this, thats what i do
Code:
if (%devent == sclick) {
  if (%did == 327) {
    ;cant remember what $xdid().state returns, modify if statement to fit
    var %state = $xdid(%dname,%did).state
    if (%state == checked) do action
    elseif (%state == unchecked) do action
  }
}

Semi inactive as mirc scripter .. paying jobs have priority, but i havent given up on my projects .. they are just slowed down.
02-03-2009 02:17 PM
Find all posts by this user Quote this message in a reply
twig Offline
Administrator
*******

Posts: 123
Joined: Nov 2008
Reputation: 1
Post: #8
RE: Double sclick for checkbox control
hey guys,

i'm not quite sure what o/s you're using, but it seems to be working fine for me on XP
i believe djabba is a vista user from the last time i asked.

from a quick test, my code is below

Code:
alias checkbox_sclick {
  dialog -ma checkbox_sclick checkbox_sclick_table
}

dialog checkbox_sclick_table {
  title "DCX Test Dialog"
  size -1 -1 498 298
}

on *:dialog:checkbox_sclick:*:*: {
  if ($devent == init) {
    dcx Mark $dname checkbox_sclick_cb
    xdialog -b $dname +mntyz

    ;// Call initilisation alias
    checkbox_sclick_init_dcx
  }
}

alias -l checkbox_sclick_init_dcx {
  ;// Initialising control: Check doubleclick (Check 1)
  xdialog -c $dname 1 check 25 14 150 20 tabstop
  xdid -t $dname 1 Check doubleclick

}

;// Callback alias for checkbox_sclick
alias checkbox_sclick_cb {
  ;if ($2 != mouse) {
  if ($findtok(changing mouseenter mouseleave mouse denter dleave activate deactivate moving endsize beginmove endmove, $2, 0, 32) == 0) {
    echo $color(info) -s */ checkbox_sclick_cb: $1-
  }
}

which generates this output when i click on it once

Code:
*/ checkbox_sclick_cb: checkbox_sclick lbdown 1
*/ checkbox_sclick_cb: checkbox_sclick lbup 1
*/ checkbox_sclick_cb: checkbox_sclick sclick 1


although, i believe if you are changing the checkbox state within the "do action" part of the code, it may trigger the click event.

My little side venture: ThatAwesomeShirt!
02-04-2009 09:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Travis Offline
Junior Member
**

Posts: 27
Joined: Jan 2009
Reputation: 0
Post: #9
RE: Double sclick for checkbox control
Must be a Vista thing then. Will all these Vista bugs be bugs with Win7 as well?

I don't remember if Win7 is picking up from Vista or if it is seperate.


Thanks for the reply you guys! Smile
(This post was last modified: 02-05-2009 08:12 PM by Travis.)
02-05-2009 08:12 PM
Find all posts by this user Quote this message in a reply
twig Offline
Administrator
*******

Posts: 123
Joined: Nov 2008
Reputation: 1
Post: #10
RE: Double sclick for checkbox control
quite possible.
none of the devs i know of are using vista (perhaps mpdreams? not sure though)

windows 7 is a definite build up from the vista base

My little side venture: ThatAwesomeShirt!
02-05-2009 10:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump: