1. Philippe PILAT
  2. PowerBuilder
  3. Monday, 22 July 2019 13:20 PM UTC

Hi all,

I'm looking for a way to prevent a window (response) from resizing when the user double-clicks on the title bar.

The window is opened "maximized" but the user can double-click on titel bar and the window is resized as "normal".

Is there a way to prevent this ?

The application is published to Powerserver as WEB and MOBILE, so the solution has to be compatible with these 2 environments.

TIA

Philippe.

Accepted Answer
Georg Brodbeck Accepted Answer Pending Moderation
  1. Monday, 22 July 2019 15:13 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Philippe

I just tried something and might have a solution for you:

Put the following code into the resize event of your window:

if windowstate <> maximized! then
  post event ue_setsize()
end if

the ue_setsize event has this line:

windowstate = maximized!

 

This just re-maximizes your window everytime, the user tries to change this. Here some additional explanations:

  • The check can't be with sizetype = 2, because if you pull the window down with the mouse (instead of double clicking it), the sizetype will still be 2
  • In this case, you also need to execute it post, otherwise it would just move the normal sized window to the top left edge

It's not beautiful but maybe does the job.

Regards,
Georg.

Comment
  1. Philippe PILAT
  2. Monday, 22 July 2019 15:22 PM UTC
Thanks Georg,

it does the job (with a little flickering of the screen).
  1. Helpful
  1. David Peace (Powersoft)
  2. Monday, 22 July 2019 16:02 PM UTC
I would have done exactly the same Georg. Simple and effective.
  1. Helpful
There are no comments made yet.
Georg Brodbeck Accepted Answer Pending Moderation
  1. Monday, 22 July 2019 14:48 PM UTC
  2. PowerBuilder
  3. # 1

Hi Philippe

I see your problem, but I don't think there's a solution.

But there might be a workaround: Just open the response Window in "normal" state and size it to the screen resolution. You can do that with the following code in your open event:

environment env

getenvironment(env)

width = pixelstounits(env.screenwidth, xpixelstounits!)
height = pixelstounits(env.screenheight, ypixelstounits!) - 120 // substract task bar

It's not perfect because the task bar could be on different positions with different hights and I don't know a way to get this information. And the window is still movable. But maybe it helps.

Regards,
Georg.

Comment
  1. Philippe PILAT
  2. Monday, 22 July 2019 14:55 PM UTC
Hi Georg,

thanks for your solution.

My problem is not to have the response window maximized, it is preventing to resize the window when the user double-clicks on the title bar.

One way I found it is to remove the title bar but it is not STD GUI ...



Best regards,

Philippe.
  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.