1. Pau Haro
  2. PowerBuilder
  3. Friday, 10 July 2020 11:43 AM UTC

Hello,

 

Im using a UserObject to make a window top menu, with some pictures that represents the buttons. When the user clicks one option I need to put a border on it and if he click's it again, I need to take this border off. That's easy, but when trying to get the border off I get black border that looks like StyleShadowBox but it's not. Im using PB 2019 R2 and the "buttons" are picture objects.

 

Im let code down below it's pretty simple code but still not working as I want.

 

To activate the border:

To deactivate the border:

The border doing weird stuff:

 

*I tried with and without SetRedraw.

 

Thanks greetings.

 

Accepted Answer
Pau Haro Accepted Answer Pending Moderation
  1. Wednesday, 15 July 2020 13:48 PM UTC
  2. PowerBuilder
  3. # Permalink

Hello,

I solved this after all, is not the best way but it works, I'll keep improving this but for now it's ok. I let the code down below so you can see how I did it.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 10 July 2020 13:35 PM UTC
  2. PowerBuilder
  3. # 1

Greetings, Pau -

I suggest you try managing redraw for the container, uo_menu, perhaps in addition to managing redraw for the particular picture control.

this.uo_menu.SetRedraw(False)
this.uo_menu.p_5.SetRedraw(False)
this.uo_menu.p_5.Border=True
this.uo_menu.p_5.SetRedraw(True)
this.uo_menu.SetRedraw(True)

Regards, John

Comment
  1. Pau Haro
  2. Friday, 10 July 2020 13:40 PM UTC
Hi John,



I tried your code but still not working, I still working to get this issue solved. Anyways thanks your your reply.
  1. Helpful
  1. John Fauss
  2. Friday, 10 July 2020 14:21 PM UTC
Sorry to hear it did not help. It was worth a try. Good luck!
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Friday, 10 July 2020 14:39 PM UTC
  2. PowerBuilder
  3. # 2

In the HELP file, under...

      Menu object
      Prev  System Object Properties, Events, and Functions

... there is no property called "Border". If you want a shadowbox border, you will need to simulate that border using predefined rectangle objects that you can make visible, place , and size when the menu is created.


Good Luck,

Olan

Comment
  1. Pau Haro
  2. Friday, 10 July 2020 15:00 PM UTC
Hello Olan,



Im not using a Menu Object, im tring to replicate like a Toolbar menu with an UserObject created by me. Im sorry I didn't explained well but my english is not the best. Thanks anyways for trying to help.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 15 July 2020 12:25 PM UTC
  2. PowerBuilder
  3. # 3

I've tried with a picture object (a bit bigger than yours) on a userobject on a window and cannot reproduce your problem with 2019 R2.

regards.

 

Comment
  1. Pau Haro
  2. Wednesday, 15 July 2020 13:10 PM UTC
Hi Miguel,

Thanks your for the help, my picture's size is (width = 114 & height = 96). I don't really know what is happening, but again thanks to you for the reply.



Regards.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 15 July 2020 13:22 PM UTC
  2. PowerBuilder
  3. # 4

I've added my testcase so you see what I did.

Just click on the button on the main window repeatedly.

 

Attachments (1)
Comment
There are no comments made yet.
Pau Haro Accepted Answer Pending Moderation
  1. Wednesday, 15 July 2020 13:24 PM UTC
  2. PowerBuilder
  3. # 5

Hello,

Thanks you all for the help guys, Im posting this for you to see exactly what is going on with this issue. I hope to fix this issue as soon as I can.

This is the video link to see the way that it works:

https://youtu.be/ijy-IPqZWYk

Again thanks and regards.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 10 July 2020 15:45 PM UTC
  2. PowerBuilder
  3. # 6

Hi Pau;

  Nice looking UO riobbon / toolbar!

  I wonder if the BorderStyle property is being reset somehow to a "StyleShadowBox!" by the PBVM when SetReDraw() is used.

   Have you tried resetting the BorderStyle property in your scripts after the SetReDraw(True)?

Regards ...Chris

Comment
  1. Pau Haro
  2. Wednesday, 15 July 2020 12:01 PM UTC
Hi Chris,

Im sorry for the delay of my reply, I been busy this days. I already tried with and without SetRedraw, on the parent object and on the buttons, I did debug and no border style have changed and the border property still on false. I think it's a PowerBuilder bugg maybe.
  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.