Access Point: 2 Letting The User Choose

Up: GEOS SDK TechDocs | Up | Up | Prev: 1 Access Points | Next: 3 Searching For an Access Point

The Talk sample application shows how an application can use an AccpntControl object to provide UI for picking an access point. This example is discussed in the Socket library documentation. The application also shows how to use the selected access point (in this case, an ISP) to establish a PPP connection; this part of the application is discussed further in the Socket chapter.

In this example, the controller is declared:

			@chunk char accpntMkr[] = "Access List";
			@object AccessPointControlClass AccpntControl = {
			    GI_states = GS_USABLE | GS_ENABLED;
			    ATTR_ACCESS_POINT_CONTROL_LIST_MONIKER = @accpntMkr;
			    HINT_ACCESS_POINT_CONTROL_MINIMIZE_SIZE;
			}

To present the user with a different type of access points (telnet connections, for example) set the type in the APCI_type instance data field:

@object AccessPointControlClass AccpntControl = {
    ...
    APCI_type = APT_TELNET;
}

You may wish to set up your program's UI such that there is a gadget which will not be enabled (will be grayed out) if there are no access points of the proper type defined. To do this, turn off the object's GS_ENABLED flag in its declaration, and use the object's optr as the value of the APCI_enableDisable instance field:

@object ... MyObject = {
    ...
    GI_states = @default & ~GS_ENABLED;
}
@object AccessPointControlClass AccpntControl = {
    ...
    APCI_enableDisable = @MyObject;
}

To find out the ID number of the controller's currently selected access point, use MSG_ACCESS_POINT_CONTROL_GET_SELECTION .

To find out when the user has selected an access point (changed their selection), you have to be a bit trickier.

While the application is using the selected access point, it can "lock" the access point to prevent the access point's parameters from being modified while it's in use. (See Locking and Unlocking .)

Multiple-Selection Access Point Controllers


Up: GEOS SDK TechDocs | Up | Up | Prev: 1 Access Points | Next: 3 Searching For an Access Point