CLayout class

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

CLayout class

Post by PI »

CLayout class - helper class to ease positioning and sizeing the GUI elements

I needed a layout class for my project, and I thought I could share it! It's absolutely free, you can use it, modify it, do everything with it!

You also get my nice gui settings, and an test app with examples :)

A little info on layouts:
- Layouts are typically expanding containers you can add elements into.
- You don't have to define coordinates and sizes (just minimum sizes, for the slots, if you want to) for the gui elements.
- You can bind layouts and slot to GUI elements, and update them at once.
- There are two types of container layouts: Horizontal (which grows the X+ direction) and vertical (which grows the Y+ direction)
- You can add other layouts into existing layouts, making a parent-child hierarchy.
- There are two special type of layouts: slots and spaces. They cannot have children elements.
- Slots are usually used for buttons, editboxes, scrollbars, and so on.
- Spaces are only used for spacing, they cannot be binded to gui elements.

Here's a screenshot:
Image

Here's the download link!

Cheers,
PI
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

yeah this is seriously cool. i have to check this out further. but i guess i will try to make a gui editor with this.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Post by PI »

Thanks! I've found small bugs, so I've updated the .zip! The download link is the same! If you find bugs or something please tell me!

Cheers,
PI
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Post by PI »

1.2 is out! Small bug-killing, minor changes and some speed improvement! The download-link is the same!

Cheers,
PI
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Very nice code. Well done.
Me - Like.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Post by PI »

Very nice code. Well done.
I think it's just well documented :lol: but thanks!
Post Reply