Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Windows form functions(Again)

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Apr 2009 19:24 Edited at: 6th Apr 2009 19:26
OK this is my newest version. here is what i have done

= Done
= WOrking on
= Planning

Window making
Change icon of window
Change cursor of window
Size window
Full screen window (set to your screen size)
Close Window
Move Window
Buttons
Menus
Textboxes
Listboxes
Lable Boxes
Much more i can't think right now


To Use the title and nameof the buttons use Mem_String(NULL, "YourString") cuz that puts it in asc string and that way i only need one windowdata variable and i don't deal with strings.

that does not take your memblocks (i have a variable named MyMem())
it all goes in that variable not actual memblocks

Documentation will be up in the next couple days.

THere is a known bug where if you arn't pressing anything for some reason the fps goes AS LOW as 40 and when you grab the title and move(that means it's painting that window constantly) it jumps to 140(on my machine) if anyone has any ideas on this please tell me


here are some screenys:




and a full screen pic




it's all uploaded.

New Site! Check it out \/

Attachments

Login to view attachments
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 6th Apr 2009 23:14
Try using a better format than .JPG for your bars. The compressed pixels make it look really sloppy.

That's what they WANT you to think...
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Apr 2009 01:08
Quote: " Try using a better format than .JPG for your bars. The compressed pixels make it look really sloppy."

i find .png is sharper.

can't read?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 03:02 Edited at: 7th Apr 2009 03:04
What do you mean "Bars" do you mean the screenshots? thats cuz i made them with print screen and paint lol


If you mean titlebars they arn't images they are drawn in the function.

I havn't gotten a size image function to work yet so i can't do that lol.

New Site! Check it out \/
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 08:26
NEW UPDATE!


Added things:


TextBoxes
CheckBoxes

The textboxes at this point are using the INPUT command. i am planning on implementing my own input function but at this point it's just dbc input.

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Apr 2009 08:31
For input, I have found it good to use ENTRY$()

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 18:05
ya i just havn't wrote a new input function yet(the old one i had didnt fit with this.) so i'm just using the input command

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Apr 2009 18:48
Quote: "i find .png is sharper."


Yeah, use PNG.

BMP=Uncompressed
PNG=Compressed/lossless
JPG=Compressed/lossy

Actually, in all media formats there are always 3 most common forms:

WAV=Uncompressed
WMA=Compressed/lossless
MP3=Compressed/lossy

AVI=Uncompressed
WMV=Compressed/lossless
MP4=Compressed/lossy

3DS=Uncompressed
X= ?
DBO= ?

hmmm...

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 19:58 Edited at: 7th Apr 2009 20:18
Well i'm not using images in the function (well not loading any) but for screen shots i'll use png now thanks


I'm workingon theText input function. it works but i just need to decide if i'm going to keep all the lines separate in a array or if i'm justgoing to return the hole string in one string.


Edit

wait if i keep it in one stringi have the risk of "String overload" error. grr i was tryingto keep the arrays to a minimum.


btw has anyone tried this? just wondering.

wait i amloading 3 images (arrow for sizing (X and y) and Arrow Cursor)

Edit2:


Whoops never uploaded the update well with this one. the title bar text color is white and theres checkboxes and textboxes(my input coming soon) and a function overview is included (not done)

heres a new screenshot:



i used png this time. your right it looks great!

New Site! Check it out \/
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 7th Apr 2009 23:38
Wow, that looks really good! Did you make all of those images yourself? Although I think that you should make it your own: you know, not exactly copying Windows.

That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 23:59 Edited at: 8th Apr 2009 00:02
Thanks!

All the images are drawn in db exept for the cursors.

i use date commands to draw the exit, maximize, check, and icon images. i am going to draw the cursors with data commands soon. i tried a couple days ago and it shot out a error i couldn't find so i just went to buttons lol

Quote: "Although I think that you should make it your own: you know, not exactly copying Windows."


Originaly i was making this for myself. and I like the windows look so thats how i modeled it. i tried other ways and looked at some other people's stuff but in the end i like this (btw i am going to make it so you can change the background color and use images for the buttons so it won't looks so plain lol i'm just getting the basic stuff in now)


Edit:

btw in the pic the back window says "Special Icon" It's not. but it was lol i took it out and forgot to put it back in sorry.

New Site! Check it out \/
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Apr 2009 07:56 Edited at: 9th Apr 2009 23:21
Sorry for double but this is a update so i think it's ok.

UPDATE!

I know have my input function in. it keeps all the lines in separate parts of a array (Lines$(Gadgetnum,LineNum)) so if you want to change/ set a start text for it just set that to whatever.

oh and if anyone wants to test this can you try and set it to 640,480 mode and put a set window on in cuz in mine when i do it shoots a unknown commmand on the set window on command. i tried it just in another project (well it was just a loop and set window on lol) and it worked. i don't know why it's doing this though.


If you write all the way to the end of the textbox for some reason you can't backspace. i'm trying to findthat error but can't. well the text box is the only update but it has word wrapping and stuff return goes down a line but theres no up and down scrolling and theres a flashing cursor. click outside the textbox to stop writing.

heres a new screenshot:



Download will be up shortly

New Site! Check it out \/
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 9th Apr 2009 23:00
...You spelled "wrapping" wrong. *epic facepalm*

That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Apr 2009 23:05
hahahaha wow... i'm and idiot....

New Site! Check it out \/
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 18th May 2009 03:09 Edited at: 18th May 2009 03:25
Update!


Yes i'm still doing this.

I was working on the one from above and realized. this is not very flexible so i realized why not make classes and Window procedures like windows does. so i did. it turned out pretty well i think. it's designed pretty much completely different now (has gradients for the title and is drawn better for speed.)

What is working now is>>

Registering Classes(only 2 parameters backgroung color and icon at the moment)

Using Window Procedures(using your class number you can tell it which procedure for which class)

Creating Windows (More like windows. a "Window" more like a object then a Movable window)

Window Flags(Child, Overlapped, Border)

1 Default class that comes registered(button)

Messages for the windows(Left Button down, Left button up, Paint, Key Down(keyboard), Destroy, Move)

