LineDisplay.ScrollText Method

2/27/2008

Scrolls text in the active window, in the specified direction.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Syntax

'Declaration
Public MustOverride Sub ScrollText ( _
    direction As DisplayScrollText, _
    units As Integer _
)
public abstract void ScrollText (
    DisplayScrollText direction,
    int units
)
public:
virtual void ScrollText (
    DisplayScrollText direction, 
    int units
) abstract
public abstract void ScrollText (
    DisplayScrollText direction, 
    int units
)
public abstract function ScrollText (
    direction : DisplayScrollText, 
    units : int
)

Parameters

  • direction
    Indicates the scrolling direction, as defined by the DisplayScrollText enumeration.
  • units
    Indicates the number of columns or rows to scroll.

Remarks

ScrollText is legal only when the window is in Immediate mode.

If the window size for the scroll direction matches its viewport size, then the window data is scrolled, the last units rows or columns are set to spaces, and the viewport is updated.

If the window size for the scroll direction is larger than its viewport, then the window data is not changed. Instead, the mapping of the window into the viewport is moved in the specified direction. The window data is not altered. However, the viewport is updated. If scrolling by units would go beyond the beginning of the window data, then the window is scrolled so that the first viewport row or column contains the first window row or column. If scrolling by units would go beyond the end of the window data, then the window is scrolled so that the last viewport row or column contains the last window row or column.

ScrollText may cause a PosControlException to be thrown with the following ErrorCode.

Value

Meaning

Illegal

One of the following conditions has occurred:

  • The specified direction was not found in the DisplayScrollText enumerator.

  • The window is not in Immediate mode (that is, the MarqueeType property must be set to None and the InterCharacterWait property must be set to 0 (zero).

Example

Example 1

Assume a 2x20 display.

A Visual Basic application has a line display object named LD.

The application has performed:

LD.CreateWindow(0, 3, 2, 4, 2, 4)  ’ 2x4 viewport of 2x4 window
LD.DisplayText("abcdABCD", Normal)

The window contains:

0

1

2

3

0

a

b

c

d

1

A

B

C

D

and the viewport on the display is as follows:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

0

a

b

c

d

1

A

B

C

D

If the method

LD.ScrollText (Left, 2)

is called, the window data becomes:

0

1

2

3

0

c

d

1

C

D

and the viewport becomes:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

0

c

d

1

C

D

Example 2

Assume a 2x20 display.

A Visual Basic application has a line display object named LD.

The application has performed:

LD.CreateWindow(0, 3, 2, 4, 2, 8)  ’ 2x4 viewport of 2x8 window
LD.DisplayText("abcdefghABCDEFGH", Normal)

The window contains:

0

1

2

3

4

5

6

7

0

a

b

c

d

e

f

g

h

1

A

B

C

D

E

F

G

H

and the viewport on the display is as follows:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

0

a

b

c

d

1

A

B

C

D

If the method

LD.ScrollText (Left, 2)

is called, the window data is unchanged, and the viewport becomes:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

0

c

d

e

f

1

C

D

E

F

If the method

LD.ScrollText (Up, 1)

is called next, the window data becomes:

0

1

2

3

4

5

6

7

0

A

B

C

D

E

F

G

H

1

and the viewport becomes:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

0

C

D

E

F

1

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

LineDisplay Class
LineDisplay Members
Microsoft.PointOfService Namespace
LineDisplay.DisplayText Method
LineDisplay.DisplayText Method