parent
ee97a84884
commit
e8c5223f00
|
|
@ -1,5 +1,6 @@
|
||||||
type teditorform = class(TVCform) //±à¼Æ÷Ö÷´°¿Ú
|
type teditorform = class(TVCform) //±à¼Æ÷Ö÷´°¿Ú
|
||||||
uses utslvclauxiliary,tslvcl,UTslSynMemo,UtslCodeEditor;
|
uses utslvclauxiliary,tslvcl,UTslSynMemo,UtslCodeEditor;
|
||||||
|
const c_e_none = "None";
|
||||||
const c_e_ansi = "ANSI";
|
const c_e_ansi = "ANSI";
|
||||||
const c_e_utf8 = "UTF8";
|
const c_e_utf8 = "UTF8";
|
||||||
const c_e_utf8bom = "UTF8 BOM";
|
const c_e_utf8bom = "UTF8 BOM";
|
||||||
|
|
@ -136,19 +137,19 @@ type teditorform = class(TVCform) //
|
||||||
FEnCodeMenu := new TMenu(self);
|
FEnCodeMenu := new TMenu(self);
|
||||||
FEnCodeMenu.Caption := c_m_encode;
|
FEnCodeMenu.Caption := c_m_encode;
|
||||||
FCodeMenus := array();
|
FCodeMenus := array();
|
||||||
for i,v in array(c_e_ansi,c_e_utf8,c_e_utf8bom,c_e_ucs2big,c_e_ucs2little,c_e_separator,c_e_to_ansi,c_e_to_utf8,c_e_to_utf8bom,c_e_to_ucs2big,c_e_to_ucs2little) do
|
for i,v in array(c_e_None,c_e_ansi,c_e_utf8,c_e_utf8bom,c_e_ucs2big,c_e_ucs2little,c_e_separator,c_e_to_ansi,c_e_to_utf8,c_e_to_utf8bom,c_e_to_ucs2big,c_e_to_ucs2little) do
|
||||||
begin
|
begin
|
||||||
it := new TMenu(self);
|
it := new TMenu(self);
|
||||||
it.Caption := v;
|
it.Caption := v;
|
||||||
FCodeMenus[i] := it;
|
FCodeMenus[i] := it;
|
||||||
if v=c_e_separator then it.TSeparator := true;
|
if v=c_e_separator then it.TSeparator := true;
|
||||||
else
|
else
|
||||||
if v in array(c_e_ucs2big,c_e_ucs2little,c_e_utf8bom) then
|
if v in array(c_e_ucs2big,c_e_ucs2little,c_e_utf8bom) then
|
||||||
begin
|
|
||||||
it.Enabled := false;
|
|
||||||
end else
|
|
||||||
begin
|
begin
|
||||||
it.OnClick := thisfunction(ClickEnCodeMenu);
|
it.Enabled := false;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
it.OnClick := thisfunction(ClickEnCodeMenu);
|
||||||
end
|
end
|
||||||
it.Parent := FEnCodeMenu;
|
it.Parent := FEnCodeMenu;
|
||||||
end
|
end
|
||||||
|
|
@ -799,7 +800,7 @@ type teditorform = class(TVCform) //
|
||||||
bm := it.EnCode;
|
bm := it.EnCode;
|
||||||
for i,v in FCodeMenus do
|
for i,v in FCodeMenus do
|
||||||
begin
|
begin
|
||||||
if i>5 then break;
|
if i>6 then break;
|
||||||
if v.Caption = bm then
|
if v.Caption = bm then
|
||||||
begin
|
begin
|
||||||
v.Checked := true;
|
v.Checked := true;
|
||||||
|
|
|
||||||
|
|
@ -1403,6 +1403,7 @@ type TPageEditerItem=class(TPageItem)
|
||||||
function ToUnicode_big();
|
function ToUnicode_big();
|
||||||
begin
|
begin
|
||||||
if FEnCode="UCS2-big" then return;
|
if FEnCode="UCS2-big" then return;
|
||||||
|
if FEnCode = "None" then return ;
|
||||||
FEnCode := "UCS2-big";
|
FEnCode := "UCS2-big";
|
||||||
FEditer.ChangedFlag := true;
|
FEditer.ChangedFlag := true;
|
||||||
FLastVersion := "";
|
FLastVersion := "";
|
||||||
|
|
@ -1410,6 +1411,7 @@ type TPageEditerItem=class(TPageItem)
|
||||||
function ToUniocode_little();
|
function ToUniocode_little();
|
||||||
begin
|
begin
|
||||||
if FEnCode="UCS2-little" then return;
|
if FEnCode="UCS2-little" then return;
|
||||||
|
if FEnCode = "None" then return ;
|
||||||
FEnCode := "UCS2-little";
|
FEnCode := "UCS2-little";
|
||||||
FEditer.ChangedFlag := true;
|
FEditer.ChangedFlag := true;
|
||||||
FLastVersion := "";
|
FLastVersion := "";
|
||||||
|
|
@ -1417,6 +1419,7 @@ type TPageEditerItem=class(TPageItem)
|
||||||
function ToUTF8();
|
function ToUTF8();
|
||||||
begin
|
begin
|
||||||
if FEnCode="UTF8" then return;
|
if FEnCode="UTF8" then return;
|
||||||
|
if FEnCode = "None" then return ;
|
||||||
FEnCode := "UTF8";
|
FEnCode := "UTF8";
|
||||||
FEditer.ChangedFlag := true;
|
FEditer.ChangedFlag := true;
|
||||||
FLastVersion := "";
|
FLastVersion := "";
|
||||||
|
|
@ -1425,6 +1428,7 @@ type TPageEditerItem=class(TPageItem)
|
||||||
function ToUTF8BOM();
|
function ToUTF8BOM();
|
||||||
begin
|
begin
|
||||||
if FEnCode="UTF8 BOM" then return;
|
if FEnCode="UTF8 BOM" then return;
|
||||||
|
if FEnCode = "None" then return ;
|
||||||
FEditer.ChangedFlag := true;
|
FEditer.ChangedFlag := true;
|
||||||
FEnCode := "UTF8 BOM";
|
FEnCode := "UTF8 BOM";
|
||||||
FLastversion := "";
|
FLastversion := "";
|
||||||
|
|
@ -1432,6 +1436,7 @@ type TPageEditerItem=class(TPageItem)
|
||||||
function ToANSI();
|
function ToANSI();
|
||||||
begin
|
begin
|
||||||
if FEnCode="ANSI" then return;
|
if FEnCode="ANSI" then return;
|
||||||
|
if FEnCode = "None" then return ;
|
||||||
FEditer.ChangedFlag := true;
|
FEditer.ChangedFlag := true;
|
||||||
FEnCode := "ANSI";
|
FEnCode := "ANSI";
|
||||||
FLastversion := "";
|
FLastversion := "";
|
||||||
|
|
@ -1460,7 +1465,7 @@ type TPageEditerItem=class(TPageItem)
|
||||||
begin
|
begin
|
||||||
if not ifstring(s)then return;
|
if not ifstring(s)then return;
|
||||||
strcode := 0;
|
strcode := 0;
|
||||||
FEnCode := "ANSI";
|
FEnCode := "None";
|
||||||
if(length(s)>= 2)and ord(s[1])=0xFE and ord(s[2])=0xFF then //ucs2-big
|
if(length(s)>= 2)and ord(s[1])=0xFE and ord(s[2])=0xFF then //ucs2-big
|
||||||
begin
|
begin
|
||||||
strcode := 2;
|
strcode := 2;
|
||||||
|
|
@ -1502,12 +1507,19 @@ type TPageEditerItem=class(TPageItem)
|
||||||
FEnCode := "UTF8";
|
FEnCode := "UTF8";
|
||||||
strcode := 1;
|
strcode := 1;
|
||||||
s := utf8toansi(s);
|
s := utf8toansi(s);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if isTextGBK(s)=1 then
|
||||||
|
begin
|
||||||
|
FEnCode := "ANSI";
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
FLastVersion := s;
|
FLastVersion := s;
|
||||||
FEditer.Text := s;
|
FEditer.Text := s;
|
||||||
FEditer.ExecuteCommand(FEditer.ecGotoXY,array(1,1));
|
FEditer.ExecuteCommand(FEditer.ecGotoXY,array(1,1));
|
||||||
FEditer.ClearUndo();
|
FEditer.ClearUndo();
|
||||||
|
if FEnCode = "None" then FEditer.ReadOnly := true;
|
||||||
FEditer.ChangedFlag := false;
|
FEditer.ChangedFlag := false;
|
||||||
if not FTslSynText then return;
|
if not FTslSynText then return;
|
||||||
if not(s)then return;
|
if not(s)then return;
|
||||||
|
|
@ -6052,9 +6064,11 @@ type TFindWnd=class(TPage)
|
||||||
FCheck_subdir.parent := self;
|
FCheck_subdir.parent := self;
|
||||||
FCheck_reg.OnClick := function(o,e)
|
FCheck_reg.OnClick := function(o,e)
|
||||||
begin
|
begin
|
||||||
FCheck_revers.Enabled := not(o.Checked);
|
ck := o.Checked;
|
||||||
FCheck_wrap.Enabled := not(o.Checked);
|
FCheck_revers.Enabled := not(ck);
|
||||||
FCheck_case.Enabled := not(o.Checked);
|
FCheck_wrap.Enabled := not(ck);
|
||||||
|
//FCheck_case.Enabled := not(ck);
|
||||||
|
FCheck_cycle.Enabled := not(ck);
|
||||||
end
|
end
|
||||||
FStatus := new TStatusBar(self);
|
FStatus := new TStatusBar(self);
|
||||||
//FStatus.Align := alNone;
|
//FStatus.Align := alNone;
|
||||||
|
|
|
||||||
|
|
@ -3638,7 +3638,7 @@ begin
|
||||||
ordi <= 0xfe and
|
ordi <= 0xfe and
|
||||||
ordi2 >= 0x40 and
|
ordi2 >= 0x40 and
|
||||||
ordi2 <= 0xfe and
|
ordi2 <= 0xfe and
|
||||||
ordi2 <> 0xf7) then
|
ordi2 <> 0x7f) then
|
||||||
begin
|
begin
|
||||||
i += 2;
|
i += 2;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue