This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
bjornir90's profile picture

[API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse support

Started by bjornir90, 24 November 2012 - 05:21 AM
bjornir90 #1
Posted 24 November 2012 - 06:21 AM
Hello everyone !

Warning : if you enter wrong args type for pop-up, it will skip the drawing of the pop-up to avoid crash

Introducing my easy to use GUI API.
It's a medium-advanced API wich mean that it allow you to do things very easily but with less personnalisation than a basic API. It's principally designed for debutant in Lua who want to create a GUI without complicated code.

I will add features as long as I got idea so if you have a request, ask for it ! Sadly, i can code more than I can test it so if you want to help, test it for me ! Thanks ;)/>

Obviously, I let you use and modify this code, but please don't redistribute it as your own. Link to this page or at least credit me in case of you wanted to make an installer. Please just let me know ! Thanks you by advance.

Functions :
SpoilerAll the color args are optionals, will set it to white and black if not specified
Also the a and b args mean "end x" and "end y", the bottom right corner of the button.

gui.getVersion() gives you the version of the API, useful to check if a function is present or not.

gui.render(reset) Use it to draw the content of the buffer to the screen, if reset is set to true, it will reset the buffer.

gui.sRender() Same as above but this one doesn't reset the buffer. removed in 1.4.1

gui.drawButton(startx, starty, endx, endy, text, colorOfLine, colorOfBackground, clear) draw a rectangle with the text inside it. It's now an internal function, you could use this to draw a button without the buffer. Set clear to true will clear the screen before drawing the button.

gui.setButton(x, y, text, colorLine, colorBackground) It remplace the draw function, it draw into the buffer. Remplace gui.draw by this in your code.

gui.setButtonc(x, y, a, b, text, colorLine, colorBackground) Same as above but clear the screen before, useful for new menu. Removed in 1.4.1

gui.drawButtonc(startx, starty, endx, endy, text, colorOfLine, colorOfBackground) same as above, but clear the screen before draw the button. Useful for a new menu. removed in 1.4

gui.setHeader(text, colorLine) Use it to draw header into the buffer, it remplace the draw one.

gui.drawHeader(text, colorOfLine) draw the text at the first line and draw a line below it. Also set the cursor position to the third line. It's an internal function since 1.4.

gui.buttonClick(startx, starty, endx, endy) return true if the specified area is clicked, false if not.

gui.buttonWaitClick(startx, starty, endx, endy) same as above but will wait until the specified area is clicked, useful for use with the parallel API.

gui.fill(starx, starty, endx, endy, color) fill the area defined with the color specified. (Must be colors.grey for example)

gui.getSelection() Take all the drawn buttons with the set function, not the draw one, and return the one which has been clicked. (Look in the example spoiler)

gui.popUp(title, text, x, y, colorLine, colorBackground, textButton1, textButton2) draw a pop-up with a title has a header, a text and a specified background color wich will close when clicked. The x and y are the coords of the upper right corner. If the buttons args are specified it will return the one which has been clicked.

gui.clearBuffer() self-explanatory

gui.cPopUp(x, y, title, text, colorLine, colorBackground) same as above but the xy args are for the center of the pop-up, allowing multiple pop-up. removed in 1.5

gui.setTickBox(x, y, colorLine, isTrue) draw a tickbox wich is a little button with a green T or red F inside, depend of isTrue. If it is clicked it will change what is inside and you can get what it is by the return of the function (Will be functionnal for 1.7)

gui.initializeLog() will make the functions write what they are doing to /guiapi/log, call it to start register what the API is doing

Download :
Spoilerhttp://pastebin.com/RZYPqxCp

Beta version non-tested, could be buggy. Please report any bug, or just say "it work !"
http://pastebin.com/5TudhQRb

Planned features :
SpoilerAdd a list function (maybe)
Allow multi-lines pop-up
Tickbox as suggested by archangel (40%)
Custom error message(100%)(maybe debug needed ?)

Changelog :
SpoilerV1.6.1 in beta
Added more logs message, especially for errors
Added custom error messages
Added skipping of pop-up if args not correct

V1.6
Added log file
Added initializeLog()
Fixed animation for pop-up

V1.5
Fixed header
Added clearBuffer() requested by Oct125
Changed the way the pop-up work, now support up to 2 buttons, automatic resizement
Fixed the coords buttons don't clear when it should (thanks to Oct125)
Added an animation for the pop-up ! (Actually buggy)
Automatic resizement of the button depending on the lenght of the text

V1.4.1
Combined sRender() and render(), and setButtonc() and setButton()
Also added an animation for cPopUp. (I will combine it with popUp() later)

V1.4
Rewrite a lot of function and the buffer system
Added render() and sRender()
Added getSelection()
Fixed the coords buttons to not clear when it should (thanks to Oct125)

V1.3
Allow color customisation for button and header
Add a buffer (save the button and header datas)(thanks to ArchAngel0075)
Add the update() function, to draw the buffer's content. You don't have to normally use it, it's a internal function but you may want to use it.
Fix the pop-up glitch

V1.2
Fix the buttonClick() bug
The pop-up doesn't close as expected, even if it is clicked and detected
Fix the fill() bug
And other bugs fix I forgot

V1.1
Added two functions : popUp() and fill()
Fix a lot of bugs
The detection function still not work
The pop-up don't close

V1.0
First release

Example and screenshoots : (a bit old)
Spoiler
A colourfull one :



Example of code for getSelection :

gui.setButton(x, y, a, b, text, colorline, colorbackground) --button 1
gui.setButton(x, y, a, b, text, colorline, colorbackground) --button 2
gui.drawButton(x, y, a, b, text, colorline, colorbackground) --button 3
gui.render()
gui.getSelection() --Will return 1 if button is clicked, 2 if button 2 is clicked but will not check for button 3 as I used draw instead of set.

Any feedback and suggestions are welcome !
billysback #2
Posted 24 November 2012 - 06:26 AM
No download, has no code.
bjornir90 #3
Posted 24 November 2012 - 06:31 AM
No download, has no code.
Fixed, I do not think there will be a response as fast as that !
bjornir90 #4
Posted 25 November 2012 - 10:22 AM
Beta 1.2 out ! Download it to fix buttonClick() and buttonWaitClick() functions ! Please tell me if it work. Edit : just tested, it doesn't work …
bjornir90 #5
Posted 27 November 2012 - 06:03 AM
Again fix it, this time it work ! Report any bug you find !
bjornir90 #6
Posted 28 November 2012 - 06:02 AM
Version 1.2 released ! Fully fonctionnal, even if the popUp() function still didn't clear itself after being clicked. Will be fixed in the next release.
Zudo #7
Posted 28 November 2012 - 06:59 AM
Comeon and fix the popup glitch! THIS IS EPIC!
bjornir90 #8
Posted 28 November 2012 - 07:19 AM
Comeon and fix the popup glitch! THIS IS EPIC!
Thanks you a lot ! :)/> As say in the first post, i'm working on it but it will be hard to make it redraw things behind the pop-up because I don't know how to save what is displaying on the screen…
ArchAngel075 #9
Posted 29 November 2012 - 11:06 AM
create a buffer table i guess, im not sure how to do this but to save onscreen data make it save the current data to a buffer and then popup, once popup is gone make it rerender the saved screen buffer?

