
Rebuilding the Demo Host Software
Additional Procedures
A-15
The rest of the layout code for the "Connection" frame lays out the "IP
address" label, the invisible 7-column "Composite" with its IP address
fields and labels, the "Discover" button and combo box, and the
"Connect" and "Disconnect" buttons. Note how the END() function closes
the definition of a widget:
WID( widgets.Composite( $w, SWT.NONE ) );
var gl = new layout.GridLayout( 7, false );
gl.marginWidth = 0;
$w.setLayout( gl );
w["txtIP1"] = WID( widgets.Text($w,SWT.BORDER|SWT.CENTER ));
$w.setLayoutData( GD( 20, SWT.DEFAULT ) );
END();
WID( widgets.Label( $w, SWT.NONE ) );
$w.setText( "." );
END();
w["txtIP2"] = WID( widgets.Text($w,SWT.BORDER|SWT.CENTER));
$w.setLayoutData( GD( 20, SWT.DEFAULT ) );
END();
WID( widgets.Label( $w, SWT.NONE ) );
$w.setText( "." );
END();
... etc, for IP3 and IP4
END();
w["btnDiscover"] = WID( widgets.Button( $w, SWT.PUSH ) );
$w.setText( " Discove&r " );
END();
w["cmbDiscover"] = WID( widgets.Combo( $w, SWT.READ_ONLY ) );
$w.setLayoutData( GD( 158, SWT.DEFAULT ) );
END();
w["btnConnect"] = WID( widgets.Button( $w, SWT.PUSH ) );
$w.setText( " &Connect " );
END();
w["btnDisconnect"] = WID( widgets.Button( $w, SWT.PUSH ) );
$w.setText( " Disc&onnect " );
END();
END();
The indentation before WID() and END() functions lets us better see
which object contains which. It is not necessary to use WID() and END(),
but we use them because they improve readability of the code. (If you
place a widget in the wrong container, you'll often get drastically different
results.)
Summary of Contents for TMS320DM6437
Page 1: ...TMS320DM6437 DVDP Getting Started Guide Literature Number SPRUEV6 July 2007 ...
Page 20: ...2 8 ...
Page 34: ...3 14 ...
Page 40: ...4 6 ...
Page 63: ......