It is currently Wed Sep 18, 2019 9:16 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: [Module] ResizeExModule.pbi (all OS)
PostPosted: Tue Mar 12, 2019 7:53 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
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:
  ; 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

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Last edited by Thorsten1867 on Wed Mar 13, 2019 5:16 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Wed Mar 13, 2019 5:51 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 107
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:
WindowBounds(#Window, 250, 200, #PB_Ignore, #PB_Ignore)

Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Wed Mar 13, 2019 6:06 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 107
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Wed Mar 13, 2019 8:49 am 
Offline
User
User

Joined: Wed Apr 18, 2018 8:24 am
Posts: 98
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Wed Mar 13, 2019 9:51 am 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4502
Location: Lyon - France
Usefull module, works fine here :D
Thanks for sharing 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Wed Mar 13, 2019 5:21 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Update:
  • Bugfixes
  • Support of containers
  • Automatic size adjustment for a defined ListIcon column
  • minimum and maximum window size

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Wed Aug 07, 2019 12:45 pm 
Offline
User
User

Joined: Mon Jan 21, 2019 1:41 pm
Posts: 23
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Sat Aug 10, 2019 12:13 pm 
Offline
User
User

Joined: Mon Jan 21, 2019 1:41 pm
Posts: 23
Not possible?


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Sat Aug 10, 2019 12:30 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 1082
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 5.70 LTS (Windows x86/x64) | Windows10 Pro x64 | Z370 Extreme4 | i7 8770k | 32GB RAM | iChill GeForce GTX 980 X4 Ultra | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Sat Aug 10, 2019 1:17 pm 
Offline
User
User

Joined: Mon Jan 21, 2019 1:41 pm
Posts: 23
Because I need a fixed size element in the upper left part of the window


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ResizeExModule.pbi (all OS)
PostPosted: Tue Sep 03, 2019 11:30 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
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()

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye