LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
nr_rows = 1
again:
DO FOREVER
guigetmsg()
IF EXISTS('GuiObject') == 0 THEN DO
IF EXISTS('GuiSignal') THEN DO
END
END
ELSE DO
IF EXISTS('GuiSignal') == 0 THEN DROP (guiobject)
ELSE SELECT guiobject
WHEN 0 THEN NOP
OTHERWISE
END
END
CATCH SYNTAX
CONDITION()
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_click_fill_view_button:
myvar.0 = 4
myvar.1 = "Column_1"||'09'x||"Column_2"||'09'x||"Column_3"||'09'x||"Column_4"
DO i = 1 TO nr_rows
i2 = nr_rows + 1
myvar.i2 = "Line "i2",1"||'09'x||"Line "i2",2"||'09'x||"Line "i2",3"||'09'x||"Line "i2",4"
END
myvar.0 = 1 + nr_rows
nr_rows = nr_rows + 1
guigetctlplacement("data_view", "x_pos", "y_pos", "x_width", "y_height", , "Scale")
guiremovectl("data_view")
guiaddctl("VIEW "x_pos","y_pos","x_width","y_height", REPORT|SHARE|EDIT|BORDER, , data_view")
rc = delete_all_data_lines()
rc = define_data_view_control(myvar.)
RETURN
delete_all_data_lines:
guisendmsg("data_View", "GETITEMCOUNT")
count = guisignal
DO i = count TO 1 BY -1
guisendmsg("data_View", "DELETEITEM", i)
END
RETURN 0
define_data_view_control:
USE ARG data.
view_header = TRANSLATE(data.1,' ','09'x)
nr_cols = WORDS(view_header)
DO i = 1 TO nr_cols
mycolumn.!width = 20
mycolumn.!text = WORD(view_header,i)
mycolumn.!subitem = i
guiaddctltext("data_view", "MyColumn", 1)
END
DO row = 2 TO data.0
temp = data.row
myitem.!item = row - 1
DO i = 1 TO nr_cols
PARSE VAR temp next_value '09'x temp
myitem.!subitem = i
myitem.!text = next_value
guiaddctltext("data_View", "MyItem")
END
END
RETURN 0
wm_click_fill_again:
RETURN
|