How to build menu like old ACHOICE function?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mol
Posts: 3253
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 235 times
Been thanked: 132 times
Contact:

How to build menu like old ACHOICE function?

Post by mol » Tue Feb 23, 2010 1:58 pm

Hi guys!
I want to place on the form menu, which should look and work like old ACHOICE function.

I've tried to use grid or listbox::

Code: Select all

	aMenuMain := {;
		{"Opcja 1"} , ;
		{"Opcja 2"} , ;
		{"Opcja 3"} ,;
		{"Opcja 4"} ,;
		{"Opcja 5"} }
		
	aMenuList := {"Opcja1","Opcja 2", "Opcja 3", "Opcja4", "Opcja 5", "Opcja 6", "Opcja 7", "Opcja 8", "Opcja 9", "Opcja 10", "Opcja 11" }

		@ 10,10 GRID Grid_1 ;
			WIDTH 400 ;
			HEIGHT 20*(len(aMenuMain)+1) ;
			HEADERS {'MENU MAIN'};
			ITEMS aMenuMain ;
			WIDTHS {400};
			COLUMNCONTROLS { aCtrl_1 } ;
			On DblClick	WyborOpcji() 

		@ 10,500 LISTBOX L_1 ;
			WIDTH 200 ;
			HEIGHT 20*(len(aMenuList)) ;		
			ITEMS aMenuList;
			FONT "ARIAL CE" SIZE 11;
			On DblClick WyborZListy()
It looks and works similar.
But - at right side scrollbar always appears - I don't want it.

Has anybody any idea (or working code) how to realise it?

Best regards, Marek

User avatar
luisvasquezcl
Posts: 1146
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 14 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Tue Feb 23, 2010 2:54 pm

Hi Mol,
You can make a list of labels to display the menu.
I can not imagine anything better. :?
best regards,
luis vasquez

User avatar
luisvasquezcl
Posts: 1146
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 14 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Tue Feb 23, 2010 3:03 pm

Hi Mol,
some time ago I did a test with a menu label + picture ... I did not like much, but they are testing to do.
best regards
luis vasquez
Attachments
imagen.JPG
imagen.JPG (13.61 KiB) Viewed 2799 times

User avatar
mol
Posts: 3253
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 235 times
Been thanked: 132 times
Contact:

Post by mol » Tue Feb 23, 2010 6:42 pm

but, how to navigate with keyboard?
Marek

User avatar
luisvasquezcl
Posts: 1146
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 14 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Wed Feb 24, 2010 1:49 am

Good question marek .... :?:
I made east example to prove visually like quedaria and without worrying to me more about another thing than that. in order to execute the event onclick of label podria to be used ON KEY… it's only one idea.
best regards,
luis vasquez.

User avatar
mol
Posts: 3253
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 235 times
Been thanked: 132 times
Contact:

Post by mol » Wed Feb 24, 2010 6:27 am

It will be difficult to realise with ON KEY, because I'm using .dbf file to store menu tree. And all menus are builded during runtime.
Most of all, I had arrow keys on my mind...

User avatar
mol
Posts: 3253
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 235 times
Been thanked: 132 times
Contact:

Post by mol » Wed Feb 24, 2010 2:11 pm

I'm sure, Rathi has possibilities to build such a user component like achoice menu.

What do you think, Rathi?

jucar_es
Posts: 77
Joined: Thu Nov 13, 2008 11:12 pm

Post by jucar_es » Wed Feb 24, 2010 7:12 pm

adjunto una funcion que yo uso la cual puede adaptar facilmente,


espero le sea util
Attachments
P_CHOICE.zip
(774 Bytes) Downloaded 249 times

User avatar
mol
Posts: 3253
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 235 times
Been thanked: 132 times
Contact:

Post by mol » Wed Feb 24, 2010 7:43 pm

Fine working!
Many thanks!
But still, it isn't what I'm want...

regards, Marek

User avatar
mol
Posts: 3253
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 235 times
Been thanked: 132 times
Contact:

Post by mol » Thu Feb 25, 2010 11:15 am

I have a question to Roberto:
Is it possible to define listbox without scrollbar?

Post Reply