Author Topic: A button to set window to ideal size  (Read 808 times)

David Graser

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 39
  • Posts: 398
    • View Profile
A button to set window to ideal size
« on: October 12, 2018, 02:41:20 pm »
A feature that might be usefully if added would be a titlebar enhancement. 

This feature is found in FM/2.  FM/2 adds a fourth title bar  button.  This feature is useful when using multiple desktops or is one does not want full screen. The button sets the FM/2 window to an ideal size.  When opening programs in multiple desktops, sometimes a program opens in two desktops.   If this happens when using FM/2, just click the button and it is moved and ideally sized in that desktop.  Or programmers could add this feature to their programs.  FM/2 source is found at Netlabs.  It could possible be a feature added to XWP. 
« Last Edit: October 12, 2018, 02:47:19 pm by David Graser »

ivan

  • Hero Member
  • *****
  • Thank You
  • -Given: 2
  • -Receive: 33
  • Posts: 904
    • View Profile
Re: A button to set window to ideal size
« Reply #1 on: October 12, 2018, 07:31:43 pm »
Hi David,

How do you define 'ideal size?  Does it depend on monitor resolution, I imagine a 28" 1920x1200 monitor has a very different 'ideal size' to a 21" 1920x1080.

The idea sounds good but I think it would need the ability to define each person's ideal size. 

Andreas Schnellbacher

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 22
  • Posts: 404
    • View Profile
Re: A button to set window to ideal size
« Reply #2 on: October 12, 2018, 09:10:44 pm »
How do you define 'ideal size?
That was my first thought, too. My second one was: An ideal size has to be defined by each application window itself. Until that information exists for most windows, at least system application windows, XWP can't make such a valuable setting work.

RickCHodgin

  • Guest
Re: A button to set window to ideal size
« Reply #3 on: October 12, 2018, 09:39:35 pm »
How do you define 'ideal size?
That was my first thought, too. My second one was: An ideal size has to be defined by each application window itself. Until that information exists for most windows, at least system application windows, XWP can't make such a valuable setting work.

A nice feature would be to be able to get the window sized the way you like it, and then right-click on the "I" button and have it save your ideal size, and then always go back in that one app to that size when clicked.

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 25
  • Posts: 405
    • View Profile
    • Blonde Guy
Re: A button to set window to ideal size
« Reply #4 on: October 12, 2018, 10:14:22 pm »
OS/2 provides an easy way to save the window information. You don't have to "remember" the ideal size. The size and position should be persistent across invocations. No button should be needed, because the app should already be the ideal size.

The API is WinSaveWindowPos, and its friends.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

RickCHodgin

  • Guest
Re: A button to set window to ideal size
« Reply #5 on: October 12, 2018, 10:30:02 pm »
OS/2 provides an easy way to save the window information. You don't have to "remember" the ideal size. The size and position should be persistent across invocations. No button should be needed, because the app should already be the ideal size.

The API is WinSaveWindowPos, and its friends.

The restoration would be for those cases where you're moved it or resized it for some purpose.  It would take it back to its "docked" or "preferred" ideal size and position, which would remain stable as things change.
« Last Edit: October 13, 2018, 01:56:29 pm by Rick C. Hodgin »

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 40
  • Posts: 358
    • View Profile
Re: A button to set window to ideal size
« Reply #6 on: October 13, 2018, 12:50:28 pm »
So what is the criteria to again set a new "ideal" size and position ? Do you want the user to select a specific menu item ? Do you want him to press a key combination ?

As Neil said, the API already exists (WinStoreWindowPos, WinRestoreWindowPos, storing to and restoring from OS2.INI).
The only problem is on what occasion you would invoke these functions.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 9
  • Posts: 528
    • View Profile
Re: A button to set window to ideal size
« Reply #7 on: October 13, 2018, 01:42:36 pm »
Here is what I would like to suggest, in combination with another feature which I dearly miss.

How many of us use a virtual Desktop setup?

