Murga-Projects Forums
Different boxes - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: Different boxes (/showthread.php?tid=253)


Different boxes - scoop0101 - 10-24-2007 07:44 AM

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.


RE: Different boxes - znarf - 10-25-2007 04:07 AM

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


RE: Different boxes - mikshaw - 10-25-2007 07:20 AM

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


RE: Different boxes - scoop0101 - 10-26-2007 08:18 AM

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,


RE: Different boxes - JohnMurga - 10-28-2007 10:01 PM

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


RE: Different boxes - mikshaw - 10-29-2007 05:16 AM

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.


RE: Different boxes - JohnMurga - 10-29-2007 11:00 PM

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


RE: Different boxes - mikshaw - 10-31-2007 01:53 PM

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.