1. Re[2]: Icons with text underneath
- Posted by aku saya <akusaya at gmx.net> May 27, 2003
- 354 views
Thanks, it works. But why is something like this: constant PushButton3 = createEx( PushButton, "PushButton3", FlatToolBar2, 0, 1, 38, 38, 0, 0 ) shows text below the button, while this constant PushButton3 = createEx( PushButton, "PushButton3", FlatToolBar2, 0, 0, 38, 38, 0, 0 ) dont show the text. The difference is the "y" parameter. Is it documented somewhere? Thanks! ______________________________________________ D> On Mon, 26 May 2003 11:47:38 +0700, aku saya <akusaya at gmx.net> wrote: >> >> Sorry if this is a duplicate message, but I didn't see my post on the >> list.------- >> >> How to make a toolbar, that has icons with text underneath it? >> >> It is like the thing in the attached picture. >> >> Thanks! >> >> btw, thanks for the many icon suggestions! D> Use a FlattoolBar control. Here is some win32lib code... D> --------------------- D> without warning D> include win32lib.ew D> integer Win, TB D> integer B1, B2 D> integer tbheight D> -- Get some icons to use. D> constant closefolder = extractIcon( "clsdfold.ico" ), D> openfolder = extractIcon( "openfold.ico" ), D> dos = extractIcon( "disk05.ico" ), D> linux = extractIcon( "disk06.ico" ), D> generic = extractIcon( "disks04.ico" ), D> icons = {addIcon( {closefolder, openfolder, openfolder} ), D> addIcon( {dos, linux, generic } ) D> } D> -- Create the main window D> Win = create( Window, "Simple Flat ToolBar Demo", 0, 0, 0, 300, 300, 0 ) D> -- Calc to toolbar height as Large Icon size + twice the current font D> height. D> tbheight = (getSystemMetrics(SM_CYICON) + 2 * getTextHeight(Win, "|")) D> -- Add the flat toolbar. D> TB = create( FlatToolBar, "", Win, 0, 0, 0, tbheight, 0) D> -- Add a couple of buttons with tooltips. D> B1 = create( PushButton, {"Folders", "Folder Functions"}, TB, icons[1], D> 10, 0, 0, 0) D> B2 = create( PushButton, {"OpSys", "Operating System Functions"}, D> TB, icons[2], 10, 0, 0, 0) D> -- And that's it. D> WinMain( Win, Normal ) D> ----------------
2. Re: Re[2]: Icons with text underneath
- Posted by Derek Parnell <ddparnell at bigpond.com> May 27, 2003
- 351 views
----- Original Message ----- From: "aku saya" <akusaya at gmx.net> To: "EUforum" <EUforum at topica.com> Subject: Re[2]: Icons with text underneath > > > Thanks, it works. > > But why is something like this: > > constant PushButton3 = createEx( PushButton, "PushButton3", > FlatToolBar2, 0, 1, 38, 38, 0, 0 ) > > shows text below the button, while this > > constant PushButton3 = createEx( PushButton, "PushButton3", > FlatToolBar2, 0, 0, 38, 38, 0, 0 ) > > dont show the text. > > The difference is the "y" parameter. > > Is it documented somewhere? No, its not documented and I don't know why it was coded that way either. If no one can see good reason not to, I will change it so that even if the 'y' value is zero on the createEx() call, any text for the FlatToolbar button will be shown anyway. -- Derek