HomeBrew LiveCode Mobile IDE

by Neil Roger on July 14, 2014 9 comments

HTML5 and now a Mobile LiveCode IDE I hear you all cry!…..well sort of 🙂

Before you continue reading this post, I have to make you aware that this is not a mobile IDE that we are working on in-house but a personal fun project (proof of concept) that I have started and like to dive into whenever I get a spare moment (which is very rarely).

There has been much discussion of a LiveCode IDE that runs on mobile devices. This would not only take the creation of LiveCode applications into the mobile space, but would also open up LiveCode to a whole new market.

So without further ado, I give you my LiveCode Mobile IDE!!! (Trumpets Please!)

image00

Tada!

Now I know that my graphic design skills are nothing to shout home about, but all of that can come later. Getting the functionality done first is key.

So let me give you a brief overview of what I’ve accomplished so far:

  • basic tools palette (buttons, fields and image objects)
  • basic property inspector (name, label, visible & opaque properties)
  • Ability to show and hide these palettes by clicking on relevant yellow sections
  • Creation of control by dragging them from tools palette
  • Move Controls after they have been placed
  • Edit scripts of controls by long pressing the control
  • Edit a field contents by double clicking control
  • Works across supported platforms (minus server)

After I started scripting the above, I soon began to realise the sheer quantity of elements there are within the desktop IDE and what I have achieved so far is only the tip of the iceberg.

So let me explain how I accomplished some of this but please be gentle with my code as it can get quite unruly at points 😀

Palette Creation

The first step was creating both the tools and property inspector palettes. These are just grouped controls of graphics objects.  To show and hide the palettes, I simply applied a move command to show/hide them depending on their location. Below is the tools palette show/hide script

on mouseUp
if the loc of group "toolsPallete" is 54,360 then
move group "toolsPallete" to -36,360 in 100 milliseconds else
move group "toolsPallete" to 54,360 in 100 milliseconds
end if
end mouseUp

When working with the property inspector palette it knows which control to assign properties to via a global variable which contains the last selected control name. The name, label, visible & opaque properties of the control can then be assigned accordingly.

Creating Controls

image01

Next is onto creating controls. There are various ways that this could be achieved, but I decided to go with a mouseDown on the card script. This meant that all scripts for this action are in one place. I then defined what happened during the mouseDown by checking if the mouse was within the rect of the tools palette via the mouseLoc function. The name of a created control is defined by the amount of pre-existing controls of that type currently present on the card.

local sMouseDown
global gControlName
-- creates controls from tools pallet group
on mouseDown
if the mouseLoc is within the rect of group "toolsPallet" then
put empty into gControlName
put true into sMouseDown
if the mouseloc is within the rect of graphic "buttonGraphic" then
lock screen
create button "button"
set the loc of it to the mouseLoc
set the name of it to (the short name of it && (the number of buttons of this card +1))
set the label of it to "button"
put the name of it into gControlName
set the script of gControlName to the cGrabMe of this stack
unlock screen
end if
if the mouseloc is within the rect of graphic "fieldGraphic" then
lock screen
create field "field"
set the loc of it to the mouseLoc
set the name of it to (the short name of it && (the number of fields of this card +1))
put the name of it into gControlName
set the backGroundColor of it to White
set the script of gControlName to the cFieldScript of this stack
unlock screen
end if
if the mouseloc is within the rect of graphic "imageGraphic" then
lock screen
create image "image"
set the loc of it to the mouseLoc
set the text it to the text of image "ic.png"
set the name of it to (the short name of it && (the number of images of this card +1))
put the name of it into gControlName
set the script of gControlName to the cGrabMe of this stack
unlock screen
end if
end if
end mouseDown
--allows created controls to be moved
on mouseMove
if sMouseDown is true then
if gControlName is not empty then
set the loc of gControlName to the mouseLoc
end if
end if
end mouseMove
--stops controls sticking to mouse loc
on mouseRelease
setInspector
put false into sMouseDown
end mouseRelease
on mouseUp
mouseRelease
end mouseUp
-- sets inspector values to control values
on setInspector
if gControlName is not empty then
put gControlName && "ID" && the id of gControlName into field "nameLabel" of group "inspectorGroup"
put the short name of gControlName into field "nameField" of group "inspectorGroup"
if "image" is not in gControlName then
put the label of gControlName into field "labelField" of group "inspectorGroup"
end if
end if
end setInspector
on updateScript pScript
set the script of gControlName to pScript
end updateScript

