Viewing PowerPoint show inside a card

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ProNothing
Posts: 6
Joined: Wed Dec 05, 2012 2:28 am

Viewing PowerPoint show inside a card

Post by ProNothing » Wed Dec 05, 2012 2:41 am

I am building a fairly simple UI for a kiosk touch screen computer. I have a number of PowerPoint Shows already built with animations and embedded videos that I need to use within my application. Currently I have my application set to open and run the PowerPoint show but it opens outside of the application and once finished with the show the user must close PowerPoint Viewer before returning to my application's UI. I would like to have the PowerPoint show run inside a window in one of my cards with the ability to advance slides manually.

Is this possible? Easy? Any suggestions?

Thank you!
Josh

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

Re: Viewing PowerPoint show inside a card

Post by Mark » Wed Dec 05, 2012 3:56 am

Hi Josh,

You could save your PowerPoint presentation as a movie and embed the movie in LC. Another way is to export the slides as pictures, but obviously you'd lose the animations.

Can't you make your presentations in LC?

Kind regards,

Mark
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

ProNothing
Posts: 6
Joined: Wed Dec 05, 2012 2:28 am

Re: Viewing PowerPoint show inside a card

Post by ProNothing » Wed Dec 05, 2012 4:07 am

Hi Mark,

Thank you for your response.

The PPT presentations have already been created for me to use. I'd rather not go down the road of exporting each slide and recreating in LC.
I have exported them as a movie and brought them into LC as an fail-safe option, but I actually want to be able to control the show (going forward or backward as needed).

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Viewing PowerPoint show inside a card

Post by Klaus » Wed Dec 05, 2012 12:01 pm

Hi Josh,

unless you (or someone else) will write an external that lets you display native PPT
documents in Livecode, you will need to go the export to movie/screenshot route!


Best

Klaus

ProNothing
Posts: 6
Joined: Wed Dec 05, 2012 2:28 am

Re: Viewing PowerPoint show inside a card

Post by ProNothing » Wed Dec 05, 2012 9:02 pm

Thank you Klaus. I was hoping I was just missing something in LC that would allow me to do this. But, I guess not.

I did look into saving the PPT as html and then running it through revbrowser, but saving PowerPoint as html doesn't save the animations either.

Thanks,

Josh

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Viewing PowerPoint show inside a card

Post by sturgis » Thu Dec 06, 2012 12:13 am

Just curious, does google docs have powerpoint support? If so, you might be able to pop the files up to google and then use a browser instance to work with them.

ProNothing
Posts: 6
Joined: Wed Dec 05, 2012 2:28 am

Re: Viewing PowerPoint show inside a card

Post by ProNothing » Thu Dec 06, 2012 12:37 am

Hi Sturgis,

Interesting thought. It does seem that google docs has some sort of ppt support. Probably enough you could use a browser instance. But I've discovered if there is video embedded in the presentation google docs will not work.

Thank you,
Josh

ProNothing
Posts: 6
Joined: Wed Dec 05, 2012 2:28 am

Re: Viewing PowerPoint show inside a card

Post by ProNothing » Tue Dec 11, 2012 6:19 am

I've decided to export all the PowerPoint slides as images and get rid of the animations. But, now my next issue. I've modified Klaus' "auto_slide_lite" to fit my project. As a slide show it works well, with only a next button and previous button. I'd like to add a looping function that only advances slides if there has not been any mouse clicks during a specified amount of time.

I've tried a number of options and it seems like it should be pretty simple but I can’t get it to work correctly (I am quite a noob). How do I script this to get the slides to advance automatically after 10 seconds, but only if there has not been a mouse click within those 10 seconds?

Thank you,
Josh

ProNothing
Posts: 6
Joined: Wed Dec 05, 2012 2:28 am

Re: Viewing PowerPoint show inside a card

Post by ProNothing » Tue Dec 11, 2012 9:42 pm

I think I figured this out. I'm sure this is not the most ideal setup but it seems to work so far. Can anyone see an issue with this?

Code: Select all

## Inorder to loop a set of slides only if there is no user input, but if there is user input reset the loop timer.
Global tTimer

on idle
   if the seconds > tTimer + 10 then
      send mouseup to the button "next"
      put the seconds into tTimer
   end if
   --pass idle
end idle

on mouseup ##there is a pass mouseup on both the next and previous buttons
   put the seconds into tTimer
end mouseup
Thanks,
Josh

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

Re: Viewing PowerPoint show inside a card

Post by Mark » Tue Dec 11, 2012 11:34 pm

Hi Josh,

What about this:

Code: Select all

local lMouseClicked

on showSlides
  if not lMouseClicked then
    go next cd
    send showSlides to me in 10 seconds
  end if
end showSlides

on mouseUp
  put true into lMouseClicked
end mouseUp

on openStack
  put false into lMouseClicked
  send showSlides to me in 10 seconds
end openStack
It is not recommended to use idle, because idle takes a relatively large amount of processing power.

Kind regards,

Mark
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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Viewing PowerPoint show inside a card

Post by jacque » Wed Dec 12, 2012 7:40 pm

Mark is right that sending a message is better than idle. I think one handler needs a slight revision:

Code: Select all

on showSlides
  if not lMouseClicked then
    go next cd
    send showSlides to me in 10 seconds
    put false into lMouseClicked -- resets it
  end if
end showSlides
That should make it work more than once.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Viewing PowerPoint show inside a card

Post by Mark » Wed Dec 12, 2012 8:46 pm

Jacue,

No, that won't work. What are you trying to do? If you want the script to only wait 10 seconds extra after a mouseClick, you need this:

Code: Select all

on showSlides
  if not lMouseClicked then
    go next cd
  end if
  send "showSlides" to me in 10 seconds
  put false into lMouseClicked
end showSlides
However, a much better solution would be a change in the mouseUp handler:

Code: Select all

on mouseUp
  if lMouseClicked is true then
    put false into lMouseClicked
    put the pendingMessages into myMsgs
    filter myMsgs with "showSlides"
    repeat for each line myMsg in myMsgs
      cancel item 1 of myMsg
    end repeat
    go next cd
    send "showSlides" to me in 10 secs
  else
    put true into lMouseClicked
  end if
end mouseUp
Mark
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

Post Reply