Главная страница
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.044 c
2-1151413170
Vovanchik
2006-06-27 16:59
2006.07.16
Работа с микрофоном (передача данных по сети)


2-1151421015
fast2
2006-06-27 19:10
2006.07.16
Как в Memo прочитать n-ю строку?


3-1147511930
vishnia
2006-05-13 13:18
2006.07.16
Почему не выполняется запрос - создание хранимой процедуры?


4-1144179410
in-tank
2006-04-04 23:36
2006.07.16
Системные параметры процесса


2-1151650837
Вьюга
2006-06-30 11:00
2006.07.16
Формы в Delphi