Главная страница
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.028 c
2-1151392582
fast2
2006-06-27 11:16
2006.07.16
Как в StringGrid e сделать ширину столбцов разными?


2-1151323955
lobach
2006-06-26 16:12
2006.07.16
Cgi


3-1147790931
Popoilyk
2006-05-16 18:48
2006.07.16
Импорт данных в DBGrid


3-1147557186
imbalanced
2006-05-14 01:53
2006.07.16
Работа с FireBird


3-1147335203
Stanislav
2006-05-11 12:13
2006.07.16
Кодировка в dbf