anachronox-sdk/docs/2dcontrols.html
2002-01-21 00:00:00 +00:00

219 lines
11 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
</HEAD>
<BODY TEXT="#808080" LINK="#0000ff" VLINK="#800080" BGCOLOR="#000000">
<FONT FACE="Tahoma">
<P ALIGN="CENTER"><A HREF="main.html">Main Menu</A><FONT COLOR="#800000"> </P>
</FONT><P><HR></P>
<FONT SIZE=6 COLOR="#ffff00"><P ALIGN="CENTER">2D CONTROLS </P>
</FONT><FONT SIZE=4><P>There are three APE extern commands to use with 2D Controls: </P>
<P>extern CreateAPE2DControl type name x y width=ctrlwidth height=ctrlheight otherparms... </P>
<P>extern RemoveAPE2DControl name </P>
<P>extern ModifyAPE2DControl name parm=value </P>
<P>Both Create and Modify can take as many parm=value arguments as you want to throw at them. Also, variable names and expressions can be used in place of discrete values.</P>
<P>One weird thing: since these are accessing controls that all parts of Anox uses, it assumes only the directory "\anoxdata" graphics. Fonts do assume the fonts directory, though! </P></FONT>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=3 WIDTH=624>
<TR><TD VALIGN="TOP" COLSPAN=2 BGCOLOR="#000080">
<P ALIGN="CENTER"><FONT SIZE=5 COLOR="#c0c0c0">TYPES OF CONTROLS</FONT></TD>
</TR>
<TR><TD WIDTH="20%" VALIGN="MIDDLE">
<FONT SIZE=4><P>TYPE</FONT></TD>
<TD WIDTH="80%" VALIGN="MIDDLE">
<FONT SIZE=4><P>DESCRIPTION</FONT></TD>
</TR>
<TR><TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>push</FONT></TD>
<TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>pushbutton--click to call sequence</FONT></TD>
</TR>
<TR><TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>edit</FONT></TD>
<TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>single-line edit box, can autoselect it</FONT></TD>
</TR>
<TR><TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>table</FONT></TD>
<TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>used for epairs</FONT></TD>
</TR>
<TR><TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>textbox</FONT></TD>
<TD VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>box containing text--use modify, addline, and addfile to add text</FONT></TD>
</TR>
</TABLE>
<P><HR></P>
<FONT SIZE=6 COLOR="#ffff00"><P ALIGN="CENTER">PARAMETERS </P></FONT>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=3 WIDTH=624>
<TR><TD VALIGN="TOP" COLSPAN=2 BGCOLOR="#000080">
<P ALIGN="CENTER"><FONT SIZE=5 COLOR="#c0c0c0">PARAMETER DESCRIPTIONS</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4><P>TYPE</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4><P>DESCRIPTION</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Setfocus=true</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Forces the specified control to be the current focus. If set to false, then focus is removed from ALL controls.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Sequence=bbbb:eeee</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>when control is operated, trigger this sequence</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Gamevar=varname</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>set this variable to the a value specified by...</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Returnvalue=numberorvar</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Override the regular return value for a control and have it set a specified gamevar (in APE) or the return message (in C) to the specified value. NOTE: If a return value is set, then ONLY the button-down message is sent, and NO OTHERS.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Value=&lt;value&gt;</P>
<P>Current=&lt;value&gt;</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>For any control with multiple entries i.e. a listbox, set the selection to item number &lt;value&gt;</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Font="fontname"</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Set font for message</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Text="string"</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Add a line of text to a textbox or listbox</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Message="blahblah"</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>label for button</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Width=ctrlwidth</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>how wide is control?</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Height=ctrlheight</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>how tall is control?</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Line_height=&lt;value&gt;</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Specify the height/spacing of the rows of text in a multi-line control i.e. listbox or textbox</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Indent=&lt;value&gt;</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>For listboxes which have an optional second column of data, this is the offset, in pixels, for column 2</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Spacing=&lt;value&gt;</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Like line_height, can be used to put space between lines in multi-line controls</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Addentry=entryval, addline=entryval</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>adds entry to a listbox</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Addfile=filepath</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Add all the text from a file into a text box.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Hiddenflag=true [false]</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>hide button gfx</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Dimflag=true[false]</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Force the control to be dimmed i.e. unselectable</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Nodrawflag=true [false]</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Suppress drawing (and use) of the control when set to true</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Holdfocusflag=false [true]</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>When set to false, then clicking on this control does not give it focus.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Keyinputflag=false [true]</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>When set to false, this control no longer accepts keyboard shortcuts or input.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Border=true [false]</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>draw border or done--assumes true</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Purge=true</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Erase all entries from a list box or text box</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Slider=&lt;value&gt;</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>For slider controls or lists, force the slider and the drawing index to a specified location. Will automatically crop to keep the slider within the valid range.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Min=&lt;value&gt;,max=&lt;value&gt;</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>For sliders, set the minimum and/or maximum values for the range.</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Normal=gfxpathname</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Graphic to use for normal state of button instead of provided gfx</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Dim=gfxpathname</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Graphic to use for dim state of button instead of provided gfx</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Backcolor=color</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Set the color for the unfilled portion of a progress bar</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Barcolor=color</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Set the color for the filled portion of a progress bar</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Bright=gfxpathname</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Graphic to use for bright state of button instead of provided gfx</FONT></TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Depressed=gfxpathname</FONT></TD>
<TD WIDTH="76%" VALIGN="MIDDLE">
<FONT SIZE=4 COLOR="#ff0000"><P>Graphic to use for depressed state of button instead of provided gfx (toggles)</FONT></TD>
</TR>
</TABLE>
<P><HR></P>
<FONT SIZE=6 COLOR="#ffff00"><P ALIGN="CENTER">EXAMPLES </P>
</FONT><FONT SIZE=4><P>extern CreateAPE2DControl push button1 226 228 width=160 height=40 normal=/gameflow/tsm/button1.tga bright=/gameflow/tsm/button1b.tga gamevar=tsChoice returnvalue=1 sequence=HandleMouseClick% </P>
<P>extern RemoveAPE2DControl button1 </P>
<P>extern CreateAPE2DControl textbox hoursbox 246 232 width=280 height=90 font="goodsym" border=false addline="MUSEUM HOURS" </P>
<P>extern ModifyAPE2DControl hoursbox addline=" " </P>
<P>extern CreateAPE2DControl push hoursbutton 396 326 width=120 height=18 font="goodsym" sequence=CloseMuseumHours% message="Back to Menu" </P></FONT></BODY>
</HTML>