Int_ListAddButton, Int_ListAddString, Int_ListClose, Int_ListCreateWindow, Int_ListDefineFixed, Int_ListDeleteString, Int_ListGetData, Int_ListInsertString, Int_ListOutput, Int_ListReset, Int_ListSetHeader, Int_ListShow
Description
int Int_ListAddButton( char *capt
, char *com
);
This function adds buttons to the list box window.
Parameters
Description
int Int_ListAddString(
char *str1
);
This function adds strings to the list box. Strings are added to the end of the list.
Note
The tabs inside the added string define the columns. There can be four columns at most. The string can be defined by the sprintf function or simply like a constant, to mark the tabs use /t symbol. The maximal amount of items is limited by 1000.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData
Description
int Int_ListClose();
This function closes the current listbox window.
Note
The listbox window is created by calling the function Int_ListCreateWindow and then displayed by the Int_ListShow function. The window can be also closed manually from the menu.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData
Description
int Int_ListCreateWindow( char *Caption
, intInt_Position
, intInt_X
, inty
, intWidth
, intHeight
);
This function creates a window which can be used to display text data in the tabbed listbox.
Parameters
//Int_ListCreateWindow example - this example shows how to create //and use simple listbox window. int tab[1],current_x,current_y; dword key,keys[2]; char mess[256],coordinates[256]; tab[0] = 0; key = 0; keys[0] = VK_LBUTTON; keys[1] = VK_RBUTTON; strcpy(mess,"API Example - Int_ListCreateWindow"); Int_CreateTextWindow(mess,0,RGB(0,0,128),RGB_WHITE,100); Wait(2); strcpy(mess," Primary mouse button to add mouse coordinates\tSecondary mouse button to quit. "); Int_CreateTextWindow(mess,0,RGB(0,0,128),RGB_WHITE,100); Int_ListCreateWindow("Listbox example",2,0,0,297,480); Int_ListAddButton("Wait","Wait(1);"); strcpy(mess, "Data 1\tData 2\tData 3\tData 4"); Int_ListSetHeader(mess); Int_ListDefineFixed(tab,1); Int_ListShow(); Int_ListInsertString(0,"This\tline\tis\tfixed.",1); SetCommandText("Listbox is working..."); while(key != keys[1]) { key = Int_GetEvents(keys,2); if(key == keys[0]) { Int_GetMousePos(¤t_x,¤t_y); sprintf(coordinates,"Position: \t%i\t%i\t ","current_x,current_y"); Int_ListAddString(coordinates); } if(key == keys[1]) { Int_ListClose(); Int_CloseTextWindow(); } }
See Also
Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData
Description
Int_ListDefineFixed( int *lpdata
, intnum
);
This function defines fixed lines within the listbox window.
Parameters
Note
This function changes the global Int_ListFixed array. Using this function, old fixed lines are forgotten.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData
Description
int Int_ListDeleteString(
int Index
);
This function deletes the index string from the list box. The index of the deleted string is appended at the end of the global Int_ListDeleted array. Strings which are defined to be fixed (by the Int_ListDefineFixed function) can not be deleted by this function.
Note
The indexes out of the valid range(0 to number of listbox items - 1) are ignored. You can see which indexes are defined to be fixed in the global Int_ListFixed array.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData
Description
INT Int_ListGetData( intIndex
, char *buf1
, intSize
);
This function gets the data from the listbox in the listbox window.
Index parameter is the index of the string in the listbox (inside the valid range) you get the data from. Special constants can be used (-1 = Whole content, -2 = Currently selected item).
Parameters
//Int_ListGetData example - this example shows how to use the list box for items selecting. char buf[256],mess[256]; dword key,keys[2]; key = 0; keys[0] = VK_RETURN; keys[1] = VK_END; SetCommandText("Working..."); strcpy(mess," application API Example - Int_ListGetData\tTo choose:double-click on some item or select and press enter."); Int_CreateTextWindow(mess,0,RGB(0,0,128),RGB_WHITE,100); Int_ListGetData("Selection listbox",6,0,0,240,160); Int_ListGetData("Exit","Int_CloseTextWindow();Int_ListClose();Int_PostMessage(VK_END,0);"); Int_ListSetHeader("Index\tClick to choose."); Int_ListShow(); Int_ListAddString("1:\tFirst item"); Int_ListAddString("2:\tSecond item"); Int_ListAddString("3:\tThird item"); again: //Waiting for selection key = 0; while(key == 0) key = Int_GetEvents(keys,2); if(key == keys[0]) { //Acquiring the selection Int_ListGetData(-2,buf,256); if(buf[0] == '1') Int_Query("Selection","You selected the first item.","Continue"); if(buf[0] == '2') Int_Query("Selection","You selected the second item.","Continue"); if(buf[0] == '3') Int_Query("Selection","You selected the third item.","Continue"); goto again; }
Note
Left button double clicking on some item inside the list box causes sending the VK_RETURN (13) to macro, see the example for details.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput
Description
int Int_ListInsertString( intIndex
, char *buf1
, intoverwrite
);
This function inserts a string into the listbox.
Index parameter is the index of the line in the listbox, you insert the string.
Parameters
Note
This function can replace fixed lines in the listbox (defined by the Int_ListDefineFixed function). If you specify greater index then the current number of items minus one, string will be added at the end of the listbox.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData, Int_ListDefineFixed
Description
int Int_ListOutput( intmode
, char *Int_Filename
);
This function exports the listbox data from the listbox window to a file or to clipboard (if the optional Int_Filename
parameter is not defined).
Parameters
//Int_ListOutput example - output data acquired from histogram. int pModeData[256]; dword pMean[4], pMin[4], pMax[4], pMaxFreq[4]; dword pRed[256], pGreen[256], pBlue[256], pIntensity[256]; char mess[256],str[256]; int i,sel; strcpy(mess,"API Example - Int_ListOutput"); Int_CreateTextWindow(mess,0,RGB(0,0,128),RGB_WHITE,100); Int_ListCreateWindow("Histogram Data",6,0,0,240,450); Int_ListAddButton("Exit","Int_CloseTextWindow();Int_ListClose();"); Int_ListSetHeader("Index\tRed\tGreen\tBlue"); Int_ListShow(); Get_Histogram(0,pModeData,pMean,pMin,pMax,pMaxFreq,pRed,pGreen,pBlue,pIntensity); SetCommandText("Working..."); for(i=0;i<256;i=i+1) { sprintf(str,"%i\t%i\t%i\t%i","i,pRed[i],pGreen[i],pBlue[i]"); Int_ListAddString(str); } sel = Int_Question("Select action","Output to:","File...","Clipboard","","",2,0); if(sel == 1) { SelectFile(file,"Text files|*.txt",0); Int_ListOutput(1,file); EditFile(file); DeleteFileQuery(file); } if(sel == 2) Int_ListOutput(0,""); Int_CloseTextWindow();
Note
This function uses the default data delimiters. You can specify them by calling Delimiter function.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListGetData
Description
int Int_ListReset();
This function resets the content of the listbox inside the listbox window. The index of the deleted string is appended at the end of the global Int_ListDeleted array.
Note
Fixed indexes (defined in global Int_ListFixed array) are not deleted.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListSetHeader, Int_ListOutput, Int_ListGetData
Description
Int_ListSetHeader(
char *Int_str1
);
This function sets the new header to the list box window. The header defines the number of columns in the list box. The tabs inside the string define the columns. There can be up to four columns.
//Int_ListSetHeader example - changing the header by mouse. char mess[256]; char h1[256],h2[256],h3[256]; dword key,keys[20]; int cmp; key = 0; keys[0] = VK_RETURN; keys[1] = VK_RBUTTON; strcpy(h1,"Data 1\tData 2\tData 3\tData 4"); strcpy(h2,"This\tis\tsecond\theader."); strcpy(h3,"Value:\t2.897\tIndex:\t99"); strcpy(mess," NIS-Elements API Example - Int_ListSetHeader\tLeft mouse dblclk on item to change the header, right to stop. "); Int_CreateTextWindow(mess,0,RGB(0,0,128),RGB_WHITE,100); Int_ListCreateWindow(NULL,7,0,0,240,120); Int_ListAddButton("Info","___Info();"); Int_ListAddButton("Exit","Int_CloseTextWindow();Int_ListClose();Int_PostMessage(VK_RBUTTON,0);"); Int_ListSetHeader(h1); Int_ListShow(); Int_ListAddString(h1); Int_ListAddString(h2); Int_ListAddString(h3); while(key != keys[1]) { key = Int_GetEvents(keys,2); if(key == keys[0]) { Int_ListGetData(-2,mess,256); if(mess[0] == 'D') Int_ListSetHeader(h1); if(mess[0] == 'T') Int_ListSetHeader(h2); if(mess[0] == 'V') Int_ListSetHeader(h3); } } Int_CloseTextWindow(); Int_ListClose();
Note
The string can be defined by sprintf function or simply like a constant, to mark the tabs use /t symbol.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListShow, Int_ListOutput, Int_ListGetData
Description
int Int_ListShow();
This function shows an already created listbox window.
//Int_ListShow example - a typical listbox. int pModeData[256]; dword pMean[4], pMin[4], pMax[4], pMaxFreq[4]; dword pRed[256], pGreen[256], pBlue[256], pIntensity[256]; char mess[256],str[256]; int i; strcpy(mess,"API Example - Int_ListShow"); SetCommandText("Working..."); Int_CreateTextWindow(mess,0,RGB(0,0,128),RGB_WHITE,100); Int_ListCreateWindow("Histogram Data",6,0,0,240,350); Int_ListAddButton("Exit","Int_CloseTextWindow();Int_ListClose();"); Int_ListSetHeader("Index\tRed\tGreen\tBlue"); Int_ListShow(); Get_Histogram(0,pModeData,pMean,pMin,pMax,pMaxFreq,pRed,pGreen,pBlue,pIntensity); for(i=0;i<256;i=i+1) { sprintf(str,"%i\t%i\t%i\t%i","i,pRed[i],pGreen[i],pBlue[i]"); Int_ListAddString(str); }
Note
The listbox window is created by calling the function Int_ListCreateWindow. You can not add more buttons after calling this function. The window can be closed manually.
See Also
Int_ListCreateWindow, Int_ListAddButton, Int_ListSetHeader, Int_ListOutput, Int_ListGetData, Get_Histogram, Int_ListCreateWindow