Updated sample with added features from pbdev.id blog
Have you ever wanted Windows Tile Menu Style on your application? this datawindow object can give you way to have it.
Just add row data to set Image, Text and size of the tile.
Its an external #datawindow #object of #powerbuilder that displaying your data rows with #Tile #Menu visual style, no need to script. just add row on your datawindow object in design time to set the image, text and tile size. It will show tile menu as you edit the the data rows.
This is step by step on how to :
- Create an N-UP, external datawindow with columns to hold tileid, tileicon, tilename, tilesize, tilecolor, and tileevent. In this article we use 6 rows per detail
- Delete all controls from datawindow, to clear up space
- Save you datawindow with dwo_tiles name
- Create 6 rectangle to be the tile of each row per detail
- Set each rectangle properties using expression in the table below.
Take note the size of the rectangle say we set to 500 in powerbuilder unit, and 40 for the space between two tiles,
Control |
Property expression |
||
x |
width |
visible |
|
r_1 |
500 * ( 0 ) |
500 * tilesize[0] |
if ( isnull ( tilesize[0] ) , 0 , 1 ) |
r_2 |
500 * (tilesize[0]) + 40 * 2 |
500 * tilesize[1] |
if ( isnull ( tilesize[1] ) , 0 , 1 ) |
r_3 |
500 * ( tilesize[0] + tilesize[1]) + 40 * 3 |
500 * tilesize[2] |
if ( isnull ( tilesize[2] ) , 0 , 1 ) |
r_4 |
500 * (tilesize[0] + tilesize[1] + tilesize[2] ) + 40 * 4 |
500 * tilesize[3] |
if ( isnull ( tilesize[3] ) , 0 , 1 ) |
r_5 |
500 * (tilesize[0] + tilesize[1] + tilesize[2] + tilesize[3]) + 40 * 5 |
500 * tilesize[4] |
if ( isnull ( tilesize[4] ) , 0 , 1 ) |
r_6 |
500 * (tilesize[0] + tilesize[1] + tilesize[2] + tilesize[3] + tilesize[4] ) + 40 * 6 |
500 * tilesize[5] |
if ( isnull ( tilesize[5] ) , 0 , 1 ) |
- Try to add 8 rows to your datawindow and right click to check the sharedata, and see what happen. Enter different tilesize with value 1 or 2
- Whoaala your tile is ready
- Now you repeat the same thing for the Icon and Tile Name. use expression to put them into the position you want.
- Done
will be share this on the #Indonesia #PowerBuilder #Developer #Coexist event
visit #zulmach blog for more information https://zulmach.wordpress.com
Comments (8)