![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Процедура [D7]
Кирилл © (2005-06-06 10:51:00)Подскажите пожалуйста, как присвоить процедуре значение метода?
Кирилл (2005-06-06 11:10:00) [1]
> evvcom © (06.06.05 11:07) [6]
Всё работает, большое спасибо!
Digitman (2005-06-06 11:09:00) [2]MyProc: procedure of object;
evvcom (2005-06-06 11:07:00) [3]Var
MyProc: procedure of object;
Кирилл (2005-06-06 11:05:00) [4]У меня есть
Type
TMyClass= class
procedure MyMethod;
end;
Var
MyClass: TMyClass;
MyProc: procedure;
Хочу сделать
MyProc:=MyClass.MyMethod;
Но получается ошибка. Пробовал с указателями - тоже ничего не выходит
Ega23 (2005-06-06 11:01:00) [5]
function ShowTexLogFile(const aFileName:String):Boolean;
procedure BtnClearClick(Sender:TObject);
var
i:Integer;
_memo:TMemo;
begin
if (Sender is TForm) then
begin
With TForm(Sender) do
begin
for i:=0 to ComponentCount-1 do
if (Components[i] is TMemo) then
if UpperCase(TMemo(Components[i]).Name)=UpperCase('memSQLLogMonitor') then
begin
_memo:=TMemo(Components[i]);
_memo.Lines.Clear;
_memo.Lines.Add(' ');
_memo.Lines.SaveToFile(_memo.Hint);
Break;
end;
end;//With TForm(Sender) do
end;//if (Sender is TForm) then
end;//procedure BtnClearClick(
var
aForm:TForm;
aPanel:TPanel;
OnClearClick:TMethod;
List:TStringList;
i:Integer;
begin
Result:=False;
//if not FileExists(aFileName) then Exit;
try
Application.CreateForm(TForm, aForm);
try
With aForm do
begin
Caption:=aFileName;
BorderStyle:=bsSingle;
Height:=500;
Width:=750;
Position:=poScreenCenter;
end;
With TMemo.Create(aForm) do
begin
Parent:=aForm;
Name:='memSQLLogMonitor';
Align:=alClient;
ScrollBars:=ssBoth;
//Height:=440;
Clear;
Hint:=aFileName;
List:=TStringList.Create;
if FileExists(aFileName) then
begin
List.LoadFromFile(aFileName);
for i:=List.Count-1 downto 0 do Lines.Add(List.Strings[i]);
end;
List.Free;
end;
aPanel:=TPanel.Create(aForm);
With aPanel do
begin
Parent:=aForm;
Height:=45;
Align:=alBottom;
end;
With TButton.Create(aPanel) do
begin
Parent:=aPanel;
Cancel:=True;
Height:=25;
Width:=100;
Font.Size:=10;
Top:=10; //aPanel.ClientHeight-10;
Left:=aPanel.Width-110;
Anchors:=[akTop, akRight];
Caption:='Закрыть';
ModalResult:=mrOK;
end;
With TButton.Create(aPanel) do
begin
Parent:=aPanel;
Height:=25;
Width:=100;
Font.Size:=10;
Top:=10; //aPanel.ClientHeight-30;
Left:=aPanel.Width-220;
Anchors:=[akTop, akRight];
Caption:='Очистить';
OnClearClick.Code:=@BtnClearClick;
OnClearClick.Data:=aForm;
OnClick:=TNotifyEvent(OnClearClick);
end;
aForm.ShowModal;
finally
aForm.Free;
end;
except on E:Exception do
raise Exception.Create('ShowTexLogFile '+E.Message);
end;
end;
Digitman (2005-06-06 10:56:00) [6]в ран-тайм с назначением обработчиков событий "плаваешь" ?
Ozone (2005-06-06 10:53:00) [7]Расшифруй чего ты хочешь
Плохиш (2005-06-06 10:53:00) [8]Переведите на русский, пожалуйста.