A few other things are happening on the card’s script.

  • Setting the property inspector values when a control is created or when a control is moved
  • Stop control sticking to the mouse position

Custom properties of the stack contain control scripts which deal with re-positioning the control and launching the script editor. The following is the script applied to a button:

global gControlName, gScript
local sMouseLocation
on mouseDown
put the mouseLoc into sMouseLocation
put the name of me into gControlName
setinspector
grab me
end mouseDown
on mouseStillDown
if the mouseLoc is sMouseLocation then
put the script of me into gScript
go to card "scriptEditor"
end if
end mouseStillDown

Script Editor

image02

The script editor can be accessed by long pressing (mouseStillDown) on any create control. When a user does this, the script editor card is opened and the script of the control is shown.

You can then edit the script, hit the apply button and it takes you back to the main card where the control’s script should update automatically.

global gControlName, gScript
on mouseUp
put field "codeEditor" into tScript
go card "canvas"
send "updateScript tScript" to card "canvas"
end mouseUp

So there you have it, a very basic mobile IDE 🙂 . As I mentioned previously, there is still a lot of work to do and it will take some time for it to progress into more advance stages of development. (If there were only more hours in the day…)

I hope you enjoyed this post and for those who are interested, here is a link to the current version of the IDE. Please feel free to experiment with it and if you’re up for the challenge, add more features to it.

http://techsupport.on-rev.com/lcMobileEditor.zip

Let us know how you get on or if you have any other feedback in the comments below.

read more
Neil RogerHomeBrew LiveCode Mobile IDE

San Diego Hotting Up

by JoJo Hernandez on July 11, 2014 4 comments

With only 2 months to go until the Kick off of RunRevLive 2014 in San Diego, things are hotting up in the office with requests and interest, so I thought I would take a moment to answer your Top 10 Frequently Asked Questions…

Q.1: I booked a Premium / Budget Ticket – which nights are included in my overnight stay?  

A.1: In either Premium (Manchester Grand Hyatt) or Budget (The Embassy Suites) the Check In & Out days are the same. Check-In is Monday 1st September with Check-Out on Friday 5th September.  

Q.2: My travel In/Out of the San Diego requires me to stay an extra night(s), how do I book these please? 

A.2: Please book these directly though us, to ensure you do not need to change rooms and that you are included in our Preferential Rate & Group Booking Block. 

Please use the links below and select the multiple(s) of nights required. Once your Order has been confirmed, please email JoJo  to confirm required additional date(s): 

Embassy Suites:

https://livecode.com/store/conference/runrevlive14-budget-xtranight

Manchester Grand Hyatt:  

https://livecode.com/store/conference/runrevlive14-premium-xtranight 

Q.3: I booked Ticket only, but would now like to add Accommodation – is this possible? 

A.3: Why yes, of course! Please follow the steps as above and remember to confirm your Check-In & Check-Out dates by emailing JoJo.

Q.4: I am attending the Community Day but would like to stay overnight, is this possible? 

A.4: Again yes, of course – Please follow the steps in A.2 and all will be taken care of for you! 

Q.5: I am attending RunRevLive in San Diego, what is included in my Ticket? 

A.5: Whether you buy a Community Day Ticket or a 4-Day Pass, you can be sure of being well looked after. We start each day with Tea, Coffee, Juice & Snacks and keep you energised in between sessions with Morning & Afternoon Breaks as well as an informal Lunch.  

WiFi is available in the Conference area and we have both a dedicated Customer Services Representative and Conference Host to look after you and assist throughout. 

 We also have our Networking Evening on Tuesday 2nd September, where you have the chance to meet with all the other Speakers and Attendees.. Plus (of course) the LiveCode Team. 

Q.6: Is the cost of WiFi included in the Hotel Rooms? 

A.6: For those of you staying at the Manchester Grand Hyatt, yes there is Complimentary WiFi in each Room booked with our Block Group Booking. 

If you are a guest at the Embassy Suites, we have negotiated a 50% Discount for all our Block Booked Attendees.  

Q.7: I have never been to San Diego, what is it like? 

 A.7: San Diego is the 8th largest City in the USA and the 2nd largest in California. Situated to the South of Los Angeles and adjacent to the Mexican Border, it as a warm and pleasant climate, with average September Temperature of Highs 77 & Lows 66 – That’s 25-19 Degrees C for us Europeans! 

San Diego International Airport is well serviced for both Domestic & International Flights and is only a 10 minute car journey away from the Conference Venue.

