1. Richard Shakour
  2. PowerBuilder
  3. Thursday, 8 March 2018 15:13 PM UTC

I am unable to place a rectangle control on a window that sits on top of an picture control also on the same window.

The rectangle control is always behind (back) of the picture control.  There is no way to move it on top of the picture.

  1. Create a new window
  2. Place a picture control on the window
  3. Place a rectangle control on the window.

The rectangle control always stays behind the picture.  Am I missing something?

All help is appreciated.

 

Richard

 

Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 8 March 2018 19:59 PM UTC
  2. PowerBuilder
  3. # 1

Hi Richard,

This is a "feature" of  "DrawObject" vs. "DragObject" controls.

  • DrawObject = Rectangle, RoundRectangle, Oval, and Line.
  • DragObject = All other controls

Same behavior in Window painter, UserObject painter, and at runtime (just checked in PB 2017 R2).

Potential workarounds:

  1. Select your rectangle using the "Control List" panel in the Window painter. Rectangle is still behind the picture, but now you have selected it if that is your only concern.
  2. Use a DataWindow object for that UI surface area. Rectangles etc. in a DataWindow are integral parts of the DW object and can be located anywhere in Z-order.
  3. Create a Custom Visual User Object containing a rectangle. Define a custom event mapped to PBM_Size to keep the rectangle filling the complete UI area.
    1. This works because your not really placing a DrawObject on the Window. Instead, you place a DragObject (your custom visual) which contains a DragObject. ​

Personally I prefer to design as much UI surface as possible using DataWindow objects.

HTH /Michael

Comment
  1. Lars Mosegaard
  2. Thursday, 8 March 2018 21:22 PM UTC
Mr Kramer is right; and workaround 4. to use a DragObject is a static text object. Obviously the text property needs to be empty string and use the text border, colour and back colour to simulate a rectangle.



 

  1. Helpful
  1. Michael Kramer
  2. Friday, 9 March 2018 00:52 AM UTC
Hey Lars, You're right! I miss working next to you. But Switzerland - Australia is a little too far to push my desk :-).



/Michael

  1. Helpful
  1. Richard Shakour
  2. Friday, 9 March 2018 12:59 PM UTC
OK Got it.  Thank you!

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 9 March 2018 14:20 PM UTC
  2. PowerBuilder
  3. # 2

Hi Richard;

  FYI: This restriction goes way back beyond PB 11.0 even.

Regards ... Chris

Comment
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Friday, 9 March 2018 17:03 PM UTC
  2. PowerBuilder
  3. # 3

Hi Richard,

 

Please also keep in mind that DrawObjects also react differently to the transparent property of other objects.

 

 

Regards, 

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