LoveUI for Love 0.5.0

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

bartbes wrote:I guess it should be less button, but I think it's fine already. I do want selection though.
My opinion is that "if it looks like a button, clicking on it should do something." If you are planning on making them clickable, I wouldn't change it. For a clickable header, it looks very pretty ^^.

A small thingy about the header: I would prefer the header to stop at the vertical scrollbar, because the way it looks now makes me feel like the header does not fall under the area the scrollbars control, so I would expect the header not to move when the horizontal scrollbar is moved. Anyway, it's not that important, just a detail I noticed.
Help us help you: attach a .love.
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

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

Post by TsT »

I wonder if the behavior of the scrollbar/button are normal.
I think the center of the scrollbar button are not managed at the center of the ... hmm ...
I have difficulty to explain... so I have drawn it.
loveui-scrollbar-bug.png
loveui-scrollbar-bug.png (15.62 KiB) Viewed 2812 times
I hope you anderstood.

Best Regards,
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

TsT wrote:I wonder if the behavior of the scrollbar/button are normal.
You mean that if you click, the left of the scrollbars sets to the position your mouse is at, and you expected the center to be set to the position of the mouse?

While the behavior programmed by appleide is simple to implement and quite logical if you think from the side of source code, I agree with you that it's rather unintuitive.
Help us help you: attach a .love.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

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

Post by appleide »

Answers:
1. There will be selection (row selection only, but it'll probably let you know which column was clicked.), but I haven't done it yet. I want to figure out the appearance first.

2. Some days later, when you the click the header, it'll sort the table by the column.

3. The header over the scrollbar thing was like a short cut... I'll see what I can do. Currently the headers and the table rows are placed in separate views and I used some magical binding code between the bottom view's offset to the top view's offset.

4. Thanks for bringing it up. :) That was a good diagram. After playing with scrollbars on my browser, I am going to make it so when you click on the right side of the scrollbar, the scrollbar will move 1 scrollbar length that way, and vice versa for left side.

Thanks for comments :)
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: LOVEUI UNSTABLE VERSION

Post by TsT »

appleide wrote: 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, [...]
I still have a problem with the new recursive search.
because I have :

Code: Select all

myproject/main.lua
myproject/lib/ -- my libs inside
myproject/external/ -- the external projects inside
myproject/external/loveuibeta -- one or more version the loveui ...
myproject/external/loveuiunstable -- the lastest one
Of course I can remove the "myproject/external/loveuibeta". But it's not my real problem : I hate the non-predictive load.
In my case I work with Subversion, and I see the recursive search check a very lot of directory to finally found the bad one (in loveuibeta).

Because I don't want to ask another change of the LoveUI loading system...
I made my own "hack" of the loading of LoveUI see below.
I'm change the enumerate function to return to LoveUI the direct and good path to the lib.
After load I restore the love function.

Code: Select all

	local enumerateBackup = love.filesystem.enumerate; -- backup before

	love.filesystem.enumerate = function(path)
		local fakefs = {external = {loveuiunstable = {Library = {LoveUI = {}}}}};
		local dir = fakefs;
		for subdir in string.gfind(path, "[^/]+") do
			if dir[subdir] ~= nil then
				dir = dir[subdir]
			end
		end
		local result = {};
		for k, v in pairs(dir) do
			table.insert(result, k);
		end
		return result;
	end

	love.filesystem.require( "external/loveuiunstable/Library/LoveUI/LoveUI.lua");

	love.filesystem.enumerate = enumerateBackup; -- restore

	LoveUI.requireall();
I'm almost sure to be the only one to get this problem, but never mind!

Best Regards,
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

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

Post by appleide »

TST: Is the folder still "LoveUI"? It has to be or it can't find it. It should be myproject/external/loveuiunstable/LoveUI/LoveUI.lua rather than myproject/external/loveuiunstable/LoveUI.lua...

It's just really hard to get it to find itself :( I'm just searching for a folder "LoveUI".
I don't think its wise to be going inside text files and checking whether various functions are there.
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

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

Post by TsT »

appleide wrote:TST: Is the folder still "LoveUI"? It has to be or it can't find it. It should be myproject/external/loveuiunstable/LoveUI/LoveUI.lua rather than myproject/external/loveuiunstable/LoveUI.lua...

It's just really hard to get it to find itself :( I'm just searching for a folder "LoveUI".
I don't think its wise to be going inside text files and checking whether various functions are there.
Of course the directory is still named "LoveUI", but with your differents versions there are more than one !

Unffortunately löve don't follow symlink, else I could make (without any kind of hack) :

Code: Select all

./main.lua
./Library -> ./external/loveuiunstable/Library

My problem was I have :

Code: Select all

./main.lua
./external/loveuibeta/Library/LoveUI/LoveUI.lua
./external/loveuiunstable/Library/LoveUI/LoveUI.lua
I load the external/loveuiunstable/Library/LoveUI/LoveUI.lua
But Then it trying to find the LoveUI directory and found it in :
./external/loveuibeta/Library/LoveUI/LoveUI.lua
instead of
./external/loveuiunstable/Library/LoveUI/LoveUI.lua
After that the requireall() start to read a large part of the older version with the current newer LoveUI.lua ... it's not so fun :D


Regards,
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

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

Post by appleide »

I have an idea. I'll add a new file "LoveUIVersion.lua"
Which has the function:
function LoveUI.getVersion()
return "03062009unstable2300" -- release date and version of LoveUI library
end

Every time I release a new version, I will change in LoveUI.lua

e.g "LoveUI.version='03062009unstable2300'"

Then, each time it loads, it tries to find the path containing LoveUI.lua and LoveUIVersion.lua, and see if LoveUI.getVersion() == LoveUI.version. If it doesn't, either that folder isn't the lib folder or it is of a different version and I should keep searching.

I might implement this this afternoon.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

I don't like where this is going: it takes too much effort for LoveUI just to find itself. I have the feeling a more elegant way must exist to solve this. No idea what it is, and if it really exists.

Or... how about replacing the directory search function with a API function? That way we can use:

Code: Select all

require "extern/loveui_beta/LoveUI/LoveUI.lua"
LoveUI.init"extern/loveui_beta/LoveUI/" --or something like that
EDIT: btw, require()ing random files to find the LoveUI version sounds even worse to me than recursively search directories...
Help us help you: attach a .love.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

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

Post by appleide »

I've made another (unstable) version.

When you require "LoveUI.lua", it looks for a file called "LoveUI.lua" inside the package which has the same version as it, but doesn't run the file's other contents. A LoveUI library's version is now specified in a local variable at the top of the LoveUI.lua file of the library.

I've added sorting to the TableView. I'll need to draw arrow images to denote ascending or descending order.

I've yet to add selection. That shouldn't be too hard though.

I've also revised the header's appearance.
Last edited by appleide on Wed Jun 03, 2009 11:11 am, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 34 guests