Q.8: If we’re not staying onsite, are there plenty of places to eat & drink? 

 A.8: Goodness yes. The ‘Gaslamp Quarter’ is a 16.5 block historical area in Downtown San Diego, which is a 5-10 minute walk from the front of the Manchester Grand Hyatt. Here you’ll find a selection of bars and eateries to suit all tastes and budgets. 

Wanted somewhere a little more on the water? Not to worry, Seaport Village is located directly to the back of the Hotel, running adjacent to the Harbour and Marina area. Offering a selection of Cafes and Restaurants, this area is also a perfect little shopping village, open from 10am – 10pm daily. Many of the local tours and attractions have a drop off / collection point here also.  

San Diego Skyline

Q.9: I am thinking of bringing my Family or Partner with me. Is this possible and will they be bored whilst I attend the Conference sessions?  

A.9: Of course they are welcome! There is no additional cost for spouses sharing a room, however there may be if you decide to bring the whole family along. Not to worry, we have negotiated amazing discounted rates, so if you think you’d like to make this a mini-break, please email JoJo and she can help you plan your trip.

 As to will they be bored? Not. At. All. Please see my answers below to Questions 10! 

Q.10: I see there is “Free Time” on Friday afternoon and some evenings, any suggestions on what to do? 

A.10: This is one thing I loved about San Diego, the amount there is to do within the immediate vicinity. 

Want to pop over and look at the Old Town, Coronado *and* Balboa Park, but a little pushed for time? How about the Hop-On/Hop-Off Trolley Tour?  A great way to see the city and have your very own voiced guided tour. 

Fancy a ball game? PETCO Park houses the San Diego Padres and we’re sure there will be a game on whilst your in town!  

 Love Big Boats? How about the USS Midway Aircraft Carrier & Museum? Even better, this one is a 15 minute wander from the Conference venue along the Seaport Promenade. (There’s even a Pedi-Cab option to save your feet for the Midway itself). 

USS Midway

 

Add to all of this Jet Ski’s, Beaches, a Zoo and the Mexican / Little Italy areas and you are spoilt for choice. 

However, it wouldn’t be fair if I didn’t also point out the Top Gun factor. Yes, that iconic 80’s Film was filmed and set here in San Diego and Coronado Island. 

Don’t believe me? Check out this great article marking the highlights from the film 

And if you’re a die-hard fan (like me) how about a stop off at Kansas City BBQ. Opposite the Conference venue (2 minutes walk from the main front doors) and you can be transported into the film itself. Go On.. I dare you to try the piano!

Kansas City Barbeque

 

Stop Press!. Q 11 I can’t be there in person, is there another way of taking part?

Yes! We’ve just announced the Simulcast – live streaming of this event. Get the Membership Pledge and view the whole proceedings from the comfort of your armchair!

read more
JoJo HernandezSan Diego Hotting Up

The Next Generation: Widgets & Themes

by Kevin Miller on July 8, 2014 45 comments

Watch this video to see me demonstrate a first prototype of the Widgets & Themes project. This is one of the most exciting parts of our entire Next-generation project. We’re now at a stage where it is working well enough that I can show you this first version working. This work has been enabled by all the work we’ve done under the hood over the last year or so.

In this video, I show a prototype widget that displays a PDF, the code that makes it work, then explain the potential for using this feature in a variety of ways to extend LiveCode. Finally I give a brief tour of the first early prototype widget editor, which demonstrates how you will be able to create these widgets yourself and install them into the IDE with a single click.

I hope you enjoy the video!

read more
Kevin MillerThe Next Generation: Widgets & Themes

Multimedia on Mac OS – A quick progress update

by Panagiotis Merakos on July 7, 2014 16 comments

Things are running smoothly regarding the update of the player object. In this post I will briefly describe what has been done so far.

The first step was the refactoring of the MCPlayer related code. Formerly, the MCPlayer class used ifdefs in most functions, based on whether it was using the ‘platform player’, ‘quicktime’, or was on Linux. Now, MCPlayer is split into two classes in separate files (player-legacy.cpp/.h and player-platform.cpp/.h). The former is the pre-platform API version; the latter the platform API version. This made it easier to update the platform-player version to use its own controller.

The next step was to implement a custom controller bar. For the reasons described in the previous blog post for Multimedia on Mac OS, we had to implement our own controller. After some discussion, and some research on the appearance of modern video controllers, we are almost there! Below is a preview of the current, and probably final version.

 playerpurple

 

Because some users may not like this color, we thought it is better to make it customisable. So we added some properties to the player object. In fact, we tied in some existing properties that were not used for the player object. For example, the hiliteColor. For the player object, the hiliteColor is the color of the played area, as well as the color of the volume area in the volume popup window. It is also the color of a button background when this button is clicked. So, if you don’t like the purple color that is set by default, all you have to do is add a new button (or just type in the message box) with the following code:

on mouseUp

set the hiliteColor of player to re

end mouseUp 

The result is the following:

 playerred 

In the player object, you can also set the foreColor, which is the color of the selected area, i.e. the color of the area between the selection handles. This is dark grey by default.

 player3

 

Modify the code in your button, to change both the hiliteColor and the foreColor

on mouseUp

set the hiliteColor of player 1 to127,255,0″

set the foreColor of player to “106,156,56”

end mouseUp

The result is the following:

player4 

Finally, we had to move from Quicktime/QTKit to AVFoundation. This transition is now done, and the new player object seems to work perfectly with the AVFoundation APIs. Some tweaks have still to be done, in order to ensure similar (or at least as similar as possible) behaviour with the old Quicktime/QTKit controller. Next, and final step as far as the player object is concerned, is to test it thoroughly and fix any bugs that may arise.

read more
Panagiotis MerakosMultimedia on Mac OS – A quick progress update

Let’s Bring HTML5 to LiveCode

by Kevin Miller on July 1, 2014 1 comment

Our campaign to add Web Deployment to LiveCode has launched! The aim is to raise enough funds to add deployment to HTML5 to LiveCode’s existing line-up of mobile and desktop platforms. We’ll keep you updated on progress here on this blog throughout the campaign.

Get involved! Help us to make this a huge success and pledge today. Tell all your friends, relatives and any developers you know. Help us to #CompleteLivecode.

Click here to return to the HTML5 Campaign

read more
Kevin MillerLet’s Bring HTML5 to LiveCode

The present and future LiveCode

by Ben Beaumont on June 30, 2014 16 comments

2013 was a big year for the LiveCode technology if not the biggest to date. The Kickstarter campaign allowed us to not only take LiveCode open source, but provided us with the funding we needed to completely refactor the way the LiveCode language was processed internally. You’re starting to see the fruits of that work with LiveCode 7 and transparent Unicode support, but that is just the tip of the iceberg. 2014 looks set to be an even bigger year for the technology with team members being committed to some of the most exciting projects I’ve seen in my 9 years working on the technology.

In the year since the Kickstarter campaign we’ve put out 15 new releases of LiveCode spanning versions 6 and 7. New features include:

  • Core Refactor: Modernise 500,000 lines of code paving the way for another decade of innovation
  • New Graphics Layer: Modernise the graphics to pave the way for ‘Resolution Independence’, ‘Fullscreen Scaling’, ‘Stack Scaling’ and other scheduled projects.
  • Resolution Independence: Apps takes advantage of high DPI displays
  • Fullscreen modes: Apps scale to any device for you with just 1 line of code
  • Stack scaling: Helps you work on your projects on small laptops
  • Unicode: Seamless easy Unicode in any app on any platform
  • Cocoa / CoreText: LiveCode on Mac OS now works with the latest API’s
  • Image Cache: LiveCode apps are now smoother and faster on mobile and desktop
  • OpenSSL: Apps can now be as secure on mobile as they are on desktop
  • Proxy Support / Secure sockets: Your apps can now work seamlessly from behind proxy servers
  • WebKit Browser: New webkit browser helps you make better cross platform apps
  • Integrated Fonts: Apps load and use fonts with no hassle
  • Server Graphics: Create graphics using LiveCode on the server
  • 9 way image stretch: Create skinned apps even more easily

We’re also in the process of finalising a couple of other features on our roadmap which will be out in testing in the coming week or two.

  • Multimedia: We’ve replaced the MacOS video player with the latest API’s (AVFoundation)
  • GDK: LiveCode on Linux now works with modern windowing API’s

Much of the work we’ve completed in the last 12 months was on our public roadmap, but you’ll notice that a number of items were not. With the desktop and mobile platforms constantly evolving we’ve been working hard to deliver on the commitments we made while keeping LiveCode at the cutting edge of cross platform development. So where does that leave us on our journey?

Roadmap

Active

Performance

Open Language

Themes / Widgets

IDE