Sorry i cant give advice, although i like this program and may use it for a minigame i plan on making :)/> (especially because of the waitforclick() )
bjornir90 #10
Posted 29 November 2012 - 07:13 PM
create a buffer table i guess, im not sure how to do this but to save onscreen data make it save the current data to a buffer and then popup, once popup is gone make it rerender the saved screen buffer?

Sorry i cant give advice, although i like this program and may use it for a minigame i plan on making :)/> (especially because of the waitforclick() )
Thanks you :)/> I have got the idea of the buffer by looking on the graphic API by killavanilla but as I don't want to copy it, I don't know how to make for multiple call of the same function …
ps: I have done this function and wanted to released it but as there would be only 30 lines I got the idea to add graphic function ^^.
Oct125 #11
Posted 01 December 2012 - 06:50 AM
Epic! I will use it on my program! If possible, add a option to select the color of the button,i tested the non-beta.
bjornir90 #12
Posted 01 December 2012 - 06:54 AM
Epic! I will use it on my program! If possible, add a option to select the color of the button,i tested the non-beta.
Thanks you ! I'm implementing the color selection on all the draw function ;)/> Added in beta version !! :)/>
bjornir90 #13
Posted 04 December 2012 - 06:01 AM
V1.3 released ! Add a buffer, colours customisation and fix the pop-up glitch !
bjornir90 #14
Posted 08 December 2012 - 11:35 PM
V1.4 released ! Rewrite the way the API work. Doesn't change too much for you. Added the getSelection() and cPopUp()
ArchAngel075 #15
Posted 09 December 2012 - 06:34 AM
Nice update, i can perhaps use this in Angel-TV now but a few questions :

gui.setButton(x, y, a, b, text, colorLine, colorBackground)
-What does the a and b arguments control ?

gui.getSelection() Take all the drawn buttons with the set function, not the draw one, and return the one which has been clicked.
-Used with set function, what exactly does it return ? the cords? button name?

-Can I set Buttons WITHIN a popup? ie, provide a "Are you sure" and then options "yes" "No" "Cancel"…
–A popup with a single input is abit useless unless its a "XYZ has happened, press OK to continue" or similar…

Plus :
Above Ive highlighted some grammar or spelling mistakes that could maybe be fixed if you feel so, they have been colored red..
ArchAngel075 #16
Posted 09 December 2012 - 07:05 AM
Sorry for this double posting but :

Suggestions :
for
setButton(x, y, a, b, text, colorLine, color)
and
setButtonc(x, y, a, b, text, colorLine, color)

perhaps you can combine them into
setButton(clears,x, y, a, b, text, colorLine, color)

the function will then be :

if clears == 1 or true then --take your pick if you wish to use 1,0 or true,false for this..
term.clear()
end
if colorLine then
colorL = colorLine
else
colorL = colors.white
end
if color then
colorB = color
else
colorB = colors.black
end
table.insert(runButton, x)
table.insert(runButton, y)
table.insert(runButton, a)
table.insert(runButton, B)/>/>
table.insert(runButton, text)
table.insert(runButton, colorL)
table.insert(runButton, colorB)
table.insert(coordButton, x)
table.insert(coordButton, y)
table.insert(coordButton, a)
table.insert(coordButton, B)/>/>
end
—–
Also for clearing the buffer for
gui.render()
you can use
gui.render(s)
and check 's' for true or 1 or nil for whether it resets or not and do as needed…
bjornir90 #17
Posted 09 December 2012 - 08:34 AM
Sorry for this double posting but :

Suggestions :
for
setButton(x, y, a, b, text, colorLine, color)
and
setButtonc(x, y, a, b, text, colorLine, color)

perhaps you can combine them into
setButton(clears,x, y, a, b, text, colorLine, color)

the function will then be :

if clears == 1 or true then --take your pick if you wish to use 1,0 or true,false for this..
term.clear()
end
if colorLine then
colorL = colorLine
else
colorL = colors.white
end
if color then
colorB = color
else
colorB = colors.black
end
table.insert(runButton, x)
table.insert(runButton, y)
table.insert(runButton, a)
table.insert(runButton, B)/>/>/>
table.insert(runButton, text)
table.insert(runButton, colorL)
table.insert(runButton, colorB)
table.insert(coordButton, x)
table.insert(coordButton, y)
table.insert(coordButton, a)
table.insert(coordButton, B)/>/>/>
end
—–
Also for clearing the buffer for
gui.render()
you can use
gui.render(s)
and check 's' for true or 1 or nil for whether it resets or not and do as needed…
Thanks you a lot for the suggestion for the combination of functions, I will change to that. Also thanks for tye grammar corrections, as I'm french and only 15, I don't know everything of the english grammar :)/>. I updated the OP to make things more clear about the arguments.
For the moment you have to manually draw the button within the pop-up but I will add that, sounds cool :P/> I think I will need to make the pop-up bigger for that. I will code it today, and test it tomorrow but the beta version will be available tonight.
ArchAngel075 #18
Posted 09 December 2012 - 09:53 AM
Why not make the popup auto resize based on the options given? My API will lengthen its "box" size to stretch using the longest options string + 5. just track the "last greatest string length" for that popup?
bjornir90 #19
Posted 10 December 2012 - 09:14 AM
Why not make the popup auto resize based on the options given? My API will lengthen its "box" size to stretch using the longest options string + 5. just track the "last greatest string length" for that popup?
I'm rewriting the pop-up to make it work this way :)/>
ArchAngel075 #20
Posted 12 December 2012 - 06:10 AM
will wait for that update since those popups will be amazing to use for all the "yes, no" questions in my AngelTV :P/>
bjornir90 #21
Posted 12 December 2012 - 06:49 AM
I'm working on implement 2 buttons for the moment, but it's a bit difficult so you need to wait a bit :P/>
Oct125 #22
Posted 13 December 2012 - 04:06 AM
Downloading the beta version right now!

–Edit!!

On line 161 "the bottom line" isn't commented! Beta version!

