Главная страница
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.054 c
10-1122298976
Max4
2005-07-25 17:42
2006.07.16
Excel


6-1141205877
Krolevetsky_Dmitry
2006-03-01 12:37
2006.07.16
Перехват потока


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


2-1151336611
b.o.n.d.007
2006-06-26 19:43
2006.07.16
Не понимаю циклы. Помогите.


3-1147586181
Sphinx
2006-05-14 09:56
2006.07.16
Минимальные сис.требования Microsoft Jet OLEDB 4.0