Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Extreme DataWindows > Moving Images from One Datawindow to Another

Moving Images from One Datawindow to Another

In many applications, you might have a situation in which you want to drag objects from a palette of objects to some type of canvas. In this case, you will have a window that might have one datawindow containing a set of standard images that you can select from and copy to another datawindow in which you build something like a network, pipeline, or workflow diagram. In order to make the movement look seamless between the two datawindows, you must use a third independent object that performs the actual move between the objects. In this case, a descendant of the PowerBuilder picture object will be used. A descendant is used because you will create instance variables within the picture object to hold data from the copied datawindow object. You also must set the picture to not visible because you are using it as a drag object only.

The action is initiated with a oe_lbd event on an object in the palette datawindow. In this event, you will extract the row of the selected image and the image name. You also want to position the picture object precisely over the datawindow image object and have it assume the width and height of the object so that it appears as if you are dragging the actual image object. This is made more difficult if you have autosize set on your detail band. In the palette datawindow, you must create a computed field that contains the cumulative y value of every row. This is done with the following computed expression called row_height:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint