pedrosgali 8 Posted September 7, 2014 Share Posted September 7, 2014 Minejaro 0.1 Manjaro style front end for OC. ++ UPDATED ++ Now with text editing! Minejaro is currently only 5 files: A library to handle all the window spawning and such. The screen library must live in your /lib folder and be called screen.lua, it returns many functions that can be called by any window. you call it like any other library local scr = require("screen") local eg = scr:newPane(eg, width, height) --This creates a new 'Pane' that has the following functions attached... --BASIC FUNCTIONS-- eg:resize(width, height) --will resize your pane eg:move(xPos, yPos) --will move your pane around the screen eg:center() --will center your pane on the screen eg:box(stx, sty, width, height, colour) --will add a box to your pane making a numbered table called eg.boxTab within. eg:text(xPos, yPos, bgCol, fgCol, text) --will add text to your pane. --NOTE: to clear this text you will need to set eg.printTab to nil and re write your text to it --OR: know which entry in the table it is (they are numbered in the order you create them.) and nil that (eg.printTab[yourValue] = nil) eg:centerText(stx, sty, endx, bgCol, fgCol, text) --will add text centered between stx and endx eg:render() --will draw your pane --DATA READOUT FUNCTIONS--Chat logs etc. eg:addTextBox(label, xPos, yPos, width, height, bgCol, fgCol) --will establish a data readout box that you can print to. --these are brilliant for debug boxes and chat logs. text scrolls if you exceed the box height in lines of text eg:printText(label, text) --will print text in the textbox with a matching label. --BUTTONS-- eg:button(label, stx, sty, width, height, colour, returnValue, textCol) --will make you a button on screen. establishes eg.buttonTab numbering all buttons as they are created --textCol defaults to black so unless you need coloured text you can miss it out. eg:buttonClick(clickX, clickY) --This goes in your run loop give it the x and y coords of a "touch" event and it will return the buttons returnValue or false if no button was clicked --TEXT INPUTS-- eg:inputBox(identifier, xPos, yPos, width, height, scale, bgCol, fgCol) --Adds a text input box to your pane, leave scale as _ if you dont want your box to change size on a resize event. --Text inputs are stored in the numbered table eg.textInputs eg:addText(char) --adds a single character to the currently selected input box, --WARNING: Using io.read() will lead to horrific screen tear!!! with this API if you want to input text you MUST pull each keystroke --as an event... there is an example further down VV eg:textInputClicked(clickX, clickY) --goes in your run loop again, will return boolien if a box was clicked it becomes selected for the purposes of addText(char) --IMAGES-- eg:loadImage(label, path, xPos, yPos) --will load any image made in paintPlus and display it in your pane. --Thats a basic list of the functions I think people will use most, there are more if you want to look if you have any trouble just post. --LOADING YOUR OBJECT INTO MINEJARO-- --Minejaro opens a global table on startup called 'st' short for screen table. --This table holds all the pane data for every open pane. --Each pane needs an inbuilt function called 'run' which Minejaro will pass all event data to. --Heres an example: --now if you are not using Minejaro then just call this function run and loop it following an event.pull with all the same parameters --and your program will run. function eg:run(ev, p1, p2, p3, p4, p5) if ev == "touch" then if self:clicked(p2, p3) then --Will check if the screen click is within the pane ret = self:buttonClicked(p2, p3) --Will check for buttons at screen click if ret == "your buttons returnValue" then --do your code for that button. self.needRender = true --set this line if you want minejaro to draw your pane at this point. return true --This is important so Minejaro knows there was a click and it can stop looking. end if self.textInputClicked() then return true end --if you have text inputs then you*ll need this line. self.grabbed = not self.grabbed --toggles self.grabbed, built in movement sensor for drag and drop. end elseif ev == "drag" then if self.grabbed then --If grabbed is toggled true then term.clear() --Clear the screen. self:move(p2, p3) --Move the pane. self.needRender = true --tell Minejaro to draw the outline of it. return true --Tell Minejaro its all good. end elseif ev == "drop" then self.grabbed = false --we*re not grabbed any more. elseif ev == "key_down" then local char = keyboard.keys[p3] if char == "enter" then --do some cool stuff return true -- Remember to tell Minejaro that it found what it is looking for end if keyboard.isShiftDown() then self:addText(string.upper(keyboard.keys[p3])) else self:addText(keyboard.keys[p3]) end end end --I hope that makes sense to you, with that template you*ve got a pane with as many buttons as you --put in all being checked and executed, it*s a grabbable object that can be moved round the --screen and can input text into text boxes. There is a lot you can do with that. --To load your pane into the global filetable (st) it needs an id... eg.id = #st + 1 --then the last line of your program should read... st[eg.id] = eg --Which loads it as a separate entity into the global screen table. A manager program that allows programs to run. manager must live in your /bin folder. Run 'manager' to start it. 'konSoul' - a console program. konSoul is my first draft at a console program, it has a few quirks at the minute. all prints from programs print to your desktop not the console which is a bug I'm going to fix but is actually kinda fun. Needs to live in /bin folder. 'Porpoise' - a file browser. Lives in /bin folder again. Porpoise is the basic file browser from paintPlus with the addition of a text input box at the top for typing the path. left clicking will open folders or run programs right clicking will open folders or open files in edit 'Ate' - A Text Editor lives in /bin again It's a text editor, not much to describe. To those that like pastebin: Here's the pastebin links Screen.lua -- Install to /lib/screen.lua Manager -- Install to /bin/Manager konSoul -- Install to /bin/konSoul Browser -- Install to /bin/Browser Ate -- Install to /bin/Ate For those that don't I will be putting it on oppm as soon as I can figure out that pesky table. That's it for now but I'm currently working on a notepad program so you can have multiple text files open at once. It is possible for you to write your own programs that run in Minejaro, you could have reports and controls from all your different base areas set up as seperate windows. (I know I will.) I included some brief info on the library in the spoiler above, I'll write a guide here later if anyone has trouble getting programs to run. Quote Link to post Share on other sites
pedrosgali 8 Posted September 13, 2014 Author Share Posted September 13, 2014 Added basic text editor so you can now check a file without leaving the editor, just bring up a new window. Quote Link to post Share on other sites
Wobbo 8 Posted September 14, 2014 Share Posted September 14, 2014 Since this has a shell, I guess it is more like a Desktop Environment than an OS, is this right? Or is it more like X.org? In any case, some pictures would be nice Anyway, I might try this out later. When time is available. Quote Link to post Share on other sites
pedrosgali 8 Posted September 14, 2014 Author Share Posted September 14, 2014 Actually it's a window manager, no desktop as such. It is literally a front end GUI for openOS.It does allow multiple 'window' programs to all be running at once and I do plan to add a desktop environment at a later date.I just can't figure out how to get icons and shortcut without the framerate going down the toilet. Yet. You're right about the pictures though, I need some screen shots. I'll put some up after work. Quote Link to post Share on other sites
pedrosgali 8 Posted September 14, 2014 Author Share Posted September 14, 2014 Added a pretty picture so you have some idea as to what this is. Please excuse the bad resolution, I broke my good monitor so I'm stuck on low res. Quote Link to post Share on other sites
Molinko 43 Posted September 15, 2014 Share Posted September 15, 2014 This is beautiful. I'm going to play with this asap Quote Link to post Share on other sites
aussieevil 0 Posted September 29, 2014 Share Posted September 29, 2014 Would it be possible to add some border functions to this in the future? Quote Link to post Share on other sites
Cat 3 Posted November 11, 2014 Share Posted November 11, 2014 Oh my... someone who actually made a nice looking post Nice job on the Windows style, but it looks like something that's just ported from CC. Nice amount of effort though, screenies included, font styling and a good presentation of your program.I hope to see you return to the forums and continue working on this! Quote Link to post Share on other sites
Pigpork 0 Posted July 14, 2016 Share Posted July 14, 2016 put a autorun. It did not work Quote Link to post Share on other sites