I do, relying on the XPager feature of the XWP. Now what I dearly miss about my old virtual Desktop app (SkyScraper) was the ability to - upon Desktop startup - assign application windows (stuff in your startup.cmd, native OS/2's or XWP's Startup folder) to be initialized and placed in a specific Desktop screen. So in effect, stuff like your email, some monitoring utilities, etc can by-default go to normal places you expect to find them.

Now let me tie this to the topic at hand. Given the usage described above I may want the app window to be set to it's "ideal size" upon initialization, and so that is how and when I would utilize such a feature.

Again, very specific, but it does give a clear use-case.

David Graser

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 39
  • Posts: 398
    • View Profile
Re: A button to set window to ideal size
« Reply #8 on: October 13, 2018, 05:42:18 pm »
Thanks for all the responses. 

1.Xpager is a great enhancement that makes OS/2, eCS, and ArcaOS a more productive operating system.  It makes multitasking easier.  It is one of the first things I set up after installing ArcaOS.  Next, is FM/2 for my file management.  If I remember correctly, Mark Kimes originally listed it as a replacement for the workplace shell if one so chose.  Because of this, this file manger can do just about everything.

Now when building my Icons, I usually have FM/2 open multiple times in two to three virtualy desktops.  In another virtually desktop, I may have PMView open,  and in another virtual desktop, the icon editor. If I need more than one instance of icon editor, FM/2 allows me to open multiple instances of the Icon editor.  The result would be
FM/2 in the first desktop, PMView open in the second, Icon editor open in the third, FM/2 open in the fourth using it to open icon editor again, and firefox in my fifth virtual desktop.

Others are right.  An user can set each program window to the desire size by pressing Shift and dragging the side and/corner of the open window to the desired size.  This works good for many, but not all programs. QEdit is one that the shift key dragging does not work.  It resize the window correctly, but does not remember the position of the window once it is resized.

That titlebar button that FM/2 is good for it.  It gives one a lot of desktop real estate for the file manager without having to go to full screen by the click of a button.

Maybe what I should have stated is that a button needs to be added when the program gets confused and has part in one of a program window in one virtual desktop and the other part of its window in another.  Instead of having to drag and resize the window, one click of the button would move it to that virtual desktop without any effort required.

Dariusz, if I understand you correctly would like to use a virtual desktop along with  work group folders.  On start up, one work group folder would open in one assigned virtual desktop and another work group folder would open in another assigned virtual desktop  on start up.

Andreas Schnellbacher

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 22
  • Posts: 404
    • View Profile
