Latest versions
...
Menu  Language: fr
Search




Articles & Documents

Close Tutorials

Preferences

Connect again
---

Your name (or pseudo) :

Your secret code (associated with your pseudo)


 Count of members 459 members


Connected :

(nobody)
CPDB.Net

Friends News
Google Ads
Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
24 Subscribers
Webmaster - Infos
Visits

   visitors

   visitors online

Pagerank
forum.gifForum - ppCompiler [EN] - Topic #9

Forum - Forum
ppCompiler [EN] - ppCompiler [EN]


active  Topic # 9  Writing a DA with PP

23/02/2009 @ 23:47
by enotar

Anonymous



I use the code post here sometimes ago but it stop on compiling at the red line saying "Duplicate frmhandleevent":

Why and how can I fix it?    d

Thank you very much

{$r FirstDA.rsrc}
{$code DAcc,DA01,code,1000}
// DA01 est le CreatorID

Program FirstDA;
{$­­i PalmAPI.pas}
Const
FORM1=1000;

function FrmHandleEvent(formP:FormPtr;var event:EventType):boolean;inline(SYSTRAP,$­A17A);
procedure EvtAddEventToQueue(const event:EventType);inline(SYSTRAP,$­­A11B);

function HandleEvent(var evt:EventType):boolean;
var
frmP : FormPtr;
begin
frmP:=FrmGetActiveForm;
HandleEvent:=false;

case evt.eType of

appStopEvent:
begin
EvtAddEventToQueue(evt);
HandleEvent:=true;
end;


ctlSelectEvent:
begin
WinDrawChars('Hello World !',13,20,20);
end;

penDownEvent:
begin
if (evt.ScreenX<1) or (evt.ScreenX>100) or (evt.ScreenY<1) or (evt.ScreenY>80) then HandleEvent:=true;
end;
end;
end;

procedure AppEventLoop;
var
evt : EventType;
done : boolean;
begin
repeat
EvtGetEvent(evt,evtWaitForever);
if not SysHandleEvent(evt) then
if not FrmHandleEvent(FrmGetActiveForm,evt) then
done:=HandleEvent(evt);
until (evt.eType=appStopEvent) or (done=true);
end;

Var
form:FormPtr;
evt : EventType;
begin

form := FrmInitForm(FORM1);
FrmSetActiveForm(form);
FrmDrawForm(form);

AppEventLoop;

FrmEraseForm(form);
FrmDeleteForm(form);

end.


enotar

Write to enotar   Post an answer  Top
Answer n 1
--------
24/02/2009 @ 00:00
by enotar

Anonymous


I didnt find another way to suscribe to this thread beside answering! l

Maybe there is a way arround

 

tkz 


enotar

Write to enotar   Post an answer  Top
Answer n 2
--------
24/02/2009 @ 00:29
by Philippe

Anonymous


FrmHandleEvent has been added to PalmAPI1.pas. Just delete the red line.
Write to Philippe   Post an answer  Top
Answer n 3
--------
24/02/2009 @ 00:58
by enotar

enotar


It works now

 

Tkze


enotar

Write to enotar   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 




^ Top ^