GUI - horizontal underline?

BlitzMax Forums/BlitzMax Beginners Area/GUI - horizontal underline?

EOF(Posted 2005) [#1]
Any ideas how to create the underline as shown from the MaxIDE screengrab here? ..



I've scanned through the IDE source but to no avail.
I tried creating one using a panel but it looks nothing like the separator.
I'm guessing the toolbar panel creates the line. Not tested though.


WendellM(Posted 2005) [#2]
(oops - wrong answer)


Perturbatio(Posted 2005) [#3]
That line is part of the toolbar


WendellM(Posted 2005) [#4]
Upon examination, the line is indeed created by the toolbar. Furthermore, the toolbar is always placed at 0,0 regardless of the coords given when it's created. This means that multiple toolbar gadgets "fight" each other, since they can't be placed anywhere but with the same origin:



The above image shows what happens when two toolbars are created, one at 0,0 and the second at 500, 100. The coordinates are ignored and the second toolbar's left/right arrows appear superimposed on the first toolbar's New/Open icons (both toolbars are PNGs with transparency)


Perturbatio(Posted 2005) [#5]
you can work around this by creating them inside panels and aligning the panels where you want.


Perturbatio(Posted 2005) [#6]
Incidentally, you can create the horizontal line by creating a toolbar with a null image. probably not the best way to do it though.


EOF(Posted 2005) [#7]
I see CreateLabel has a LABEL_SEPARATOR flag although the results are still undesirable.
The docs say,
LABEL_SEPARATOR:

The label is an etched box with no text useful for drawing separators


Tried:
win:TGadget = CreateWindow("separator",10,10,140,90,Null,WINDOW_TITLEBAR)

CreateLabel("",0,20,win.ClientWidth(),1,win,LABEL_SEPARATOR)

Repeat
	WaitEvent
	Until EventID()=EVENT_WINDOWCLOSE
End
Results:



Shagwana(Posted 2005) [#8]
Tried creating a thin bordered panel?, maybe one or two pixels high.


EOF(Posted 2005) [#9]
* EDIT

Using CreatePanel with a PANEL_BORDER style and the smallest height (4 pixels) produces:

Anything smaller and the panel disappears.

However, this seems to look about right:

Using a panel with a PANEL_GROUP style and the following values:
win:TGadget = CreateWindow("separator - panel",10,10,180,90,Null,WINDOW_TITLEBAR)

CreatePanel -2,20,win.ClientWidth()+2,8,win,PANEL_GROUP

Repeat
WaitEvent
Until EventID()=EVENT_WINDOWCLOSE
End
Note the -2 x offset. This is needed to remove an odd looking white pixel from the start of the line separator. Even though the line is obviously too close to the edge now. I know .. I'm hard to please.