![]() |
|
|
#1 |
|
Im just wondering if any of you do any Visual Basic programming in your spare time. Im a little stuck, but I've yet to find an answer on alot of the sites.
How to read and write treeviews? You see im building a web browser, no apparent reason, just for style and speed. So far I got the built in media player so you can surf and listen to tunes, has favorites, sourcecode downloader (.txt and .html) and a popup blocker. Not too bad. So I just started coding up the treeview so it builds itself as you search sites just like the history does. But when its time to save, ya, lol its nearly impossible to load it back in due to the branches in the keys needed to form the tree. Other than that umm, I was going to put in its own searching tool to parse a pile of search engines for a keyword, or whatnot just to give it more flexibility. EDIT # 2 ======= Oh ya if your intrested in an animated picture of what it looks like, click "My Website" in my sig. Last edited by The Twiggman; 27th Aug 2003 at 03:51 PM. |
|
|
|
|
|
|
#2 |
|
hm, i've played a little with the treeview, i'll see if i've got any stuff lying around that may help
__________________
You wanna be a big cop in a small town? **** off down the model village! |
|
|
|
|
|
|
#3 |
|
I did some projects. My most nutty was an RTS using Direct Draw (Bitblt was too slow, and lacked the ROPs for what I wanted to do)
I can post some screenies, but its not much to look at. I never developed a real tileset for it (In fact, I just used my wallpaper ), and the buildings and such were all ripped from TA... movement code (sorta) works, but lacks pathing abilities, etc.In short, I dropped it right around when i realized VB was too goddamn slow to do anything fun in
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#4 | |
|
Thanks D-Stroya. BTW 3300 post dude cheers!
Quote:
|
||
|
|
|
|
|
#5 |
|
As for games wise, I've done a few games in my time.
VB Dope Wars, that was quite intresting, it eventually got right unstable as I put so much into it. It was mint though, it was real time, like the prices for drugs were changing all the time, just had to buy and sell and not be busted at the wrong time. But you could also buy rocket launchers to shoot the cops with. The game was nuts. I tried to build a top down game like "Total Carnage" for SNES. I had it working with guns and collision detection, but I couldn't figure out how you would really move around farther than the screen so I just turned it into a game where you have enemys moving towards you from all sides and you have to shoot them. Every minute they move faster. Then recently I just started making a game like everwars style. Like an rpg text bases fighting game, not that bad but it had some style to it. I called it "Ghetto Wars" because you fight with guns, knives, chains and bats. Toss on a backwards hat and get an extra 2 armour points. The battle engine was neat though. For every round it takes to fight and defeat the opposing player the fight jackpot would go up by $5, so if it takes like 10 rounds to defeat the player then someone wins $50 bucks and the other player loses $50 bucks. |
|
|
|
|
|
|
#6 |
|
Moving the screen tiles takes a bit of thinking. I just put them in a matrix, and moved the tiles in relation to the absolute and partial positions of the character. (Round to a tile, get the tiles we need, and draw them with an offset relational to the offset from the character to the tile you rounded off too.
I think I have some sample code here somewheres...
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#7 |
|
Smart thinking. I should have just looked for a sample instead of just trying to figure it out myself. But I like to be independant on this stuff.
Hmm, im going to go figure out this read/write treeview stuff. Im sure I can figure out a way to write to an ini and call it all back. If I got any success then I'll post the code here and at PSC just because I've yet to see anything done. |
|
|
|
|
|
|
#8 |
|
Well this will work reads and writes just fine for what I need. A little bit sloppy and makes the folders look pretty jumbled up, but hey, either that or nothing. Lol.
Code:
'Read And Write Treeviews, A Little Demo For Use For Web Browser History 'Still A Bit Buggy, But Nothing Half As Bad As It Was 10 Minutes Ago 'All you need is a folder named Cache within the directory of the programhttp://forums.beyondunreal.com/editpost.php?do=editpost&p=1196128 'By Twiggy 'Define Variables Dim a As Integer Dim z As Integer 'Each click saves the special number to a cache folder 'Also saves two files per address, one with date, one with time Private Sub Command1_Click() 'Adding One To Special Number a = a + 1 Label2 = a 'Saving Special Number Open App.Path & "\Cache\a.ini" For Output As #2 Print #2, a Close #2 'Adding Node Displaying Site Under The Date TV1.Nodes.Add "Date" & Date, tvwChild, a & "Site", Text1 'Saving The Two Files For The Address Open App.Path & "\Cache\t" & a For Output As #2 Print #2, Text1 Close #2 Open App.Path & "\Cache\d" & a For Output As #2 Print #2, Date Close #2 End Sub Private Sub Form_Load() 'When The Program Loads It Creates A New Parent Node For Todays Date TV1.Nodes.Add , , "Date" & Date, Date 'Loads In The Special Number Open App.Path & "\Cache\a.ini" For Input As #1 Input #1, x a = x Label2 = a Close #1 'A Loop To Load In The Previous History From 1 to The Speical Number 'See where it comes into play For p = 1 To Label2 Open App.Path & "\Cache\t" & p For Input As #1 Open App.Path & "\Cache\d" & p For Input As #2 Input #1, t Input #2, D t1 = t d1 = D TV1.Nodes.Add "Date" & Date, tvwChild, p & "Site", t1 Close #1 Close #2 Next p End Sub 'When You Click The History Item, It Will Appear In A Text Box Below Private Sub TV1_NodeClick(ByVal Node As MSComctlLib.Node) Text1 = TV1.SelectedItem.Text End Sub
Last edited by The Twiggman; 28th Aug 2003 at 06:47 PM. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|