Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Database] Candle Sparks
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Delos




PostPosted: Thu Jul 07, 2005 12:40 pm   Post subject: [Database] Candle Sparks

Well, here it is. Several weeks worth of production. It took me bloody long to code this, and by the end I'd learnt some very important concepts dealing with maintenance, redundant arrays, and file management.

[sigh]

Ok, without furthur ado, or is it adieu?
I present Candle Sparks, Version 2.2.5. Don't ask what happened to the other 2.2.4 versions. They are now a happily forgotten memory of mine.

I've attached a Setup file instead of a zip, for reasons that will be alluded to in the ReadMe.
As for the ReadMe, please do Read It. You may be a little lost otherwise.

Please post any bugs/comments here. I am aware of one serious bug involving that main datafile, but that only ever occurs when you try to scew around with it without knowing what you're doing Very Happy.
I'll post a patch at some point or another. For now, just be happy that it works...

Enjoy
~Delos~

Edit: Oh yeah, all GUI is custom made.

Edit: 10 July 2005



Version 2.2.6 released. Minor changes, mainly stability. Several other areas to be ironed out in future releases, including wrapping in menus, more responsive text fields, and improved file integrity checks.
Please make a back up of your data.txt file, uninstall your old version, install the new version, and import your data file in. Or you could just reinstall over the last version, should work as well.



setup.zip
 Description:
V 2.2.6, updated 10 July 2005

Download
 Filename:  setup.zip
 Filesize:  469.23 KB
 Downloaded:  282 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Jul 07, 2005 1:22 pm   Post subject: (No subject)

Oh no! Ali Baba's birthday is coming up! Quick Delos, add a feature that will tell me what to buy him! Laughing
*ahem*
Nice stuff Delos.
Sadly, I've a few bugs to pick. Well, only one of them is actually a bug. When manipulating the database (from within the program) if you select edit, you can scroll down past the entries that exist, to blank spaces. Hitting enter will then produce a run-time error: array subscript is out of range.
Also, I'm finding your textfields to be fairly unresponsive. That is, if I press a key followed by another key in quick succession, it won't register. Is the delay in your loop too large, or perhaps some other reason?
Regarding the menus, I like being able to move to the bottom of the menu, hit the down arrow, and be transported to the top. Useful with (semi-)large menus. Similarly for being at the top and hitting the up arrow.
Also, using the mouse for buttons and textfields would be nice, but not necessary. Very Happy

Now, my real concern. I've added users with birthdays of July 9, July 8, and even July 7. And yet, they do not appear in the "Birthdays coming up soon" table. Thinking
Delos




PostPosted: Thu Jul 07, 2005 1:31 pm   Post subject: (No subject)

You must be doing something wrong Ali B- *ahem* Cervantes. Did you 'Save' the edits after you entered them (as noted by the readme file?). I just tried entering 3 entries, 7th, 8th, 9th, and all work.
Tony




PostPosted: Thu Jul 07, 2005 4:42 pm   Post subject: (No subject)

weird, birthdays are not coming up for me ether.

Controls require improvement. Kind of difficult to navigate and select options.

As for bugs -- make the main window close when quit is selected. I think it's an option at compile time.

Another suggestion -- message prompts. Such as "last name not entered!" when trying to save a new entry. Also make your disabled buttons more obvious. I didn't catch on at first.

Otherwise it's looking good. Maybe not so much blue though.
Delos




PostPosted: Thu Jul 07, 2005 4:45 pm   Post subject: (No subject)

Very strange...I'll do some checks and repost a setup file. As for the blue...well, I like the blue! And there's a lot of red too...well, somewhat a lot Laughing.

Edit:
Well, I did a fresh install and tested it...and it worked Thinking .
PM me your data.txt files (or at least their contents) perhaps something will make sense then...[sigh]
And Cervantes, no more wise-cracks! This may not be mind-blowing, but it's damn well useful! Laughing
MysticVegeta




PostPosted: Sat Jul 09, 2005 5:02 pm   Post subject: (No subject)

oh cool, it starts up with Windows Smile But i navigated my way to the
CurrentVersion -> Run key in the registry editor but i couldn;t find a startup value for this program Confused
Delos




PostPosted: Sat Jul 09, 2005 5:54 pm   Post subject: (No subject)

Start -> Programs -> Startup
MysticVegeta




PostPosted: Sun Jul 10, 2005 1:14 pm   Post subject: (No subject)

haha lol, that never occured to me.
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Jul 10, 2005 5:09 pm   Post subject: (No subject)

Updated to 2.2.6, read initial post for list of changes.
Token




PostPosted: Sat Jul 16, 2005 12:34 am   Post subject: (No subject)

wow delos, this is really amazing! I may actually use this, but anyways, umm just a few ideas, you shoud put an option, notify me # days before event... or somthing to that affect, also your menue is a little off. what i found when making menu's is that its not always the delay within the loop, because on faster computers its impossible to control and on slower computers its anoyingly slow. so why dont you try somthing like this

code:

loop
    loop
   
    exit when a key is pressed
   
    end loop
   take in that key and move up or down one space here
    loop
   
    exit when no keys are being pressed down
   
    end loop
end loop


this way it dosent work off of a delay it works in accordance to how many times the key is pressed and released. here is an example

code:

var chars : array char of boolean

var pos, dir : int := 1



