Page 1 of 1

PB5.30 #PB_Container_BorderLess

Posted: Fri Aug 08, 2014 11:51 pm
by IdeasVacuum
PB5.30 x86 Tested XP/Win7/Win8.1

If a ContainerGadget() is given the flags: #PB_Container_BorderLess | #PB_Container_Flat

..... you get a flat container with a black line border?

Code: Select all

Enumeration
#Win
#Cntr
#BtnExit
EndEnumeration

Procedure Win()
;--------------

Protected  iExit.i = #False
Protected iFlags.i = #PB_Container_BorderLess | #PB_Container_Flat

               If OpenWindow(#Win, 0, 0, 600, 100, "", #PB_Window_ScreenCentered)

                          SetWindowColor(#Win, RGB(192,192,192))

                         ContainerGadget(#Cntr,     10, 10, 580,  50, iFlags)
                            ButtonGadget(#BtnExit, 100, 12, 100,  26, "Exit")
                          SetGadgetColor(#Cntr, #PB_Gadget_BackColor, RGB(125,125,255))
                         CloseGadgetList()

                         Repeat

                                Select WaitWindowEvent(1)

                                      Case #PB_Event_Gadget

                                          Select EventGadget()

                                              Case #BtnExit: iExit = #True

                                          EndSelect

                                EndSelect

                         Until iExit = #True
               EndIf
EndProcedure

Win()

End

Re: PB5.30 #PB_Container_BorderLess

Posted: Sat Aug 09, 2014 12:21 am
by Bisonte
It's normal. #PB_Container_BorderLess = 0 !

If you create a ContainerGadget() it's the default.
So every ContainerGadget is "borderless" till you take another Flag...

Re: PB5.30 #PB_Container_BorderLess

Posted: Sat Aug 09, 2014 12:23 am
by IdeasVacuum
....just tested the above snippet (on XP) with #PB_Container_Flat only, still draws that border!
....Same result from PB4.61 strangely.

Re: PB5.30 #PB_Container_BorderLess

Posted: Sat Aug 09, 2014 12:29 am
by Bisonte
#PB_Container_Flat draws the border ....

Flags = #PB_Container_BorderLess | #PB_Container_Flat
is like
Flags = 0 | 1
so Flags = 1

;)

Re: PB5.30 #PB_Container_BorderLess

Posted: Sat Aug 09, 2014 1:33 am
by IdeasVacuum
...so what we are saying then is that you can't have a flat borderless container?

Re: PB5.30 #PB_Container_BorderLess

Posted: Sat Aug 09, 2014 9:52 am
by Danilo
How do you want a ContainerGadget to look like, when having a flat border and no border at the same time?

Re: PB5.30 #PB_Container_BorderLess

Posted: Wed Aug 13, 2014 9:20 pm
by IdeasVacuum
I want it to simply be a rectangle to arrange other gadgets in, without it being seen as an underlying gadget. It's there for my purposes, not my User's.

Re: PB5.30 #PB_Container_BorderLess

Posted: Wed Aug 13, 2014 10:02 pm
by BorisTheOld
IdeasVacuum wrote:I want it to simply be a rectangle to arrange other gadgets in, without it being seen as an underlying gadget. It's there for my purposes, not my User's.
Just set the window and the container to the same colour, and use #PB_Container_BorderLess

You'll see that the the container is flat and borderless. Which is what you want.

I use this technique in all my resizable GUI classes.

Don't be confused by thinking that #PB_Container_Flat is the only way to create a flat container. :)

Re: PB5.30 #PB_Container_BorderLess

Posted: Wed Aug 13, 2014 10:33 pm
by Danilo
#PB_Container_Flat is a visual border style, like other #PB_Container_* styles.
#PB_Container_Flat adds a border of 1 pixel. Somehow I have the feeling
you mean something completely different when you talk about "flat container".

Code: Select all

#PB_Container_BorderLess : Without any border (Default).
#PB_Container_Flat       : Flat frame.
#PB_Container_Raised     : Raised frame.
#PB_Container_Single     : Single sunken frame.
#PB_Container_Double     : Double sunken frame.