DICE PACKS BUNDLE
Page 3 of 3 First 123
  1. #21
    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

  2. #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>
    The button doesn't show as depressed when I click on it.

    When I add code:
    Code:
       buttons[i].setStateText(0, "Click me!, "I'm being clicked!");
    The text will change as I click on the button, but the frame does not. Instead, when I am done with the click, the button switches to the second "state", and now it shows the depressed (buttondown) frame. So now the button behaves (visually) as some kind of toggle button. And that isn't what I wanted.

    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 )

  3. #23
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in