Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.07.16;
Скачать: CL | DM;

Вниз

Дата в StringGrid (Перенесена из Компоненты)   Найти похожие ветки 

 
PanIlya ©   (2006-06-02 12:23) [0]

Теxt  здесь:
http://delphimaster.net/view/5-1149152770/
Кое-что поменял:


procedure TDatePickerGrid.OnExitGrid(Sender: TObject);
var FParent: TWinControl;
begin
 inherited destroy; //Ушли из ячейки ничего не меняем
end;

procedure TDatePickerGrid.KeyPressEsc(Sender: TObject; var Key: Char);
var vFParent: TWinControl;
begin
 if key = #13 then begin //Enter Вводим значение
   vfparent := parent;
   (vFParent as TStringGrid).Cells[(vFParent as TStringGrid).Col,(vFParent as TStringGrid).Row] := datetostr(DateTime);
   inherited destroy;
 end;
 if key = #27 then inherited destroy; // Esc ничего

{здесь медод free может не работать есть подозрение что Key куда-то передается поэтому и вылетает ошибка => либо   inherited destroy
или так key = #0 затем free
как лучше, незнаю?}

end;

procedure TDatePickerGrid.RectSet; // так будет правильно
var vFParent: TWinControl;
   i : integer;
begin
  vfparent := parent;
  for i := 0 to (vFParent as TStringGrid).FixedCols-1 do
       Left := Left + (vFParent as TStringGrid).ColWidths[i];
  for i := (vFParent as TStringGrid).LeftCol to (vFParent as TStringGrid).Col-1 do
       Left := Left + (vFParent as TStringGrid).ColWidths[i]+1;

  Left :=  Left + (vFParent as TStringGrid).Left;

  for i := 0 to (vFParent as TStringGrid).FixedRows-1 do
       Top := Top + (vFParent as TStringGrid).RowHeights[i];
  for i := (vFParent as TStringGrid).TopRow to (vFParent as TStringGrid).Row-1 do
       Top := Top + (vFParent as TStringGrid).RowHeights[i]+1;

  Top := Top + (vFParent as TStringGrid).Top;

  Width := (vFParent as TStringGrid).ColWidths[(vFParent as TStringGrid).Col]+3;
  Height := (vFParent as TStringGrid).RowHeights[(vFParent as TStringGrid).row]+3;
end;


To: Юрий Зотов:
Ошибся,  извините,  с кем не бывает?


 
PanIlya ©   (2006-06-02 14:35) [1]

inherited destroy память не очищает!!!!
=>
заменить на:
key = #0;
free;

Или ???????



Страницы: 1 вся ветка

Текущий архив: 2006.07.16;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.029 c
1-1149120367
wsih
2006-06-01 04:06
2006.07.16
Печать нескольких страниц


6-1142322245
SKAyeR
2006-03-14 10:44
2006.07.16
Как получить список файлов находящихся в папке на удал. web серв


2-1151606996
Ivolg
2006-06-29 22:49
2006.07.16
PageControl


15-1150695068
ЮЮ
2006-06-19 09:31
2006.07.16
Куда мои 10$ делись?


6-1141723811
vcat
2006-03-07 12:30
2006.07.16
IDSMTP