Re: A button to set window to ideal size
« Reply #9 on: October 13, 2018, 08:16:23 pm »
An user can set each program window to the desire size by pressing Shift and dragging the side and/corner of the open window to the desired size.
Yes, that would probably the best option to get an event for to save the window data. But I see the problem that the resize messages are processed by an application itself. In order not to rebuild each application with the additional behavior, a hook can be installed to catch these messages. That has to be done once per application and is therefore not the solution. ('m not much experienced on that and am curious if another option exists.)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 10
  • -Receive: 134
  • Posts: 1948
    • View Profile
Re: A button to set window to ideal size
« Reply #10 on: October 13, 2018, 08:37:11 pm »
An user can set each program window to the desire size by pressing Shift and dragging the side and/corner of the open window to the desired size.
Yes, that would probably the best option to get an event for to save the window data. But I see the problem that the resize messages are processed by an application itself. In order not to rebuild each application with the additional behavior, a hook can be installed to catch these messages. That has to be done once per application and is therefore not the solution. ('m not much experienced on that and am curious if another option exists.)

I looked at the old xit program, http://hobbes.nmsu.edu/download/pub/os2/util/wps/xit26.zip thinking it might have the capability. It doesn't but it does show some possibilities for what a program can add to the titlebar. Be nice if the source was available.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 9
  • Posts: 528
    • View Profile
Re: A button to set window to ideal size
« Reply #11 on: October 13, 2018, 08:59:02 pm »
Hi David,

...Dariusz, if I understand you correctly would like to use a virtual desktop along with  work group folders.  On start up, one work group folder would open in one assigned virtual desktop and another work group folder would open in another assigned virtual desktop  on start up.

Close, but not quite the functionality I am suggesting. Instead what I'm looking for is that upon Desktop initialization the XPager functionality automatically put the window into a pre-assigned virtual Desktop screen. In that particular screen the window should then open using the "ideal size" setting, as defined by the user.

The way SkyScraper accomplished this was by having you setup the full virtual Desktop environment across multiple desktops and essentially do a "Save As" on all the locations (you could have multiple profiles). That way upon re-boot (or actually anytime) you could simply select a different virtual Desktop profile (mapping/layout) and existing applications would automatically get re-positioned to their "parent" virtual Desktops.

I think where you went with the idea allows for more functionality, and it certainly would accomplish what I am looking to do, although I personally am not looking for so much more functionality.
« Last Edit: October 13, 2018, 09:00:59 pm by Dariusz Piatkowski »

David Graser

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 39
  • Posts: 398
    • View Profile
Re: A button to set window to ideal size
« Reply #12 on: October 13, 2018, 10:27:40 pm »
I looked at the old xit program, http://hobbes.nmsu.edu/download/pub/os2/util/wps/xit26.zip thinking it might have the capability. It doesn't but it does show some possibilities for what a program can add to the titlebar. Be nice if the source was available.
[/quote]

I use XIT on another bootable ArcaOS partition.  The titlebar enhancement preference page is really the only page needed.  I like the idea of adding more functionality to the titlebar and selecting the location to place it.  Basically, all its other functions on its other  preference pages  have been already been added by XWP or other programs.  The titlebar functions would be a great addition.  I use the titlebar enhancements only with none of its other system enhancements selected to keep from conflicting with programs.  I also like the idea of putting the date and time anywhere on the desktop.  XIT works good if only its titlebar enhancements are used when usig ArcaOS..
« Last Edit: October 13, 2018, 11:08:00 pm by David Graser »

David Graser

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 39
  • Posts: 398
    • View Profile
Re: A button to set window to ideal size
« Reply #13 on: October 17, 2018, 01:31:22 am »
Hi David,

Close, but not quite the functionality I am suggesting. Instead what I'm looking for is that upon Desktop initialization the XPager functionality automatically put the window into a pre-assigned virtual Desktop screen. In that particular screen the window should then open using the "ideal size" setting, as defined by the user.

The way SkyScraper accomplished this was by having you setup the full virtual Desktop environment across multiple desktops and essentially do a "Save As" on all the locations (you could have multiple profiles). That way upon re-boot (or actually anytime) you could simply select a different virtual Desktop profile (mapping/layout) and existing applications would automatically get re-positioned to their "parent" virtual Desktops.

I think where you went with the idea allows for more functionality, and it certainly would accomplish what I am looking to do, although I personally am not looking for so much more functionality.

I found the program Megadesk on eCSoft/2

https://ecsoft2.org/megadesk-desktop-expander

https://ecsoft2.org/system/files/repository/megads.zip

After experimenting, I see what you are talking about.   In its options, it has the options
Restore Main State
Restore Numbered State
Redraw all Screens
Capture lost screens
Change Medadesk
Erase numbered State
Save Numbered State
Save Main State

It saves the states to its own megadesk.ini file.

After playing with it some, I agree it is nice to save states if one so chooses when starting it.  I tested it with Xpager disabled.  As near as I can tell it works fine with Xpager disabled.  However, this was not an in depth test.

I then tried it with XPager enabled.  It appears I can operate with three rooms.  However, if I go for a fourth room, it appears to get confused. Other than this, I can see no detriment to my system.  I just close Megadesk to bring everything back to normal.   Basically, XPager does most of what it does, except for the saving of states (rooms).

« Last Edit: October 17, 2018, 01:36:48 am by David Graser »