Writer:例:一个简单的窗体
出自OOo 中文指南手册翻译
目录 |
[编辑] 创建文档 Create the document
打开一个新的文档(文件 > 新建 > 文本文档)。先不管窗体的控件,列出文档的大纲。这些内容在后面能很容易地修改。 这是一个很好的方法不用表格控件去写下文档的大纲,尽管它在之后很容易被改变。 Open a new document (File > New > Text Document). It is a good idea to write down the outline of the document, without form controls, though of course it can easily be changed later.
[编辑] 添加窗体控件 Add form controls
下一步将在文档中添加一个窗体控件。我们将用到四个控件: The next step is to add the form controls to the document. We will have four controls:
- 名字是一个文本框。 Name is a text box
- 性别是两个选择按钮,男性或者女性。 Sex is two option buttons, male or female.
- 最喜爱的形状是一个选择列表。 Favourite shape is a list of options.
- 所有你喜欢的形状是一系列的复选框。 All shapes you like is a series of check boxes.
添加这些控件的步骤是: To add these controls:
- 选择菜单 视图 > 工具栏 > 窗体控件,打开 窗体控件 工具栏。 Select View > Toolbars > Form Controls to open the Form Control toolbar.
- 如果控件工具没有激活,点击窗体导航按钮(在窗体控制工具栏上)激活它们。如果有必要,也可以点击 启动或关闭设计模式 按钮。 If the tools are not active, click the Form Navigator button (on the Form Control toolbar) to activate them. If necessary, also click the Design Mode On/Off button.
- 点击 文本框 按钮
,然后在文档中点击,按住鼠标左键按钮,拖动生成计划大小的 名字 文本框。 Click the Text Box button
, then click in the document and, with the left mouse button held down, drag the shape of the Name text box to approximately the size you want.
- 确定 打开/关闭向导 按钮
是激活的(边框有阴影)。点击 更多控件工具 按钮
打开 更多控件 工具栏。 Make sure the Wizards On/Off button
is on (shaded with a border). Click the More Controls button
to launch the More Controls toolbar.
- 点击 更多控件工具栏 上的 分组框 按钮
。画 性别 分组框,进入分组元素向导。 On the More Controls toolbar, click the Group Box button
. Draw a group box by the Sex: entry to launch the Group Element Wizard.
- 在向导的第一页上,为选项领域输入两个选项的名称: 男性 和 女性。点击3次继续(N)>> ,删除说明文字,然后点击完成。 On the first page of the wizard, enter two names for the options fields: Male and Female. Click Next>> three times, delete the caption and click Finish.
- 现在创建列表框。在窗体控件工具栏上,点击 打开/关闭向导 按钮
关闭向导。点击列表框按钮
,在最爱的形状旁边绘制一个列表框:在这个文档中。这只是一个暂时空的窗格。 Now create the list box. On the Form Controls toolbar, click the Wizards On/Off button
to turn wizards off. Click the List Box button
and draw a list box by Favourite Shape: in the document. This will just be an empty pane for now.
- 最后在所有你喜欢的形状旁边创建四个复选框。点击复选框按钮
,然后并排跨页绘制出四个复选框。 Finally create four check boxes by All the shapes you like. Click on the Check Box button
and then draw out four check boxes, side by side across the page.
现在你应该有一个看起来像下图的文档。 You should now have a document looking something like the figure below.
[编辑] 配置窗体控件 Configure form controls
姓名和性别的区域不需要进一步设置(当然,如果你希望的话,也可以设置控件,例如为每一个控件命名或者改变控件的外观)。 No further configuration is required to the Name and Sex fields (though, of course, there is configuration that could be done if you wanted, such as giving a name to each control and changing the appearance of the controls).
该列表框必须被配置为添加选项列表。复选框必须被配置为添加名称(替代复选框,复选框1...) The list box must be configured to add the list of options. The check boxes must be configured to add in the names (instead of Check Box, Check Box1...)
- 在文档中点击列表框控件,然后控制按钮[[Image:]] 在窗体设计工具栏上打开控件属性对话框。选择常规选项卡。 Click on the List Box control within the document and then the Control button [[Image:]] on the Form Design toolbar to launch the control properties dialog box. Select the General tab.
- 在列表框入口中,输入形状的名称:圆形,三角形,方形和五角形。输入一个形状,并按下输入键。然后把光标定位到该行结束并输入下一个形状。您应该最终得到一个排列“圆形”;“三角形”;“方形”;“五角形”。 In the List Entries box, enter the names of the shapes: Circle, Triangle, Square and Pentagon. Type in one shape and press Enter. Then position the cursor at the end of the line to type in the next shape. You should end up with a line saying “Circle”;”Triangle”;”Square”;”Pentagon”.
- 点击第一个复选框。在属性对话框保持打开状态,而是改变,以显示对复选框的属性。 Click on the first Check Box. The Properties dialog box stays open but changes to show the properties for the check box.
- 把标签更改为圆形,然后按回车键。复选框的标签将立即被更改了。 Change the Label to Circle and press Enter. The label on the check box will change immediately.
- 轮流点击其他三个复选框。在属性对话框中把标签的名称依次改为三角形,主形,五角形。 Click on each of the other three check boxes in turn. Change the Label in the Properties dialog box to Triangle, Square and Pentagon in turn.
- 关闭属性对话框。 Close the Properties dialog box.
- 关闭设计模式
并且关闭两个控制工具栏。 Turn Design Mode off
and close the two Controls toolbars.
现在您已经完成了你所希望的窗体看起来像下图。 You have now completed the form and your form hopefully looks something like the figure below.
[编辑] Finishing touches
这个窗体已经完成,但你可以自由地对文档做出进一步修改。如果你发送这个给其他人来完成,你可能想使设置该文档为只读。这个效果将会是用户将能够填写窗体,但不能对文档进行任何其他更改。 The form is complete, but you are free to make further changes to the document. If you were sending this out to other people to complete, you would probably want to make the document read-only. The effect would be that users would be able to fill in the form, but not to make any other changes to the document.
设置文档为只读,选择工具>选项>OpenOffice.org>安全>打开这个文档为只读模式。 To make the document read-only, select Tools > Options > OpenOffice.org > Security > Open this document in read-only mode.
| 如果这个文档是只读的,窗体中的任何填充都需要使用文件>别存为来保存文档。 If the document is read-only, anyone filling in the form will need to use File > Save as to save the document. | |
[编辑] 进度表
| Writer:例:一个简单的窗体 中文化进度 | 翻译 | 0 | 校对 | 0 | 插图 | / | 上次编辑 | 20100517075646 | 编者 | 218.249.75.106 |