default Window Procedure(send all messages you don't want to handle there)

Error Handling(With Real Message Boxes. can be fatal, or just warning. Loads a dll, number 255)

User Picks what bitmaps are used (needs 2 bitmaps)


Here's a screen shot, and a Exe attached that shows a window that looks kinda like a calculator but the calculator isn't supposed to work because there's something wrong with my String storage and i can't get it to change the calculator number correctly.

[img] http://i614.photobucket.com/albums/tt228/My_darkbasic_screenshots/ScreenShot-2.png[/img]

By the way, i got(on a couple year old computer) 150 fps with 20 random sized windows on the screen. so if you have a fast computer(definatley not mine hahaha) it will be even better!

Any bugs let me know please

New Site! Check it out \/

Attachments

Login to view attachments
AndrewT
18
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 18th May 2009 03:23
Looks pretty good!

A couple bugs:

-If you're dragging the window and the mouse moves off it it stops dragging it.
-If you hold the mouse button and move it over the buttons they go down and stay down until you release the mouse button.

i like orange
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 18th May 2009 03:34 Edited at: 18th May 2009 05:41
Thanks!

Bug 1:
Oh! i thought i fixed that! thanks! i'll get right on it

Bug 2:
Um if your mouse stays over it and you hold the mouse it shouldn't come back up.

Wait i just realized if you mean that when you click and drag off the button the button stays down. that's probably because it only sends the Left mouse down message if the mouse is over the window . in a effort to conserve speed, i did my check by cycling through all the windows (From bottom to top) and if the mouse was on it then i set a variable equal to that window then when the loop was done the highest window that the cursor is one is that variable. well in doing this all the input and stuff is handle when the mouse is over the window. Doh! not gunna work lol.


Just tested it. you can click and drag the mouse off the button and then let go and it stays down until you put mouse over it again. whoops. i will have to put the mouseclick message sending in the window check loop instead of at the end.

thanks for these bugs! well thanks for informing me of them lol



!!EDIT!!

Got those bugs fixed. heres the new update of the exe. i also included the source. so that way you can give me your oppinion on the code itself.

Oh and to use the classes and stuff heres how.

first you have to register a class like this:

Win_RegisterClass(ClassNumber, Icon Image, Background Color)

Pretty simple really. but then In the function called Win_SortWindowProcedure(hWnd, Msg, wParam, lParam) make a new case with the number you registered your class With. now from there all you need is your own Window Procedure function. A window Procedure function should look something like this:



That procedure will paint the window with just the background color and the Other features depending on style(WS_OVERLAPPED has a title and border, WS_BORDER has a black border, WS_CHILD adds nothing.)

Now in the WinData() array. the first value is the hWnd of the window. and the second is the window data (Theres a key to this with the source code) and the spaces 26 - 50 in that are for your use(like the Built in Button procedure uses 26 to store the state of the button) so then you can process the messages like WM_LBUTTONDOWN and stuff. the WM_KEYDOWN message, the wParam is the asc value of the key being pressed.

The rest is up to whatever you want to do lol.

Any suggestions on Messages and other features needed tell me.

New Site! Check it out \/

Attachments

Login to view attachments
Stefan p
16
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 18th May 2009 22:53
One question for you caleb, how did you manage to get th text to appear behind the window and still show up with make the windows overall alpha small.

Thanks, Stefan
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th May 2009 01:20
I used 2 bitmaps. so you can draw to the first one and then when you need to update the positions(or repaint the window) it just copies the first one to the second and puts the windows overtop.

I'm not sure what you mean by the alpha though. if you are referring to the images that make the window. they are all drawn in db exept the exit button(havn't redone the data statements to make it from the last version yet)

I have a Edit box Class worked out for the most part. i just have to get Wrapping done and tighten up some loose ends.

i have a Focus set up also. whenever you click on a window that has the WS_CHILD style the focus get's set to that window(i only did it on WS_CHILD because you can't mix styles in db. well not any easy way. so you can only have WS_CHILD or WS_OVERLAPPED and overlapped has active window so it doesn't need a focus.)

the Text output functions now support these ummmm dang can't remember the name for em but it's these things:

\n (new line)
\t (Tab)
\0 (End of the string)
\\ (prints a backslash)

those came from a need for a easier way to have tabs and new lines and things for the edit box window. they make it so all i really need to do is put em in there and the program handles the rest. because the text is print 1 character at a time so it handles these when it gets there.

one thing that is yet to be delt with is indevidual character editing in the edit box. so right now you can only type from the end of the line and back space.


One on the side peice of information is that pressing Control+H returns the same ascii value as backspace hahahaha found that out while messing around.


I am working on finishing the edit box and adding menus now.

New Site! Check it out \/
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 19th May 2009 23:20 Edited at: 20th May 2009 01:52
@Caleb1994

Quote: "the Text output functions now support these ummmm dang can't remember the name for em but it's these things:

n (new line)
t (Tab)
� (End of the string)
(prints a backslash)"


I believe those are known as "Escape Sequences". They allow you to add special "characters" to your strings. They can be found in languages such as JavaScript and PHP. For example: you can use \" to print speech marks inside a string - instead of marking the end of the string.

mystring = "\"Hello World\""

This when printed would literally display:

"Hello World" (complete with the speech marks).


In DarkBASIC however, it seems speech marks don't require escaping:




Good luck with your form functions. Looking good so far
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th May 2009 23:57 Edited at: 20th May 2009 00:01
thats the name! thanks! lol i couldn't remember it.


darkbasic doesn't use them but you can't use double quotes like that either. it thinks your saying print nothing ("") then a unknown command then nothing again ("") lol the only way i have found is to use ascii value of a quote and add it using the chr$() command (if your familiar with the dbc language.)


