Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2003.09.08;
Скачать: [xml.tar.bz2];

Вниз

Кому делать нечего- найдите ошибку!   Найти похожие ветки 

 
Zmei-Gorin   (2002-12-30 11:01) [0]

Хелп!!! Выбрасывает РТ-Еррор... что я делаю не так???

program TestKOL;

uses
windows,
messages,
kol;

type
PMyObj = ^TMyObj;
TMyObj = object( TObj )
private
protected
public
procedure trayiconnotify(Sender: TObject; Message: Word);
procedure menuhandler( Sender: PMenu; Item: Integer );
end;

var O: PMyObj;
W: PControl;
ti:Ptrayicon;
m,m2:pmenu;
BOK,Edpath,BBrowse,EdTemplate:PControl;

{$R *.res}

procedure TMyObj.trayiconnotify(Sender: TObject; Message: Word);
var pt:Tpoint;
begin
case message of
WM_RBUTTONDOWN:
begin
GetCursorPos (Pt);
m.PopupEx(pt.X,pt.Y);
end;
WM_LBUTTONDBLCLK:
begin

end;
end;
end;

procedure tmyobj.menuhandler( Sender: PMenu; Item: Integer );
begin
ShowMessage(Int2Str(item));
{ case item of
0:;
2:;
3:begin
ti.Active:=false;
applet.Close;
( "Z-Copier")
Хелп!!! Выбрасывает РТ-Еррор... что я делаю не так???

program TestKOL;

uses
windows,
messages,
kol;

type
PMyObj = ^TMyObj;
TMyObj = object( TObj )
private
protected
public
procedure trayiconnotify(Sender: TObject; Message: Word);
procedure menuhandler( Sender: PMenu; Item: Integer );
end;

var O: PMyObj;
W: PControl;
ti:Ptrayicon;
m,m2:pmenu;
BOK,Edpath,BBrowse,EdTemplate:PControl;

{$R *.res}

procedure TMyObj.trayiconnotify(Sender: TObject; Message: Word);
var pt:Tpoint;
begin
case message of
WM_RBUTTONDOWN:
begin
GetCursorPos (Pt);
m.PopupEx(pt.X,pt.Y);
end;
WM_LBUTTONDBLCLK:
begin

end;
end;
end;

procedure tmyobj.menuhandler( Sender: PMenu; Item: Integer );
begin
ShowMessage(Int2Str(item));
{ case item of
0:;
2:;
3:begin
ti.Active:=false;
applet.Close;
end;
end; }
end;

procedure TestObjs;
begin
applet := newapplet("Z-Copier");
applet.Hide;
w:=newform(applet,"Z-Copier");
w.Width:=345;
w.Height:=250;
w.CanResize:=false;
W.CenterOnParent;

BOK:=newbutton(w,"OK");
BOK.Font.FontHeight:=11;
bok.Top:=193;
bok.Left:=270;

BBrowse:=NewButton(w,"...");
BBrowse.Font.FontHeight:=11;
BBrowse.Top:=3;
BBrowse.Left:=313;
BBrowse.Width:=20;
BBrowse.Height:=20;

edpath:=NewEditbox(w,[]);
edpath.Font.FontHeight:=11;
Edpath.Color:=clwhite;
Edpath.Width:=310;

EdTemplate:=NewEditbox(w,[eoMultiline,eoWantReturn]);
EdTemplate.Font.FontHeight:=11;
EdTemplate.Color:=clwhite;
EdTemplate.Width:=330;
EdTemplate.Height:=160;
EdTemplate.Top:=30;// если закомментировать-работает.


ti:=NewTrayIcon(w,loadicon(0,IDI_WINLOGO));
ti.Active:=true;
ti.Tooltip:="Z-Copier";
ti.OnMouse:=o.trayiconnotify;
// m2:=newmenu(w,20,[],o.menuhandler);
m:=newmenu(nil,10,["1"],o.menuhandler);//или если третий параметр [], то работает
Run( applet );
end;

begin
New( O, Create );
TestObjs;
end.



 
mdw   (2002-12-30 14:53) [1]

Вместо
m:=newmenu(nil,10,["1"],o.menuhandler);

Напиши
NewMenu( w, 0, [ "" ], nil );
m:= newmenu(w, 10, ["1", ""], o.menuhandler);

...и будет счастье...:)))



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2003.09.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.009 c
6-24585
MGA
2003-05-05 18:37
2003.09.08
Контроль печати сетевого принтера - КАК ?


1-24445
boband
2003-08-25 17:06
2003.09.08
Создание редактора свойств в Delphi 6


1-24524
SEN
2003-08-26 23:20
2003.09.08
TMemo


1-24417
AlexLP
2003-08-26 09:55
2003.09.08
FileSize


6-24572
alak
2003-06-30 10:00
2003.09.08
Pagecontrol and webbrowser





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский