Soda v0.7: gorgeous and powerful GUI/ windowing/ button library. Now with fully selectable text.

thanks for 1)

for 2) it does not change with default. I already had the problem with the version 0.5

@hpsoft I pasted the code snippet above into your earlier equations program, but I’m not seeing the issue you described. I took out the “BUG” option, and I was able to select any of the calculations, and it seemed the correct calculation is performed. Is it to do with having or not having a default? If you omit the default attribute, then the list starts without any selection, and the callback is not called (this is the behaviour you want, I expect). If default is set, that item will be selected, and the callback will be called, when the list is created.

my ios version is 8.3 ( not yet 9 )
yes i don’t use callback here
the result is returned directly in textentry
i’ve removed “bug” item and replaced defaultNo by default

by default, FV is selected in Dropdownlist

i tape 5 enter in N
i tape 6 enter in IYR
i tape 100000 enter in PV

but when i want select FV
i can’t validate FV

i can validate the other PV N IYR…

Try removing the default = 1 attribute altogether.

I think the issue could be that if you select an option that is already selected, it does nothing, the callback does not fire again (this is by design). ie the list is for selecting one option from many. It might be more appropriate in this case to have a set of buttons for each calculation, like a calculator.

Just over a month ago, @Jmv38 messaged me with an idea to merge his Sensor class for differentiating between various touch gestures into Soda. I was impressed with the effect this had in terms of making the code more modular by putting all of the touch logic in one class. So, 5 or so weeks later, and a lot of hard work (mainly on @Jmv38 's part) here’s v0.7 of Soda. @Jmv38 rewrote the text entry class, so that it now has fully selectable text with draggable in and out points and an iOS style popover menu for cut paste, undo etc.

See below for version notes and screen shots.

It was a fascinating experience for me, going from being the “developer” to more of a “project manager” role while @Jmv38 did all the heavy lifting. All of the source control was done with Working Copy (and the Working Copy Codea Client) which was very useful, particularly in the early stages. @Jmv38 initially forked v0.4 of Soda, so I was able to continue working on the next 2 versions at the asme time as @Jmv38 was working on the Sensor branch, and then merge in the differences. Thanks @Jmv38 for all your work.

Enjoy!

v0.7

  • Big changes underneath the hood: all touch logic is now handled by Jmv38’s Sensor engine (renamed Gesture in Soda), making for a more modular architecture that will be easier to maintain and expand in future.

  • Jmv38 has rewritten the text entry boxes. Now features fully selectable text with draggable selection start and end points, the ability to scroll the text by dragging and holding the cursor to either end of the entry box, and a pop-up menu for cut, copy, paste, and 5-level undo.

  • Windows can now be draggable: add draggable = true to the window’s constructor to add this. The window can be moved by dragging any part of the window that does not contain interface elements. See the calculator demo for an example of this.

  • Various minor fixes for iOS 9 and Codea 2.3.2 affecting sliders, orientationChanged, and forcing the plain, non-emoji form of various symbols to display.

Selectable text

Calculator in a draggable window

@yojimbo2000, @Jmv38 - great work, guys! =D>

Very impressive, guys!
Question: non-english keyboards don’t seem to work with text entry boxes… Is that a bug or just not implemenfed yet (i tried with Russian keyboard)

@Juce did it work with previous version of Soda?

@Jmv38, it works in v0.5, although it has some issues there: the font size appears to be different (larger) compared to latin chars, so as you type more text cursor gradually gets out of position, and eventually that appears to cause runtime errors. With v0.7 (head of master), cyrillic symbols don’t render at all, and cursor does not move.

even more gorgeousness! great job

@piinthesky thanks!

@juce thanks for reporting this. Can I ask, in utf-8 is Russian double/ multi-byte? We’re wondering if this issue is to do with the Lua string commands being set up for single-byte characters

@yojimbo2000, in utf-8, it is multi-byte, yes… You are right: that appears to be the root of the problem. For example, this prints out “12”, even though, the word has only 6 characters.

-- Russian

function setup()
    print(#"??????")
end

@juce We’ll get a fix out for this, probably using the Lua 5.3 UTF8 library. Thanks again.

@jmv38 and @yojimbo2000 thank you for soda and excellent copy/paste wich works fine with ios 8. It’s a dream team.

but i have 2 problem :

  • the first , the cursor is misplaced if i use TextMode(), the solution i use pushstyle and popstyle ( not the case in previous version )

  • the 2nd problem when i use Soda.TextEntry, i have the error " attempt to concatenate a nil value " in the last version ( it’s works fine with the previous version ).

an extract :

variable=Soda.TextEntry { parent=panelnew, x=20, y=-20, w=600, h=40, 
      title = "Variable =", default = "", callback = function(self, inkey) v1=inkey end
    }
    
    valeur=Soda.TextEntry { parent=panelnew, x=20, y=-80, w=600, h=40, 
      title = "Valeur =", default = "", callback = function(self, inkey) v2=inkey end
    }


function draw()
    pushMatrix() ; Soda.camera() ; Soda.drawing() ; popMatrix()
    pushStyle()
        textMode(CORNER) ; font("Futura-CondensedMedium") ; fontSize(30)
        varlist=listLocalData() ; nbvar=#varlist ; text("Nb de variables : "..nbvar,50,700)
        if ecran=="Info" then end
        text("v1="..v1,300,700)
        text("v2="..v2,500,700)
    popStyle()
end



thanks

@hpsoft thanks for your input. I’ll check for this and correct it.
Thanks

thank you it will be very usefull for my database project including photo links :slight_smile:

Can you do it in one class? I am too lazy to do this

@TokOut

According to your various other posts on different threads, you want text input, switches, and various other elements, so no, it cannot be all in one class.

Try to keep your comments constructive or you will be blocked.

@TokOut, ???. ??? ?? ???-??? ??? ??? - ??? ??? ??-???. (Translation: @TokOut, you can write the questions in Russian)

Thanks, @juce!!