[Module] ContainerEx - Module (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] ContainerEx - Module (all OS)

Post by Thorsten1867 »

Extended Container Gadget - Module (all OS / DPI / 64Bit)
  • change background color
  • automatic gadget size adjustment
  • add title possible (similar to FrameGadget)
  • change text align, color and font possible
  • automatic adjustment of the border to the text size
Image _ _ _ Image

Code: Select all

; ContainerEx::Close()              - similar to 'CloseGadgetList()'
; ContainerEx::DisableReDraw()      - disable redraw
; ContainerEx::Gadget()             - similar to 'ContainerGadget()'
; ContainerEx::SetAutoResizeFlags() - [#MoveX|#MoveY|#Width|#Height]
; ContainerEx::SetColor()           - similar to 'SetGadgetColor()'
; ContainerEx::SetFont()            - similar to 'SetGadgetFont()'
; ContainerEx::SetText()            - similar to 'SetGadgetText()'
Download: ContainerExModule.pbi
Last edited by Thorsten1867 on Fri Dec 20, 2019 4:04 pm, edited 4 times in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ContainerEx - Module (all OS)

Post by Cyllceaux »

Line 337: If IsWindow(ListEx()\Window\Num)

ListEx() not found
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ContainerEx - Module (all OS)

Post by Thorsten1867 »

Fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ContainerEx - Module (all OS)

Post by Cyllceaux »

Thorsten1867 wrote:Fixed
still there :(

If you use Themes and SetText, the top border is not drawn correctly.


Btw... hide would be usefull ;)
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ContainerEx - Module (all OS)

Post by Thorsten1867 »

There were actually still some hidden behind a CompilerIf.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ContainerEx - Module (all OS)

Post by Cyllceaux »

I mean a hide function.

the canvas is always drawn. If I make "HideGadget()" it's still drawn
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ContainerEx - Module (all OS)

Post by Thorsten1867 »

Update: Added ContainerEx::Hide()
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ContainerEx - Module (all OS)

Post by Cyllceaux »

In the dark theme and resize, its flickering really hard between white and blue.

I commented line 389 and I noticed, the gadget changed to white.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ContainerEx - Module (all OS)

Post by Thorsten1867 »

Then it must be the original background color of the CanvasGadget. Obviously it will be deleted automatically when resizing.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ContainerEx - Module (all OS)

Post by Cyllceaux »

Found a flickering Solution...

I added additionally on line 518: BindGadgetEvent(ContainerEx()\CanvasNum, @_ResizeHandler(), #PB_EventType_Resize)

now, everything is smooth


on line 283, I changed to: RoundBox(X, Y, Width, Height,8,8, ContainerEx()\Color\Border)
This looks cool... maybe it is a good theme option?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ContainerEx - Module (all OS)

Post by Thorsten1867 »

Update:
  • Added: Attribute '#Corner'
  • Fixed resizing
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply