Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jwalker

Pages: 1 ... 19 20 [21] 22 23 ... 45
301
News / Re: TI: A step back towards the TI community?
« on: June 17, 2012, 09:43:36 am »
TI is only locking it down because teachers want this, isn't it?

That and programs like OSlauncher and PTT Killer can be created.

302
News / Re: TI-Nspire OS 3.2 is out!
« on: June 12, 2012, 08:46:56 pm »
they probably think everyone is going to switch to lua. lol

303
Lua / Re: Updating WZGUILib
« on: June 12, 2012, 08:09:06 pm »
yea, I will.
Also it seems to be with the third paramater of the gc:drawString function

304
Lua / Re: Updating WZGUILib
« on: June 12, 2012, 07:12:29 pm »
not realy, some of the strings dont draw out in the same place as they used to. All I did was change on.create to on.construction in the "UseThisFile.lua" file I uploaded and I got rid of platform.gc() along time ago, but that is ok because it gives me a real good reason to go back and change the looks of some controls.

305
Lua / Re: Updating WZGUILib
« on: June 12, 2012, 03:15:54 pm »
So after I found out that os 3.2 seems to draw things out diffrently than the os's < 3.2. Well I guess that the light at the end of the tunnel is that I can add some new stuff to the current controls.

306
Lua / Re: Taking my hand at Lua
« on: June 08, 2012, 02:16:04 pm »
It is, but he can use it as a reference once he learns more about how to program.

307
Lua / Re: Taking my hand at Lua
« on: June 08, 2012, 01:58:40 pm »
So here is a very very very basic type of menu. It has no sub-menus because I didnt have the time to do it today.
This should be written as a class, but since you probably dont know how to make classes, I didnt write it that way to make it less confusing.
Code: [Select]
menu = {{text = "small", selected = true, id = 1},
        {text = "larger", selected = false, id = 2},
        {text = "even larger",  selected = false, id = 3},
        {text = "sml", selected = false, id = 4}}--our menu
       
menuDrawn = false--menu flag

function on.paint(gc)
    gc:setFont("serif", "r",7)
    if menuDrawn then
        --dynamicly find the width
        local width = 0
        local strHld = 0
        for i = 1, table.maxn(menu) do
            strHld = gc:getStringWidth(menu[i].text)
            if strHld > width then
                width = strHld + 1
            end
        end
       
        strHld = gc:getStringHeight("Hh") --find the strings height
        local height = strHld * table.maxn(menu)--find the total height
        --fill grey rectangle
        gc:setColorRGB(175, 175, 175)
        gc:fillRect(0, 0, width, height)
        --draw black rectangle
        gc:setColorRGB(0, 0, 0)
        gc:drawRect(0, 0, width, height)
        --draw the strings
        local y = 5
        for i = 1, table.maxn(menu) do
            if menu[i].selected then --reverse video
                gc:fillRect(0, y - 6, width, strHld)
                gc:setColorRGB(255, 255, 255)
                gc:drawString(menu[i].text, 1, y, "middle")
                gc:setColorRGB(0, 0, 0)
            else
                gc:drawString(menu[i].text, 1, y, "middle")
            end
            gc:drawLine(0, y + 7, width, y + 7)
            y = y + strHld
        end
    end
end

function on.contextMenu() --pressed ctrl+menu
    menuDrawn = not(menuDrawn)
end
function on.arrowUp() --up arrow was pressed
    local fnd = findCurSelection()
    if menu[fnd].id ~= 1 then
        menu[fnd - 1].selected = true
    else
        menu[table.maxn(menu)].selected = true
    end
    menu[fnd].selected = false
    platform.window:invalidate()
end
function on.arrowDown() --down arrow was pressed
    local fnd = findCurSelection()
    if menu[fnd].id ~= table.maxn(menu) then
        menu[fnd + 1].selected = true
    else
        menu[1].selected = true
    end
    menu[fnd].selected = false
    platform.window:invalidate()
end
function on.enterKey() --enter key was pressed
    menu[findCurSelection()].text = "You pressed Enter"
    platform.window:invalidate()
end
function findCurSelection() --find the current selected item
    for i = 1, table.maxn(menu) do
        if menu[i].selected then
            return i
        end
    end
end

since this is a very basic outline, you could do alot with it.

308
Lua / Re: Taking my hand at Lua
« on: June 08, 2012, 10:14:51 am »
I could probably make a very simple example and post it, also go to inspired-lua.org for the toolpallete question, even though it has been updated for 3.2, not alot has changed when it comes to creating the toolpallete

309
Lua / Re: Taking my hand at Lua
« on: June 08, 2012, 10:11:28 am »
do you mean like create, one of the toolpallete menus that are in the calculator app, or create your own from scratch?

310
Lua / Re: Taking my hand at Lua
« on: June 08, 2012, 10:08:17 am »
that would do it, i had just tried it and didnt get any errors

311
Lua / Re: Taking my hand at Lua
« on: June 08, 2012, 10:03:27 am »
one quick question, what os version are you using?

312
News / Re: TI-Nspire OS 3.2 is out!
« on: June 06, 2012, 10:07:15 pm »
im happy but sad.... I will update only one of my nspires

313
News / Re: First Nspire OS 3.2 demo on a calculator
« on: June 06, 2012, 04:28:14 pm »
just to say, i love my nspires
also idk, everyone is saying something diffrent about when the os is comming out

314
Computer Programming / Re: Help learning X86 Asm
« on: June 06, 2012, 12:58:53 am »
True, but alot of critical stuff cant be written in C/C++. I may start with linux to get an idea about what I would be getting into, but later I would probably write one from scratch.
I probably wont try this though for a couple of years, so I know I have a very good understanding of C/C++ and asm.

315
Computer Programming / Re: Help learning X86 Asm
« on: June 06, 2012, 12:50:22 am »
That and I would like to write my own OS one day.

Pages: 1 ... 19 20 [21] 22 23 ... 45