Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

MainMenu manipulation library

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 12-10-2010, 06:02 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

It does work, look at post #84 onwards here http://www.basic4ppc.com/forum/addit...braries-9.html

However you need the latest MainMenu library if you are merging it.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #22 (permalink)  
Old 01-28-2011, 11:50 AM
Senior Member
 
Join Date: Dec 2007
Posts: 149
Awards Showcase
Beta Tester Beta Tester 
Total Awards: 2
Default How to toggle the checked property

Hello Agraham,
I've recreated the Menu structure of my SqLite Desktop application with Maimenu.dll. I hoped that it is an easy way to use additional features, like the checked property and have more functionalty.
I have a Main menu called "Abfragen"(querries), that holds some Menufunctions like "Neu"(new),"öffnen"(open),"Ausführen"(run),"lösche n"(delete) and the querries that are saved in the database. In german it looks like the attached picture.
Now I want to toggle the checked properties of the menu items that holds the querrynames in it, so that the functions above refer to the choosed querry.
I tried something like this, with no success:
In the Menu Popup event I get the count of menus and save the Items
Sub FEx1Men1_Popup
.
.
.
MenC = FEx1Men1.MenuCount
FEx1Men.SaveMenuItem(FEx1Men1.ControlRef, 2)
.
.
End Sub

If a menu was clicked I select the menu.text.
If it is an enty larger than seven I want to check the selected and uncheck the others.

Case 2
Select FEx1Men1.Text
Case "Neue Abfrage"
Quer.Qer_Start
Case "Abfrage öffnen"
Msgbox("Abfrage öffnen")
Case "Abfrage ausführen"
If EINIT = True AND Conv.EditEx1.Text = "Abfrage" Then
If Conv.TBEdit.Text <> "" Then
SqlStr = Conv.TBEdit.Text
FiNa = AktQer
Conv.EditEx1.Close
If MakeQeryTab(SqlStr, FiNa)= True Then
GetParams(FiNa)
fo.FormGrid_Start
End If
End If
End If
Case "Abfrage speichern"
If EINIT = True Then
cdummy = QIn.Show("Name: ", "Abfrage", "", -1, 30)
AktQer = cdummy
QerText = Conv.TBEdit.Text
MakeQerTab
End If
Case "Abfrage löschen"
QerErase(AktQer)
Case Else
AktQer = FEx1Men1.Text
FEx1Men2.ControlRef = FEx1Men1.ControlRef
For i = 7 To MenC-1 'MenC = MenC = FEx1Men1.MenuCount = 16; 7=begin of querry names
FEx1Men1.ControlRef = FEx1Men1.SavedMenuItem(i)
FEx1Men3.ControlRef = FEx1Men1.ControlRef
FEx1Men3.Checked(False)
Next
FEx1Men2.Checked = True
.
.
.
End Sub

This one try of many but I don't know how to set a not selected Menu Item as the actual Item, to set the property.
Could you help? Or isn't it possible with this DLL?

Best regards

berndgoedecke
Attached Images
File Type: jpg SQLMenu.JPG (22.8 KB, 9 views)
Reply With Quote
  #23 (permalink)  
Old 01-28-2011, 12:23 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Code:
MenuItem1.Checked(False)
Should be
Code:
MenuItem1.Checked = False
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #24 (permalink)  
Old 01-28-2011, 12:43 PM
Senior Member
 
Join Date: Dec 2007
Posts: 149
Awards Showcase
Beta Tester Beta Tester 
Total Awards: 2
Default

This is one of the possibilties I've allready tested.
The best solution in my opinion is something like that:
For i = 7 To MenC-1 'MenC = MenC = FEx1Men1.MenuCount = 16
FEx1Men3.ControlRef = FEx1Men3.GetMenuItem(i)
FEx1Men3.Checked = False
Next
FEx1Men2.Checked = True
But it throws th attached error although FEx1Men3 is declared.
Do you have another idea?
Attached Images
File Type: jpg MenuErr.JPG (19.6 KB, 4 views)
Reply With Quote
  #25 (permalink)  
Old 01-28-2011, 12:53 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Code:
FEx1Men3.ControlRef = FEx1Men3.GetMenuItem(i)
This line is wrong. You need a separate MenuItem. At the moment you are trying to walk deeper into the menu tree with every iteration.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #26 (permalink)  
Old 01-31-2011, 08:20 AM
Senior Member
 
Join Date: Dec 2007
Posts: 149
Awards Showcase
Beta Tester Beta Tester 
Total Awards: 2
Default I've got it

Hello Agraham,
I've got the solution. In German we say: I must have had a board in front of the head.(Ich muß ein Brett vor dem Kopf gehabt haben.) because it is pretty easy.
AktQer = FEx1Men3.Text
FEx1Men3.ControlRef = FEx1Men.GetMenuItem(2)
MenC = FEx1Men1.MenuCount
For i = 7 To MenC-1 'MenC = MenC = FEx1Men1.MenuCount = 16
FEx1MenT.ControlRef = FEx1Men3.GetMenuItem(i)
If FEx1MenT.Text = AktQer Then
FEx1MenT.Checked = True
Else
FEx1MenT.Checked = False
End If
Next
So it computes. Lot of thanks to you.

Best regards
berndgoedecke
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 11:23 AM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 09:22 AM
Runtime controls manipulation Erel Tutorials 0 09-26-2007 01:18 PM
Recordset or equivalent Implementation for database manipulation markbarrett_1 Basic4ppc Wishlist 4 08-30-2007 07:23 AM
Runtime control manipulation Erel Code Samples & Tips 6 05-11-2007 01:19 PM


All times are GMT. The time now is 06:38 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0