zt:如何显示中文化的打印设置对话框?
2004-07-14 16:04
567 查看
如何显示中文化的打印设置对话框?
拷贝C:/Rave5/Source目录中的RpFormSetup.pas和RpFormSetup.dfm到对应的项目目录中。
把RpFormSetup.pas加入到对应的项目文件中,把对应窗体的名字从RPSetupForm更改为SCSetupForm;将文件RpFormSetup.pas另存为SCFormSetup.pas。
把窗体SCSetupForm中的对应文字从英文更改为中文。
在主窗体上加上 RvProject和 RvSystem部件,通过设定RvProject.Engine为RvSystem部件来把两者挂接。
设置RvSystem部件的OverrideSetup事件过程为以下代码:
procedure TForm1.RvSystem1OverrideSetup(ReportSystem: TRvSystem;
OverrideMode: TOverrideMode; var OverrideForm: TForm);
begin
case
OverrideMode of
omCreate:
begin
OverrideForm := TSCSetupForm.Create(nil);
//OverrideForm.Caption := RvSystem1.TitleSetup;
(OverrideForm as TSCSetupForm).ReportSystem := ReportSystem;
end;
omShow:
begin
with OverrideForm as TSCSetupForm, ReportSystem do
begin
PreviewSetup := False;
Aborted := ShowModal = mrCancel;
end;
end;
omWait:
begin
{because showModal: no wait necessary!}
end;
omFree:
begin
OverrideForm.Free;
end;
end;
end;
编译运行这个项目,其打印设置对话框就会变成中文的了!
这种方式进行中文化不会受到RAVE版本升级的影响!
--------------------------------------------------------------------------------------
参考资料一
How to override the standard setupdialog
Normally the Printsetup Form is displayed when executing the report to allow the user to select the report destination and other settings (copies, file format to use).
Copy the rpFormSetup.pas- and rpFormSetup.dfm-file in the project folder and change the filenames and the unit-name inside the pas-file and the form-name. for example in dtFormSetup (dt is the abbreviation of "deutsch"- german).
Sample Files: rave_dtformsetiup.zip
Add dtFormSetup to the uses statement in the project. Make visual changes and localization to the form and save it.
Connect the RvSystem component with the RvProject component.
Select the RvSystem component and create the OverrideSetup event and enter the following code:
Compile and run any of the reports, your special Setup Form should be displayed when you execute a rave-report.
-> this way doesn't override your setupform on a rave-update, too.
拷贝C:/Rave5/Source目录中的RpFormSetup.pas和RpFormSetup.dfm到对应的项目目录中。
把RpFormSetup.pas加入到对应的项目文件中,把对应窗体的名字从RPSetupForm更改为SCSetupForm;将文件RpFormSetup.pas另存为SCFormSetup.pas。
把窗体SCSetupForm中的对应文字从英文更改为中文。
在主窗体上加上 RvProject和 RvSystem部件,通过设定RvProject.Engine为RvSystem部件来把两者挂接。
设置RvSystem部件的OverrideSetup事件过程为以下代码:
procedure TForm1.RvSystem1OverrideSetup(ReportSystem: TRvSystem;
OverrideMode: TOverrideMode; var OverrideForm: TForm);
begin
case
OverrideMode of
omCreate:
begin
OverrideForm := TSCSetupForm.Create(nil);
//OverrideForm.Caption := RvSystem1.TitleSetup;
(OverrideForm as TSCSetupForm).ReportSystem := ReportSystem;
end;
omShow:
begin
with OverrideForm as TSCSetupForm, ReportSystem do
begin
PreviewSetup := False;
Aborted := ShowModal = mrCancel;
end;
end;
omWait:
begin
{because showModal: no wait necessary!}
end;
omFree:
begin
OverrideForm.Free;
end;
end;
end;
编译运行这个项目,其打印设置对话框就会变成中文的了!
这种方式进行中文化不会受到RAVE版本升级的影响!
--------------------------------------------------------------------------------------
参考资料一
How to override the standard setupdialog
Category
Rave - GeneralQuestion
How can I change the setup-dialogbox in an other look or in an other language, for example german ?Solution
In Rave 5 exist a standard setup-form. Many user , especially in "non"-english countries, would localize this dialog.Normally the Printsetup Form is displayed when executing the report to allow the user to select the report destination and other settings (copies, file format to use).
Copy the rpFormSetup.pas- and rpFormSetup.dfm-file in the project folder and change the filenames and the unit-name inside the pas-file and the form-name. for example in dtFormSetup (dt is the abbreviation of "deutsch"- german).
Sample Files: rave_dtformsetiup.zip
Add dtFormSetup to the uses statement in the project. Make visual changes and localization to the form and save it.
Connect the RvSystem component with the RvProject component.
Select the RvSystem component and create the OverrideSetup event and enter the following code:
procedure TForm1.RvSystem1OverrideSetup(ReportSystem: TRvSystem; OverrideMode: TOverrideMode; var OverrideForm: TForm); begin case OverrideMode of omCreate: begin OverrideForm := TdtSetupForm.Create(nil); OverrideForm.Caption := RvSystem1.TitleSetup; (OverrideForm as TdtSetupForm).ReportSystem := ReportSystem; end; omShow: begin with OverrideForm as TdtSetupForm, ReportSystem do begin PreviewSetup := False; Aborted := ShowModal = mrCancel; end; end; omWait: begin {because showModal: no wait necessary!) end; omFree: begin OverrideForm.Free; end; end; end;
Compile and run any of the reports, your special Setup Form should be displayed when you execute a rave-report.
-> this way doesn't override your setupform on a rave-update, too.
相关文章推荐
- zt:如何显示中文化的打印预览对话框
- Linux技巧: Linux终端打印如何设置不同的颜色及显示方式
- MFC对话框初始化函数是在哪里?以及如何为MFC的EDIT控件设置默认显示值?
- PS如何设置打印尺寸显示图像和实际纸张大小一致
- Flex中如何设置Slider控件,使只有鼠标移动到HSlider/VSlider时才显示游标
- web开发,如何自动选定打印机进行打印(设置默认打印机打印)
- 在vs2008如何设置可以显示行号
- 如何设置Windows7系统文档批量打印的方法
- logback如何设置打印的日志信息的最大字段长度
- 调用DocumentProperties弹出打印设置对话框
- 如何实现基于MFC对话框的PCL显示(1)
- 开源:.NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现(一)
- 如何在对话框中显示一个位图
- 如何设置双显示器同时底部显示任务栏
- 外卖云打印机如何设置智能打印小票底部logo
- NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- MFC中如何判断对话框是否显示
- Windows7任务栏不能显示缩略图只显示文字是怎么回事?如何设置?
- 如何显示打印预览窗口
- Java中文件选择器JFileChooser使用(如何设置默认文件名,并在框中显示)小结