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

Username:   Password: 
 RegisterRegister   
 Custom GUI
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2, 3, 4  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SNIPERDUDE




PostPosted: Sun Sep 28, 2008 7:54 pm   Post subject: Custom GUI

Okay, just done a whole bunch of updates on my custom GUI module - want your guys' opinions.
The main update here is the full styled frames.
Still no outside images used.

Let me know if I should submit this beta - I just need to write up a quick manual.



screen.bmp
 Description:
Screenshot of the various themes' buttons and Frames.
 Filesize:  2.25 MB
 Viewed:  571 Time(s)

screen.bmp


Sponsor
Sponsor
Sponsor
sponsor
SNIPERDUDE




PostPosted: Mon Sep 29, 2008 12:37 pm   Post subject: Re: Custom GUI

Don't want to double post - but I felt that this should be on another post.

Okay, so I'm finally done creating the help file (READ IT), and I also included an executable run programme (as well as the source code for it).
I know it's alot, but tell me what you guys think.

*OOPS*

Can a mod edit this the the Turing Submissions Forum? Sorry...



LGUI 1.4.2.rar
 Description:
LGUI 1.4.2

Files include:
The import file
Support files
Example Executable
Example Code
Help File

Download
 Filename:  LGUI 1.4.2.rar
 Filesize:  299.16 KB
 Downloaded:  414 Time(s)

[Gandalf]




PostPosted: Mon Sep 29, 2008 5:39 pm   Post subject: RE:Custom GUI

Done. Also, methinks if you have such a knack for creating custom GUIs you should look into a language where it would be more appreciated or useful, a language that actually supports custom GUI themes. Wink
SNIPERDUDE




PostPosted: Mon Sep 29, 2008 7:24 pm   Post subject: RE:Custom GUI

Lol, probably should.
I know java but hate the syntax.

I think later I'll create a Turing to Java converter (at least give the the syntax to type in) so I can switch all of these over.
Clayton




PostPosted: Tue Sep 30, 2008 4:57 pm   Post subject: RE:Custom GUI

I have one big problem with this so far (before actually using it even): Naming conventions. Why, in God's green Earth, is your class called LGUI1v4a?! I don't care what version the class is on when I'm making a button, and it looks like crap. Plus, now if you want to update the code, and you change your version number (LGUI1v5a?), anyone that previously used your 1v4a code will now have to trudge through their program and search out LGUI1v4a and replace it with LGUI1v5a, not so cool. Also, the names of your methods could do with some revamping as well, having a method called Buttons gives me no inkling that it should be what I need to use to create myself some buttons. For now, I'm using these names, as I'm slightly interested in what you can do with them, but the naming needs some serious reconsideration.
SNIPERDUDE




PostPosted: Tue Sep 30, 2008 8:18 pm   Post subject: RE:Custom GUI

Duly noted - and I'll certainly change it.
Makes alot of sense.

About the Buttons, I put the 's' at the end because Turing gave me an error saying I couldn't use 'Button'.
What do you propose for the name of the class?

Any other criticism? I want to make this as good as I can, and advice as such really helps.

Thank you, and I'll get right on the naming conventions.
Clayton




PostPosted: Tue Sep 30, 2008 8:25 pm   Post subject: RE:Custom GUI

How about CreateButton? It's simple, elegant, and lets the programmer know exactly what the procedure/function does. That is what you should be aiming for when you write your own library. In my opinion, comments should be stricken from the known universe, and instead, everyone writes self-documenting code. Things would be much easier that way, even if it's not going to happen Razz
SNIPERDUDE




PostPosted: Tue Sep 30, 2008 8:36 pm   Post subject: RE:Custom GUI

So should I use 'Create' before all of them?
And what did you mean by this:

Clayton wrote:
In my opinion, comments should be stricken from the known universe, and instead, everyone writes self-documenting code. Things would be much easier that way, even if it's not going to happen Razz
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Wed Oct 01, 2008 7:16 am   Post subject: RE:Custom GUI

It meant that when you code something, your variable/method/whatever names, along with the clarity that you code with, should require zero comments. Why? Because it should be exceedingly obvious what your code is doing. And, no, you should not use 'Create' before all of your current method names. The names should reflect exactly what the method is going to do. So if you have a method that's going to create a buttong, CreateButton is an excellent choice. If you have another method to re-draw the button, well, ReDraw would be a good name for that one wouldn't it?
SNIPERDUDE




PostPosted: Wed Oct 01, 2008 4:43 pm   Post subject: RE:Custom GUI

I just used code tags to make it easier for me - not because of the organization but rather the mass amount of code.
And I only meant putting 'Create' before the object procedures - such as Button or Frame, etc.

I don't have a redraw procedure - everything is automatically initialized. So you would put the Button procedure in the main loop. You can change the properties of any Button using the Properties procedure.

Maybe I should put 'Draw' instead of 'Create' before the procedure, considering everything comes automatically created.

Ex:
Turing:
LGUI (g).ButtonProp (1, "Style:XPs, Text:Buttons are cool")

loop
    cls
    LGUI (g).DrawButton (1, "CC", maxx div 2, maxy div 2, 100, 25, END)
    View.Update
    exit when EXIT
end loop
SNIPERDUDE




PostPosted: Fri Oct 03, 2008 12:03 pm   Post subject: Re: Custom GUI

I don't really want to make a double post - people do get mad at that. But this post has nothing to do with the last.

Anywho I figured since I am working on this now - I want to get people's input.
WHAT DO YOU WANT FROM A CUSTOM GUI?


Any input, opinions, comments, suggestions, questions, etc are appreciated.

So far at the moment I am working on:

Movable Frames
Resizable Frames
Frame Icons
Transparencies
Customizable Object Back Colours
An Error Checking Module (so it won't crash on you)

And maybe a 'smart' auto-correct (so if you make a typo in something like in the 'properties' procedure it will ignore it and execute what it think you meant - then tell you after your programme finishes so you know) Very Happy



EDIT / UPDATE:

So I'm done adding the following:

Movable Frames
Frame Icons
Transparencies
Customizable Back Colours
And the error checking module
And I also fixed the naming conventions

It still has a few bugs, so I won't release it at the moment - but I thought I'd give an update.
It took me a while to figure out a method of adding transparencies (without causing a major slowdown)
, but I figured it out so it can run at full speed while still having an effective look.

This is how I did it if anyone wants to use this method in the future:
Because Turing runs slower than most other languages Evil or Very Mad , I couldn't use my own algorithm for transparencies (ex splitting the alpha in RGB, using a grid and blur method, etc.). So using Turing 4.1, I took a screenshot of the background, drew the new layer (the background colour) using drawfillbox, took a screenshot, used Pic.Blend (you can change the percentage of background to foreground - the two screenshots), then drew this new image. I I wish to add more style (costing a bit a speed, but nothing too major), I would also use a Pic.Blur to blend it a little. Simple, fast, and easy.

Screenshot provided below.



untitled.bmp
 Description:
Screen shot of the Translucent Frame
 Filesize:  662.88 KB
 Viewed:  201 Time(s)

untitled.bmp


chopperdudes




PostPosted: Tue Nov 18, 2008 12:58 am   Post subject: RE:Custom GUI

please sniperdude? checkboxes and textboxes and textfields? basically like the turing GUI library.

just so that you know i can't use your custom GUI with the original GUI... firstly it would kill the main purpose (to look nice), and then it would not be compatible since yours work in offscreenonly mode while the one in turing is nooffscreenonly.

so any updates?
SNIPERDUDE




PostPosted: Tue Nov 18, 2008 8:02 am   Post subject: RE:Custom GUI

It was made as a total replacement for the Turing's GUI, most people want to be able to use GUI in offscreenonly.

I do have a lot of updates, I'm going to clean up any open ends at the moment and at the end of the day I'll post. I'm really going to try to get it in at the end of today, but I really don't remember exactly where I left off.


*EDIT*

Taking my schedule into consideration (I forgot I had other commitments today) I will try to get it up before the work week ends. I might post it tomorrow, I'm not too certain (I will be busy making new boxes for my speakers) though. Cheers.

Oh, and looking back at your comment; My GUI is not made to cover up the old GUI or anything of the sort, but to be a complete replacement - not a skin package. You just put the one line in your main loop (or whatever loop you want) and it will function completely as any GUI would. Smile
chopperdudes




PostPosted: Tue Nov 18, 2008 11:42 pm   Post subject: RE:Custom GUI

thx alot!!

yeah i know it's not made to cover up the turing GUI. but i was just saying that without almost all the functional stuff in turing's GUI module, it was rather lacking adn therefore some other place i need turing's checkboxes or sliders for example.

and yeah i rly hate using turing and having to set it to nooffscreeonly... and then of course you can't have animations along side the original GUI.
SNIPERDUDE




PostPosted: Wed Nov 19, 2008 8:10 am   Post subject: RE:Custom GUI

Exactly. What if you wanted an in-game menu?

Anyways this will eventually (soon, all of the basic coding is done) surpass the built-in GUI even in the items one can use. I will get back to you as soon as possible with the update, it may take some time to update the manual too - I want you to know what you are doing, not that it's complicated.


* EDIT *

Okay, so since my shipment of wood has been delayed until tomorrow, I did put some work into this today. Most of it being just updating the Manual so people know what they are doing. I know there are still some bugs, please bear with me (some of the styles for inputboxes are not drawn yet - so if you can't see it you know why). Oh man, I probably should have put in a good example of the inputboxes. Oh well. So here it is for now, will be updating later (with a better manual). Comments, questions, criticism welcome.


* EDIT *


Okay, wrote a quick example of using the inputbox.
Turing:
import LGUI
var g : ^LGUI
new LGUI, g

setscreen ("graphics:max;max, nobuttonbar, offscreenonly, nocursor, title:GUI SMASH LAB 1.0")

var EXIT : boolean := false
var pic : int := Pic.FileNew ("t.jpg")


proc END
    EXIT := true
end END

LGUI (g).FrameProp (1, "Style:MMJB, Window, Title:MMJB Style, Transparent, TranspNum:2")
LGUI (g).SetTransp (2, "Low", 80, 1)

loop
    var t : int := Time.Elapsed
    cls
    drawfillbox (0, 0, maxx, maxy, 7)
    Pic.Draw (pic, 0, 0, 0)

    LGUI (g).DrawFrame (1, "CC", maxx div 2, maxy div 2, 400, 400)
    LGUI (g).InputBox (1, "CC", maxx div 2, maxy div 2, 200)
   
    View.Update
    exit when LGUI (g).GetFocus = -1 and LGUI (g).GetText (1) = "EXIT"
end loop

Pic.Free (pic)
drawfillbox (0, 0, maxx, maxy, 7)



LGUI.rar
 Description:

Download
 Filename:  LGUI.rar
 Filesize:  470.57 KB
 Downloaded:  221 Time(s)

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 4  [ 52 Posts ]
Goto page 1, 2, 3, 4  Next
Jump to:   


Style:  
Search: