Solved

creating an interface

Posted on 1998-08-10
3
123 Views
Last Modified: 2010-04-04
I would like to create an interface whereby one has 3 options to select. Each option will call a separate procedure. How could I do this on Delphi 1?
Please, I have already created a form in which the open dialog icon is used to read a set of data into a record.
Thank you
0
Comment
Question by:liau080698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
erajoj earned 20 total points
ID: 1361848
Hi,
How would you like to visualise these options? Radiobuttons?
If so...
1. Set the first radiobutton's Tag property to 1, the second's to 2 and so on...
2. Select the first radiobutton. In the object inspector, on tab "Events" write (for instance) "OptionClick" in the "OnClick" combobox and press enter.
3. Write something like this:
  procedure TForm1.OptionClick(Sender: TObject);
  begin
    // your code begins here
    if not ( Sender is TRadioButton ) then Exit; // not a valid option
    case ( Sender as TRadioButton ).Tag of
      1: ; // option 1
      2: ; // option 2
      3: ; // option 3
    end;
    // or...
    // MyOption := ( Sender as TRadioButton ).Tag;
    // ...and ends here
  end;
4. Then mark all the other radiobuttons and select the "OptionClick" event in "OnClick" combobox in the object inspector and press enter.
5. Run the project...

Done!

/// John
0
 

Expert Comment

by:andrewjackson
ID: 1361849
erajoj has given one possible solution using radio buttons but you could simply have 3 buttons or menus each with their own OnClick event.  It really depends on what you are trying to do.

Look at other Windows application for inspiration.  If the options are something like 'Accept', 'Reject', 'Cancel' or 'Create', 'Delete', 'Edit' then I think 3 buttons / menus are better than radio buttons.
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1361850
Yes, menus and buttons are probably better in most cases, but the radiobutton example contains some simple tricks is/as/tag that can be useful and besides; the "mode d'emploi" isn't very different in the button/menu case.

/// John
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question