Cider2 - Windowed Controls

@aciolino have you had a chance to host the code?

Unfortunately, no, I didn’t I am kind of stuck with archiving solutions right now…typically I’ve been putting them in DropBox, but I really want to put it in a GIT since that seems to be where people are looking.

Wow!
I second your comments above on the need for minor productivity. Nothing big, but the ability to whip up little apps for small biz use without the need to deal with obj-c is very intresting to me.
Nice job! Looking forward to playing with it!

I have uploaded the initial version of Cider2 here. https://gist.github.com/AntonioCiolino/5356607

There are two files:

1.       Cider2.lua - the entire current state of Cider2

2.       BingImageSearch.lua - example that uses Cider2. Comment out the call to Backup() on line 60.

 

These are "Codea-friendly"; tap and hold the New Project "+" and do a "Paste into project". I suggest keeping the Cider2 name for now on Cider2.

 

Cider2

Cider2 should be self-contained; other than Backup() being called externally. Set the backup variable to false in main() to bypass that code.

 

Running Cider2 should present you a simple windowed environment with a palette on the right and a working designer surface on the left. drag and drop controls to place on the designer. By default, the windows are created in Design mode, so controls will (typically) not execute.

·         Double-click a control to set its public properties.

·         Triple-click the window to set the window's public properties

·         Select "Design" from the window menu to change the window into Run mode, where the controls will execute.

There is also an app, HACKED together, called "SampleApp" built into Cider2; move the SampleApp to the last tab in the project to make it take over; main will be the second to last tab and will get overridden.

The Sample app will create a simple image viewer; your images from DropBox will be listed; select a button and a new window is created showing the image. You can change it to Documents if you don't have a DropBox account; uncomment line 38 and change line 53 to "Documents"

BingImageSearch

The BingImageSearch app shows the Cider2 controls in two states - Windowed and non-windowed. It's written to come up windowed to begin, and hitting the MODE button will change the state into a non-windowed version. I don't allow toggling for this POC, it just shows that the same code executes in both contexts (once).

BingImageSearch will search Bing for images based on the keywords entered into the text box. Enter a phrase, hit search, watch the spinner...and images will load into the scrolling container. Touch an image to view it.

 

MAJOR CAVEATS

This code is very much still work in progress:

·         Code can (and in the BingImageSearch app, WILL) crash Codea often

·         Sounds are mostly for debugging, not usefulness

·         Code may reference images directly in Documents library, such as a reference to the Cider2 background image (not parameter driven yet)

·         Some controls are defined but not ported (NotchSlider)

·         Some controls operate but are tricky to understand (PropoertyBuilder)

·         Some controls simply have bugs (ex: ContainerControl renders outside of it's extents if an PictureControl image is bad)

·         The Code Builder portion is not complete; I can Save() and Load() controls, but I don't write and read them yet.

I made a textbox that tries it’s best to be a good citizen, but it isn’t really “right”, that said, it does allow you to move the cursor around the text and type in the middle. I still need to implement cursor controls though.

v1.02: Made a change so that you can design a window and save it to the same window id. Once saved, it can be loaded again by the same window id.

The goal is to allow UI design to occur and save the UI, loading it again at will either programatically or via the UI by a user in design mode.

There is a bug in that if you load the window and generate another window, the cached version of the configuration will get loaded in the second window. It’s a feature, not a bug :slight_smile:

I’m getting an error PictureControl = class(control) line 80 attempt to index local i a nil value

Make sure that control is the first tab.

It is, still getting the error. I’ll take a look at it and see if I can figure out why.

Hi @Aciolino. Github is a good place to put the code we share. I have switched to my website just because i wanted to know the number of downloads. Do you know whether github can provide this information and how? If yes i’ll switch back to github. Thanks.

@Aciolino, I received the same error as @BriarFox when I run Cider 2 by itself. ‘Control’ is the first tab…

I’ll open a new project and see what happens.

@jvm38 if github had a good web UI for posting to a GIT, I’d use that. So far, only gist seems to work with a web client from and ipad.

The error is because of the picture property self.url; I have “documents:truck” , you don’t. Go to CreatePalette and change the url.

Cant get the bing test project to work. I created a bing mobile key. Nothing comes up when i hit search.

you have to put your bing key into the bing Codea app where it says “your key here”. Also, type in some search criteria…finally, don’t forget to include the Cider2 library as a dependency. Guess I should update the Bing code to check for that automatically :slight_smile:

Tried that :slight_smile: Keys there, no errors but Search seems to do nothing. I’ll play around with it some more.

@Briarfox, take a look at the debug panel and see if it says “0 results”…

All I get is Attempt to index global Base64 a nil value

oof…yup, Base64 is in my Utils class for base64 encoding. I’ve included it in the BingImageSearch Gist (manually, hope it’s ok)