Dustpuppy 16 Posted July 23, 2016 Share Posted July 23, 2016 BIG UPDATE! I've worked out some updates and a new visual editor for the gui system. To use the gui just download http://pastebin.com/Dfgc6z0T to a computer as /lib/gui.lua and try your best. If you don't want to fight with the placing of elements on the screen, then you want to use the visual editor. It's alpha state, but i hope it will make no errors. The editor will create a full lua code as frame work for your own program in resolution 80x25 like for a tier 2 screen. But you need a tier 3 screen to use the editor it self. The program you can run then on a tier 2 or tier 3 screen. Please try it and let me know, what you think. It's a bit flickry when updating the screen, but i hope i get this fixed. You can download the editor at https://pastebin.com/jdaM8FKG If you like it, let me know and tell me, what i could change, or what you want me to put into the gui or the editor. Have fun sigmasoldier, CocoVanChoco, JackCarterSmith and 2 others 2 3 Quote Link to post Share on other sites
Dustpuppy 16 Posted August 30, 2016 Author Share Posted August 30, 2016 Made some changes :-) Internal display handling changed to prevent the flickering. Now only the changed element is refreshed, not the whole gui anymore. Added the checkbox. Still the same download link on pastebin GreaseMonkey 1 Quote Link to post Share on other sites
Dustpuppy 16 Posted August 31, 2016 Author Share Posted August 31, 2016 And the next update :-) Insert a vertical progress bar, that can display value from top to bottom or bottom to top. Quote Link to post Share on other sites
Dustpuppy 16 Posted August 31, 2016 Author Share Posted August 31, 2016 And one more. As you see, i have nothing to do at the moment ;-) Insert radio buttons. Now it's enough. I have no idea what else is missing. If you have ideas let me know. sigmasoldier 1 Quote Link to post Share on other sites
TheRealKANi 0 Posted November 7, 2016 Share Posted November 7, 2016 Hey Dustpuppy.. I seriously like your design..! I currently implementing a lot of computers to control our energy, economy, item, shops, farms, trains, roads and a lot of production and storage systems. Your gui is exactly what I'm looking for, I was developing my own like you. But time constraints in the family aspect of life has left me searching alternatives. Would you be so kind to send me the code for that image you have attached. I know I can create it from your code, but again. Time is not on my side. I will let you know if I run into some bugs/errors, new features etc... Thanks in advance Kenneth Quote Link to post Share on other sites
Dustpuppy 16 Posted November 17, 2016 Author Share Posted November 17, 2016 Here's the code of the screenshot. local component = require("component") local gpu = component.gpu local gui = require("gui") local prgName = "Gui-lib v" local version = gui.Version() function exitButtonCallback(guiID, id) local result = gui.getYesNo("", "Do you really want to exit?", "") if result == true then gui.exit() end gui.displayGui(myGui) end myGui = gui.newGui(2, 2, 78, 23, true) exitbutton = gui.newButton(myGui, "center", 21, "exit", exitButtonCallback) label1 = gui.newLabel(myGui, 2, 1, "A label") label2 = gui.newLabel(myGui, 2, 3, "A colored label", 0xFF0000, 0xFFFF00) frame = gui.newFrame(myGui, 2, 5, 40, 6, "A frame") checkbox1 = gui.newCheckbox(myGui, 3, 7, false) cbLabel1 = gui.newLabel(myGui, 7, 7, "Checkbox") checkbox2 = gui.newCheckbox(myGui, 3, 8, true) cbLabel2 = gui.newLabel(myGui, 7, 8, "Second checkbox") text = gui.newText(myGui, 2, 12, 25, "Text input") progress = gui.newProgress(myGui, 2, 16, 35, 100, 0, nil, true) list = gui.newList(myGui, 50, 3, 25, 10, {"Entry 1", "Entry two", "Number 3", "44444"}, nil, "A List") vprogress1 = gui.newVProgress(myGui, 44, 3, 10, 100, 0, nil) vprogress2 = gui.newVProgress(myGui, 46, 3, 10, 100, 0, nil, 1) radioframe = gui.newFrame(myGui, 48, 14, 25, 6) radio1 = gui.newRadio(myGui, 50, 15) radio2 = gui.newRadio(myGui, 50, 16) radio3 = gui.newRadio(myGui, 50, 17) radio4 = gui.newRadio(myGui, 50, 18) radioLabel1 = gui.newLabel(myGui, 54, 15, "Radio button 1") radioLabel2 = gui.newLabel(myGui, 54, 16, "Radio button 2") radioLabel3 = gui.newLabel(myGui, 54, 17, "Radio button 3") radioLabel4 = gui.newLabel(myGui, 54, 18, "Radio button 4") hline = gui.newHLine(myGui, 5, 20, 40) gui.clearScreen() gui.setTop(prgName .. version) local counter = 0 while true do gui.runGui(myGui) counter = counter + 1 if counter <= 100 then gui.setValue(myGui, progress, counter) gui.setValue(myGui, vprogress1, counter) gui.setValue(myGui, vprogress2, counter) end if counter > 110 then counter = 0 end end Quote Link to post Share on other sites
BrisingrAerowing 12 Posted December 17, 2016 Share Posted December 17, 2016 How about adding some charts? I would do so myself if I knew how to do GUI programming in OpenComputers. I may still try and do that as an extension to this library. Quote Link to post Share on other sites
Dustpuppy 16 Posted December 18, 2016 Author Share Posted December 18, 2016 Good idea. At the moment i don't have time to play or for coding. If you want, make the lib bigger, or make some extentions. As soon as i have time again, i will see, what i can do :-) Quote Link to post Share on other sites
Enykey 0 Posted December 19, 2016 Share Posted December 19, 2016 Bug in relaunch gui app. You need set property "displayed = false" with each launch gui app Quote Link to post Share on other sites
BrisingrAerowing 12 Posted December 19, 2016 Share Posted December 19, 2016 I'll have to get my base set up and a OC computer configured first. I have a lot of work to do on my base still (it is a large underground hidden bunker). Quote Link to post Share on other sites
Dustpuppy 16 Posted March 11, 2017 Author Share Posted March 11, 2017 On 19.12.2016 at 0:50 PM, Enykey said: Bug in relaunch gui app. You need set property "displayed = false" with each launch gui app What kind of bug? Can't find, what you mean. Quote Link to post Share on other sites
Dustpuppy 16 Posted March 11, 2017 Author Share Posted March 11, 2017 I have updated the lib. Now it has charts and some file handling for saving tables. The documentation for the functions i do later. At the moment i am moving house and i have not that much time. Download link is still the same. To see all features i've made a program to control passive reactors with up to 25 rods. http://pastebin.com/2xEFeZC9 Quote Link to post Share on other sites
BrisingrAerowing 12 Posted March 11, 2017 Share Posted March 11, 2017 Awesome! Hope the move goes well and nothing gets broken! Quote Link to post Share on other sites
Aether 1 Posted May 9, 2017 Share Posted May 9, 2017 After booting up the PC the gui works fine, when I start the program again it just won't work until I reboot the PC. Quote Link to post Share on other sites
Dustpuppy 16 Posted May 9, 2017 Author Share Posted May 9, 2017 Will check this, when i have time. Do you have the code of your program? Quote Link to post Share on other sites
Aether 1 Posted May 10, 2017 Share Posted May 10, 2017 This is the code, I only tweaked the colors in the gui.lua but didn't touch anything else. local component = require("component") local gpu = component.gpu local gui = require("gui") local prgName = "Door control" local version = "0.1" local sides = require("sides") local term = require("term") local event = require("event") local i = 0 local io = require("io") function toggleRedstone(guiID, id) for address in component.list("redstone",true) do rs = component.proxy(address) rs.setOutput(5,15) end end function untoggleRedstone(guiID, id) for address in component.list("redstone",true) do rs = component.proxy(address) rs.setOutput(5,0) end end function buttonCallback(guiID, id) local result = gui.getYesNo("", "Sure?", "") if result == true then gui.exit() end gui.displayGui(myGui) end myGui = gui.newGui(2, 2, 160, 42, false) exitbutton = gui.newButton(myGui, "center", 38, "exit", buttonCallback) tButton = gui.newButton(myGui, 1, 2, "Open", toggleRedstone) untButton = gui.newButton(myGui, 1, 3, "Close", untoggleRedstone) gui.clearScreen() gui.setTop(prgName .. " " .. version) while true do gui.runGui(myGui) end Quote Link to post Share on other sites
Dustpuppy 16 Posted May 10, 2017 Author Share Posted May 10, 2017 Fixed Quote Link to post Share on other sites
Aether 1 Posted May 10, 2017 Share Posted May 10, 2017 4 hours ago, Dustpuppy said: Fixed Can I get a link? Quote Link to post Share on other sites
Dustpuppy 16 Posted May 11, 2017 Author Share Posted May 11, 2017 I've updated the pastebin download. Aether 1 Quote Link to post Share on other sites
Aether 1 Posted May 11, 2017 Share Posted May 11, 2017 Oh, thanks then Quote Link to post Share on other sites
Dustpuppy 16 Posted June 21, 2017 Author Share Posted June 21, 2017 During coding a transporter system for RF Tools i found a little error in the list part. Corrected it and uploaded again. Same Pastebin then before. Quote Link to post Share on other sites
Dustpuppy 16 Posted July 3, 2017 Author Share Posted July 3, 2017 Have done some work on the gui. Most internal, but also put in a vertical slider, a chart and some other elements. Download link is the same as allways. Here's an overview of all functions. I will do a proper documentation, if i find the time, but i think my code is good enough to understand it. Quote Version 2.3 --------------------------------------------------------------------------- Example: --------------------------------------------------------------------------- local component = require("component") local gpu = component.gpu local gui = require("gui") local prgName = "Test" local version = gui.Version() function buttonCallback(guiID, id) local result = gui.getYesNo("", "Do you really want to exit?", "") if result == true then gui.exit() end gui.displayGui(myGui) end myGui = gui.newGui(2, 2, 78, 23, true) button = gui.newButton(myGui, "center", 21, "exit", buttonCallback) gui.clearScreen() gui.setTop(prgName .. " " .. version) while true do gui.runGui(myGui) end --------------------------------------------------------------------------- --------------------------------------------------------------------------- Functions: --------------------------------------------------------------------------- gui.checkVersion(major, minor) gui.checkHardware(comp, msg) gui.clearScreen() gui.exit() gui.setTop(text) gui.setBottom(text) gui.runGui(guiID) gui.displayGui(myGui) gui.closeGui(guiID) gui.newGui(x, y, w, h, frame, text, bg, fg) gui.newCheckbox(guiID, x, y, status) gui.newRadio(guiID, x, y) gui.newLabel(guiID, x, y, text, bg, fg) gui.newMultiLineLabel(guiID, x, y, w, h, text, bg, fg) gui.newButton(guiID, x, y, text, func) gui.newText(guiID, x, y, lenght, text, func, fieldLenght, hide) gui.newProgress(guiID, x, y, lenght, maxValue, value, func, number) gui.newVProgress(guiID, x, y, lenght, width, maxValue, value, func, direction) gui.newVSlider(guiID, x, y, lenght, min, max, value, func) gui.newList(guiID, x, y, width, height, tab, func, text) gui.newFrame(guiID, x, y, width, height, text) gui.newHLine(guiID, x, y, width) gui.newChart(guiID, x, y, minValue, maxValue, data, lenght, height, bg, fg) gui.getSelected(guiID, listID) gui.setSelected(guiID, listID, selection) gui.setMax(guiID, widgetID, maxValue) gui.setChartData(guiID, chartID, data) gui.setValue(guiID, widgetID, value) gui.resetProgress(guiID, progressID) gui.setText(guiID, widgetID, text) gui.getText(guiID, widgetID) gui.getCheckboxStatus(guiID, widgetID) gui.setEnable(guiID, widgetID, state) gui.setVisible(guiID, widgetID, state) gui.setBackground(guiID, widgetID, color) gui.setForeground(guiID, widgetID, color) gui.clearList(guiID, listID) gui.insertList(guiID, listID, value) gui.getRadio(guiID) gui.setRadio(guiID, radioID) gui.showError(msg1, msg2, msg3) gui.showMsg(msg1, msg2, msg3) gui.getYesNo(msg1, msg2, msg3) gui.crypt(str, k, inv) gui.string2key(str) gui.saveTable(tbl,filename ) gui.loadTable( sfile ) gui.splitString(str, sep) gui.sepString(str) Quote Link to post Share on other sites
BrisingrAerowing 12 Posted July 7, 2017 Share Posted July 7, 2017 This project keeps getting better and better! Keep up the good work, and keep on crafting! Quote Link to post Share on other sites
Dustpuppy 16 Posted July 9, 2017 Author Share Posted July 9, 2017 Looks like, i will leave it, like it is now. Have started a new gui, because this one is not flexible enough If someone want to test the new one, it's here https://pastebin.com/J4SXwzHa Dokumentation is on top of the file. At the moment it only has 2 elements, a button and a label, but i am working on more. When i've finished it, i will make a new threat. Quote Link to post Share on other sites
Dustpuppy 16 Posted July 10, 2017 Author Share Posted July 10, 2017 Someone allready taken a look at the new gui? I need feedback :-) Quote Link to post Share on other sites