Computer Science Canada

Custom GUI

Author:  SNIPERDUDE [ 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.

Author:  SNIPERDUDE [ 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...

Author:  [Gandalf] [ 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

Author:  SNIPERDUDE [ 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.

Author:  Clayton [ 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.

Author:  SNIPERDUDE [ 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.

Author:  Clayton [ 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

Author:  SNIPERDUDE [ 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

Author:  Clayton [ 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?

Author:  SNIPERDUDE [ 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

Author:  SNIPERDUDE [ 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.

Author:  chopperdudes [ 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?

Author:  SNIPERDUDE [ 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

Author:  chopperdudes [ 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.

Author:  SNIPERDUDE [ 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)

Author:  Geniis [ Fri Nov 21, 2008 9:03 pm ]
Post subject:  Re: Custom GUI

this is a pretty sweet GUI. I really like it and it works pretty good. But i theres a small bug i noticed with one of your buttons.
Here is the code:
Turing:

import LGUI in "E:\\Turing\\LGUI\\LGUI.tu"
var g : ^LGUI
new LGUI, g

var EXIT := false

proc END ()
    EXIT := true
end END

View.Set("offscreenonly")

LGUI (g).ButtonProp (1, "Style:XPs, Text:+")
LGUI (g).ButtonProp (2, "Style:XPs, Text:-")
LGUI (g).ButtonProp (3, "Style:XPs, Text:+")
LGUI (g).ButtonProp (4, "Style:XPs, Text:-")
LGUI (g).ButtonProp (5, "Style:XPs, Text:+")
LGUI (g).ButtonProp (6, "Style:XPs, Text:-")
LGUI (g).ButtonProp (7, "Style:XPs, Text:+")
LGUI (g).ButtonProp (8, "Style:XPs, Text:-")
LGUI (g).ButtonProp (9, "Style:XPs, Text:+")
LGUI (g).ButtonProp (10, "Style:XPs, Text:-")
LGUI (g).ButtonProp (11, "Style:XPs, Text:Finished")

loop
    LGUI (g).DrawButton (1, "BL", 150, 300, 20, 20, proc)
    LGUI (g).DrawButton (2, "BL", 200, 300, 20, 20, proc)
    LGUI (g).DrawButton (3, "BL", 150, 260, 20, 20, proc)
    LGUI (g).DrawButton (4, "BL", 200, 260, 20, 20, proc)
    LGUI (g).DrawButton (5, "BL", 150, 220, 20, 20, proc)
    LGUI (g).DrawButton (6, "BL", 200, 220, 20, 20, proc)
    LGUI (g).DrawButton (7, "BL", 150, 180, 20, 20, proc)
    LGUI (g).DrawButton (8, "BL", 200, 180, 20, 20, proc)
    LGUI (g).DrawButton (9, "BL", 150, 140, 20, 20, proc)
    LGUI (g).DrawButton (10, "BL", 200, 140, 20, 20, proc)
    LGUI (g).DrawButton (11, "BL", 50, 100, 80, 20, END)
    exit when EXIT
    View.Update
end loop


Where it says proc i had some procedures...
anyways the thing was when i pressed the button a couple times the text in the button would move about three spaces to the right and about one space down.
just thought i should mention it.

Oh and as a suggestion, dont know if youve thought of it yet but you should make a way so that if you create a button or an input box and you put it in one of those moveable widows, it moves with the window when the user moves it. I think it would be cool.

Author:  SNIPERDUDE [ Fri Nov 21, 2008 10:30 pm ]
Post subject:  Re: Custom GUI

Geniis @ November 21st 2008 wrote:
this is a pretty sweet GUI. I really like it and it works pretty good. But i theres a small bug i noticed with one of your buttons.
Here is the code:
Turing:

import LGUI in "E:\\Turing\\LGUI\\LGUI.tu"
var g : ^LGUI
new LGUI, g

var EXIT := false

proc END ()
    EXIT := true
end END

View.Set("offscreenonly")

LGUI (g).ButtonProp (1, "Style:XPs, Text:+")
LGUI (g).ButtonProp (2, "Style:XPs, Text:-")
LGUI (g).ButtonProp (3, "Style:XPs, Text:+")
LGUI (g).ButtonProp (4, "Style:XPs, Text:-")
LGUI (g).ButtonProp (5, "Style:XPs, Text:+")
LGUI (g).ButtonProp (6, "Style:XPs, Text:-")
LGUI (g).ButtonProp (7, "Style:XPs, Text:+")
LGUI (g).ButtonProp (8, "Style:XPs, Text:-")
LGUI (g).ButtonProp (9, "Style:XPs, Text:+")
LGUI (g).ButtonProp (10, "Style:XPs, Text:-")
LGUI (g).ButtonProp (11, "Style:XPs, Text:Finished")

loop
    LGUI (g).DrawButton (1, "BL", 150, 300, 20, 20, proc)
    LGUI (g).DrawButton (2, "BL", 200, 300, 20, 20, proc)
    LGUI (g).DrawButton (3, "BL", 150, 260, 20, 20, proc)
    LGUI (g).DrawButton (4, "BL", 200, 260, 20, 20, proc)
    LGUI (g).DrawButton (5, "BL", 150, 220, 20, 20, proc)
    LGUI (g).DrawButton (6, "BL", 200, 220, 20, 20, proc)
    LGUI (g).DrawButton (7, "BL", 150, 180, 20, 20, proc)
    LGUI (g).DrawButton (8, "BL", 200, 180, 20, 20, proc)
    LGUI (g).DrawButton (9, "BL", 150, 140, 20, 20, proc)
    LGUI (g).DrawButton (10, "BL", 200, 140, 20, 20, proc)
    LGUI (g).DrawButton (11, "BL", 50, 100, 80, 20, END)
    exit when EXIT
    View.Update
end loop


Where it says proc i had some procedures...
anyways the thing was when i pressed the button a couple times the text in the button would move about three spaces to the right and about one space down.
just thought i should mention it.

Oh and as a suggestion, dont know if youve thought of it yet but you should make a way so that if you create a button or an input box and you put it in one of those moveable widows, it moves with the window when the user moves it. I think it would be cool.



I just edited you code slightly so it can run (just to check). After doing so, I still haven't gotten that error.

Turing:

var EXIT := false

proc END ()
    EXIT := true
end END

proc END2 ()

end END2

View.Set("offscreenonly")

LGUI (g).ButtonProp (1, "Style:XPs, Text:+")
LGUI (g).ButtonProp (2, "Style:XPs, Text:-")
LGUI (g).ButtonProp (3, "Style:XPs, Text:+")
LGUI (g).ButtonProp (4, "Style:XPs, Text:-")
LGUI (g).ButtonProp (5, "Style:XPs, Text:+")
LGUI (g).ButtonProp (6, "Style:XPs, Text:-")
LGUI (g).ButtonProp (7, "Style:XPs, Text:+")
LGUI (g).ButtonProp (8, "Style:XPs, Text:-")
LGUI (g).ButtonProp (9, "Style:XPs, Text:+")
LGUI (g).ButtonProp (10, "Style:XPs, Text:-")
LGUI (g).ButtonProp (11, "Style:XPs, Text:Finished")

loop
    LGUI (g).DrawButton (1, "BL", 150, 300, 20, 20, END2)
    LGUI (g).DrawButton (2, "BL", 200, 300, 20, 20, END2)
    LGUI (g).DrawButton (3, "BL", 150, 260, 20, 20, END2)
    LGUI (g).DrawButton (4, "BL", 200, 260, 20, 20, END2)
    LGUI (g).DrawButton (5, "BL", 150, 220, 20, 20, END2)
    LGUI (g).DrawButton (6, "BL", 200, 220, 20, 20, END2)
    LGUI (g).DrawButton (7, "BL", 150, 180, 20, 20, END2)
    LGUI (g).DrawButton (8, "BL", 200, 180, 20, 20, END2)
    LGUI (g).DrawButton (9, "BL", 150, 140, 20, 20, END2)
    LGUI (g).DrawButton (10, "BL", 200, 140, 20, 20, END2)
    LGUI (g).DrawButton (11, "BL", 50, 100, 80, 20, END)
    exit when EXIT
    View.Update
end loop


As for making it so buttons can move with the dragging of Frames (I have come across this before), I could ealsily achieve this by creating an internal X and Y co-ordinate system like I did for the frames (when you call the draw frame proc in your code, it has it's own internal co-ordinates as well to make the dragging possible). I would also have to create a communications procedure for sending and receiving that variable (so you can call a proc in your code to put the internal co-ordinates what you wish (including a 'flush', a reset), as well as a proc to tell you what the internal co-ordinates are at). Something to work on for sure, because you want your frames to be in sync with your other objects in that frame for sure.

Author:  Geniis [ Sat Nov 22, 2008 10:16 am ]
Post subject:  Re: Custom GUI

Hun... maybee i did somthing wrong then . Ill check that out.
maybee i accidentally changed sumthing in the buttonClass.t file or sumthing
(i went lookin around in the module cause i was interested in seeing how you
did it lol)

Author:  SNIPERDUDE [ Sat Nov 22, 2008 11:44 am ]
Post subject:  RE:Custom GUI

Lol, I imagine one would be interested. To make the button 'AI' if you will, I tried comparing it to a real button; so you can hold down the button without it running the proc, but as soon as you let go (whilst the mouse is still over the button) it will execute. For the running the procedure bit (how to call a specific procedure when executed) I looked at Turing's own GUI on how they did that.

Now to go work on that button and text box internal co-ordinates system. Then fix up Window Icons. If you guys get any ideas, let me know on this thread. Very Happy


* EDIT *

Okay, so I updated it so you can track, set, and flush (reset) the internal co-ordinates for all objects - you can now move objects with the frame whilst dragging. I have also added and updated the frame icons feature, so you can now add your own icons to the frames (also has an auto-scaling feature). The only one that doesn't support icons is the 'EOD' style, it would just look too strange with it. Either way I'm going to release it later, when I have a more significant amount of updates. Before I do, if you have an idea you want included let me know as soon as possible.


* EDIT *

Progress report. Added two useful objects: checkboxes and radio buttons. Added proper fading drop shadows for frames. Added Messageboxes (as in VB). Working on adding a 'tooltip' for buttons (when you pause the mouse over the button a small box will show up displaying text) for each theme and with dropshadows for effects. Also working on so that inactive windows fade. Any other ideas welcome.


FUTURE UPDATES (for versions 2.*)

Many more styles
pop-up animations (when a frame is opened if there is any type of animation, ex: center-out)
active animations (always running animations for frames, ex: 'nudge', 'twitch' effect, etc)


Example EXE below - release will be later.

To exit the example programme just close the window frame (the one programmed in). Drop shadow example on the messagebox. Note messagebox automatically fades everything else out. Just click OK or Cancel to close the messagebox. The style shown is "MMJB", frame on Low transparency at 90%. Icon example shown. Radio Button example shown, they do not have any purpose. Windows are moveable (just click and drag like for any normal window frame), but the messagebox one isn't. Note the background is ROYGBIV counter-clockwise Very Happy. Windows are not resizeable yet. Let me know if this gave you any sweet ideas.

Author:  SNIPERDUDE [ Tue Nov 25, 2008 4:09 pm ]
Post subject:  RE:Custom GUI

Does editing the last post do anything for marking it as 'unread'? Sorry about the double-post.


* UPDATE *

I thought of something whist playing around the the feature where you can match and edit internal co-ordinates; I added a new feature in the properties menu for each object (button, text box, etc) called "Match:#". What this new property does is you enter a number with it for the index of any frame you've made, and your object will auto follow the frame for you - this includes not only following the co-ordinates, but also things like visible (if you close a window it will hide the stuff matched with it as well), and even focus (when a frame loses focus, it fades into the background a bit, as will anything matched with the frame). I hope to come up with even more ways to provide not only power and flexibility, but also user friendliness as well.

Once again all ideas, comments, and criticism welcome.

I will try to clean it up enough to post version 1.6 as soon as I can - this will prove to be a much anticipated release.
Due note that the time slowing down said date is also due to the fact that so many new articles have to be included in the help manual, so bear with me during this process. If anybody wished to help me create a more elaborate and descriptive Help manual (as a revision of the one to be released), please PM me and let me know.

Thank you!

Author:  Geniis [ Fri Nov 28, 2008 5:20 am ]
Post subject:  Re: Custom GUI

Very nice. I like the message box thing...pretty sweet. And its awesome to hear about this match thing, at school right now im using your GUI in my projects instead of the regular turing one and that could be helpfull lol.
Cant wait to get the update lol.

Author:  SNIPERDUDE [ Fri Nov 28, 2008 8:03 am ]
Post subject:  RE:Custom GUI

Haha, awesome to have a fan. I am just cleaning it up so it can be submitted before the day ends. I'm sure you will appreciate the new updates, and even as I've found the match feature is incredibly useful.

* EDIT *

Sorry about not getting it up tonight, all I have left is about 20 minuets of work to do on the manual left, but with work in the morn I'm retiring for the night. Should be up tomorrow evening - I'd say before 4pm. Cheers!

Author:  SNIPERDUDE [ Sat Nov 29, 2008 5:30 pm ]
Post subject:  Re: Custom GUI

So here it is in all its glory (and confusion)...

I really messed up on the help file in that I really should come up with a new way of making a help file considering it's becoming overwhelming. I don't think everything was included either. Either way take a look at the new objects (Support/RadioButtonClass.t) (Support/CheckboxClass.t) (Support/MessageboxClass.t) (Support/ObjectProperties.t) and take a look through the help file anyways - don't use the links beacuse I didn't update them Confused . So anyways if anybody want to submit a better help file, please do - I'm going to work on a new method for my help files, I have an idea.

Launch the example file and fiddle around with that for a while if you want - just to get an idea.
For the example file, just close the messagebox to continue, and when you see that frame play around with it to just see how it works (pressing space will make it appear again and center it in the screen, pressing anything else will end the programme, you can click and drag it around, you can click off of it and make it fade out, you can close it by pressing the X in the corner, the radio buttons do nothing at this point, just for show).

If you have questions just ask.

Author:  SNIPERDUDE [ Sun Nov 30, 2008 2:09 pm ]
Post subject:  Re: Custom GUI

* IMPORTANT NOTICE *

I noticed that when going through the example file that the frame wasn't transparent although it should be. This was caused by a small error in the Frame Class file, where transparency was temporarily turned off for losing focus (since it has it's own transparency set for losing focus, it needed to be turned off so it doesn't spam resources or make it fade away too much). I have fixed this error, and you need to replace the FrameClass.t file in the support folder with this one, thank you.

Author:  andrew. [ Sun Nov 30, 2008 6:58 pm ]
Post subject:  RE:Custom GUI

I am getting an error whenever I run the example program. It says that the picture couldn't be created and shows the FrameClass.t source code.

It points to line 273: var icq : int := Pic.Scale (icp, 16, 16)

Author:  SNIPERDUDE [ Sun Nov 30, 2008 7:00 pm ]
Post subject:  RE:Custom GUI

What version of Turing?
I'll look at that piece of code.

Author:  SNIPERDUDE [ Sun Nov 30, 2008 7:07 pm ]
Post subject:  Re: Custom GUI

Okay, got it. It is the line that draws the icon of your choice. Because it says in the example file the icon is "test.bmp", I forgot to include that in the package. Here you go - put it in the same directory as the example file.

Author:  Homer_simpson [ Tue Dec 02, 2008 1:37 am ]
Post subject:  Re: Custom GUI

wow man, very neat code, kudos, seems like u've put quite a bit of work into this, GJ Very Happy

Author:  SNIPERDUDE [ Tue Dec 02, 2008 8:09 am ]
Post subject:  RE:Custom GUI

Thanks man.

I wanted a project that not only would test my skills, but also could be easily expanded to fit more. As a game would eventually suffer from overkill on graphics, I thought this would be most useful. I'm glad even a L33T Programmer found it good! Razz

Author:  andrew. [ Tue Dec 02, 2008 6:21 pm ]
Post subject:  RE:Custom GUI

Wow. Very nice. One question though, how exactly did you make the translucent windows? I know you can use RGB and change the value of each pixel but I am sure you didn't do that because it's waayyy faster.

Author:  Homer_simpson [ Tue Dec 02, 2008 8:44 pm ]
Post subject:  Re: Custom GUI

those tags beside the name dont really mean much, it just means i have more posts on this website, i'm sure there's "newbie"s on this website way better than me =)
still doesn't deprive of the fact that ur program is neat =D

Author:  SNIPERDUDE [ Tue Dec 02, 2008 8:45 pm ]
Post subject:  RE:Custom GUI

much faster.

For the translucent windows, In place of the background (drawbox), I did it in several steps. 1) screenshot the background 2) draw the normal backing on 3) take another screenshot 4) use Pic.Blend (to any given percentage) 5) draw it.

Author:  SNIPERDUDE [ Tue Dec 02, 2008 8:49 pm ]
Post subject:  RE:Custom GUI

Haha, I guess I'm the opposite case - A L33T programmer with not much status.

Author:  chopperdudes [ Tue Dec 02, 2008 10:00 pm ]
Post subject:  RE:Custom GUI

very cool, i'm beginning to implement it in my game, just the basics were used, however, i can't find out how i can possibly get the text of an input box, it's listed on the help file, but i can't find it, have you not coded that part yet?

Author:  SNIPERDUDE [ Tue Dec 02, 2008 10:42 pm ]
Post subject:  RE:Custom GUI

Take a look at the ObjectStatus functions. The one you want is:
Turing:
fcn InputBoxStatusS (Index : int, str : string) : string
    %% ERROR SCAN
    if Index < 0 or Index > 120 then
        ERROR (1, "InputBoxStatusS (" + intstr(Index) + ", " + str + ")", "", Index)
    end if


    if str = "Font" then
        result InputB (Index).Font
    elsif str = "Text" then
        result InputB (Index).Text
    elsif str = "DefaultText" then
        result InputB (Index).Default
    elsif str = "Style" then
        result InputB (Index).Style
    elsif str = "LockChar" then
        result InputB (Index).LockChar
    elsif str = "TextAlign" then
        result InputB (Index).Align
    else
        ERROR (16, "InputBoxStatusS (" + intstr(Index) + ", " + str + ")", str, 0)
    end if
end InputBoxStatusS


so to get the text of an input box you would do this:
Turing:
LGUI (g).InputBoxStatusS (1, "Text")

Author:  Geniis [ Wed Dec 03, 2008 12:58 pm ]
Post subject:  Re: Custom GUI

I like the update, its pretty sick. im using it in a paint thing my teachers makin us make. I keep getting an error tho when useing the input boxes. It says somthing about being unable to Allocate memory for something cause its alredy reached the max num of id numbers. And i still somtimes get the same problem with the text on the buttons moving after a little while. Not all the time but every now and then. And im having trouble with the fading thing it keeps saying it cant free a pic or something because it doesnt exist. I hate to bug you with all this but the errors are getting annoying lol. I just seem to keep having bad luck with it lol. I attached the programm too so you can see what i mean.

Author:  Geniis [ Wed Dec 03, 2008 12:58 pm ]
Post subject:  Re: Custom GUI

I like the update, its pretty sick. im using it in a paint thing my teachers makin us make. I keep getting an error tho when useing the input boxes. It says somthing about being unable to Allocate memory for something cause its alredy reached the max num of id numbers. And i still somtimes get the same problem with the text on the buttons moving after a little while. Not all the time but every now and then. And im having trouble with the fading thing it keeps saying it cant free a pic or something because it doesnt exist. I hate to bug you with all this but the errors are getting annoying lol. I just seem to keep having bad luck with it lol. I attached the programm too so you can see what i mean.Other than that its awesome

Edit* : oops sorry for the double post my computer did somthing wierd, and sorry bout the comments in the prog, i go to french school and my teacher makes me put them in french lol

Author:  SNIPERDUDE [ Wed Dec 03, 2008 4:19 pm ]
Post subject:  RE:Custom GUI

Arg the french. Anyways..

What is this line?
Turing:
LGUI (g).End


and
Turing:
exit when LGUI (g).Exit


After commenting those two lines out it ran perfectly fine, even the button glitch didn't come up. Change those two line so that you are using a variable inside your programme to quit, and try reinstalling the GUI. An ex:

Turing:
var EXIT : boolean := false
proc END
    EXIT := true
end proc

% The button Procedure that calls the END proc you made

exit when EXIT

Author:  TheGuardian001 [ Wed Dec 03, 2008 9:15 pm ]
Post subject:  Re: Custom GUI

Looks Awesome, very nicely done. Although I have to wonder why you would put this much effort into a GUI for Turing... or any language really. still, very nice work.
now if only I could open the help file...

Author:  SNIPERDUDE [ Wed Dec 03, 2008 9:22 pm ]
Post subject:  RE:Custom GUI

Hmm, well I made it using Office '07.

Either way I put this much effort in to a GUI because at first it was a way to just test all of my programming abilities and push them farther. It has certainly done that, and along the way I found it to be a great project - it has an outcome all can enjoy, and the topic of a custom library interested me.

And like mentioned earlier, the next major release I make will include a much easier help file - I am planning on using my GUI to create a help programme that reads a directory and displays the files I include. This allows it to be more universal, and everyone can open it. It would look similar to that of other help files, much like Turing's. Should be well worth it.

Author:  syntax_error [ Thu Dec 04, 2008 1:14 am ]
Post subject:  Re: Custom GUI

TheGuardian001 @ Wed Dec 03, 2008 9:15 pm wrote:
Looks Awesome, very nicely done. Although I have to wonder why you would put this much effort into a GUI for Turing... or any language really. still, very nice work.
now if only I could open the help file...



magic

Author:  SNIPERDUDE [ Thu Dec 04, 2008 7:52 am ]
Post subject:  RE:Custom GUI

An FLV converter for a word document?

Author:  Geniis [ Thu Dec 04, 2008 9:22 am ]
Post subject:  Re: Custom GUI

Oh the LGUI(g).Exit thing is just somthing i added in to the lgui.tu file for my use to exit a program...kinda like turings GUI.Exit thing. Anyways i stoped getting the errors for some reason...all of them at once. Sorry for the trouble lol.

Author:  SNIPERDUDE [ Thu Dec 04, 2008 4:12 pm ]
Post subject:  RE:Custom GUI

No problem.
Just make sure your exit thing doesn't interfere with anything else.

Author:  Geniis [ Fri Dec 05, 2008 5:04 pm ]
Post subject:  Re: Custom GUI

ya i made sure it didnt... and i think i found the probleme. My pc at home is an old windows me laptop that cant doesnt run turing very well lol and as soon as i used the school computers there was nothing wrong. So it was just my computer lol.

Author:  SNIPERDUDE [ Fri Dec 05, 2008 8:51 pm ]
Post subject:  RE:Custom GUI

Cool, I've never heard that before. Well, you learn something new everyday - today's was Don't eat gravel. Razz

Author:  andrew. [ Thu Jun 18, 2009 11:57 am ]
Post subject:  Re: RE:Custom GUI

SNIPERDUDE @ Tue Dec 02, 2008 8:45 pm wrote:
much faster.

For the translucent windows, In place of the background (drawbox), I did it in several steps. 1) screenshot the background 2) draw the normal backing on 3) take another screenshot 4) use Pic.Blend (to any given percentage) 5) draw it.
Oh Pic.Blend. I forgot about that. I've used mostly 4.0.5 so I don't really know about the 4.1.x features.

EDIT: A suggestion: for the locations of the radio buttons, you should have them relate to your frame instead of the window. e.g. if I put the x value as 0, it goes to 0 in the main window instead of 0 in your GUI.

Author:  SNIPERDUDE [ Thu Jun 18, 2009 9:00 pm ]
Post subject:  Re: RE:Custom GUI

andrew. @ June 18th 2009 wrote:
Oh Pic.Blend. I forgot about that. I've used mostly 4.0.5 so I don't really know about the 4.1.x features.

EDIT: A suggestion: for the locations of the radio buttons, you should have them relate to your frame instead of the window. e.g. if I put the x value as 0, it goes to 0 in the main window instead of 0 in your GUI.

Cool, thanks for the suggestion. Although I have pretty much stopped this project in Turing, I was thinking of starting it fresh in Python. I know there are quite a few libraries I could download - but I want to make one as advanced as possible. Plus - I wouldn't need to worry about speed like I do in Turing (which was a major problem when making special effects like drop shadows, transparencies, etc.)

New start, new ideas, going to be good. So if you do have any cool ideas for an awesome GUI let me know - I'm down for trying new stuff.

Author:  mirhagk [ Wed Nov 18, 2009 12:40 am ]
Post subject:  RE:Custom GUI

I'm sorry to kinda rez an old topic but I was wondering SNIPERDUDE if I could use/modify your code to use in this project i decided to undertake.

I decide to make a pseudo-operating system, this window code helps ALOT. The system will be able to create and run custom programs of it's own kind.

Please don't ask why I felt the need to do it, I just did lol

Author:  SNIPERDUDE [ Wed Nov 18, 2009 8:48 pm ]
Post subject:  RE:Custom GUI

Sure thing, I can PM you the latest version I had finished before moving this project to another language - much has been done since the last post.

Author:  mirhagk [ Sat Nov 21, 2009 8:12 am ]
Post subject:  RE:Custom GUI

Just out of curiousity does anyone know where the custom GUI tutorial is?

Author:  SNIPERDUDE [ Sun Nov 22, 2009 1:38 am ]
Post subject:  RE:Custom GUI

A tutorial to create a custom GUI? Or a tutorial for this GUI?
For the former I don't believe there is one. Just comes down to learning Turing and thinking out the logic.
For the latter I think I put some form of documentation in the folder.


: