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: Menu System  (Read 11498 times)
Carl P.
Posts: 14


« on: April 11, 2011, 03:37:19 pm »

Hello,

I've been trying to write a menu system in Genero. The idea is to have an input field with a display array underneath it. The user types part of a menu option and the display array refreshes to just show the appropriate matches. They then just have to hit enter to move into the display array and then enter again on the option that they want.

It's almost working. You type and after a second the list will refresh, but it seems to stutter. I think I can see what it's doing. It has a second to remove any non-matching items from the array before it has to go around the dialog loop again.

There has to be a way to update the entire array in one go but I can't see how.

This menu is going to be used to select screens within a module and there could easily be over 40 screens.

What do other people use for a menu system?

Thanks,

Carl

* quick_menu.per (0.75 KB - downloaded 647 times.)
* quick_menu.4gl (3.19 KB - downloaded 667 times.)
* quick_menu.txt (0.13 KB - downloaded 734 times.)
Reuben B.
Four Js
Posts: 1062


« Reply #1 on: April 12, 2011, 02:03:32 am »

> There has to be a way to update the entire array in one go but I can't see how.

Change your FOR loop to be ...

FOR i = l_max_array TO 1 STEP -1

... so that it only requires one parse over the array.

When you have
FOR i = 1 TO l_max_array
   CALL menu_list.deleteElement(i)

What was i+1 is now i but this element will never get processed as next time round the loop counter has increased.



I've attached an example I have which did something similar utilising ON ACTION dialogtouched.  In that case I cleared the array and repopulated it each time as I had to consider the case of the user deleting what they had typed.  You might need to consider that as well.


 




> What do other people use for a menu system?

Start menu https://4js.com/online_documentation/fjs-fgl-manual-html/User/StartMenus.html
Tree Widget https://4js.com/online_documentation/fjs-fgl-manual-html/User/TreeViews.html
MDI https://4js.com/online_documentation/fjs-fgl-manual-html/User/MDIWindows.html
3rd party menu systems :-(
Haven't seen one utilising cover flow yet https://4js.com/online_documentation/fjs-gdc-manual-html/User/NewFeatures220.html#220TablePFlow

To a great extent it depends on what their existing character based menu system was and how they chose to move forward.

* dialogtouched.4gl (10.05 KB - downloaded 672 times.)
* dialogtouched.4st (0.43 KB - downloaded 635 times.)
* dialogtouched.per (0.58 KB - downloaded 633 times.)

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


« Reply #2 on: April 12, 2011, 11:42:09 am »

Thanks Reuben, that's worked really well.

I've changed my menu to use dialogtouched and to add the selected items to the list instead of deleting them.

> To a great extent it depends on what their existing character based menu system was and how they chose to move forward.

I've set-up our main menu to use the tree widget and also this quick menu. This quick menu is for users who know what option they want but don't want to navigate down a tree to find it.

Our existing application just displays a two column list of options with a corresponding number. You enter the two digit number to select the option. When I first saw it 10 years ago I thought that it was old fashioned.

Thanks,

Carl
Sebastien F.
Four Js
Posts: 509


« Reply #3 on: April 12, 2011, 12:00:42 pm »

You should consider using a treeview to organize the programs in groups and sub-groups, with specific icons... on the right of the treeview, you could have some panel with a description of the program, and other info (for ex, user rights to use the program...).

If you make it configurable, the end user could even create his own treeview node with drag&drop, to build a group of most used programs...

Seb
Carl P.
Posts: 14


« Reply #4 on: February 08, 2012, 01:18:35 pm »

Hi I'm back,

My little quick menu worked fine for 8 months.

Last week our 'management' decided to force our clients to use the Web Client instead of the Desktop Client. This was after spending 9 months converting 800 forms and the day before we were due to start testing.

I found that my quick menu in the Web Client now doesn't work. It gets to the ON ACTION accept in the INPUT but then can't jump to the DISPLAY ARRAY when they hit return out of the INPUT FIELD.

Any help, again, would be appreciated.

I'm using BDL and GAW 2.40.

Thanks,

Carl

* quick_menu.4gl (4.76 KB - downloaded 647 times.)
* quick_menu.per (0.97 KB - downloaded 641 times.)
* quick_menu.txt (0.15 KB - downloaded 658 times.)
Sisavanh S.
Four Js
Posts: 80


« Reply #5 on: February 08, 2012, 02:24:39 pm »

Hi,

It is rather a support issue. May I ask you to contact your local support center ?
Tell them which GWC set you are using (GWC-SL, GWC-AJAX, ...) and which browser you have tested.

With latest GAS 2.40 (set AJAX), I can enter the display array by hitting enter outside of the input field using IE8 and Firefox 10.

Many regards,

Reuben B.
Four Js
Posts: 1062


« Reply #6 on: February 08, 2012, 11:32:10 pm »

Carl,

... your program sort of worked for me as well.  One thing I did notice though was in your code, the last line here ...

Code
  1.         DIALOG ATTRIBUTES ( UNBUFFERED, FIELD ORDER FORM )
  2. INPUT BY NAME menu_option
  3. ON ACTION dialogtouched
  4. IF DIALOG.getCurrentItem() = "menu_option" THEN
  5. CALL selected_submenu.clear()
  6.  
  7. FOR i = 1 TO submenu.getLength()
  8. LET l_item = UPSHIFT( submenu[ i ].screen_desc )
  9. LET l_option = UPSHIFT( menu_option )

... that should be

LET l_option = UPSHIFT(FGL_DIALOG_GETBUFFER())

(and you could move it before the FOR loop as the value doesn't change each iteration)

In ON ACTION dialogtouched, the current field won't be populated with what the user has typed in, when using UNBUFFERED.  To get what has been typed in so far, use FGL_DIALOG_GETBUFFER().  For reason why, consider what would happen if the field was a DATE and how the date field would be populated after typing one character.

If you still have an issue, perhaps post your .4ad (or use the default.4ad in FGLDIR/lib/default.4ad).  Make sure that the dialogtouched action has validate="no" defined

Hope that helps,

Reuben

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


« Reply #7 on: February 09, 2012, 12:03:10 pm »

Reuben,

I've made that change to the code. I added validate="no" to the dialogtouched in default.4ad and it still didn't work.

I copied the Four Js default.4ad from FGLDIR/lib and it works!

I've attached my default.4ad file. Can you see anything obvious in that file that could still be causing a problem?

If you can't then I'll just take the FGLDIR/lib file, add 3 of my actions then test it, make 3 changes then test it, until I find out where the problem is.

Thanks for your help,

Carl

* default.4ad (3.38 KB - downloaded 654 times.)
Reuben B.
Four Js
Posts: 1062


« Reply #8 on: February 10, 2012, 03:03:08 am »

Quote
I've attached my default.4ad file. Can you see anything obvious in that file that could still be causing a problem

You are missing some actions that are defined in FGLDIR/lib/default.4ad and the run-time is probably expecting to be defined.  Adding editcopy,editcut, editpaste to your .4ad seems to make the program function as expected.  Exactly, why I don't know.

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


« Reply #9 on: February 10, 2012, 10:42:48 am »

Thanks Reuben. That worked fine.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines