emclient / mac-playground

70 stars 10 forks source link

What is the corresponding version in Mono of System.Windows.Forms? #27

Open joyinfo opened 5 years ago

joyinfo commented 5 years ago

I found in some cases there are issues if I build System.Windows.Forms with MACOS_THEME and it is good if building without MACOS_THEME, DataGridViewComboBoxColumn, for example.

I would like to know what is the corresponding version in Mono of System.Windows.Forms? So I can check some source of without MACOS_THEME against Mono source.

filipnavara commented 5 years ago

Unfortunately I don't have that information anymore and can only guess based on the individual file history. We have back-ported most of the general/layout fixes to Mono last year. Since the Mono implementation is supported by community only there were not too many changes to it in the past few years.

If you have some small code that reproduces the issue we may look into it.

joyinfo commented 5 years ago

Thanks for your information.

The first issue I met is the mouse move event is sent to another hidden control after the mouse down event is sent to the correct control. I fixed it by adding the code snippet after method OtherMouseDown in System.Windows.Forms.CocoaInternal/MonoView.cs.

        public override void MouseDragged(NSEvent theEvent)
        {
            eventResponder.MouseDragged(theEvent);
        }
joyinfo commented 5 years ago

Another issue is that I can not build System.Windows.Forms without MACOS_THEME symbol.

Screen Shot 2019-08-28 at 11 39 31 AM I fixed it by adding the code snippet after property Capture in /System.Windows.Forms/Control.cs. Now I can build it at least, yet don't know this fixing is correct or not.

        internal virtual bool InternalCapture {
            get {
                return Capture;
            }

            set {
                Capture = value;
            }
        }
joyinfo commented 5 years ago

@filipnavara I forked a testing repository to reproduce the the issue of DataGridViewComboBoxColumn.

The testing repository is https://github.com/joyinfo/mac-playground.

I added testing code in TextBoxForm. If you try to click the triangle of combobox, the program will crash.

WeChatce4676858d79f73696e52a99acd9b760

If you test it in Visual Studio for Mac, it will show the exception in ComboBox.Mac.cs. Screen Shot 2019-08-28 at 6 58 19 PM

filipnavara commented 5 years ago

Thanks for the repro! We will look into it but I cannot promise any timeframe.