The text of a manual · part 18 of 28
6400 PSK Reference Manual, pages 171 to 180
Pages 171 to 180 of 272
The original document is the PDF (1.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 6400
Page 171
im_viewport_move
5 im_viewport_move Purpose:
This function moves the viewport the specified distance and direction.
Syntax:
#include "im64psk.h" IM_STATUS im_viewport_move (IM_VIEWPORT_DIRECTION direction, IM_USHORT distance, IM_USHORT *row, IM_USHORT *col);
IN Parameters:
The direction parameter is one of these constants: IM_VIEWPORT_LEFT
Move left.
IM_VIEWPORT_RIGHT
Move right.
IM_VIEWPORT_UP Move up. IM_VIEWPORT_DOWN Move down. The distance parameter indicates the number of units to move the viewport. If the distance parameter is IM_DEFAULT_DISTANCE, the default step size of 10 is used. OUT Parameters:
The row parameter returns the row number to which the viewport has moved. The col parameter returns the column number to which the viewport has moved.
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_VP_DISABLED
Viewporting currently disabled.
IM_INVALID_DIRECTION IM_TO_LARGE Notes:
Invalid direction was passed in.
Distance was too large for that direction, moved as far as possible.
The (row, column) pair represents the upper left corner of the viewport being displayed. This function is valid only when viewporting is enabled. The viewport moves left/right in increments of two. If an odd column distance is specified, the new viewport location is off by one. This function has no effect when using LARGE and SPECIAL fonts.
See Also:
im_viewport_end, im_viewport_home, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor, im_cursor_to_viewport
Example See example for im_viewport_setxy.
5-115
Page 172
im_viewport_page_down im_viewport_page_down Purpose:
This function moves the viewport down one viewport length.
Syntax:
#include "im64psk.h" void im_viewport_page_down(void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_AT_EDGE
Moved to edge of virtual display.
IM_VP_DISABLED Notes:
Viewporting currently disabled.
This function is valid only when viewporting is enabled. This function has no effect when using LARGE or SPECIAL fonts.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_up, im_viewport_to_cursor
Example See example for im_viewport_setxy.
5-116
Page 173
im_viewport_page_left
5 im_viewport_page_left Purpose:
This function moves the viewport left one page size on the virtual screen. The viewport cannot move beyond the left edge of the virtual screen.
Syntax:
#include “im64psk.h” IM_STATUS im_viewport_page_left (void);
IN Parameters:
None
OUT Parameters:
None
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_AT_EDGE
Moved to edge of virtual display.
IM_VP_DISABLED Notes:
Viewporting currently disabled.
This function is valid only when viewporting is enabled. This function has no effect when using LARGE and SPECIAL fonts.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_up, im_viewport_to_cursor
Example See example for im_viewport_setxy.
5-117
Page 174
im_viewport_page_right im_viewport_page_right Purpose:
This function moves the viewport right one page size on the virtual screen. The viewport cannot move beyond the right edge of the virtual screen.
Syntax:
#include “im64psk.h” IM_STATUS im_viewport_page_right (void);
IN Parameters:
None
OUT Parameters:
None
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_AT_EDGE
Moved to edge of virtual display.
IM_VP_DISABLED Notes:
Viewporting currently disabled.
This function is valid only when viewporting is enabled. This function has no effect when using LARGE or SPECIAL fonts.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_up, im_viewport_to_cursor
Example See example for im_viewport_setxy.
5-118
Page 175
im_viewport_page_up
5 im_viewport_page_up Purpose:
This function moves the viewport up one page size on the virtual screen. The viewport cannot move beyond the top edge of the virtual screen.
Syntax:
#include "im64psk.h" void im_viewport_page_up(void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_AT_EDGE
Moved to edge of virtual display.
IM_VP_DISABLED Notes:
Viewporting currently disabled.
This function is valid only when viewporting is enabled. This function has no effect when using LARGE or SPECIAL fonts.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_down, im_viewport_to_cursor
Example See example for im_viewport_setxy.
5-119
Page 176
im_viewport_setxy im_viewport_setxy Purpose:
This function sets the viewport row and column to a specific value when moving between two screens.
Syntax:
#include "im64psk.h" IM_STATUS im_viewport_setxy (IM_USHORT row, IM_USHORT col);
IN/OUT Parameters:
row Sets the row value (Y-coordinate) of the viewport. The top of the virtual screen equals 0. col Sets the column value (X-coordinate) of the viewport. The top of the virtual screen equals 0. As input parameters, row and col set the desired location for the viewport. As output parameters, row and col return the actual location.
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_VP_DISABLED
Viewporting currently disabled.
IM_INVALID_ROW
Row number out of range, moved as far as possible.
IM_INVALID_COLUMN Column number out of range, moved as far as possible. IM_INVALID_BOTH Row and column out of range, moved to lower right corner. Notes:
The (row, col) pair represents the upper left corner of the viewport being displayed. The minimum values for both the row and col are (0,0), which is the upper left corner of the virtual window. The function is valid only when viewporting is enabled. This function has no effect when using LARGE or SPECIAL fonts.
See Also:
im_viewport_move
Example /******************** im_viewport_setxy ************************************/ /* Also with: im_viewport_getxy */ /* im_viewport_home */ /* im_viewport_end */ /* im_viewport_page_down */ /* im_viewport_page_up */ /* im_viewport_move */ /* im_set_display_mode */
5-120
Page 177
im_viewport_setxy
5 im_viewport_setxy (continued) /* /* /* im_get_display_mode im_viewport_to_cursor im_cursor_to_viewport
*/ */ */
#include <stdio.h> #include <dos.h> #include <conio.h> #include "im64psk.h" #define
SOUND_TIME void main (void) { IM_USHORT IM_STD_SIZE_MODE IM_STD_VIDEO_MODE IM_SCROLL_MODE IM_CHARACTER_HEIGHT
200
/* 200 milliseconds */ row, col; std_size, cmode_size; std_video, cmode_video; std_scroll, cmode_scroll; std_charhigh, cmode_charhigh;
/* Set display mode to 80 x 25 and remaining parameters standard. */ std_size = IM_SIZE_MODE_80X25; std_video = IM_STD_VIDEO_MODE_3; std_scroll = IM_LCD_SCROLL_AT_25; std_charhigh = IM_STANDARD_CHAR_HEIGHT; im_set_display_mode(std_size, std_video, std_scroll, std_charhigh); /* Set up mark for viewport operation fuctions */ /* DOS Screen uses (1,1) as home but im functions start at (0,0) */ gotoxy( 1, 1 ); im_cputs("1-viewport_home", IM_NORMAL); /* viewport_home mark*/ gotoxy( 1, 1+1); im_cputs(" row:0, col:0" IM_NORMAL); gotoxy( 61, 24 ); im_cputs("2-viewport_end" IM_NORMAL); /* viewport_end mark*/ gotoxy( 61, 24+1); im_cputs(" row:23, col:60" IM_NORMAL); gotoxy( 61, 1 ); im_cputs("3-viewport_page_up" IM_NORMAL); /* viewport_page_up */ gotoxy( 61, 1+1); im_cputs(" row:0, col:60" IM_NORMAL); gotoxy( 21, 1 ); im_cputs("4-viewport_setxy" IM_NORMAL); /* viewport_setxy */ gotoxy( 21, 1+1); im_cputs(" row:0, col:20" IM_NORMAL); gotoxy( 41, 1 ); im_cputs("5-viewport_move" IM_NORMAL); /* viewport_move */ gotoxy( 41, 1+1); im_cputs(" row:0, col:40" IM_NORMAL); gotoxy( 41, 19 ); im_cputs("6-viewport_page_down" IM_NORMAL); /* vewport_page_down */ gotoxy( 41, 19+1); im_cputs(" row:18, col:40" IM_NORMAL); gotoxy( 21, 19 ); im_cputs("7-viewport_to_cursor" IM_NORMAL); /* viewport_to_cursor*/ gotoxy( 21, 19+1); im_cputs(" row:18, col:20" IM_NORMAL); /* Bring cursor back so that viewport will stay with it */ gotoxy( 1, 1); /* Action 1: Set viewport back to Home */ im_viewport_home(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch();
5-121
Page 178
im_viewport_setxy im_viewport_setxy (continued) /* Action 2: Viewport End */ im_viewport_end(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 3: Viewport Page Up */ im_viewport_page_up(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 4: Viewport Setxy */ row = 0; col = 20; im_viewport_setxy(&row, &col); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 5: Viewport Move */ im_viewport_move(IM_VIEWPORT_RIGHT, 20, &row, &col); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 6: Viewport Page Down */ im_viewport_page_down(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 7: set cursor at row:18, column:10 and viewport_to_cursor */ /* Note: Cursor at the centor of viewport */ gotoxy(20+10, 18); /* Need offset 10 to let cursor at center*/ im_viewport_to_cursor(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 8: Viewport Getxy */ im_viewport_end(); /* Force viewport to end */ /* In 80X25 mode, viewport_end causes the viewport move at (9,60) */ /* You should see value is row:9, col:60 */ im_viewport_getxy(&row, &col); im_viewport_home(); /* Force viewport to home */ gotoxy(1, 1 ); im_cputs ("8-viewport_getxy", IM_NORMAL); /* Start at home again */ gotoxy(1, 1+1); im_cputs (" Row:%d, Col:%d", row, col, IM_NORMAL); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 9: Mark ref. c->v */ clrscr(); gotoxy(51, 10 ); im_cputs("Ref. C->V", IM_NORMAL); /* viewport_to_cursor*/ gotoxy( 1, 1); im_cputs("9-C->V", IM_NORMAL); gotoxy( 1, 1+1); im_cputs("Cursor at Ref.", IM_NORMAL); getch(); /* Action 9: Move viewport to end, then Do cursor_to_viewport */ row = 2; col = 40; im_viewport_setxy(&row, &col); im_viewport_end(); /* Force viewport to end */ im_cursor_to_viewport(); /* Cursor go to center */
5-122
Page 179
im_viewport_setxy
5 im_viewport_setxy (continued) im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 10: Get Display Mode */ im_get_display_mode(&cmode_size, &cmode_video, &cmode_scroll, &cmode_charhigh); if ( (std_size == cmode_size) && (std_video == cmode_video) && (std_scroll == cmode_scroll) && (std_charhigh == cmode_charhigh) ) im_cputs("\nDisplay mode setup ok\n", IM_NORMAL); else im_cputs("\nError in display_mode\nsetup\n", IM_NORMAL); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); }
5-123
Page 180
im_viewport_to_cursor im_viewport_to_cursor Purpose:
This function moves the viewport so that the cursor appears at the home position.
Syntax:
#include "im64psk.h" IM_STATUS im_viewport_to_cursor (void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of these codes: IM_SUCCESS Success. IM_VP_DISABLED Viewporting is currently disabled.
Notes:
This function is valid only when viewporting is enabled. When the cursor is not displayed, use this function to move the viewport to the cursor.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_down
Example See example for im_viewport_setxy.
5-124