LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
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"
myvar.2 = "Line 1,1"||'09'x||"Line 1,2"||'09'x||"Line 1,3"||'09'x||"Line 1,4"
myvar.3 = "Line 2,1"||'09'x||"Line 2,2"||'09'x||"Line 2,3"||'09'x||"Line 2,4"
myvar.4 = "Line 3,1"||'09'x||"Line 3,2"||'09'x||"Line 3,3"||'09'x||"Line 3,4"
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 |