Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently November 8th, 2024, 7:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Disable button
PostPosted: April 1st, 2007, 10:24 am 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
I need a help in disabling a button if i go to another page and come back to the same page.
If i have 30 buttons on the same page and if i click on one of them it'll take me to the next page and if I return i want to see that button disabled. I know how to do it with assigning pub varibles and give actions but i want how to do it in script or using arrays . Antbody could help


Top
 Profile  
 
 Post subject: first thought
PostPosted: April 8th, 2007, 4:03 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
would think that if you assigned a script to a click action and use

this.Enable(false)


would work.


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 15th, 2007, 11:10 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
I've used Opus for years, but have so far avoided scripts.

However, I think it's time I learned.

Can someone explain in simple steps how I'd achieve the answer given here?

**assign a script to a click action and use this.Enable(false)

Thanks, Linda

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 16th, 2007, 12:24 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Linda,

On an object (for example a button) that you want disabled after clicking do the following;

1. Create a left click trigger (or another other that suits your purpose)
2. Add the action that you want to apply (for example show on item)
3. On the programming tab, double click the script function
4. On the script tab, in the box, enter this.Enable(false)
5. Click OK and close the dialogue box

Sorry, but after checking my idea that I posted for OpusLover, released that Opus, rather annoyingly, doesn't save the state of an object once you've changed pages. Therefore the disable action is only suitable for the page your on.

In order to disable a button throughout a publication you'd need to use variable to track whether the button has been pressed and therefore whether it should perform an action or not.


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 16th, 2007, 3:08 am 
Here is an example of a technique which I use, and which you might be able to adapt to work with disabling a button. I'm not sure if this technique will work for you, but I find it very effective in my development environment.

What I want the technique to do:

1.To present large amounts of text information, I display each paragraph in turn. It takes 46 seconds for this page (Page 1) to completely display.

2. In page 1 there is a hyperlink that takes the the reader to Page 2.

3. The reader returns to Page 1 by using the Previous Button.

4. On return to Page 1, I do not want the reader to have to wait for 46 seconds for the page to display again. However, I want to give the reader a chance to review the contents of Page 1 in the light of what was read on Page 2, before continuing.

How this works:

1. On the master page, I have a publication variable, Page_seen, which is initially set to 0. The Previous Button uses a Left mouse click to (a) set Page_seen = 1, before a Go to Page <Previous> action.

2. On any page where I have a hyperlink that sends a reader to another page, I have an On Show trigger that runs the script which appears below.

3. If Page_seen = 0, the paragraphs display in turn.

4. If Page_seen = 1, the paragraphs display simultaneously.

Note: In this sample, Page 1 and Page 2 are placed next to each other, whereas in reality they are separated. This has the effect of distorting the the use of the Next, Back and Previous Buttons after the reader returns to Page 1 from Page 2.

(My thanks go to Steve Henson for working with me to develop this technique.)

==================
if (Page_Seen == 0)
{
How_do.Show() //This is the first paragraph
wait(6)

Character_differentiation.Show() //This is the second paragraph
wait(9)

For_example.Show() //This is the third paragraph
wait(11)

Adding_speech.Show() //This is the fourth paragraph
wait(12.7)

These_socioeconomic.Show() //This is the fifth paragraph

Loading.Hide() // This is the timer/counter that indicates more paragraphs remain to be loaded.
wait(6)

Turn_page.Show() // This is an alert that the page has been fully displayed
}

if (Page_Seen == 1)
{
//These paras display simultaneously
How_do.Show()
Character_differentiation.Show()
For_example.Show()
Adding_speech.Show()
These_socioeconomic.Show()
Loading.Hide()
Turn_page.Show()
}


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group