Page 7 of 12

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Mon May 11, 2009 11:58 pm
by appleide
1 mark for getting part a) correct. XD

For the second textfield its not a bug, more a limitation. Otherwise when you edit it, it'd have like "Textfield: Balia", where the last 'a' is the newly entried letter. And since it we've bounded it to the first textfield, which has 'Bali', it'd turn into 'Textfield:Balia'. Which in turn, will cause the second textbox to have "Textfield: Textfield: Balia". This will occur with every letter we press, which isn't at all desirable. So I made it a one-way binding, it's always bounded to what ever value is in the top textfield, resulting it being uneditable as a side-effect.

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue May 12, 2009 1:33 pm
by Robin
appleide wrote:1 mark for getting part a) correct. XD
Yay!
appleide wrote:So I made it a one-way binding, it's always bounded to what ever value is in the top textfield, resulting it being uneditable as a side-effect.
I had an idea that was be the case. However, wouldn't making the second textfield readonly be more logical to the user? For the little demo it doesn't matter much, but I can imagine people would want to do that in their games. Do textfields have a .readonly property?

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue May 12, 2009 1:43 pm
by appleide
Yes; .enabled.

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue May 12, 2009 1:45 pm
by Robin
Is the user able to select the component if .enabled = false?

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue May 12, 2009 1:58 pm
by appleide
you mean:
aTextfield.enabled=false?
yes.
:)

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue May 12, 2009 2:38 pm
by appleide
Here's a new demo that stops using deprecated features. (lols) It also uses enabled to disable second textfield too. Otherwise the library is exactly the same as before.

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue May 12, 2009 2:52 pm
by Robin
appleide wrote:It also uses enabled to disable second textfield too.
It's more intuitive this way, I think ^^.

(Somehow I always find clicking the "Launch Missile" button disturbingly satisfying :joker:.)

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Sun May 31, 2009 6:22 am
by appleide
I have received some complaints:
My game is more dark. So the white background of the textfield are not good.
I'm start to change the color but nothing seems applied, with :

Code: Select all

aTextfield.backgroundColor=love.graphics.newColor(0, 150, 150, 10)
same for :

Code: Select all

aTextfield.image=nil
I finaly choose :

Code: Select all

aTextfield.opaque=false
And the background become dark \o/

After that I change the text color, but the cursor are still black.
This is my small change : the cursor follow the text color.

In Library/LoveUI/LoveUITextfieldCell.lua :

In LoveUI.TextfieldCell:drawSelection function :
Before:

Code: Select all

                        if self.showCursor and view.isFirstResponder then
                                LoveUI.graphics.setColor(0,0,0,255)
After:

Code: Select all

                        if self.showCursor and view.isFirstResponder then
                                LoveUI.graphics.setColor(self.controlView.textColor)

Another thing.
I put your LoveUI (alpha) in a sub directory :
myproject/main.lua
myproject/lib/
myproject/external/loveuialpha/
myproject/external/loveuialpha/Library/class.lua
myproject/external/loveuialpha/Library/LoveUI/LoveUI.lua

I have no problem in my main.lua to load the class.lua and LoveUI.lua
but You have in LoveUI.lua a hardcoded PATH :

Code: Select all

        local PATHS={}
        PATHS.LIBRARY_DIR="Library";
It will be great if you (in futur version) let this dynamic.
And updated it :)
I've fixed the textfield's backgroundcolor and the cursor being same as textcolor.
Also... from now on:
If you have a folder named "Library", "library", "lib" or "libs", then the LoveUI and the class.lua MUST reside in that folder. (If you have more than one of those, then it ONLY checks the first one found, in the order I listed them.)

If you don't, you have to call LoveUI.loadLoveUIFrom(newPath) after requiring LoveUI.lua.
e.g, for myproject/external/loveuialpha/Library/LoveUI/LoveUI.lua
You'd call

Code: Select all

LoveUI.loadLoveUIFrom("external/loveuialpha/Library")
right after the require("external/loveuialpha/Library/LoveUI/LoveUI.lua") (or similar) statement to finish loading.
If you have one of the folder I've listed then you CANNOT call this.

class.lua still has to be on the same level as LoveUI folder, however.

This release is now 'beta'.

LOVEUI UNSTABLE VERSION

Posted: Tue Jun 02, 2009 12:45 pm
by appleide
This is a new version with new features:
Changelog wrote: 2 June 2009

-Library Loading Code. Requires SECS by bartbes, if class function is absent, will load SECS from its own folder.
Just require the LoveUI.lua file inside LoveUI and it'll look for the lib by itself.
Your library folder can have any names and LoveUI can be placed anywhere in your package.
Just make sure the library's name stays "LoveUI".

-Removed deprecated "LoveUI.EventMouseEntered=2; LoveUI.EventMouseExited=3;" Events

-LoveUI.DEFAULTFONT, LoveUI.SMALLFONT changed to LoveUI.DEFAULT_FONT, LoveUI.SMALL_FONT

-Button no longer uses .title. Use .value instead

-TableView half finished.
It now searches for itself anywhere in the package rather than in one of the specific folders, and you don't need to call anything, or require SECS first (if you don't the lib has its own copy). (But you have to use SECS for classes)

I'm also doing the TABLEVIEW, a list with multiple columns. and I DONT KNOW WHAT THE HEADERS SHOULD LOOK LIKE! Please download and look at the demo and then tell me what you think would suit it best. and how the rest of the table should look like. Thanks.

This version contains unstable features. Use with caution. May need source changes to adapt to this one.

Re: LoveUI... has button, Textfield, scrollVIew

Posted: Tue Jun 02, 2009 2:16 pm
by bartbes
I guess it should be less button, but I think it's fine already. I do want selection though.