Testing the Non-beta
bjornir90 #23
Posted 13 December 2012 - 04:21 AM
Thanks you for testing it but I think I will remove this link because it is very buggy but I fixed most of them already :)/>
Oct125 #24
Posted 13 December 2012 - 05:09 AM
Thanks you for testing it but I think I will remove this link because it is very buggy but I fixed most of them already :)/>
Ok!
Now i'm using the non-beta (1.4, i think) and it's working fine! B)/>

–Edit!

I tested the popUp function but didn't work… So i opened the code and i saw that your: gui.popUp(title, text, x, y, colorLine, colorBackground) function in this post, don't match to the code ( the "x", "y", and "colorLine")… Then i try to fix it and i got this: (Ignoring the popUp position…)

function popUp(title, text, colorLine, color)

And appears to work ;)/>
1.4 Version!

But… I'm having problems with multi line in the popUp… Any tip?
bjornir90 #25
Posted 13 December 2012 - 05:34 AM
Thanks you for testing it but I think I will remove this link because it is very buggy but I fixed most of them already :)/>/>
Ok!
Now i'm using the non-beta (1.4, i think) and it's working fine! B)/>
Thanks you ! What are you doing with my API ? Just to know :P/>
Oct125 #26
Posted 13 December 2012 - 06:11 AM
Thanks you for testing it but I think I will remove this link because it is very buggy but I fixed most of them already :)/>/>
Ok!
Now i'm using the non-beta (1.4, i think) and it's working fine! B)/>
Thanks you ! What are you doing with my API ? Just to know :P/>
I'm using your API in my OS! And working very fine! I don't create a topic for the OS yet…

Just to know… I'm using the correct code to check if the button is clicked?
Check the code:

term.setTextColor(colors.white)
gui.drawButton(2, 6, 32, 8, "1", colors.gray)
while true do
btn3 = gui.buttonClick(2, 6, 32, 8)
if btn3 == "true" then    -- Press the button
term.setCursorPos(1,19)
term.setTextColor(colors.lime)
print("Ok!")
sleep(2)
end
end

Using this code, i have to press the button many times… Any tip??
bjornir90 #27
Posted 13 December 2012 - 07:05 AM
It's the good code but it will check only one time so if you don't click it the first time, it will not detect the click. I have created this to put it in a loop, you should use buttonWaitClick(coord) to wait until the user click this button :)/>.
Oct125 #28
Posted 13 December 2012 - 10:32 AM
It's the good code but it will check only one time so if you don't click it the first time, it will not detect the click. I have created this to put it in a loop, you should use buttonWaitClick(coord) to wait until the user click this button :)/>.
Ok… But i have a problem… In the screen i have 3 buttons! And i have no idea to the program detect the button pressing!
bjornir90 #29
Posted 13 December 2012 - 07:06 PM
Ok… But i have a problem… In the screen i have 3 buttons! And i have no idea to the program detect the button pressing!
And here comes the getSelection() function ! With this powerful function, you can check every buttons actually drawn on the screen !:)/> It will return the number of your button. Look at the OP for more informations about it :P/>
ArchAngel075 #30
Posted 13 December 2012 - 11:29 PM
Suggestion :
Pages Hook, it takes the options you provide it and generates pages with buttons to select the options, it self checks how many pages to gen by
NumPages = NumOptionsGiven / NumOptionCanFitOnScreen rounded to wholeNumber

say 10 options per screen
say we given 33 options, thus 33/10 rounded = 3Pages.

Also to detect what option is what button it uses the options number, ie option 1 = button 1

I could write this myself and you can add to your API if youd like, i feel pretty motivated to try :)/> i just need to make sure no conflict occur and if youd have any other suggestions (say color support, custom buttons, custom NumOptions per page, etc)

-end-
ArchAngel075 #31
Posted 14 December 2012 - 12:00 AM
also pls update the pastebin of the non-beta to return version 1.4.1, i was confused when 'gui.render(reset)' was nil even though both versions (in pastebin and my DL file) were same :)/>Noticed the beta is 1.4.1 if im correct, sorry about that derp

Working on the angelTV update to support pastebin for pastebin movie sharing atlast! your API really makes things more easier :P/>
ArchAngel075 #32
Posted 14 December 2012 - 12:42 AM
New Suggestion :P/> :

I noticed buttons dont auto size based on text, thats ok for when you can choose how long the buttons text is but what ive the text is too long ? It just prints the text longer than the buttons length.

Perhaps have it check over the text length and button length and if text length > BLength then print the text that would be going over the button under the text
ie
'This button'

might become instead

"This Butt
on"

use
ButtonSplit[index] = string.sub(TEXT, buttonLength,string.len(TEXT))
index = index+1

its a table because we might have multiple-runovers, so keep checking the lengths till it wont run over then print text by

index = 1
for index = 1,table.maxn(ButtonSplit)
print(ButtonSplit[index])
index = index+1
end

you could also then expand the Y of the box by b = table.maxn(ButtonSplit)+1 – plus 1 is optional, its good for spacing inside buttons.

Summary of suggestion :
allow the text that is longer than a buttons length to print over to new lines within a button

-end-
bjornir90 #33
Posted 14 December 2012 - 04:56 AM
also pls update the pastebin of the non-beta to return version 1.4.1, i was confused when 'gui.render(reset)' was nil even though both versions (in pastebin and my DL file) were same :)/>/>Noticed the beta is 1.4.1 if im correct, sorry about that derp

Working on the angelTV update to support pastebin for pastebin movie sharing atlast! your API really makes things more easier :P/>/>
Thanks you for all your suggestion, but I don't understand the point of the pages… Also the beta is already 1.5 but I didn't touch to render() so … I didn't understand that too :P/>. In 1.5, everythings work but the button on the pop-up :)/>
bjornir90 #34
Posted 14 December 2012 - 05:00 AM
New Suggestion :P/>/> :

I noticed buttons dont auto size based on text, thats ok for when you can choose how long the buttons text is but what ive the text is too long ? It just prints the text longer than the buttons length.

Perhaps have it check over the text length and button length and if text length > BLength then print the text that would be going over the button under the text
ie
'This button'

might become instead

"This Butt
on"

use
ButtonSplit[index] = string.sub(TEXT, buttonLength,string.len(TEXT))
index = index+1

its a table because we might have multiple-runovers, so keep checking the lengths till it wont run over then print text by

index = 1
for index = 1,table.maxn(ButtonSplit)
print(ButtonSplit[index])
index = index+1
end

you could also then expand the Y of the box by b = table.maxn(ButtonSplit)+1 – plus 1 is optional, its good for spacing inside buttons.

Summary of suggestion :
allow the text that is longer than a buttons length to print over to new lines within a button

-end-
I have find this problem too and I think to make the button auto size with the text lenght, but I will probably add that too :P/> I think I will add you as a co-dev because of all your suggestion ;p
Oh and thanks, my goal is to make gui easy for everyone :)/>
ArchAngel075 #35
Posted 14 December 2012 - 05:13 AM
co-dev lol, that be abit hard… it takes alot to get me typing in any program XD

