Buttons in "Click enabled" Panels



  • OK, I may well be doing something silly but...

    I have a panel, and I've set it up so Allow Callbacks:Clicks Only

    So this captures and processes mouse clicks fine, until...

    I add a button inside my panel, now I DONT want the button to catch the mouse clicks (its basically a two image animation), but every time I click in the panel the button captures the mouse event, and my onMouseCallback never fires....

    I'm under the impression if I ask the parent panel to capture the mouse clicks it should, no matter whats in the panle.



  • Seems to be working fine for me

    HiseSnippet 890.3ocsV0saaaCElzwLqVqtXEXO.B4Jaf1.40+Fvvv7hS7lQWRLl6J5cELTzwDghTPjJYFEEXOJEnuf6MX6PQIK4T0hVCTckO++wC+NG54YZF2XzYHbuWrNkiv2krXsxtZxJpPglcLBeOxoTikmE5Ucz5TpwviQX7d+lSAtWWTw2+9KGQkTEiWqBgdoVv3+gHQXq0Ne7yER4TZL+EhjFd+3wyXZ0DsTmC3YORDJkxthdI+LpysNDDd+ShEVc1BK0xMfOGoiWuXk9Fk2+WJLhKjbmvHzBHQd0nIqDx34UmUCBg6Nu9jum+j+8jSEwhM5q6.eWggv5HZ1Cvc1FRc2BRi9XPZpVF6RvGAd3FvqqGd2mrfkIRs0VbX6aIyTvkyRJz1aBKuunNnNjIZvCk8vD5U7oYfvlHF7znnGD9jnng+T+f9APy2XCullENmp3xQg+bXUrWxsSzIoZEHL3.u4C7Q4ENzvsmpyM7ITo7B3ZavxbEyJzpA7guoePH7AIynk7CSyDaxR3MTSHSJXWwigDBd0O3s9D2OPnjBEOrJSgZ0Q4VqVMxAqLsb.qBSO.fsLmOre.Tqd2pP9ftUkfxTTk1Ogk04fgtyUY01bxtMLbIqAFOSa4mqFLL3MA8BdaP3sMsbYq1JSljm0pY2nR1mJvAp7jK3YUchJGA9y1Dz8+7HnLeeogiZ0LkvddJuTtlBOpEJLprwB+5ulcL0Rcr5Rcfeo7LqvAG7w7qgUDdNdOxwbyUVcZguk2FH72XKr1uZBvQbPBnz2g3Yen+dyVj+47wqqWo76iuQDaWgvD76wHzJt3xUVmz6.I39TeS0spwk+IN5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jK3YUchJGA9y1Dz8+7HnLeeogiZ0LkvddJuTtlBOpEJLprwB+5ulcL0Rcr5Rcfeo7LqvAG7w7qgUDdNdOxwbyUVcZguk2FH72XKr1uZBvQbPBnz2g3Yen+dyVj+47wqqWo76iuQDaWgvD76wHzJt3xUVmz6.I39TeS0spwk+IN5gI7bkb81HXeOBtWIB72+EPnGojLz.CnoMwvyGmRyfrzHcavsgdMelZdFGnYtwVzGN2Caezw4Rpc6URtcukF.ZvVy9t4akQXW2b27WvdpnV2S05k7mIbuOYtvxV0Nd6zBdAxxWa7Vt0uO4jkK4LaMX6Rl9pccE+W.T9SctUnt7TpMS.TGxY4IKfG9Xb.IJfbXbzzNtAIubjS10YVvUwEB+G7UZbjSFWZbTkQTBkkoeMyufv8txcJz.XRU7jZO3scPNbDpXoADGI5vHTB7b2qYLWq3g.1aOleXGh4Q6PLOdGh4I6PLOcGh4Y6PL+3mLF2+z3Wys5D+XBnX9IEaOw3STTfkUvHQ+O3WZkNF

    No its not! its doing what mine is doing....I DONT want the onControl callback executing....the parent panel should capture the mouse event in all cases....



  • @Lindon Then what's the button for?

    You can also use the Z-Index and place a second panel over the button to receive the clicks.

    HiseSnippet 905.3ocsV0saaaCElzIbnVctXEnO.B4Jaft.Yu1tALLTu3DuYzlDi4thcWACEcLQnHEHoRlaQw1ibeC5NTTxVI0Iqv.QW4y+e7vOdNdpQy3Vq1fvseyxbNB+sjYKUtEiVPEJzjCQ3GQNlZcbSbP0AKyoVKOEgw67adE316hJ+9zKOfJoJFesJD5sZAi+ZQlvsV6zguRHkioo72HxZ38yFNgoUizRcAfmcHInbJ6B547Snd2ZQP3u4nTgSal4nNtEg28.c5xYKzWoB9+VgUblj6E5ilAIJndrVl5QrWKZzBgLcZ841hfrLccWXmPW3IjiEohU5W2M9tRCwqinY+.25tfW+lvK4qGd3Fva2.7dLYFyHxcqs3w1CISTvE0bJbEzDVAeQsPsHizfGJ29YzK3iMfvpH59hjjmF+7jjd+bmnNQvEg0EeI0DOkp3xAw+RbcrmycizY4ZEHzcuf48BQED12xcGqKr7QTo7L3Jr67BEyIzpt7denSTL7AIypk78yMhUYI9JpMlIErK3oPBAu5D8wPh6DITRghGWmoXs5fBmSq56gkQK6xpwzSAXKK385DA0p8MJTHnaTInLkUYymvp5rWO+4ppZqNY2DF9j0.imnc7SUc6E8gn1QeLJ9lllOei1pRlja1nY+yFycEXWUQ1YbScmn1Qf+bcBJ41InMe+vB8kFNpUSTB2o4b0sQaQUMS3W+4jCoNpmIWoC7KmabBODvGxuDFQD30sIGxsW3z4k9VcC.u5ckV6Ty58jEj.31OfT969n+d0Tj+8zgKWOR42GdkH0sXkhj2ObAWb9hFSid+PbqurVOppVga2xh0lTcU2nZnwMq1qFlSMPVZjtUHzRujOQM0vARj+QIpoS+OmuAMq3flUbP84if+GLBUe1H3kfzsCFf8puplCa8Udj+wfM9TkbILf9KF3.i8zoERp65yB8K.pL.7uqMzwOXQYEtkMWPbuLf7qEtOlLU3XK1LdasA7BL16a7VstoC4n4y4L2ZvtKY7ec+uaA8G5BmPc9wTmQ.bLxIEYyfsuLNfDEPU7yHvs7ulCxIdYemYFWkVJ7Y3qxXeuLtxX+ZinLJyneGKLYxuP6AkZ.LoJ2q2F9CFfbbeT4zJHNRx9InLXO66XLeq36Aru4XFrEw7CaQLOaKh44aQLuXKh4G2hX9o6LF+ew4WKb5rvyDPwziJGgiwGon.KqjQh9OPdDBSL
    


  • @d-healey

    AS I said the button is acting as a simple 2 state animation like this:

    HiseSnippet 966.3ocsV8taaaCDmxIZn1atXEXO.D4S1XsFxdscCaXXdwIdynKIFycA6aELTzVDghTPjJdtEAXOB6oaOG8MX6nnjkhqiagAhxGh48Gd+ti28ibZphxzZUJxq4qWkvPdeg+rURSznHBWhlbBx6w9mQzFVJ1I53UIDslEh77N3WrB7ZdHJ+68+zwDAQRYUhPnKUbJ623wbSkzoCeEWHFSBYulGWy5mObBUIGoDpL.OG3GfRHzqIKXmSrl0vG48YmFxMpzYFhgoQdGdrJb0rH0Roy9K4Z9UBlcQezLXibhGqDgVDakhFEwEgSKyaMB1koUUgCbUgux+LdHes7ppwWlq.W4Q85gWicAu90gWvmN77pAuCcv6I9yno7DSkFK19b+IR3fZNANBpCKmsnF+aC+QJvBooWL4Z13TXwZO57xffmheQPP2encq1sfCBsAeCIEOkHYhA3eDW56BlYjJNQIgEcNxo9HqWU9bblwnj8uWmJzejKVt+baTOMyblJSyFQDhqfi+NyyjTCWI6v59t1svvGeNtCqGUvoWyB65jUnx9Yh3Z61bIQjw5zG+LmjEkR5ZiZowEHox9cXKjKZkf0KIkuNywKIZbATdJj6fSXt96OB+02WTuE9+skINWJ3RFtLGwJYAfr0sTknCsrnUr4P5BoZyMfhyo5XIuzdadT9HGA1TuHZqq4aBC6lUCimqLrKjc515csZ151V3MUMe9V0UrYBV5VUaICR2kicjYwWwRKqDkFBSE2cry+9G6pyJPc0kZFpjSjbyEIL48MLhJJlvu9iImPLD67YgLvtDVpgagf2Ira.hO2zZS+SX5qMpjbaKNA.tLSt11kyx11IDGlXeje9u6i9q0bi+8ECWUQT9qCWxCMQqED71gQL9hnZbrucnWiOLVOtHVtS27f0zu3ntVzPiqGsWMLgjB6RssaMB0jaXSjSSYPSjkpAU2nOR9MndDGTOhC1H+d+xMyu+Y4N.EzEqVV1KqsHXjcnPiuPJVAW+7Azo.otJLSPL2ko2d8VgBnO7NTpVZSolaVU+5uGD5+OU39D+obCMZ63swVvKz49Pi2hKSa6e574LpoBrG5O9Oe3u4D86pLCWt3LhIkC8Z9mmEOCdaAkAHQBsJVtBuF1oZ25.6ZakYFSFlu3+fuBk8sq8JT1uTIJlPSUug5XnrWW+nbI.lj4uZoI77IXMtOJm0B7yOnW.JFdEwanTao3Y.12tOC1Ce9l8vmmuG97h8vmWtG97s6gOe2N8w9.teNynhciIffomlSk64cpj.cY4cjn+GPywNPr
    

    still dont love this z-plane solution though...



  • Then donโ€˜t use button but simply draw the image on the panel?



  • Or use an image control and change its offset.



  • You'll still end up with another UI element which you might not need.

    Another way would be to simply set the button's enabled property to false, in this case it won't consume mouse events (not 100% sure though, but I think that's the case).



  • @Christoph-Hart I think that will also grey out the button.



  • Yeah but I think just the stock ones - it wonโ€˜t do that for filmstrips AFAIK (but I could be wrong here)



  • @Christoph-Hart I just tested and it does grey out filmstrips.



  • Oopsies. Then scratch that solution ๐Ÿ™‚



  • @Lindon Then do the opposite, put the panel inside the button ๐Ÿ˜‰


Log in to reply
 

7
Online

590
Users

2.3k
Topics

18.2k
Posts