Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Please, don't deprecate FGL_WINBUTTON().  (Read 9217 times)
Enrico S.
Posts: 40


« on: September 02, 2019, 10:32:33 am »

Hi all.
I read on 3.20.05 compiler stdout ... "The 'fgl_winbutton()' function is supported for backward compatibility".
Then I found inside documentation ... "This function is provided for backward compatibility, use a menu with "dialog" style instead."

In my opinion the fgl_winbutton() function is much much powerful then e menu with "dialog" style.
Indeed it have an abstraction level unmatched by any kind of menu statement.

Think for instance to a such program fragment ...

IF upshift(fgl_winbutton(" ", "What do you want to do ?", "Nothing", "Breakfast|Lunch|Dinner|Just Drink|Nothing", "question", 0)) = "BREAKFAST" THEN ...

This allow the developer to show a powerful dialog just in one program row.
Several different fgl_winbutton() inside a program flow make very easy and fast write and maintain this kind of program logic.

Now imagine to change all this with several menus with "dialog" style: it is simply a drama because the MENU is unable to reproduce this kind of logic: it is static.
You need several functions each with an hardcoded menu to reproduce this kind of logic.
May be you could try to create a dynamic dialog to do something of similar, but at which cost ?

So, a MENU is not al alternative to FGL_WINBUTTON(), and I ask you to change your mind on that.

Does someone else agree with me on that, or am I wrong ?
Kind regards.
Enrico

Reuben B.
Four Js
Posts: 1119


« Reply #1 on: September 02, 2019, 11:13:55 am »

Enrico,

Have a look inside $FGLDIR/src/fgldialog.4gl.  Deep down fgl_winbutton, fgl_winquestion, fgl_winmessage is a MENU with STYLE="dialog" (almost).  The value for STYLE there has special meaning for the GDC but it has some negative behaviour.  It uses the system dialog which blocks which isn't desirable.

You can take that source and modify it for your requirements e.g. different title, language, icon etc, call it enrico_winbutton (or even fgl_winbutton if you place it higher up in our FGLLDPATH), place it in your library.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Enrico S.
Posts: 40


« Reply #2 on: September 02, 2019, 07:09:29 pm »

Hi, Reuben.
Thanks a lot for your explication.
I do extensive use of fgl_winbutton(), so I'll make a copy of the function to preserve the behavior for my programs (I don't use GDC anymore since a lot of time).

Best regards.
Enrico
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines