Window

Int_CloseTextWindow, Int_CreateTextWindow, Int_CreateWindow, Int_OutputWindow, Int_SetWindowState, Int_SetWindowText

Int_CloseTextWindow

Description 

int Int_CloseTextWindow();

This function closes the text window which was previously created by the Int_CreateTextWindow function.

Return Values

int

This function returns TRUE (1) if the window was closed, otherwise FALSE (0).

Note

The text window can be closed also manually. You must push the left button on this window and then use Alt+F4.

See Also 
Int_CreateTextWindow

Int_CreateTextWindow

Description 

 Int_CreateTextWindow(
   char *text,
   int  Int_Position,
   colorref  background,
   colorref  foreground,
   int  Size
);

This function creates a window without caption and menu, which can be used to display a text message.

Parameters

char *text

Text in the window. You must choose the string length according to the window size. For details see the comments.

int Int_Position

Position-code of the window

0

Top centered.

1, WP_TOPLEFT

Top left

2, WP_TOPRIGHT

Top right

3, WP_BOTTOMLEFT

Bottom left

4, WP_BOTTOMRIGHT

Bottom right

5, WP_TOTALUP

Total up

6, WP_UP

1/4 from top

7, WP_CENTERED

Centered

8

Top centered with menu visible

9

Top centered with menu and icons visible

colorref background

Background color of the window. You can use the RGB function or predefined constants.

colorref foreground

Foreground color of the window. You can use the RGB function or predefined constants.

int Size

Width of the window in percents of the screen width.

Return Values

This function returns TRUE if the window was created, else FALSE.

//Int_CreateTextWindow example - shows the text message.
int    i,j;
SetCommandText("Working...");
Beep();
j=0;
for(i=0;i<256;i=i+10)
   {
   Int_CreateTextWindow("API Example - Int_CreateTextWindow",0,RGB(i,i,0),RGB(256-i,256-i,0),j);
   j = j + 4;
   }
Wait(2);
Int_CloseTextWindow();

Note

The text window is designed to display one-line text messages. You can replace the text in currently created window simply by calling this function again with different text. The first /t character is used to divide the text, the first part is aligned to the left side, the right part to the right side. Text without \t character is centered in the window. There can be only one text window created.

Int_CreateWindow

Description 

 Int_CreateWindow(
   int  Int_Id,
   char *Caption,
   int  Int_Position,
   int  x,
   int  y,
   int  Width,
   int  Height,
   char *Buffer,
   int  hasMenu,
   int  columns,
   double  Int_Livetime,
   int  editable,
   int  scrollbars,
   int  scalable,
   char *font
);

This function creates a window which can be used to display text. Because of the automatic column-formatting feature, this function is useful to display the results of measurements.

The text to be displayed in the window may contain the character sequence , which will be interpreted as CR and the character sequence, which will be interpreted as HTAB. String length should be less than 30000. When buffer is a NULL pointer or an empty string (a string with zero length), the properties and display-parameters of an existing window will be changed, but its text remains.

Parameters

int Int_Id

Identifier of window which should be created or of which the parameters should be changed. From 1 to 4 inclusive.

1, WND_1

First window.

2, WND_2

Second window.

3, WND_3

Third window.

4, WND_4

Fourth window.

char *Caption

Text displayed in the caption.

int Int_Position

Position-code of the window

0

Top centered.

1, WP_TOPLEFT

Top left

2, WP_TOPRIGHT

Top right

3, WP_BOTTOMLEFT

Bottom left

4, WP_BOTTOMRIGHT

Bottom right

5, WP_TOTALUP

Total up

6, WP_UP

1/4 from top

7, WP_CENTERED

Centered

8

Top centered with menu visible

9

Top centered with menu and icons visible

int x

X-coordinate of top-left corner of window when position = 0.

int y

Y-coordinate of top-left corner of window when position = 0.

int Width

Image width in pixels.

int Height

Image height in pixels.

char *Buffer

Address of the buffer.

int hasMenu

Window has a menu when non-zero: FILE - Save As, Print and EDIT - Cut, Copy, Paste, Select Font.

int columns

When non-zero, the text in the window will be formatted according to the tabstop-sequences () in buffer.

double Int_Livetime

Time, in seconds, after which the window should be destroyed. It is rounded to a quarter of a second. When livetime is equal to zero, the window will never be destroyed. When lifetime is negative, the user is prompted before destruction, with the option of letting the window remain permanently.

int editable

When non-zero, the text is editable.

int scrollbars

When non-zero, the text can be scrolled into view by means of scrollbars.

int scalable

When non-zero, the window will have a scalable border.

char *font

Font-information in the form [first N (case-insensitive) characters of fontname,] [pointsize][[B][I][C]] B and I stand for Bold and Italic,C for charset respectively. N can range from 1 to the length of the name of the desired font. C can be one of the following constants: A ANSI_CHARSET, G GREEK_CHARSET, T TURKISH_CHARSET, L BALTIC_CHARSET, E EASTEUROPE_CHARSET, R RUSSIAN_CHARSET. All parameters are optional and may appear in any order.

Return Values

If a window is created, the function returns TRUE.

See Also 
Int_SetWindowText, Int_SetWindowState, Int_OutputWindow, Int_CreateTextWindow, Int_CloseTextWindow

Int_OutputWindow

Description 

 Int_OutputWindow(
   int  Int_Id,
   int  Int_Dest,
   char *Filename
);

This function copies text from a window created by the Int_CreateWindow function to the clipboard, prints it, or writes it to a file in the Windows directory. This function returns zero when no window specified by Int_Id exists or when it proves impossible to write to the specified file.

Parameters

int Int_Id

Identifier of window which should be created or of which the parameters should be changed. From 1 to 4 inclusive.

1, WND_1

First window.

2, WND_2

Second window.

3, WND_3

Third window.

4, WND_4

Fourth window.

int Int_Dest

Specifies output device.

1, CLIPBOARD

Clipboard

2, PRINTER

Printer

3, FILE

File in UNICODE

3, FILE

File in ANSI

char *Filename

The filename in the windows directory. Used when dest is FILE (3). If filename == NULL (0) 'LIM_OWN.TXT' file is created.

Int_SetWindowState

Description 

int Int_SetWindowState(
   int  Int_Id,
   int  mode
);

This function changes the state of a window created by the Int_CreateWindow function.

Parameters

int Int_Id

Identifier of window which should be created or of which the parameters should be changed. From 1 to 4 inclusive.

1, WND_1

First window.

2, WND_2

Second window.

3, WND_3

Third window.

4, WND_4

Fourth window.

int mode

Required state.

0, WS_DESTROY

Destroy window.

1, WS_SHOW

Show window.

2, WS_HIDE

Hide window.

Return Values

int

Unused

See Also 
Int_CreateWindow, Int_SetWindowText, Int_OutputWindow, Int_CreateTextWindow, Int_CloseTextWindow, Int_CreateWindow

Int_SetWindowText

Description 

int Int_SetWindowText(
   int  Int_Id,
   char *text,
   int  append
);

This function replaces or appends text to a window created by the Int_CreateWindow function.

Parameters

int Int_Id

Identifier of window which should be created or of which the parameters should be changed. From 1 to 4 inclusive.

1, WND_1

First window.

2, WND_2

Second window.

3, WND_3

Third window.

4, WND_4

Fourth window.

char *text

Text to be sent to the window, which may contain the character sequence , which will be interpreted as CR/LF and the character sequence /t, which will be interpreted as HTAB. String length should be less than 32000.

int append

Replaces text when zero and appends text when non-zero.

Return Values

int

If referenced window does not exist, this function returns FALSE (0), else TRUE (1).

Note

For a macro example, see the Get_Info function description.

See Also 
Int_CreateWindow, Int_SetWindowState, Int_OutputWindow, Int_CreateTextWindow, Int_CloseTextWindow, Get_Info, Int_CreateWindow