[Module] ResizeExModule.pbi (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] ResizeExModule.pbi (all OS)

Post by Thorsten1867 »

Extended Resize - Module (All OS)
  • Store & restore window size, position and state
  • Automatic size adjustment for gadgets [#MoveX|#MoveY|#Width|#Height]
  • Automatic horizontal & vertical centering [#HCenter/#VCenter]
  • Proportional size adjustment in percent [#HFactor/#VFactor]
  • Support of containers
  • Automatic size adjustment for a defined ListIcon column

Code: Select all

  ; Window::Free()                - Delete all data
  ; Window::RestoreData()         - Restore position, size and state of the window
  ; Window::StoreData()           - Store position, size and state of the window
  ; Window::Save()                - Save data off all windows
  ; Window::Load()                - Load data off all windows

  ; Resize::AddContainer()        - Add container for automatic size adjustment of the contained gadgets
  ; Resize::AddWindow()           - Add window for automatic resizing
  ; Resize::AddGadget()           - Add gadget for automatic resizing
  ; Resize::Free()                - Delete all data
  ; Resize::RemoveContainer()     - Remove all resize data for this container
  ; Resize::RemoveGadget()        - Stop resizing gadget and remove resize data
  ; Resize::RemoveWindow()        - Remove all resize data for this window (-> CloseWindow)
  ; Resize::RestoreWindow()       - Restore original window & gadgets size
  ; Resize::SelectWindow()        - Select a previously added window
  ; Resize::SetFactor()           - Set the factor for the movement and size adjustment (Default: 100%)
  ; Resize::SetListColumn()       - Define ListIcon column for automatic resizing
Download: ResizeExModule.pbi
Last edited by Thorsten1867 on Sat Nov 23, 2019 1:38 pm, edited 2 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] ResizeExModule.pbi (all OS)

Post by Cyllceaux »

This is great :-)

DPI-Compatible: off
Image

DPI-Compatible: on
Image
And this is not resizable.


After remove line 457 and DPI-Compatible: on

Code: Select all

WindowBounds(#Window, 250, 200, #PB_Ignore, #PB_Ignore)
Image
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ResizeExModule.pbi (all OS)

Post by Cyllceaux »

Oh.. Btw... How about Container?

I mean, sometimes the parent is a container, not a window.

Or a Canvas (#PB_Canvas_Container), or a Panel, or a container in a Splitter.

It's not always the best choice to use a Window as a parent.
forumuser
User
User
Posts: 98
Joined: Wed Apr 18, 2018 8:24 am

Re: [Module] ResizeExModule.pbi (all OS)

Post by forumuser »

So is this finally a fully dpi-aware solution to resize a window with all its gadgets?

Would it be possible to add a min / max value for a window (so that the resize handler
doesn't make it smaller than these numbers)?

Regarding the saving of window data (to make it more readable), could you
add #PB_JSON_PrettyPrint to the SaveJSON() command?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: [Module] ResizeExModule.pbi (all OS)

Post by Kwai chang caine »

Usefull module, works fine here :D
Thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ResizeExModule.pbi (all OS)

Post by Thorsten1867 »

Update:
  • Bugfixes
  • Support of containers
  • Automatic size adjustment for a defined ListIcon column
  • minimum and maximum window size
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
jacky
User
User
Posts: 63
Joined: Mon Jan 21, 2019 1:41 pm

Re: [Module] ResizeExModule.pbi (all OS)

Post by jacky »

Is it possible to add e.g. a list icon gadget, that is still dpi aware
but doesn't get moved or resized? E.g. I'd like to add one in a
form gadget on the left side and it should stay on that position
and should not get resized when the window is enlarged or
reduced...

Thanks,
Jacky
jacky
User
User
Posts: 63
Joined: Mon Jan 21, 2019 1:41 pm

Re: [Module] ResizeExModule.pbi (all OS)

Post by jacky »

Not possible?
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: [Module] ResizeExModule.pbi (all OS)

Post by Bisonte »

jacky wrote:Is it possible to add e.g. a list icon gadget, that is still dpi aware
but doesn't get moved or resized? E.g. I'd like to add one in a
form gadget on the left side and it should stay on that position
and should not get resized when the window is enlarged or
reduced...

Thanks,
Jacky
Why you want to add it, if you don't want to resize it ???
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
jacky
User
User
Posts: 63
Joined: Mon Jan 21, 2019 1:41 pm

Re: [Module] ResizeExModule.pbi (all OS)

Post by jacky »

Because I need a fixed size element in the upper left part of the window
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ResizeExModule.pbi (all OS)

Post by Thorsten1867 »

With the support of Walbus I could integrate dynamic gadget texts, i.e. with the gadget size now the text size can be adjusted automatically.

Update:
  • Added: Resize gadget text (dynamic text/font)
  • Added: _CloseWindowHandler()
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
camille
User
User
Posts: 66
Joined: Tue Nov 19, 2019 12:52 pm

Re: [Module] ResizeExModule.pbi (all OS)

Post by camille »

Hello,

I'd like to ask if something like this is possible with ResizeEx?
https://imgur.com/a/Pz5EMuT

The "Profiles and sections overview" frame should only resize horizontally.
The drop-down in it should not be resized horizontally (because it
would look dumb if the text is relatively short and its drop-down is
getting wider and wider).
The listview and the buttons on the right side should grow / shrink
together with the frame they're living in.

The "Section properties" frame should resize both horizontally and vertically.
It consists of logical groups (left, middle and right).
The left one should not grow / shrink at all,
the middle one should only do it vertically,
the right one (drop-down + listview underneath it) should be resized with
the size of the belonging frame -> horizontally and vertically).
The buttons at the bottom of the frame should stay centered and resize
horizontally...

Thanks,
Camille
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ResizeExModule.pbi (all OS)

Post by Thorsten1867 »

camille wrote:Hello,

I'd like to ask if something like this is possible with ResizeEx?
https://imgur.com/a/Pz5EMuT

The "Profiles and sections overview" frame should only resize horizontally.
The drop-down in it should not be resized horizontally (because it
would look dumb if the text is relatively short and its drop-down is
getting wider and wider).
The listview and the buttons on the right side should grow / shrink
together with the frame they're living in.

The "Section properties" frame should resize both horizontally and vertically.
It consists of logical groups (left, middle and right).
The left one should not grow / shrink at all,
the middle one should only do it vertically,
the right one (drop-down + listview underneath it) should be resized with
the size of the belonging frame -> horizontally and vertically).
The buttons at the bottom of the frame should stay centered and resize
horizontally...

Thanks,
Camille

Code: Select all

Resize::AddGadget(#Frame1,  Resize::#Width)
Resize::AddGadget(#ListView,  Resize::#Width)
Resize::AddGadget(#Button,  Resize::#MoveX)
Resize::AddGadget(#Frame2,  Resize::#Width|Resize::#Height)
......
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
camille
User
User
Posts: 66
Joined: Tue Nov 19, 2019 12:52 pm

Re: [Module] ResizeExModule.pbi (all OS)

Post by camille »

Thank you, Thorsten1867!

But the thing that I don't understand is, how would I register e.g.
the first combobox in the first frame in your module?

It shouldn't move when the window is resized, and it shouldn't
be made smaller or larger as well. I see no flag value that I can
use to achieve this behavior...
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ResizeExModule.pbi (all OS)

Post by Thorsten1867 »

camille wrote:Thank you, Thorsten1867!

But the thing that I don't understand is, how would I register e.g.
the first combobox in the first frame in your module?

It shouldn't move when the window is resized, and it shouldn't
be made smaller or larger as well. I see no flag value that I can
use to achieve this behavior...
You don't have to do anything. Only gadgets that are moved or enlarged need to be registered.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

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