Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Auckland, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Some help for a noob with buttons

    There has to be a way to do what I want to do but I'm fugged iif I know how. Here's the problem...

    A page has three frames - top, left and disp. Top and left contain a number of buttons that display another page in disp. All the buttons need to behave as one set of radio buttons; when a button is clicked any other button returns to the non-clicked state. The really awkward bit is there's an image in top that changes depending on the currently clicked button and that image is behind the buttons.

    Here it is in pseudocode of sorts.

    Code:
    On click button[n]
        Button[LastClicked].Image := Button[LastClicked].UnClickedImage;
        Button[n].Image := Button[n].ClickedImage;
        Top.Image := Button[n].TopImage;
    end;
    I hope that makes sense.

    If some kind soul has any idea of how to do that I'd be very grateful.

    Thanks.

    Simon.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,537
    Thanks
    77
    Thanked 4,381 Times in 4,346 Posts
    So the buttons show their state? That is, do they change from one color or text or image to another when they are clicked on and thus active?

    It would help if you'd show your HTML, even without the JS code.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Auckland, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    type BUTTON
    string: ImageFileName;
    string: ImageFileName;
    string: PageFileName;
    function ButtonClickHandler(BUTTON: Sender) integer;
    end;

    function ButtonClickHandler(BUTTON: sender) integer;
    integer: i;
    begin

    end;
    array [1..10] of BUTTON: buttons;
    Last edited by Trunkles; 09-25-2011 at 06:40 AM. Reason: 'Cos I didn't mean to post it!

  • #4
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Auckland, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    type BUTTON
             string: ImageFileName;
             string: ImageFileName;
             string: PageFileName;
             function ButtonClickHandler(BUTTON: Sender) integer;
    end;
    
    array [1..10] of BUTTON: buttons;
    
    function ButtonClickHandler(BUTTON: sender) integer;
    integer: i;
    begin
         for i := 1 to 10 do
         button[i].image := 
              
    end;

  • #5
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Auckland, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Argh! How do I delete the posts. :S

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,537
    Thanks
    77
    Thanked 4,381 Times in 4,346 Posts
    Could you answer my question??

    I think what you want is trivial, but I would *REALLY* like to see the HTML of the page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Auckland, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah... problem is... I haven't written the html yet. 'Cos I know the html isn't going to need Werner Von Braun so I decied to del with the sticky bit first. 90% of the coding takes 10% of the time.

    I haven't got all the images yet but I'll try and throw something together this evening and post a link to it on here.


  •  

    Posting Permissions

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