)
)
[Main] Name=DialogAddScrollRegion Type=Function Subtype=Macro Header Files=dialogs.h Definition=HANDLE DialogAddScrollRegion (HANDLE Handle, short flags, short x, short y, unsigned short x1, unsigned short y1, unsigned short FirstItem, unsigned short LastItem, unsigned short NumDspItems, unsigned short TotNumItems, unsigned short ItemHeight); [Description] Adds an rectangular item-scrolling region to a dialog box. [Explanation] DialogAddScrollRegion adds a rectangular item-scrolling region to the dialog structure associated with handle <EM>Handle</EM> from the (<EM>x</EM>, <EM>y</EM>) position to the (<EM>x1</EM>, <EM>y1</EM>) position, where coordinates are relative to the top-left corner of the dialog box.<BR> A scroll region defines a group of items that will scroll as the user moves through the items. The identification number of the first scrollable should be set in <EM>FirstItem</EM> and the last scrollable item in <EM>LastItem</EM>. <EM>NumDspItems</EM> defines the number of items that are displayed at one time. The total number of scrollable item should be set in <EM>TotNumItems</EM> and the height of each item in <EM>ItemHeight</EM>.Every scrollable item must be defined contiguously and have the DF_SCROLLABLE flag set and mustn't be a MENU, a HEADER or an XFLAGS type. The coordinates of the scrollable items are relative to the dialog box except that they may extend beyond the bottom coordinate of the dialog box. They are defined assuming a virtual scroll region. <BR><BR> It's very easy to make display bugs with this function (Of course that won't crash your calculator but the dialog can become easily ugly) ; so here is a method you can use to avoid those bugs ; First, the standard item height is the height of the biggest item ( oftently the EDIT item which is 10 pixel high), so the minimum value in <EM>ItemHeight</EM> should be 10 in most case. Then, to avoid any display bug, the <EM>y</EM> axis should be the y value of your first displayed item - 2 and <EM>y1</EM> axis should be the y value of your last displayed item + 8. (i.e. If you wish to scroll 8 items and just display items 3 by 3 and the first scrollable item is item number 4 (the last displayed item at the begining is therefore item 6) so the calculation should be : <EM>y</EM>=(item 4 y axis)-2 and <EM>y1</EM>=(item 6 y axis)+8).The <EM>x1</EM>-<EM>x</EM> should also be greater than the width of the largest item (else it will result in display bugs). I don't really understand the utility of such a <EM>TotNumItems</EM> parameter as it should always be equal to <EM>LastItem</EM> - <EM>FirstItem</EM> + 1. The flag DF_CLR_ON_REDRAW is very usefull and should be set in most cases (see below). <BR><BR> <STRONG>Note :</STRONG> If you use a SCROLL_REGION, it must be the first item defined in the dialog box. A dialog box can therefore have at most one scroll region. <BR><BR> <STRONG>Beware :</STRONG> Items creation order is very important as it automatically gives each item an identification number (the first created item will have zero for identification number, the second one : '1', ...). Every function that creates an item (i.e. all the functions beginning with 'MenuAdd...') will increase this identification number.<BR> DialogAddScrollRegion is in fact a macro created for your convenience with <A HREF="$$LINK(DialogAdd)">DialogAdd</A> and D_SCROLL_REGION as the <EM>ItemType</EM>. <BR><BR> Parameter <EM>flags</EM> can be a combination of the following, defined in <A HREF="$$LINK(DialogFlags)">DialogFlags</A> enumeration :<BR> <TABLE BORDER CELLPADDING="3"> <TR> <TD>DF_SKIP</TD> <TD>This item is skipped since the system maintains this flag. (i.e. you won't be able to focus on/select this item until the flag is unset).</TD> </TR> <TR> <TD>DF_SCREEN_SAVE</TD> <TD>The dialog code saves the area underneath the dialog box when it is started, DB_MEMFULL returned if it cannot.</TD> </TR> <TR> <TD>DF_CLR_ON_REDRAW</TD> <TD>Clear the entire visible scroll region when redrawn. If you do not set this flag, the scroll region will not be cleared before beeing redrawn and you might still see previous inscriptions underneath the new ones.</TD> </TR> </TABLE> <BR><BR> DialogAddScrollRegion returns <A HREF="$$LINK(alloc.h/H_NULL)">H_NULL</A> in a case of error, may return DB_MEMFULL if you used DF_SCREEN_SAVE, else returns <EM>Handle</EM>. This routine (as well as all other 'DialogAdd...' routines) may cause heap compression.
<TR> <TD>DF_SCROLLABLE</TD> <TD>Any Type</TD> <TD>Set this flag if you want this item to be scrollable in a SCROLL_REGION.</TD> </TR> <TR>
C'est totalement préliminaire. Utilisez ces informations à votre propre risque.ordivore a écrit :
solid a dit "in the doc of tigcc !!!!!!!! " --->admet tout de meme que la doc de tigcc n'est pas si facile à comprendre!
On s'efforce de faire une documentation claire, et c'est pour entendre ça? La documentation est très claire, à condition de comprendre l'anglais, évidemment.
Elynx a écrit :
je precise mes questions sur les dialog-box:
"DialogNew acts like DialogNewSimple, but accepts a pointer to the user function UserFunc as third parameter"(doc de tigcc)
[...] On peut faire des trucs vachement compliqués avec cette fonction ?!
par exemple:quand on a bcp d'options dans un dialog on fait scroller vers le bas comme le menu MODE de la ti ?
