1. Neil Garcia
  2. PowerBuilder
  3. Tuesday, 25 April 2023 23:53 PM UTC

Hi everyone,

I've been trying to get the actual height of a foreground control. I put it on the header band location/position but it is a foreground. It is so that I can stretch it across multiple columns. I want to adjust the header band height (manually) based on the actual height of the foreground control/dw object. Is there a way to accomplish this? Using describe will always return the height set on the painter. I need the actual height. 

* updated to make the question a bit clearer.

Thanks

Neil

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 9 May 2023 02:01 AM UTC
  2. PowerBuilder
  3. # 1

Neil - Is the screen shot below a rough approximation of what you are wanting?

This is a screen grab of an actual PB window & DataWindow from a test app, but the DW Data Object has been manually created/tweaked.

I don't believe it is possible to have the autosize-height adjustment of the grid's column headings to occur automatically, but I think it can be coded... depending on the complexity of your requirements. I still have some work to do, but I'd like to know more about your design requirements before I spend additional effort at coming up with a possible solution. Please describe in more detail your needs/requirements and I'll try to come up with something.

Best regards, John

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 27 April 2023 06:47 AM UTC
  2. PowerBuilder
  3. # 2

Hi.

Take a look at the following discussion: Why describe Autosize Height can't return new height? (appeon.com). Syntax has the definition of how data should be displayed and how data may affect the presentation. As a result it will always return the values that were initially defined. While you cannot get that information, you can approximately calculate it. Windows provides API functions that will tell you what "space" will be used by a certain text based on font used and it's defined size (and some other information).

Andreas.

Comment
  1. Berka Frenfert
  2. Sunday, 30 April 2023 15:03 PM UTC
Hi Neil, read comment posted by Andreas.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 26 April 2023 01:40 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Neil - 

You're working on a faulty premise. The Background and Foreground layers do not contain any bands. Think of each of them instead as a transparent sheet, like an overhead projector sheet, on which you can place DW objects. While placing and working with DW objects in these two layers, you can see the contents of the normal, familiar Band layer. This gives you the mistaken impression that you are working in the Band layer.

HTH, John

Comment
  1. Neil Garcia
  2. Wednesday, 26 April 2023 14:33 PM UTC
Hi John,



I appreciate your reply to my question. I'm not sure though why it is faulty. PB has no feature like the colspan in HTML table which is exactly what I need. I am just trying to find a workaround. I need a grid dw. The header needs to stretch across multiple columns and it is autosize height. I cannot think of any other alternatives than putting the header in the foreground layer in order to stretch it. I know it's a funky solution but if I can make it work then it is still a solution.



Just to clarify my question. I am just asking if it is possible (how?) or not possible to get the actual height of a autosize height control/dwo object in the foreground/background layer. I guess, I will just have to move on if it is indeed a PB limitation and not possible.



Thanks,

Neil
  1. Helpful
  1. John Fauss
  2. Thursday, 27 April 2023 13:41 PM UTC
Your original question stated that you were wanting to work with a (text? column?) DWObject in the foreground layer of the header band. Since there are NO bands in either the foreground or background layers, I maintain that is an incorrect premise. Are you looking for a general-purpose solution that can be adapted to various examples, or is this a one-and-done? Do you have any mockup/concept images what you think this should look like? Is the grid DW going to be used for data input, or just read-only presentation? Will the user resize columns? Will auto-width be used? Is the use of the grid style a requirement? There MAY be a way to simulate what you want, but it depends on the specific requirement(s) and how much effort you are willing to invest.
  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.