PB5.30 #PB_Container_BorderLess

Just starting out? Need help? Post your questions and find answers here.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

PB5.30 #PB_Container_BorderLess

Post 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
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Bisonte
Addict
Addict
Posts: 1313
Joined: Tue Oct 09, 2007 2:15 am

Re: PB5.30 #PB_Container_BorderLess

Post 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...
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB5.30 #PB_Container_BorderLess

Post by IdeasVacuum »

....just tested the above snippet (on XP) with #PB_Container_Flat only, still draws that border!
....Same result from PB4.61 strangely.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Bisonte
Addict
Addict
Posts: 1313
Joined: Tue Oct 09, 2007 2:15 am

Re: PB5.30 #PB_Container_BorderLess

Post by Bisonte »

#PB_Container_Flat draws the border ....

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

;)
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB5.30 #PB_Container_BorderLess

Post by IdeasVacuum »

...so what we are saying then is that you can't have a flat borderless container?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PB5.30 #PB_Container_BorderLess

Post by Danilo »

How do you want a ContainerGadget to look like, when having a flat border and no border at the same time?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB5.30 #PB_Container_BorderLess

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: PB5.30 #PB_Container_BorderLess

Post 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. :)
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PB5.30 #PB_Container_BorderLess

Post 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.
Post Reply