1. Giuseppe moglia
  2. PowerBuilder
  3. Monday, 27 September 2021 09:24 AM UTC

Hi Guys

 

I've created a window response Maximized

When I open it  the titlebar and icons to minimize and so on is not visible

 

Attached the source code

Version PB 19 R3

Any hints?

Thanks

Attachments (1)
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 27 September 2021 10:56 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

The first "problem" is that there's no title, it's empty. Your title bar IS visible, but maybe, since this is a response window, the background is white on windows 10. (you can change those preferences using win10 colour settings btw).

For the rest, those other controls are not visible on response windows, unless you do something with windows API functions such as SetWindowPos().

Have a look at PFC classes: pfcmain.pbl - pfc_w_response. It has some attributes named:

Protected:

    Boolean        #ControlMenu                    = TRUE
    Boolean        #MinBox                            = FALSE
    Boolean        #MaxBox                            = FALSE
    Boolean        #CloseBox                        = TRUE
    Boolean        #Resizable                        = FALSE

When you inherit a window from w_response you'll see those properties as checkboxes in the properties down below the other properties:

You don't have to also mark the 'normal' checkbox for "controlmenu" for them to work (if I remember well), so if it looks like in the image below, you have to 'uncheck' that box:

If you do a search on for example "#controlmenu" in the pfc_w_response window, you'll see how they work.

Here's the code of the pfc_preopen event:

/////////////////////////////////////////////////////////////////////////
//
//	Event:	  		pfc_preOpen
//
// Arguments:		None
//
//	Returns:			None
//
//	Description: 	Triggered from the top of the open event.
//
/////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version			12.5				Initial version, provide ability to
//											make a response window resizable.
//						12.5				Adjust size of window when resizable is
//											set to true.  Border is thicker for
//											resizable windows.
/////////////////////////////////////////////////////////////////////////
//
// Open Source PowerBuilder Foundation Class Libraries
//
// Copyright (c) 2004-2017, All rights reserved.
// 
// Redistribution and use in source and binary forms, with or without
// modification, are permitted in accordance with the MIT License
// 
// 
// https://opensource.org/licenses/MIT
// 
// This software consists of voluntary contributions made by many
// individuals and was originally based on software copyright (c) 
// 1996-2004 Sybase, Inc. http://www.sybase.com.  For more
// information on the Open Source PowerBuilder Foundation Class
// Libraries see https://github.com/OpenSourcePFCLibraries
//
/////////////////////////////////////////////////////////////////////////

//	The default for the controlMenu property on pfc response windows is
//	FALSE.  Only do resize logic if developer has not changed the
//	controlMenu property.
IF NOT controlMenu THEN
	
	unsignedLong				lul_hWnd
	lul_hWnd						= Handle(this)
	
	n_cst_winSrv_style		lnvo_style
	lnvo_style					= CREATE n_cst_winSrv_style
	
	f_setPlatForm(invo_platForm, TRUE)

	//	Window is resizable
	IF #Resizable THEN
		
		lnvo_style.of_style(lul_hWnd, invo_constants.WS_THICKFRAME, TRUE)
		lnvo_style.of_style_extended(lul_hWnd, invo_constants.WS_EX_DLGMODALFRAME, FALSE)
		
		//	Adjust window size to include new thicker border style
		Long						ll_xExpand
		ll_xExpand				= invo_platForm.of_getSystemMetrics(invo_constants.SM_CXSIZEFRAME)	&
									- invo_platForm.of_getSystemMetrics(invo_constants.SM_CXDLGFRAME) + 2

		Long						ll_yExpand
		ll_yExpand				= invo_platForm.of_getSystemMetrics(invo_constants.SM_CYSIZEFRAME)	&
									- invo_platForm.of_getSystemMetrics(invo_constants.SM_CYDLGFRAME)
									
		Width						= Width	+ PixelsToUnits(ll_xExpand * 2, XPixelsToUnits!)
		Height					= Height	+ PixelsToUnits(ll_yExpand * 2, YPixelsToUnits!)
		
	END IF
	
	//	Developer requested a controlMenu
	IF #controlMenu THEN
		
		//	Add the default system menu
		lnvo_style.of_style(lul_hWnd, invo_constants.WS_SYSMENU, TRUE)
	
		UnsignedLong			lul_Menu
		lul_menu					= invo_platForm.GetSystemMenu(lul_hWnd, FALSE)
	
		//	Minimize Box
		IF #minBox THEN
			lnvo_style.of_style(lul_hWnd, invo_constants.WS_MINIMIZEBOX, TRUE)
		ELSE
			invo_platForm.DeleteMenu(lul_Menu, invo_constants.SC_MINIMIZE, invo_constants.MF_BYCOMMAND)
		END IF
	
		//	Maximize Box
		IF #maxBox THEN
			lnvo_style.of_style(lul_hWnd, invo_constants.WS_MAXIMIZEBOX, TRUE)
		ELSE
			invo_platForm.DeleteMenu(lul_Menu, invo_constants.SC_MAXIMIZE, invo_constants.MF_BYCOMMAND)
		END IF
	
		//	Restore is not needed if there is no minimize nor maximize
		IF NOT (#maxBox OR #minBox) THEN
			invo_platForm.DeleteMenu(lul_Menu, invo_constants.SC_RESTORE, invo_constants.MF_BYCOMMAND)
		END IF

		//	Size is not needed if the window is not resizable
		IF NOT (#resizable) THEN
			invo_platForm.DeleteMenu(lul_Menu, invo_constants.SC_SIZE, invo_constants.MF_BYCOMMAND)
		END IF

		//	Turn off/disable the system menu's close.  There is also
		//	code in ue_sysCommand to prevent Alt-F4 from closing the
		//	window when the closeBox is not requested.
		IF NOT #closeBox THEN
			
			invo_platForm.DeleteMenu(lul_Menu, invo_constants.SC_CLOSE, invo_constants.MF_BYCOMMAND)
			invo_platForm.DeleteMenu(lul_menu, invo_platForm.GetMenuItemCount(lul_menu) - 1, invo_constants.MF_BYPOSITION)
		
		END IF
	
	END IF
	
	//	Force Redraw
	invo_platForm.SetWindowPos(lul_hWnd, 0, 0, 0, 0, 0, invo_constants.SWP_NOSIZE + invo_constants.SWP_NOMOVE + invo_constants.SWP_NOZORDER + invo_constants.SWP_FRAMECHANGED)
	invo_platForm.DrawMenuBar(lul_hWnd)
	
	DESTROY lnvo_style

END IF

Whatever is tried with the "thick border" in the above code no longer works on windows 8 and 10.

For the rest of the API declarations like DeleteMenu, SetWindowPos(), DrawMenuBar() etc. please download the latest pfc classes and have a look at the platform objects used in this code. https://github.com/OpenSourcePFCLibraries

regards,

MiguelL

 

 

Comment
There are no comments made yet.
Giuseppe moglia Accepted Answer Pending Moderation
  1. Monday, 27 September 2021 12:35 PM UTC
  2. PowerBuilder
  3. # 2

Thank you for your answer but the title is not empty

 

Here the screenshot after the open:

As you can see no titlebar is visible 

But if i drag down with the mouse:

The titlebar is now visible....

 

 

Comment
  1. Miguel Leeuwe
  2. Monday, 27 September 2021 14:57 PM UTC
When I say the title is empty, I mean there is no text written in the title attribute, at least not in the sample that you gave us and not in the image that you pasted above.

  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 27 September 2021 14:59 PM UTC
Also, when you say "if I drag with the mouse..." that already means that with the mouse you are clicking and dragging in the title bar. (maybe you don't see it, but try writing some text in it).
  1. Helpful
There are no comments made yet.
Giuseppe moglia Accepted Answer Pending Moderation
  1. Monday, 27 September 2021 16:02 PM UTC
  2. PowerBuilder
  3. # 3

Window response, maximized in PB2017--->I can see the title bar (And it cover also the bottom toolbar)

In attachment the example

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Monday, 27 September 2021 18:55 PM UTC
Exactly, now there is a visible title "My Title". (which I can see, maximized or not). For the rest of your question, see my initial answer.

regards
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 27 September 2021 19:24 PM UTC
  2. PowerBuilder
  3. # 4

Hi Giuseppe;

  Your Test App's response window works well for me (maximized and normal size) under PB2019R3 and PB2021 under W10 version 21H1 ...

Regards ... Chris

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 27 September 2021 21:09 PM UTC
  2. PowerBuilder
  3. # 5

First, what is your display size for the Windows platform. If it's > 100% perhaps that's the issue.

Next, insert the following command into the OPEN event of the main window:
    this.Center = TRUE

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 28 September 2021 08:08 AM UTC
  2. PowerBuilder
  3. # 6

Hi Giuseppe,

I can reproduce it using PB 2019 R3 Build 2670 but the issue is gone in PB 2019 R3 Build 2703. A bug about the position of the Response window had been fixed in this version (Build 2703). See the link below for details.
https://www.appeon.com/standardsupport/bugfixes/view?id=362 

Thus I suggest you upgrade to PB 2019 R3 Build 2703 or 2728 and see if the issue is gone.

Regards,
Ken

Comment
  1. Miguel Leeuwe
  2. Tuesday, 28 September 2021 17:11 PM UTC
That would explain why I didn't see any problem with the title not showing. I'm using 2019 R3 2703 too.

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