Some first base general questions...

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Some first base general questions...

Post by gyroscope » Wed Apr 30, 2008 8:39 pm

Hi, I'd appreciate any answers to the following general questions please.

• Is there a way to print all scripts in one go (in particular GLX2)? I used to find this helpful when using Lingo, to study them away from the computer (with a glass of whisky....I mean a nice cup of tea :wink: )

• In Getting Started > Quick Start > Tips for Learning Revolution, the video shows an older version of Revolution which, it would appear, had a button in Documentation called Objects, showing scripting elements from the Dictionary grouped together according to their type, such as Objects, Commands, Constants, Control Structures, Functions, etc. I think this would be a very useful in tandem with the Dictionary. Does anyone know if a similar thing will appear again in a future version of RR? (Or perhaps it's still there and hiding from me...)

• Will the Scripting Conferences web pages ever make a return?

• My heart sank a little when I saw that visual effects were for between cards only. Is there a way of using visual effects for images, in particular the wipes, pushes and reveals? The words [to finalimage] in the Dictionary gives me a bit of hope. (If not, I think I'll let out a little sob... :cry: )

• Is there any way to script RR to strip the text from PDFs so as to place it into a text field? And to import image snapshots of PDF pages (i.e to script the snapshot system and then place them as images)? If not, I wonder if the most excellent Quartam PDF Library would be adding import facilities as well as output at some stage?

• Fo a future project, I'd like to have some aspects of the software as close as possible to a simulation as if it were a piece of hardware. I'd still need the mouse clicks of course, but things like positioning the iBeam in a field I'd like to do with buttons (move left, right, up, down). So my questions here are: can Rev be scripted to move the Ibeam in a field using buttons; can the iBeam position be captured (not loc x,y but which line of text) and finally if the iBeam's location of it's start point and end point can be registered, can Rev be scripted to highlight the text background between those two insertion points? (To clarify more, a system based on dragging over a selection to highlight it using a mouse, but using buttons and scripting instead).

Yay or Nay answers and some general pointers to the last three questions at this stage would be gratefully received, thank you!

:)

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Wed Apr 30, 2008 8:49 pm

One thing to look up for the last question:

look up selectedChunk (and related items)

on mouseUp
put the selectedChunk
end mouseUp

make sure the buttons traversalOn property is set to false

All the best,

Malte

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Apr 30, 2008 10:30 pm

Hi gyroscope,

Let me just post my little collection of links for beginners again:

http://h.webring.com/hub?ring=runtimerevoluti1
http://revolution.byu.edu/indexgeneric.php (wow!)
http://www.runrev.info
http://www.altuit.com/webs/altuit2/RunRev/Tutorials.htm
http://www.revjournal.com/tutorials/
http://www.sosmartsoftware.com/?r=revol ... ciels&l=en
http://support.runrev.com/scriptingconferences/
http://derbrill.de/developers.php?lang=en
http://lists.runrev.com/pipermail/use-revolution

I hope there are no dead links in this list. I have only checked that the scripting conference stacks are actually there (at the bottom of the somewhat distorted page).

Now the answers to your questions.

1) You can write a script that loops through all controls of all stacks and prints their scripts.

2) I agree that previous versions of the built-in docs were better than the current docs --at least as far as the interface and some features are concerned. The current contents is quite up-to-date, even if a bit incomplete in some respects. Unfortuantely, nobody knows what the future will bring.

3) There are on-line, you just need to find them (see links above).

4) Check out the lock screen/unlock screen commands.

5) It depends on the PDF. You may need a shell command for this and you might want to search the Rev Use Mail List archives:
http://search.gmane.org/search.php?grou ... &query=rev

There is a FireFox search plugin available on the Economy-x-Talk website:
http://economy-x-talk.com/developers.html
(at the bottom of the page).

I think you should contact the published of Quartam with questions about the library.

6) Yes, yes, yes etc., but I'd think twice before writing SOFTware that behaves like HARDware. You need a very, very good reason to do so. If there is only the slightest doubt that this will work, you might want to keep in mind that you're still making SOFTware in the end.

Best,

Mark
Last edited by Mark on Fri Dec 25, 2009 7:37 pm, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Thu May 01, 2008 8:09 pm

Hi malte

Thanks for the pointers concerning selected text using buttons. I can see how I can use SelectedChunk now but unfortunately still leaves the question as to whether or not the exact iBeam position can be found.

But anyhow, I've changed my mind about using that anyway! (Reasons later in this post...)

Hi Mark

Most grateful for your list of links and answers to my questions, thanks!

A few things: the links are great but Scripting conferences> Online conferences > then on to Scripting Conferences is broken. Maybe when the new style RR website was created they got lost? Anyhow, plenty of other stuff to try to digest now!

A reply to 6): For your interest: I didn't add in my previous post that the software, as well as simulating actions of hardware wherever possible, would also have the normal mouse usages, in this instance, for selecting and highlighting text. Which led me onto thinking about my reasons for wanting to add as an option the simulation of buttons from a hypothetical piece of hardware. THe pipedream of actually having the hardware brought into existance by a manufacturer made me think of these simulations. Then your comment about software rang true: I should be concentrating on the user experience, and not trying to tack on hardware simulation (which wouldn't use a mouse) for a potential future manufacturer. Hope all that makes sense! So I appreciate your getting my head in gear there!

Thank you again for your answers and links.

:)

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Sat May 03, 2008 6:11 pm

4) Check out the lock screen/unlock screen commands.
Got it working using that, thank you Mark. I realised that using import snapshot places the image in the centre of the card and as far as I could tell, without any way of placing it anywhere else. So I used export snapshot first and brought in the image into an image object using import snapshot, then using lock screen was able to use visual effects. :)



If anyone wants to see the script of that, I'll gladly post it.

If you do use visual effects on images, to save a bit of work, note that all of them work except zoom, scroll, push, reveal, shrink and stretch. Well, they do work (except zoom, which doesn't seem to do anything at all) but still affect the whole card.

:)

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Sun May 04, 2008 10:09 am

the newly created snapshot is just an image. However rev doesn't give the name or any identification of said image. Fortunately it's always the frontmost object with the highest layer, so you can do this:

Code: Select all

on mouseUp
  import snapshot
  set the name of the last control to "new snapshot"
  set the topleft of image "new snapshot" to 0,0 --or whatever
on mouseUp
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Sun May 04, 2008 9:29 pm

Hi BvG

Thanks for that tip; unfortunately I couldn't get that to work. No matter what topLeft coordinates I gave it, the imported snapshot still appeared in the centre of the card.

I'll stick with exporting first I think, and then placing it in an image object (no import snapshot needed, I was incorrect to say that before).

:)

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Sun May 04, 2008 10:44 pm

I tested the script (fixing the "on" with "end" at the last line), and it works fine for me. Did you actually try the code as given by me? If yes, what platform and rev version are you on?
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Mon May 05, 2008 11:52 pm

Hi BvG

I tried again and got it working this time (so I don't know what I did wrong last time... :wink: )

Still some unwanted behaviour though... (Rev 2.9, iMac G5 OSX10.4.11)

Firstly, scripted as your suggestion:

on mouseUp pMouseBtnNo
import snapshot from rectangle 164,88,292,180 of card id 1002
set the name of the last control to "new snapshot"

set the topleft of image "new snapshot" to 164,88
-- then lockscreen
-- stuff (hide/ show images)
--- unlock screen with visual eff, etc..........
end mouseUp

What happens is the snapshot "pops" into view for a fraction of a second in the centre of the screen before the image being placed in the correct position.

I then thought I'd sandwich "set the topleft of..." etc., with "set the visible of img "new snapshot" to false" before it, and script for setting visible to true after. This caused some odd behaviour (can't remember exactly but think both the centred image appeared and the wanted position image as well). Removing these lines again, compiling and saving didn't bring it back to the original image "pop" and positioned image. Can't remember what happened, maybe both images still... Anyhow, thought I'd have a go at trying to solve the "popping" centred image; but failed...

I'll stick with export and saving file at the moment and bring it in that way but thank you for your suggestion!

:)

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Tue May 06, 2008 10:20 am

If you don't want to show certain things on screen, then you should try lock screen, sometimes it does slow things down a bit, but it's perfect for this case:

Code: Select all

on mouseUp pMouseBtnNo 
lock screen
import snapshot from rectangle 164,88,292,180 of card id 1002 
set the name of the last control to "new snapshot" 
set the topleft of image "new snapshot" to 164,88  
end mouseUp 
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue May 06, 2008 12:14 pm

Thanks for that BvG, I'll give that a try.

:)

Post Reply