oh! and by the way, don't put a \0 at the end of your window name because that will get stored as 2 different characters then the system automaticly adds the \0 at the end as one character(otherwise it doesn't read it as \0. it reads it as \ then 0)

actually i just realized you can't use Escape Sequences when putting in the window name. hmmm i will have to fix that.

New Site! Check it out \/
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 20th May 2009 01:49 Edited at: 20th May 2009 01:51
Quote: "darkbasic doesn't use them but you can't use double quotes like that either. it thinks your saying print nothing ("") then a unknown command then nothing again ("") lol"


Thats what I initially thought and my original code was "escaped" using backslashes, but it printed them to the screen. So I thought "I wonder if it will complain about 'unterminated string' if I try with double-quotes?" However it didn't, it prints them as

"Hello Everyone"
"Hello World"

Please try to run the program above in my previous post, you'll see what I mean. I was a bit stunned, but it looks like DB might be automatically escaping the speech marks?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th May 2009 03:22 Edited at: 20th May 2009 03:23
Hm! thats odd i have tried that a million times and it never worked but it does now! huh!


Hey off topic is that steve paul thomas? it says stp games and there was a steve paul Thomas on here plus i think you have the same pic. ha



Oh and the window name did exept escape sequences but only the new line one so i fixed that.

New Site! Check it out \/
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 20th May 2009 14:29 Edited at: 20th May 2009 14:38
Quote: "Hey off topic is that steve paul thomas? it says stp games and there was a steve paul Thomas on here plus i think you have the same pic. ha"


I think we're probably way off topic now, but since you ask - yes its me spt games aka steve paul thomas games. Now posting as spt games. Also the pic is the "s" from my website logo (made in CINEMA 4D):




Quote: "Oh and the window name did exept escape sequences but only the new line one so i fixed that."


DB is a funny thing sometimes, but great that you found a solution


Also, I wanted to ask about the WinAPI. I have noticed that yourself and Latch are both excellent at making use of it. I think it would be useful for the Level Editor that I am planning on making.

Are there any forum posts or web resources that you found useful when you started messing with DB + WinAPI?
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th May 2009 17:35
looking nice!

You should put the shading effect around your windows too (like you did with your buttons). Because when the windows overlap, you can't see the edges anymore...

And where is the minimize function? Will you put that in too?

I like the text wrapping function (I never figured out how to do it). The next step would be to import some grammar file from windows and wrap it grammatically (like fo-otball should be foot-ball).

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th May 2009 18:22 Edited at: 20th May 2009 18:39
Quote: "DB is a funny thing sometimes, but great that you found a solution "


Ya DB is funny about A LOT of the MOST of the time haha! but thats why i love it! you have to find ways around the little "funny things" about it lol

Quote: "
Also, I wanted to ask about the WinAPI. I have noticed that yourself and Latch are both excellent at making use of it. I think it would be useful for the Level Editor that I am planning on making.

Are there any forum posts or web resources that you found useful when you started messing with DB + WinAPI? "


