您的位置:学习中国 推荐教程 Delphi 正文
原作者:酷酷 添加时间:2007-06-25 原文发表:2007-06-25 人气:124 来源:互联网

本文章共2039字,分2页,当前第1页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《RAVE中MEMO中文断行乱码问题的完美解决》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------

delphi7所附Rave5之Memo控件,在中文一行不能打印完时能够自动断行,但不能按整字来断
行,有时一个中文字会被截断,造成下行的混乱.

      問題已經被我完美解決!请下载 Nevrona Rave V5.1.2 BEX Full Sources For
Delphi BCB。
   
    先卸载原来delphi7中的Rave V5.0.8,然后通过运行Rave V5.1.2 BEX Full Sources中
的SETUP来安装,安装后从组件中包中再将其卸载,再打开C:\Rave5\Source\dclRave.dpk重
新编译安装。
    請把RpMemo.pas文件中的TMemoBuf.GetLine函數進行如下的脩改。然后重新編譯
RvCore.dpk包。把編譯獲得的RvCore50.bpl拷貝到Rave.exe對應的目錄即可!学习中国

function TMemoBuf.GetLine( Width: longint;
var Eol: boolean): string;
var
TestWidth: longint;
SavePos: longint;
NewWord: string;
S1: string;
S2: string;
StartPos: longint;
FormatState: TFormatState;
StartState: string;
AdjWidth: longint;
FirstLine: boolean;

//SCYANGYU ************** Start **************
Function CurLineEndHalfCHS(Const CurLineStr:String):Boolean;
Var
bIsDBCS:Boolean;
jLength,jFor:Integer;
Begin
bIsDBCS := False;
jLength:=Length(CurLineStr);
for jFor := 1 to jLength do
begin
if bIsDBCS then
bIsDBCS := False
else
Begin
if Windows.IsDBCSLeadByte(byte(CurLineStr[jFor])) then
bIsDBCS := True;
End;
end; //end of for
Result:=bIsDBCS;
End;
//SCYANGYU ************** End **************

begin { GetLine }
{ Get a line of text that will fit within PrintStart to PrintEnd }
EOL := false;
NewLine := true;
StartPos := -1;
S1 := '';
S2 := '';
StartState := '';
Result := '';
FirstLine := NewParagraph;
AdjWidth := Width;

repeat
SavePos := FPos; { Save off current position}
NewWord := GetWord; { Get next word }

if StartPos < 0 then
begin { Initial run through }
StartPos := NonSpacePos;
if HasRPTF then
begin { Get state of line start }
FormatState := GetStateAtPos(SavePos);
StartState := StateToRPTF(FormatState);
if FirstLine then
begin
LeftIndent := FormatState.Para.FirstIndent + FormatState.Para.LeftIndent;
end
else
begin
LeftIndent := FormatState.Para.LeftIndent;
end; { else }
RightIndent := FormatState.Para.RightIndent;
AdjWidth := Width - Round((LeftIndent + RightIndent) * BaseReport.XDPI);
if AdjWidth < BaseReport.XDPI then
begin { Don't allow width less than 1" }
AdjWidth := BaseReport.XDPI;
end; { if }
end; { if }
end; { if }

if (NewWord = #13) or (NewWord = '') then
begin { Finish off line }
EOL := true;
if Result = '' then
begin
Result := StartState;
end; { if }
Break;
end
else
begin { Test width with new word }
S2 := S2 + NewWord;
S1 := StartState + FillRPTF(S2,StartPos);

if System.Pos(RPTFPrefix,S1) = 0 then
begin
TestWidth := SimpleTextWidth(BaseReport,S1,0);
end
else
begin
TestWidth := RPTFTextWidth(BaseReport,S1);
end; { else }

if TestWidth <= AdjWidth then
begin { Add new word }
Result := S1;
end
else
begin
{ Reset position to before this word}
FPos := SavePos;
end; { else }

if TestWidth >= AdjWidth then
begin
if UnformatLen(Result) = 0 then
begin { First word was too long, cut it down }
 
本文章更多内容1 - 2 - 下一页>>
本页地址
收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签]
               
[搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘]
相关文章

如何显示中文化的打印预览对话框
制作好的Rave报表文件如何打包到EXE文件里
Jmail的主要参数列表
报表设计从C/S到B/S结构的一次变革
Cell组件插件报表工具-让报表二次开发更轻松
Visual Graph助企业开发图形应用系统
在Delphi2006上安装ReportBuilder9.01
水晶报表控件在Delphi6下的安装过程
在Listbox加背景图
Delphi7目录结构----初学者参考
将页面设置为横向
字符串列表及应用(一)
字符串列表及应用(二)
文本编辑器的设计(一)
文本编辑器的设计(二)
Delphi图形图像编程(一)
Delphi图形图像编程(二)
文件管理(一)
文件管理(二)
文件管理(三)

相关评论


本文章所属分类:首页 推荐教程 Delphi   Delphi