Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 23:38:06 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 8 9 [10] 11 12 ... 21   Go Down
  Print  
Author Topic: Updating WZGUILib - Updating would like input  (Read 12390 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #135 on: 18 July, 2012, 02:28:20 »
0

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?
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 22:50:27
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Total Post Ratings: +180

View Profile WWW
« Reply #136 on: 18 July, 2012, 16:05:25 »
0

Sorry for the late reply.

]
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:

1
2
3
4
5
6
7
8
 --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.

Well, I think you want is a 'screen manager' (well, that's what certain Lua coders call it).
Here is the code for a very simple one: (warning, not tested might contain a bug)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

--Screen manager code

screens = {}

function current_screen()
    return screens[#screens]
end

function push_screen(screen)
    table.insert(screens, screen)
    platform.window:invalidate()
end

function pull_screen()
    platform.window:invalidate()
    return table.remove(screens)
end

Screen = class()

function Screen:paint() end
function Screen:arrowKey() end
function Screen:enterKey() end

function on.paint(gc)
    for _, screen in ipairs(screens) do
        screen:paint(gc)
    end
end

function on.arrowKey(arrow) current_screen():arrowKey(arrow) end
function on.enterKey() current_screen():enterKey() end

-- User code

main = Screen()

function main:paint(gc)
    gc:drawString("Hello World", 10, 10, "top")
end

function main:enterKey()
    push_screen(sub)
end

sub = Screen()

function sub:paint(gc)
    gc:fillRect(10,10,20,20)
end

function sub:enterKey()
    pull_screen()
end

push_screen(main)

Take a look at this tutorial too: http://www.inspired-lua.org/2012/02/how-to-create-a-screen-manager/
And if you want at https://github.com/adriweb/EEPro-for-Nspire/tree/master/Global%20Libraries (screen.lua and widgets.lua) for example of a real life implementation.

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?

Regarding the scrollbar, check out my implementation of it in widgets.lua (in the above link). Basically, I have three parameters for my scroll bar.
total: the amount of lines/whatever I need to scroll
visible: the amount of lines/whatever that you can see
top: the current line/whatever that you are on.

With this information I easily can calculate how to draw my scrollbar.

I haven'y noticed the toggle switch.
« Last Edit: 18 July, 2012, 16:06:06 by jimbauwens » Logged

jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #137 on: 18 July, 2012, 18:57:27 »
0

I all ready implement a screen manager, it just looks a little diffrent from yours because it considers every form a screen, and has to switch between the forms.
What I mean is that say I have something like form:paint(gc), which is already there, everytime it is called to repaint the form, it would call something like form1_paint(gc), giving WZ its own 'events'.
The toggle switch is on the very bottom of the class definitions in the last file that I uploaded, I have some creation code commented out.
It looks like:

1
2
3
4
    --toggle test 0.1
    --t1 = toggle(50, 100, true, form1)
    --t2 = toggle(1, 1, false, Tabs.atab)

thanks for the link to your scrollbars class, I think it will help.
« Last Edit: 18 July, 2012, 18:59:07 by jwalker » Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #138 on: 21 July, 2012, 06:28:37 »
0

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 Smiley, 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.


* fform_c.png (2.15 KB, 320x240 - viewed 96 times.)
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 14 June, 2013, 17:56:38
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1202


Total Post Ratings: +186

View Profile WWW
« Reply #139 on: 21 July, 2012, 08:58:18 »
0

Well that's a very nice idea Cheesy
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #140 on: 22 July, 2012, 03:41:12 »
0

thank you
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 28 May, 2013, 18:19:14
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Total Post Ratings: +158

View Profile WWW
« Reply #141 on: 22 July, 2012, 11:18:49 »
0

imo the title isn't toooooo big, is it? i think it fits fine, it does not overflow the area, so that's good enough i think..

it's nice to see the progress, i just can't test your latest versions because i'm staying at OS 3.1 for  ndless reasons
Logged

jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #142 on: 22 July, 2012, 18:38:53 »
0

Thats what Im doing with my CX, and I added the files to the bottom Smiley.
The WZ_ST_LIB should work on all versions.

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 calc
place WZ_ST_LIB.tns inot your MyLib folder
Refresh your libraries
execute WZ_LibTST

*I havnt yet implemented it.
the setup instructions are at the bottome

* WZ_LibTST.lua (35.64 KB - downloaded 9 times.)
* WZ_ST_Lib.tns (3.95 KB - downloaded 8 times.)
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 28 May, 2013, 18:19:14
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Total Post Ratings: +158

View Profile WWW
« Reply #143 on: 22 July, 2012, 23:23:06 »
0

that's what i did, and it tells me this:

"You must update your software to the latest version to view this document.
WZ_LibTST.tns.
Visit education.ti.com to update."

so i guess that's because of the os
Logged

jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #144 on: 23 July, 2012, 00:06:28 »
0

ok, I know whats going on....
I think the problem is that it is trying to open the WZ_ST_LIB.tns file to read the variables, because the lua script that I just posted should work on all versions.
So here is what You will have to do, to have 'Styles' and the dynamicaly loaded strings.
Make a new file called WZ_ST_LIB.tns (this way you dont have to change anything in the WZ_LibTST lua file) and paste the code snipits into it from the file that I provided.

I divided each one out with: ------------------------------------------name of control----------------------------------------------

copy everything into the file and then press enter, this way the variable is created, and do the same for all variables.

This is also how it would work with any style that some one may develop, the variable names would remain the same but the drawing code may be diffrent and the name of the library may be diffrent.

Also feel free to mess around with the drawing code, in the future I will make sure to include this file, and a file that works with <=3.2 calcs.
Also in the future I will add all some of the event code, because if you made a rounded window, you cant check the click the same as you would with a standard window

* to_be_pasted.txt (14.28 KB - downloaded 24 times.)
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 22:29:06
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50643


Total Post Ratings: +2640

View Profile WWW
« Reply #145 on: 23 July, 2012, 00:18:04 »
0

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 Smiley, 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.
If you got Virtual PC you can actually run Windows XP mode on Windows 7 and you have unlimited PRIZM emulation there, since once your trial expires, you just need to start a new image and get rid of the previous one
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #146 on: 23 July, 2012, 01:47:19 »
0

true, but I am using home premium...
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 22:29:06
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50643


Total Post Ratings: +2640

View Profile WWW
« Reply #147 on: 23 July, 2012, 01:48:56 »
0

Ah that sucks. I actually had Home too but upgraded.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Topic starter
Total Post Ratings: +12

View Profile
« Reply #148 on: 23 July, 2012, 02:14:40 »
0

I thought about, but decided not to in the end (dont want to spend the money Tongue)
« Last Edit: 23 July, 2012, 02:14:47 by jwalker » Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 June, 2013, 19:34:32
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Total Post Ratings: +88

View Profile
« Reply #149 on: 23 July, 2012, 02:20:13 »
0

I thought about, but decided not to in the end (dont want to spend the money Tongue)
I would suggest VirtualBox, which is pretty nice. Once you install XP, just download the emulator and then shut down the VM. Copy the virtual HDD to a safe place, and then keep using (install and use). Once you're out, backup any progress from the current VM, delete said VM, and then use the old one to repeat. Wink

If you don't have an XP CD/image... be creative. Tongue
Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
Pages: 1 ... 8 9 [10] 11 12 ... 21   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.533 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.