Главная страница
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.027 c
15-1150318363
Petr V. Abramov
2006-06-15 00:52
2006.07.16
Сколько стоит доехать до Тимково на местном таксисте?


5-1135472981
sirin
2005-12-25 04:09
2006.07.16
Список классов, зарегестрированных в Delphi


2-1151579681
fast2
2006-06-29 15:14
2006.07.16
Как проверить, что переменная типаTDate "пустая", т.е....


15-1150556177
Vlad Oshin
2006-06-17 18:56
2006.07.16
любые числа +-*:


2-1151493908
shart
2006-06-28 15:25
2006.07.16
Как послать сообщение клиенту (Indy 9, Tcp)