Prev | Current Page 899 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Text;
import nGui.controls.Control;
import nGui.controls.ReturnType;
import nGui.controls.containers.VBox;
import nGui.controls.containers.Dialog;
class TextSample
{
public static function main()
{
var bs = new TextSample();
}
public function new()
{
var mng = new Manager();
var vert : VBox = new VBox();
var txt1 : Text = new Text( false );
txt1.readonly = true;
txt1.width = 150;
var txt2 : Text = new Text( true );
txt2.setSize( ???150???, ???50??? );
vert.appendChild( txt1 );
vert.appendChild( txt2 );
txt2.onChange = function( char : Int, val : String )
{
txt1.value = ???Button pressed = ??? + Std.chr( char );
return txt2.RTToInt( DEFAULT );
}
var wind : Dialog = new Dialog( vert );
wind.title = ???Text Sample???;
wind.show();
mng.loop();
}
}
This example should produce a dialog similar to that shown in Figure 17 - 4 . The Text control provides
several properties and functions you can use to interact with the control. The properties are detailed in
Table 17 - 7 and the functions in Table 17 - 8 .


Pages:
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911