GetOrigin PowerScript function
Description
Finds the X and Y coordinates of the upper-left corner of
the ListView item.
Controls
ListView controls
Syntax
|
1 |
<span>listviewname</span><span>.GetOrigin</span> ( <span></span><span>x , y</span> <span></span>) |
|
Argument |
Description |
|---|---|
|
listviewname |
The ListView control for which you want |
|
x |
An integer variable in which you want |
|
y |
An integer variable in which you want |
Return Values
Integer. Returns 1 if it succeeds and – 1
if it fails.
Usage
Use GetOrigin to find the position of a
dragged object relative to the upper left corner of a ListView control.
Examples
This example moves a static text clock to the upper-left
coordinates of the selected ListView item:
|
1 |
integer li_index |
|
1 |
listviewitem l_lvi |
|
1 |
|
1 |
li_index = lv_list.SelectedIndex() |
|
1 |
lv_list.GetItem(li_index, l_lvi) |
|
1 |
|
1 |
lv_list.<span>GetOrigin</span>(l_lvi.ItemX, l_lvi.ItemY) |
|
1 |
|
1 |
sle_info.Text = "X is "+ String(l_lvi.ItemX) & |
|
1 |
   + " and Y is " + String(l_lvi.ItemY) |
|
1 |
|
1 |
st_clock.Move(l_lvi.itemx , l_lvi.ItemY) |
|
1 |
|
1 |
MessageBox("Clock Location", "X is " & |
|
1 |
   + String(st_clock.X) & |
|
1 |
   + ", and Y is " & |
|
1 |
   + String(st_clock.Y)+".") |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest