Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 19 of 40

2D JANUS PSK for C/C++ Reference Manual, pages 181 to 190

Pages 181 to 190 of 400

The original document is the PDF (793 KB). 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 J2020, Intermec J2010 and Intermec J2050

Page 181

im_viewport_getxy

2 im_viewport_getxy Purpose:

This function retrieves the column and row of the upper left corner of the viewport.

Syntax:

#include "im20lib.h" IM_STATUS im_viewport_getxy (IM_USHORT *row, IM_USHORT *col);

IN Parameters:

None.

OUT Parameters:

The row parameter returns the row value (Y-coordinate) of the viewport. The col parameter returns the column value (X-coordinate) of the viewport.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

This function is valid only when the display is in 80 x 25 mode. This function has no effect on the JANUS 2050.

See Also:

im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_up, im_viewport_page_down, im_viewport_setxy, im_viewport_to_cursor

Example See example for im_viewport_setxy.

2-155

Page 182

im_viewport_home im_viewport_home Purpose:

This function sets the viewport to the upper left corner (home) of the virtual display.

Syntax:

#include <im20lib.h> void im_viewport_home(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

This function has no effect on the JANUS 2050.

See Also:

im_cursor_to_viewport, im_viewport_end, im_viewport_move, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor

Example See example for im_viewport_setxy.

2-156

Page 183

im_viewport_move

2 im_viewport_move Purpose:

This function moves the viewport the specified distance and direction.

Syntax:

#include <im20lib.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 IM_VIEWPORT_RIGHT IM_VIEWPORT_UP IM_VIEWPORT_DOWN

Move left Move right Move up Move down

The distance parameter indicates the number of units to move the viewport and is either a numeric value between 1 and 70 or is IM_DEFAULT_DISTANCE. If the distance parameter is IM_DEFAULT_DISTANCE, the default step size is used. The distance moved is a configurable parameter. For more information on configuring the viewport, see your JANUS user’s manual. 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 the standard status codes defined in Appendix A, “Status Codes.”

2-157

Page 184

im_viewport_move

Notes:

The (row, column) pair represents the upper left corner of the viewport being displayed. The minimum value for both the row and column is (0,0), which is the upper left corner of the virtual window. The maximum value is determined by the video mode and the number of lines and columns displayed. For example, for the normal video mode 3 (80 x 25 display) with a 20 x 16 display size, the maximum value of row is 9 (25 minus 16) and the maximum value of column is 60 (80 minus 20). The row and column viewport settings are set to the maximum allowed for the current mode and display size. To determine the actual values set, check the returned values of row and col. This function has no effect on the JANUS 2050.

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.

2-158

Page 185

im_viewport_page_down

2 im_viewport_page_down Purpose:

This function moves the viewport down one viewport length.

Syntax:

#include <im20lib.h> void im_viewport_page_down(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

This function has no effect on the JANUS 2050.

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.

2-159

Page 186

im_viewport_page_up im_viewport_page_up Purpose:

This function moves the viewport up one viewport length.

Syntax:

#include <im20lib.h> void im_viewport_page_up(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

This function has no effect on the JANUS 2050.

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.

2-160

Page 187

im_viewport_setxy

2 im_viewport_setxy Purpose:

This function sets the viewport row and column to a specific value when moving between two screens.

Syntax:

#include <im20lib.h> IM_STATUS im_viewport_setxy (IM_USHORT *row, IM_USHORT *col);

IN/OUT Parameters:

The row parameter sets the row value (Y-coordinate) of the viewport. The col parameter sets the column value (X-coordinate) of the viewport.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

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. For the normal video mode 3 (80 x 25 display) with 20 x 16 display character size, the maximum value of row is 9 (25 minus 16) and the maximum value of col is 60 (80 minus 20). The row and column viewport settings are set to the maximum allowed for the current mode and display size. To determine the actual values set, check the returned values of row and col. This function has no effect on the JANUS 2050.

See Also:

im_viewport_move

2-161

Page 188

im_viewport_setxy

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 */ /* im_get_display_mode */ /* im_viewport_to_cursor */ /* im_cursor_to_viewport */ #include <stdio.h> #include <dos.h> #include <conio.h> #include <stdlib.h> #include "im20lib.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 ); cputs("1-viewport_home"); /* viewport_home mark*/ gotoxy( 1, 1+1); cputs(" row:0, col:0"); gotoxy( 61, 24 ); cputs("2-viewport_end"); /* viewport_end mark*/ gotoxy( 61, 24+1); cputs(" row:23, col:60"); gotoxy( 61, 1 ); cputs("3-viewport_page_up"); /* viewport_page_up */ gotoxy( 61, 1+1); cputs(" row:0, col:60"); gotoxy( 21, 1 ); cputs("4-viewport_setxy"); /* viewport_setxy */ gotoxy( 21, 1+1); cputs(" row:0, col:20"); gotoxy( 41, 1 ); cputs("5-viewport_move"); /* viewport_move */ gotoxy( 41, 1+1); cputs(" row:0, col:40"); gotoxy( 41, 19 ); cputs("6-viewport_page_down"); /* vewport_page_down */ gotoxy( 41, 19+1); cputs(" row:18, col:40"); gotoxy( 21, 19 ); cputs("7-viewport_to_cursor"); /* viewport_to_cursor*/ gotoxy( 21, 19+1); cputs(" row:18, col:20"); /* 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();

2-162

Page 189

im_viewport_setxy

2

/* 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 ); cputs ("8-viewport_getxy"); /* Start at home again */ gotoxy(1, 1+1); cputs (" Row:%d, Col:%d", row, col); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 9: Mark ref. c->v */ clrscr(); gotoxy(51, 10 ); cputs("Ref. C->V"); /* viewport_to_cursor*/ gotoxy( 1, 1); cputs("9-C->V"); gotoxy( 1, 1+1); cputs("Cursor at Ref."); 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 */ 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) )

2-163

Page 190

im_viewport_setxy printf("\nDisplay mode setup ok\n"); else printf("\nError in display_mode\nsetup\n"); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); }

2-164