Podstrony
- Strona startowa
- Steven Rosefielde, D. Quinn Mil Masters of Illusion, American L
- Masterton Graham Studnie piekiel (SCAN dal 736)
- Masterton Graham Wojownicy Nocy t.2 (SCAN dal 91
- Masterton Graham Nocna Plaga (SCAN dal 1062)
- Masterton Graham Dzinn (SCAN dal 1029) (3)
- Masterton Graham Podpalacze Ludzi t.1 (SCAN dal
- Masterton Graham Sfinks (SCAN dal 838)
- Masterton Graham Manitou (SCAN dal 826)
- Masoneria czyzby papierowy tygr (2)
- Evanovich Janet Po trzecie dla draki
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- vader.opx.pl
[ Pobierz całość w formacie PDF ]
.A Really Cool ToolbarThe CoolBar component is basically a collection of TCoolBand objects that you can activateby selecting the Band Editor item of the CoolBar shortcut menu, the Bands property, or theObject TreeView.You can customize the CoolBar component in many ways: You can set abitmap for its background, add some bands to the Bands collection, and then assign to eachband an existing component or component container.You can use any window-based control(not graphic controls), but only some of them will show up properly.If you want to have abitmap on the background of the CoolBar, for example, you need to use partially transparentcontrols.The typical component used in a CoolBar is the Toolbar (which can be made completelytransparent), but combo boxes, edit boxes, and animation controls are also quite common.This is often inspired by the user interface of Internet Explorer, the first Microsoft applica-tion featuring the CoolBar component.You can place one band on each line or all of them on the same line.Each would use a part ofthe available surface, and it would be automatically enlarged when the user clicks on its title.Itis easier to use this new component than to explain it.Try it yourself or follow the descriptionbelow, in which we build a new version of our continuing toolbar example based on a CoolBarcontrol.You can see the form displayed by this application at run time in Figure 8.4.The CoolBar example has a TCoolBar component with four bands, two for each of the twolines.The first band includes a subset of the toolbar of the previous example, this timeadding an ImageList for the highlighted images.The second has an edit box used to set theCopyright ©2001 SYBEX, Inc., Alameda, CA www.sybex.com2874c08.qxd 7/2/01 4:27 PM Page 299Toolbar Containers 299font of the text; the third has a ColorGrid component, used to choose the font color and thatof the background.The last band has a ComboBox control with the available fonts.FI GURE 8.4:The form of the CoolBarexample at run timeThe user interface of the CoolBar component is really very nice, and Microsoft is increas-ingly using it in its applications.However, the Windows CoolBar control has had many dif-ferent and incompatible versions, as Microsoft has released different versions of the commoncontrol library with different versions of the Internet Explorer.Some of these versions broke existing programs built with Delphi.NOTEIt is interesting to note that Microsoft applications generally don t use the common controllibraries.Word and Excel use their own internal versions of the common controls, and VB uses anOCX, not the common controls directly.Part of the reason that Borland had so much trouble withthe common controls is that it uses them more (and in more ways) than even Microsoft does.For this reason, Borland introduced (in Delphi 4) a toolbar container called the Control-Bar.A control bar hosts several controls, as a CoolBar does, and offers a similar user interfacethat lets a user drag items and reorganize the toolbar at run time.A good example of the use ofthe ControlBar control is Delphi s own toolbar, but Microsoft applications use a very similaruser interface.The ControlBarThe ControlBar is a control container, and you build it just by placing other controls insideit, as you do with a panel (there is no list of Bands in it).Every control placed in the bar gets itsown dragging area (a small panel with two vertical lines, on the left of the control), as you canCopyright ©2001 SYBEX, Inc., Alameda, CA www.sybex.com2874c08.qxd 7/2/01 4:27 PM Page 300300 Chapter8 " Building the User Interfacesee in Figure 8.5.For this reason, you should generally avoid placing specific buttons insidethe ControlBar, but rather add containers with buttons inside them.Rather than using apanel, you should generally use one ToolBar control for every section of the ControlBar.FI GURE 8.5:The ControlBar is a con-tainer that allows a user todrag all the elements, usingthe special drag bar on theside.Notice that each but-ton gets a separate dragbar, something you ll gen-erally try to avoid.The MdEdit2 example is another version of the demo we ve developed throughout the lastand this chapter.I ve basically grouped the buttons into three toolbars (instead of a singleone) and left the two combo boxes as stand-alone controls.All these components are inside aControlBar, so that a user can arrange them at runtime, as you can see in Figure 8.6.FI GURE 8.6:The MdEdit2 example atrun time, while a user isrearranging the toolbars inthe control barCopyright ©2001 SYBEX, Inc., Alameda, CA www.sybex.com2874c08
[ Pobierz całość w formacie PDF ]