-
August 22nd, 2019, 19:47 #21
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,566
In the notes_actions template, you could add these tags:
<state frame="buttonup" />
<state frame="buttondown" />
Then, use the setStateText/setStateFrame/etc. APIs, instead of the setText/setFrame/etc. APIs. When you use the latter, it resets the button states.
Regards,
JPG
-
August 27th, 2019, 22:55 #22
I didn't want to bother you, but I have been trying and trying... and I still can't get it to work.
When I remove all of my coding, and just use:
Code:<template name="notes_actions"> <buttoncontrol> <anchored to="text" position="insideleft" /> <state frame="buttonup" /> <state frame="buttondown" /> <invisible /> <script> function onButtonPress() window.text.buttonPressed(self); end </script> </buttoncontrol> </template>
When I add code:
Code:buttons[i].setStateText(0, "Click me!, "I'm being clicked!");
I wanted the button to visually work like a standard push button. It would show as depressed when the user clicks on it, and it show as "up" when the user lets go of the click. I had this (sort of) working by changing the frame using the onClickDown/onClickRelease methods, but if the user moved the mouse away while holding down the button, it would get out of sync. I can solve this by watching the onHover event, but dang... I was hoping that I could just build some standard push buttons (and not have to reinvent the wheel, so to speak )
-
August 28th, 2019, 04:56 #23
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,566
Where's the example of using the template?
You need the whole chain from base control through implementation in the window class, in order to know what the final XML looks like and be able to see any problems. (i.e. show the part where "notes_actions" used.)
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks