View Issue Details

IDProjectCategoryView StatusLast Update
0016435LazarusLCLpublic2011-12-01 11:24
ReporterJohn vd Waeter Assigned ToFelipe Monteiro de Carvalho  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN) 
Fixed in Version0.9.29 (SVN) 
Summary0016435: Cannot change caption of MainMenuItem if Item has subitem, WinCE
DescriptionTo change language of program, I'd like to be able to change at runtime the caption of menu-items.

This works all OK in OnCreate of Mainform.

This works at the click of a button, except if an item has subitems. Then the caption will not change.

John

TagsNo tags attached.
Fixed in Revision26794, 26795, 26798, 26804, 26807, 26435, 26853, 26871, 26893
LazTarget-
Widgetset
Attached Files

Relationships

related to 0014973 closedFelipe Monteiro de Carvalho WinCE: Can't change menu item caption in soft key bar 
related to 0016332 closedFelipe Monteiro de Carvalho Menu on WinCe 
related to 0017090 closedFelipe Monteiro de Carvalho Misc WinCE Menu issues 

Activities

John vd Waeter

2010-05-09 19:47

reporter   ~0037402

NB on Smartphone (emulator) ALL captions of menuitems refuse to get set at runtime, but can get set in the oncreate-event of the form.

Felipe Monteiro de Carvalho

2010-06-01 09:49

developer   ~0038193

For atKeyPadDevice: rev 25813 implements changing the top-level menu caption, other captions don't work yet

For atPDA: Everything should be working

John vd Waeter

2010-06-01 10:36

reporter   ~0038196

Last edited: 2010-06-03 10:26

ok, I'll test as soon as snapshot available

John vd Waeter

2010-06-03 10:26

reporter   ~0038281

Confirmed: setting captions on toplevel-menuitems at runtime works on all emulators. Thanks!

Felipe Monteiro de Carvalho

2010-07-24 13:26

developer   ~0039655

Last edited: 2010-07-26 16:02

The following revisions are helping fix the menu issues:

26794, 26795, 26798, 26804, 26807, 26435

John vd Waeter

2010-07-25 11:34

reporter   ~0039684

Last edited: 2010-07-25 11:34

Things changed again... :-)
tested on snapshot 26825, testmenu3

On Pocket PC:
 - Right toplevel menu does not fire event

On Smartphone:
 - Caption of left sub-menu cannot be changed at runtime
 - Left toplevel menu of 2nd form does not fire.

Felipe Monteiro de Carvalho

2010-07-26 16:06

developer   ~0039703

Here the Right toplevel menu fires the event, both on the Windows Mobile 5 PocketPC as well as on the WM 6 emulators.

The smartphone issues were expected. The caption change is a bug.

The secondary form issue is a clash of menu IDs, because the menu IDs are hard-coded in the RC file so both forms use the same IDs for the menu. I still don't know how to solve that...

John vd Waeter

2010-07-27 08:39

reporter   ~0039720

Hmm, weird, my testmenu1 example, build with 26825, does not fire both left and right toplevel menu. If there are submenus its ok.

John vd Waeter

2010-07-27 09:52

reporter   ~0039722

To overcome the doubled ID's, I thought maybe creating the menu at runtime would help. This one is weird:

Have a mainform with no menu. Just a button. The button creates a second form, showmodal and destroy.

In the secondform, in the oncreate-event, create a menu and one submenu. Point the event of the sub1 to an eventhandler with only "close" in it.

On pocketpc, it just stops working after 2 times. On smartphone, it works one time. Second time it gives AV.

Felipe Monteiro de Carvalho

2010-07-27 13:37

developer   ~0039726

I fixed the pocket pc top-level menu clicking as well as double IDs in rev26853

I solved the double IDs by simply removing the menu items from the list of menu click handlers ... was pretty easy, actually this wasn't such a big deal =)

Please test with the latest svn.

Felipe Monteiro de Carvalho

2010-07-27 13:52

developer   ~0039728

Ha, I see the dynamic menu problem. But here it works if you create a static menu ... no idea yet what the problem is, but I think you should create a new report for dynamic menus. Let's keep this one only about static menus.

If static menus work, that's already a great thing.

The WinCE design is really not in favor of dynamic menus, so they are more complex.

John vd Waeter

2010-07-28 10:09

reporter   ~0039733

Agreed, but not yet... ;-)
tested on build 26845, fpc 2.4.3

If No menu On form
------------------
Just a form, no menu. Ok on PocketPC.
On smartphone, explorer-menu remains visible, but onresponsive.
If an "empty" TMainmenu is dropped on a form, its ok.

No Events when only toplevel menus
----------------------------------
If only toplevel menu is used, the events attached to them are NOT fired on PocketPC. They are fired OK on smartphone.

Felipe Monteiro de Carvalho

2010-07-28 11:08

developer   ~0039734

You revision is too old. Please use >= 26853

You should also try subversion, it's really easy. Just do the following:

1> Keep your snapshot installed, don't uninstall it, we need the binaries

2> Download Lazarus from SVN

3> Build Lazarus with a batch script, something like this:

PATH=F:\Programas\lazarus29\fpc\2.4.0\bin\i386-win32
make bigide
pause

4> Open your SVN Lazarus, use the Configure Build Lazarus dialog to build only LCL to wince-wince-arm (go to advanced view & fill the dialog!)

Now you can already build your project

John vd Waeter

2010-07-28 11:36

reporter   ~0039736

Can I mail you about this svn? The subject does not belong here. I have tried this a zillion times, following different wiki-pages about it, but somehow I always messed up with the effect that existing projects stopped the compiler with messages like "unit interfaces not found" and alike. First, do I need fpc 2.4.0 or 2.4.3? Second, your point 2: Download from svn? Where?? Do you mean using an svn-client like in the wiki? And @4: There are about 30 Radioboxes in that dialog? For you their meaning, especially in the box in the left upper corner, may be obvious, but not for me. I guess I'm a little too old for that.
But keeping up via svn would definitely speed up testing, so I really would appreciate a little help :-)

Felipe Monteiro de Carvalho

2010-07-28 11:47

developer   ~0039737

No problem, you can mail me

> somehow I always messed up with the effect that existing projects stopped the compiler with messages like "unit interfaces not found" and alike.

This message means that you need to rebuild your LCL

> First, do I need fpc 2.4.0 or 2.4.3?

Doesn't matter

> Second, your point 2: Download from svn? Where?? Do you mean using an svn-client like in the wiki?

Yes, usually TortoiseSVN

Ah, I forgot the following steps:

3.1> You need to start the Lazarus SVN with the following command line, or else it will mix the configuration files of your various installed Lazarus:

F:\Programas\lazarussvn\lazarus.exe --primary-config-path=F:\Programas\lazarussvn\

3.2> In your new Lazarus SVN go to the menu Environmento->Options and copy there the path to your compiler. You can copy it from the snapshot. Should be something like

F:\Programas\lazarus29\fpc\2.4.3\bin\i386-win32\fpc.exe

> And @4: There are about 30 Radioboxes in that dialog? For you their meaning, especially in the box in the left upper corner, may be obvious, but not for me. I guess I'm a little too old for that.

Put everything to None (the X symbol) and only LCL to Build+Clean (The gear + cleaning thing)

John vd Waeter

2010-07-28 12:23

reporter   ~0039739

Hmmm, sofar all went well, except for building:
c:\lazarus_svn\lazarus.pp(128,1):
Error: undefined symbol VMT_PROJECTINTF_TLAZBUILDVARIABELES
I think this is the last struggle, please advice?

Felipe Monteiro de Carvalho

2010-07-28 12:45

developer   ~0039740

Building the Lazarus IDE - step 3?

It looks like you need to clean it, try:

PATH=F:\Programas\lazarus29\fpc\2.4.0\bin\i386-win32
make clean
make bigide
pause

How does your script look like exactly?

Felipe Monteiro de Carvalho

2010-07-28 13:01

developer   ~0039744

Microsoft is really annoying, in atKeyPadDevice it is impossible to change the caption of a subitem. You need to remove it and insert it again ... arrgg

John vd Waeter

2010-07-28 13:21

reporter   ~0039746

Yes, step 3.
No script yet. I use a commandline to type the commands. If all works ok, I will make a script. Cleaning did the thing, i could make bigide without errors. But now from the IDE configure Build Lazarus advanced, LCL Clean+Build, LCL-interface set to wince, gives me Identifier not found: "SHSendBackToFocusWindow" (in wincecallback.inc) (something just added if I'm right)

Felipe Monteiro de Carvalho

2010-07-28 14:20

developer   ~0039747

In this same dialog you need to specify:

Operating System: wince
Architecture: arm

You are trying to build LCL-Wince for desktop Windows. It also works, my recent change just broke it, but I don't think that's what you want to do. I added this capability to fix bugs which also appear on desktop, because the desktop debugger is faster.

John vd Waeter

2010-07-28 14:29

reporter   ~0039749

I don't understand. My older lazarus dir has /lcl/units/arm-wince.
Whatever I do in making, cleaning, remaking, recleaning, reupdating svn, rebuilding (I really lost track), in my c:\lazarus_svn\lcl\units there is NO arm-wince dir. Now I keep getting "unit interfaces not found". (I *think* it searches it here). Maybe I should first have Rebuild/Clean LCL, but that one stalls on the shsendbacktofocuswindow. First another coffee now.

John vd Waeter

2010-07-28 14:56

reporter   ~0039750

Ok, I have the directory arm-wince now. Now the rebuilding of Lazarus complains about Can't find unit MultiMon (Win32Int.pp). Give up, delete all directories and starting from scratch.

Felipe Monteiro de Carvalho

2010-07-28 15:12

developer   ~0039751

??? Please follow the steps in exactly the order provided and tell me which step causes problem and why.

John vd Waeter

2010-07-28 15:26

reporter   ~0039753

Ok, here's what I did:
1. Keep snapshot version from yesterday with fpc 2.4.3.
   Path points to this fpc\2.4.3\bin
2. Created dir c:\lazarus_svn
3. SVN download to this dir
4. make clean, all ok
5. make bigide, all ok
6. Start lazarus here, inserted path to fp compiler
7. Configure Build, advanced, only LCL
8. set targets to wince and arm
9. Try to build: Cannot find unit multimon.

So, basically, I must be blind for something. I have done Turbo Pascal since it was released under CP/M, but this beast is escaping me. I'll install a fresh snapshot tomorrow (if any, there was none today) and let you know how the menus behave here.

Felipe Monteiro de Carvalho

2010-07-28 15:29

developer   ~0039754

Last edited: 2010-07-28 15:30

Step 8 - You forgot to change the widgetset to "wince". It is a list of radio buttons in the top-right corner

 MultiMon (Win32Int.pp) is not part of the WinCE interface, you are building win32-wince-arm (widgetset-operating system-architecture) instead of wince-wince-arm

John vd Waeter

2010-07-28 15:45

reporter   ~0039755

Ok, just in time. I was about to throw a computer out of the window.
This last option 8 with wince ended without errors. The only thing left to do was install the lNet-package. It's the only external package I use in my current project.
Now this one stalls like this:
c:\lazarus_svn\components\codetools\codetoolsstrconsts.pas Fatal:
Can't find unit Unix used by FileProcs

Felipe Monteiro de Carvalho

2010-07-28 16:01

developer   ~0039756

You didn't mention before that you wanted to install packages. To install packages you need to make step 8 again, but put LCL, Package Registration and IDE Interface to either Build or Clean+Build.

Felipe Monteiro de Carvalho

2010-07-28 17:34

developer   ~0039757

rev26871 fixes setting the caption of second-level items in atKeyPadDevice. Unfortunatelly the only way I found to make it work was by recreating the entire menu structure.

Felipe Monteiro de Carvalho

2010-07-28 17:40

developer   ~0039758

For me the issue is now fixed. I know no WinCE static menu bugs, please test.

John vd Waeter

2010-07-28 17:43

reporter   ~0039759

I will, as soon as I get things going here.
All building now end without errors. Just one problem left, when just starting a new project. Try to build and it stops on the famous Can't find unit interfaces. All paths look ok, interfaces.pp is even loaded in the ide... if it all fails, I'll revert to using daily snapshots.

Felipe Monteiro de Carvalho

2010-07-28 21:28

developer   ~0039766

Sure, starting a new project, did you set operating system and architecture and widgetset for the new project to wince-wince-arm?

If you using a different target, then you need to rebuild your LCL to the apropriate target you are trying to build your application. The default is win32-win32-x86

John vd Waeter

2010-07-29 08:31

reporter   ~0039772

Yes, I know. I tried to test my own project, with lots of forms, menus, caption changes etc, but my project uses lNet and for some reason I cannot install lNet. It keeps on barking about a not found unit Unix. I think I have to wait a few days. Yesterday there were no new snapshots, and also today no new snapshots are available. Maybe it was not compilable. And therefore maybe I have used some svn-parts with a problem in it.

Felipe Monteiro de Carvalho

2010-07-29 09:00

developer   ~0039773

The solution is simple: Don't install LNet and don't drop it's controls on your form. Use it as a non-visual control created in code. I use LNet like that and it works fine, and then we avoid the installation issues. The IDE does annoys me saying that I should install it, but I just ignore those warnings and it works.

John vd Waeter

2010-07-29 10:34

reporter   ~0039776

Yes, but I've got lNet package installed now. Don't ask how, I really don't know. However, the strange thing is I cannot compile any new project. A Win32 project gives me "can't find unit interfaces", a WinCE project gives me "can't find unit menus". All units are at their proper places, all search-paths are set.

If I try to compile my WinCE-project (from within lazsvn) it stops with "can't find unit LazarusPackageIntf" and immediately complains about lNet not being installed properly. If I use my older lazarus snapshot, all works ok, except of course I don't have latest svn-changes to test menus. I have cleaned/rebuild about anything, the searchpaths are ok (AFAICS), the units, both sources and ppu's are there.

There is not much good in testing applications if even an new, empty project doesn't compile.

Since 2 days ago there are no new snapshots, so I think there is a problem in compiling/building. I assume the snapshots are also built from SVN.

About LNet: I use them that way too, non-visual, no problems.
Other strange thing: Everytime I try to build this empty application, the messagewindow starts with "Recompiling Interfaces, checksum changed for System", immediately followed by "Can't find unit interfaces"

Felipe Monteiro de Carvalho

2010-07-29 11:09

developer   ~0039780

> A Win32 project gives me "can't find unit interfaces"

This means: Rebuild your LCL

> a WinCE project gives me "can't find unit menus".

Can you go to your messages form in the IDE, right click it, "copy all + hidden" and paste the result here? For win32 too

Which compiler version do you use? I have 2.4.3, maybe it doesn't build with 2.4.0 ...

> If I try to compile my WinCE-project (from within lazsvn) it stops with "can't find unit LazarusPackageIntf"

This means: Build Packages Intf or something like that. In the same dialog as the LCL.

> and immediately complains about lNet not being installed properly.

Can be ignored

> Other strange thing: Everytime I try to build this empty application, the messagewindow starts with "Recompiling Interfaces, checksum changed for System", immediately followed by "Can't find unit interfaces"

Strange ... could you maybe start over, follow all steps in exactly the provided order and tell me which step causes trouble?

Felipe Monteiro de Carvalho

2010-07-29 11:11

developer   ~0039781

rev26893 fixes the case of a atKeyPadDevice form menu without

Felipe Monteiro de Carvalho

2010-07-29 11:13

developer   ~0039782

Sure there are snapshots, I just downloaded them:

Lazarus + fpc 2.4.0 win32 Lazarus-0.9.29-26845-fpc-2.4.0-20100727-win32.exe
Lazarus + fpc 2.4.0 win32 -> arm wince Lazarus-0.9.29-26845-fpc-2.4.0-20100727-cross-arm-wince-win32.exe

Probably fpc 2.4.3 cannot be compiled

John vd Waeter

2010-07-29 11:56

reporter   ~0039785

addendum:
If I SAVE the new project first in a different location than the default test-project-location given in the environment-options, I CAN compile an empty project! Both for Win32 and WinCE.... seems I'm getting somewhere now.
So I changed the setting for test-projects in both my lazsvn and other lazarus to different dirs. Now after a clean all, build bigide, install lnet, rebuild lazarus things seem to work ok. Well, almost. Some libraries cannot be found. e.g. There doesn't seem to be a c:\lazsvn\ideintf\units\arm-wince.
So I installed a win-arm crosscompiler from snapshot on top of my lazsvn-dir. Now the missing directories were created, but of course with the old wince menu routines. So SVN-checkout again, make clean, make bigide, start lazarus, install lnet-package (it was not re-installed by make bigide). My project loads, compiles and runs. I'll start checking the menu-behaviour....

Felipe Monteiro de Carvalho

2010-07-29 11:57

developer   ~0039786

> If I SAVE the new project first in a different location than the default test-project-location given in the environment-options, I CAN compile an empty project! Both for Win32 and WinCE.... seems I'm getting somewhere now.

GNU Tools have issues with directories with spaces

John vd Waeter

2010-07-29 12:10

reporter   ~0039787

Last edited: 2010-07-29 12:11

>>GNU Tools have issues with directories with spaces
Yeah, well, the default lazarus setup inserts this temp-directory location, I didn't. And it always worked, that is, with ONE lazarus installed. Now I have no directorypaths without spaces, not even special characters and not even longer than 8 characters.... that seems to work ok now. My lazsvn says it is svn 26896. Is there a way I can check if I am up to date with your latest menu-modifications? If I open a second form on the pda, with only one toplevel-menu-item that has the event "close", it doesn';t fire. But with all this messing I'm not quite sure if I have the latest modifications. In what path/file can I check this?

Felipe Monteiro de Carvalho

2010-07-29 13:52

developer   ~0039789

Last edited: 2010-07-29 13:53

> And it always worked, that is, with ONE lazarus installed.

If you have multiple Lazarus installations you need to start lazarus with a special option specifying the config path, read here:

http://wiki.freepascal.org/Multiple_Lazarus

> My lazsvn says it is svn 26896. Is there a way I can check if I am up to date with your latest menu-modifications?

Yes, just check if is bigger then the latest revision in the list of revisions in this bug report. In short: yes, you are with the latest fixes

> If I open a second form on the pda, with only one toplevel-menu-item that has the event "close", it doesn';t fire.

Can you attach the project? For me it works

John vd Waeter

2010-07-29 14:39

reporter   ~0039792

I have read it, and it was the first thing i did. The config-path was not the problem, it was some remains in the temp-dir path that caused problems. Clearing the tempdir solved the problem. (and after that giving my two lazarusses different tempdirs). See attached testmenu4.zip. Just one mainform and two toplevel menuitems. Onclick should change caption of label1. Works on Keypaddevice, does not work on pocketpc.

John vd Waeter

2010-07-29 14:40

reporter   ~0039794

I have read it, and it was the first thing i did. The config-path was not the problem, it was some remains in the temp-dir path that caused problems. Clearing the tempdir solved the problem. (and after that giving my two lazarusses different tempdirs). See attached testmenu4.zip. Just one mainform and two toplevel menuitems. Onclick should change caption of label1. Works on Keypaddevice, does not work on pocketpc.

2010-07-29 14:41

 

testmenu4.zip (66,000 bytes)

John vd Waeter

2010-07-29 14:42

reporter   ~0039795

Last edited: 2010-07-29 14:43

Mantis causes trouble too:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 68773 bytes) in /FPC/mantis/docroot/core/string_api.php on line 421

2010-07-29 14:50

 

menutest4.PNG (71,348 bytes)   
menutest4.PNG (71,348 bytes)   

Felipe Monteiro de Carvalho

2010-07-29 14:51

developer   ~0039797

Here it works in both emulators 5.0 and 6.0

I hope this isn't a WM 6.5 specific issue. Please rebuild your LCL again to make sure you are using the latest code.

Felipe Monteiro de Carvalho

2010-07-29 15:00

developer   ~0039798

Here it works in both emulators 5.0 and 6.0

I hope this isn't a WM 6.5 specific issue. Please rebuild your LCL again to make sure you are using the latest code.

Felipe Monteiro de Carvalho

2010-07-29 15:01

developer   ~0039799

Here it works in both emulators 5.0 and 6.0

I hope this isn't a WM 6.5 specific issue. Please rebuild your LCL again to make sure you are using the latest code.

John vd Waeter

2010-07-29 15:01

reporter   ~0039800

I tested on WM5, WM6.1 and WM6.5 emulators.

That is why I asked about how to really check latest svn of your code. If I rebuild LCL I now get:
Identifier not found: SHFindMenuBar (in WinCEWSMenus)
Weird, have not updated svn since last build.

Felipe Monteiro de Carvalho

2010-07-29 15:05

developer   ~0039801

Which FPC version are you using?

2010-07-29 15:18

 

testmenu4.exe (1,785,856 bytes)

Felipe Monteiro de Carvalho

2010-07-29 15:19

developer   ~0039803

You can try this executable. If it works then the bug is fixed and the problem is in your setup. Could be related to the FPC version.

John vd Waeter

2010-07-29 15:19

reporter   ~0039804

Hmm, messages don't come through I guess... here goes again:
FPC Version 2.4.3

John vd Waeter

2010-07-29 15:23

reporter   ~0039806

Your exe works ok here. I guess its my FPC version.

Felipe Monteiro de Carvalho

2010-07-29 15:30

developer   ~0039809

No, I also use FPC 2.4.3

Go to the menu project->Project Options

Click on the button "Show Options" and paste here.

Mine are:

 -MObjFPC -Scghi -O1 -TWinCE -Parm -Xs -WG -vewnhi -l -FiF:\Programas\Test\testmenu4\lib\arm-wince\ -FuF:\Programas\lazarussvn\lcl\units\arm-wince\ -FuF:\Programas\lazarussvn\lcl\units\arm-wince\wince\ -FuF:\Programas\lazarussvn\components\codetools\units\arm-wince\ -FuF:\Programas\lazarussvn\components\custom\ -FuF:\Programas\lazarussvn\packager\units\arm-wince\ -Fu. -FUlib\arm-wince\ -otestmenu4.exe -dLCL -dLCLwince

Also attached are some screenshots of my configurations

2010-07-29 15:32

 

config_build_laz_wince.PNG (34,034 bytes)   
config_build_laz_wince.PNG (34,034 bytes)   

2010-07-29 15:32

 

ide_options_wince.PNG (39,313 bytes)   
ide_options_wince.PNG (39,313 bytes)   

John vd Waeter

2010-07-29 15:38

reporter   ~0039812

ok, here goes:
-MObjFPC
-Scghi
-O1
-TWinCE
-Parm
-Xs
-WG
-vewnhi
-l
-FiZ:\ontw\Lazarus\testmenu4\lib\arm-wince\
-FuC:\lazsvn\lcl\units\arm-wince\
-FuC:\lazsvn\lcl\units\arm-wince\wince\
-FuC:\lazsvn\components\codetools\units\arm-wince\
-FuC:\lazsvn\components\custom\
-FuC:\lazsvn\packager\units\arm-wince\
-Fu.
-FUlib\arm-wince\
-otestmenu4.exe
-dLCL
-dLCLwince

Some returns inserted for readability.

John vd Waeter

2010-07-29 15:54

reporter   ~0039815

Ok, I just rebuild LCL with "wince" and "arm" inserted. Done that a zillion times, but now after this the onclick events fire. Problem is now I cannot get lNet installed anymore: barking about a unit Unix and when trying to cleanup/rebuild the IDE: Cannot find unit MultiMon...... repairing one thing kinda breaks another thing. Must say:
"Eu realmente aprecio a sua paciencia" if that is translated correctly...

Felipe Monteiro de Carvalho

2010-07-29 16:05

developer   ~0039817

Don't install LNet. Just add it to your project as a requirement and build your project. Then it will build LNet automatically. Also don't add any paths to LNet in your Project Options dialog, just add it as a requirement. That works for me. You can also try attaching a project which uses LNet so that I can try to build it.

Yep, your portuguese is really good, only missed the "acento circunflexo" in "paciência", also known as little hat =)

John vd Waeter

2010-07-29 16:40

reporter   ~0039818

I didn't miss it, I was just afraid to type it here... Mantis has thrown a lot of errors to me today, didn't want to risk another one...
Its the rebuilding of lazarus that goes wrong... somewhere something is really messed up. Even on a new application, with NOTHING in it, when building, it started asking questions about one of the units in another application... weird... there where no dependencies and still it referred to that other unit...
And now even the codetools-unit starts complaining upon a rebuild. I did nothing with codetools. I must quit now, preparing my old motorbike for a trip for the weekend. When I get back I'll install another snapshot (hopefully they will be up to date again) and start all over. Thanks sofar!

Felipe Monteiro de Carvalho

2010-07-29 22:57

developer   ~0039820

Last edited: 2010-07-30 09:29

Have a nice trip! just don't forget to check the snapshots using FPC 2.4.0 too. They are building normally. It's only the FPC 2.4.3 snapshots which aren't working. Either one should be fine.

Hopefully menus are 100% now

John vd Waeter

2010-08-02 14:38

reporter   ~0039889

Hmm, still no new snapshots. Both 2.4.0 and 2.4.3 are from juli 27th.

John vd Waeter

2010-08-02 19:38

reporter   ~0039893

Tested with 2.4.0. One main program form with menu, a couple of other, autocreated forms, all with only one static left toplevel menuitem that executes "close", thereby reshowing the mainwindow.

Works ok on PocketPC. On keypaddevice, it works sometimes, sometimes not. And (checked by inserting some extra code in the menuitem-onclick): sometimes the menu-item of form C is executed when clicking on menu form B...

The 1.log file (kinda debug-output I guess?) also shows strange fenomena:
On PocketPC, it has a couple of entries saying GetMenuItem failed, SetMenuItemInfo failed, a couple of GetmenuItemInfoi=1 (or 2) failed, breaking.
But all menus on all pages work OK.

On Keypaddevice, it shows 2 lines with RemoveMenu. Thats all. But menus don't work.


In a project with just 2 forms things seem to run ok.

I'll try to assemble a demo-project that demonstrates the problem.

John vd Waeter

2010-08-02 21:44

reporter   ~0039895

Last edited: 2010-08-02 21:58

I was wrong saying that in a project with just two forms things go ok.
Thing went OK because the mainform had no menu.

There is little help in creating a demo... just follow these steps and test on Keypaddevice WM5 emulator

1. create new application wince, Form1
2. create extra Form2
3. put button on Form1 that exectes Form2.Show;
4. Put button on Form2 that executes "close".

Run, works ok.

5. Put labe1 on Form1.
6. Put Menu on Form1, with only toplevel Left and Right
7. Give Captions 'L1' and 'R1'
8. Left menu executes Label1.Caption:='Left';
9. Right menu executes Label1.Caption:='Right';

Run, works OK.

10. On Form2,put mainmenu with only left toplevel menuitem.
11. Give menu caption = 'L2'
12. This menuitem executes: Messagebeep(0);

12. Run. Form1 Shows. Checke meus. Work ok

13. Show Form2. Click menu, works OK.

14. Close Form2

15. Click left menu on Form1. Beep! ???

