Subject Re: Pushbuttons
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Wed, 18 Sep 2019 10:09:25 -0700
Newsgroups dbase.getting-started

On 9/18/2019 7:32 AM, Akshat Kapoor wrote:
> On 18/09/2019 17:57, Emeka Ossai wrote:
>> I need assistance on how I can achieve what I have explained.
>>
>> Emeka
>
> You have 405 option from which you want to select 1.
> Shortlisting these with the help of pushbuttons is hell of a task.
> Leave apart the user it would be hell of a task for the programmer
> placing so many pushbuttons on the form.
>
> The way you have suggested would involve displaying the pushbuttons and
> hiding them. For Eg. clicking on Rice would dim the rest of the
> pushbuttons and display the new options required.
>
> Enabling/disabling such large number of buttons/ containers would be a
> task in itself and highly prone to typos.

Yes. The better way to handle this is polymorphism. Take a look at the
way the calendars are set up in the DUFLP.

You change the month, the text changes for each button on the calendar,
in some cases colors change, and more.

The basic idea then would be you click option 1, and the buttons all
change based on that. It would take work setting everything up in
tables, but it will point you in the right direction ... I would do
everything via tables. One for the main menu options, another for all
the submenu options. The tables would link on the main menu:

1 Main Menu
2 Rice Menu
3 Chicken Menu

The submenu table would link on the number, so when you clicked 2, the
buttons would change to display anything in the rice submenu ...

It will be time-consuming, but if done properly the code itself wouldn't
be all that complex.

Ken


--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm