Модератор: Модераторы
системной библиотеке?можно ли как-то подсунуть ему стандартную папку?
сделать свой диалог выбора шрифтов.можно ли как-то
initialization
FormRegister:=TFormRegister.create;//<---указывает сюда
// иначе нет смысла
INIPropStorage1:=TINIPropStorage.Create(nil);
EditorFont:=TFont.Create;
ProgFont:=TFont.Create;// освобождение при финише ведет к ошибке!
FontLst:= TStringList.Create;
LoadFontList;
LoadSetting;
finalization
FreeAndNil(FormRegister);//финализация регистратора
//сохранение настроек сессии
SaveSetting;
FreeAndNil(FontLst);
INIPropStorage1.Free;
FreeAndNil(ProgFont);
FreeAndNil(EditorFont);
end.
constructor TFormRegister.create;
begin
dic:=TFormDictionary.create;//<---указывает сюда
end;
initialization
{$I styles.lrs}
FormData:=FormRegister.GetDefaultFormData;
FormData.FormCreateProc:=@CreateFStyle;
FormData.HumanReadableFormName:=rsStyleFormName;
FormRegister.RegisterForm('FStyle',FormData);//<---указывает сюда
finalization
FormRegister.UnRegisterForm('FStyle',FormData);
FormData.HumanReadableFormName:='';
FormData.FormName:='';
FormData.FormCreateProc:=nil;
end.
---------------------------
Error
---------------------------
Heap dump by heaptrc unit
57948 memory blocks allocated : 5861599/6022224
57944 memory blocks freed : 5861096/6021712
4 unfreed memory blocks : 503
True heap size : 950272 (80 used in System startup)
True free heap : 949376
Should be : 949424
Call trace for block $035300C8 size 392
$0042E756 TOPENADDRESSING$4$CRC99FE3619__REHASH, line 363 of inc/generics.dictionaries.inc
$0042E680 TOPENADDRESSING$4$CRC99FE3619__PREPAREADDINGITEM, line 230 of inc/generics.dictionaries.inc
$0042E966 TOPENADDRESSING$4$CRC99FE3619__DOADD, line 275 of inc/generics.dictionaries.inc
$00430570 TFORMREGISTER__REGISTERFORM, line 307 of global.pas
$0062BCD9 STYLES_$$_init$, line 150 of styles.pas
$0040FD16
$0064210D
$0061E2AE
Call trace for block $0355FB30 size 21
$00456083
$00430553 TFORMREGISTER__REGISTERFORM, line 307 of global.pas
$00628FF8 VIRTKEYBOARD_$$_init$, line 1087 of virtkeyboard.pas
$0040FD16
$0057B809
$0057AF1C
$0057A839
$0057ABC5
Call trace for bl
--------------------------
ОК
---------------------------
---------------------------
Error
---------------------------
Call trace for block $0 $0057B334
$0057A839
$0057ABC5
$0057AA86
$0057A6F3
$00642079
$0061E2AE
$0040FD16
Call trace for block $000D7918 size 48
$004303E0 TFORMREGISTER__CREATE, line 289 of global.pas
$00430698 GLOBAL_$$_init$, line 324 of global.pas
$0040FD16
---------------------------
ОК
---------------------------
procedure F_Save;
begin
case FMain.ComboLangCodePage.ItemIndex of
3:FEditors.Editors.Lines.SaveToFile(MyFile, FEditors.Encode.ANSI);
//Txt:=utf8tocp1251(FEditors.Editors.Lines.Text);
2:FEditors.Editors.Lines.SaveToFile(MyFile, FEditors.Encode.UTF8);
//Txt := FEditors.Editors.Lines.Text;
1:FEditors.Editors.Lines.SaveToFile(MyFile, FEditors.Encode.GetEncoding('KOI8'));//<<<---------косяк явно здесь
//txt := utf8toKOI8(FEditors.Editors.Lines.Text);
0:FEditors.Editors.Lines.SaveToFile(MyFile, FEditors.Encode.GetEncoding('CP866'));//<<<---------и здесь
//Txt := utf8toCP866 (FEditors.Editors.Lines.Text);
4:FEditors.SaveFTR(Utf8ToAnsi(MyFile));
end;
end;
---------------------------
Error
---------------------------
Heap dump by heaptrc unit
181378 memory blocks allocated : 21741669/22302576
181375 memory blocks freed : 21741597/22302504
3 unfreed memory blocks : 72
True heap size : 1474560 (80 used in System startup)
True free heap : 1474192
Should be : 1474216
Call trace for block $02609320 size 24
$0046063A
$00432074 F_SAVE, line 181 of main.pas
$004345EF MENUSAVEASCLICK, line 689 of main.pas
$00557944 CLICK, line 83 of include/menuitem.inc
$005580B5 DOCLICKED, line 280 of include/menuitem.inc
$0040DDF3
$005084E9 WINDOWPROC, line 2676 of win32/win32callback.inc
$0060B211 CUSTOMFORMWNDPROC, line 386 of win32/win32wsforms.pp
Call trace for block $025F9010 size 24
$0046063A
$00432016 F_SAVE, line 179 of main.pas
$004345EF MENUSAVEASCLICK, line 689 of main.pas
$00557944 CLICK, line 83 of include/menuitem.inc
$005580B5 DOCLICKED, line 280 of include/menuitem.inc
$0040DDF3
$005084E9 WINDOWPROC, line 2676 of win32/win32callback.inc
$0060B211 C
---------------------------
ОК
---------------------------
1:FEditors.Editors.Lines.SaveToFile(MyFile, TEncoding.GetEncoding('KOI8'));
....
procedure TFEditors.InsertImage(const FileName: string; const AImgSize: TSize);
Var
Res:Boolean;
APos:Integer;
begin
APos:=Edit.FEditors.Editors.SelStart;
Res:=InsertImageFromFile(Edit.FEditors.Editors, APos, FileName,AImgSize);
end;
.....
procedure TFImages.BtInsertImagesClick(Sender: TObject);
Var
Size:TSize;
begin
Size.cx:=SpinX.Value;
Size.cy:=SpinY.Value;
Edit.FEditors.InsertImage(OpenPictureDialog1.FileName, Size);
end;
Вернуться в Разработки на нашем сайте
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4