Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Tue Nov 21, 2017 4:00 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: softkeyV2 and menus
PostPosted: Mon Jul 03, 2006 6:13 pm 
Offline

Joined: Thu Apr 13, 2006 3:17 pm
Posts: 41
Location: Milpits, CA
Hi,



I am using a G55 handheld.

I have a scenario for which I think softkeys with menu data will be a good fit. However I have some questions trying to use them. For instance in the following:



1. menu item-1 (option-1, option-2, etc)

2. menu item-2 (option-1, option-2, etc)

:

:

10. menu item-10 (option-1, option-2, etc)



I would have one softkey to represent each menu item?

Pressing each sofkey will display all the options once I fill out menudata?

How do I move up and down the options in menudata?

Is there a way to use the editor in the softKeyBarV2 to program the softkey menudata?

Do I select a hotkey, e.g., <enter> to select the option for a give menu item?



When I tried to just drop a softkeyV2 object inside an existing softkeybar, I did not see it appear, although I saw it in the object tree. How exactly should I be programming the menu data?



Is there some sample code?



Thanks,

Ata

_________________
Semiconductor EFEM products


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 05, 2006 8:14 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Ok, menus are a feature that is present, but Qlarity Foundry does not yet support.



The object support is complete which means that you can use them, but Qlarity Foundry does not have a GUI for them.



The first thing to understand, is that menu items are not soft key objects (nor any kind of object for that matter). Instead, a softkey may define a menu instead of directly handling a key press.



The first step is to enable advanced code, if you haven't already. To do this check Tools->Settings->Editor->"Show advanced code sections..."



This will enable a branch of the object tree called Internal. In Internal, all your softkeys will appear.



The next step is to define a menu for a soft key. First, create the softkeybar you want and the soft key on that bar that will contain the menu. Next, select that soft key from the Internal section of the object tree. In Layout View, you will notice that it has a menudata property. For now assign it the following value:

Code:
(Item A,,'A', 1;Item B,,'B', 2;Item C,(Sub Item A,,'A',11;Sub Item B,,'B',12;),'C', 3;Item D,,'D', 4;)


This will create a small 4 item menu, one of which triggers a sub menu. You can test this out in Simulation View.



The next step is to handle the event that notifies you when a menu item was selected. With the soft key object selected, go to code view. In the Events/Overrides drop list, add the item Selected event and try the following code:

Code:
func itemSelected(ID as integer)

    _print ("Item " + str(id) + " was selected")

endfunc





Now all that is left is for you to go back and modify the menuData property to match the menu you actually want and modify the itemSelected function to property react to the menu selection. This will probably be something in this format:

Code:
func itemSelected(ID as integer)

    if ID == 1 then

       'some code

    elseif ID == 2 then

        'some other code

    elseif id == 3

        'some final code

    endif

endfunc


_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 05, 2006 8:26 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Quote:
I would have one softkey to represent each menu item?


Well actually a single softkey can have a menu with numerous menu and sub menu items. Paste this into a menudata property to test: "(a, (a1,,,3;) ,,2;b,,,4;)".



Quote:
Pressing each sofkey will display all the options once I fill out menudata?


Yes pressing a softkey with a filled out menudata property in the right syntax will popup the menu.



Quote:
How do I move up and down the options in menudata?


Up and Down arrow keys.



Quote:
Is there a way to use the editor in the softKeyBarV2 to program the softkey menudata?


No



Quote:
Do I select a hotkey, e.g., <enter> to select the option for a give menu item?


Once you have the appropriate menu item selected you can press the <enter> key which will cause the itemselected event of the softkey to occur.



Quote:
When I tried to just drop a softkeyV2 object inside an existing softkeybar, I did not see it appear, although I saw it in the object tree. How exactly should I be programming the menu data?


To add a softkey to a softkeybar you must use the softkeylist property. Drag and drop will not work. You program the menudata using the menudata property. It requires that you enter a string in a specific format which is then parsed to create the menus at run-time. This is an advanced feature. Menu Data comes in the form of (caption, menudata, hot char, id;). As in this example: "(a, (a1,,,3;) ,,2;b,,,4;)" This will create 2 menus and 1 subment with captions a, b, and a1. I did not fill in the hot char property for any of these menus. To create submenus you embedd them in the menu declaration under the menudata section. Here's some more examples:



(menu item1,(submenu1,,,2;),,1;)



(menu item1,,,1;menu item2,,,2;menu item3,,,3;)



In the itemselected event you can use an if statement to determine which menu item was selected:



Code:

func itemSelected(ID as integer)

    if id == 1 then



    elseif id == 2 then



    elseif id == 3 then



    endif

endfunc





This is not a commonly used feature, in fact this is the first question I've had on the menudata property.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 11, 2006 9:43 am 
Offline

Joined: Thu Apr 13, 2006 3:17 pm
Posts: 41
Location: Milpits, CA
Thanks, that's working nicely.



I noticed that I could only use up to 10 items in the menu. For anything over 10 items, I ended up using a listbox that shows up as a result of pressing the softkey.



Ata

_________________
Semiconductor EFEM products


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 11, 2006 9:46 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Menu contents are limited by screen height (no scrolling support on the menus). If you need more than 10 items, you can consider breaking the items into sub menus, or using a list box as you already did.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: softkeyV2 and menus
PostPosted: Wed Feb 04, 2009 3:46 pm 
Offline

Joined: Thu Jan 17, 2008 6:51 am
Posts: 37
Location: Detroit, MI
Hello all,

I noticed the date of these posts...has this feature been completed?

_________________
---

Qlarity Foundry v2.5

BFF v1.023

Firmware v2.500


Top
 Profile  
 
 Post subject: Re: softkeyV2 and menus
PostPosted: Wed Feb 04, 2009 3:55 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
If your referring to the discussion of a gui for the menudata property, then nothing has been implemented.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
 Post subject: Re: softkeyV2 and menus
PostPosted: Wed Feb 04, 2009 3:57 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Well the menu feature is complete and supported. There is still no Qlarity Foundry GUI for easily creating and editing menu items. However the steps outlined in this post will work.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: softkeyV2 and menus
PostPosted: Thu Feb 05, 2009 8:35 am 
Offline

Joined: Thu Jan 17, 2008 6:51 am
Posts: 37
Location: Detroit, MI
Hmm...well, I've followed the instructions and I'm not seeing any menus when I press my button. I've got a series of listboxes that are enabled/disabled based on the item selected. When I enter my screen, I can see the default data displayed, and pressing the button, a down arrow, and enter changes the data, but I can't see anything happen with the menu...did I read the post wrong? I know there's no GUI to build the thing, but I should be seeing it, correct?

_________________
---

Qlarity Foundry v2.5

BFF v1.023

Firmware v2.500


Top
 Profile  
 
 Post subject: Re: softkeyV2 and menus
PostPosted: Thu Feb 05, 2009 8:44 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
I'll probably have to look at your application to get an idea what's going on. I'll send you my e-mail.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
 Post subject: Re: softkeyV2 and menus
PostPosted: Thu Feb 05, 2009 9:29 am 
Offline

Joined: Thu Jan 17, 2008 6:51 am
Posts: 37
Location: Detroit, MI
Actually, I found it...now I just need the menu to pop up instead of down...

_________________
---

Qlarity Foundry v2.5

BFF v1.023

Firmware v2.500


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group