1. Marc James
  2. PowerBuilder
  3. Wednesday, 15 April 2020 18:56 PM UTC

Hello, I am having a bit of trouble setting a rectangle on a particular row visible = 1 , i will then need to set it visible = 0 after the mouse has moved off that row.

The event that triggers this is is called mousemove (pbm_dwnmousemove).

You can see from the video, I am getting the row fine, I just need to know what command to pass for that row and that rectangle!

https://i.ibb.co/KrtZvZ8/image.png = screenshot of code/window

https://www.youtube.com/watch?v=pstB_ODsX1s = video of it running and getting the rows

Thanks

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 16 April 2020 09:11 AM UTC
  2. PowerBuilder
  3. # Permalink

Change the mousemove of your datawindow to:

 

if row > 0 then
	this.Setrow(row)
	this.object.r_rectangle.visible = "0~tif ( currentrow() = getrow(), 1, 0)"
end if

 

and in the mousemove of the window or surrounding object do:

dw_module.object.r_rectangle.visible = 0

Comment
  1. Miguel Leeuwe
  2. Thursday, 16 April 2020 11:59 AM UTC
I've dropped this comment on your youtube chat.

FlipFlap46 Leeuwe​something

FlipFlap46 Leeuwe​Hi I'm Miguel

FlipFlap46 Leeuwe​so you want to show a grey oval behand the back arrow?

FlipFlap46 Leeuwe​Just place it on top of the image with the arrow. and right click on it and do a "send to back" of the oval. The arrow image has to be transparent in the area around the arrow.

FlipFlap46 Leeuwe​I'm not sure if you can set transparencies for normal rectangle and oval objects. If not you have to use a datawindow for these 2 objects

  1. Helpful
  1. Marc James
  2. Thursday, 16 April 2020 12:03 PM UTC
Sorry, didn't notice you were on!
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 16 April 2020 15:13 PM UTC
Well I've got a zip file for you but don't know where you want me to drop it. Just let me know,

regards
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 16 April 2020 03:34 AM UTC
  2. PowerBuilder
  3. # 1

I see what you mean now, you want to appy the visibility only to one row and not on all rows.

(By the way, what I said before is wrong: the 1 that you assign, not being a number, also works as it's implicitly converted)

 

What you have to do is put an expression in the visibility attribute of the rectangle object in the datawindow:

if ( currentrow() = getrow(), 1, 0)

In the mousemove you only do:

if row > 0 then
	this.Setrow(row)
end if

 

Here's a demo of the result:

https://drive.google.com/open?id=18LmzmvOCYMMOtN9xEqEcVbrdxxvs-s__

 

Comment
  1. Miguel Leeuwe
  2. Thursday, 16 April 2020 09:35 AM UTC
Well, I guess your text shows as "Row 0" because for some funny reason your SetRow(row) (while row might be 0), doesn't blow up.

Try seeing what I mean by doing a GetRow() after you have done a SetRow(0).

This is why in my code I only do the SetRow(row) when row > 0.



Within the datawindow itself a row that "has been set" will never be 0

  1. Helpful
  1. Marc James
  2. Thursday, 16 April 2020 10:29 AM UTC
Right, i see now, you can never be 0..

If i have a 2 txt fields in each row, one showing currentrow() and one getrow() as the calculation on the text that will show, why is it they show nothing, but can be referenced in a visible calc?

https://i.ibb.co/KGMS11V/image.png



I then set a mousemove event on the DW above this one, and set it to make some static text say "No" and it doesn't seem to trigger it at all, is it because the DW is only showing a header possibly and not the actual detail

https://i.ibb.co/m0B6qCg/image.png
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 16 April 2020 10:41 AM UTC
If you would like to do that, use 2 "computed fields" instead of 2 "text fields".
  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.