Regions
LiveCode to use more intelligent region data to reduce the number of pixels rendered.
Awaiting build – LiveCode 6.7 DP5
Effect: 0 – 5x Speedup
Evaluator
Write a new evaluator
Prototype complete
Widget Architecture
LiveCode to have pluggable themed controls that can be written in the LiveCode language by inhouse developers or community members.
Prototype in progress
Widget IDE
Widgets provide an ideal focal point for the new IDE. We’re prototyping a basic IDE to help test and progress the widget prototype. This builds on other IDE prototypes created in the past.
Prototype in progress
Multicore Rendering
LiveCode to use all CPU cores when rendering
Prototype complete
Effect: 2x Speedup
Parser + Specs
Write a new parser
Prototype complete
File Format
New file format to save new controls into stack as well as provide for better versioning system integration
Stack Views *
A stack view in LiveCode will enable us to load stacks as a view and create a single windowed IDE
Multicore Accelerated Rendering
LiveCode to use all cores when generating data for GPU allowing LiveCode to use the GPU by default
Network / Sockets
Use new open language feature to implement
Cross browser player object
Use widget framework to wrap video playback on all platforms into a single object
Full IDE Prototype *
A full prototype of a new IDE based on a solid architecture
Database
Use new open language feature to implement.
Vector Shape Object
Use widget framework to write this control

Performance: We’ve made substantial changes to the graphics architecture in the last 12 months. The core has been replaced with a modern abstraction providing a foundation upon which much of our future tech will be built. However, Resolution Independence has required this library to do work it never had to in the past. A retina display requires the graphics library to render 4 times the number of pixels to the screen. Every pixel takes time to calculate, so the more you have, the longer it takes. This project was added to our roadmap to address the slowdown caused by this increase in pixels. We’ve created a generalised threading library that the engine can use to take advantage of all the cores available on a given system. We’re also looking at ways to reduce the number of pixels LiveCode renders taking advantage of features in our new graphics library. Most of these changes have been prototyped and are now being implemented for release in 6.7 or 6.7.1.

Open Language: With the core refactoring almost complete (LiveCode 7.0) we’ve started to turn our attention to the final aspect of this project which is to open up the language for extension by anyone. We have been prototyping for quite some time now and plans are in place to move this project forward at a rapid pace once LiveCode 7.0 is released. We will complete network, socket and database libraries with easy to use English like syntax as part of the development and testing of this feature. This is currently slated as one half of our next major release, currently imaginatively named “8.0”.

Theme / Widgets: Another important prototype we’ve invested time in is codenamed “Widgets”. Our aim is to provide a means for any LiveCode developer to extend the control set. This builds on “Open Language” making it possible for any developer to extend the language and the UI. While still in its infancy, we are really excited about the results which will make LiveCode 8.0 a groundbreaking release.

We’re looking forward to showing these prototypes at the upcoming conference which we hope will give you a flavour of where the technology is going in 2014/2015. This is going to be another special 12 months for LiveCode!

* These features are reliant on strands 1-3.

Queued

That leaves us with only 2 queued projects. Physics is best implemented using the features in planned for LiveCode 8.0. It will take advantage of the new controls as well as have wonderful English like syntax to power it. The Windows 8 port can take place as soon as engineers are available to work on it. The platform layer underpins the LiveCode 6.7 Cocoa port making this Windows port much easier to tackle.

Physics Engine
Incorporate Box2D into LiveCode along with an animation loop feature.

Windows 8
Port LiveCode to Windows 8 on mobile platforms using the new platform API developed for the Cocoa port.

Summary

We’ve shared at length over the last few years our dreams for the technology and creating a “Next Generation” version of LiveCode. A bold step forward to make LiveCode a mainstream language with awesome tools to make app development efficient and easy. Our vision as a company is to make programming simple. For professionals, that means achieving amazing result with a small team. For those new to programming, it means a chance to learn a skill that we see as vital in the 21st century.

LiveCode’s roots are in Hypercard, a wonderful vision to make programming simple brought to us by Bill Atkinson and his team at Apple well over 20 years ago. We share their vision many years on and in a new technological landscape. The first Kickstarter campaign that you supported enabled us to prepare the LiveCode technology to be opened up to every developer.

After 14 months of hard work we are now starting to see the fruits of our labours. LiveCode 7 is a huge milestone which sees your existing LiveCode projects running on completely new foundations. LiveCode 8 builds on these changes bringing the LiveCode language into the mainstream and providing a way for anyone to extend LiveCode to do exactly what they need.

read more
Ben BeaumontThe present and future LiveCode