Well really MSDN was my help. and once i understood that structures(if you know what i'm talking about) are just memblocks it's quite easy to put things together in dbc. what kind of things were you looking into? if you talking about buttons and windows and things, it's impossible to do in dbc. unless you make a custom dll to do it for you(i put one together a while back. not great but it would do buttons and checkboxes and overlapped windows and stuff.

the main thing for WinAPI is these:

LPSTR, LPCSTR, LPWSTR, LPCWSTR(or anything else to that extent) a string

Anything Referencing a "Structure" is put together using memblocks

When it says "Pointer to a null terminated string" it's just a string(db passes the pointer for you)

anything like dword,float,UINT, or whatever like that. you can pass a integer.

Last but DEFINITLEY not least. all function names ARE case sensitive.

thats all i can think of (theres probably more i'm taking for granted but thats what i can think of)

Go here and theres all the winAPI lol
Most of it takes more then nine parameters though. so you can't use it without special a dll i havn't seen a lot of posts on it though since a lot of it can't be used with db without a extra dll.

ok on topic:
Quote: "
looking nice!
"


Thanks!

Quote: "You should put the shading effect around your windows too (like you did with your buttons). Because when the windows overlap, you can't see the edges anymore..."


there are 2 lines on the right and bottom of the windows (rgb(64,64,64) and rgb(128,128,128)) same as the buttons. i was thinking of putting a shadow like in windows though what do you think?

Quote: "
And where is the minimize function? Will you put that in too?"


I wasn't sure how to handle that as theres no "Start Menu" i didn't know where it would go when you minimized it.

I am going to add a thing to make it go full screen(the middle button up top lol) i just knew how to do that and it was fairly simple so i figured i would do that in a little bit after i perfect(as much as possible) my messages and Window Procedure stuff

Really it doesn't "wrap" yet. you can press enter do go down a line but at this point it does not automaticly wrap around. unless you looking at the old version(the one without the gradient) then ya that does have wrapping

I'm doing by adding a n escape sequence and then i have a function that prints stuff 1 character at a time so i can use those and when it comes to a n it goes down a line. then when backspace it delete that character and there you have it it goes up a line lol it makes a hole lot less work for me(or whoever is making a edit window)


as for the grammer stuff that would be some intense stuff. lol i would have to scan the string. when i found the word i would have to have a "Key" to tell where that word should cut off and... dang my head hurts lol


Steve:

Theres a source attached that will create a rightclick menu(and actually a normal window menu) and a function to show the menu

although using set menu does put a menu on the dbc window you cannot get information from it. for that you need to call PeekMessage or GetMessage which as far as i have found is impossible in dbc for some reason. but theres some right click menus. and latch put up some code to turn of the Minimize button in dbc window on another post.

New Site! Check it out \/

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th May 2009 20:15
@Caleb
Haven't tried the functions yet but eyeballed some of the code. Looks good. A couple of things in terms of using DLLs, memblocks, and offscreen bitmaps in functions: because there are so few of each of these (1 to 255 and 0 to 31), when creating library functions, I've found it best to use a parameter to pass the value of a DLL, memblock, or bitmap so the programmer has a choice as to what number(s) they want to assign.

If you hard code their values into the functions, that can interfere with what a prgrammer may be trying to do. If, for example, the programmer has created a graphics library for their application that uses the same memblocks, bitmaps, and dll numbers, and they wanted to use your windows library in addition, then the programmer has to change something somewhere.

In the case of your message box, it looks like you delete the DLL after you load it - but it's still hard coded as 255. If you only want to use any of those items for a short time - a sort of one time thing - then do a search for available memblocks, dlls, or bitmaps in the function:



The same for any one timer bitmaps or memblocks.

I've saved myself a lot of headaches by keeping those bitmaps, memblocks, dlls, objects, etc. that I want to use over and over, or even want to change, as parameters into my library functions.


Also, if you are drawing straight lines vertically or horizontally and they don't exceed the screen size, then use BOX instead of LINE. It is WAYYY faster.

Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st May 2009 06:39 Edited at: 21st May 2009 06:41
The user inputs the main Background/Painting bitmaps and any other bitmaps or images are searched for and then deleted exept for the images for the windows but theres 65535 images available so i don't think it will be a problem when i only use 500 at max, which drops the frame rate to like 10 if there all overlapped atleast lol.

as for the dll, i should probably do a search instead. you are correct. i will change that thanks!

as for memblocks i'm not using any am i? wait i think the last one i uploaded still used memblocks for string storage(don't know why i did that in the first place haha) or did it... hmmm.

unless you talking about the rightclick functions i uploaded. if so they wern't supposed to be "library functions" they were more a example.

New Site! Check it out \/
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 21st May 2009 08:52
Thanks for the link and the code Caleb The right-click menu is a nice example of whats possible. Would be perfect for something like level editor. As would something like the Windows Common Load/Save dialogs. Thanks again
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd May 2009 02:23 Edited at: 22nd May 2009 02:27
Anytime!

If you are good with Memblocks then Load/Save Dialogs are easy. but to pass the strings you have to store the strings in separate memblocks(so like the lpstrTitle member of the structure would be a pointer to a memblock with the string stored in it)

to store it, just make a memblock with this size "Len(YourString$)+1" then just store each characters ascii value in each byte(1 character per byte)

Now On Topic.

I'm tightining up some speed difficulties then i will upload a new version. Although the editbox isn't done it does exept text and have new lines and tabs.

I also included a Doted box function.

and i'm still trying to get these menu's to work.... hmmm they are behaving weird.

I have a "Poll" Though here's the question:

When you make a window with a menu/overlapped/border whatever should it make the window bigger to include it or should it just take up part of the space?

Windows does it so if you make a 640x480 window and it's overlapped then then the size of the window without the border(the actuall window part) is going to be 612x472 because it includes the titlebar(20 pixels high) and the border(4 pixels on each side) into your size.

thats all i have today. lol

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th May 2009 22:08
Take up part of the space

You should also add a file input/open function.

TheComet


Make the path of your enemies easier with Waypoint Pro!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 24th May 2009 22:25
Ok thanks for you input, thats what i thought,

do you mean a File open/save dialog then i really can't do that until i get some more controls done like sliders, list boxes, stff like that.

Will probably have a update 2morro

New Site! Check it out \/
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th May 2009 06:42 Edited at: 27th May 2009 07:31
Well i was swomped yesterday so couldn't upload anything but i can now!

Ok, i have a couple updates.

Finished Edit box Class.

Finished Listbox Class.

Finished Progress Bar Class.

Updated Button Class.


The edit box is finished but more like a text box, not much use for multiline. i'm going to make a new class for that, so i don't have to deal with weather or not it's multiline.

The listbox is done and finished, with a doted box on the selected when the focus isn't on that window. it changes the size if you try and put more items then there is space for. i wanted to make adding items in a message but theres no way because you don't have pointers and i can't use strings in the window procedures

Progress bar is done and has a pretty good size calculation i think. i'm using this to calculate how many "Box" type things go in the progress bar:

((WidthOfWindow/MaxProgressSize)*Pos)/SizeofBoxes

Works pretty good. i have a set step, step, and set position messages for the progress bar.

The button class now gets a border when it has focus and a doted box. thats the only update.

The checkbox is in and done. has a gray, Checked, and unchecked states (grayed is when you are clicking it) and you can specify a size but thats just so wherever you click in that size it changes the check state. the size does not effect the actual size of the checkbox. and the text is displayed next to the checkbox. Doted box with Focus.

Now for anyone who doesn't know, what i mean by focus is the window that has been selected. this is different from the top overlapped window. to set the focus, Send the message "WM_SETFOCUS" to the window you want the focus to be. for instance if the edit box has focus then you can type in it. and soo i will make is so if the button has focus you can press the return key to click it. for the user to set the focus just click on any window with the "WS_CHILD" style.


If anyone has any ideas about being able to draw behind the windows throw it out, because the way i am doing it isn't going to work. because to draw behind the window you would have to draw to the back bitmap then completely repaste all the windows(not repaint, but repaste all the window images) and that cuts the speed in have if you are doing that every loop. then when you grab a window or do something to change it it has to update the bitmap twice a loop which cuts it down to about 50 fps, from about 180

Any ideas for Classes? i'm looking through the stuff on visual basic(it has a nice window explorer thing) and looking at things that could be made with this, at this stage of progress.

Edit::

Dangit! internet is being dumb. now it's gunna be thursday before the update can be up. sorry

New Site! Check it out \/
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Jun 2009 01:24
FINALY a update sorry it took so long, every time i am going to upload a update i always see something that needs done. and that leeds to other things that i want to do lol.


Well here are the new updates


Combo box added(a drop down listbox thing)

Doesn't look like much but this update also includes the stuff from above lol.

theres a screen shot attatched and heres the code (no media needed)



Oh there are a couple new functions>>

Win_ActivateWindow()
Make's it so the window is update able. other wise the window is grayed(overlapped windows) and is not updated

Win_DeActivateWindow()
Make's it so the window doesn't update. while deactivated the window has a grayed title bar(overlapped windows) and doesn't update.

Win_IsActive()
checks to see if the window is active.

Win_GetTopWindow()
Returns the current top window.

Win_SetTopWindow()
Sets the top windows, paints the old and new ones, then updates the bitmap.

Win_GetFocus()
Gets which window has the focus(only applies to windows with the WS_CHILD style)


i am working on Help type files should have those within the week.

Oh almost forgot the example code hahaha.



OH YA! i also go sizing to work on overlapped windows and instead of using "Repeat : Sync : until Mouseclick() = 0" with the x button it acts normal! lol

New Site! Check it out \/

Attachments

Login to view attachments
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 5th Jun 2009 22:00 Edited at: 8th Jun 2009 21:17
Ahhh Quad Post lol, no one is replying and the last post is already almost 2000 lines cuz of the functions :/ lol


Well, i have a update.

if you saw my other posts on the forum you know i was messing around with cursor, well i decided to throw em in here, you can load a cursor with LoadCursor() and then use it in the Win_RegisterClass() function, the cursors are optional(since i know some people probly don't want em.) but to use them just put Win_Sys_UpdateCursor() with the Win_Systemupdate() function and it will set the cursor.

there are also cursors you can load a cursor with numbers instead of a file name msdn talks about it, there are actually pointers to a string for that file, but there are numbers that u can use just use the str$() function. i use them to load the default cursor when you call Win_Sys_Initiate() function.

there is also a new edit class(the old one is gone), you can now scroll threw the letters with the arrow keys! woohoo! i'm going to work on getting Scrollbars to work with it once i finish them(the only thing that needs done is the buttons on the bars)

there are also some new window text functions

WIn_AddCharToPos(Window, Position, Char$)
adds a character to a position and shifts everything down.

Win_SubCharFromPos(Window, Pos)
Subtracts a character from a position and shifts everything back.

and some other new functions

LoadCursor(FileName$)
Loads a cursor from a file using WinAPI and returns the pionter.

Win_DeleteCursor(CurPtr)
Deletes a cursor from memory.

Win_SystemEnd()
Deletes bitmaps, leftover windows, cursors, cleans up after itself.

well the new functions are attachted!

here's a example with the new textbox and cursors!


Oh by the way, that example re-registers the WC_OVERLAPPED class, but has the same parameters as the old one exept with a funky cursor lol.



Oh and i was board so theres a little thing that shows the ellapsed Seconds,Minutes,Hours on there lol


!!UPDATE!!

Added some new stuff to up the speed. now you can draw to the bitmap specified in Win_Sys_Initiate() function as the back bitmap and it will update behind the windows every loop.

The system now runs at about 275 fps with 100 overlapped windows.
and about 180 when repainting a window constantly.

New update this week probably.

New Site! Check it out \/

Attachments

Login to view attachments
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Jun 2009 07:20 Edited at: 10th Jun 2009 07:21
No Seriusly Someone needs to Post cuz this is my like 5th one in a row... i don't know if i should actually post again. if someone doesn't think so then tell me and i will stop lol.

Ok i have a new update!!!


I got menus!!!!!!!!!!!

The Menus Don't support Sub-Menus though but it's still menus!

There is something with the menus that's Droping the framerate so i have to find that then i will post the new update. I added the WM_COMMAND(1) Message also.

You can have up to 100 menus to a window and 100 items to each Menu(that would sooooo drop the frame rate... :/ )

Once i find the frame rate dropper i will post the update! WOO!

New Site! Check it out \/

Login to post a reply

Server time is: 2025-05-15 06:24:22
Your offset time is: 2025-05-15 06:24:22