Bug 331052

Summary: Notify icon and Right click handle
Product: [Mono] Mono: Class Libraries Reporter: Eric Petit <surfzoid2002>
Component: Windows.FormsAssignee: Jonathan Pobst <jpobst>
Status: RESOLVED FIXED QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: i686   
OS: Other   
Whiteboard: NotifyIcon
Found By: DeveloperNet Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: The complete project who can be use as testcase
New, and good this time, testcase attachment
under win toolstrip balloon Ok
under nux, not Ok

Description Eric Petit 2007-10-05 11:59:58 UTC
hi
I have writed a littl VB appliction who use a notify icon (near the clock)
i say when click on it if it's left click then display the main form and it's ok under windows but under linux if i made a right click it display main form too, also the main form is just a monthcalandar who dock the main form, i disable minimize and maximize form, but the form and monthcalandar are not adjusted like under windows and minimize/maximize but are already here.
I attach my complete source because it 's a very little program and can be use as a test case.
Also other strange thing, at startup i detect if the executable is in the start folder, if not i try to copy it to startupfolder, but i have a io execption who say the file doesn't exist !! (under windows there isn't this problem).
Comment 1 Eric Petit 2007-10-05 12:01:21 UTC
Created attachment 176493 [details]
The complete project who can be use as testcase
Comment 2 Eric Petit 2007-10-05 12:11:46 UTC
Other point i just see and real important, the goal of this litll prog is to quickly display the week number, under windows this the good displayed number in monthcalandar and in the toolstripballon of the notify icon, but under linux the week number have -1.
The code i use is with the datepart function :

DatePart(DateInterval.WeekOfYear, _

        Me.MonthCalendar1.SelectionEnd, FirstDayOfWeek.System, FirstWeekOfYear.FirstFullWeek)


[eric@surfzoidPC ~]$ mono -V
Mono JIT compiler version 20071004 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none
[eric@surfzoidPC ~]$
Comment 3 Jonathan Pobst 2007-10-08 21:20:38 UTC
Fixed the right click part in r87132.

2007-10-08  Jonathan Pobst  <monkey@jpobst.com>

	* NotifyIcon.cs: Set the correct mouse button when handling right mouse
	button.  Fixes a part of bug #331052.
Comment 4 Jonathan Pobst 2007-10-08 21:42:16 UTC
For the IO path, you can't hardcode "\" because the path separator on Linux is "/".  You need to use IO.Path.DirectorySeparatorChar which will use the correct one on each platform.  Or you can build you paths using Path.Combine, which will use the correct separator as well.
Comment 5 Jonathan Pobst 2007-10-08 22:15:02 UTC
Fixed the MonthCalendar sizing issue in r87133.

2007-10-08  Jonathan Pobst  <monkey@jpobst.com>

	* MonthCalendar.cs: When ShowWeekNumbers is changed, force the calendar
	to recalculate its size.  Fixes a part of bug #331052.


I cannot find any issue with DatePart.  If you can find a small reproducible testcase, please file a new bug under the Visual Basic Runtime category.

Thanks for the report!
Comment 6 Eric Petit 2007-10-09 12:33:46 UTC
Hum, really strange i certainly do a mistake when put the testcase attachment, because i had already solve this separator prolem like most of my prog who need to run on different plateform, i put again the attachment.
For the bad week number, it's in the toolstrip ballon of the notify icon(when mouse hover), i put two screen shot, one under windows other under nux, not ok, i use the function datepart of runtime.
Comment 7 Eric Petit 2007-10-09 12:35:07 UTC
Added new attachmentS
Comment 8 Eric Petit 2007-10-09 12:36:02 UTC
Created attachment 177048 [details]
New, and good this time, testcase attachment
Comment 9 Eric Petit 2007-10-09 12:36:49 UTC
Created attachment 177049 [details]
under win toolstrip balloon Ok
Comment 10 Eric Petit 2007-10-09 12:37:44 UTC
Created attachment 177051 [details]
under nux, not Ok
Comment 11 Eric Petit 2007-10-09 12:40:35 UTC
in Fact after reflexion, the test case for the toolstripbaloon problem can be more simple, just add anywhere a messagebox.show or Console.writeline with text from this :
DatePart(DateInterval.WeekOfYear, _

        Date.Now, FirstDayOfWeek.System, FirstWeekOfYear.FirstFullWeek)
and then run it under win and linux the same daytime to see two diferent week number
Comment 12 Eric Petit 2007-10-09 12:47:00 UTC
In fact, for the path separtor problem, now the really problem is under windows i use the My.Computer.FileSystem.SpecialDirectories.Programs & PathSep() & "Démarrage" (i'm french and "démarage" is startup) so under linux it's complety diferent, also after the problem will be, by defaut the system doesn 't start mono exe directly
Comment 13 Jonathan Pobst 2007-10-09 14:14:10 UTC
Looks like the problem with DatePart is that FirstDayOfWeek.System is not picking up your locale's (French?) first day of the week correctly.  On my English system, Oct 9th returns 40 on all platforms.  I suggest you file a bug under the Visual Basic Runtime category.