| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. View control #11647 | I want to use the View control for the first time and am hitting a problem/bug. Here's my test code
LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow()
rc = post_create_window()
guisetctlvalue()
guisetctlplacement(,,,,,,'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
post_create_window:
DO i = 1 TO 4
SELECT i
WHEN 1 THEN
DO
mycolumn.!width = 40
mycolumn.!text = "Module/section"
mycolumn.!state = "LEFT"
END
WHEN 2 THEN
DO
mycolumn.!width = 20
mycolumn.!text = "Start"
mycolumn.!state = "LEFT"
END
WHEN 3 THEN
DO
mycolumn.!width = 20
mycolumn.!text = "End"
mycolumn.!state = "LEFT"
END
OTHERWISE
DO
mycolumn.!width = 20
mycolumn.!text = "Time taken (secs)"
mycolumn.!state = "RIGHT"
END
END
mycolumn.!subitem = i
guiaddctltext("trace_view", "MyColumn", 1)
END
RETURN 0
wm_click_ok_button:
trace_event_type.0 = 5
DO i = 1 TO 5
trace_text.i = 'Trace_text 'i
trace_event_type.i = 'Trace_event_type 'i
END
DO i = 1 TO trace_event_type.0
myitem.!item = i
myitem.!subitem = 1
myitem.!text = trace_text.i
myitem.!subitem = 2
myitem.!text = trace_event_type.i
guiaddctltext("trace_View", "MyItem")
END
RETURN 0
Run the script, press the button - I don't see anything being added to the view control. I'm assuming I can do what I'm trying to ?
I'll carry on experimenting in the meantime | 2. Found it #11648 | The last DO block should have been (note the GuiAddCtlText for every cell in the view)
DO i = 1 TO trace_event_type.0
myitem.!item = i
myitem.!subitem = 1
myitem.!text = trace_text.i
guiaddctltext("trace_View", "MyItem")
myitem.!subitem = 2
myitem.!text = trace_event_type.i
guiaddctltext("trace_View", "MyItem")
myitem.!subitem = 3
myitem.!text = trace_text.i
guiaddctltext("trace_View", "MyItem")
myitem.!subitem = 4
myitem.!text = trace_event_type.i
guiaddctltext("trace_View", "MyItem")
END
| 3. Jeff - can you update the View docs please ? #11649 | Now that I'm going to start using it, I can see a possible need for creating the control dynamically. In the one situation, I might want a view with 2 columns with data, in the other with 4 columns.
Or is there a way of changing the number of columns and headers (dropping the view's control variables and recreating them ?) | 4. Another question #11652 | Is there an equivalent way of doing the following (for a listbox control)
listboxline(handle, 393, i - 1, myline)
so as to pick up the next item/line from a view control ? | 5. Sort of a view #11656 | Is this implemented yet ? My control is defined as
view 15, 96, 473, 126, report|share|edit|border, clientedge, trace_view
but clicking on the column header seems to make no difference | 6. #12352 | You can remove a ctl with GuiRemoveCtl, reassign your variables, and then recreate the control with GuiAddCtl. | 7. #12354 | Update to the latest REXX GUI.
Assume you've associated the REXX variable named "MyView" with your view control.
Add a handler for its COLUMNCLICK event. Your view control's variable will be set to the column number clicked upon. For example:wm_columnclick_myview:
guisay("User clicked upon column #" || myview)
RETURN | 8. Thanks - did the trick nicely #12355 | | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|