The pages idea was an branch of how i could have done the previewer in my program(i instead whent for mouse scrolling) and i noticed its useful for some things such as displaying lists >

If you take AngelTV for example :
It is editor mode and you wish to select a file to edit, it outputs pages containing the files names as buttons(or with buttons attached) and vy clicking a file name or button you will open the file in an editor… if the file you need isnt on that page then you can "turn" the page and search that one, it might output say 10 files per page and you want file 22 etc

but this needs some indepth and as i will write this myself and give you the code if you want to use it in your API instead of my adding it to cpsAPI(which i am dropping)
bjornir90 #36
Posted 14 December 2012 - 05:25 AM
co-dev lol, that be abit hard… it takes alot to get me typing in any program XD

The pages idea was an branch of how i could have done the previewer in my program(i instead whent for mouse scrolling) and i noticed its useful for some things such as displaying lists >

If you take AngelTV for example :
It is editor mode and you wish to select a file to edit, it outputs pages containing the files names as buttons(or with buttons attached) and vy clicking a file name or button you will open the file in an editor… if the file you need isnt on that page then you can "turn" the page and search that one, it might output say 10 files per page and you want file 22 etc

but this needs some indepth and as i will write this myself and give you the code if you want to use it in your API instead of my adding it to cpsAPI(which i am dropping)
Oh ok. That's a good idea but it shouldn't be very difficult, I will add that and we will see the one wich is better :P/> *Um Um* Finally I will let you do that because I have a lot of things to do #^^'#
Oct125 #37
Posted 14 December 2012 - 07:54 AM
Ok… But i have a problem… In the screen i have 3 buttons! And i have no idea to the program detect the button pressing!
And here comes the getSelection() function ! With this powerful function, you can check every buttons actually drawn on the screen ! :)/> It will return the number of your button. Look at the OP for more informations about it :P/>

Hm ok! Thanks and sorry for not paying attention in the functions list :P/>
ArchAngel075 #38
Posted 14 December 2012 - 08:16 AM
Ok… But i have a problem… In the screen i have 3 buttons! And i have no idea to the program detect the button pressing!
And here comes the getSelection() function ! With this powerful function, you can check every buttons actually drawn on the screen ! :)/> It will return the number of your button. Look at the OP for more informations about it :P/>

Hm ok! Thanks and sorry for not paying attention in the functions list :P/>

For future help i suggest adding this to the spoiler of the function :
gui.setButton(x,y,endx,endy,text,colorline,colorbackground)–button 1
gui.setButton(x,y,endx,endy,text,colorline,colorbackground)–button 2
gui.sRender()
gui.getSelection() –will return 1 if the button is clicked, 2 if the button 2 is clicked and so…


-end-

suggestion! : roundness, yes… i noticed we have rectangles but not round buttons, this can add a lot more, rendering out the button will be easy in my opinion, im not sure how to check its inside cords for the gui.getSelection() perhaps make it save the buttons radius as X (you can also in-depth for ovals if you save two radii X; Y…. I might write a temp of the render and the scan inside since circular buttons just climbed my priority more than pages :P/>
bjornir90 #39
Posted 14 December 2012 - 09:21 AM
I don't implement round button for 3 reasons:
1.It's too complicated for what it is
2.In minecraft, there is square and not round
3.It will be a bit ugly cause of the size of the pixel
Feel free to add it ;)/>
Oct125 #40
Posted 14 December 2012 - 09:25 AM
Ok… But i have a problem… In the screen i have 3 buttons! And i have no idea to the program detect the button pressing!
And here comes the getSelection() function ! With this powerful function, you can check every buttons actually drawn on the screen ! :)/> It will return the number of your button. Look at the OP for more informations about it :P/>

Hm ok! Thanks and sorry for not paying attention in the functions list :P/>

For future help i suggest adding this to the spoiler of the function :
gui.setButton(x,y,endx,endy,text,colorline,colorbackground)–button 1
gui.setButton(x,y,endx,endy,text,colorline,colorbackground)–button 2
gui.sRender()
gui.getSelection() –will return 1 if the button is clicked, 2 if the button 2 is clicked and so…


-end-

suggestion! : roundness, yes… i noticed we have rectangles but not round buttons, this can add a lot more, rendering out the button will be easy in my opinion, im not sure how to check its inside cords for the gui.getSelection() perhaps make it save the buttons radius as X (you can also in-depth for ovals if you save two radii X; Y…. I might write a temp of the render and the scan inside since circular buttons just climbed my priority more than pages :P/>

Thanks ArchAngel075!!
I'm programming in the right way now, but i'm having problems… And, one solution would be to create a function that clears the buffer without drawing it… So there is the suggestion :P/>


function bClear()
runButton = {}
runHeader = {}
coordButton = {}
end


–EDIT!!!

The current way to clear the buffer don't clear the buttons coordinates!!
bjornir90 #41
Posted 14 December 2012 - 09:35 AM
Thanks ArchAngel075!!
I'm programming in the right way now, but i'm having problems… And, one solution would be to create a function that clears the buffer without drawing it… So there is the suggestion :P/>/>
I also thougt of that (not sure for thougt) and you can easily do
gui.render(true)
gui.clear()
It will clear the buffer then clear the screen immediately. Or you can do
runButton = {}
runHeader = {}
coordButton = {}
I think the first is best because it will work even if I make it local :)/>
Edit : I fixed the bug with buttons coord, thanks to Oct125
Oct125 #42
Posted 14 December 2012 - 09:51 AM
Updating to the beta version and testing… :P/>

Well the bug has fixed :)/> But… Pleeease add a function to clear only the buffers!! I don't want to make this by my self, because, i will redistribute my program with my version of your API!! The function: gui.render(true) clears the screen, so don't serves me, and i need to clear the buffers! If you have any other idea, please, disconsider this and tell me!
ArchAngel075 #43
Posted 14 December 2012 - 03:02 PM
Going to write that round button part, dont think it of a circle, think it of a set of squares in a shape that just *happens* to be circular :P/>

im going to try and add alot of functionality to it, including position on screen, inner color, outline color, the size, text of button

One problem will be storing the data, since i am used to string storage (ie SIZE.."#"..Color1.."#"..Color2 ….. etc) this may be problematic…

Also i need this round button for my program thus it was going to be written anyways :)/>
bjornir90 #44
Posted 14 December 2012 - 07:01 PM
Updating to the beta version and testing… :P/>/>/>

Well the bug has fixed :)/>/>/> But… Pleeease add a function to clear only the buffers!! I don't want to make this by my self, because, i will redistribute my program with my version of your API!! The function: gui.render(true) clears the screen, so don't serves me, and i need to clear the buffers! If you have any other idea, please, disconsider this and tell me!
Ok I will add, it's really easy :P/> I will do that tonight because now, I have school so you have to wait a bit but to start implement this function, his name will be clearBuffer() :)/> Never mind, added in the beta :)/>
bjornir90 #45
Posted 14 December 2012 - 07:04 PM
Going to write that round button part, dont think it of a circle, think it of a set of squares in a shape that just *happens* to be circular :P/>/>

im going to try and add alot of functionality to it, including position on screen, inner color, outline color, the size, text of button

One problem will be storing the data, since i am used to string storage (ie SIZE.."#"..Color1.."#"..Color2 ….. etc) this may be problematic…

Also i need this round button for my program thus it was going to be written anyways :)/>/>
Ok so go for it, I want to see the result :P/> If it is not so ugly I will maybe add it. Thanks you for all your ideas anyways :)/>
ArchAngel075 #46
Posted 15 December 2012 - 02:07 AM
i want to point out the circles are imposible, they need to be HUGE to actually look like circles and the smallest word like HELLO will require a large circle…the pixels are not cut out for this…

*depressed face*

On to the page thing….
Oct125 #47
Posted 15 December 2012 - 02:46 AM
Updating to the beta version and testing… :P/>/>/>

Well the bug has fixed :)/>/>/> But… Pleeease add a function to clear only the buffers!! I don't want to make this by my self, because, i will redistribute my program with my version of your API!! The function: gui.render(true) clears the screen, so don't serves me, and i need to clear the buffers! If you have any other idea, please, disconsider this and tell me!
Ok I will add, it's really easy :P/> I will do that tonight because now, I have school so you have to wait a bit but to start implement this function, his name will be clearBuffer() :)/> Never mind, added in the beta :)/>


Thanks!!! :lol:/>
bjornir90 #48
Posted 15 December 2012 - 04:58 AM
i want to point out the circles are imposible, they need to be HUGE to actually look like circles and the smallest word like HELLO will require a large circle…the pixels are not cut out for this…

*depressed face*

On to the page thing….
That's why I didn't implement it :P/>
Oct125 #49
Posted 19 December 2012 - 12:58 PM
I found a problem in the Beta API: "gui: 48 : Attempt to get length of number"
ArchAngel075 #50
Posted 19 December 2012 - 03:35 PM
Im looking into that error now, also ill now be testing every beta and n-beta every release.

Also im going to look into improvements i can make here and there…

One i noticed is those checks like

if tostring(clears) == true then
term.clear()
end

eg on line 35 -> 37

can be perhaps improved for others by making it instead

if tostring(clears) == nil then
clears == false
elseif tostring(clears) == true then


end

this can maybe add speed to programmers and clean up abit, since you can now use a nil (no argument given) and it will default to false.

im not sure if this is really needed though :)/>


please look into the non-betas render() and setButton() functions, for some reason if the render's argument is true or "true" then the buttons dont seem to work, my guess is some how they are clearing the buffer and thus loosing the buttons information… I have confirmed its only when the clearBuffer() function is called does this happen.

lines 126 –> 139 are the render() function
lines 147 –> 155 are the setButton() function

It must be noted that this seems to happen when a button settup in a program is put in a while loop, ie

1.| while true do
2.| setButton—
3.| setButton—
4.| setButton—
5.| render(true)
6.| selection = gui.getSelection()
7.| —whatever is executed ->
8.| —based on selection
9.| end

i have a working button setup above without a loop and it works fine.
ArchAngel075 #51
Posted 19 December 2012 - 03:49 PM
bug report and fix for :
lines 34 -> 37

function : setButton

highlited errors :
(errors = red, other noted lines = blue)
—-
34.| function setButton(x, y, text, colorLine, color, clear)
35.| if tostring(clear) == "true" then
36.| clear()
37.| end
—-
Error returned :
Line 36 : attempt to call boolean
—-
Fix : (changes = green, other noted = blue)

34.| function setButton(x, y, text, colorLine, color, clears)
35.| if tostring(clears) == "true" then
36.| clear()
37.| end

Changed the arguments to "clears" instead of "clear" so that it wont call the argument but instead call the term.clear() function.


If this style of bug reports is annoying ill tone it down, but this gives me the best way of presenting the errors and fixes(if found)
ArchAngel075 #52
Posted 19 December 2012 - 04:54 PM
I found a problem in the Beta API: "gui: 48 : Attempt to get length of number"

fix for line 48 Beta version, changes are in red

local sizeText = #text

to –>

local sizeText = #tostring(text)
bjornir90 #53
Posted 19 December 2012 - 07:06 PM
Im looking into that error now, also ill now be testing every beta and n-beta every release.

Also im going to look into improvements i can make here and there…

One i noticed is those checks like

if tostring(clears) == true then
term.clear()
end

eg on line 35 -> 37

can be perhaps improved for others by making it instead

if tostring(clears) == nil then
clears == false
elseif tostring(clears) == true then


end

this can maybe add speed to programmers and clean up abit, since you can now use a nil (no argument given) and it will default to false.

im not sure if this is really needed though :)/>/>


please look into the non-betas render() and setButton() functions, for some reason if the render's argument is true or "true" then the buttons dont seem to work, my guess is some how they are clearing the buffer and thus loosing the buttons information… I have confirmed its only when the clearBuffer() function is called does this happen.

lines 126 –> 139 are the render() function
lines 147 –> 155 are the setButton() function

It must be noted that this seems to happen when a button settup in a program is put in a while loop, ie

1.| while true do
2.| setButton—
3.| setButton—
4.| setButton—
5.| render(true)
6.| selection = gui.getSelection()
7.| —whatever is executed ->
8.| —based on selection
9.| end

i have a working button setup above without a loop and it works fine.
That's because the clearBuffer() wich is used in render(true) clear also the data for getSelection(), you need to clear the buffer after the getSelection() :)/>
bjornir90 #54
Posted 19 December 2012 - 07:09 PM
I found a problem in the Beta API: "gui: 48 : Attempt to get length of number"

fix for line 48 Beta version, changes are in red

local sizeText = #text

to –>

local sizeText = #tostring(text)
I will add a check to know if it is a number or not :)/> Also thanks you alot for your bug report it will help me a lot :)/> Expect a new version today !
Ps : thanks you for testing the bêta !
bjornir90 #55
Posted 19 December 2012 - 07:19 PM
Fixed the clear bug in beta ! I will change the way the buffer work after school :)/>
Oct125 #56
Posted 21 December 2012 - 04:22 AM
I'm testing the beta, and the code still buggy in line 48/51
bjornir90 #57
Posted 21 December 2012 - 06:59 PM
Oh sorry ! I forgot to upload the fix :(/>
Oct125 #58
Posted 22 December 2012 - 02:28 PM
Oh sorry ! I forgot to upload the fix :(/>
That's ok ;)/>
But I still have problems on line 54…
bjornir90 #59
Posted 22 December 2012 - 07:02 PM
Fixed AND uploaded ;)/> I removed the useless if statement. Oh and I almost forgot : now the buttons on the pop-up should work :)/>
Oct125 #60
Posted 23 December 2012 - 04:00 AM
Fixed AND uploaded ;)/> I removed the useless if statement. Oh and I almost forgot : now the buttons on the pop-up should work :)/>
Ok!

The code keeps buggy on line 122: "Expected Number"
I get this if i set a button, and use the render function!
bjornir90 #61
Posted 23 December 2012 - 07:03 AM
yes I 'm testing it and it give me the same, I'm working on, don't worry :)/> And sorry for all of this issue, I didn't test the beta version since a long time… And thanks for your support and bugs report :)/>
bjornir90 #62
Posted 23 December 2012 - 07:08 AM
I found the problem !! You need to change your code because now, the API needs only the top left corner of the button and auto resize the button to the text lenght :)/> I forgot it myself in my code XD And also expect the 1.5 to come out this week end ! :D/>
Oct125 #63
Posted 23 December 2012 - 09:29 AM
yes I 'm testing it and it give me the same, I'm working on, don't worry :)/> And sorry for all of this issue, I didn't test the beta version since a long time… And thanks for your support and bugs report :)/>
It's all right! :D/>
I found the problem !! You need to change your code because now, the API needs only the top left corner of the button and auto resize the button to the text lenght :)/> I forgot it myself in my code XD And also expect the 1.5 to come out this week end ! :D/>
Ok! And thanks to make the button auto resizing! This will help a lot! :P/>
Do you upload the code?
bjornir90 #64
Posted 23 December 2012 - 08:19 PM
Yes yes I upload it everytime I say something is new :)/> That was only me forgot about it because of school, I didn't have time to upload it before school and then I forgot to upload the fix :P/> This shouldn't make it again ;)/>
bjornir90 #65
Posted 24 December 2012 - 07:15 AM
Fixed the header not color the whole line. Also I have a question : did the pop-up work correctly ? If so the 1.5 will come out ! :)/>
Oct125 #66
Posted 25 December 2012 - 02:59 AM
I have the same problem… The screen gives me some blue lines, and prints a error in the line 121…
bjornir90 #67
Posted 25 December 2012 - 08:55 PM
It's strange because it work perfectly for me and on this line there is only a setBackgroundColor(). Make sure you enter tthe arguments in this order : x, y, colorLine, colorBackground, clear, where clear is a bolean to know if it should clear the screen, it's optional. :)/>
Oct125 #68
Posted 26 December 2012 - 07:02 AM
Well… I forgot of the edition of the code to remove the A and B parameters :P/> And after the editions, worked fine!
But the popUp doesn't work, error in line 240… Here's my testing code:

os.loadAPI("gui")
gui.popUp("title", "text", 9, 25, colors.gray, colors.white, "Yes", "No")
bjornir90 #69
Posted 26 December 2012 - 11:10 PM
Ok thanks you a lot, I've got a new PC :P/> for christmas so I must reinstall everything so don't expect a release before a least tomorrow… What error it gives you please ?
Oct125 #70
Posted 27 December 2012 - 08:10 AM
Ok!

Error: gui:240: attempt to compare __lt on nil and number
bjornir90 #71
Posted 27 December 2012 - 08:23 AM
Should have fixed it :)/>
Oct125 #72
Posted 28 December 2012 - 08:10 AM
Error in line 269: Unexpected symbol, it's a "çl" I fix that but the code keeps buggy in line 240 :/
HotGirlEAN #73
Posted 28 December 2012 - 04:56 PM
:)/> I'll see what I can create in this API, thanks!
:P/> And if I can create something awesome looking, I'll send you screenshots so you can update the old ones. (They look kind of bland, no offense ^^;)/>
bjornir90 #74
Posted 28 December 2012 - 09:40 PM
Error in line 269: Unexpected symbol, it's a "çl" I fix that but the code keeps buggy in line 240 :/
Ok thanks you, I will test that today, I finally reinstalled everything I need :)/>
@hotgirlEAN Thanks you ! I'm happy to see this is useful :)/> And for the screenshot I took the first I could but if you can send me some screenshot that would be nice :P/>.
So expect the 1.5 for today ! :D/>
Oct125 #75
Posted 29 December 2012 - 07:43 AM
Ok!
ArchAngel075 #76
Posted 30 December 2012 - 07:20 AM
Hey, its been awhile! Im amazed to see so many changes now that ive checked in, Ill try and DL the beta and stable to see what is really new, but dont expect any reports or feedback till friday as im using my aunts data bundle(and its really small).

Updated to win7 atlast, sadly I didnt have java for win7 until now so no real testing or work for a week…

-end-
bjornir90 #77
Posted 30 December 2012 - 10:10 PM
Ok thanks you ! Sadly (or not :P/>) I've got BF3 for christmas as well as a few of my friends so the release will be late, sorry… If you really want to help I can make a debug version, so you run it and you tell me what it say :P/> So I can debug it without my pc :)/> Anyways thanks you all for your support ! :D/>
bjornir90 #78
Posted 05 January 2013 - 08:17 AM
Update ! The 1.5 is out !!! Now with automatic resizement of buttons and pop-up !
ArchAngel075 #79
Posted 05 January 2013 - 08:58 AM
I am now back in action aside from small driver issues, but anyhow :

I will play around with 1.5 ASAP, and I have two suggestions! :

TickBox
draws a 3x3 box where its centre is green or red, if ticked = green if not ticked = red,

setLists
i've no idea what to call them really.. but they are simply two boxes witha button between them, the boxes contain a list of things, like place names or what have you(user defined) and allow you to set if (for this example) placeA to true, placeB - D to false and then placeE to true again.. And one can quickly return what the value of a place is..
-Its like a multi-version of the tickbox, to change a places value you click its name in the box and click the button between the boxes(which in Windows can be two arrows going right/left)

ill elaborate more if needed…
bjornir90 #80
Posted 07 January 2013 - 02:13 AM
I'm implementing the tickbox yet :)/> for the set list, I don't really understand what you mean…
Rwkeith #81
Posted 07 January 2013 - 07:01 AM
Very nice man. Keep up the work. P.S. I got BF3 too for christmas(xbox) =D
bjornir90 #82
Posted 07 January 2013 - 08:10 AM
Thanks you :)/> I got it for pc, it run in ultra :P/>
ArchAngel075 #83
Posted 07 January 2013 - 02:11 PM
For that setlist idea ill try to put together a concept of it, perhaps make the code for it and you can add to your api, but it will take a month at least since my prog comes first in everything(except anime XD)
ArchAngel075 #84
Posted 08 January 2013 - 08:04 PM
Ok i have the concept for the setlist box i was talking about,