Form1 left menu executes form2 left menu event.
Captions get replaced ok, events not?

Keypaddevice Left Menu Event points to event of Form2 Lef tmenu

When executing step 15 on PocketPC WM5 emulator, Left menu event points to nothing.

On WM6.1 PocketPC emulator, the behaviour is the same as on WM5
On WM6.5 PocketPC VGA emulatoir, behaviour is even worse: step 4, run, try menu: no effect.

So sorry, not 100% on last snapshot/fpc 2.4.0
I'll try 2.4.3

John vd Waeter

2010-08-02 22:26

reporter   ~0039897

On 2.4.3 the effects are the same (as probably expected).

For WM5 and 6.1:
If multiple forms all have menus, and the menus are shown, things seem to work. When the form is closed, the underlying form appears again, but I think the menu is not updated properly. Captions are, but events not.

For WM 6.5 Pocketpc, Form1 initial menu doesn't even work.

Felipe Monteiro de Carvalho

2010-08-02 22:58

developer   ~0039899

Aha ... the problem is that it needs to rebuild the entire menu structure each time a new form is shown. I added code to rebuild the menu when you issue a Show() or ShowModal(), but I didn't take care of going back to the original form ... maybe rebuilding the menu in OnActivate should do it...

Felipe Monteiro de Carvalho

2010-08-02 23:04

developer   ~0039901

Mantis doesn't like this topic, let's discusse the issue in bug 17090 instead so that we can talk without the Mantis bug poping up.

Issue History

