1. Miguel Leeuwe
  2. PowerBuilder
  3. Friday, 28 August 2020 04:29 AM UTC

Hi everyone,

About resizable response windows:

I've checked all I could find on google, but no luck.

I do have a working version of a resizable response window (using the windows SetWindowLong API), but I can't figure out how to show a "gripper" in the right bottom corner. (others call it "chevron" icon).

I did have this working in the past but unfortunately I've lost that code.

Also, I vaguely remember that it doesn't work anymore on newer windows versions.

The current problem with a resizable response window, is that you have to position your mouse slightly "outside" of the areao where you would normally expect the resize arrow to appear, for it to work (sorry for my bad English).

 

If still possible, anyone knows how to do this? 

TIA

 

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 2 September 2020 16:32 PM UTC
  2. PowerBuilder
  3. # Permalink

Running with Roland's suggestion to use a static text control, and based on the "Resize Response" free code sample he generously makes available to all on his TopWizProgramming.com web site, I have created a resizable response window that contains a "resize grip" drag control in the lower-right corner. With Roland's permission, I've attached the enhanced sample application here. The sample app was written in PB 2017 R2 and has been tested under Windows 7 and 10. The code should be easily adaptable to other types of resizable windows (main/sheet, etc.)

During development, I was also able to create a version that utilizes the DrawFrameControl Windows API. It worked, but it required the use of several additional WinAPI functions and more involved code. As others have noted, the DrawFrameControl API is from the Windows XP era and it has not been modernized. The grip it renders is limited to a background color of "button face" and I'm told it also does not behave well in alternative dots-per-inch (DPI) conditions (it is not "DPI-aware"), so I went with the static text control that uses the Marlett font. The sample app illustrates how the grip appears with some alternative window background colors.

The main key to getting this to work correctly was using WinAPI functions that allows the window to capture the mouse cursor during the "drag/resize" operation, then release it. Another key was that the "grip" static text control must be disabled so that it does not receive focus when you click on it to drag/resize the window. There really is not much code needed to make it work, surprisingly.

As Chris has mentioned in this thread and most of you know, PB Themes obviously significantly alters an application's visual appearance. I've not tested the resize grip with themes, but I would be very surprised if it works...so be aware that it was not intended for use with themes.

Miguel, I hope this is something you can use. Have fun!

 

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Wednesday, 2 September 2020 16:41 PM UTC
Wow! Thank you John! I already gave up on this, as it requires more knowledge than I have and after browsing the web and trying for a full day ...

I`ll let you know how it behaves and if it works with Themes.

Thank you so much!

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 2 September 2020 17:46 PM UTC
Great stuff!

I've noticed that on your version of the resizable response the resize cursor DOES show correctly when moving over the borders (in my old version, I have to move slightly away from the border). So that's something I'll have to compare too. I'm using a mix of external functions in the PFCs and some old code from "The Anvil of Times".



I've tested it with Appeon's Blue Theme: works great too!

Thank you once again (also Roland and Chris of course!).
  1. Helpful
  1. John Fauss
  2. Wednesday, 2 September 2020 18:31 PM UTC
You're welcome!
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 28 August 2020 12:58 PM UTC
  2. PowerBuilder
  3. # 1

The gripper can be created with a statictext using the Marlett font. The lower case o is the one you want.

The 'official' Windows way to do it is with the DrawFrameControl function with DFC_SCROLL for arg3 and DFCS_SCROLLSIZEGRIP for uType. 

DFC_SCROLL = 3
DFCS_SCROLLSIZEGRIP = 8

I have a resize response example. It doesn't have the gripper on it.

https://www.topwizprogramming.com/freecode_resize_response.html

 

Comment
  1. Miguel Leeuwe
  2. Monday, 31 August 2020 15:11 PM UTC
Hmm, that's sort of what I've been trying to do Brad. The problem is how to translate all of that to powerbuilder external function calls (and where ....). It's not that important, I have a feeling this might not even work anymore on W10. The examples I found in C++ don't seem to compile on more modern versions of Visual Studio. It's just too much effort. After showing the control, I'd still have to make it do something too.

The only real problem is that, if you don't have to gripper control, users might not know a response window is resizable. The resize cursor only appears when you're slightly outside of the windows border (where the "thick frame" would be ending but which somehow no longer shows as a thick frame in W10).

I give up, life's too short and have lots of other (more) important stuff.

Thank you all for trying to help.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 2 September 2020 14:34 PM UTC
Hi Miguel;

I have had this functionality in my frameworks for over a decade. You are correct in that older MS-Windows O/S's used to show the gripper but W10 now does not show this icon anymore. However, moving the mouse to any border or corner point in the W10 response dialogue does show the proper drag icon. So it's pretty intuitive the way it is without the gripper icon IMHO.

The real challenge though that I find now in PB 2019 Rx, is when using Themes feature. This changes the active border on any window to be a much smaller pixel size. Thus making resizing with the mouse a much more difficult exercise as the resize drag icon is way harder to locate (activate) on the smaller border. If the user has mouse sensitivity or mobility issues - this much thinner window border on an active theme could be a real usability issue. Just my $0.02.

Regards .... Chris
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 2 September 2020 16:43 PM UTC
Hi Chris, yes we already have had it working for some years without any gripper, but I like the gripper, as it clearly indicates a user the window is resizable. Also, you have to move your mouse slightly to the exterior of the window borders for the resize cursor to appear.

Thanks!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.