Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Dustpuppy

New ultimate Gui

Recommended Posts

Here we are!!! :D

I am finished for the first release....(i hope)

If you want to test it, just do "pastebin run Kz9E2JGL" on the computer in your minecraft world. You need an internet card for this.
This will install all needed files in /usr/lib/windowmanager and /etc/windowmanager.

During the installation you will be ask for the admin user name and the password. You can choose, whatever you want, but best is to use your mc username, because the software will add user to the computer using (funny sentence), like useradd in OS does.

After finishing the installation just start it with "windowmanager"

Minumum requirements for the computer are, a tier 2 screen, a modem, a keyboard 640k ram and a user who use it. ;)

 

I will do a proper documentation, how to make own programs, after i got some response and when i find the time.

For now, just have a look into /usr/lib/windowmanager/programs/program_frame.lua.

It's a frame work for making new programs. Or have a look into the other files in this directory.

 

Here's a list of functions that are available. Not complete, but i am working on the documentation.

 

Enjoy and have fun.

Quote

Basic functions:


wm.startGui()
Start the window manager and the program manager. (Not needed, if you use the program_frame.lua file, because windowmanager will do this allready.

wm.exitGui()
Close the gui system. Attention: You need to reboot after all. Trying to fix this problem.

wm.setTopText(text)
Set the text on top of the screen.

wm.redraw()
Redraw the whole screen.
-------------------------------------------------------------------------------


Functions for windows:


wm.newWindow(x, y, w, h, text)
Create a new window.

wm.raiseWindow(self)
Show window on screen.

wm.closeWindow(self)
Close a window.

wm.lowerWindow(self)
Lower a window.

wm.resizeWindow(self, w, h)
Set a new size to the window.

wm.disableWindowButtons(self, state)
Disable/enable the close and the lower button.

wm.setWindowSticky(self, state)
Disable movement of window.

wm.hideWindow(self, state)
Hide a window from the window list, even when it is lowered.

wm.setOnCloseCallback(self, callback)
Callback that will called, when window is closed. If callback returns false, the window will stay open.

wm.setOnLowerCallback(self, callback)
Callback that will called, when window is lowered.

wm.setOnResizeCallback(self, callback)
Callback that will called, when a window is raised to the screen.

wm.getWindowInfo(self)
Returns x,y,w,h,text and number of elements of a window.

wm.setWindowResizable(self, state)
Enables on screen resizable of the window. If true, you can click the lower-right corner of a window
and drag/drop to new size. This is normaly disabled, because the screen will heavaly flicker.

wm.getActiveWindow()
Returns the active window.

wm.addElement(self, element)
Adds an element to the window.

wm.newElement(id, x, y, w, h, text, callback)
This is normaly not needed. It's internal called from the gui system. Coders who want to make own
elements can use it.

-------------------------------------------------------------------------------

Functions for menus

wm.newMenu(x, y, w, text, callback)
Creates a new menu. Callback will get the number of the selected entry as agument.

wm.insertMenu(self, entry)
Insert an entry (just text) into the menu.

wm.removeMenu(self, entry)
Removes the entry from the menu.

wm.clearMenu(self)
Clears a full menu from all entries.

wm.setMenuCallback(self, callback)
Se the callback of the menu.

wm.drawMenu(self)
Displays a menu on screen.

wm.menuSetPosition(self, x, y)
Changes the position of the menu.

wm.menuUseFrame(self, state)
Set to true to use frames and the menu text, or false for just a menu with only the entries.

-------------------------------------------------------------------------------

The modem functions are not needed to be used, but the collection of packet information will
not work without.

wm.modemSend(addr, port, ...)
wm.modemBroadcast(port, ...)
Both functions are the same then the standard modem functions. They just collect some extra infos.

wm.getModemPackets()
Returns sended packets, received packets, sended bytes, received bytes. Numbers are only correct, if
you use the modemSend and modemBroadcast functions.


-------------------------------------------------------------------------------

Program manager functions.
If you have made a program for the gui system and you want to have it in your next program to without
copying the code into your new program, you can simply use your code with some changes in the program manager.
Have a look into plugin_framework.lua

wm.newSymbol(icon, program)
Creates a new symbol in the right-bottom corner of the screen. Icon is a single character and program the full
path to the lua program.

wm.setSymbolIcon(self, icon)
Change the icon.

wm.setSymbolProgram(self, program)
Change the program to start.

wm.drawSymbol(self)
Draw a symbol. Usefull to redraw symbols from programs to window manager.


-------------------------------------------------------------------------------

Functions for element manipulation.
Most of the names are telling you, what they do.
self is allways the element it self.
win is allways the window the element belongs to.
alignment can be "left", "center" or "right".
autowordwrap will fit the text into the element. great for labels.
state is allways true or false.

guiElements.newElement(id, x, y, w, h, text)
guiElements.newRadioGroup(x, y, w, callback)
guiElements.newList(x, y, w, h, text, callback)
guiElements.newInput(x, y, w, text, callback)
guiElements.newCheckbox(x, y, text, callback)
guiElements.newHBar(x, y, w, h)
guiElements.newVSlider(x, y, h, callback)
guiElements.newHSlider(x, y, w, callback)
guiElements.newFrame(x, y, w, h)
guiElements.newLine(x, y, w)
guiElements.newLabel(x, y, w, h, text)
guiElements.newButton(x, y, w, h, text, callback)

guiElements.drawElement(win, self)
  Draws an element. Call it after changeing something on an element, to redraw it.
guiElements.setElementBackground(self, background)
guiElements.setElementForeground(self, foreground)
guiElements.setElementActiveBackground(self, background)
guiElements.setElementActiveForeground(self, foreground)
guiElements.setElementX(self, x)
guiElements.setElementY(self, y)
guiElements.setElementW(self, w)
guiElements.setElementH(self, h)
guiElements.setElementText(self, text)
guiElements.setElementCallback(self, callback)
guiElements.setElementAlignment(self, alignment)
guiElements.setElementMax(self, max)
guiElements.setElementMin(self, min)
guiElements.setElementValue(self, value)
guiElements.setElementState(self, state)
guiElements.setElementSteps(self, steps)
  Stepsize for bars and sliders.
guiElements.setElementAutoWordWrap(self, state)
guiElements.setElementSelected(self, state)
guiElements.setElementProtected(self, state)
  If true, input fields will only display *. good for passwords.
guiElements.getElementBackground(self)
guiElements.getElementForeground(self)
guiElements.getElementActiveBackground(self)
guiElements.getElementActiveForeground(self)
guiElements.getElementX(self)
guiElements.getElementY(self)
guiElements.getElementW(self)
guiElements.getElementH(self, h)
guiElements.getElementText(self)
guiElements.getElementAlignment(self)
guiElements.getElementMax(self)
guiElements.getElementMin(self)
guiElements.getElementValue(self)
guiElements.getElementState(self)
guiElements.getElementAutoWordWrap(self)
guiElements.getElementType(self)
guiElements.getLastElement()
guiElements.getElementProtected(self)
guiElements.getElementSelected(self)

guiElements.insertElementData(self, data)
guiElements.removeElementData(self, num)
  For lists
 
 
 
--------------------------------------------------------------------------------------------  
Functions for coders who want make their own elements. Have a look into the guiElements.lua file
to see, how they work. Normal users don't need this functions.

guiElements.setElementType(self, type)
guiElements.setElementDrawCallback(self, callback)
guiElements.setElementHandleCallback(self, callback)
guiElements.setElementUserData1(self, data)
guiElements.setElementUserData2(self, data)
guiElements.setElementUserData3(self, data)
guiElements.getElementUserData1(self)
guiElements.getElementUserData2(self)
guiElements.getElementUserData3(self)
guiElements.setElementIgnoreMouseBlock(self, state)
guiElements.getColors()

wm.blockMouse(state)
wm.setMouseCallback(callback)
wm.getColors()

 

 

IcWOGCw.png

2Aav1wE.png

 

SKJNoD7.png

Link to post
Share on other sites

I think, i am getting crazy. :blink:

Worked a bit on the gui system. It will come much easier to make (let's call them) programs for it. The gui it self is a multi user windows system with driver integration and some nice features. But still can be used as stand alone windows based gui.

 

 

Multi user  driver working to register user to the computer and the gui with differend level.

IvXtcmC.png

fKekENh.png

Z0DsANf.png

 

 

Printer management for openprinter with print queue.

Owv4KaQ.png

AXQXuwc.png

sutTxnD.png

 

 

Start menu. Just make you gui based programs and add them to the menu.

2RQNuF7.png

 

Network driver with own messaging system

IyL5dTL.png

GgvQVmh.png

 

Drivers will be registered to the gui. Use only, what you need.

mkgxReS.png

 

 

Or use it just as a simple gui, with no driver, no start menu and no managment programs.

CkJVEAK.png

Link to post
Share on other sites

Nice work, i'm currently try to work with this. apperently i struggle a bit. 
Would it be posible that you upload you source code (Of the programs in the screenshots) to github?

I would like to work with the start menu, but it seem that i can't start any program with it.

It would be nice to see the source codes of your made programs, so i can look through it and maybe i can finde my mistake.

I'm realy looking forward to make some nice programs with this gui.

Keep up this great work.

Link to post
Share on other sites

At the moment i am working on the gui, to get it faster in screen redraw and background buffering.

I've packed my full working environment into an archive.

http://carr-ireland.com/mc/all.zip

Unzip it to the home directory of the oc computer and start test.lua.

There are 2 frame work files.

program_frame.lua is how to make a program.

plugin_framework.lua is for making a symbol program.

In test.lua you can see, how to insert them.

After first start of test.lua open the user manager and add your self as user. Then delete line 31 ( wm.setUserName("") ) and uncomment user.login() in line 30 and restart the computer and the test.lua to get the multiuser environment running.

Exit is not working at the moment, but i fix this after getting other things done.

Before i forget. There's a bug in the print manager. Don't remove a printer, after add one. Close and restart the print manager first. Sometimes it hangs.

And you need a modem in the computer.

 

Link to post
Share on other sites

Thanks for your fast reply, i gonna look through this files and play around with them.

I will wait patiently, for new updates for the documentary and API.

In my opinion, its just crazy good what you have made here.

I hope you can keep going with this API, otherwise it would be a huge lost.

But take your time with it.

Link to post
Share on other sites

THIS IS SO COOL

 

I really do wonder how well it would work with Plan9k as it has (IMO) better threading support, proper virtual component support and component/event sandboxing/namespaces (so a program can/can't see selected components, events can be filtered/translated(like mouse clicks)). Would you mind if I try to port this api there?

 

Oh, and why won't you put this on OpenPrograms/OPPM?

Link to post
Share on other sites

Give me time. In my point of view it's not finished yet. But if you want, you can port it to Plan9k. Would be great. Don't forget, that i change allways things and specialy add functions to the differend libs, that i am missing during making programs for it.

When it is finished, i will have a look to move it into oppm.

 

Link to post
Share on other sites

O_O Wow, this is far and away a big step forward from the old api. And the window manager you've put together is essentially a rather functional shell to go over openos. Especially with that terminal window you got there. I'll definitely have to dig around in this and learn how it works. Such awesomeness happened while I was taking a break from minecraft stuff.

Link to post
Share on other sites

Darn it, I just started using the one from 2016 just to find this XD
Good thing I put my code into it's own library as a safety measure and now happy I did

Edit:
Can't seem to get a window to even show up, even with using the program_frame.lua.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.