i use "#"s instead of coloured pixels since the drawPixel() seems to overwrite anything with that colour.

here is the code, quick and simple..

NOTE : to use the program you select a item in a list(one of the two boxes) and then then if you click on the "%" in the middle it will swap over to the other side… this idea can be useful for moving objects or things around bbetween two lists of things… My personal use would be to have the two lists represent EnabledMovies and DisabledMovies in AngelTV…

small edits were made, since its mostly intended for angelTV, but if you can maybe get it to work in the API it will be more useful and usable..

Spoiler

term.setCursorPos(1,1)
term.clear()
setA = {"OneFo","TwoFo","ThreeFo"}
Borders = {}
setB = {"FourFo","FiveFo","SixFo"}
maxWordA = 0
maxWordB = 0

--Check if Directory and lengths
for i = 1,table.maxn(setA) do
--if fs.isDir(setA[i]) == true then
  if string.len(setA[i]) > maxWordA then
	maxWordA = string.len(setA[i])
  end
--end
end
--next set
for i = 1,table.maxn(setB) do
--if fs.isDir(setB[i]) == true then
  if string.len(setB[i]) > maxWordB then
	maxWordB = string.len(setB[i])
  end
--end
end
function drawSetBox()
for i = 3,maxWordA+5 do
  term.setCursorPos(i,1)
  print("#")
  term.setCursorPos(i,table.maxn(setA)+2)
  print("#")
end
for i = 1,table.maxn(setA) do
  term.setCursorPos(3,i+1)
  print("#")
  term.setCursorPos(maxWordA+5,i+1)
  print("#")
end
for i = 1,table.maxn(setA) do
  term.setCursorPos(4,i+1)
  print(setA[i])
end
-- next set
g = 1
for i = 3+maxWordA+6 , 3+maxWordA+maxWordB+8 do
  term.setCursorPos(i,1)
  print("#")
  term.setCursorPos(i,table.maxn(setB)+2)
  print("#")
end
for i = 1,table.maxn(setB) do
  term.setCursorPos(maxWordA+9,i+1)
  print("#")
  term.setCursorPos(11+maxWordA+maxWordB,i+1)
  print("#")
end
for i = 1,table.maxn(setB) do
  term.setCursorPos(maxWordA+10,i+1)
  print(setB[i])
end
term.setCursorPos(maxWordA+7,(maxWordA+maxWordB)/4)
print("%")
broken = false
  local event,mouse,mx,my = os.pullEvent("mouse_click")
   term.clear()
  term.setCursorPos(1,15)
   -- check if first box
   --print("if " .. mx .. " == " .. maxWordA+7 .. " and " .. my .. " == " .. (maxWordA+maxWordB)/4 .. " " .. maxWordA+maxWordB)
	print(bsele)
   if mx >= 3 and mx <= maxWordA+4 then
	indexC = my-1
print(indexC .. " INDEX " .. my )
	bSele = "A"
print(setA[indexC])
   elseif mx >= 3+maxWordA+7 and mx <= 10+maxWordA+maxWordB then
	indexC = my-1
print(indexC .. " INDEX " .. my )
	bSele = "B"
print(setB[indexC])
   elseif mx == maxWordA+7 and my <= ((maxWordA+maxWordB)/4)+1 and my >= ((maxWordA+maxWordB)/4)-2 then
if bsele == "A" or "B" and indexC ~= nil then
  Switch(bSele,indexC)
end
   end
end

function Switch(set,indexG)
bsele = nil
if set == "A" then
  print("swapped A |INDEX>" .. indexG)
  table.insert(setB,setA[indexG])
  table.remove(setA,indexG)
elseif set == "B" then
  print("swapped B |INDEX>" .. indexG)
  temp = setB[indexG]
  table.insert(setA,setB[indexG])
  table.remove(setB,indexG)
end
end
while true do
drawSetBox()
end
bjornir90 #85
Posted 09 January 2013 - 07:34 AM
I will look what it make tomorrow :)/> Anyways thanks you :D/>
ArchAngel075 #86
Posted 09 January 2013 - 11:16 AM
i discovered how to make the SWAP button centre more properly using the % operator… everything in the program autosizes, even the position of the SWAP button(it tries to stay centred) though there is no way to pull what is the current position of an option and i know of a way to allow the managing of multiple sets(a simple reset table and add the new values while externally saving old values)

i will maybe post the updated version unless you wish to take up on it since mine uses # and you can perhaps adapt it to use pixels like in your API
Oct125 #87
Posted 10 January 2013 - 05:35 AM
I am now back in action aside from small driver issues, but anyhow :

I will play around with 1.5 ASAP, and I have two suggestions! :

TickBox
draws a 3x3 box where its centre is green or red, if ticked = green if not ticked = red,

setLists
i've no idea what to call them really.. but they are simply two boxes witha button between them, the boxes contain a list of things, like place names or what have you(user defined) and allow you to set if (for this example) placeA to true, placeB - D to false and then placeE to true again.. And one can quickly return what the value of a place is..
-Its like a multi-version of the tickbox, to change a places value you click its name in the box and click the button between the boxes(which in Windows can be two arrows going right/left)

ill elaborate more if needed…

The tick box will be really useful!
And Bjornir, i've made a installer in my OS that copies the API from your pastebin ok?
bjornir90 #88
Posted 10 January 2013 - 05:37 AM
I am now back in action aside from small driver issues, but anyhow :

I will play around with 1.5 ASAP, and I have two suggestions! :

TickBox
draws a 3x3 box where its centre is green or red, if ticked = green if not ticked = red,

setLists
i've no idea what to call them really.. but they are simply two boxes witha button between them, the boxes contain a list of things, like place names or what have you(user defined) and allow you to set if (for this example) placeA to true, placeB - D to false and then placeE to true again.. And one can quickly return what the value of a place is..
-Its like a multi-version of the tickbox, to change a places value you click its name in the box and click the button between the boxes(which in Windows can be two arrows going right/left)

ill elaborate more if needed…

The tick box will be really useful!
And Bjornir, i've made a installer in my OS that copies the API from your pastebin ok?
Ok that's fine for me :)/>
Rwkeith #89
Posted 11 January 2013 - 08:29 AM
Is it possible to draw an image to the screen?
ArchAngel075 #90
Posted 11 January 2013 - 11:10 AM
using paintutils.loadImage(path) you can

first use
xyz = paintutils.loadImage(path) – where xyz can be any variable.

then use
paintutils.drawImage(image, x, y) – image being that xyz you specified above, and x,y is the topleft most point to start rendering it from afaik.

all info on the paintutils is found on paintutils

if this is not what you meant then please try to elaborate.

-end-
ArchAngel075 #91
Posted 11 January 2013 - 11:01 PM
New request :

Drag n Replace lists

It will render a list using an table, if user selects two items in the list they will swap places within the table…

I am already writing a concept for it, i have render down i just need to add the dlGetSelection()
,

it will hopefully presave the last known selection so that any other actions can be done within. I may add a cancel using mouse2 or backspace etc.. it is still a concept piece though…
bjornir90 #92
Posted 12 January 2013 - 06:56 AM
using paintutils.loadImage(path) you can

first use
xyz = paintutils.loadImage(path) – where xyz can be any variable.

then use
paintutils.drawImage(image, x, y) – image being that xyz you specified above, and x,y is the topleft most point to start rendering it from afaik.

all info on the paintutils is found on paintutils

if this is not what you meant then please try to elaborate.

-end-
Thanks you for support in my post ;)/>
ArchAngel075 #93
Posted 12 January 2013 - 07:08 AM
im browsing by often, awaiting any updates and suggestions to conceptualize.. BTW

yet another suggestion ill concept(i love conceptualizing ideas XD) :

drag panes, it will at first be a square or rectangular box drawn on screen with a title, if clicked upon it will "drag" the pane out and render a list of buttons. if the sqaure is again clicked it closes.
(the closest name would be drop down tabs)

-One can perhaps support too many buttons(making it render off screen) by catching the screen size, and then making an auto scroll bar to scroll within the panel…

id be happy to try my hand at the auto scroll bar system since it can come in handy?
,

the drag n Replace concept is priority atm.
-
bjornir90 #94
Posted 12 January 2013 - 10:31 AM
im browsing by often, awaiting any updates and suggestions to conceptualize.. BTW

yet another suggestion ill concept(i love conceptualizing ideas XD) :

drag panes, it will at first be a square or rectangular box drawn on screen with a title, if clicked upon it will "drag" the pane out and render a list of buttons. if the sqaure is again clicked it closes.
(the closest name would be drop down tabs)

-One can perhaps support too many buttons(making it render off screen) by catching the screen size, and then making an auto scroll bar to scroll within the panel…

id be happy to try my hand at the auto scroll bar system since it can come in handy?
,

the drag n Replace concept is priority atm.
-
I've thougt of it also, but the tick box is my priority :)/>
ArchAngel075 #95
Posted 12 January 2013 - 02:21 PM
OK!, a small question, will you use getSelection() for all selection-related events ? since then i might be able to use it to make conceptuals better…Also do you have any clue to how to prioritise buttons so that popup-related-buttons overlapping normal buttons will fire first since they overlap? or is this internally handled already?

I havent really looked at thelatest version of the API, i might be able to find some tweaks if possible… else ill look into linking my concepts into them for better compatibility…
bjornir90 #96
Posted 12 January 2013 - 06:54 PM
OK!, a small question, will you use getSelection() for all selection-related events ? since then i might be able to use it to make conceptuals better…Also do you have any clue to how to prioritise buttons so that popup-related-buttons overlapping normal buttons will fire first since they overlap? or is this internally handled already?

I havent really looked at thelatest version of the API, i might be able to find some tweaks if possible… else ill look into linking my concepts into them for better compatibility…
I'm not going to use getSelection() because it erase the buffer for the detection part. So you need to redeclare everythings already drawed to the screen if I use it. As the tickbox should be clickable as well as other buttons, I don't really know how I will do that actually :P/>. Oh and for the popUp, only the buttons on popUp are clickable, it is internally handled by popUp()
ArchAngel075 #97
Posted 12 January 2013 - 07:46 PM
I was thinking that if an event is used in a while loop to get the mouseX and mouseY, then it will use if thens- to check the coords to see if they are part of a list of :

popups;dragmenus;tickbox;button

it will prioritise what will be found first on the overlaying buttons using elseif> if it is higher in the elseif chain then it will handle the button as that type and then continue to process which button of that type was pressed exactly and then return a value.. it could be possible to use ids like you have for buttons, but can you maybe also return a type for future versions ? this is so each type has an internal buffer, and id list… will be easier removing specific ones in a list..

but if a universal id is made, if you use a seperate table that tracks types > if buttonID[5] was a tickbox then buttonType[5] is a tickbox, just match the index?

honestly ill play around with ideas…Maybe look at the API and see where we can exploit anything to get it.
bjornir90 #98
Posted 13 January 2013 - 09:54 AM
Well I like the idea of universal id and it shouldn't be too difficult to make…. I will definitely make it, in the 2.0 version :P/>
ArchAngel075 #99
Posted 13 January 2013 - 02:07 PM
cool, Ive been playing on servers so much i haven't any work done on conceptuals…. Perhaps I'll finish up drag menu tonight..

actually question is if conceptuals help at all :P/>
bjornir90 #100
Posted 14 January 2013 - 05:43 AM
Yes, yes it's useful, it just take time to add new features as I work on multiples projects so this is especially useful :)/>
JohnSmith41Junk #101
Posted 18 February 2013 - 07:26 AM
Hi! I am trying to use your CCBackup program, which requires this API. However, I am stuck, because I dont know how to install it. I am on the computercraft emulator, and it wont let me copy the guiapi file into /rom/apis/. Halp!
bjornir90 #102
Posted 18 February 2013 - 08:14 AM
Well to install it, the easiest way is to active the http API, and use pastebin get <pastebin code> and the name of the program, for use it with ccBackup you need to call it gui or it won't work.
bjornir90 #103
Posted 22 May 2013 - 01:20 AM
Just to say that i'm back on it ! I will finish the tickbox soon. :)/>
Oct125 #104
Posted 22 May 2013 - 05:33 PM
Just to say that i'm back on it ! I will finish the tickbox soon. :)/>

:D/>
bjornir90 #105
Posted 24 May 2013 - 11:10 AM
The tickbox is taking more time than wanted so I decided to add a log system, everything is in the op :)/>
bjornir90 #106
Posted 25 May 2013 - 12:30 PM
If someone could say to me if the log file is clear enough and if you have improvements and suggestions, go on ! I need feedback !! :)/> (Also i'm working on fixing the tickbox)
bjornir90 #107
Posted 26 May 2013 - 07:22 AM
Version 1.6 released Add a log system, tickbox drawing and preparation for 1.7.
EpicPigChops #108
Posted 01 June 2013 - 07:58 PM
Does this have any Monitor support?
bjornir90 #109
Posted 04 June 2013 - 11:53 AM
I haven't tested with monitor but it should run fine with term.redirect :)/>