Date Modified Username Field Change
2010-05-09 19:42 John vd Waeter New Issue
2010-05-09 19:47 John vd Waeter Note Added: 0037402
2010-05-09 22:40 Felipe Monteiro de Carvalho Status new => assigned
2010-05-09 22:40 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2010-05-31 23:35 Felipe Monteiro de Carvalho Relationship added related to 0014973
2010-06-01 07:56 Felipe Monteiro de Carvalho Relationship added related to 0016332
2010-06-01 09:49 Felipe Monteiro de Carvalho Note Added: 0038193
2010-06-01 10:36 John vd Waeter Note Added: 0038196
2010-06-03 10:25 John vd Waeter Note Edited: 0038196
2010-06-03 10:26 John vd Waeter Note Edited: 0038196
2010-06-03 10:26 John vd Waeter Note Added: 0038281
2010-07-24 13:27 Felipe Monteiro de Carvalho Note Added: 0039655
2010-07-25 11:34 John vd Waeter Note Added: 0039684
2010-07-25 11:34 John vd Waeter Note Edited: 0039684
2010-07-26 16:02 Felipe Monteiro de Carvalho Note Edited: 0039655
2010-07-26 16:06 Felipe Monteiro de Carvalho Note Added: 0039703
2010-07-27 08:39 John vd Waeter Note Added: 0039720
2010-07-27 09:52 John vd Waeter Note Added: 0039722
2010-07-27 13:37 Felipe Monteiro de Carvalho Note Added: 0039726
2010-07-27 13:52 Felipe Monteiro de Carvalho Note Added: 0039728
2010-07-28 10:09 John vd Waeter Note Added: 0039733
2010-07-28 11:08 Felipe Monteiro de Carvalho Note Added: 0039734
2010-07-28 11:36 John vd Waeter Note Added: 0039736
2010-07-28 11:47 Felipe Monteiro de Carvalho Note Added: 0039737
2010-07-28 12:23 John vd Waeter Note Added: 0039739
2010-07-28 12:45 Felipe Monteiro de Carvalho Note Added: 0039740
2010-07-28 13:01 Felipe Monteiro de Carvalho Note Added: 0039744
2010-07-28 13:21 John vd Waeter Note Added: 0039746
2010-07-28 14:20 Felipe Monteiro de Carvalho Note Added: 0039747
2010-07-28 14:29 John vd Waeter Note Added: 0039749
2010-07-28 14:56 John vd Waeter Note Added: 0039750
2010-07-28 15:12 Felipe Monteiro de Carvalho Note Added: 0039751
2010-07-28 15:26 John vd Waeter Note Added: 0039753
2010-07-28 15:29 Felipe Monteiro de Carvalho Note Added: 0039754
2010-07-28 15:30 Felipe Monteiro de Carvalho Note Edited: 0039754
2010-07-28 15:45 John vd Waeter Note Added: 0039755
2010-07-28 16:01 Felipe Monteiro de Carvalho Note Added: 0039756
2010-07-28 17:34 Felipe Monteiro de Carvalho Note Added: 0039757
2010-07-28 17:40 Felipe Monteiro de Carvalho Fixed in Revision => 26794, 26795, 26798, 26804, 26807, 26435, 26853, 26871
2010-07-28 17:40 Felipe Monteiro de Carvalho LazTarget => -
2010-07-28 17:40 Felipe Monteiro de Carvalho Note Added: 0039758
2010-07-28 17:43 John vd Waeter Note Added: 0039759
2010-07-28 21:28 Felipe Monteiro de Carvalho Note Added: 0039766
2010-07-29 08:31 John vd Waeter Note Added: 0039772
2010-07-29 09:00 Felipe Monteiro de Carvalho Note Added: 0039773
2010-07-29 10:34 John vd Waeter Note Added: 0039776
2010-07-29 11:09 Felipe Monteiro de Carvalho Note Added: 0039780
2010-07-29 11:11 Felipe Monteiro de Carvalho Fixed in Revision 26794, 26795, 26798, 26804, 26807, 26435, 26853, 26871 => 26794, 26795, 26798, 26804, 26807, 26435, 26853, 26871, 26893
2010-07-29 11:11 Felipe Monteiro de Carvalho Note Added: 0039781
2010-07-29 11:13 Felipe Monteiro de Carvalho Note Added: 0039782
2010-07-29 11:56 John vd Waeter Note Added: 0039785
2010-07-29 11:57 Felipe Monteiro de Carvalho Note Added: 0039786
2010-07-29 12:10 John vd Waeter Note Added: 0039787
2010-07-29 12:11 John vd Waeter Note Edited: 0039787
2010-07-29 13:52 Felipe Monteiro de Carvalho Note Added: 0039789
2010-07-29 13:53 Felipe Monteiro de Carvalho Note Edited: 0039789
2010-07-29 14:39 John vd Waeter Note Added: 0039792
2010-07-29 14:40 John vd Waeter Note Added: 0039794
2010-07-29 14:41 John vd Waeter File Added: testmenu4.zip
2010-07-29 14:42 John vd Waeter Note Added: 0039795
2010-07-29 14:43 John vd Waeter Note Edited: 0039795
2010-07-29 14:50 Felipe Monteiro de Carvalho File Added: menutest4.PNG
2010-07-29 14:51 Felipe Monteiro de Carvalho Note Added: 0039797
2010-07-29 15:00 Felipe Monteiro de Carvalho Note Added: 0039798
2010-07-29 15:01 Felipe Monteiro de Carvalho Note Added: 0039799
2010-07-29 15:01 John vd Waeter Note Added: 0039800
2010-07-29 15:05 Felipe Monteiro de Carvalho Note Added: 0039801
2010-07-29 15:18 Felipe Monteiro de Carvalho File Added: testmenu4.exe
2010-07-29 15:19 Felipe Monteiro de Carvalho Note Added: 0039803
2010-07-29 15:19 John vd Waeter Note Added: 0039804
2010-07-29 15:23 John vd Waeter Note Added: 0039806
2010-07-29 15:30 Felipe Monteiro de Carvalho Note Added: 0039809
2010-07-29 15:32 Felipe Monteiro de Carvalho File Added: config_build_laz_wince.PNG
2010-07-29 15:32 Felipe Monteiro de Carvalho File Added: ide_options_wince.PNG
2010-07-29 15:38 John vd Waeter Note Added: 0039812
2010-07-29 15:54 John vd Waeter Note Added: 0039815
2010-07-29 16:05 Felipe Monteiro de Carvalho Note Added: 0039817
2010-07-29 16:40 John vd Waeter Note Added: 0039818
2010-07-29 22:57 Felipe Monteiro de Carvalho Note Added: 0039820
2010-07-30 09:29 Felipe Monteiro de Carvalho Note Edited: 0039820
2010-08-02 14:38 John vd Waeter Note Added: 0039889
2010-08-02 19:38 John vd Waeter Note Added: 0039893
2010-08-02 21:44 John vd Waeter Note Added: 0039895
2010-08-02 21:58 John vd Waeter Note Edited: 0039895
2010-08-02 22:26 John vd Waeter Note Added: 0039897
2010-08-02 22:58 Felipe Monteiro de Carvalho Note Added: 0039899
2010-08-02 23:04 Felipe Monteiro de Carvalho Status assigned => resolved
2010-08-02 23:04 Felipe Monteiro de Carvalho Fixed in Version => 0.9.29 (SVN)
2010-08-02 23:04 Felipe Monteiro de Carvalho Resolution open => fixed
2010-08-02 23:04 Felipe Monteiro de Carvalho Note Added: 0039901
2010-08-02 23:04 Felipe Monteiro de Carvalho Relationship added related to 0017090
2011-12-01 11:24 Marc Weustink Status resolved => closed