News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Different boxes
Author Message
scoop0101
Junior Member
**


Posts: 2
Group: Registered
Joined: Oct 2007
Status: Offline
Reputation: 0
Post: #1
Different boxes

FLTK does supply various shapes (or Box Types) for boxes : rounded, oval, diamond... But I could not reach them with MurgaL. Is it possible ? How ?
Thank you.

10-24-2007 07:44 AM
Find all posts by this user Quote this message in a reply
znarf
Junior Member
**


Posts: 34
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #2
RE: Different boxes

Hi scoop0101,

the following statements may illustrate the general approach:

btClear = fltk:Fl_Button(gui:w()-sz, gui:h()-sz, sz,sz, "clear")
btClear:box(fltk.FL_THIN_UP_BOX)

Regards,
Gerald

10-25-2007 04:07 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #3
RE: Different boxes

You can also change the default box so you don't have to set each individual one

Code:
Fl:set_boxtype(fltk.FL_UP_BOX,fltk.FL_BORDER_BOX)
Fl:set_boxtype(fltk.FL_DOWN_BOX,fltk.FL_ENGRAVED_BOX)

As far as I can tell, some box types such as oval and diamond are not supported in murgaLua

10-25-2007 07:20 AM
Find all posts by this user Quote this message in a reply
scoop0101
Junior Member
**


Posts: 2
Group: Registered
Joined: Oct 2007
Status: Offline
Reputation: 0
Post: #4
RE: Different boxes

mikshaw Wrote:
You can also change the default box so you don't have to set each individual one

Code:
Fl:set_boxtype(fltk.FL_UP_BOX,fltk.FL_BORDER_BOX)
Fl:set_boxtype(fltk.FL_DOWN_BOX,fltk.FL_ENGRAVED_BOX)

As far as I can tell, some box types such as oval and diamond are not supported in murgaLua


It is precisely what I was afraid of. If there are other people interested in using other boxes than those dull squares and rectangles couldn't we organize some lobbying to get them included in the next release of murgaLua ?

Thanks a lot anyway,
Cheers,

10-26-2007 08:18 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #5
RE: Different boxes

scoop0101 Wrote:
It is precisely what I was afraid of. If there are other people interested in using other boxes than those dull squares and rectangles couldn't we organize some lobbying to get them included in the next release of murgaLua ?


I think it is not supported, but can be done with the numerical values for the constants currently ... Either way I will put it on my to-do list.

However, I have spent the last two weeks fixing my house, so the new release won't be for a while.

Cheers
JohnM

10-28-2007 10:01 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #6
RE: Different boxes

EDIT: Oh heck...that's funny.

Code:
for k,v in pairs(fltk) do print(k,v) end

This shows all entries in the fltk table. I just noticed these functions:
fl_define_FL_SHADOW_LABEL
fl_define_FL_PLASTIC_UP_BOX
fl_define_FL_OVAL_BOX
fl_define_FL_EMBOSSED_LABEL
fl_define_FL_RFLAT_BOX
fl_define_FL_SHADOW_BOX
fl_define_FL_ROUND_UP_BOX
fl_define_FL_RSHADOW_BOX
fl_define_FL_DIAMOND_BOX
fl_define_FL_ROUNDED_BOX
fl_define_FL_GTK_UP_BOX
fl_define_FL_ENGRAVED_LABEL

After calling the appropriate function, I was able to use the related box type or label type using their numeric values.
It seems like an odd way to do it, but maybe it's done for lower memory usage or something?

Original post....

Quote:
can be done with the numerical values

fltk._FL_DIAMOND_UP_BOX = 24
fltk._FL_ROUND_UP_BOX = 22
fltk._FL_SHADOW_BOX = 15
fltk._FL_ROUNDED_BOX = 18
fltk._FL_OVAL_BOX = 26
fltk._FL_PLASTIC_UP_BOX = 30
fltk._FL_GTK_UP_BOX = 38

Some of these values make some sort of minor change, but it is not the change displayed in the documentation.

I also don't understand why these constants all begin with an underscore while most others do not.

This post was last modified: 10-29-2007 05:33 AM by mikshaw.

10-29-2007 05:16 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #7
RE: Different boxes

mikshaw Wrote:
I also don't understand why these constants all begin with an underscore while most others do not.


It's a bug ... They are not the only ones, I fixed a whole bunch a few weeks ago.

Cheers
John de Murga

10-29-2007 11:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #8
RE: Different boxes

The shaped boxes aren't something I particularly like, but the shadow I'll make use of in more than one area. One thing I don't like about it is it doesn't seem possible to change the shadow color specifically. I think it could be a little more subtle than it is.

This will lighten up the shadow a little:
Fl:set_color(fltk.FL_DARK3,150,150,150)

The drawback is it lightens up all shadows, including those under other 3d objects like scrollbars and regular frames.

10-31-2007 01:53 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: