0 Members and 1 Guest are viewing this topic.
So I had a thought about something that I may do.I havent realy been able to test out the style system that I proposed, although today I may get Time, but this idea could go hand in hand with it.What I was thinking about doing was hidding the main events that drive WZ (on.click, on.paint, etc...), and do this instead:Code: [Select] --create a window in on.create, which will still be 'visible' to the user window = form(...) --then after on.create we would have the new 'events' window_paint(gc) window_click(x, y)--where x and y is the location of the pixel in the forms body window_etc.....all controls would also work similar, so it is kind of like VB.net, or C#.I thought that this could be released in a WZGUILIB_EventDriven stylepack, or maybe it could be integrated into all WZ versions, although that would be a more radical aproach.
--create a window in on.create, which will still be 'visible' to the user window = form(...) --then after on.create we would have the new 'events' window_paint(gc) window_click(x, y)--where x and y is the location of the pixel in the forms body window_etc.....
--Screen manager codescreens = {}function current_screen() return screens[#screens]endfunction push_screen(screen) table.insert(screens, screen) platform.window:invalidate()endfunction pull_screen() platform.window:invalidate() return table.remove(screens)endScreen = class()function Screen:paint() endfunction Screen:arrowKey() endfunction Screen:enterKey() endfunction on.paint(gc) for _, screen in ipairs(screens) do screen:paint(gc) endendfunction on.arrowKey(arrow) current_screen():arrowKey(arrow) endfunction on.enterKey() current_screen():enterKey() end-- User codemain = Screen()function main:paint(gc) gc:drawString("Hello World", 10, 10, "top")endfunction main:enterKey() push_screen(sub)endsub = Screen()function sub:paint(gc) gc:fillRect(10,10,20,20)endfunction sub:enterKey() pull_screen()endpush_screen(main)
Does anyone know the best way to implement scroll bars? I was thinking about how to do it, but im not quite sure how to calculate when the scroll bars gets larger and smaller depending on what is in the scrollable area.Also for those who tried the dev release/preview, what did you think about the toggle switch, if you noticed it?
--toggle test 0.1 --t1 = toggle(50, 100, true, form1) --t2 = toggle(1, 1, false, Tabs.atab)
Excuse my double post...I am happy to announce that I hav successfully got the 'lib' system to work.Currently, I have only moved the paint code to the lib, but I will move the rest later.This is a proof of concept release, it is a v3 development version.I tested these two files on both the computer and my old light blue greyscale nspire.What this could allow is: Easily create styles for WZGUILIB. Easily switch styles durring execution. Editing how the GUI objects look and work on calc (great for me and style developers). Allow multiple styles on one calc without having to have several diffrent versions of WZGUILIB. *Allow to only have some class code loaded.Questions and comments are definately welcome**********************How to set up**********************send both files to your calcplace WZ_ST_LIB.tns inot your MyLib folderRefresh your librariesexecute WZ_LibTST*I havnt yet implemented it.
So today I came home after work and decided to take a look at what WZGUILIB might look like in C, for use on the prizm, and I definately think that porting it wont be that difficult. But I ran into a problem....My Prizm emulator trial ran out and I dont want to ruin my prizm.So as an effect of that, I will be writting out the first C version in Nspire C , and once school starts I will download the prizm emulator on one of the schools computers and directly port WZ to the prizm. The WZ headers them selves will have barely any platform specific code in them, so I can easily port it.The only problem right now is.... nRGBLib draws out its chars way to large, in the image, the title is bieng drawn out at a size of 1. I only drew out the body, frame and title of the form, as you can see. It will have the two circle buttons in the end.
I thought about, but decided not to in the end (dont want to spend the money )