Results 1 to 10 of 14

Thread: Looking for simple GUI library/framework

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    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
    Last edited by Cybermonkey; 15-07-2014 at 06:51 PM. Reason: Added screenshot
    Best regards,
    Cybermonkey

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •