📄 apa.htm
字号:
defined? <P> <DT></DT> <DD>In the Object Inspector, switch to the Events page. In the value column next to the event, click the drop-down arrow button. A list of compatible event handlers is displayed. Choose one. <P> <DT></DT> <DD><B>10. </B>When using the Object Inspector, how can you enumerate the choices for a particular property? <P> <DT></DT> <DD>Double-click the value column next to the property name in the Object Inspector. Each time you double-click, the value changes to the next item in the list. <P></DL><H2><A NAME="Heading5"></A>Day 5</H2><DL> <DT></DT> <DD><B>1. </B>Are all components visible at design time? <P> <DT></DT> <DD>No. Only visual components can be seen at design time. <P> <DT></DT> <DD><B>2. </B>Is the OpenDialog component a visual component or a nonvisual component? <P> <DT></DT> <DD>It's a nonvisual component. Although it is displayed at runtime, it is considered nonvisual because it is not visible at design time. <P> <DT></DT> <DD><B>3. </B>What is the name of the VCL class that represents a Delphi form? <P> <DT></DT> <DD>TForm. <P> <DT></DT> <DD><B>4. </B>Do all versions of Delphi ship with the same set of components? <P> <DT></DT> <DD>No. The Professional version comes with more components than the Standard version. Likewise, the Client/Server version comes with more components than does the Professional version. <P> <DT></DT> <DD><B>5. </B>Are all VCL classes ultimately derived from TObject? <P> <DT></DT> <DD>Yes. <P> <DT></DT> <DD><B>6. </B>Name one nonvisual VCL component. <P> <DT></DT> <DD>TOpenDialog, TSaveDialog, TRegistry, TColorDialog, TTimer, TImageList, TFontDialog, and many more, are all nonvisual VCL components. <P> <DT></DT> <DD><B>7. </B>Do all components share certain common properties? <P> <DT></DT> <DD>Yes. All components are ultimately derived from TComponent, so they all have the properties found in TComponent, such as Name and Owner. <P> <DT></DT> <DD><B>8. </B>Name two common properties that all visual components share. <P> <DT></DT> <DD>Common properties that all visual components share include Top, Left, Owner, Parent, Width, Height, and so on. <P> <DT></DT> <DD><B>9. </B>Can two or more components share the same event handler? <P> <DT></DT> <DD>Yes. <P> <DT></DT> <DD><B>10. </B>What is the VCL terminology for a Windows device context? What is the name of the VCL class that encapsulates device contexts? <P> <DT></DT> <DD>A canvas is a Windows device context. VCL encapsulates device contexts through the TCanvas class. <P></DL><H2><A NAME="Heading6"></A>Day 6</H2><DL> <DT></DT> <DD><B>1. </B>When do you use Ctrl+drag in selecting components? <P> <DT></DT> <DD>When selecting components that are children of another component (components on a panel, for example). <P> <DT></DT> <DD><B>2. </B>What significance does the first component selected have when aligning a group of components? <P> <DT></DT> <DD>It is the anchor component. It retains its position, and all other components are aligned to it. <P> <DT></DT> <DD><B>3. </B>What is the quickest method to select a group of components? <P> <DT></DT> <DD>Drag a bounding rectangle around (or just touching) them. <P> <DT></DT> <DD><B>4. </B>How can you make a group of components all have the width of the group's widest component? <P></DL><UL> <LI>Select all the components you want to modify. Then choose Edit | Size from the main menu and choose the Grow to Largest radio button.</UL><DL> <DT></DT> <DD><B>5. </B>What happens when you double-click a component on a form? <P> <DT></DT> <DD>The default event handler for that component is displayed in the Code Editor. In the case of many components, the OnClick event handler will be displayed. In some special cases (such as the Image component), a dialog box is displayed. <P> <DT></DT> <DD><B>6. </B>What does the Align property's alClient option do? <P> <DT></DT> <DD>It forces the component to fill the entire client area of its parent, regardless of how the parent (usually a form) is sized. <P> <DT></DT> <DD><B>7. </B>What does the ellipsis following a menu item mean? <P> <DT></DT> <DD>Traditionally, it means that choosing that menu item will result in a dialog being displayed. <P> <DT></DT> <DD><B>8. </B>What two ways can you move a menu item? <P> <DT></DT> <DD>In the Menu Designer, you can drag the menu to a new location or you can use cut and paste. <P> <DT></DT> <DD><B>9. </B>How do you add menu accelerators to menu items? <P> <DT></DT> <DD>When typing the caption for the menu item, add the ampersand (&) before the shortcut key you choose as the shortcut for that menu item. For example, the Caption for the File | Exit menu item would read E&xit. <P> <DT></DT> <DD><B>10. </B>How do you initially disable a menu item? <P> <DT></DT> <DD>Set its Enabled property to False. <P></DL><H2><A NAME="Heading7"></A>Day 7</H2><DL> <DT></DT> <DD><B>1. </B>Can you change the Name property of a component at runtime? <P> <DT></DT> <DD>Yes, but it's a very bad idea. <P> <DT></DT> <DD><B>2. </B>What property is used to enable and disable controls? <P> <DT></DT> <DD>The Enabled property. <P> <DT></DT> <DD><B>3. </B>How can you tell at runtime that a button is disabled? <P> <DT></DT> <DD>Its text is grayed out. <P> <DT></DT> <DD><B>4. </B>What is the difference between the long hint and the short hint? <P> <DT></DT> <DD>The long hint is used for the status bar text, and the short hint is used for the tooltip text. <P> <DT></DT> <DD><B>5. </B>Name three of the four methods that can be used to tell a control to repaint itself. <P> <DT></DT> <DD>Invalidate, Repaint, Refresh, and Update. <P> <DT></DT> <DD><B>6. </B>How many types of combo boxes are there? <P> <DT></DT> <DD>Three: simple, drop-down, and drop-down list. <P> <DT></DT> <DD><B>7. </B>How is the ModalResult property used for button components? <P> <DT></DT> <DD>When a button with a ModalResult property set to a whole number is clicked, the form will close. The value of the ModalResult property for the button clicked will be the return value from the ShowModal method. <P> <DT></DT> <DD><B>8. </B>What component is often used as a container for other components? <P> <DT></DT> <DD>The Panel component. Several others qualify, too. <P> <DT></DT> <DD><B>9. </B>What is the return value from the Execute method for an OpenDialog component if the user clicks OK to close the dialog box? <P> <DT></DT> <DD>true. <P> <DT></DT> <DD><B>10. </B>How do you make the SaveDialog component into a Save As dialog box? <P> <DT></DT> <DD>Just change its Title property to Save As. <P></DL><H2><A NAME="Heading8"></A>Day 8</H2><DL> <DT></DT> <DD><B>1. </B>When do you use the Inherit option when selecting an object in the Object Repository? <P> <DT></DT> <DD>Use the Inherit option when you want all the features of the base object and you want the inherited object to change if the base object changes. <P> <DT></DT> <DD><B>2. </B>What is the procedure for saving a project to the Object Repository? <P> <DT></DT> <DD>To save a project to the Object Repository, choose Project|Add to Repository from the main menu. <P> <DT></DT> <DD><B>3. </B>What happens to inherited forms when you change the base form? <P> <DT></DT> <DD>When you change the base form, all the inherited forms change to reflect the change made to the base form. <P> <DT></DT> <DD><B>4. </B>Where in the form's class declaration do you place user method declarations? <P> <DT></DT> <DD>You place user method declarations in the private or public sections of the class declaration. Never place user declarations in the Delphi-managed section of the class declaration (unless you know what you are doing). <P> <DT></DT> <DD><B>5. </B>Where do you place the method definition (the method itself) when you add your own methods to Delphi code? <P> <DT></DT> <DD>In the implementation section of the unit. <P> <DT></DT> <DD><B>6. </B>How can you determine who wrote a particular object in the Object Repository? <P> <DT></DT> <DD>You can tell who wrote an object in the Object Repository by switching to the Details view. The object's author is listed there. <P> <DT></DT> <DD><B>7. </B>Where do you add and delete pages in the Object Repository? <P> <DT></DT> <DD>You add or delete pages in the Object Repository from the Object Repository configuration dialog box (which you get by selecting Tools | Repository from the main menu). <P> <DT></DT> <DD><B>8. </B>Is it easier to create a basic application from scratch or by using the Application Wizard? <P> <DT></DT> <DD>It is easier to create a new application by using the Application Wizard in almost all cases. <P> <DT></DT> <DD><B>9. </B>Which is better for small applications: static linking or dynamic linking using packages? <P> <DT></DT> <DD>For small applications, static linking is usually better than dynamic linking (no runtime packages). <P> <DT></DT> <DD><B>10. </B>Can you create a resource script file containing a string table with a text editor? <P> <DT></DT> <DD>Yes, you can easily create a string table with a text editor. You only need to understand the basic layout of a string table. <P></DL><H2><A NAME="Heading9"></A>Day 9</H2><DL> <DT></DT> <DD><B>1. </B>How can you quickly switch between a unit's form and source code when working with Delphi? <P> <DT></DT> <DD>Use the F12 key to quickly switch between the Form Designer and the Code Editor. <P> <DT></DT> <DD><B>2. </B>If you remove a file from your project via the Project Manager, is the file removed from your hard drive? <P> <DT></DT> <DD>No, it is only removed from the project. <P> <DT></DT> <DD><B>3. </B>How do you set the main form for an application? <P> <DT></DT> <DD>Go to the Forms page of the Project Options dialog box and select the form you want to be the main form in the Main form combo box. <P> <DT></DT> <DD><B>4. </B>What does it mean if you do not have Delphi Auto-create forms? <P> <DT></DT> <DD>You will have to take the responsibility of creating the forms before using them. <P> <DT></DT> <DD><B>5. </B>How do you add new items to your unit using the Code Explorer? <P> <DT></DT> <DD>Right-click and choose New from the Code Explorer context menu. Type in the declaration for the new item and hit Enter. <P> <DT></DT> <DD><B>6. </B>What is the significance of generating debug information for your application? <P> <DT></DT> <DD>When debug information is generated, you will be able to step through your code during debugging sessions. <P> <DT></DT> <DD><B>7. </B>What is the Find in Files option used for? <P> <DT></DT> <DD>Find in Files is used to find text in files. <P> <DT></DT> <DD><B>8. </B>What is the keyboard shortcut for saving a file in the Code Editor? <P> <DT></DT> <DD>Ctrl+S (assuming that you're using the default keymapping). <P> <DT></DT> <DD><B>9. </B>How do you set a bookmark in an editor window? How many bookmarks are available? <P> <DT></DT> <DD>Set a bookmark with Ctrl+K+0 through Ctrl+K+9. There are 10 bookmarks available. <P> <DT></DT> <DD><B>10. </B>How do you set a file to read-only in the Code Editor? <P> <DT></DT> <DD>Choose Read Only from the Code Editor context menu. <P></DL><H1><A NAME="Heading9.5"></A>Day 10</H1><DL> <DT></DT> <DD><B>1. </B>How do you set a breakpoint on a particular code line? <P> <DT></DT> <DD>Click in the gutter (the left margin) on that code line. You can also press F5 or choose Toggle Breakpoint from the Code Editor context menu. <P> <DT></DT> <DD><B>2. </B>What is an invalid breakpoint? <P> <DT></DT> <DD>A breakpoint that is inadvertently set on a source code line that generates no compiled code. <P> <DT></DT> <DD><B>3. </B>How do you set a conditional breakpoint? <P> <DT></DT> <DD>Set the breakpoint, choose View|Debug Windows|Breakpoints from the main menu, click the breakpoint in the Breakpoint List window, and then choose Properties from the Breakpoint List context menu. Set the condition in the Condition field of the Edit Breakpoint dialog box. <P> <DT></DT> <DD><B>4. </B>How can you change the properties of an item in the Watch List? <P> <DT></DT> <DD>Double-click the item in the Watch List window. The Watch Properties dialog box is displayed. Modify the properties as needed. <P> <DT></DT> <DD><B>5. </B>What's the quickest way to add a variable to the Watch List? <P> <DT></DT> <DD>Click the variable and press Ctrl+F5 (or choose Add Watch at Cursor from the Code Editor context menu). <P> <DT></DT> <DD><B>6. </B>What tool do you use to view the data fields and methods of a class? <P> <DT></DT> <DD>The Debug Inspector is used to view classes and records. <P> <DT></DT> <DD><B>7. </B>How do you trace into a method when stepping with the debugger? <P> <DT></DT> <DD>Use F7 or Run|Trace Into to step into a method. <P> <DT></DT> <DD><B>8. </B>How can you change the value of a variable at runtime? <P> <DT></DT> <DD>Click the variable and then choose Evaluate/Modify from the Code Editor context menu (or choose Run|Evaluate/Modify from the main menu). Change the value in the Evaluate/Modify dialog box. <P> <DT></DT> <DD><B>9. </B>How can you send your own messages to the Event Log? <P> <DT></DT> <DD>You can send your own messages to the Event Log by calling the Windows API function, OutputDebugString. <P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -