Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Beginning REALbasic - From Novice To Professional (2006)

.pdf
Скачиваний:
233
Добавлен:
17.08.2013
Размер:
18.51 Mб
Скачать

86

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

Figure 3-27. An example of the ListBox control, as shown on Mac OS X

The MoviePlayer Control

The MoviePlayer control, which Figure 3-28 shows, provides you with the capability to create applications that can play movies. To do so, Apple QuickTime or Windows Media Player must be installed on the computer where the application is run. As a result, this control does not work on Linux applications.

Figure 3-28. An example of the MoviePlayer control, as shown on Windows

The NotePlayer Control

The NotePlayer control provides you with the capability to play music using Apple QuickTime musical instruments. While this control does provide your applications with functionality, it is invisible to the user.

The OLEContainer Control

The OLEContainer control is a Windows-specific feature that provides you with the capability to integrate ActiveX controls into your REALbasic applications. While this control does provide your applications with functionality, it is invisible to the user.

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

87

The Oval Control

The Oval control, as Figure 3-29 shows, provides the capability to draw oval shapes on windows. Oval drawings are, by default, 1 pixel thick, and they are black with a white center. However, you can change line thickness, as well as line and fill colors.

Figure 3-29. An example of the Oval control, as shown on Linux

The PagePanel Control

The PagePanel control provides the capability to define and display different panels on a window, where only one panel is visible at a time. The PagePanel control does not provide a visual navigation feature that enables the user to switch between panels. Instead, providing this capability is up to the user. Figure 3-30 shows a typical Document Window. The content for this window is stored on two pages.

Figure 3-30. A Document Window to which a PagePanel Window has been added

Figure 3-31 shows the contents displayed on the second page of the PagePanel control. In this example, the user is able to switch between pages by clicking a PushButton control that was added to each page.

88

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

Figure 3-31. An example of the PagePanel control, as shown on Windows

The Placard Control

The Placard control, which you see in Figure 3-32, provides the capability to add a placard to your REALbasic applications. Placards are typically used to help provide emphasis to controls or text placed on them. As Figure 3-32 shows, placards can have background colors, and they can be displayed in normal, pressed, and disabled states.

Figure 3-32. Examples of the Placard control, as shown on Windows, in pressed, disabled, and normal states.

The PopupArrow Control

The PopupArrow control, shown in Figure 3-33, enables you to display an arrow in any of four directions (north, south, east, and west). The PopupArrow control is often used as a building block for creating custom controls.

Figure 3-33. An example of the PopupArrow control, as shown on Mac OS X

The PopupMenu Control

The PopupMenu control, seen in Figure 3-34, is a space-saving feature that let’s you display a list of choices to the user. Once selected, the user can use the up and down keys to navigate the list, and Enter or Return to make a selection.

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

89

Figure 3-34. An example of the PopupMenu control, as shown on Windows

The PowerPointApplication Control

The PowerPointApplication control is one of three REALbasic controls that provide you with the capability to develop applications that incorporate Microsoft Office functionality into your applications, provided Microsoft Office is installed on the computer where the applications execute. This control is used to integrate Microsoft PowerPoint functionality into REALbasic applications. The PowerPointApplication control is invisible to the user.

The PowerPointApplication control works with Microsoft Office 2000 and 2003 on computers running Windows, and Office 98, and Office 2001 on Macintosh. Also, Microsoft Office X is supported on Mac OS X. Microsoft Office Applications do not run on Linux, so this control is not supported on that OS.

Note To effectively use this control, you must have some familiarity with Microsoft VBA, which you can find published in numerous books, including Office 2003 Programming: Real World Applications (ISBN: 1590591399), published by Apress.

The ProgressBar Control

The ProgressBar control, shown in Figure 3-35, provides you with the capability to display an indicator that shows some sort of progress as your applications process a particular task. The ProgressBar control only has a horizontal orientation.

Figure 3-35. An example of the ProgressBar control, as shown on Mac OS X

The ProgressWheel Control

The ProgressWheel control, seen in Figure 3-36, provides you with the capability to visually indicate when a time-consuming operation is taking place.

Figure 3-36. An example of the ProgressWheel control, as shown on Linux

90

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

The PushButton Control

As you saw in previous chapters, the PushButton control, shown in Figure 3-37, is used to display buttons that users can click to initiate specific actions.

Figure 3-37. Examples of PushButton controls, as shown on Mac OS X

The RadioButton Control

The RadioButton control, which you can see in Figure 3-38, is used to present users with a choice between one or more values. RadioButton controls operate in groups, where only one RadioButton in the group can be selected at a time. In situations where you want to create distinct sets of RadioButton controls on the same window, you can use the GroupBox control to separate and organize the RadioButton controls.

Figure 3-38. Examples of RadioButton controls, as shown on Windows

The Rb3Dspace Control

The Rb3Dspace control provides you with the capability to display animation in a predefined three-dimensional space.

The RbScript Control

The RbScript control provides you with the capability to let users submit REALbasic code, and then executes it from your compiled application. While this control does provide your application with functionality, it is invisible to the user.

The Rectangle Control

The Rectangle control, seen in Figure 3-39, provides the capability to draw rectangle and square shapes on windows. Rectangle drawings are, by default, 1 pixel thin and they are black with a white center. However, you can change line thickness, as well as line and fill colors.

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

91

Figure 3-39. An example of the Rectangle control, as shown on Linux

The RoundRectangle Control

The RoundRectangle control, as shown in Figure 3-40, provides the capability to draw rectanglelike and square-like shapes (with rounded corners) on windows. RoundRectangle drawings are by default, 1 pixel thick and black with a white center. However, you can change the line thickness, as well as line and fill colors.

Figure 3-40. An example of the RoundRectangle control, as shown on Linux

The ScrollBar Control

The Scrollbar control, which you see in Figure 3-41, is used to add vertical and horizontal scrollbars to your applications. By default, ScrollBar controls are vertical, but, by reshaping them, you can make them horizontal.

Figure 3-41. An example of the ScrollBar control, as shown on Mac OS X

You can resize your ScrollBar controls as required by your application. However, be careful not to make them less than 16 pixels thick or they will not look right.

The Separator Control

The Separator control, shown in Figure 3-42, is used to visually divide or organize a window into different parts. Otherwise, the Separator control has no effect on the operations within an application.

92

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

Figure 3-42. An example of the Separator control, as shown on Linux

The Serial Control

The Serial control provides you with the capability to create applications that can communicate with other applications or devices by sending and receiving messages over the computer’s serial port. While the Serial control does provide your applications with functionality, it is invisible to the user.

The ServerSocket Control

The ServerSocket control provides you with the capability to create web server applications capable of handling thousand of simultaneous incoming TCP/IP connections over a single port. While the ServerSocket control does provide your applications with functionality, it is invisible to the user.

The Slider Control

The Slider control, as seen in Figure 3-43, provides you with the capability to accept user input provided when the user drags the slider and moves it to a new location on the slider bar. You can display the Slider control horizontally or vertically.

Figure 3-43. An example of the Slider control, as shown on Mac OS X

The SpotlightQuery Control

The SpotlightQuery control is a Mac OS X-specific (Mac OS X 10.4 or higher) control that provides you with the capability to accept and pass on user queries to Spotlight, and then display any returned results. While the SpotlightQuery control does provide your applications with functionality, it is invisible to the user.

Note Spotlight is a Mac OS X feature that uses metadata to assist users in performing searches.

The SpriteSurface Control

The SpriteSurface control provides you with the capability to produce animated effects using sprites. A sprite is an object with a picture that can be moved around the screen via program code. The SpriteSurface control is responsible for handling all drawing operations and for informing your application code when collisions occur.

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

93

The StandardToolbarItem Control

The StandardToolbarItem control is a Macintosh-specific control that provides you with the capability to add toolbars, complete with graphic icons, to Macintosh applications.

The StaticText Control

As you saw in previous chapters, the StaticText control, as Figure 3-44 shows, provides the capability to display text on windows. The StaticText control is typically used to display labels for other controls.

Figure 3-44. An example of the StaticText control, as shown on Mac OS X

The TabPanel Control

The TabPanel control, shown in Figure 3-45, provides the capability to organize content on two or more tabs that share space on the same window. This control is often used to conserve space and logically organize related controls. Users navigate between panels by clicking their associated tabs. By default, REALbasic sets up a TabPanel control with two tabs, but you can add as many additional tabs as you require.

Figure 3-45. An example of the TabPanel control, as shown on Linux

The TCPSocket Control

The TCPSocket control provides you with the capability to create applications that can communication with other TCP/IP-based programs on computer networks and the Internet. While the TCPSocket control does provide your applications with functionality, it is invisible to the user. Its functionality differs from that provided by the ServerSocket control, which is designed to support the development of web server applications.

94

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

The Thread Control

The Thread control provides you with the capability to develop applications that run in the background without any user interaction. Threads also run in parallel with one another, enabling you to develop applications that can do a number of things at the same time. While the Thread control does provide your applications with functionality, it is invisible to the user.

The Timer Control

The Timer control is used to execute program code at specific time intervals. For example, if you develop a REALbasic game, you might use the time control to limit how long a player’s turn lasts. While the Timer control does provide your applications with functionality, it is invisible to the user.

The ToolbarItem Control

The ToolbarItem control is a Macintosh-specific control that provides you with the capability to add toolbars, complete with graphic icons, to Macintosh applications.

The UDPSocket Control

The UDPSocket control provides you with the capability to create applications that can communicate with other TCP/IP-based programs using the UDP protocol on computer networks and the Internet. While the UDPSocket control does provide your applications with functionality, it is invisible to the user.

The UpDownArrows Control

The UpDownArrows control, shown in Figure 3-46, is typically used to control interface scrolling.

Figure 3-46. An example of the UpDownArrows control, as shown on Windows

The WordApplication Control

The WordApplication control is one of three REALbasic controls that provide you with the capability to develop applications that incorporate Microsoft Office functionality into your applications, provided Microsoft Office is installed on the computer where the application executes. This control is used to integrate Microsoft Word functionality into REALbasic applications. The WordApplication control is invisible to the user.

The WordApplication control works with Microsoft Office 2000 and 2003 on computers running Windows and Office 98, and Office 2001 on Macintosh. Also, Microsoft Office X is supported on Mac OS X. Microsoft Office Applications do not run on Linux, so this control is not supported on that OS.

C H A P T E R 3 C R E A T I N G A N A P P L I C A T I O N ’ S U S E R I N T E R F A C E

95

Note To effectively use this control, you must have some familiarity with Microsoft VBA, which you can find published in numerous books, including Microsoft Office Programming: A Guide for Experienced Developers (ISBN: 1590591216), published by Apress.

Extending REALbasic Functionality by

Adding New Controls

Sometimes, you may find yourself in need of functionality not provided by REALbasic’s builtin collection of controls. In these situations, you have several choices. For starters, you can use REALbasic to create a solution yourself, but chances are good that if you have come up with a need or an idea for a new control, someone has already invented it. You may want to do a little surfing on the Internet to see if you can find a plug-in that provides the required functionality.

Some plug-ins are free, while others are for sale. To use these plug-ins, all you have to do is download them and add them to the REALbasic plug-ins folder, which you can find in the same directory where you installed REALbasic.

Plug-Ins

One source of free plug-ins is the REALbasic website, where you can find database plug-ins in the download area. One way to find other sources of REALbasic plug-ins is to search the Internet for REALbasic Plug-ins. In addition, you might want to check out the REALbasic Plugins Web ring at http://w.webring.com/hub?ring=rbplugins.

Other sources of REALbasic plug-ins include Van Hoek Software REALbasic Plugins at http://homepage.mac.com/vanhoek/ and Mile 23 (http://www.mile23.com/plugins.html) and Monkeybread plugins at http://www.monkeybreadsoftware.de.

ActiveX

If you are developing applications specifically for Windows, you can take advantage of Microsoft ActiveX controls, which are available on most users’ home computers. By adding these controls to REALbasic, you can programmatically work with them just as if they were built-in REALbasic controls.

Note ActiveX is a collection of technologies that provide information for sharing between Windows applications.