loop

    drawfillbox (100, 0, 200, 100, black)
    drawfillbox (200, 0, 300, 100, black)
    drawfillbox (300, 0, 400, 100, black)
    drawfillbox (100 * pos, 0, 100 + (100 * pos), 100, red)


    loop

        Input.KeyDown (chars)

        if chars (KEY_DOWN_ARROW) then
            dir := -1
            exit
        elsif chars (KEY_UP_ARROW) then
            dir := +1
            exit
        end if
        locate (1, 1)
        put "Pos: ", pos, "  Dir: ", dir
    end loop

    if dir = 1 and pos < 3 or pos > 1 and dir = -1 then
        pos += dir
    end if
    locate (1, 1)
    put "Pos: ", pos, "  Dir: ", dir


    loop
        Input.KeyDown (chars)
        if not chars (KEY_DOWN_ARROW) and not chars (KEY_UP_ARROW) then
            exit
        end if
        locate (1, 1)
        put "Pos: ", pos, "  Dir: ", dir
    end loop
end loop


other than that i didnt find any bugs, and i really like your GUI, good luck!
Cervantes




PostPosted: Sat Jul 16, 2005 9:46 am   Post subject: (No subject)

Token: that's only semi-functional. If you've got a big menu and you want to scroll from the top to the middle, you've got to repeatedly tap the down arrow. It would be better if you held the down arrow and it moved you down constantly.
(btw, did you take this idea from my snake game? Smile)
It may be better like this:
code:

loop
    loop
        exit when (an arrow key is pressed) or (a certain amount of time has passed)
    end loop
    %handle the key
end loop

The other advantage of doing it this way is your program is not waiting for input. You can have other things occuring in this same loop, such as getting mouse input.
Token




PostPosted: Sat Jul 16, 2005 10:25 am   Post subject: (No subject)

ha no Cervantes, i didnt steal it from you. i used this idea in my menu for my FP, you may remember the hellecopter game, somone had mentioned it not being about delays but more about keystrokes and thats what i came up with... acutally it may have been you. but anyhow, i see what you mean how with a large menu it could get very agrivating, so maybe you'll want to incorporate it so that when the mouse is over that one its selected, or have both the mouse and the keys working at the same time. you said that in your example it isnt waiting for input? well neither is mine, it uses Input.KeyDown, so it dosent pause the program at that point while it waits for input. i'll incorporate a mouse selection into my example for you just to show you what i mean and add it to this post.


code:

var chars : array char of boolean

var pos, dir : int := 1
var x, y, b, prevx, prevy, prevb : int
var selected : boolean := false

loop


    dir := 0
    mousewhere (prevx, prevy, prevb)
    loop

        if pos = 1 then
            drawfillbox (100, 0, 200, 100, red)
            drawfillbox (200, 0, 300, 100, black)
            drawfillbox (300, 0, 400, 100, black)
        elsif pos = 2 then
            drawfillbox (100, 0, 200, 100, black)
            drawfillbox (200, 0, 300, 100, red)
            drawfillbox (300, 0, 400, 100, black)
        elsif pos = 3 then

            drawfillbox (100, 0, 200, 100, black)
            drawfillbox (200, 0, 300, 100, black)
            drawfillbox (300, 0, 400, 100, red)
        end if

        mousewhere (x, y, b)
        Input.KeyDown (chars)

        if chars (KEY_ENTER) or b = 1 then
            selected := true
            exit
        elsif chars (KEY_DOWN_ARROW) then
            dir := -1
            exit
        elsif chars (KEY_UP_ARROW) then
            dir := +1
            exit
        elsif x > 100 and x < 200 and prevx not= x then
            pos := 1

        elsif x > 200 and x < 300 and prevx not= x then
            pos := 2

        elsif x > 300 and x < 400 and prevx not= x then
            pos := 3
        end if
        locate (1, 1)
        put "Pos: ", pos, "  Dir: ", dir
    end loop


    if dir = 1 and pos < 3 and selected = false or pos > 1 and dir = -1 and selected = false then
        pos += dir
    end if
    locate (1, 1)
    put "Pos: ", pos, "  Dir: ", dir


    loop
        exit when selected
        Input.KeyDown (chars)
        if not chars (KEY_DOWN_ARROW) and not chars (KEY_UP_ARROW) then
            exit
        end if
        locate (1, 1)
        put "Pos: ", pos, "  Dir: ", dir
    end loop
    exit when selected
end loop


put "\n\t", pos, " has been selected"
MysticVegeta




PostPosted: Sun Jul 17, 2005 4:42 pm   Post subject: (No subject)

Hmm, i sorta agree with Cervantes with it being semi0-functiional. Maybe what you could do is.
code:

drawfillbox(x1, y1, x2, y2, c)
if key arrow up then
x1+=100
x2+=someV
y2+=someV
y1+=someV
elsif key down arrow then
x1-=100
x2-=someV
y2-=someV
y1-=someV
end if

if x1 > (originalX1 * boxlimit) then
x1 := originalX1
x2 := originalX2
y2 := original Y2
y1 := original Y1
end if


Doesnt that save us some effort to create a set of boxes for each new added box,.
Delos




PostPosted: Sun Jul 17, 2005 5:53 pm   Post subject: (No subject)

I don't particulalry like Token's method. It, well, doesn't serve my purpose here. The method I used is much close to Mystic's. I think the problem with my own was the delay. I might need to lengthen it or use some nifty coding to give it a universal delay that would work on different computers. Since we all know how well Turing handles delays across different computers.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 14 Posts ]
Jump to:   


Style:  
Search: