Output Box

The Output Box widget displays streaming text data. The data may come from a specified Output Channel, or be explicitly added. By default, it does not listen to any channel.

Table 1. Summary

Logical Widget Name:

Outputbox

Physical Widget:

uoutputbox

Triggers:

None

Widget Operations:

addLine, getContent

See Widget Operations

Supported in Grid?

No

MSAA Support?

Yes, for testing purposes only. For more information, see Accessibility.

Widget Properties

Table 2. Output Box Properties

Property

Physical Name

Dynamic?

3-D Effect

3D

No

Attach to Window Border

attach

Yes

Background Color

BackColor

Yes

Bottom Line

BottomLine

Yes

Foreground Color

ForeColor

Yes

Frame

Frame

No

Label Font

labelfont

Yes

History Size

history

No

Output Channel

msgchannel

Yes

Tool Tip Text

ToolTipText

Yes

Vertical Scroll Bar

VScroll

Yes

Widget Font

Font

No

AttachMargin

Yes

PopupRect

Yes

Description

The output box widget is useful for displaying messages and process output. It can automatically stream information from the Compiler Output channel, Putmess channel, or Message Line channel, as determined by the Output Message property.

It is also possible to manually add text messages to the output box. To do so, you can do one of the following:

The Uniface line break symbol %%^ is interpreted. For example:

 "This is a veryyyyyyy long line%%^And this comes at the next line"

is displayed as:

 This is a veryyyyyyy long line
And this comes at the next line

As text is streamed in, the output box scrolls to display the last line, adding horizontal and vertical scrollbars as necessary. The widget has no awareness of the current line—there is only one active line and that is always the last line. The last line is available in the field value and can be read from Proc.

The complete content can be read using widget operation getContent.

The output box widget supports Unicode and the standard Uniface field colors. How the color is handled depends on the underlying window system.

Printing is not supported, but you can use the getContent widget operation to copy the content to a variable, which you can then send to a log file or other output.

To clear the widget, clear it's parent entity.

Widget Operations

The Output Box widget has widget operations that can be called in Proc to manipulate the contents of the widget, without changing the field's value. To call these operations, use the $widgetoperation with a field handle (obtained by $fieldhandle). For more information, see $widgetoperation.

The Output Box has the following widget operations:

  • addLine—add a string to the Output Box.

    Syntax: $fieldhandle(Field)->$widgetoperation("addLine", "LineContent")

  • getContent—copy the current content of the Output Box into a variable (Output). The output consists of a Uniface list in which each item is a line in the Output Box.

    Syntax: $fieldhandle(Field)->$widgetoperation("getContent", Output)

Keys and Macros

The output box widget uses standard keyboard keys for navigation through the data .

Table 3. Navigation Keys

Key

Action

Up and Down arrows

Scroll data one line at a time

Page Up

Page Down

Scroll data one page at a time. (A page is equal to the size of the control.)

Ctrl+Home

Move to top of data

Ctrl+End

Move to end of data

Table 4. Macros

Macro

Action

^Save

Puts the complete content on the clipboard.

^Zoom

Zoom field

^Remfield

Allows the user to save the data in a UTF8-formatted file.

Example: Connecting the Output Box to the Putmess Channel

The following code redirects the putmess output to the output box. Whenever code calls the putmess statement, this text is also sent to the Output Box. No additional code required.

 $fieldproperties("OUTPUTBOX_FIELD")="msgchannel=2"

Example: Procedurally Adding Messages to the Output Box

The following example adds a message to the Output Box using the addLine widget operation:

 
entry report
variables
  handle vHandle
endvariables
  vHandle = $fieldhandle("OUTPUTBOX_FIELD")
  forentity "MYENT"
    if (FLD1.MYENT > FLD2.MYENT)
      vHandle->$widgetoperation("addLine", "Error: FLD1 is bigger than FLD2")
    endif
  endfor
end

 

Uniface logo and link to website

Send feedback about this topic to Uniface.