Hm, it's a real ugly hack I did and not object oriented at all. Something I have so far is a type for a button like this:
Code:
type TButton= record
x,y,width,height:integer;
caption:string;
id:integer;
clicked:boolean;
end;
I create a button the following way:
Code:
button :=createbutton (500,400,'QUIT');
Then I have to take care of the event loop (in a REPEAT...UNTIL loop):
Code:
if mouseonbutton (button) then begin
drawbuttonpressed (button);
button.clicked:=true;
end else begin
drawbutton (button);
end;
if button.clicked=true then begin
buttononlick();
button.clicked:=false;
end;
I know it's a rather ancient way to do so but for that kind of retro GUI sufficient enough (IMHO). The function mouseonbutton means that the mouse cursor is on the button and the left mouse button is pressed ...
New version with text input:
Bildschirmfoto vom 2014-07-15 20:50:03.jpg
Bookmarks