Compare commits

...
156 Commits
Author SHA1 Message Date
Jonathan Pobst e80fe9efc2 2008-02-22 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* TreeView.cs: Make selected_node and highlighted_node internal.
	* TreeNodeCollection.cs: Reset selected_node and highlighted_node
	to null when Nodes.Clear is called.
	[Fixes bug #363884]

svn path=/branches/mono-1-9/mcs/; revision=97635
2008-03-06 21:58:25 +00:00
Ivan Zlatev 689eabf6e7 2008-03-06 Ivan N. Zlatev <[email protected]>
* CodeDomSerializerBase.cs: Fix deserialization of 
	CodeFieldReference to handle static fields. This fixes enum 
	references.


svn path=/branches/mono-1-9/mcs/; revision=97623
2008-03-06 19:51:33 +00:00
Ivan Zlatev b3e85147e2 2008-03-06 Ivan N. Zlatev <[email protected]>
* ImageFormatConverter.cs: 
	 - String comparison should use the InvariantCulture.
	 - ConvertTo string should return the name for known image formats.
	 [Fixes bug #366570]


svn path=/branches/mono-1-9/mcs/; revision=97620
2008-03-06 19:46:05 +00:00
Ivan Zlatev de49cf51ec 2008-03-06 Ivan N. Zlatev <[email protected]>
* Container.cs: On disposal unsite the component first before 
	disposing in order to prevent it from asking us to remove it 
	through the Site property.
	[Fixes bugs #367653 and #367583]


svn path=/branches/mono-1-9/mcs/; revision=97612
2008-03-06 19:22:01 +00:00
Paolo Molaro d4b13e6d82 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <[email protected]>
* marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
	the called function takes an object type argument. Fixes storing or
	valuetypes across remoting as well as reducing memory usage.
	* image.c, metadata-internals.h: remove now unused ldfld_remote and
	stfld_remote wrapper caches.


svn path=/branches/mono-1-9/mono/; revision=97603
2008-03-06 18:18:36 +00:00
Paolo Molaro 5c631e2d87 Tue Mar 4 19:10:30 CET 2008 Paolo Molaro <[email protected]>
* marshal.c: mono_load_remote_field_new() always returns object,
	so use the proper signature (fixes bug #366445).


svn path=/branches/mono-1-9/mono/; revision=97329
2008-03-04 17:23:58 +00:00
Sebastien Pouliot 235887395e 2008-03-04 Sebastien Pouliot <[email protected]>
* Graphics.cs: Sync with HEAD. This fix CopyFromScreen for X11 
	when source or destination coordinates are not 0 (bug #363881),
	remove some dead code and adds some comments.


svn path=/branches/mono-1-9/mcs/; revision=97317
2008-03-04 15:24:24 +00:00
Sebastien Pouliot 9ee3b1f02d 2008-03-04 Sebastien Pouliot <[email protected]>
* SymmetricTransform.cs: Sync with corlib. Fix ANSIX923 padding check
	(#366623)
	[Backport r97309]


svn path=/branches/mono-1-9/mcs/; revision=97313
2008-03-04 14:58:43 +00:00
Sebastien Pouliot b0783baf40 2008-03-04 Sebastien Pouliot <[email protected]>
* PaddingModeTest.cs: Add test case for #366623 ANSI padding bug.
	[Backport r97310]


svn path=/branches/mono-1-9/mcs/; revision=97312
2008-03-04 14:57:31 +00:00
Sebastien Pouliot 8a21d63bc2 2008-03-04 Sebastien Pouliot <[email protected]>
* SymmetricTransform.cs: Fix ANSIX923 padding check (#366623) to be
	just like PKCS7 (but comparing to 0).
	[Backport of r97308]


svn path=/branches/mono-1-9/mcs/; revision=97311
2008-03-04 14:56:20 +00:00
Marek Habersack ed11caf050 Backport of r97256
svn path=/branches/mono-1-9/mcs/; revision=97258
2008-03-03 23:43:43 +00:00
Ivan Zlatev 836cb6843c 2008-03-03 Ivan N. Zlatev <[email protected]>
* ImageFormatConverter.cs: Perform a case insensitive comparison 
	instead of a case sensitive one.
	[Fixes bug #366567]


svn path=/branches/mono-1-9/mcs/; revision=97247
2008-03-03 22:23:25 +00:00
Ivan Zlatev db6e3e3f17 2008-03-03 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Do not convert not only if the types match, 
	but also if the property type is assigneable from the value's
	type.
	[Fixes bug #366566]


svn path=/branches/mono-1-9/mcs/; revision=97245
2008-03-03 21:49:06 +00:00
Veerapuram Varadhan 7208c99ada Test for Bug#332809
svn path=/branches/mono-1-9/mcs/; revision=97242
2008-03-03 21:43:33 +00:00
Ivan Zlatev 2d6fec4e28 2008-03-03 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: 
	 - Subscribe to the listbox only once and not everytime.
	 - Update the textbox even if SetValue fails.
	 - Close the listbox before calling TrySetValue just in case.
	 [Fixes bug #366569]


svn path=/branches/mono-1-9/mcs/; revision=97240
2008-03-03 21:35:45 +00:00
Veerapuram Varadhan 54df38d9c4 ** Various ODBC fixes from trunk
svn path=/branches/mono-1-9/mcs/; revision=97238
2008-03-03 21:33:34 +00:00
Marek Habersack 2cc0acba6b Backport of r97178
svn path=/branches/mono-1-9/mcs/; revision=97234
2008-03-03 20:56:04 +00:00
Ivan Zlatev 1ac00c75cc 2008-03-02 Ivan N. Zlatev <[email protected]>
* DesignModeSite.cs: Fix Name setter to actually set the name.


svn path=/branches/mono-1-9/mcs/; revision=97139
2008-03-02 18:17:52 +00:00
Ivan Zlatev bff810e592 2008-03-01 Ivan N. Zlatev <[email protected]>
* ControlDesigner.cs: Ignore the first WM_MOUSEMOVE after
	WM_MOUSEDOWN as it is sent just after it.
	* ParentControlDesigner.cs: Monitor Component Remove events
	and fire ComponentChanging/ed events for the Parent of the removed
	Control. Helps the UndoEngine to serialize parent changes.
	* ControlDesigner.cs: Set the Control.Text to be the component name.
	* FormDocumentDesigner.cs: Added.
	* PanelDesigner.cs: Added.
	* UISelectionService.cs: Set Parent through the TypeDescriptor, so
	that component change notifications get fired.
	* DefaultMenuCommands.cs: Implement Cut, Copy, Paste
	* DocumentDesigner: 
	 - Drop Form specific code.
	 - Add menu commands.


svn path=/branches/mono-1-9/mcs/; revision=97106
2008-03-01 23:23:21 +00:00
Ivan Zlatev 40dd58615d 2008-03-01 Ivan N. Zlatev <[email protected]>
* MenuCommandService.cs: implemeneted
	* DesignerHost.cs: Do not fire ComponentChanging/ed events
	when removing a component.
	* DesignModeSite: Naming fixes.
	* UndoEngine.cs: A lot of bugfixes.
	* SelectionService: Set root component as selected if the 
	last remaining component from the current selection has been
	removed.


svn path=/branches/mono-1-9/mcs/; revision=97104
2008-03-01 23:16:52 +00:00
Ivan Zlatev 3a6d3b7485 2008-03-01 Ivan N. Zlatev <[email protected]>
* CodeDomSerializerBase.cs, PropertyCodeDomSerializer.cs: 
	PropertySerializer shouldn't check for serialization visibility
	as its duty is to serialize properies if invoked directly.
	CodeDomSerializerBase.SerializeProperties should check the 
	visibility.
	* CodeDomSerializer.cs: Fix deserialize to deserialize all 
	statements.
	* CodeDomDesignerLoader.cs: Implement IDesignerSerializationService
	using the ComponentSerializationService instead of calling
	ourselves recursive.
	* CodeDomComponentSerializationService.cs: A lot of bugfixes.
	* DesignerSerializationManager.cs: 
	 - Verify that we are not in session before creating a new one.
	 - Do not check whether we should
	 preserve names in GetInstance. This is only for CreateInstance.
	 - Fix a NRE if serialization providers are not initialized.
	* CodeDomSerializationProvider.cs, CodeDomDesignerLoader.cs:
	Refactor the codedom provider to a singleton, so that
	CodeDomComponentSerializationService and others can share the
	instance.
	* SerializeAbsoluteContext.cs: ShouldSerialize should check if 
	the absolute context is of the same member not the opposite.


svn path=/branches/mono-1-9/mcs/; revision=97102
2008-03-01 23:14:32 +00:00
Ivan Zlatev 55aaf8ca5f 2008-03-01 Ivan N. Zlatev <[email protected]>
* Component.cs: Do not set the Site to null on disposing as this 
        is the Containers job. Instead try to remove from Container if sited.


svn path=/branches/mono-1-9/mcs/; revision=97094
2008-03-01 21:45:39 +00:00
Miguel de Icaza 3161ba3c79 Backport this as well
svn path=/branches/mono-1-9/mono/; revision=97068
2008-03-01 06:27:49 +00:00
Miguel de Icaza e51bb3501f Use mono.pub
svn path=/branches/mono-1-9/mcs/; revision=97066
2008-03-01 06:24:49 +00:00
Marek Habersack 0a0d8780f0 Backport of r97038
svn path=/branches/mono-1-9/mono/; revision=97043
2008-03-01 01:11:23 +00:00
Marek Habersack 5f63b448ca Backport of r97035
svn path=/branches/mono-1-9/mcs/; revision=97042
2008-03-01 01:10:35 +00:00
Ivan Zlatev 2c347b349c 2008-02-29 Ivan N. Zlatev <[email protected]>
* StringCollectionEditor.cs: 
	 - Split the lines not based on Environment.NewLine as this is 
	 not what is used by MWF on Windows.
	 - Ignore last empty line.
	[Fixes bug #365948]


svn path=/branches/mono-1-9/mcs/; revision=97016
2008-02-29 20:43:43 +00:00
Ivan Zlatev 3b931798ed 2008-02-29 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs: Fix wrong array size initialization.
	* GridEntry.cs: For MS compitability make all child properties 
	readonly if the parent is readonly. Ugh.
	[Fixes bug #365945 and #365944]


svn path=/branches/mono-1-9/mcs/; revision=97012
2008-02-29 20:32:08 +00:00
Jonathan Pryor 2ceb17724a * signal.c: SLES9 has glib 2.2, so we can't rely on g_atomic_int_*().
Provide a fallback mechanism between using Mono's atomic.h, glib 2.4
	  functions, and horribly unsafe-but-no-alternative code.

svn path=/branches/mono-1-9/mono/; revision=96934
2008-02-28 22:38:08 +00:00
Marek Habersack 3e85ee2c42 Backport of a fix for bug #341764
svn path=/branches/mono-1-9/mcs/; revision=96912
2008-02-28 18:33:15 +00:00
Marek Habersack 2b3bfcb002 Backport of some changes from svn trunk - performance improvement and a fix for bug #325371
svn path=/branches/mono-1-9/mcs/; revision=96899
2008-02-28 16:21:29 +00:00
Ivan Zlatev 23a247a942 2008-02-28 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: 
	 - Use PropertyDescriptor.DisplayName instead of .Name for Label,
	   so that DisplayNameAttribute doesn't get ignored.
	 - Check for ParenthesizeNameAttribute and parenthesize the Label.
	 - Add support for PasswordPropertyTextAttribute
	* PropertyGridView.cs: Check if an entry is a password.
	[Fixes bugs #365589, #365586, #365588]


svn path=/branches/mono-1-9/mcs/; revision=96884
2008-02-28 14:59:47 +00:00
Marek Habersack 9f2ef9809c Backport of r96870
svn path=/branches/mono-1-9/mcs/; revision=96871
2008-02-28 13:14:32 +00:00
Marek Habersack a111503d8b Backport of r96861
svn path=/branches/mono-1-9/mcs/; revision=96862
2008-02-28 11:52:13 +00:00
Marek Habersack 503db178aa Backport of r96841
svn path=/branches/mono-1-9/mcs/; revision=96842
2008-02-28 00:57:07 +00:00
Marek Habersack fc080ff59c Backport of r96839
svn path=/branches/mono-1-9/mcs/; revision=96840
2008-02-28 00:46:28 +00:00
Marek Habersack b0871c8895 Backport of r96719
svn path=/branches/mono-1-9/mcs/; revision=96720
2008-02-27 01:21:32 +00:00
Ivan Zlatev 4353fd8f2c 2008-02-26 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Optimization in ToggleValue so that it caches
	the current value.
	* PropertyGridView.cs: An optimization so that the property isn't 
	re-read twice for each StandardValue added to the drop-down menu.
	Patch by Andy Hume <[email protected]> under the MIT/X11
	license.
	[Fixes bug #362755]


svn path=/branches/mono-1-9/mcs/; revision=96671
2008-02-26 17:25:43 +00:00
Marek Habersack afd0431985 Backport of r96644
svn path=/branches/mono-1-9/mcs/; revision=96645
2008-02-26 13:57:55 +00:00
Marek Habersack 62a731564f Backport of r96587
svn path=/branches/mono-1-9/mcs/; revision=96589
2008-02-25 20:59:35 +00:00
Ivan Zlatev 52cc9ad641 2008-02-25 Ivan N. Zlatev <[email protected]>
* DateTimeEditor.cs: Set the calendar to the currently edited 
	date. Patch by Andy Hume. Code is contributed under 
	MIT/X11 license.
	[Fixes #362749]


svn path=/branches/mono-1-9/mcs/; revision=96559
2008-02-25 14:50:53 +00:00
Ivan Zlatev 6540fcf26d 2008-02-25 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Use the PropertyDescriptor.PropertyType instead 
	of GetType on the value as it uses reflection to 
	determine the type. This fixes the case where the new value is 
	null.
	[Fixes #358332]


svn path=/branches/mono-1-9/mcs/; revision=96551
2008-02-25 14:36:02 +00:00
Marek Habersack ebd3a9281e Backport of r96541
svn path=/branches/mono-1-9/mcs/; revision=96542
2008-02-25 13:28:14 +00:00
Ivan Zlatev a329776379 2008-02-25 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: Limit mousewheel scrolling to not scroll
	past the view.
	[Fixes bug #364359]


svn path=/branches/mono-1-9/mcs/; revision=96540
2008-02-25 12:59:10 +00:00
Marek Habersack 35707fc9bd Backport of r96536
svn path=/branches/mono-1-9/mcs/; revision=96537
2008-02-25 12:35:53 +00:00
Atsushi Eno 3630d90e48 backport r96408.
svn path=/branches/mono-1-9/mcs/; revision=96409
2008-02-22 03:59:42 +00:00
Marek Habersack f18b59fff1 Backport of r96395
svn path=/branches/mono-1-9/mcs/; revision=96396
2008-02-21 21:09:59 +00:00
Marek Habersack ccee7e4b9d Backport of r96384
svn path=/branches/mono-1-9/mcs/; revision=96385
2008-02-21 18:31:27 +00:00
Sebastien Pouliot a5b4338830 2008-02-21 Sebastien Pouliot <[email protected]>
* Rfc2898DeriveBytesTest.cs: Add test cases for consecutive calls to
	GetBytes and compare the result to a single, larger, call. Converted 
	all exitsing tests to NUnit 2.2.
	[Backport r96344]


svn path=/branches/mono-1-9/mcs/; revision=96345
2008-02-21 13:59:46 +00:00
Sebastien Pouliot 7fdb0c5558 2008-02-21 Sebastien Pouliot <[email protected]>
* Rfc2898DeriveBytes.cs: Fix GetByte not to throw an exception if
	called several time to get more data.
	[Backport r96343]


svn path=/branches/mono-1-9/mcs/; revision=96344
2008-02-21 13:59:32 +00:00
Zoltan Varga 2a99fb1060 Merge from HEAD.
svn path=/branches/mono-1-9/mcs/; revision=96332
2008-02-21 11:06:54 +00:00
Zoltan Varga aceb5b70e6 2008-02-20 Zoltan Varga <[email protected]>
* icall.c (ves_icall_Type_GetPacking): Handle dynamic types.

svn path=/branches/mono-1-9/mono/; revision=96315
2008-02-20 20:47:01 +00:00
Marek Habersack 80ee6f45bd Backport of r96296
svn path=/branches/mono-1-9/mcs/; revision=96297
2008-02-20 19:49:13 +00:00
Ivan Zlatev f9317b6730 2008-02-20 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: Fix a NRE when closing the drop down form.


svn path=/branches/mono-1-9/mcs/; revision=96292
2008-02-20 19:20:24 +00:00
Zoltan Varga cd1524d307 Merge from HEAD.
svn path=/branches/mono-1-9/mono/; revision=96288
2008-02-20 19:07:03 +00:00
Marek Safar d48d61a5b3 2008-02-20 Marek Safar <[email protected]>
A fix for bug #363218
 	* expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
 	initializers.
 	

svn path=/branches/mono-1-9/mcs/; revision=96282
2008-02-20 18:10:29 +00:00
Daniel Nauck b2cea1696b 2008-02-17 Daniel Nauck <[email protected]>
[Backport from r95967 to 1.9]
        * HttpWebResponse.cs: refactored cookie expires parsing to
        allow all common expires datetime formats.


svn path=/branches/mono-1-9/mcs/; revision=96279
2008-02-20 17:55:59 +00:00
Zoltan Varga e56d0ffb1f Merge from HEAD.
svn path=/branches/mono-1-9/mcs/; revision=96239
2008-02-20 11:34:42 +00:00
Ivan Zlatev 1250fe8848 2008-02-20 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: 
	 - Fix a NRE that caused a test failure
	 - Another performance improvement - cache the standard values
	 listbox.


svn path=/branches/mono-1-9/mcs/; revision=96235
2008-02-20 11:16:59 +00:00
Ivan Zlatev 8adf9c4e63 2008-02-19 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGridView.cs: Fix a big performance bug.


svn path=/branches/mono-1-9/mcs/; revision=96182
2008-02-19 20:03:01 +00:00
Marek Habersack 883ad0420d Backport of r96105
svn path=/branches/mono-1-9/mcs/; revision=96106
2008-02-18 22:44:15 +00:00
Zoltan Varga 77de52bdbf Merge from HEAD.
svn path=/branches/mono-1-9/mcs/; revision=96102
2008-02-18 20:51:54 +00:00
Marek Habersack 297bd4e009 Backport of r96096
svn path=/branches/mono-1-9/mcs/; revision=96097
2008-02-18 19:38:18 +00:00
Marek Habersack 46196ff4c4 Backport of r96093
svn path=/branches/mono-1-9/mcs/; revision=96094
2008-02-18 19:14:46 +00:00
Marek Habersack 0424bef8f1 Backport of r96079
svn path=/branches/mono-1-9/mcs/; revision=96080
2008-02-18 17:03:48 +00:00
Ivan Zlatev 7d36c3b9ea 2008-02-17 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Set expanded state before notifying that the
	expansion has taken place.
	* PropertyGridView.cs:
	 - Set the propertygridtextbox text to the selected 
	 StandardValue before proceeding to setting it.
	 - Scrolling bugfixes.


svn path=/branches/mono-1-9/mcs/; revision=95969
2008-02-17 14:07:10 +00:00
Ivan Zlatev a50d266d26 2008-02-16 Ivan N. Zlatev <[email protected]>
* GridEntry.cs:
	 - Fix ValueText to not return null.
	 - Fix conversion error reporting to actually happen.
	* PropertyGridView.cs: Set entry only if the text has changed.
	[Fixes bug #362116]


svn path=/branches/mono-1-9/mcs/; revision=95935
2008-02-16 22:02:27 +00:00
Ivan Zlatev 580704c69d 2008-02-16 Ivan N. Zlatev <[email protected]>
* CharConverter.cs: 
	 - Handle \0 char.
	 - Trim the ConvertFrom string
	 - Handle null string in ConvertFrom as \0 char.
	 [Fixes bug #362112]


svn path=/branches/mono-1-9/mcs/; revision=95931
2008-02-16 21:56:08 +00:00
Ivan Zlatev e9350eef2a 2008-02-16 Ivan N. Zlatev <[email protected]>
* CultureInfoConverter.cs:
	 - Handle "(default)" to and from conversion
	 - Sort cultures alphabetically and also cache them.
	 [Fixes bug #362113]


svn path=/branches/mono-1-9/mcs/; revision=95917
2008-02-16 20:19:48 +00:00
Ivan Zlatev 48e2cffb75 2008-02-16 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* GridEntry.cs: 
	 - Fix handling of a null current value.
	 - Swallow editor exceptions.
	[Fixes bug #362114]


svn path=/branches/mono-1-9/mcs/; revision=95915
2008-02-16 20:11:11 +00:00
Ivan Zlatev c34e8b3eac 2008-02-16 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGridTextBox.cs, PropertyGridView.cs: Explicitly send
	a mouse down event to the textbox so that we get the caret
	positioned under cursor.
	[Fixes bug #362119]


svn path=/branches/mono-1-9/mcs/; revision=95908
2008-02-16 17:59:53 +00:00
Ivan Zlatev 6260184c6c 2008-02-16 Ivan N. Zlatev <[email protected]>
* UITypeEditor.cs: Associate string[] with StringArrayEditor in the 
	editors table.
	[Part of fix for bugs #360666 and #358332]


svn path=/branches/mono-1-9/mcs/; revision=95894
2008-02-16 15:14:14 +00:00
Ivan Zlatev 778d93bf88 2008-02-16 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs, PropertyDescriptor.cs: 
	Do not throw when can't find Type from string.
	* ReferenceConverter.cs: Convert null value from and to string.
	Return an empty StandardValueCollection.
	[Part of fix for bugs #360666 and #358332]


svn path=/branches/mono-1-9/mcs/; revision=95893
2008-02-16 15:11:54 +00:00
Ivan Zlatev c0cb46ff10 2008-02-16 Ivan N. Zlatev <[email protected]>
* CollectionEditor.cs: Handle null collection.
	[Part of fix for bugs #360666 and #358332]


svn path=/branches/mono-1-9/mcs/; revision=95892
2008-02-16 15:10:21 +00:00
Ivan Zlatev 0ff81ba716 2008-02-16 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs: Clear current items first thing before 
	repopulating subitems.
	* GridEntry.cs: 
	 - Handle null StandardValuesCollection.
	 - Mark as not editable if there is no PropertyDescriptor and
	 if the Converter cannot convert from string.
	[Part of fix for bugs #360666 and #358332]


svn path=/branches/mono-1-9/mcs/; revision=95890
2008-02-16 15:07:46 +00:00
Andreia Gaita e48557ea01 [Backport to 1.9]
* XplatUIX11.cs: If the handle is null when posting a message, use the
current thread queue to post instead.
[Fixes #332409]

* SendKeys.cs: Slight optimization

2008-02-15  Andreia Gaita <[email protected]>

svn path=/branches/mono-1-9/mcs/; revision=95750
2008-02-15 13:44:57 +00:00
Ivan Zlatev 316e1afee5 2008-02-14 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGrid.cs, PropertyGridView.cs:
	Fix multiple scrolling and sizing issues.
	[Fixes bug #359199]


svn path=/branches/mono-1-9/mcs/; revision=95683
2008-02-14 19:37:11 +00:00
Geoff Norton 88f93ba4d4 In .:
2008-02-14  Geoff Norton  <[email protected]>

	* WindowHandler.cs: Ensure we send WM_ACTIVATE when we activate our
	Form.  Fixes #360721


svn path=/branches/mono-1-9/mcs/; revision=95670
2008-02-14 17:40:35 +00:00
Gert Driesen 328122f2f8 * Delegate.cs (CreateDelegate): Walk the inheritance chain to find
matching method. Fixes bug #360784.

svn path=/branches/mono-1-9/mcs/; revision=95589
2008-02-13 18:53:41 +00:00
Daniel Nauck e1a99be943 2008-02-13 Daniel Nauck <[email protected]>
[Backport from r95334 to 1.9]
        * HttpWebResponse.cs: convert UTC/GMT Expires DateTime from a cookie
        into local time.


svn path=/branches/mono-1-9/mcs/; revision=95581
2008-02-13 14:58:29 +00:00
Ivan Zlatev fe00fc8182 2008-02-12 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* DateTimeEditor.cs: Set edit value only if the user sets it
	in the editor.
	[Fixes #359159]


svn path=/branches/mono-1-9/mcs/; revision=95533
2008-02-12 17:25:33 +00:00
Ivan Zlatev 9ef62b1562 2008-02-12 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGridView.cs: Ensure that drop down editors are shown
	in the WorkingArea of the screen.
	[Fixes bug #359807]


svn path=/branches/mono-1-9/mcs/; revision=95528
2008-02-12 16:56:20 +00:00
Ivan Zlatev 04bcafd809 2008-02-12 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* GridEntry.cs: Fail silently when UITypeEditor is missing.
	[Fixes bug #360666]


svn path=/branches/mono-1-9/mcs/; revision=95520
2008-02-12 15:47:11 +00:00
Jonathan Pryor 429fb49940 * signal.c: Fix another build break; g_atomic_int_set() (part of GLib 2.10)
isn't present on all build machines, so use an alternate function.

svn path=/branches/mono-1-9/mono/; revision=95500
2008-02-12 14:20:17 +00:00
Jonathan Pryor f6c15fba31 * UnixSignal.cs: Improve argument checking to match docs.
svn path=/branches/mono-1-9/mcs/; revision=95476
2008-02-12 01:29:28 +00:00
Ivan Zlatev 98b067eb08 2008-02-11 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGridView.cs:
	 - Clear the controls in the drop down form after it is hidden.
	 - Fix Width sizing of the dropdown editors to match MSFT.


svn path=/branches/mono-1-9/mcs/; revision=95457
2008-02-11 18:00:30 +00:00
Ivan Zlatev 0685091566 2008-02-11 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: 
	 - Fix height for drawing the grid entry
	 text value, so that it clips multiline text properly.
	 - Fix unfocusing to match MSFT.
Imaginary Buffer Line
	* PropertyGrid.cs: Do not populate subgriditems unless expandable.
	Fixes a bug where on repopulation after value changed items become
	expandable.


svn path=/branches/mono-1-9/mcs/; revision=95449
2008-02-11 16:44:56 +00:00
Ivan Zlatev 0e7f1c8676 2008-02-11 Ivan N. Zlatev <[email protected]>
* AnchorEditor.cs: More sensible default width.


svn path=/branches/mono-1-9/mcs/; revision=95448
2008-02-11 16:32:50 +00:00
Miguel de Icaza 7053921e5c Backport Eyal's fixes from 95428 (fixes a regression in ToString R)
svn path=/branches/mono-1-9/mcs/; revision=95434
2008-02-11 13:21:35 +00:00
Geoff Norton ea34135825 In .:
2008-02-11  Geoff Norton  <[email protected]>

	* loader.c: [Backport] Guard and dereference against inflated generic 
	methods.  Populate the parameter name for generic parameters as well.
	 (Fixes #342536)


svn path=/branches/mono-1-9/mono/; revision=95416
2008-02-11 05:44:55 +00:00
Miguel de Icaza c00d8b2f2e Backport fix
svn path=/branches/mono-1-9/mcs/; revision=95397
2008-02-10 18:45:09 +00:00
Gert Driesen e8d0f665f5 * UnixRegistryApi.cs: In OpenSubKey, respect value of writable argument
when creating well-known subkey. Fixes bug #357883.


svn path=/branches/mono-1-9/mcs/; revision=95362
2008-02-10 10:02:26 +00:00
Jonathan Pryor c923f03807 * mono-service.cs: Use Mono.Unix.UnixSignal for signal handling, which
is actually safe.  As a bonus, it removes the 'wakeup every .5s' code.
	  - The return value of UnixSignal.WaitAny() changed; cope.

svn path=/branches/mono-1-9/mcs/; revision=95287
2008-02-08 17:57:47 +00:00
Jonathan Pryor 2d807b3fe9 * UnixSignal.cs: UnixSignal.WaitAny() should have the same return type as
WaitHandle.WaitAny().  Oops.


svn path=/branches/mono-1-9/mcs/; revision=95280
2008-02-08 17:09:36 +00:00
Jonathan Pryor aa7633a74e * signal.c: Mono_Unix_UnixSignal_WaitAny() semantic change: return the index
into the signals array of the first signaled signal if successful,
	  otherwise return the timeout.

svn path=/branches/mono-1-9/mono/; revision=95279
2008-02-08 17:09:26 +00:00
Sebastien Pouliot ae27633a66 2008-02-08 Sebastien Pouliot <[email protected]>
* Random.cs: Explain (and extend) special case in Next(min,max)
	[Backport r95273]

2008-02-08  Juraj Skripsky  <[email protected]>

	* Random.cs (Next): Use rounding (via implicit conversion) only on
	positive values. Fixes bug 359918.
	[Backport r95272]


svn path=/branches/mono-1-9/mcs/; revision=95274
2008-02-08 16:40:29 +00:00
Marek Habersack dfe4ec189c Backport of r95265
svn path=/branches/mono-1-9/mcs/; revision=95267
2008-02-08 15:49:02 +00:00
Jonathan Pryor 7bef2052ef * signal.c: Provide support functions for Mono.Unix.UnixSignal, which
supports both polling and waiting on signal emission.
    - Fix the Win32 build.
	  - Make the signal handler thread-safe, so that it can safely be
	    invoked concurrently from multiple threads.
	* map.h: Flush (adds UnixSignal-related prototypes).

svn path=/branches/mono-1-9/mono/; revision=95263
2008-02-08 15:15:19 +00:00
Jonathan Pryor 08bc44024f * Mono.Posix.dll.sources: Add Mono.Unix/UnixSignal.cs.
* Mono.Unix/UnixSignal.cs: Added; Polling and blocking based Unix signal 
	  mechanism.
	  - http://lists.ximian.com/pipermail/mono-devel-list/2008-January/026501.html
		- Modification of Info->count should be thread safe.
	* Mono.Unix.Native/Stdlib.cs: Obsolete Stdlib.signal(), as it's not safe; 
	  see also:
	  http://lists.ximian.com/pipermail/mono-devel-list/2008-January/026501.html
	  http://lists.ximian.com/pipermail/mono-devel-list/2008-January/026503.html
	  Add SetSignalAction() as a replacement.

svn path=/branches/mono-1-9/mcs/; revision=95262
2008-02-08 15:14:30 +00:00
Jonathan Pobst 831f0d7461 2008-02-08 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* Control.cs: Guard against an NRE in ShowFocusCues.
	[Fixes bug #359830]

svn path=/branches/mono-1-9/mcs/; revision=95261
2008-02-08 14:52:39 +00:00
Ivan Zlatev a91c5109b0 2008-02-08 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* ColorEditor.cs: Fix Height to include the last 8th row.


svn path=/branches/mono-1-9/mcs/; revision=95212
2008-02-08 00:59:07 +00:00
Marek Habersack 4eb3ecc064 Backport of r95198
svn path=/branches/mono-1-9/mcs/; revision=95199
2008-02-07 22:28:25 +00:00
Marek Habersack 3aba6bf43f Removed CWL
svn path=/branches/mono-1-9/mcs/; revision=95185
2008-02-07 20:07:15 +00:00
Marek Habersack 715d098ce9 Backport of r95160
svn path=/branches/mono-1-9/mcs/; revision=95161
2008-02-07 17:24:24 +00:00
Marek Habersack 151a6ee40d Backport of r95135
svn path=/branches/mono-1-9/mcs/; revision=95136
2008-02-07 13:18:53 +00:00
Marek Habersack 2fa1d2490e backport of r95074
svn path=/branches/mono-1-9/mcs/; revision=95075
2008-02-06 20:32:01 +00:00
Ivan Zlatev e17e04416c 2008-02-06 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGridView.cs: 
	 - Refactor SetValue to allow setting the value
	when a custom editor is used, but the entry is not editable.
	 - Remove the custom editor control on CloseDropDown.
	[Fixes #359196]


svn path=/branches/mono-1-9/mcs/; revision=95052
2008-02-06 17:35:39 +00:00
Andreia Gaita 1583fe12b7 2008-02-06 Andreia Gaita <[email protected]>
[Backport to 1.9]
* PrintControllerWithStatusDialog.cs: Set PrintFileName value through
reflection only on 1.1, this property is public on system.drawing on 2.0.
Fixed #359247

svn path=/branches/mono-1-9/mcs/; revision=95042
2008-02-06 17:14:17 +00:00
Marek Habersack 9809316f66 Backport of r95028
svn path=/branches/mono-1-9/mcs/; revision=95029
2008-02-06 15:04:22 +00:00
Marek Habersack e40411592a Backport of r95015
svn path=/branches/mono-1-9/mcs/; revision=95016
2008-02-06 12:44:19 +00:00
Marek Habersack f7290f8d7e Backport of r95013
svn path=/branches/mono-1-9/mcs/; revision=95014
2008-02-06 12:11:27 +00:00
Jonathan Pobst 146863bf60 2008-02-05 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* Form.cs: If we change the active MDI child form, let the others
	know they need to repaint their title bar so it will appear inactive.
	[Fixes part 1 of bug #325473]

svn path=/branches/mono-1-9/mcs/; revision=94991
2008-02-06 04:31:10 +00:00
Andreia Gaita fd82166795 2008-02-06 Andreia Gaita <[email protected]>
[Backport to 1.9]
* Navigation.cs: Pass the proper flags to reload

svn path=/branches/mono-1-9/mcs/; revision=94989
2008-02-06 03:36:27 +00:00
Andreia Gaita a66c2664be 2008-02-05 Andreia Gaita <[email protected]>
[Backport to 1.9]
* XplatUIWin32.cs, XplatUICarbon.cs: set the hwnd.Mapped flag when we create 
the window so that the check on Control.UpdateZOrderOfChild passes on non-X
platforms. Fixes #359036

svn path=/branches/mono-1-9/mcs/; revision=94979
2008-02-06 01:20:48 +00:00
Jonathan Pobst 3c5ff3f112 2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* ListBoxTest.cs: Disable test that is default font dependent.

svn path=/branches/mono-1-9/mcs/; revision=94976
2008-02-06 00:55:09 +00:00
Marek Habersack c24f8893d8 Backport of r94971
svn path=/branches/mono-1-9/mcs/; revision=94972
2008-02-05 23:27:57 +00:00
Marek Habersack f88bcac76e Backport of r94968
svn path=/branches/mono-1-9/mcs/; revision=94969
2008-02-05 23:00:13 +00:00
Everaldo Canuto 80e8976130 2008-02-05 Everaldo Canuto <[email protected]>
[Backport to 1.9]
	* MenuAPI.cs: Check if control is disposable when track popup menu. Thanks
	Jonathan for this patch. Fixes #358442.


svn path=/branches/mono-1-9/mcs/; revision=94950
2008-02-05 21:03:53 +00:00
Marek Habersack fe5c27104f Backport of r94469
svn path=/branches/mono-1-9/mcs/; revision=94942
2008-02-05 20:22:27 +00:00
Marek Habersack a86712e017 backport of r94924
svn path=/branches/mono-1-9/mcs/; revision=94938
2008-02-05 20:15:57 +00:00
Ivan Zlatev 56e8e6273a 2008-02-05 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* MutilineStringEditor.cs: Make BorderStyle, Width and Height
	sensible.
	[Fixes #356530]


svn path=/branches/mono-1-9/mcs/; revision=94907
2008-02-05 17:30:34 +00:00
Ivan Zlatev f81b806058 2008-02-05 Ivan N. Zlatev <[email protected]>
* ColorEditor.cs: Set the Height to match the custom colors tab
	Height.
	[Fixes bug #356527]


svn path=/branches/mono-1-9/mcs/; revision=94903
2008-02-05 16:27:12 +00:00
Marek Habersack 41ca144a72 Backport of r94898
svn path=/branches/mono-1-9/mcs/; revision=94899
2008-02-05 15:53:38 +00:00
Ivan Zlatev 13e3ae40a9 2008-02-05 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	* PropertyGridView.cs: Do not trucate custom editors' width
	and align them to the left.
	[Fixes #356527 and #358349]


svn path=/branches/mono-1-9/mcs/; revision=94894
2008-02-05 15:35:29 +00:00
Jonathan Pobst 75260f9e81 2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* UpDownBase.cs: Make sure the internal textbox calls the base's
	OnMouseDown and OnMouseUp so the textbox will function correctly.
	There were notes saying it doesn't chain up, but its an internal
	class, so our implementation may differ.
	[Fixes bug #357482]

svn path=/branches/mono-1-9/mcs/; revision=94888
2008-02-05 14:53:40 +00:00
Jonathan Pobst 14ff54e757 2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* Control.cs: Remove HeightInternal.
	* ListBox.cs: Commit patch from James Purcell that correctly
	calculates heights for ListBoxen.
	[Fixes bug #357152]

svn path=/branches/mono-1-9/mcs/; revision=94887
2008-02-05 14:52:36 +00:00
Jonathan Pobst 7fe451d046 2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* Label.cs: Apply patch from James Purcell that corrects the 
	signature of the AutoSize property.
	[Fixes bug #357605]

svn path=/branches/mono-1-9/mcs/; revision=94886
2008-02-05 14:48:01 +00:00
Marek Habersack 7e75b72870 Backport of r94878
svn path=/branches/mono-1-9/mcs/; revision=94879
2008-02-05 13:03:07 +00:00
Marek Habersack 511c9adecf Backport of r94873
svn path=/branches/mono-1-9/mcs/; revision=94874
2008-02-05 12:13:54 +00:00
Marek Habersack 7cd6288fc6 Backport of r94869
svn path=/branches/mono-1-9/mcs/; revision=94870
2008-02-05 11:31:01 +00:00
Carlos Alberto Cortez a4988f3889 2008-02-04 Carlos Alberto Cortez <[email protected]>
[Backport to 1.9]
	* ListView.cs: In ItemControl.ItemsMouseMove, only fire ItemDrag event
	when the item in current position is different than 0. Also, save the
	item index in the beginning of the operation, instead of getting the
	index of the item when the event is actually performed. Lastly clean
	the related fields in ItemsMouseUp if the ItemDrag operation wasn't
	triggered.
	[Fixes #357873]


svn path=/branches/mono-1-9/mcs/; revision=94845
2008-02-05 04:33:46 +00:00
Geoff Norton e61dc1e89b In .:
* KeyboardHandler.cs: [Backport fix] msg != msg.message

2008-02-04  Geoff Norton  <[email protected]>


svn path=/branches/mono-1-9/mcs/; revision=94844
2008-02-05 04:25:44 +00:00
Geoff Norton 63b0b98afc In .:
* LineTag.cs: 
	* DataGriveViewCell.cs: More fixing the branch.  bmp_g is the instance
	variable, call the appropriate Property instead.
2008-02-04  Geoff Norton  <[email protected]>


svn path=/branches/mono-1-9/mcs/; revision=94843
2008-02-05 04:20:13 +00:00
Geoff Norton 187a102e2a In System.Windows.Forms:
* Control.cs: Fix the branch.  bmp_g is the instance variable, call the
	appropriate Property instead.

2008-02-04  Geoff Norton  <[email protected]>


svn path=/branches/mono-1-9/mcs/; revision=94841
2008-02-05 04:04:44 +00:00
Geoff Norton 24516aeabe In .:
2008-02-04  Geoff Norton  <[email protected]>

	* Hwnd.cs: [Backport] The conversion to Quartz coordinates happens in
	System.Drawing.  Removing this translation from here.


svn path=/branches/mono-1-9/mcs/; revision=94825
2008-02-05 01:03:26 +00:00
Ivan Zlatev 092f8596ab 2008-02-04 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	 * ColorEditor.cs: Perfom action in OnMouseUp only if in client.
	 [Fixes bug #358444]


svn path=/branches/mono-1-9/mcs/; revision=94821
2008-02-05 00:03:03 +00:00
Ivan Zlatev 0c4808b22c 2008-02-04 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	 * DateTimeConverterTests.cs: Test ConvertFrom with empty string.
	 * DateTimeConverter.cs: handle empty strings in ConvertFrom.


svn path=/branches/mono-1-9/mcs/; revision=94819
2008-02-05 00:01:22 +00:00
Ivan Zlatev ac48be8ec3 2008-02-04 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
	 * PropertyGrid.cs, PropertyGridView.cs, GridEntry.cs,
	 CategoryGridEntry.cs, RootGridEntry.cs, GridItem.cs,
	 GridItemCollection.cs:
	 PropertyGrid backport.


svn path=/branches/mono-1-9/mcs/; revision=94816
2008-02-04 23:53:43 +00:00
Geoff Norton 18fb74b024 In .:
2008-02-04  Geoff Norton  <[email protected]>

	* EventHandler.cs: [Backport] Expose GetEventClass internally.  Subscribe to
	the unicode text events.
	* KeyboardHandler.cs: [Backport] Commit the new keyboard handler.  We grab
	the unicode characters provided by apple and push them thru a translation
	table to generate windows style keyboard events. Control+key does not generate
	SYSKEY, it prevents SYSKEY (ctrl+alt+foo).  Also implement broken menu keyup
	filtering.  lParam should be cleared in the broken menu filter case.
	Commit support for the last batch of keytypes .(F1-12; Fn+modifiers; etc).
	Filter the translate call.


svn path=/branches/mono-1-9/mcs/; revision=94815
2008-02-04 23:23:34 +00:00
Zoltan Varga 5917d34218 Merge from HEAD.
svn path=/branches/mono-1-9/mono/; revision=94786
2008-02-04 21:22:54 +00:00
Marek Habersack 67b79ccf25 Backport of r94774
svn path=/branches/mono-1-9/mcs/; revision=94775
2008-02-04 19:38:32 +00:00
Marek Habersack 4268e0a712 Backport of r94770
svn path=/branches/mono-1-9/mcs/; revision=94771
2008-02-04 17:57:32 +00:00
Marek Safar 49c256b0c8 2008-02-01 Marek Safar <[email protected]>
A fix for bug #357255
 	* decl.cs: One more missing visibility check.


svn path=/branches/mono-1-9/mcs/; revision=94538
2008-02-01 17:48:25 +00:00
Marek Safar c1f9c48fba 2008-02-01 Marek Safar <[email protected]>
* support.cs: Fixed broken return.


svn path=/branches/mono-1-9/mcs/; revision=94527
2008-02-01 16:39:08 +00:00
Dick Porter afd04d879e 2008-02-01 Dick Porter <[email protected]>
* TcpClient.cs: If the Connect fails (when given an array of
	addresses) leave the socket object in a usable state.  Fixes bug
	355473.



svn path=/branches/mono-1-9/mcs/; revision=94524
2008-02-01 14:28:58 +00:00
Jonathan Pobst 65fdb3d442 2008-01-31 Jonathan Pobst <[email protected]>
[Backport to 1.9]
	* Control.cs: Remove my awesome optimization as it caused some
	regressions with control ordering.  :(
	[Fixes bug #357467]

svn path=/branches/mono-1-9/mcs/; revision=94517
2008-01-31 23:46:05 +00:00
Bill Holmes 38f2bec738 2008-01-31 William Holmes <[email protected]>
* process.c (process_module_string_read): Check the size returned form
	  VerQueryValue to avoid out of memory exception.


svn path=/branches/mono-1-9/mono/; revision=94497
2008-01-31 18:40:31 +00:00
Zoltan Varga efb92fc79f 2008-01-31 Zoltan Varga <[email protected]>
* mini.c: Fix a couple more soft-float issues.

svn path=/branches/mono-1-9/mono/; revision=94487
2008-01-31 17:56:46 +00:00
Ivan Zlatev 71464a4c62 2008-01-31 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: Fix a NRE on double click when there is no
	 selected object.


svn path=/branches/mono-1-9/mcs/; revision=94474
2008-01-31 16:28:57 +00:00
Sebastien Pouliot 13000f9324 2008-01-31 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Inverse name and oid when reading them from 
	machine.config. Part of the fix for #346536 
	[Backport r94458]


svn path=/branches/mono-1-9/mcs/; revision=94464
2008-01-31 14:15:42 +00:00
Sebastien Pouliot 208a65bee0 backport config changes for MD2 OID
svn path=/branches/mono-1-9/mono/; revision=94463
2008-01-31 14:13:55 +00:00
Jb Evain 14b266700f 2008-01-31 Jb Evain <[email protected]>
* AspGenerator.cs: correct typo. Fix #357547.
	Backport from trunk at r94456.


svn path=/branches/mono-1-9/mcs/; revision=94457
2008-01-31 13:34:22 +00:00
Zoltan Varga 832157656c 2008-01-30 Zoltan Varga <[email protected]>
* exceptions-x86.c (mono_arch_find_jit_info): Fix stack unwinding when an
	exception happens while compiling a virtual method.

svn path=/branches/mono-1-9/mono/; revision=94419
2008-01-30 20:58:49 +00:00
Atsushi Eno 48e294dac5 backport r94351.
svn path=/branches/mono-1-9/mcs/; revision=94352
2008-01-30 02:34:06 +00:00
Atsushi Eno 3015d251c6 backported r94280 and r94289.
svn path=/branches/mono-1-9/mcs/; revision=94291
2008-01-29 19:03:05 +00:00
Atsushi Eno c6967cc409 backported r94267 and r94268.
svn path=/branches/mono-1-9/mcs/; revision=94272
2008-01-29 17:23:13 +00:00
1047 changed files with 9980 additions and 38518 deletions

No files matched your search

-30
View File
@@ -1,33 +1,3 @@
2008-02-29 Miguel de Icaza <[email protected]>
* configure.in: Detect if there is an mcs1 command installed as
the external c# compiler, and if this is the compiler, pick this
to bootstrap.
You need to re-autogen.sh after the first installation of mono
with the new scripts.
2008-02-28 Miguel de Icaza <[email protected]>
* scripts/Makefile.am: Implement new defaults for the Mono 2.0
release, 2.0 profile executables are now the defaults (al, ilasm,
mkbundle, mono-api-info, monop, resgen, wsdl and mcs).
Old commands running under the 1.0 profile are still available
by having the number 1 appended to their command name (al1,
ilasm1, mcs1, mkbundle1, mono-api-info1, monop1, resgen1, wsdl1).
2008-02-05 Zoltan Varga <[email protected]>
* runtime/Makefile.am: Update after the changes to mcs/Makefile.
2008-02-03 Zoltan Varga <[email protected]>
* runtime/Makefile.am (clean-local): Use mono --wapi=semdel instead of the
nonexistent semdel utility.
* runtime/semdel-wrapper.in: Delete.
2008-01-28 Wade Berrier <[email protected]>
* configure.in: version bump -> 1.9
+3 -4
View File
@@ -30,10 +30,9 @@ For comments, corrections and updates, please contact [email protected]
This code is dual licensed under the LGPL or commercial licenses.
The LGPL ensures that Mono can be used in most scenarios, but
gives Novell the flexibility to relicense the code for
embedded systems, static linking or commercial settings where
the LGPL can not be used.
The LGPL ensures that Mono can be used in most scenarios, but
gives Novell the flexibility to relicense the code for embedded
systems or commercial settings where the LGPL can not be used.
Contact [email protected] for details on obtaining the Mono
runtime under other terms.
+2 -6
View File
@@ -729,9 +729,6 @@ dnl
if test x$platform_win32 = xno; then
dnl hires monotonic clock support
AC_SEARCH_LIBS(clock_gettime, rt)
dnl dynamic loader support
AC_CHECK_FUNC(dlopen, DL_LIB="",
AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", dl_support=no)
@@ -1928,8 +1925,6 @@ if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86" -o "x$TARGET" = "xALPHA"; t
fi
fi
AC_PATH_PROG(MCSCMD, mcs1, mcs1, mcs)
AC_MSG_CHECKING(if the Mono Debugger is supported on this platform)
if test "x$mono_debugger_supported" = "xyes"; then
AC_DEFINE(MONO_DEBUGGER_SUPPORTED,1,[The Mono Debugger is supported on this platform])
@@ -2059,6 +2054,7 @@ AC_SUBST(mono_cfg_dir)
AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
AC_CONFIG_FILES([runtime/monodis-wrapper],[chmod +x runtime/monodis-wrapper])
AC_CONFIG_FILES([runtime/semdel-wrapper],[chmod +x runtime/semdel-wrapper])
AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
[ depth=../../../..
@@ -2211,7 +2207,7 @@ fi
echo 'IL_FLAGS = /debug' >> $srcdir/$mcsdir/build/config.make
echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$mcsdir/build/config.make
echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $srcdir/$mcsdir/build/config.make
echo "EXTERNAL_MCS = $MCSCMD" >> $srcdir/$mcsdir/build/config.make
case $INSTALL in
[[\\/$]]* | ?:[[\\/]]* ) mcs_INSTALL=$INSTALL ;;
*) mcs_INSTALL=$mono_build_root/$INSTALL ;;
-4
View File
@@ -1,7 +1,3 @@
2008-02-29 Marek Habersack <[email protected]>
* machine.config: added an entry to ignore the browserCaps section.
2007-12-15 Marek Habersack <[email protected]>
* web.config: compilation/compilers are no longer necessary.
-1
View File
@@ -21,7 +21,6 @@
<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="authorization" type="System.Web.Configuration.AuthorizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="browserCaps" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />/>
<section name="clientTarget" type="System.Web.Configuration.ClientTargetSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="compilation" type="System.Web.Configuration.CompilationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="customErrors" type="System.Web.Configuration.CustomErrorsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+44 -91
View File
@@ -34,6 +34,10 @@
* 'prev' pointer of a doubly-linked list node is _not_ updated). Any
* invariant would require a post-processing pass to fix matters if
* necessary.
*
* Note: We refer to a list fragment as a "digit" because the code for
* maintaining the invariants of the core data structure parallels the
* code for incrementing the binary representation of a number.
*/
typedef list_node *digit;
@@ -42,34 +46,18 @@ typedef list_node *digit;
* = ceiling (log2 (maximum number of list nodes))
* = ceiling (log2 (maximum possible memory size/size of each list node))
* = number of bits in 'size_t' - floor (log2 (sizeof digit))
* Also, each list in sort_info is at least 2 nodes long: we can reduce the depth by 1
* Also, each "digit" is at least 2 nodes long: we can reduce the depth by 1
*/
#define FLOOR_LOG2(x) (((x)>=2) + ((x)>=4) + ((x)>=8) + ((x)>=16) + ((x)>=32) + ((x)>=64) + ((x)>=128))
#define MAX_RANKS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (list_node)) - 1)
#define MAX_DIGITS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (list_node)) - 1)
struct sort_info
{
int min_rank, n_ranks;
GCompareFunc func;
/* Invariant: ranks[i] == NULL || length(ranks[i]) >= 2**(i+1) */
list_node *ranks [MAX_RANKS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */
};
static inline void
init_sort_info (struct sort_info *si, GCompareFunc func)
{
si->min_rank = si->n_ranks = 0;
si->func = func;
/* we don't need to initialize si->ranks, since we never lookup past si->n_ranks. */
}
static inline list_node *
merge_lists (list_node *first, list_node *second, GCompareFunc func)
static inline digit
add_digits (digit first, digit second, GCompareFunc func)
{
/* merge the two lists */
list_node *list = NULL;
list_node **pos = &list;
digit list = NULL;
digit *pos = &list;
while (first && second) {
if (func (first->data, second->data) > 0) {
*pos = second;
@@ -84,89 +72,51 @@ merge_lists (list_node *first, list_node *second, GCompareFunc func)
return list;
}
/* Pre-condition: upto <= si->n_ranks, list == NULL || length(list) == 1 */
static inline list_node *
sweep_up (struct sort_info *si, list_node *list, int upto)
static inline digit
combine_digits (digit *digits, digit list, int n_digits, GCompareFunc func)
{
int i;
for (i = si->min_rank; i < upto; ++i) {
list = merge_lists (si->ranks [i], list, si->func);
si->ranks [i] = NULL;
}
for (i = 0; i < n_digits; ++i)
list = add_digits (digits [i], list, func);
return list;
}
/*
* The 'ranks' array essentially captures the recursion stack of a mergesort.
* The merge tree is built in a bottom-up manner. The control loop for
* updating the 'ranks' array is analogous to incrementing a binary integer,
* and the O(n) time for counting upto n translates to O(n) merges when
* inserting rank-0 lists. When we plug in the sizes of the lists involved in
* those merges, we get the O(n log n) time for the sort.
*
* Inserting higher-ranked lists reduce the height of the merge tree, and also
* eliminate a lot of redundant comparisons when merging two lists that would've
* been part of the same run. Adding a rank-i list is analogous to incrementing
* a binary integer by 2**i in one operation, thus sharing a similar speedup.
*
* When inserting higher-ranked lists, we choose to clear out the lower ranks
* in the interests of keeping the sort stable, but this makes analysis harder.
* Note that clearing the lower-ranked lists is O(length(list))-- thus it
* shouldn't affect the O(n log n) behaviour. IOW, inserting one rank-i list
* is equivalent to inserting 2**i rank-0 lists, thus even if we do i additional
* merges in the clearing-out (taking at most 2**i time) we are still fine.
* Given: length(list) == k
* Invariant: digit[i] == NULL || length(digit[i]) == k * 2**i
*/
#define stringify2(x) #x
#define stringify(x) stringify2(x)
/* Pre-condition: 2**(rank+1) <= length(list) < 2**(rank+2) (therefore: length(list) >= 2) */
static inline void
insert_list (struct sort_info *si, list_node* list, int rank)
static inline int
increment (digit *digits, digit list, int n_digits, GCompareFunc func)
{
int i;
if (rank > si->n_ranks) {
if (rank > MAX_RANKS) {
g_warning ("Rank '%d' should not exceed " stringify (MAX_RANKS), rank);
rank = MAX_RANKS;
}
list = merge_lists (sweep_up (si, NULL, si->n_ranks), list, si->func);
for (i = si->n_ranks; i < rank; ++i)
si->ranks [i] = NULL;
} else {
if (rank)
list = merge_lists (sweep_up (si, NULL, rank), list, si->func);
for (i = rank; i < si->n_ranks && si->ranks [i]; ++i) {
list = merge_lists (si->ranks [i], list, si->func);
si->ranks [i] = NULL;
}
for (i = 0; i < n_digits && digits [i]; i++) {
list = add_digits (digits [i], list, func);
digits [i] = NULL;
}
if (i == MAX_RANKS) /* Will _never_ happen: so we can just devolve into quadratic ;-) */
if (i == MAX_DIGITS) /* Will _never_ happen: so we can just devolve into quadratic ;-) */
--i;
if (i >= si->n_ranks)
si->n_ranks = i + 1;
si->min_rank = i;
si->ranks [i] = list;
if (i == n_digits)
++n_digits;
digits [i] = list;
return n_digits;
}
#undef stringify2
#undef stringify
#undef MAX_RANKS
#undef FLOOR_LOG2
/* A non-recursive mergesort */
/*
* A mergesort that avoids recursion. The 'digits' array essentially
* captures the recursion stack. The actual merge tree is built in a
* bottom-up manner. It's "counting", since we "increment" a set of
* "digit"s.
*/
static inline digit
do_sort (list_node* list, GCompareFunc func)
do_sort (digit list, GCompareFunc func)
{
struct sort_info si;
init_sort_info (&si, func);
int n_digits = 0;
digit digits [MAX_DIGITS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */
while (list && list->next) {
list_node* next = list->next;
list_node* tail = next->next;
digit next = list->next;
digit tail = next->next;
if (func (list->data, next->data) > 0) {
next->next = list;
@@ -175,10 +125,13 @@ do_sort (list_node* list, GCompareFunc func)
}
next->next = NULL;
insert_list (&si, list, 0);
n_digits = increment (digits, list, n_digits, func);
list = tail;
}
return sweep_up (&si, list, si.n_ranks);
return combine_digits (digits, list, n_digits, func);
}
#undef MAX_DIGITS
#undef FLOOR_LOG2
-5
View File
@@ -1,8 +1,3 @@
2008-02-07 Massimiliano Mantione <[email protected]>
* include/gc.h: (GCEventType): Added start-stop the world events.
* pthread_stop_world.c: (GC_stop_world and GC_start_world): hooked
start-stop the world events.
2007-11-05 Geoff Norton <[email protected]>
* darwin_stop_world.c: Correct the structure name on Darwin-x86 for Leopard.
+1 -5
View File
@@ -98,11 +98,7 @@ typedef enum {
GC_EVENT_MARK_END,
GC_EVENT_RECLAIM_START,
GC_EVENT_RECLAIM_END,
GC_EVENT_END,
GC_EVENT_PRE_STOP_WORLD,
GC_EVENT_POST_STOP_WORLD,
GC_EVENT_PRE_START_WORLD,
GC_EVENT_POST_START_WORLD
GC_EVENT_END
} GCEventType;
GC_API void (*GC_notify_event) GC_PROTO((GCEventType event_type));
-8
View File
@@ -414,8 +414,6 @@ static void pthread_stop_world()
/* Caller holds allocation lock. */
void GC_stop_world()
{
if (GC_notify_event)
GC_notify_event (GC_EVENT_PRE_STOP_WORLD);
/* Make sure all free list construction has stopped before we start. */
/* No new construction can start, since free list construction is */
/* required to acquire and release the GC lock before it starts, */
@@ -435,8 +433,6 @@ void GC_stop_world()
# ifdef PARALLEL_MARK
GC_release_mark_lock();
# endif
if (GC_notify_event)
GC_notify_event (GC_EVENT_POST_STOP_WORLD);
}
/* Caller holds allocation lock, and has held it continuously since */
@@ -453,8 +449,6 @@ static void pthread_start_world()
# if DEBUG_THREADS
GC_printf0("World starting\n");
# endif
if (GC_notify_event)
GC_notify_event (GC_EVENT_PRE_START_WORLD);
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
@@ -494,8 +488,6 @@ static void pthread_start_world()
}
}
if (GC_notify_event)
GC_notify_event (GC_EVENT_POST_START_WORLD);
#if DEBUG_THREADS
GC_printf0("World started\n");
#endif
-5
View File
@@ -1,8 +1,3 @@
2007-12-08 Jonathan Pryor <[email protected]>
* wsdl.1: Fix groff comment (so that it doesn't appear in monodoc's
man-provider output).
2007-12-08 Marek Habersack <[email protected]>
* mono.1: added short documentation about the
+1 -1
View File
@@ -1,4 +1,4 @@
.\"
\"
.\" wsdl manual page.
.\" (C) 2003 Novell, Inc.
.\" Author:
+1 -19
View File
@@ -1,21 +1,3 @@
2008-02-18 Raja R Harinath <[email protected]>
* Makefile (net_2_0_centum_tests): Add System.Xml.Linq here.
2008-02-17 Raja R Harinath <[email protected]>
* Makefile (_boot_): Orchestrate the net_2_1 bootstrap.
(net_2_1_bootstrap_SUBDIRS, net_2_1_raw_SUBDIRS): New.
2008-02-06 Zoltan Varga <[email protected]>
* Makefile (dir-check): Hopefully fix make dist.
2008-02-05 Zoltan Varga <[email protected]>
* Makefile: Abort with an error message if make is typed directly in this
directory, instead from the 'mono' directory.
2007-12-06 Atsushi Enomoto <[email protected]>
* Makefile: currently Sys.Web.Extensions is not ready for
@@ -24,7 +6,7 @@
2007-12-04 Marek Safar <[email protected]>
* Makefile: Added more tests.
2007-12-03 Marek Safar <[email protected]>
* Makefile: Added 3.5 profile, it probably not used here.
+27 -36
View File
@@ -6,49 +6,45 @@ basic_SUBDIRS := build jay mcs class
net_1_1_bootstrap_SUBDIRS := build jay mcs class ilasm tools
net_2_0_bootstrap_SUBDIRS := build jay mcs class ilasm tools
net_2_0_SUBDIRS := build jay mcs class nunit20 ilasm tools tests errors
net_2_1_bootstrap_SUBDIRS := build mcs class
net_2_1_raw_SUBDIRS := build mcs class tools
net_2_1_SUBDIRS := tools tests errors
net_2_1_SUBDIRS := build mcs class tools
net_3_5_SUBDIRS := build class
# List of test subdirs that should pass 100%
centum_tests := \
class/corlib \
class/System \
class/System.XML \
class/Commons.Xml.Relaxng \
class/Cscompmgd \
class/Microsoft.JScript \
class/Mono.Posix \
class/Mono.Security \
class/System.Messaging \
class/System.Runtime.Remoting \
class/System.Runtime.Serialization.Formatters.Soap \
class/System.Security \
class/System.ServiceProcess \
class/System.Web.Services \
tests \
class/corlib \
class/System \
class/System.XML \
class/Commons.Xml.Relaxng \
class/Cscompmgd \
class/Microsoft.JScript \
class/Mono.Posix \
class/Mono.Security \
class/System.Messaging \
class/System.Runtime.Remoting \
class/System.Runtime.Serialization.Formatters.Soap \
class/System.Security \
class/System.ServiceProcess \
class/System.Web.Services \
tests \
errors
default_centum_tests := \
default_centum_tests := \
$(centum_tests) \
class/System.Data
net_2_0_centum_tests := \
$(centum_tests) \
$(centum_tests) \
class/System.Core \
class/System.Configuration \
class/System.Xml.Linq \
class/Microsoft.Build.Framework \
class/Microsoft.Build.Utilities \
class/System.Configuration \
class/Microsoft.Build.Framework \
class/Microsoft.Build.Utilities \
class/Microsoft.Build.Engine
#class/Microsoft.Build.Tasks
#class/Mono.C5
# note that System.Xml.Linq is here to prevent this from being empty
#class/Microsoft.Build.Tasks
#class/Mono.C5
net_3_5_centum_tests := \
class/System.Xml.Linq
#class/System.Web.Extensions
#class/System.Web.Extensions
ifdef ONLY_CENTUM_TESTS
TEST_SUBDIRS := $($(PROFILE)_centum_tests)
@@ -60,15 +56,12 @@ endif
include build/rules.make
all-recursive $(STD_TARGETS:=-recursive): dir-check platform-check profile-check
all-recursive $(STD_TARGETS:=-recursive): platform-check profile-check
.PHONY: all-local $(STD_TARGETS:=-local)
all-local $(STD_TARGETS:=-local):
@:
dir-check:
@if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then echo "Running make from the mcs directory is not supported. Run make from the parent directory (if using a tarball), or from the directory where the runtime is checked out (if using an SVN checkout)."; exit 1; fi
# fun specialty targets
PROFILES = default net_2_0 net_3_5
@@ -91,9 +84,7 @@ profiles-do--run-test:
# Orchestrate the bootstrap here.
_boot_ = all clean install
$(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_2_1--%): profile-do--net_2_1--%: profile-do--net_2_1_raw--%
$(_boot_:%=profile-do--net_2_1_raw--%): profile-do--net_2_1_raw--%: profile-do--net_2_1_bootstrap--%
$(_boot_:%=profile-do--net_2_1_bootstrap--%): profile-do--net_2_1_bootstrap--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_2_1--%): profile-do--net_2_1--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--net_2_0_bootstrap--%
$(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--default--%
$(_boot_:%=profile-do--default--%): profile-do--default--%: profile-do--net_1_1_bootstrap--%
-11
View File
@@ -1,14 +1,3 @@
2008-02-18 Raja R Harinath <[email protected]>
* rules.make (%/.stamp): Unify all directory creation targets here.
2008-02-17 Raja R Harinath <[email protected]>
* profiles/net_2_1_bootstrap.make: New.
* profiles/net_2_1_raw.make: New. The untuned 2.1 profile.
* profiles/net_2_1.make: New. The tuned 2.1 profile.
* Makefile (PROFILES): Update.
2007-12-06 Atsushi Enomoto <[email protected]>
* profiles/net_3_5.make : fixed net_2_0 path.
-2
View File
@@ -21,8 +21,6 @@ PROFILES = \
default \
net_2_0_bootstrap \
net_2_0 \
net_2_1_bootstrap \
net_2_1_raw \
net_2_1 \
net_1_0 \
net_3_5
+6
View File
@@ -87,6 +87,12 @@ ifndef PROGRAM_COMPILE
PROGRAM_COMPILE = $(CSCOMPILE)
endif
ifdef prog_dir
$(prog_dir)/.stamp:
$(MKINSTALLDIRS) $(@D)
touch $@
endif
$(PROGRAM): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(prog_dir:=/.stamp)
$(PROGRAM_COMPILE) -target:exe -out:$(base_prog) $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
ifneq ($(base_prog),$(PROGRAM))
+4
View File
@@ -297,6 +297,10 @@ endif
# The library
$(the_libdir)/.stamp $(build_libdir:=/.stamp):
$(MKINSTALLDIRS) $(@D)
touch $@
$(the_lib): $(the_libdir)/.stamp
$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir:=/.stamp)
+4 -6
View File
@@ -1,12 +1,10 @@
#! -*- makefile -*-
my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
INTERNAL_SMCS = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack $(topdir)/class/lib/net_2_1/smcs.exe
BOOTSTRAP_PROFILE = net_2_1_bootstrap
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
BOOTSTRAP_PROFILE = net_2_1
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_1$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
MCS = MONO_PATH="$(topdir)/class/lib/net_2_1$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
profile-check:
@:
-17
View File
@@ -1,17 +0,0 @@
#! -*- makefile -*-
INTERNAL_SMCS = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack $(topdir)/class/lib/$(PROFILE)/smcs.exe
BOOTSTRAP_PROFILE = net_2_0
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
profile-check:
@:
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
# the tuner takes care of the install
NO_INSTALL = yes
-19
View File
@@ -1,19 +0,0 @@
#! -*- makefile -*-
my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
BOOTSTRAP_PROFILE = net_2_1_bootstrap
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
profile-check:
@:
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
# the tuner takes care of the install
NO_INSTALL = yes
+1 -1
View File
@@ -162,7 +162,7 @@ dist-default:
$(MKINSTALLDIRS) $$dest && cp -p $$f $$dest || exit 1 ; \
done
%/.stamp:
$(depsdir)/.stamp:
$(MKINSTALLDIRS) $(@D)
touch $@
+4 -5
View File
@@ -1,11 +1,10 @@
2008-02-17 Raja R Harinath <ha[email protected]>
2008-03-03 Marek Habersack <mha[email protected]>
* Makefile (net_3_5_dirs): Remove System.Xml.Linq, now that it's
built in the 2.0 profile.
* Makefile: Move Mono.Web back to the common section.
2008-02-11 Andrew Jorgensen <ajorgensen@novell.com>
2008-03-03 Marek Safar <marek.safar@gmail.com>
* Makefile: build System.Xml.Linq in the 2.0 profile
* Makefile: Moved Mono.Web to 2.0 section.
2007-12-19 Jb Evain <[email protected]>
@@ -72,12 +72,10 @@
<asp:BoundField DataField="Role" HeaderText="Role Name" >
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Add\Remove Role">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" NavigateUrl='<%# string.Format("ManageRole.aspx?Role={0}", HttpUtility.UrlEncode((string)Eval("Role"))) %>'
Text="Manage" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="Role" DataNavigateUrlFormatString="ManageRole.aspx?Role={0}"
HeaderText="Add\Remove Role" Text="Manage" >
<HeaderStyle HorizontalAlign="Left" />
</asp:HyperLinkField>
<asp:TemplateField>
<ItemTemplate>
<custom:GridButton ID="grid_btn" runat="server" User='<%# Bind("Role") %>' OnClick="gridbtn_click" >Delete</custom:GridButton>
@@ -77,12 +77,8 @@
<asp:BoundField DataField="User" HeaderText="User Name" >
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink NavigateUrl='<%# string.Format("EditUser.aspx?User={0}", HttpUtility.UrlEncode((string)Eval("User"))) %>'
Text="Edit User" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="User" DataNavigateUrlFormatString="EditUser.aspx?User={0}"
Text="Edit User" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<custom:GridButton ID="GridButton1" runat="server" User='<%# Bind("User") %>' OnClick="Delete_Click" >Delete User</custom:GridButton>
@@ -57,47 +57,5 @@ namespace Mainsoft.Web.Hosting
Trace.WriteLine ("Exiting getComponentStateToSave");
return serializedComponentStates;
}
protected void SaveStateInClient (FacesContext facesContext, StateManager.SerializedView serializedView) {
//UIViewRoot uiViewRoot = facesContext.getViewRoot ();
////save state in response (client-side: full state; server-side: sequence)
//RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, uiViewRoot.getRenderKitId ());
//// not us.
//renderKit.getResponseStateManager ().writeState (facesContext, serializedView);
java.io.ByteArrayOutputStream bytearrayoutputstream = new java.io.ByteArrayOutputStream ();
java.io.ObjectOutputStream objectoutputstream = new java.io.ObjectOutputStream (bytearrayoutputstream);
//ignore tree structure
//objectoutputstream.writeObject (serializedView.getStructure ());
objectoutputstream.writeObject (serializedView.getState ());
objectoutputstream.close ();
bytearrayoutputstream.close ();
string s = " <input type=\"hidden\" name=\"" + VIEWSTATE + "\" id=\"" + VIEWSTATE + "\" value=\"" +
Convert.ToBase64String ((byte []) vmw.common.TypeUtils.ToByteArray (bytearrayoutputstream.toByteArray ())) + "\" />\n ";
facesContext.getResponseWriter ().write (s);
}
protected object GetStateFromClient (FacesContext facesContext, String viewId, String renderKitId) {
//RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, renderKitId);
//ResponseStateManager responseStateManager = renderKit.getResponseStateManager ();
//responseStateManager.getTreeStructureToRestore (facesContext, viewId); //ignore result. Must call for compatibility with sun implementation.
//return responseStateManager.getComponentStateToRestore (facesContext);
java.util.Map map = facesContext.getExternalContext ().getRequestParameterMap ();
string s1 = (string) map.get (VIEWSTATE);
byte [] buffer = Convert.FromBase64String (s1);
java.io.ByteArrayInputStream bytearrayinputstream = new java.io.ByteArrayInputStream (vmw.common.TypeUtils.ToSByteArray (buffer));
java.io.ObjectInputStream inputStream = new java.io.ObjectInputStream (bytearrayinputstream);
//ignore tree structure
//inputStream.readObject ();
object state = inputStream.readObject ();
inputStream.close ();
bytearrayinputstream.close ();
return state;
}
}
}
@@ -83,14 +83,10 @@ namespace Mainsoft.Web.Hosting
override public void init(ServletConfig config)
{
base.init(config);
InitRuntime (config, this, CreateDeserializer ());
InitRuntime (config, this);
}
protected virtual vmw.@internal.io.IObjectsDeserializer CreateDeserializer () {
return null;
}
public static void InitRuntime (ServletConfig config, object evidence, vmw.@internal.io.IObjectsDeserializer deserializer) {
public static void InitRuntime (ServletConfig config, object evidence) {
ServletContext context = config.getServletContext ();
@@ -122,8 +118,6 @@ namespace Mainsoft.Web.Hosting
//servletDomain.SetData (J2EEConsts.CLASS_LOADER, vmw.common.TypeUtils.ToClass (evidence).getClassLoader ());
//servletDomain.SetData(J2EEConsts.SERVLET_CONFIG, config);
servletDomain.SetData (J2EEConsts.RESOURCE_LOADER, new ServletResourceLoader (context));
if (deserializer != null)
servletDomain.SetData (J2EEConsts.DESERIALIZER_CONST, deserializer);
lock (evidence) {
if (context.getAttribute (J2EEConsts.APP_DOMAIN) == null)
@@ -23,7 +23,11 @@ namespace Mainsoft.Web.Hosting
if (serializedView != null) {
if (isSavingStateInClient (facesContext)) {
SaveStateInClient (facesContext, serializedView);
UIViewRoot uiViewRoot = facesContext.getViewRoot ();
//save state in response (client-side: full state; server-side: sequence)
RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, uiViewRoot.getRenderKitId ());
// not us.
renderKit.getResponseStateManager ().writeState (facesContext, serializedView);
}
else {
HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (true);
@@ -43,7 +47,10 @@ namespace Mainsoft.Web.Hosting
Object serializedComponentStates;
if (isSavingStateInClient (facesContext)) {
serializedComponentStates = GetStateFromClient (facesContext, uiViewRoot.getViewId(), renderKitId);
RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, renderKitId);
ResponseStateManager responseStateManager = renderKit.getResponseStateManager ();
responseStateManager.getTreeStructureToRestore (facesContext, uiViewRoot.getViewId ()); //ignore result. Must call for compatibility with sun implementation.
serializedComponentStates = responseStateManager.getComponentStateToRestore (facesContext);
}
else {
HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (false);
@@ -78,8 +78,9 @@ namespace Mainsoft.Web.Hosting
return _HttpServletRequest.getServerPort ();
}
public override string GetPathInfo () {
return base.GetPathInfo () ?? String.Empty;
public override string GetPathInfo () {
string pathInfo = base.GetPathInfo() ?? _HttpServletRequest.getPathInfo ();
return pathInfo ?? String.Empty;
}
public override string GetQueryString () {
@@ -154,6 +155,10 @@ namespace Mainsoft.Web.Hosting
return _HttpServletRequest.getRemoteUser ();
}
protected override int getServerPort () {
return _HttpServletRequest.getServerPort ();
}
protected override java.util.Enumeration getHeaderNames () {
return _HttpServletRequest.getHeaderNames ();
}
@@ -42,8 +42,7 @@ using java.security;
namespace Mainsoft.Web.Hosting {
[MonoTODO("Implement security demands on the path usage functions (and review)")]
[ComVisible (false)]
public abstract class BaseWorkerRequest : HttpWorkerRequest, IHttpExtendedWorkerRequest, IServiceProvider
{
public abstract class BaseWorkerRequest : HttpWorkerRequest, IServiceProvider {
OutputStreamWrapper _OutputStream;
readonly string _contextPath;
@@ -187,7 +186,7 @@ namespace Mainsoft.Web.Hosting {
string uri = GetUriPath();
string pathInfo = GetPathInfo();
if (pathInfo != null && pathInfo.Length > 0)
uri = uri.Substring (0, uri.Length - pathInfo.Length);
uri = uri.Substring(0, uri.Length - pathInfo.Length);
return uri;
}
@@ -247,6 +246,7 @@ namespace Mainsoft.Web.Hosting {
protected abstract int getContentLength ();
protected abstract string getContentType ();
public abstract string GetRemoteUser ();
protected abstract int getServerPort ();
protected abstract string getHeader (string name);
protected abstract java.util.Enumeration getHeaderNames ();
protected abstract InputStream getInputStream ();
@@ -272,7 +272,7 @@ namespace Mainsoft.Web.Hosting {
case KnownServerVariable.REQUEST_URI : return GetUriPath();
case KnownServerVariable.SCRIPT_NAME : return GetFilePath ();
case KnownServerVariable.SERVER_NAME : return GetServerName();
case KnownServerVariable.SERVER_PORT : return Convert.ToString(GetLocalPort());
case KnownServerVariable.SERVER_PORT : return Convert.ToString(getServerPort());
case KnownServerVariable.SERVER_PROTOCOL : return GetHttpVersion ();
case KnownServerVariable.SERVER_SOFTWARE : return GetContext().getServerInfo();
case KnownServerVariable.PATH_INFO : return GetPathInfo();
@@ -163,7 +163,7 @@ namespace Mainsoft.Web.Security
int returnValue = DerbyRolesHelper.UsersInRoles_FindUsersInRole (connection, applicationName, roleName, usernameToMatch, out reader);
if (returnValue == 2)
throw new ProviderException ("The role '" + roleName + "' was not found.");
throw new ProviderException ("roleName was not found in the database");
using (reader) {
if (reader == null)
@@ -234,7 +234,7 @@ namespace Mainsoft.Web.Security
int returnValue = DerbyRolesHelper.UsersInRoles_GetUsersInRoles (connection, applicationName, rolename, out reader);
if (returnValue == 2)
throw new ProviderException ("The role '" + rolename + "' was not found.");
throw new ProviderException ("rolename was not found in the database");
using (reader) {
if (reader == null)
@@ -59,8 +59,5 @@ namespace Mainsoft.Web.Hosting
public const string FILESYSTEM_ACCESS = "WebFileSystemAccess";
public const string ACCESS_FULL = "Full";
public const string ACCESS_VIRTUAL = "Virtual";
public const string ACTION_URL_PREFIX = "ActionURL:";
public const string RENDER_URL_PREFIX = "RenderURL:";
}
}
+6 -7
View File
@@ -104,7 +104,6 @@ net_2_0_dirs := \
System.Core \
System.Web.Extensions \
System.Web.Extensions.Design \
System.Xml.Linq \
Microsoft.Build.Framework \
Microsoft.Build.Utilities \
Microsoft.Build.Engine \
@@ -113,17 +112,17 @@ net_2_0_dirs := \
net_2_1_dirs := \
corlib \
System \
System.Xml.Core \
System.Core
System.Xml.Core \
System.Core \
net_3_5_dirs := \
System.Xml.Linq \
System.Web.Extensions \
System.Web.Extensions.Design
System.Web.Extensions.Design \
default_SUBDIRS := $(common_dirs) $(default_dirs)
net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs)
net_2_1_bootstrap_SUBDIRS := $(net_2_1_dirs)
net_2_1_raw_SUBDIRS := $(net_2_1_dirs)
net_2_1_SUBDIRS := $(net_2_1_dirs)
net_3_5_SUBDIRS := $(net_3_5_dirs)
include ../build/rules.make
@@ -136,7 +135,7 @@ SUBDIRS = $(common_dirs) $(default_dirs) $(net_2_0_dirs) $(net_2_1_dirs) $(net_3
BROKEN_SUBDIRS =
DIST_ONLY_SUBDIRS = \
$(BROKEN_SUBDIRS)
$(BROKEN_SUBDIRS) Mono.Web
# No new makefiles for: System.Messaging, System.Web.Mobile,
# System.ServiceProcess
-15
View File
@@ -1,18 +1,3 @@
2008-02-19 Jonathan Pobst <[email protected]>
* System.Windows.Forms_test.dll.sources: Added SelectionRangeTest.cs.
2008-02-06 Andreia Gaita <[email protected]>
* build-csproj2k5: fixed mono.mozilla project guid
* SWF2K5.csproj: synched to sources
* SWF2k5.sln: updated with proper mono.mozilla guid
2008-02-04 Carlos Alberto Cortez <[email protected]>
* System.Windows.Forms_test.dll.sources: Added
BindingsCollectionTest.cs.
2008-01-26 Gert Driesen <[email protected]>
* System.Windows.Forms.dll.sources: Moved PropertiesTab.cs from
@@ -150,7 +150,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mono.Mozilla\Mono.Mozilla2K5.csproj">
<Project>{5E6C996A-007F-40CE-B244-006EFCFB77D2}</Project>
<Project>{3A1F2BAF-B92F-4F90-8250-A0F04ACCEAD0}</Project>
<Name>Mono.Mozilla2K5</Name>
</ProjectReference>
</ItemGroup>
@@ -173,7 +173,6 @@
<Compile Include="System.Windows.Forms.Design\ToolStripItemDesignerAvailability.cs" />
<Compile Include="System.Windows.Forms.Design\ToolStripItemDesignerAvailabilityAttribute.cs" />
<Compile Include="System.Windows.Forms.Design\WindowsFormsComponentEditor.cs" />
<Compile Include="System.Windows.Forms.PropertyGridInternal\PropertiesTab.cs" />
<Compile Include="System.Windows.Forms.RTF\Charcode.cs" />
<Compile Include="System.Windows.Forms.RTF\Charset.cs" />
<Compile Include="System.Windows.Forms.RTF\CharsetFlags.cs" />
@@ -695,6 +694,7 @@
<Compile Include="System.Windows.Forms\ProgressBar.cs" />
<Compile Include="System.Windows.Forms\ProgressBarRenderer.cs" />
<Compile Include="System.Windows.Forms\ProgressBarStyle.cs" />
<Compile Include="System.Windows.Forms\PropertiesTab.cs" />
<Compile Include="System.Windows.Forms\PropertyGrid.cs" />
<Compile Include="System.Windows.Forms\PropertyGridCommands.cs" />
<Compile Include="System.Windows.Forms\PropertyGridTextBox.cs" />
+10 -12
View File
@@ -1,8 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWF2k5", "SWF2k5.csproj", "{5E6430B2-6B9F-4E76-802E-20207EF80391}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Mozilla2K5", "..\Mono.Mozilla\Mono.Mozilla2K5.csproj", "{5E6C996A-007F-40CE-B244-006EFCFB77D2}"
# Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWF", "SWF2k5.csproj", "{5E6430B2-6B9F-4E76-802E-20207EF80391}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,14 +18,14 @@ Global
{5E6430B2-6B9F-4E76-802E-20207EF80391}.Release 2.0|Any CPU.Build.0 = Release 2.0|Any CPU
{5E6430B2-6B9F-4E76-802E-20207EF80391}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E6430B2-6B9F-4E76-802E-20207EF80391}.Release|Any CPU.Build.0 = Release|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug 2.0|Any CPU.ActiveCfg = Debug|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug 2.0|Any CPU.Build.0 = Debug|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release 2.0|Any CPU.ActiveCfg = Release|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release 2.0|Any CPU.Build.0 = Release|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release|Any CPU.Build.0 = Release|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Debug 2.0|Any CPU.ActiveCfg = Debug|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Debug 2.0|Any CPU.Build.0 = Debug|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Release 2.0|Any CPU.ActiveCfg = Release|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Release 2.0|Any CPU.Build.0 = Release|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{788D0CB1-4C79-4787-A0CE-07A24774B6A5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1,8 +1,3 @@
2008-02-26 Geoff Norton <[email protected]>
* WindowHandler.cs: Send WM_CLOSE instead of WM_DESTROY. Fixes
#364281
2008-02-14 Geoff Norton <[email protected]>
* WindowHandler.cs: Ensure we send WM_ACTIVATE when we activate our
@@ -10,35 +5,19 @@
2008-02-04 Geoff Norton <[email protected]>
* KeyboardHandler.cs: Filter the translate call.
* KeyboardHandler.cs: [Backport fix] msg != msg.message
2008-02-04 Geoff Norton <[email protected]>
* KeyboardHandler.cs: Commit support for the last batch of keytypes
(F1-12; Fn+modifiers; etc).
2008-02-04 Geoff Norton <[email protected]>
* KeyboardHandler.cs: lParam should be cleared in the broken menu
filter case.
2008-02-04 Geoff Norton <[email protected]>
* KeyboardHandler.cs: Control+key does not generate SYSKEY, it prevents
SYSKEY (ctrl+alt+foo). Also implement broken menu keyup filtering.
2008-02-04 Geoff Norton <[email protected]>
* KeyboardHandler.cs: Control+key generates SYSKEY/SYSCHAR as well
as Alt+key.
2008-02-04 Geoff Norton <[email protected]>
* EventHandler.cs: Expose GetEventClass internally. Subscribe to
* EventHandler.cs: [Backport] Expose GetEventClass internally. Subscribe to
the unicode text events.
* KeyboardHandler.cs: Commit the new keyboard handler. We grab
* KeyboardHandler.cs: [Backport] Commit the new keyboard handler. We grab
the unicode characters provided by apple and push them thru a translation
table to generate windows style keyboard events.
table to generate windows style keyboard events. Control+key does not generate
SYSKEY, it prevents SYSKEY (ctrl+alt+foo). Also implement broken menu keyup
filtering. lParam should be cleared in the broken menu filter case.
Commit support for the last batch of keytypes .(F1-12; Fn+modifiers; etc).
Filter the translate call.
2008-01-28 Geoff Norton <[email protected]>
@@ -140,7 +140,7 @@ namespace System.Windows.Forms.CarbonInternal {
}
break;
case kEventWindowClose:
NativeWindow.WndProc (hwnd.Handle, Msg.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
NativeWindow.WndProc (hwnd.Handle, Msg.WM_DESTROY, IntPtr.Zero, IntPtr.Zero);
return false;
case kEventWindowShown: {
msg.message = Msg.WM_SHOWWINDOW;
@@ -1,8 +1,3 @@
2008-02-19 Jonathan Pobst <[email protected]>
* FlowLayout.cs: Take padding into account when determining if there
is still room left on a row. [Fixes bug #361448]
2008-01-23 Jonathan Pobst <[email protected]>
* TableLayout.cs: Don't include Dock.Fill, multicolumn/multirow spanned
@@ -124,7 +124,7 @@ namespace System.Windows.Forms.Layout
// Decide if it's time to start a new row
// - Our settings must be WrapContents, and we ran out of room or the previous control's FlowBreak == true
if (settings.WrapContents && !(parent is ToolStripPanel))
if ((parentDisplayRectangle.Width + parentDisplayRectangle.Left - currentLocation.X) < (c.Width + c.Margin.Left + c.Margin.Right) || forceFlowBreak) {
if ((parentDisplayRectangle.Width - currentLocation.X) < (c.Width + c.Margin.Left + c.Margin.Right) || forceFlowBreak) {
currentLocation.Y = FinishRow (rowControls);
currentLocation.X = parentDisplayRectangle.Left;
@@ -164,7 +164,7 @@ namespace System.Windows.Forms.Layout
// Decide if it's time to start a new column
// - Our settings must be WrapContents, and we ran out of room or the previous control's FlowBreak == true
if (settings.WrapContents)
if ((parentDisplayRectangle.Height + parentDisplayRectangle.Top - currentLocation.Y) < (c.Height + c.Margin.Top + c.Margin.Bottom) || forceFlowBreak) {
if ((parentDisplayRectangle.Height - currentLocation.Y) < (c.Height + c.Margin.Top + c.Margin.Bottom) || forceFlowBreak) {
currentLocation.X = FinishColumn (rowControls);
currentLocation.Y = parentDisplayRectangle.Top;
@@ -1,7 +1,3 @@
2008-01-29 Jonathan Pobst <[email protected]>
* Picture.cs: Don't create a bitmap just to get the dpi.
2007-12-19 Jonathan Pobst <[email protected]>
* RTF.cs: Patch from Luke Page that ignores CRLF during tokenisation
@@ -42,7 +42,9 @@ namespace System.Windows.Forms.RTF {
static Picture ()
{
dpix = TextRenderer.GetDpi ().Width;
Bitmap b = new Bitmap (1, 1);
Graphics g = Graphics.FromImage (b);
dpix = g.DpiX;
}
public Picture ()
@@ -1,25 +1,20 @@
2008-02-25 Jonathan Pobst <monkey@jpobst.com>
* LabelPainter.cs: Take Padding into account when drawing
the label text.
2008-01-23 Everaldo Canuto <[email protected]>
* LabelPainter.cs: Added.
2008-01-22 Everaldo Canuto <[email protected]>
* LinkLabelPainter.cs: Change Draw method to virtual.
2008-01-22 Everaldo Canuto <[email protected]>
* LinkLabelPainter.cs: Added.
2007-09-04 Everaldo Canuto <[email protected]>
* CheckBoxPainter.cs: Adjust checkbox light color to ControlLightLight to
mimic win32 look. Fixes #82656 (2.0).
2008-01-23 Everaldo Canuto <ecanuto@novell.com>
* LabelPainter.cs: Added.
2008-01-22 Everaldo Canuto <[email protected]>
* LinkLabelPainter.cs: Change Draw method to virtual.
2008-01-22 Everaldo Canuto <[email protected]>
* LinkLabelPainter.cs: Added.
2007-09-04 Everaldo Canuto <[email protected]>
* CheckBoxPainter.cs: Adjust checkbox light color to ControlLightLight to
mimic win32 look. Fixes #82656 (2.0).
2007-08-28 Jonathan Pobst <[email protected]>
* RadioButtonPainter.cs: Added.
@@ -20,8 +20,8 @@
// Copyright (c) 2007 Novell, Inc.
//
// Authors:
// Everaldo Canuto ([email protected])
// Everaldo Canuto ([email protected])
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
@@ -33,29 +33,20 @@ namespace System.Windows.Forms.Theming.Default
public LabelPainter ()
{
}
public virtual void Draw (Graphics dc, Rectangle client_rectangle, Label label)
{
Rectangle r;
#if NET_2_0
Padding p = label.Padding;
r = new Rectangle (client_rectangle.Left + p.Left, client_rectangle.Top + p.Top, client_rectangle.Width - p.Horizontal, client_rectangle.Height - p.Vertical);
#else
r = client_rectangle;
#endif
label.DrawImage (dc, label.Image, r, label.ImageAlign);
if (label.Enabled) {
dc.DrawString (label.Text, label.Font, ThemeEngine.Current.ResPool.GetSolidBrush (label.ForeColor), r, label.string_format);
} else {
ControlPaint.DrawStringDisabled (dc, label.Text, label.Font, label.BackColor, r, label.string_format);
}
}
public virtual Size DefaultSize {
get { return new Size (100, 23); }
}
}
public virtual void Draw (Graphics dc, Rectangle clip_rectangle, Label label)
{
label.DrawImage (dc, label.Image, label.ClientRectangle, label.ImageAlign);
if (label.Enabled) {
dc.DrawString (label.Text, label.Font, ThemeEngine.Current.ResPool.GetSolidBrush (label.ForeColor), clip_rectangle, label.string_format);
} else {
ControlPaint.DrawStringDisabled (dc, label.Text, label.Font, label.BackColor, clip_rectangle, label.string_format);
}
}
public virtual Size DefaultSize {
get { return new Size (100, 23); }
}
}
}
@@ -195,51 +195,30 @@ namespace System.Windows.Forms
public static string CommonAppDataPath {
get {
return CreateDataPath (Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData));
return Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData);
}
}
public static RegistryKey CommonAppDataRegistry {
get {
string key = string.Format ("Software\\{0}\\{1}\\{2}", CompanyName, ProductName, ProductVersion);
return Registry.LocalMachine.CreateSubKey (key);
return Registry.LocalMachine.OpenSubKey ("Software\\" +
Application.CompanyName + "\\" + Application.ProductName +
"\\" + Application.ProductVersion, true);
}
}
public static string CompanyName {
get {
string company = string.Empty;
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
AssemblyCompanyAttribute[] attrs = (AssemblyCompanyAttribute[])
assembly.GetCustomAttributes (typeof(AssemblyCompanyAttribute), true);
if (attrs != null && attrs.Length > 0)
company = attrs [0].Company;
return attrs [0].Company;
// If there is no [AssemblyCompany], return the outermost namespace
// on Main ()
if (company == null || company.Length == 0)
if (assembly.EntryPoint != null) {
company = assembly.EntryPoint.DeclaringType.Namespace;
if (company != null) {
int firstDot = company.IndexOf ('.');
if (firstDot >= 0)
company = company.Substring (0, firstDot);
}
}
// If that doesn't work, return the name of class containing Main ()
if (company == null || company.Length == 0)
if (assembly.EntryPoint != null)
company = assembly.EntryPoint.DeclaringType.FullName;
return company;
return assembly.GetName().Name;
}
}
@@ -269,7 +248,9 @@ namespace System.Windows.Forms
public static string LocalUserAppDataPath {
get {
return CreateDataPath (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData));
return Path.Combine (Path.Combine (Path.Combine (
Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData),
CompanyName), ProductName), ProductVersion);
}
}
@@ -281,46 +262,25 @@ namespace System.Windows.Forms
public static string ProductName {
get {
string name = string.Empty;
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
AssemblyProductAttribute[] attrs = (AssemblyProductAttribute[])
assembly.GetCustomAttributes (typeof(AssemblyProductAttribute), true);
assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), true);
if (attrs != null && attrs.Length > 0)
name = attrs [0].Product;
return attrs [0].Product;
// If there is no [AssemblyProduct], .NET returns the name of
// the innermost namespace and if that fails, resorts to the
// name of the class containing Main ()
if (name == null || name.Length == 0)
if (assembly.EntryPoint != null) {
name = assembly.EntryPoint.DeclaringType.Namespace;
if (name != null) {
int lastDot = name.LastIndexOf ('.');
if (lastDot >= 0 && lastDot < name.Length - 1)
name = name.Substring (lastDot + 1);
}
if (name == null || name.Length == 0)
name = assembly.EntryPoint.DeclaringType.FullName;
}
return name;
return assembly.GetName ().Name;
}
}
public static string ProductVersion {
get {
String version = string.Empty;
String version;
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
@@ -328,27 +288,18 @@ namespace System.Windows.Forms
Attribute.GetCustomAttribute (assembly,
typeof (AssemblyInformationalVersionAttribute))
as AssemblyInformationalVersionAttribute;
if (infoVersion != null)
version = infoVersion.InformationalVersion;
// If [AssemblyFileVersion] is present it is used before
// resorting to 1.0
if (version == null || version.Length == 0) {
else {
AssemblyFileVersionAttribute fileVersion =
Attribute.GetCustomAttribute (assembly,
typeof (AssemblyFileVersionAttribute))
as AssemblyFileVersionAttribute;
if (fileVersion != null)
version = fileVersion.Version;
else
version = assembly.GetName ().Version.ToString ();
}
// If [AssemblyInformationalVersion] is not present, it
// seems 1.0.0.0 is always returned, despite the documentation
if (version == null || version.Length == 0)
version = new Version (1, 0, 0, 0).ToString ();
return version;
}
}
@@ -370,15 +321,17 @@ namespace System.Windows.Forms
public static string UserAppDataPath {
get {
return CreateDataPath (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData));
return Path.Combine (Path.Combine (Path.Combine (
Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
CompanyName), ProductName), ProductVersion);
}
}
public static RegistryKey UserAppDataRegistry {
get {
string key = string.Format ("Software\\{0}\\{1}\\{2}", CompanyName, ProductName, ProductVersion);
return Registry.CurrentUser.CreateSubKey (key);
return Registry.CurrentUser.OpenSubKey ("Software\\" +
Application.CompanyName + "\\" + Application.ProductName +
"\\" + Application.ProductVersion, true);
}
}
@@ -446,13 +399,11 @@ namespace System.Windows.Forms
#endif
static bool FilterMessage (ref Message message)
{
lock (message_filters) {
for (int i = 0; i < message_filters.Count; i++) {
IMessageFilter filter = (IMessageFilter) message_filters[i];
lock (message_filters)
foreach (IMessageFilter filter in message_filters)
if (filter.PreFilterMessage (ref message))
return true;
}
}
return false;
}
@@ -1022,22 +973,6 @@ namespace System.Windows.Forms
return false;
}
#endif
// Takes a starting path, appends company name, product name, and
// product version. If the directory doesn't exist, create it
private static string CreateDataPath (string basePath)
{
string path;
path = Path.Combine (basePath, CompanyName);
path = Path.Combine (path, ProductName);
path = Path.Combine (path, ProductVersion);
if (!Directory.Exists (path))
Directory.CreateDirectory (path);
return path;
}
#endregion
}
}
@@ -40,11 +40,7 @@ namespace System.Windows.Forms {
private bool checked_isnull;
private BindingMemberInfo binding_member_info;
#if NET_2_0
private IBindableComponent control;
#else
private Control control;
#endif
private BindingManagerBase manager;
private PropertyDescriptor control_property;
@@ -54,13 +50,10 @@ namespace System.Windows.Forms {
private Type data_type;
#if NET_2_0
private DataSourceUpdateMode datasource_update_mode;
private ControlUpdateMode control_update_mode;
private object datasource_null_value;
private object null_value;
private IFormatProvider format_info;
private string format_string;
private bool formatting_enabled;
//private DataSourceUpdateMode datasource_update_mode;
//private object null_value;
//private string format_string;
//private IFormatProvider format_info;
#endif
#region Public Constructors
#if NET_2_0
@@ -95,14 +88,10 @@ namespace System.Windows.Forms {
data_source = dataSource;
data_member = dataMember;
binding_member_info = new BindingMemberInfo (dataMember);
datasource_update_mode = dataSourceUpdateMode;
null_value = nullValue;
format_string = formatString;
format_info = formatInfo;
EventDescriptor prop_changed_event = GetPropertyChangedEvent (data_source, binding_member_info.BindingField);
if (prop_changed_event != null)
prop_changed_event.AddEventHandler (data_source, new EventHandler (SourcePropertyChangedHandler));
//datasource_update_mode = dataSourceUpdateMode;
//null_value = nullValue;
//format_string = formatString;
//format_info = formatInfo;
}
#else
public Binding (string propertyName, object dataSource, string dataMember)
@@ -111,22 +100,11 @@ namespace System.Windows.Forms {
data_source = dataSource;
data_member = dataMember;
binding_member_info = new BindingMemberInfo (dataMember);
EventDescriptor prop_changed_event = GetPropertyChangedEvent (data_source, binding_member_info.BindingField);
if (prop_changed_event != null)
prop_changed_event.AddEventHandler (data_source, new EventHandler (SourcePropertyChangedHandler));
}
#endif
#endregion // Public Constructors
#region Public Instance Properties
#if NET_2_0
public IBindableComponent BindableComponent {
get {
return control;
}
}
#endif
public BindingManagerBase BindingManagerBase {
get {
return manager;
@@ -142,123 +120,22 @@ namespace System.Windows.Forms {
[DefaultValue (null)]
public Control Control {
get {
#if NET_2_0
return control as Control;
#else
return control;
#endif
}
}
#if NET_2_0
[DefaultValue (ControlUpdateMode.OnPropertyChanged)]
public ControlUpdateMode ControlUpdateMode {
get {
return control_update_mode;
}
set {
control_update_mode = value;
}
}
#endif
public object DataSource {
get {
return data_source;
}
}
#if NET_2_0
[DefaultValue (DataSourceUpdateMode.OnValidation)]
public DataSourceUpdateMode DataSourceUpdateMode {
get {
return datasource_update_mode;
}
set {
datasource_update_mode = value;
}
}
[DefaultValue (null)]
public object DataSourceNullValue {
get {
return datasource_null_value;
}
set {
datasource_null_value = value;
}
}
[DefaultValue (false)]
public bool FormattingEnabled {
get {
return formatting_enabled;
}
set {
if (formatting_enabled == value)
return;
formatting_enabled = value;
PushData ();
}
}
[DefaultValue (null)]
public IFormatProvider FormatInfo {
get {
return format_info;
}
set {
if (value == format_info)
return;
format_info = value;
if (formatting_enabled)
PushData ();
}
}
[DefaultValue ("")]
public string FormatString {
get {
return format_string;
}
set {
if (value == null)
value = String.Empty;
if (value == format_string)
return;
format_string = value;
if (formatting_enabled)
PushData ();
}
}
#endif
public bool IsBinding {
get {
return is_binding;
}
}
#if NET_2_0
[DefaultValue (null)]
public object NullValue {
get {
return null_value;
}
set {
if (value == null_value)
return;
null_value = value;
if (formatting_enabled)
PushData ();
}
}
#endif
[DefaultValue ("")]
public string PropertyName {
get {
@@ -267,27 +144,7 @@ namespace System.Windows.Forms {
}
#endregion // Public Instance Properties
#if NET_2_0
public void ReadValue ()
{
PushData (true);
}
public void WriteValue ()
{
PullData (true);
}
#endif
#region Protected Instance Methods
#if NET_2_0
protected virtual void OnBindingComplete (BindingCompleteEventArgs args)
{
if (BindingComplete != null)
BindingComplete (this, args);
}
#endif
protected virtual void OnFormat (ConvertEventArgs cevent)
{
if (Format!=null)
@@ -305,11 +162,7 @@ namespace System.Windows.Forms {
get { return data_member; }
}
#if NET_2_0
internal void SetControl (IBindableComponent control)
#else
internal void SetControl (Control control)
#endif
{
if (control == this.control)
return;
@@ -322,15 +175,8 @@ namespace System.Windows.Forms {
throw new ArgumentException (String.Concat ("Cannot bind to property '", property_name, "' because it is read only."));
data_type = control_property.PropertyType; // Getting the PropertyType is kinda slow and it should never change, so it is cached
control.Validating += new CancelEventHandler (ControlValidatingHandler);
if (control is Control)
((Control)control).Validating += new CancelEventHandler (ControlValidatingHandler);
#if NET_2_0
EventDescriptor prop_changed_event = GetPropertyChangedEvent (control, property_name);
if (prop_changed_event != null)
prop_changed_event.AddEventHandler (control, new EventHandler (ControlPropertyChangedHandler));
#endif
this.control = control;
}
@@ -356,56 +202,19 @@ namespace System.Windows.Forms {
PushData ();
}
internal bool PullData ()
{
return PullData (false);
}
// Return false ONLY in case of error - and return true even in cases
// where no update was possible
bool PullData (bool force)
internal void PullData ()
{
if (IsBinding == false || manager.Current == null)
return true;
#if NET_2_0
if (!force && datasource_update_mode == DataSourceUpdateMode.Never)
return true;
#endif
return;
data = control_property.GetValue (control);
try {
SetPropertyValue (data);
} catch (Exception e) {
#if NET_2_0
if (formatting_enabled) {
FireBindingComplete (BindingCompleteContext.DataSourceUpdate, e, e.Message);
return false;
}
#endif
throw e;
}
#if NET_2_0
if (formatting_enabled)
FireBindingComplete (BindingCompleteContext.DataSourceUpdate, null, null);
#endif
return true;
SetPropertyValue (data);
}
internal void PushData ()
{
PushData (false);
}
void PushData (bool force)
{
if (manager == null || manager.IsSuspended || manager.Current == null)
return;
#if NET_2_0
if (!force && control_update_mode == ControlUpdateMode.Never)
return;
#endif
if (is_null_desc != null) {
bool is_null = (bool) is_null_desc.GetValue (manager.Current);
@@ -422,33 +231,14 @@ namespace System.Windows.Forms {
data = pd.GetValue (manager.Current);
}
try {
data = FormatData (data);
SetControlValue (data);
} catch (Exception e) {
#if NET_2_0
if (formatting_enabled) {
FireBindingComplete (BindingCompleteContext.ControlUpdate, e, e.Message);
return;
}
#endif
throw e;
}
#if NET_2_0
if (formatting_enabled)
FireBindingComplete (BindingCompleteContext.ControlUpdate, null, null);
#endif
data = FormatData (data);
SetControlValue (data);
}
internal void UpdateIsBinding ()
{
is_binding = false;
#if NET_2_0
if (control == null || (control is Control && !((Control)control).Created))
#else
if (control == null && !control.Created)
#endif
if (control == null || !control.Created)
return;
if (manager == null || manager.IsSuspended)
return;
@@ -473,22 +263,16 @@ namespace System.Windows.Forms {
private void ControlValidatingHandler (object sender, CancelEventArgs e)
{
#if NET_2_0
if (datasource_update_mode != DataSourceUpdateMode.OnValidation)
return;
#endif
object old_data = data;
bool ok = true;
// If the data doesn't seem to be valid (it can't be converted,
// is the wrong type, etc, we reset to the old data value.
// If Formatting is enabled, no exception is fired, but we get a false value
try {
ok = PullData ();
PullData ();
} catch {
ok = false;
data = old_data;
SetControlValue (data);
}
e.Cancel = !ok;
}
private void PositionChangedHandler (object sender, EventArgs e)
@@ -497,40 +281,6 @@ namespace System.Windows.Forms {
PushData ();
}
EventDescriptor GetPropertyChangedEvent (object o, string property_name)
{
if (o == null || property_name == null || property_name.Length == 0)
return null;
string event_name = property_name + "Changed";
Type event_handler_type = typeof (EventHandler);
EventDescriptor prop_changed_event = null;
foreach (EventDescriptor event_desc in TypeDescriptor.GetEvents (o)) {
if (event_desc.Name == event_name && event_desc.EventType == event_handler_type) {
prop_changed_event = event_desc;
break;
}
}
return prop_changed_event;
}
void SourcePropertyChangedHandler (object o, EventArgs args)
{
PushData ();
}
#if NET_2_0
void ControlPropertyChangedHandler (object o, EventArgs args)
{
if (datasource_update_mode != DataSourceUpdateMode.OnPropertyChanged)
return;
PullData ();
}
#endif
private object ParseData (object data, Type data_type)
{
ConvertEventArgs e = new ConvertEventArgs (data, data_type);
@@ -540,10 +290,6 @@ namespace System.Windows.Forms {
return e.Value;
if (e.Value == Convert.DBNull)
return e.Value;
#if NET_2_0
if (e.Value == null)
return data_type.IsByRef ? null : Convert.DBNull;
#endif
return ConvertData (e.Value, data_type);
}
@@ -556,18 +302,6 @@ namespace System.Windows.Forms {
if (data_type.IsInstanceOfType (e.Value))
return e.Value;
#if NET_2_0
if (formatting_enabled) {
if (e.Value == null || e.Value == Convert.DBNull) {
return null_value;
}
if (e.Value is IFormattable && data_type == typeof (string)) {
IFormattable formattable = (IFormattable) e.Value;
return formattable.ToString (format_string, format_info);
}
}
#endif
if (e.Value == null && data_type == typeof (object))
return Convert.DBNull;
@@ -591,27 +325,10 @@ namespace System.Windows.Forms {
return null;
}
#if NET_2_0
void FireBindingComplete (BindingCompleteContext context, Exception exc, string error_message)
{
BindingCompleteEventArgs args = new BindingCompleteEventArgs (this,
exc == null ? BindingCompleteState.Success : BindingCompleteState.Exception,
context);
if (exc != null) {
args.SetException (exc);
args.SetErrorText (error_message);
}
OnBindingComplete (args);
}
#endif
#region Events
public event ConvertEventHandler Format;
public event ConvertEventHandler Parse;
#if NET_2_0
public event BindingCompleteEventHandler BindingComplete;
#endif
#endregion // Events
}
}
@@ -88,16 +88,6 @@ namespace System.Windows.Forms
get { return this.exception; }
}
#endregion // Public Instance Properties
internal void SetErrorText (string error_text)
{
this.error_text = error_text;
}
internal void SetException (Exception exception)
{
this.exception = exception;
}
}
}
#endif
#endif
@@ -69,14 +69,6 @@ namespace System.Windows.Forms
get;
}
#if NET_2_0
public bool IsBindingSuspended {
get {
return IsSuspended;
}
}
#endif
public abstract int Position {
get; set;
}
@@ -105,10 +97,8 @@ namespace System.Windows.Forms
public abstract void SuspendBinding();
#endregion // Public Instance Methods
internal virtual bool IsSuspended {
get {
return false;
}
internal abstract bool IsSuspended {
get;
}
#region Protected Instance Methods
@@ -67,42 +67,24 @@ namespace System.Windows.Forms {
AddCore(binding);
}
protected virtual void AddCore (Binding dataBinding)
{
CollectionChangeEventArgs args = new CollectionChangeEventArgs (CollectionChangeAction.Add, dataBinding);
#if NET_2_0
OnCollectionChanging (args);
#endif
protected virtual void AddCore(Binding dataBinding) {
base.List.Add(dataBinding);
OnCollectionChanged (args);
OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Add, base.List));
}
protected internal void Clear() {
ClearCore();
}
protected virtual void ClearCore()
{
CollectionChangeEventArgs args = new CollectionChangeEventArgs(CollectionChangeAction.Refresh, null);
#if NET_2_0
OnCollectionChanging (args);
#endif
protected virtual void ClearCore() {
base.List.Clear();
OnCollectionChanged (args);
OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, base.List));
}
protected virtual void OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs ccevent) {
if (CollectionChanged!=null) CollectionChanged(this, ccevent);
}
#if NET_2_0
protected virtual void OnCollectionChanging (CollectionChangeEventArgs args)
{
if (CollectionChanging != null)
CollectionChanging (this, args);
}
#endif
protected internal void Remove(Binding binding) {
RemoveCore(binding);
}
@@ -112,14 +94,9 @@ namespace System.Windows.Forms {
OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Remove, base.List));
}
protected virtual void RemoveCore(Binding dataBinding)
{
CollectionChangeEventArgs args = new CollectionChangeEventArgs(CollectionChangeAction.Remove, dataBinding);
#if NET_2_0
OnCollectionChanging (args);
#endif
protected virtual void RemoveCore(Binding dataBinding) {
base.List.Remove(dataBinding);
OnCollectionChanged (args);
OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Remove, base.List));
}
protected internal bool ShouldSerializeMyAll() {
@@ -138,9 +115,6 @@ namespace System.Windows.Forms {
#region Events
public event CollectionChangeEventHandler CollectionChanged;
#if NET_2_0
public event CollectionChangeEventHandler CollectionChanging;
#endif
#endregion // Events
}
}
@@ -1,26 +1,32 @@
2008-02-22 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* TreeView.cs: Make selected_node and highlighted_node internal.
* TreeNodeCollection.cs: Reset selected_node and highlighted_node
to null when Nodes.Clear is called.
[Fixes bug #363884]
2008-03-03 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Do not convert not only if the types match,
but also if the property type is assigneable from the value's
type.
[Fixes bug #366566]
2008-03-03 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs:
- Subscribe to the listbox only once and not everytime.
- Update the textbox even if SetValue fails.
- Close the listbox before calling TrySetValue just in case.
[Fixes bug #366569]
2008-02-29 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs: Check for null PropertyDescriptor.Name just
in case.
* PropertyGrid.cs: Fix wrong array size initialization.
* GridEntry.cs: For MS compitability make all child properties
readonly if the parent is readonly. Ugh.
[Fixes bug #365945 and #365944]
2008-02-29 Andreia Gaita <[email protected]>
* HtmlHistory.cs: Fix sigs for Forward and Back to navigate by index
relative to the history
2008-02-29 Andreia Gaita <[email protected]>
* HtmlElement.cs: More handlers for mouse and key events
2008-02-28 Andreia Gaita <[email protected]>
* WebBrowserBase.cs: MouseClick sig changed.
* HtmlHistory.cs: Implement history navigation
* HtmlElement.cs: Add event handlers, and connect them.
2008-02-28 Ivan N. Zlatev <[email protected]>
* GridEntry.cs:
@@ -31,32 +37,6 @@
* PropertyGridView.cs: Check if an entry is a password.
[Fixes bugs #365589, #365586, #365588]
2008-02-28 Andreia Gaita <[email protected]>
* PropertyGridView.cs: Revert the message filtering change, as we
need it to block after all. Remove block parameter, unnecessary.
2008-02-27 Jonathan Pobst <[email protected]>
* UserControl.cs: Better implementation of GetPreferredSize.
First step to fixing bug #361441.
2008-02-26 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Actually implement data binding support for
classes implementing IBindableComponent.
* ControlBindingsCollection.cs: Likewise.
2008-02-26 Andreia Gaita <[email protected]>
* PropertyGridView.cs: Use a message filter to check when to
close the dropdown
2008-02-26 Andreia Gaita <[email protected]>
* Application.cs: Change the message_filters loop so a filter
can be removed while looping.
2008-02-26 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Optimization in ToggleValue so that it caches
@@ -67,146 +47,23 @@
license.
[Fixes bug #362755]
2008-02-26 Jonathan Pobst <[email protected]>
* Application.cs: Apply patch from Justin Cherniak to match
MS better for ProductName, ProductVersion, and CompanyName.
[Fixes bug #361709]
2008-02-25 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Actually implement 2.0 NullValue property. Also
when changing the formatting related properties, only update the state
if formatting_enabled is true (we don't mind otherwise).
2008-02-25 Jonathan Pobst <[email protected]>
* ToolStrip.cs: Don't raise ItemClicked for disabled items.
[Fixes bug #364486]
2008-02-25 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Use the PropertyDescriptor.PropertyType instead
of GetType on the current value as it uses reflection to
of GetType on the value as it uses reflection to
determine the type. This fixes the case where the new value is
null.
null.
[Fixes #358332]
2008-02-25 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: Limit mousewheel scrolling to not scroll
past the view.
2008-02-24 Luke Page <[email protected]>
* Line.cs, TextControl.cs: Implement offset x and y so that a
document doesn't have to begin at (0,0) on the viewpoint.
* TextBox.cs, TextBoxBase.cs: RightToLeft switches the scroll
bars and switches the text alignment (and therefore is now
implemented for textbox). Fixes #321383.
2008-02-23 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Actually implement 2.0 FormatString and FormatInfo
properties. Also when changing FormattingEnabled update the control
property -as .Net does-.
2008-02-22 Carlos Alberto Cortez <calberto.cortez@ŋmail.com>
* ControlBindingsCollection.cs: Add the missing 2.0 Add overloads.
* Binding.cs: Add stubs for the overloads of the Add method in
CBCollection.
2008-02-22 Carlos Alberto Cortez <[email protected]>
* Binding.cs: PullData () returns a false value if we got an exception.
Also when validating the control and we get an error, instead of
setting the value of the previous one, cancel the event (tested in 1.1
and 2.0).
2008-02-22 Jonathan Pobst <[email protected]>
* TreeView.cs: Make selected_node and highlighted_node internal.
* TreeNodeCollection.cs: Reset selected_node and highlighted_node
to null when Nodes.Clear is called.
[Fixes bug #363884]
2008-02-21 Jonathan Pobst <[email protected]>
* FontDialog.cs: Ensure that when the Font is set in code,
all the gui pieces are updated accordingly.
[Fixes bug #361020]
2008-02-21 Jonathan Pobst <[email protected]>
* TextRenderer.cs: Respect proposed size for MeasureString.
* ThemeWin32Classics.cs: If our CheckBox/RadioButton isn't
autosize, use a proposed width to force wrapping for long text.
[Fixes bug #360981]
2008-02-21 Jonathan Pobst <[email protected]>
* TreeView.cs: Factor in checkboxes = false and state images in
to HitTest. [Fixes bug #363360]
2008-02-21 Jonathan Pobst <[email protected]>
* ThemeWin32Classic.cs: Only look at the Date part of a DateTime
when drawing the selected range.
[Fixes bug #363648]
2008-02-21 Jonathan Pobst <[email protected]>
* ToolStripContainer.cs: Add SupportsTransparentBackColor and
ResizeRedraw control styles.
[Fixes bug #363555]
2008-02-20 Jonathan Pobst <[email protected]>
* TreeView.cs: StateImages are basically custom checkboxes, so
factor their size the same as real checkboxes when determining
what got clicked.
[Fixes bug #363367]
2008-02-20 Jonathan Pobst <[email protected]>
* MessageBox.cs: Make the message box wider if the form caption
is longer than the text in the form.
[Fixes bug #361137]
2008-02-20 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: Fix a NRE when closing the drop down form.
2008-02-20 Jonathan Pobst <[email protected]>
* TreeNode.cs: Guard against an NRE when the parent's
StateImageList hasn't been set.
[Fixes bug #363353]
2008-02-20 Jonathan Pobst <[email protected]>
* SplitContainer.cs: Add SupportsTransparentBackColor and
OptimizedDoubleBuffering control styles.
[Fixes bug #363303]
2008-02-20 Jonathan Pobst <[email protected]>
* Application.cs: For the app data paths and the registry key paths,
ensure they are created before returning them to the user.
[Fixes bug #361709]
2008-02-20 Jonathan Pobst <[email protected]>
* Application.cs: Guard against an NRE in CompanyName and
ProductName.
2008-02-20 Jonathan Pobst <[email protected]>
* Application.cs: For CompanyName, ProductName, and ProductVersion,
make sure we handle all three cases correctly: attribute is present,
attribute is present but is an empty string, and attribute is not
present.
2008-02-20 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs:
@@ -214,51 +71,14 @@
- Another performance improvement - cache the standard values
listbox.
2008-02-19 Jonathan Pobst <[email protected]>
* ComboBox.cs: Fix previous change to affect both 1.1 and 2.0
code paths.
2008-02-19 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGridView.cs: Fix a big performance bug.
2008-02-19 Jonathan Pobst <[email protected]>
* SelectionRange.cs: Apply patch from Andy Hume to make
constructor behavior more accurate. [Fixes bug #362117]
2008-02-19 Andreia Gaita <[email protected]>
* Control.cs: Added a new flag is_disposing to track if the
window is currently in the process of being disposed of.
This is used so that, when firing visibility changes triggered
by unparenting controls during Dispose, the control doesn't
get created again.
2008-02-19 Jonathan Pobst <[email protected]>
* ComboBox.cs: Set height to preferred height when the handle
is created. [Fixes bug #360862]
2008-02-18 Andreia Gaita <[email protected]>
* XplatUIX11.cs: Create FosterParent with border width at 0.
With the previous value of 4, everytime a control got reparented
from parent = null, it's location would be shifted right and
down by 4, since these coordinates would be offset by the
FosterParent's border width.
2008-02-18 Ivan N. Zlatev <[email protected]>
* Control.cs: During diposing firstly remove ourselfes from
the parent and *then* destroy our handle, because removing
ourselfes from the parent controls collection causes
VisibilityChange, etc events, which require a handle and end
up recreating the control.
2008-02-17 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* GridEntry.cs: Set expanded state before notifying that the
expansion has taken place.
* PropertyGridView.cs:
@@ -276,6 +96,7 @@
2008-02-16 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* GridEntry.cs:
- Fix handling of a null current value.
- Swallow editor exceptions.
@@ -283,6 +104,15 @@
2008-02-16 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGridTextBox.cs, PropertyGridView.cs: Explicitly send
a mouse down event to the textbox so that we get the caret
positioned under cursor.
[Fixes bug #362119]
2008-02-16 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGrid.cs: Clear current items first thing before
repopulating subitems.
* GridEntry.cs:
@@ -290,52 +120,37 @@
- Mark as not editable if there is no PropertyDescriptor and
if the Converter cannot convert from string.
[Part of fix for bugs #360666 and #358332]
2008-02-15 Luke Page <[email protected]>
* MaskedTextBox.cs: Now skips non editable characters after a
character has been entered and we are progressing to the next
position in the MaskedTextBox.
2008-02-15 Luke Page <[email protected]>
* TextBoxBase.cs: Handles MouseDown when shift key is clicked so
that it changes the selection rather than just repositioning the
cursor. Fixes Bug #360873.
2008-02-15 Luke Page <[email protected]>
* TextBoxBase.cs, TextControl.cs, RichTextBox.cs: TextChanged fires
when Undo/Redo changes the text. Undo/Redo/Undo/Redo now works
correctly. See #359330
2008-02-15 Andreia Gaita <[email protected]>
[Backport to 1.9]
* XplatUIX11.cs: If the handle is null when posting a message, use the
current thread queue to post instead. Fixes #332409
current thread queue to post instead.
[Fixes #332409]
* SendKeys.cs: Slight optimization
2008-02-14 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGrid.cs, PropertyGridView.cs:
Fix multiple scrolling and sizing issues.
[Fixes bug #359199]
2008-02-12 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGridView.cs: Ensure that drop down editors are shown
in the WorkingArea of the screen.
[Fixes bug #359807]
2008-02-12 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* GridEntry.cs: Fail silently when UITypeEditor is missing.
[Fixes bug #360666]
2008-02-11 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Implement 2.0 DataSourceNullValue property.
2008-02-11 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGridView.cs:
- Clear the controls in the drop down form after it is hidden.
- Fix Width sizing of the dropdown editors to match MSFT.
@@ -346,153 +161,17 @@
- Fix height for drawing the grid entry
text value, so that it clips multiline text properly.
- Fix unfocusing to match MSFT.
2008-02-11 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs: Do not populate subgriditems unless expandable.
Fixes a bug where on repopulation after value changed items become
expandable.
2008-02-10 Carlos Alberto Cortez <[email protected]>
* Binding.cs: For the 2.0 profile, look for a
'PropertyChanged' event in the target control, and add checks for
DataSourceUpdateMode property to change -or not- the data source
from validation/control property change.
2008-02-10 Atsushi Enomoto <[email protected]>
* Binding.cs : build fix (operator == is not overriden in 1.x. Do
not compare struct with null in 2.0).
2008-02-10 Luke Page <[email protected]>
* MaskedTextBox.cs: UseSystemPasswordChar updates PasswordChar, PasswordChar
updates the provider and if not using a provider, uses the internal document
class implementation of password char. Also when showing text, uses display string
from the provider, instead of the actual text.
2008-02-09 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Ooooops, forgot to take into account the data_source
and binding_member_info null case (it was breaking the Binding tests).
2008-02-09 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Implement support for data source changes exposed by
'PropertyNameChanged' events, and update the control property as
needed.
2008-02-08 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Implement 2.0 WriteValue method.
2008-02-08 Jonathan Pobst <[email protected]>
Commit patch from James Purcell for better AutoScale implementation:
* ScaleControl should call GetScaledBounds with the control's total size rather
than client size. GetScaledBounds should handle ignoring the borders in its
calculations. Cleaned up ScaleControl/GetScaledBounds overrides in controls
(for the most part they just call the base code now since that is fixed).
* Added ScaleChildrenInternal to allow controls to disable scaling of children
without having to override ScaleChildren (since none of .NET's controls do).
This is required for most controls in Mono that have scrollbars to prevent the
scrollbars from being moved/resized.
* Nested ContainerControls can have a different scale mode than their parent.
This is briefly mentioned in MSDN but is buggy in MS.NET (the runtime and
designer produce different results both of which look incorrect).
* Default AutoScaleMode for ContainerControl should be Inherit.
* Simplified workaround for ComboBox scaling issue.
* 1.0 style auto-scaling now uses its own methods instead of sharing 2.0's.
1.0 style auto scaling should scale the whole control's size instead of
ignoring the borders (except for Form) and the rounding is done differently to
preserve control alignment.
* ApplyAutoScaling (used for 1.0 style) should use the rounded result of
GetAutoScaleSize.
* Cleaned up fix for "Bug 355703 - Setting AutoScale = true doesn't stick".
* CurrentAutoScaleDimensions should round the estimated character width instead
of truncating.
* ListBox's GetScaledBounds should always use the height it was set to instead
of the height that was passed in. This prevents rounding errors from
accumulating quickly with IntegralHeight.
[Bug #359098]
2008-02-08 Andreia Gaita <[email protected]>
* Form.cs: Add a null check (darn it).
2008-02-08 Jonathan Pobst <[email protected]>
* MdiClient.cs: Make sure the requesting form actually owns the
control menu items before removing them. Also, use
Suspend/ResumeLayout when adding or removing items so we only
layout once.
[Fixes bug #359887]
2008-02-08 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* Control.cs: Guard against an NRE in ShowFocusCues.
[Fixes bug #359830]
2008-02-08 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Implement 2.0 ReadValue method and ControlUpdateMode
property, as well as stubbing DataSourceUpdateMode.
2008-02-08 Andreia Gaita <[email protected]>
* Form.cs: When closing forms, get focus back to the active control of the
active form. [Fixes #341314, corner case]
2008-02-07 Jonathan Pobst <[email protected]>
* MdiClient.cs: After we move the scrollbars, invalidate the NC
area, so any old scrollbar artifacts are cleaned up.
[Fixes bug #336305]
2008-02-07 Jonathan Pobst <[email protected]>
* MdiWindowManager.cs: If we are maximized and using MainMenuStrip
for our menus, display that control box menu instead of the 1.1
menu one.
2008-02-07 Jonathan Pobst <[email protected]>
* MdiControlStrip.cs: Add property to access the mdi form tied to
each toolstripitem.
* MdiClient.cs: Be smarter about removing and adding toolstripitems
to the implicitly merged menu. Every time we clicked the form, items
were getting removed and the re-added, causing the form to jump around
as the menu resized.
2008-02-07 Jonathan Pobst <[email protected]>
* MdiClient.cs: Make sure the NormalBounds always gets set. It
was being reset by the implicit menu merge for menustrips.
[Fixes bug #336296]
2008-02-07 Jonathan Pobst <[email protected]>
* Form.cs: Don't do the previous change when WindowState = Normal,
or it messes up where the window is placed. Fixes test failure.
2008-02-07 Jonathan Pobst <[email protected]>
* Form.cs: When becoming visible, if we are an MDI child, call
SetWindowState with a dummy old_state so that changes will actually
be made.
[Fixes the 2nd part of bug #325473]
2008-02-07 Andreia Gaita <[email protected]>
* Control.cs: Reset properties to their pre parent-change values in case
the new parent == null (in which case we're basically removing the control,
and don't want any events fired due to fake property changes)
[Fixes #355850]
2008-02-06 Ivan N. Zlatev <[email protected]>
[Backport to 1.9]
* PropertyGridView.cs:
- Refactor SetValue to allow setting the value
when a custom editor is used, but the entry is not editable.
@@ -500,72 +179,63 @@
[Fixes #359196]
2008-02-06 Andreia Gaita <[email protected]>
[Backport to 1.9]
* PrintControllerWithStatusDialog.cs: Set PrintFileName value through
reflection only on 1.1, this property is public on system.drawing on 2.0.
Fixed #359247
2008-02-06 Andreia Gaita <avidigal@novell.com>
* WebBrowser.cs: Do a normal page refresh by default.
2008-02-05 Jonathan Pobst <monkey@jpobst.com>
[Backport to 1.9]
* Form.cs: If we change the active MDI child form, let the others
know they need to repaint their title bar so it will appear inactive.
[Fixes part 1 of bug #325473]
2008-02-05 Andreia Gaita <[email protected]>
[Backport to 1.9]
* XplatUIWin32.cs, XplatUICarbon.cs: set the hwnd.Mapped flag when we create
the window so that the check on Control.UpdateZOrderOfChild passes on non-X
platforms. Fixes #359036
Note: Control.UpdateZOrderOfChild needs to be rewritten to not rely on
platform-specific flags.
2008-02-05 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Add 2.0 BindableComponent property - just return control
by now.
2008-02-05 Everaldo Canuto <[email protected]>
[Backport to 1.9]
* MenuAPI.cs: Check if control is disposable when track popup menu. Thanks
Jonathan for this patch. Fixes #358442.
2008-02-05 Jonathan Pobst <[email protected]>
* Form.cs: If we change the active MDI child form, let the others
know they need to repaint their title bar so it will appear inactive.
[Fixes part 1 of bug #325473]
2008-02-05 Ivan N. Zlatev <[email protected]>
* PropertyGridView.cs: Do not trucate custom editors' width
and align them to the left.
[Fixes #358353 and #358349]
2008-02-04 Carlos Alberto Cortez <[email protected]>
* BindingsCollection.cs: Implement 2.0 CollectionChanging event.
Also fix the arguments passed to CollectionChangeEventArgs in the
related methods.
2008-02-04 Geoff Norton <[email protected]>
* Hwnd.cs: The conversion to Quartz coordinates happens in
System.Drawing. Removing this translation from here.
2008-02-04 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs, PropertyGridView.cs, GridEntry.cs,
CategoryGridEntry.cs, RootGridEntry.cs, GridItem.cs,
GridItemCollection.cs:
PropertyGrid rewrite part 2. Tons of bugfixes and new features.
2008-02-04 Geoff Norton <[email protected]>
* X11Keyboard.cs: VK_MENU should send a KEYUP instead of
SYSKEYUP if any other key has been pressed in the mean time.
Fixes #324404
[Backport to 1.9]
* PropertyGridView.cs: Do not trucate custom editors' width
and align them to the left.
[Fixes #356527 and #358349]
2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* UpDownBase.cs: Make sure the internal textbox calls the base's
OnMouseDown and OnMouseUp so the textbox will function correctly.
There were notes saying it doesn't chain up, but its an internal
class, so our implementation may differ.
[Fixes bug #357482]
2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* Control.cs: Remove HeightInternal.
* ListBox.cs: Commit patch from James Purcell that correctly
calculates heights for ListBoxen.
[Fixes bug #357152]
2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* Label.cs: Apply patch from James Purcell that corrects the
signature of the AutoSize property.
[Fixes bug #357605]
2008-02-04 Carlos Alberto Cortez <[email protected]>
[Backport to 1.9]
* ListView.cs: In ItemControl.ItemsMouseMove, only fire ItemDrag event
when the item in current position is different than 0. Also, save the
item index in the beginning of the operation, instead of getting the
@@ -574,111 +244,31 @@
triggered.
[Fixes #357873]
2008-02-03 Jonathan Pobst <monkey@jpobst.com>
2008-02-04 Geoff Norton <gnorton@novell.com>
* LineTag.cs:
* DataGriveViewCell.cs: More fixing the branch. bmp_g is the instance
variable, call the appropriate Property instead.
* Form.cs: Alt-Minus for MDI children system menu should work
with both the minus keys on the keyboard.
[Fixes bug #336295]
2008-02-04 Geoff Norton <[email protected]>
2008-02-03 Jonathan Pobst <[email protected]>
* Control.cs: Fix the branch. bmp_g is the instance variable, call the
appropriate Property instead.
* Control.cs: Don't invalidate on region change. The WM should
take care of this automagically. Keeps us out of an infinite
paint loop if someone changes the Region in the OnPaint.
[Fixes bug #358327]
2008-02-04 Geoff Norton <[email protected]>
* Hwnd.cs: [Backport] The conversion to Quartz coordinates happens in
System.Drawing. Removing this translation from here.
2008-02-04 Ivan N. Zlatev <[email protected]>
* ImageIndexConverter.cs: ConvertFrom must handle "(none)".
2008-02-03 Jonathan Pobst <[email protected]>
* DateTimePicker.cs: Apply patch from Srikanth Madikeri so we drop
down the MonthCalendar only on F4, not Alt+F4.
* MonthCalendar.cs: If we are a popup, close ourselves on Alt+F4.
[Fixes bug #358340]
2008-02-03 Jonathan Pobst <[email protected]>
* ThemeWin32Classic.cs: For MonthCalendar, draw a dark border
if its part of a DateTimePicker, else, use the back color.
[Fixes bug #358339]
2008-02-03 Jonathan Pobst <[email protected]>
* Hwnd.cs: Use GraphicContext instead of the uninitialized bmp_g.
[Fixes bug #358342]
2008-02-03 Carlos Alberto Cortez <[email protected]>
* CurrencyManager.cs: When we get a ListChanged event from our source,
always fire our own ListChanged event, as .Net does.
2008-02-03 Luke Page <[email protected]>
* RichTextBox.cs: AutoSize now defaults to false. Fixes Bug
#358379.
2008-02-03 Luke Page <[email protected]>
* TextBoxBase.cs, RichTextBox.cs, TextControl.cs: Sets richtext
property. Removed if for richtext property that was always true.
PgUp/PgDn at top/bottom fixed for RTB. Fixes bug #358237.
2008-02-03 Luke Page <[email protected]>
* TextBoxBase.cs - commited patch from James Purcell that
correctly sets the FixedHeight control style when the MultiLine
property is changed on a TextBox control. Fixes bug 358229.
2008-02-02 Luke Page <[email protected]>
* Line.cs, LineTag.cs, RichTextBox.cs, TextControl.cs
Fixes bug 351938 - caret is positioned correctly when drawn
and when calculating textual position of caret, no longer
has a NRE in certain situations.
2008-02-01 Geoff Norton <[email protected]>
* Hwnd.cs: Ensure that windows moved into -'ve coordinate space
get that region removed from the paint event.
* XplatUICarbon.cs: Remove the window mapping after disposing of
window. Prevents a crash with handle reuse. Optimize exposes
only onto visible windows (rare; but possible).
2008-02-01 Jonathan Pobst <[email protected]>
* UpDownBase.cs: Make sure the internal textbox calls the base's
OnMouseDown and OnMouseUp so the textbox will function correctly.
There were notes saying it doesn't chain up, but its an internal
class, so our implementation may differ.
[Fixes bug #357482]
2008-02-01 Jonathan Pobst <[email protected]>
* ListBox.cs: Fix a logic error and don't process MouseDown
for mouse buttons other than Left.
2008-02-01 Jonathan Pobst <[email protected]>
* Control.cs: Remove HeightInternal.
* ListBox.cs: Commit patch from James Purcell that correctly
calculates heights for ListBoxen.
[Fixes bug #357152]
2008-02-01 Jonathan Pobst <[email protected]>
* Label.cs: Apply patch from James Purcell that corrects the
signature of the AutoSize property.
[Fixes bug #357605]
2008-02-01 Jonathan Pobst <[email protected]>
* ListBox.cs: Don't throw [Mouse]Click events for buttons
other than the left mouse button.
[Backport to 1.9]
* PropertyGrid.cs, PropertyGridView.cs, GridEntry.cs,
CategoryGridEntry.cs, RootGridEntry.cs, GridItem.cs,
GridItemCollection.cs:
PropertyGrid backport.
2008-01-31 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* Control.cs: Remove my awesome optimization as it caused some
regressions with control ordering. :(
[Fixes bug #357467]
@@ -688,52 +278,6 @@
* PropertyGridView.cs: Fix a NRE on double click when there is no
selected object.
2008-01-30 Carlos Alberto Cortez <[email protected]>
* BindingManagerBase.cs: Implement IsBindingSuspended 2.0 property.
2008-01-30 Jonathan Pobst <[email protected]>
* ListBox.cs: Call MouseClick and MouseDoubleClick.
[Fixes bug #357146]
2008-01-29 Jonathan Pobst <[email protected]>
* Hwnd.cs: Make bmp, bmp_g variables threadstatic and private.
* Control.cs, DataGridViewCell.cs, LineTag.cs: Use Hwnd.GraphicsContext
instead of Hwnd.bmp_g.
2008-01-29 Jonathan Pobst <[email protected]>
* TextRenderer.cs: Don't maintain private bitmap/graphics contexts.
Use the Hwnd one instead.
2008-01-29 Jonathan Pobst <[email protected]>
* Form.cs: Remove duplicated copy of GetAutoScaleSize.
2008-01-29 Jonathan Pobst <[email protected]>
* Form.cs: corcompare for RestoreBounds.
2008-01-29 Jonathan Pobst <[email protected]>
* Control.cs: Add MarshalAs attribute to Font getter for corcompare.
2008-01-29 Jonathan Pobst <[email protected]>
* Form.cs: Handle Alt-Minus for MDI children forms.
* MdiWindowManager.cs: Make ShowPopup internal so Form can call it.
Add mnemonics to the control menu.
[Fixes bug #336295]
2008-01-28 Carlos Alberto Cortez <[email protected]>
* Binding.cs: Initial implementation bits of FormattingEnabled
property and BindingComplete event (2.0).
* BindingCompleteEventArgs.cs: Internal methods for setting error text
and exception.
2008-01-28 Jonathan Pobst <[email protected]>
* TableLayoutPanel.cs: Draw the table border at 0,0 instead of
@@ -1094,8 +1094,6 @@ namespace System.Windows.Forms
{
base.OnHandleCreated (e);
SetBounds (Left, Top, Width, PreferredHeight, BoundsSpecified.None);
if (textbox_ctrl != null)
Controls.AddImplicit (textbox_ctrl);
@@ -1233,9 +1231,31 @@ namespace System.Windows.Forms
#endif
#if NET_2_0
private float current_factor_width = 1f;
// WTF? WTF? WTF????
// I am sure this is tied to something I missed that makes this make sense.
// Every time you double the size of the control, subtract 4 pixels from it
protected override void ScaleControl (SizeF factor, BoundsSpecified specified)
{
base.ScaleControl (factor, specified);
// Never change the ComboBox's height
specified &= ~BoundsSpecified.Height;
int width = ClientSize.Width;
// Go back to the original (un-4-subtracted) size
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width)
width += (int)(((current_factor_width) - 1f) * 4.0f);
Rectangle new_bounds = GetScaledBounds (new Rectangle (Location, new Size (width, ClientSize.Height)), factor, specified);
// Subtract 4 for every time the control is 'doubled'
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width) {
new_bounds.Width += (int)(((factor.Width * current_factor_width) - 1f) * -4.0f);
current_factor_width *= factor.Width;
}
SetBounds (new_bounds.X, new_bounds.Y, new_bounds.Width, new_bounds.Height, specified);
}
#endif
@@ -48,7 +48,6 @@ namespace System.Windows.Forms {
private AutoScaleMode auto_scale_mode;
private bool auto_scale_mode_set;
private bool auto_scale_pending;
private bool is_auto_scaling;
#endif
internal bool validation_failed; //track whether validation was cancelled by a validating control
@@ -60,7 +59,7 @@ namespace System.Windows.Forms {
ControlRemoved += new ControlEventHandler(OnControlRemoved);
#if NET_2_0
auto_scale_dimensions = SizeF.Empty;
auto_scale_mode = AutoScaleMode.Inherit;
auto_scale_mode = AutoScaleMode.None;
#endif
}
#endregion // Public Constructors
@@ -275,9 +274,6 @@ namespace System.Windows.Forms {
return auto_scale_mode;
}
set {
if (this is Form)
(this as Form).AutoScale = false;
if (auto_scale_mode != value) {
auto_scale_mode = value;
@@ -288,6 +284,9 @@ namespace System.Windows.Forms {
PerformAutoScale ();
}
if (this is Form)
(this as Form).AutoScale = false;
}
}
#endif // NET_2_0
@@ -317,7 +316,7 @@ namespace System.Windows.Forms {
case AutoScaleMode.Font:
Size s = TextRenderer.MeasureText ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", Font);
int width = (int)Math.Round ((float)s.Width / 62f);
int width = (int)((float)s.Width / 62f);
return new SizeF (width, s.Height);
}
@@ -357,12 +356,9 @@ namespace System.Windows.Forms {
#region Public Instance Methods
#if NET_2_0
internal void PerformAutoScale (bool called_by_scale)
public void PerformAutoScale ()
{
if ((AutoScaleMode == AutoScaleMode.Inherit) && !called_by_scale)
return;
if ((layout_suspended > 0) && !called_by_scale) {
if (layout_suspended > 0) {
auto_scale_pending = true;
return;
}
@@ -370,37 +366,20 @@ namespace System.Windows.Forms {
// PerformDelayedAutoScale after ResumeLayout
auto_scale_pending = false;
SizeF factor = AutoScaleFactor;
if (AutoScaleMode == AutoScaleMode.Inherit) {
ContainerControl cc = FindContainer (this.Parent);
if (cc != null)
factor = cc.AutoScaleFactor;
}
if (factor != new SizeF (1F, 1F)) {
is_auto_scaling = true;
if (AutoScaleFactor != new SizeF(1F, 1F)) {
SuspendLayout ();
Scale (factor);
Scale (AutoScaleFactor);
ResumeLayout (false);
is_auto_scaling = false;
}
auto_scale_dimensions = CurrentAutoScaleDimensions;
}
public void PerformAutoScale ()
{
PerformAutoScale (false);
}
internal void PerformDelayedAutoScale ()
{
if (auto_scale_pending)
PerformAutoScale ();
}
internal bool IsAutoScaling {
get { return is_auto_scaling; }
}
#endif
[MonoTODO]
@@ -32,7 +32,6 @@
#undef DebugRecreate
#undef DebugFocus
#undef DebugMessages
using System;
using System.ComponentModel;
@@ -88,7 +87,6 @@ namespace System.Windows.Forms
int tab_index; // position in tab order of siblings
bool tab_stop; // is the control a tab stop?
bool is_disposed; // has the window already been disposed?
bool is_disposing; // is the window getting disposed?
Size client_size; // size of the client area (window excluding decorations)
Rectangle client_rect; // rectangle with the client area (window excluding decorations)
ControlStyles control_style; // rather win32-specific, style bits for control
@@ -1121,7 +1119,6 @@ namespace System.Windows.Forms
protected override void Dispose (bool disposing)
{
if (!is_disposed && disposing) {
is_disposing = true;
Capture = false;
DisposeBackBuffer ();
@@ -1134,8 +1131,9 @@ namespace System.Windows.Forms
DestroyHandle();
}
if (parent != null)
if (parent != null) {
parent.Controls.Remove(this);
}
Control [] children = child_controls.GetAllControls ();
for (int i=0; i<children.Length; i++) {
@@ -1144,7 +1142,6 @@ namespace System.Windows.Forms
}
}
is_disposed = true;
is_disposing = false;
is_visible = false;
base.Dispose(disposing);
}
@@ -2765,9 +2762,6 @@ namespace System.Windows.Forms
[Localizable(true)]
[MWFCategory("Appearance")]
public virtual Font Font {
#if NET_2_0
[return: MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Font))]
#endif
get {
if (font != null)
return font;
@@ -3141,7 +3135,7 @@ namespace System.Windows.Forms
XplatUI.SetClipRegion(Handle, value);
clip_region = value;
Invalidate ();
#if NET_2_0
OnRegionChanged (EventArgs.Empty);
#endif
@@ -3552,15 +3546,15 @@ namespace System.Windows.Forms
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected virtual bool ScaleChildren {
get { return ScaleChildrenInternal; }
}
protected
#else
internal
#endif
internal virtual bool ScaleChildrenInternal {
virtual bool ScaleChildren
{
get { return true; }
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -3709,10 +3703,6 @@ namespace System.Windows.Forms
return;
}
if (is_disposing) {
return;
}
if (!is_visible) {
return;
}
@@ -4213,52 +4203,26 @@ namespace System.Windows.Forms
ScaleCore(dx, dy);
}
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
public void Scale (SizeF factor)
#if NET_2_0
public
#else
internal
#endif
void Scale (SizeF factor)
{
BoundsSpecified bounds_spec = BoundsSpecified.All;
SuspendLayout ();
if (this is ContainerControl) {
if ((this as ContainerControl).IsAutoScaling)
bounds_spec = BoundsSpecified.Size;
else if (IsContainerAutoScaling (this.Parent))
bounds_spec = BoundsSpecified.Location;
}
ScaleControl (factor, bounds_spec);
ScaleControl (factor, BoundsSpecified.All);
// Scale children
if ((bounds_spec != BoundsSpecified.Location) && ScaleChildren) {
foreach (Control c in Controls.GetAllControls ()) {
if (ScaleChildren)
foreach (Control c in Controls.GetAllControls ())
c.Scale (factor);
if (c is ContainerControl) {
ContainerControl cc = c as ContainerControl;
if ((cc.AutoScaleMode == AutoScaleMode.Inherit) && IsContainerAutoScaling (this))
cc.PerformAutoScale (true);
}
}
}
ResumeLayout ();
}
internal ContainerControl FindContainer (Control c)
{
while ((c != null) && !(c is ContainerControl))
c = c.Parent;
return c as ContainerControl;
}
private bool IsContainerAutoScaling (Control c)
{
ContainerControl cc = FindContainer (c);
return (cc != null) && cc.IsAutoScaling;
}
#endif
public void Select() {
Select(false, false);
}
@@ -4465,57 +4429,25 @@ namespace System.Windows.Forms
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected virtual Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
{
// Top level controls do not scale location
if (!is_toplevel) {
if ((specified & BoundsSpecified.X) == BoundsSpecified.X)
bounds.X = (int)Math.Round (bounds.X * factor.Width);
if ((specified & BoundsSpecified.Y) == BoundsSpecified.Y)
bounds.Y = (int)Math.Round (bounds.Y * factor.Height);
}
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth)) {
int border = (this is ComboBox) ? (ThemeEngine.Current.Border3DSize.Width * 2) :
(this.bounds.Width - this.client_size.Width);
bounds.Width = (int)Math.Round ((bounds.Width - border) * factor.Width + border);
}
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight)) {
int border = (this is ComboBox) ? (ThemeEngine.Current.Border3DSize.Height * 2) :
(this.bounds.Height - this.client_size.Height);
bounds.Height = (int)Math.Round ((bounds.Height - border) * factor.Height + border);
}
return bounds;
}
protected
#else
internal
#endif
private Rectangle GetScaledBoundsOld (Rectangle bounds, SizeF factor, BoundsSpecified specified)
virtual Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
{
RectangleF new_bounds = new RectangleF(bounds.Location, bounds.Size);
// Top level controls do not scale location
if (!is_toplevel) {
if ((specified & BoundsSpecified.X) == BoundsSpecified.X)
new_bounds.X *= factor.Width;
bounds.X = (int)Math.Round (bounds.Left * factor.Width);
if ((specified & BoundsSpecified.Y) == BoundsSpecified.Y)
new_bounds.Y *= factor.Height;
bounds.Y = (int)Math.Round (bounds.Top * factor.Height);
}
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth)) {
int border = (this is Form) ? (this.bounds.Width - this.client_size.Width) : 0;
new_bounds.Width = ((new_bounds.Width - border) * factor.Width + border);
}
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight)) {
int border = (this is Form) ? (this.bounds.Height - this.client_size.Height) : 0;
new_bounds.Height = ((new_bounds.Height - border) * factor.Height + border);
}
bounds.X = (int)Math.Round (new_bounds.X);
bounds.Y = (int)Math.Round (new_bounds.Y);
bounds.Width = (int)Math.Round (new_bounds.Right) - bounds.X;
bounds.Height = (int)Math.Round (new_bounds.Bottom) - bounds.Y;
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth))
bounds.Width = (int)Math.Round (bounds.Width * factor.Width);
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight))
bounds.Height = (int)Math.Round (bounds.Height * factor.Height);
return bounds;
}
@@ -4823,32 +4755,48 @@ namespace System.Windows.Forms
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected virtual void ScaleControl (SizeF factor, BoundsSpecified specified)
protected
#else
internal
#endif
virtual void ScaleControl (SizeF factor, BoundsSpecified specified)
{
Rectangle new_bounds = GetScaledBounds (bounds, factor, specified);
Rectangle new_bounds = GetScaledBounds (new Rectangle (Location, ClientSize), factor, specified);
SetBounds (new_bounds.X, new_bounds.Y, new_bounds.Width, new_bounds.Height, specified);
}
#endif
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Never)]
#else
[EditorBrowsable (EditorBrowsableState.Advanced)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
#endif
protected virtual void ScaleCore (float dx, float dy)
{
Rectangle new_bounds = GetScaledBoundsOld (bounds, new SizeF (dx, dy), BoundsSpecified.All);
protected virtual void ScaleCore(float dx, float dy) {
Point location;
Size size;
SuspendLayout ();
SuspendLayout();
SetBounds (new_bounds.X, new_bounds.Y, new_bounds.Width, new_bounds.Height, BoundsSpecified.All);
location = new Point((int)(Left * dx), (int)(Top * dy));
size = this.ClientSize;
if (ScaleChildrenInternal)
foreach (Control c in Controls.GetAllControls ())
c.Scale (dx, dy);
if (!GetStyle(ControlStyles.FixedWidth)) {
size.Width = (int)(size.Width * dx);
}
ResumeLayout ();
if (!GetStyle(ControlStyles.FixedHeight)) {
size.Height = (int)(size.Height * dy);
}
SetBounds(location.X, location.Y, size.Width, size.Height, BoundsSpecified.All);
/* Now scale our children */
Control [] controls = child_controls.GetAllControls ();
for (int i=0; i < controls.Length; i++) {
controls[i].Scale (new SizeF (dx, dy));
}
ResumeLayout();
}
protected virtual void Select(bool directed, bool forward) {
@@ -5173,7 +5121,7 @@ namespace System.Windows.Forms
}
protected virtual void WndProc(ref Message m) {
#if DebugMessages
#if debug
Console.WriteLine("Control {0} received message {1}", window.Handle == IntPtr.Zero ? this.Text : XplatUI.Window(window.Handle), m.ToString ());
#endif
if ((this.control_style & ControlStyles.EnableNotifyMessage) != 0) {
@@ -5682,16 +5630,14 @@ namespace System.Windows.Forms
Control [] controls = child_controls.GetAllControls ();
bool parented = false;
for (int i=0; i<controls.Length; i++) {
if (controls [i].is_visible && controls[i].IsHandleCreated)
if (XplatUI.GetParent (controls[i].Handle) != window.Handle) {
XplatUI.SetParent(controls[i].Handle, window.Handle);
parented = true;
}
if (controls [i].is_visible && controls[i].IsHandleCreated) {
XplatUI.SetParent(controls[i].Handle, window.Handle);
parented = true;
}
}
//if (parented)
if (parented) {
UpdateChildrenZOrder ();
}
}
}
else {
@@ -36,26 +36,12 @@ namespace System.Windows.Forms {
public class ControlBindingsCollection : BindingsCollection {
#region Fields
private Control control;
#if NET_2_0
private IBindableComponent bindable_component;
#endif
#endregion // Fields
#region Constructors
internal ControlBindingsCollection (Control control) {
this.control = control;
#if NET_2_0
bindable_component = control as IBindableComponent;
#endif
}
#if NET_2_0
public ControlBindingsCollection (IBindableComponent control)
{
bindable_component = control;
control = control as Control;
}
#endif
#endregion // Constructors
#region Public Instance Properties
@@ -75,14 +61,6 @@ namespace System.Windows.Forms {
return null;
}
}
#if NET_2_0
public IBindableComponent BindableComponent {
get {
return bindable_component;
}
}
#endif
#endregion // Public Instance Properties
#region Public Instance Methods
@@ -102,47 +80,6 @@ namespace System.Windows.Forms {
return res;
}
#if NET_2_0
public Binding Add (string propertyName, object dataSource, string dataMember, bool formattingEnabled)
{
return Add (propertyName, dataSource, dataMember, formattingEnabled, DataSourceUpdateMode.OnValidation, null, String.Empty, null);
}
public Binding Add (string propertyName, object dataSource, string dataMember, bool formattingEnabled, DataSourceUpdateMode updateMode)
{
return Add (propertyName, dataSource, dataMember, formattingEnabled, updateMode, null, String.Empty, null);
}
public Binding Add (string propertyName, object dataSource, string dataMember, bool formattingEnabled, DataSourceUpdateMode updateMode,
object nullValue)
{
return Add (propertyName, dataSource, dataMember, formattingEnabled, updateMode, nullValue, String.Empty, null);
}
public Binding Add (string propertyName, object dataSource, string dataMember, bool formattingEnabled, DataSourceUpdateMode updateMode,
object nullValue, string formatString)
{
return Add (propertyName, dataSource, dataMember, formattingEnabled, updateMode, nullValue, formatString, null);
}
public Binding Add (string propertyName, object dataSource, string dataMember, bool formattingEnabled, DataSourceUpdateMode updateMode,
object nullValue, string formatString, IFormatProvider formatInfo)
{
if (dataSource == null)
throw new ArgumentNullException ("dataSource");
Binding res = Add (propertyName, dataSource, dataMember);
res.FormattingEnabled = formattingEnabled;
res.DataSourceUpdateMode = updateMode;
res.NullValue = nullValue;
res.FormatString = formatString;
res.FormatInfo = formatInfo;
Add (res);
return res;
}
#endif
public new void Clear() {
base.Clear();
}
@@ -168,11 +105,7 @@ namespace System.Windows.Forms {
if (dataBinding == null)
throw new ArgumentNullException ("dataBinding");
#if NET_2_0
if (dataBinding.Control != null && dataBinding.BindableComponent != bindable_component)
#else
if (dataBinding.Control != null && dataBinding.Control != control)
#endif
throw new ArgumentException ("dataBinding belongs to another BindingsCollection");
for (int i = 0; i < Count; i++) {
@@ -186,11 +119,7 @@ namespace System.Windows.Forms {
}
}
#if NET_2_0
dataBinding.SetControl (bindable_component);
#else
dataBinding.SetControl (control);
#endif
dataBinding.Check ();
base.AddCore (dataBinding);
}
@@ -377,6 +377,8 @@ namespace System.Windows.Forms {
MetaDataChanged (this, e);
}
/* TODO - We need to fire the 2.0 ListChanged event for -likely- all the events,
since we are only doing it by now for ItemChanged - but need tests to ensure it */
private void ListChangedHandler (object sender, ListChangedEventArgs e)
{
switch (e.ListChangedType) {
@@ -421,6 +423,7 @@ namespace System.Windows.Forms {
UpdateIsBinding ();
#else
OnItemChanged (new ItemChangedEventArgs (-1));
OnListChanged (e);
#endif
}
else {
@@ -457,9 +460,6 @@ namespace System.Windows.Forms {
// UpdateIsBinding ();
break;
}
#if NET_2_0
OnListChanged (e);
#endif
}
#if NET_2_0
@@ -926,10 +926,6 @@ namespace System.Windows.Forms
}
}
internal override bool ScaleChildrenInternal {
get { return false; }
}
internal bool ShowEditRow {
get {
if (ListManager != null && !ListManager.CanAddRows)
@@ -1016,10 +1016,6 @@ namespace System.Windows.Forms {
}
}
internal override bool ScaleChildrenInternal {
get { return false; }
}
[DefaultValue (ScrollBars.Both)]
[Localizable (true)]
public ScrollBars ScrollBars {
@@ -1495,11 +1495,8 @@ namespace System.Windows.Forms {
break;
}
case Keys.F4:
if (!e.Alt && !is_drop_down_visible) {
DropDownMonthCalendar ();
e.Handled = true;
}
if (!is_drop_down_visible)
DropDownMonthCalendar();
break;
}
}
@@ -411,9 +411,6 @@ namespace System.Windows.Forms
currentSize = font.Size;
currentFontName = font.Name;
strikethroughCheckBox.Checked = font.Strikeout;
underlinedCheckBox.Checked = font.Underline;
int index = fontListBox.FindString (currentFontName);
if (index != -1) {
@@ -422,9 +419,6 @@ namespace System.Windows.Forms
fontListBox.SelectedIndex = 0;
}
UpdateFontSizeListBox ();
UpdateFontStyleListBox ();
fontListBox.TopIndex = fontListBox.SelectedIndex;
}
}
@@ -1143,11 +1137,6 @@ namespace System.Windows.Forms
currentFontStyle = FontStyle.Bold | FontStyle.Italic;
break;
}
if (strikethroughCheckBox.Checked)
currentFontStyle |= FontStyle.Strikeout;
if (underlinedCheckBox.Checked)
currentFontStyle |= FontStyle.Underline;
}
fontstyleListBox.EndUpdate( );
@@ -189,15 +189,21 @@ namespace System.Windows.Forms {
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected override Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
{
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width) {
int border = Size.Width - ClientSize.Width;
bounds.Width = (int)Math.Round ((bounds.Width - border) * factor.Width) + border;
}
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height) {
int border = Size.Height - ClientSize.Height;
bounds.Height = (int)Math.Round ((bounds.Height - border) * factor.Height) + border;
}
// Never change the Form's location
specified &= ~BoundsSpecified.Location;
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth))
bounds.Width = (int)Math.Round (bounds.Width * factor.Width);
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight))
bounds.Height = (int)Math.Round (bounds.Height * factor.Height);
Size size = ClientSizeFromSize (bounds.Size);
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth))
bounds.Width -= (int)((bounds.Width - size.Width) * (factor.Width - 1));
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight))
bounds.Height -= (int)((bounds.Height - size.Height) * (factor.Height - 1));
return bounds;
}
@@ -209,7 +215,9 @@ namespace System.Windows.Forms {
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected override void ScaleControl (SizeF factor, BoundsSpecified specified)
{
base.ScaleControl (factor, specified);
Rectangle new_bounds = GetScaledBounds (bounds, factor, specified);
SetBounds (new_bounds.X, new_bounds.Y, new_bounds.Width, new_bounds.Height, specified);
}
#endif
@@ -378,7 +386,7 @@ namespace System.Windows.Forms {
#region Public Constructor & Destructor
public Form ()
{
SizeF current_scale = GetAutoScaleSize (Font);
SizeF current_scale = GetAutoScaleSize (DeviceContext, Font);
autoscale = true;
autoscale_base_size = new Size ((int)Math.Round (current_scale.Width), (int)Math.Round(current_scale.Height));
@@ -505,12 +513,12 @@ namespace System.Windows.Forms {
}
set {
autoscale = value;
#if NET_2_0
if (value)
if (value && AutoScaleMode != AutoScaleMode.None)
AutoScaleMode = AutoScaleMode.None;
#endif
autoscale = value;
}
}
@@ -1146,7 +1154,6 @@ namespace System.Windows.Forms {
#if NET_2_0
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public Rectangle RestoreBounds {
get { return restore_bounds; }
}
@@ -1592,6 +1599,23 @@ namespace System.Windows.Forms {
#endregion // Public Static Methods
#region Public Instance Methods
internal SizeF GetAutoScaleSize (Graphics g, Font font)
{
//
// The following constants come from the dotnet mailing list
// discussion: http://discuss.develop.com/archives/wa.exe?A2=ind0203A&L=DOTNET&P=R3655
//
// The magic number is "Its almost the length
// of the string with a smattering added in
// for compat with earlier code".
//
string magic_string = "The quick brown fox jumped over the lazy dog.";
double magic_number = 44.549996948242189;
float width = (float) (g.MeasureString (magic_string, font).Width / magic_number);
return new SizeF (width, font.Height);
}
public void Activate ()
{
@@ -1800,7 +1824,7 @@ namespace System.Windows.Forms {
#endif
protected void ApplyAutoScaling()
{
SizeF current_size_f = GetAutoScaleSize (Font);
SizeF current_size_f = GetAutoScaleSize (DeviceContext, Font);
Size current_size = new Size ((int)Math.Round (current_size_f.Width), (int)Math.Round (current_size_f.Height));
float dx;
float dy;
@@ -1817,19 +1841,19 @@ namespace System.Windows.Forms {
// http://blogs.msdn.com/mharsh/archive/2004/01/25/62621.aspx
// but it makes things larger without looking better.
//
if (current_size.Width != AutoScaleBaseSize.Width) {
dx = (float)current_size.Width / AutoScaleBaseSize.Width + 0.08f;
if (current_size_f.Width != AutoScaleBaseSize.Width) {
dx = current_size_f.Width / AutoScaleBaseSize.Width + 0.08f;
} else {
dx = 1;
}
if (current_size.Height != AutoScaleBaseSize.Height) {
dy = (float)current_size.Height / AutoScaleBaseSize.Height + 0.08f;
if (current_size_f.Height != AutoScaleBaseSize.Height) {
dy = current_size_f.Height / AutoScaleBaseSize.Height + 0.08f;
} else {
dy = 1;
}
Scale (dx, dy);
Scale (new SizeF (dx, dy));
AutoScaleBaseSize = current_size;
}
@@ -2152,12 +2176,7 @@ namespace System.Windows.Forms {
if (Visible) {
if (window_manager != null)
if (WindowState == FormWindowState.Normal)
window_manager.SetWindowState (WindowState, WindowState);
else
// We don't really have an old_state, and if we pass the same thing,
// it may not really change the state for us
window_manager.SetWindowState ((FormWindowState)(-1), WindowState);
window_manager.SetWindowState (WindowState, WindowState);
}
}
@@ -2195,10 +2214,6 @@ namespace System.Windows.Forms {
case Keys.Control | Keys.Shift | Keys.F6:
MdiParent.MdiContainer.ActivatePreviousChild ();
return true;
case Keys.Alt | Keys.OemMinus:
case Keys.Alt | Keys.Subtract:
(this.WindowManager as MdiWindowManager).ShowPopup (Point.Empty);
return true;
}
}
@@ -2254,13 +2269,42 @@ namespace System.Windows.Forms {
}
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Never)]
[EditorBrowsable(EditorBrowsableState.Never)]
#else
[EditorBrowsable (EditorBrowsableState.Advanced)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
#endif
protected override void ScaleCore (float dx, float dy)
{
base.ScaleCore (dx, dy);
protected override void ScaleCore(float dx, float dy) {
try {
SuspendLayout();
// We can't scale max or min windows
if (WindowState == FormWindowState.Normal) {
// We cannot call base since base also adjusts X/Y, but
// a form is toplevel and doesn't move
Size size;
size = ClientSize;
if (!GetStyle(ControlStyles.FixedWidth)) {
size.Width = (int)(size.Width * dx);
}
if (!GetStyle(ControlStyles.FixedHeight)) {
size.Height = (int)(size.Height * dy);
}
ClientSize = size;
}
/* Now scale our children */
Control [] controls = Controls.GetAllControls ();
for (int i=0; i < controls.Length; i++) {
controls[i].Scale (new SizeF (dx, dy));
}
}
finally {
ResumeLayout();
}
}
protected override void Select(bool directed, bool forward) {
@@ -2572,9 +2616,7 @@ namespace System.Windows.Forms {
if (is_modal) {
Hide ();
} else {
Dispose ();
if (act != null && act != this)
act.SelectActiveControl ();
Dispose ();
}
mdi_parent = null;
} else {
@@ -431,7 +431,8 @@ namespace System.Windows.Forms.PropertyGridInternal
TypeConverter converter = PropertyDescriptor.Converter;
Type valueType = value != null ? value.GetType () : null;
// if the new value is not of the same type try to convert it
if (valueType != this.PropertyDescriptor.PropertyType) {
if (valueType != null && this.PropertyDescriptor.PropertyType != null &&
!this.PropertyDescriptor.PropertyType.IsAssignableFrom (valueType)) {
bool conversionError = false;
try {
if (converter != null &&
@@ -25,32 +25,21 @@
#if NET_2_0
using System;
using System.ComponentModel;
using Mono.WebBrowser.DOM;
namespace System.Windows.Forms
{
[MonoTODO ("Needs Implementation")]
public sealed class HtmlElement
{
private EventHandlerList events;
private Mono.WebBrowser.IWebBrowser webHost;
internal IElement element;
internal IElement element;
internal HtmlElement (Mono.WebBrowser.IWebBrowser webHost, IElement element)
{
this.webHost = webHost;
this.element = element;
}
internal EventHandlerList Events {
get {
if (events == null)
events = new EventHandlerList();
return events;
}
}
#region Properties
public HtmlElementCollection All {
get {
@@ -251,240 +240,6 @@ namespace System.Windows.Forms
return !(left == right);
}
#endregion
#region Events
private void OnClick (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[ClickEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object ClickEvent = new object ();
public event HtmlElementEventHandler Click {
add {
Events.AddHandler (ClickEvent, value);
element.Click += new NodeEventHandler (OnClick);
}
remove {
Events.RemoveHandler (ClickEvent, value);
element.Click -= new NodeEventHandler (OnClick);
}
}
private void OnDoubleClick (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[DoubleClickEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object DoubleClickEvent = new object ();
public event HtmlElementEventHandler DoubleClick {
add {
Events.AddHandler (DoubleClickEvent, value);
element.DoubleClick += new NodeEventHandler (OnDoubleClick);
}
remove {
Events.RemoveHandler (DoubleClickEvent, value);
element.DoubleClick -= new NodeEventHandler (OnDoubleClick);
}
}
private void OnMouseDown (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[MouseDownEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object MouseDownEvent = new object ();
public event HtmlElementEventHandler MouseDown {
add {
Events.AddHandler (MouseDownEvent, value);
element.MouseDown += new NodeEventHandler (OnMouseDown);
}
remove {
Events.RemoveHandler (MouseDownEvent, value);
element.MouseDown -= new NodeEventHandler (OnMouseDown);
}
}
private void OnMouseUp (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[MouseUpEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object MouseUpEvent = new object ();
public event HtmlElementEventHandler MouseUp {
add {
Events.AddHandler (MouseUpEvent, value);
element.MouseUp += new NodeEventHandler (OnMouseUp);
}
remove {
Events.RemoveHandler (MouseUpEvent, value);
element.MouseUp -= new NodeEventHandler (OnMouseUp);
}
}
private void OnMouseMove (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[MouseMoveEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object MouseMoveEvent = new object ();
public event HtmlElementEventHandler MouseMove {
add {
Events.AddHandler (MouseMoveEvent, value);
element.MouseMove += new NodeEventHandler (OnMouseMove);
}
remove {
Events.RemoveHandler (MouseMoveEvent, value);
element.MouseMove -= new NodeEventHandler (OnMouseMove);
}
}
private void OnMouseOver (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[MouseOverEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object MouseOverEvent = new object ();
public event HtmlElementEventHandler MouseOver {
add {
Events.AddHandler (MouseOverEvent, value);
element.MouseOver += new NodeEventHandler (OnMouseOver);
}
remove {
Events.RemoveHandler (MouseOverEvent, value);
element.MouseOver -= new NodeEventHandler (OnMouseOver);
}
}
private void OnMouseEnter (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[MouseEnterEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object MouseEnterEvent = new object ();
public event HtmlElementEventHandler MouseEnter {
add {
Events.AddHandler (MouseEnterEvent, value);
element.MouseEnter += new NodeEventHandler (OnMouseEnter);
}
remove {
Events.RemoveHandler (MouseEnterEvent, value);
element.MouseEnter -= new NodeEventHandler (OnMouseEnter);
}
}
private void OnMouseLeave (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[MouseLeaveEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object MouseLeaveEvent = new object ();
public event HtmlElementEventHandler MouseLeave {
add {
Events.AddHandler (MouseLeaveEvent, value);
element.MouseLeave += new NodeEventHandler (OnMouseLeave);
}
remove {
Events.RemoveHandler (MouseLeaveEvent, value);
element.MouseLeave -= new NodeEventHandler (OnMouseLeave);
}
}
private void OnKeyDown (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[KeyDownEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object KeyDownEvent = new object ();
public event HtmlElementEventHandler KeyDown {
add {
Events.AddHandler (KeyDownEvent, value);
element.KeyDown += new NodeEventHandler (OnKeyDown);
}
remove {
Events.RemoveHandler (KeyDownEvent, value);
element.KeyDown -= new NodeEventHandler (OnKeyDown);
}
}
private void OnKeyPress (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[KeyPressEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object KeyPressEvent = new object ();
public event HtmlElementEventHandler KeyPress {
add {
Events.AddHandler (KeyPressEvent, value);
element.KeyPress += new NodeEventHandler (OnKeyPress);
}
remove {
Events.RemoveHandler (KeyPressEvent, value);
element.KeyPress -= new NodeEventHandler (OnKeyPress);
}
}
private void OnKeyUp (object sender, EventArgs e)
{
HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[KeyUpEvent];
if (eh != null) {
HtmlElementEventArgs ev = new HtmlElementEventArgs ();
eh (this, ev);
}
}
private static object KeyUpEvent = new object ();
public event HtmlElementEventHandler KeyUp {
add {
Events.AddHandler (KeyUpEvent, value);
element.KeyUp += new NodeEventHandler (OnKeyUp);
}
remove {
Events.RemoveHandler (KeyUpEvent, value);
element.KeyUp -= new NodeEventHandler (OnKeyUp);
}
}
#endregion
}
}
@@ -30,53 +30,13 @@ using Mono.WebBrowser.DOM;
namespace System.Windows.Forms
{
public sealed class HtmlHistory : IDisposable {
private bool disposed;
public sealed class HtmlHistory {
private Mono.WebBrowser.IWebBrowser webHost;
internal HtmlHistory (Mono.WebBrowser.IWebBrowser webHost)
{
this.webHost = webHost;
}
#region IDisposable Members
private void Dispose (bool disposing)
{
if (!disposed) {
disposed = true;
}
}
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
#endregion
public void Back (int index) {
this.webHost.Navigation.Go (index * -1, true);
}
public void Forward (int index) {
this.webHost.Navigation.Go (index, true);
}
public void Go (int index) {
this.webHost.Navigation.Go (index, true);
}
public void Go (string url) {
this.webHost.Navigation.Go (url);
}
public void Go (Uri uri) {
this.webHost.Navigation.Go (uri.ToString ());
}
}
}
@@ -58,10 +58,7 @@ namespace System.Windows.Forms
string indexStr;
if (value != null && value is string) {
indexStr = (string) value;
if (indexStr == "(none)")
return -1;
else
return Int32.Parse (indexStr);
return Int32.Parse (indexStr);
}
else
return base.ConvertFrom (context, culture, value);
@@ -331,7 +331,7 @@ namespace System.Windows.Forms
break;
}
TextBoxTextRenderer.DrawText (dc, end_str, last.Font, last.Color, X + widths [TextLengthWithoutEnding ()] - document.viewport_x + document.OffsetX, y, true);
TextBoxTextRenderer.DrawText (dc, end_str, last.Font, last.Color, X + widths [TextLengthWithoutEnding ()] - document.viewport_x, y, true);
}
/// <summary> Find the tag on a line based on the character position, pos is 0-based</summary>
@@ -452,15 +452,11 @@ namespace System.Windows.Forms
bool wrapped;
Line line;
int wrap_pos;
int prev_height;
int prev_ascent;
pos = 0;
len = this.text.Length;
tag = this.tags;
prev_offset = this.offset; // For drawing optimization calculations
prev_height = this.height;
prev_ascent = this.ascent;
this.height = 0; // Reset line height
this.ascent = 0; // Reset the ascent for the line
tag.Shift = 0;
@@ -477,10 +473,9 @@ namespace System.Windows.Forms
wrap_pos = 0;
while (pos < len) {
while (tag.Length == 0) { // We should always have tags after a tag.length==0 unless len==0
//tag.Ascent = 0;
tag.Shift = tag.Line.ascent - tag.Ascent;
tag.Shift = 0;
tag = tag.Next;
}
@@ -566,18 +561,12 @@ namespace System.Windows.Forms
}
}
while (tag != null) {
tag.Shift = tag.Line.ascent - tag.Ascent;
tag = tag.Next;
}
if (this.height == 0) {
this.height = tags.Font.Height;
tags.Height = this.height;
tags.Shift = 0;
tag.Height = this.height;
}
if (prev_offset != offset || prev_height != this.height || prev_ascent != this.ascent)
if (prev_offset != offset)
retval = true;
return retval;
@@ -396,11 +396,7 @@ namespace System.Windows.Forms
return tag; // Not sure if we should get the final tag here
while (tag != null) {
// [H e][l][l o _ W][o r] Text
// [1 2][3][4 5 6 7][8 9] Start
// 3 4 8 10 End
// 0 1 2 3 4 5 6 7 8 9 Pos
if ((tag.start <= pos) && (pos < tag.End))
if ((tag.start <= pos) && (pos <= tag.End))
return GetFinalTag (tag);
tag = tag.next;
@@ -448,7 +444,7 @@ namespace System.Windows.Forms
return retval;
}
start_tag = FindTag (line, formatStart - 1);
start_tag = FindTag (line, formatStart);
// we are at an empty tag already!
// e.g. [Tag 0 - "He"][Tag 1 = 0 length][Tag 2 "llo world"]
@@ -491,7 +487,7 @@ namespace System.Windows.Forms
return retval;
/// Now do the last tag
end_tag = FindTag (line, end-1);
end_tag = FindTag (line, end);
if (end_tag != null) {
end_tag.Break (end);
@@ -511,16 +507,13 @@ namespace System.Windows.Forms
int length_no_ending = line.TextLengthWithoutEnding ();
if (Length == 0)
return low-1;
return start;
if (length_no_ending == 0)
return 0;
if (x < line.widths [low]) {
if (low == 1 && x > (line.widths [1] / 2))
return low;
if (x < line.widths[low])
return low - 1;
}
if (x > line.widths[length_no_ending])
return length_no_ending;
@@ -569,9 +562,8 @@ namespace System.Windows.Forms
private static void SetFormat (LineTag tag, Font font, Color color, Color back_color, FormatSpecified specified)
{
if ((FormatSpecified.Font & specified) == FormatSpecified.Font) {
if ((FormatSpecified.Font & specified) == FormatSpecified.Font)
tag.Font = font;
}
if ((FormatSpecified.Color & specified) == FormatSpecified.Color)
tag.color = color;
if ((FormatSpecified.BackColor & specified) == FormatSpecified.BackColor) {
@@ -863,9 +863,28 @@ namespace System.Windows.Forms
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected override Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
{
bounds.Height = requested_height;
// For some reason, it always uses the control's Height instead of
// the Height passed in
bounds.Height = this.bounds.Height;
return base.GetScaledBounds (bounds, factor, specified);
if ((specified & BoundsSpecified.X) == BoundsSpecified.X)
bounds.X = (int)Math.Round (bounds.Left * factor.Width);
if ((specified & BoundsSpecified.Y) == BoundsSpecified.Y)
bounds.Y = (int)Math.Round (bounds.Top * factor.Height);
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth))
bounds.Width = (int)Math.Round (bounds.Width * factor.Width);
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight))
bounds.Height = (int)Math.Round (bounds.Height * factor.Height);
Size size = ClientSizeFromSize (bounds.Size);
if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width && !GetStyle (ControlStyles.FixedWidth))
bounds.Width -= (int)((bounds.Width - size.Width) * (factor.Width - 1));
if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height && !GetStyle (ControlStyles.FixedHeight))
bounds.Height -= (int)((bounds.Height - size.Height) * (factor.Height - 1));
return bounds;
}
#endif
@@ -1050,7 +1069,9 @@ namespace System.Windows.Forms
protected override void ScaleControl (SizeF factor, BoundsSpecified specified)
{
base.ScaleControl (factor, specified);
Rectangle new_bounds = GetScaledBounds (new Rectangle (Location, new Size (Width, Height)), factor, specified);
SetBounds (new_bounds.X, new_bounds.Y, new_bounds.Width, new_bounds.Height, specified);
}
#endif
@@ -1730,11 +1751,7 @@ namespace System.Windows.Forms
private void OnMouseDownLB (object sender, MouseEventArgs e)
{
// Only do stuff with the left mouse button
if ((e.Button & MouseButtons.Left) == 0)
return;
int index = IndexAtClientPoint (e.X, e.Y);
int index = IndexAtClientPoint (e.X, e.Y);
if (index == -1)
return;
@@ -1814,22 +1831,10 @@ namespace System.Windows.Forms
private void OnMouseUpLB (object sender, MouseEventArgs e)
{
// Only do stuff with the left mouse button
if ((e.Button & MouseButtons.Left) == 0)
return;
if (e.Clicks > 1) {
if (e.Clicks > 1)
OnDoubleClick (EventArgs.Empty);
#if NET_2_0
OnMouseDoubleClick (e);
#endif
}
else if (e.Clicks == 1) {
else if (e.Clicks == 1)
OnClick (EventArgs.Empty);
#if NET_2_0
OnMouseClick (e);
#endif
}
if (!button_pressed)
return;
@@ -2806,4 +2811,3 @@ namespace System.Windows.Forms
}
@@ -278,14 +278,6 @@ namespace System.Windows.Forms
#endregion Public Properties
#region Private Properties
internal override bool ScaleChildrenInternal {
get { return false; }
}
#endregion Private Properties
#region Public Methods
protected object FilterItemOnProperty (object item)
@@ -385,10 +385,6 @@ namespace System.Windows.Forms
}
}
internal override bool ScaleChildrenInternal {
get { return false; }
}
#endregion // Private Internal Properties
#region Protected Properties
@@ -131,7 +131,6 @@ namespace System.Windows.Forms
throw new ArgumentNullException ();
}
provider = maskedTextProvider;
is_empty_mask = false;
Init ();
}
@@ -141,7 +140,6 @@ namespace System.Windows.Forms
throw new ArgumentNullException ();
}
provider = new MaskedTextProvider (mask, CultureInfo.CurrentCulture);
is_empty_mask = false;
Init ();
}
private void Init ()
@@ -246,14 +244,7 @@ namespace System.Windows.Forms
if (!result) {
OnMaskInputRejected (new MaskInputRejectedEventArgs (testPosition, resultHint));
} else {
int iIndex = provider.FindEditPositionFrom (SelectionStart+1, true);
if (iIndex != MaskedTextProvider.InvalidIndex) {
SelectionStart = iIndex;
} else {
SelectionStart = provider.Length;
}
SelectionStart++;
UpdateVisibleText ();
}
@@ -517,7 +508,6 @@ namespace System.Windows.Forms
}
provider = new MaskedTextProvider (value, provider.Culture, provider.AllowPromptAsInput, provider.PromptChar, provider.PasswordChar, provider.AsciiOnly);
ReCalculatePasswordChar ();
UpdateVisibleText ();
}
}
@@ -575,22 +565,10 @@ namespace System.Windows.Forms
[DefaultValue ('\0')]
public char PasswordChar {
get {
if (use_system_password_char)
return '*';
return provider.PasswordChar;
}
set {
provider.PasswordChar = value;
if (value != '\0') {
provider.IsPassword = true;
} else
provider.IsPassword = false;
ReCalculatePasswordChar (true);
CalculateDocument ();
UpdateVisibleText ();
}
}
@@ -752,14 +730,7 @@ namespace System.Windows.Forms
return use_system_password_char;
}
set {
if (use_system_password_char != value) {
use_system_password_char = value;
if (use_system_password_char)
PasswordChar = PasswordChar;
else
PasswordChar = '\0';
}
use_system_password_char = value;
}
}
@@ -786,21 +757,6 @@ namespace System.Windows.Forms
}
#endregion
#region Internal and private members
private void ReCalculatePasswordChar ()
{
ReCalculatePasswordChar (PasswordChar != '\0');
}
private void ReCalculatePasswordChar (bool using_password)
{
if (using_password)
if (is_empty_mask)
document.PasswordChar = PasswordChar.ToString ();
else
document.PasswordChar = string.Empty;
}
internal override void OnPaintInternal (PaintEventArgs pevent)
{
base.OnPaintInternal (pevent);
@@ -816,15 +772,7 @@ namespace System.Windows.Forms
private void UpdateVisibleText ()
{
string text = null;
if (is_empty_mask || setting_text)
text = base.Text;
else
if (provider == null)
text = string.Empty;
else
text = provider.ToDisplayString ();
string text = Text;
setting_text = true;
if (base.Text != text) {
@@ -459,8 +459,6 @@ namespace System.Windows.Forms {
} else if (sizegrip != null) {
sizegrip.Visible = false;
}
XplatUI.InvalidateNC (Handle);
}
private void CalcHBar (int left, int right, bool vert_vis)
@@ -843,30 +841,13 @@ namespace System.Windows.Forms {
if (c is MenuStrip)
child_menu = (MenuStrip)c;
if (form.WindowState != FormWindowState.Maximized)
RemoveControlMenuItems (wm);
RemoveControlMenuItems (wm);
if (form.WindowState == FormWindowState.Maximized) {
bool found = false;
foreach (ToolStripItem tsi in parent_menu.Items) {
if (tsi is MdiControlStrip.SystemMenuItem) {
(tsi as MdiControlStrip.SystemMenuItem).MdiForm = form;
found = true;
} else if (tsi is MdiControlStrip.ControlBoxMenuItem) {
(tsi as MdiControlStrip.ControlBoxMenuItem).MdiForm = form;
found = true;
}
}
if (!found) {
parent_menu.SuspendLayout ();
parent_menu.Items.Insert (0, new MdiControlStrip.SystemMenuItem (form));
parent_menu.Items.Add (new MdiControlStrip.ControlBoxMenuItem (form, MdiControlStrip.ControlBoxType.Close));
parent_menu.Items.Add (new MdiControlStrip.ControlBoxMenuItem (form, MdiControlStrip.ControlBoxType.Max));
parent_menu.Items.Add (new MdiControlStrip.ControlBoxMenuItem (form, MdiControlStrip.ControlBoxType.Min));
parent_menu.ResumeLayout ();
}
parent_menu.Items.Insert (0, new MdiControlStrip.SystemMenuItem (form));
parent_menu.Items.Add (new MdiControlStrip.ControlBoxMenuItem (form, MdiControlStrip.ControlBoxType.Close));
parent_menu.Items.Add (new MdiControlStrip.ControlBoxMenuItem (form, MdiControlStrip.ControlBoxType.Max));
parent_menu.Items.Add (new MdiControlStrip.ControlBoxMenuItem (form, MdiControlStrip.ControlBoxType.Min));
}
if (child_menu != null)
@@ -882,23 +863,11 @@ namespace System.Windows.Forms {
{
Form form = wm.form;
MenuStrip parent_menu = form.MdiParent.MainMenuStrip;
// Only remove the items if the form requesting still owns the menu items
if (parent_menu != null) {
parent_menu.SuspendLayout ();
for (int i = parent_menu.Items.Count - 1; i >= 0; i--) {
if (parent_menu.Items[i] is MdiControlStrip.SystemMenuItem) {
if ((parent_menu.Items[i] as MdiControlStrip.SystemMenuItem).MdiForm == form)
parent_menu.Items.RemoveAt (i);
} else if (parent_menu.Items[i] is MdiControlStrip.ControlBoxMenuItem) {
if ((parent_menu.Items[i] as MdiControlStrip.ControlBoxMenuItem).MdiForm == form)
parent_menu.Items.RemoveAt (i);
}
}
parent_menu.ResumeLayout ();
}
if (parent_menu != null)
for (int i = parent_menu.Items.Count - 1; i >= 0; i--)
if (parent_menu.Items[i] is MdiControlStrip.SystemMenuItem || parent_menu.Items[i] is MdiControlStrip.ControlBoxMenuItem)
parent_menu.Items.RemoveAt (i);
}
#endif
@@ -912,15 +881,15 @@ namespace System.Windows.Forms {
ActivateChild (form);
return;
}
if (old_window_state == FormWindowState.Normal)
wm.NormalBounds = form.Bounds;
if (SetWindowStates (wm))
return;
if (old_window_state == new_window_state)
return;
if (old_window_state == FormWindowState.Normal)
wm.NormalBounds = form.Bounds;
mdiclient_layout = old_window_state == FormWindowState.Maximized || new_window_state == FormWindowState.Maximized;
@@ -90,11 +90,6 @@ namespace System.Windows.Forms
return;
}
public Form MdiForm {
get { return form; }
set { form = value; }
}
private void RestoreItemHandler (object sender, EventArgs e)
{
form.WindowState = FormWindowState.Normal;
@@ -177,11 +172,6 @@ namespace System.Windows.Forms
}
}
public Form MdiForm {
get { return form; }
set { form = value; }
}
private void RestoreItemHandler (object sender, EventArgs e)
{
form.WindowState = FormWindowState.Normal;
@@ -243,13 +243,13 @@ namespace System.Windows.Forms {
icon_menu.DrawItem += new DrawItemEventHandler (DrawIconMenuItem);
icon_menu.Click += new EventHandler (ClickIconMenuItem);
MenuItem restore = new MenuItem ("&Restore", new EventHandler (RestoreItemHandler));
MenuItem move = new MenuItem ("&Move", new EventHandler (MoveItemHandler));
MenuItem size = new MenuItem ("&Size", new EventHandler (SizeItemHandler));
MenuItem minimize = new MenuItem ("Mi&nimize", new EventHandler (MinimizeItemHandler));
MenuItem maximize = new MenuItem ("Ma&ximize", new EventHandler (MaximizeItemHandler));
MenuItem close = new MenuItem ("&Close", new EventHandler (CloseItemHandler));
MenuItem next = new MenuItem ("Nex&t", new EventHandler (NextItemHandler));
MenuItem restore = new MenuItem ("Restore", new EventHandler (RestoreItemHandler));
MenuItem move = new MenuItem ("Move", new EventHandler (MoveItemHandler));
MenuItem size = new MenuItem ("Size", new EventHandler (SizeItemHandler));
MenuItem minimize = new MenuItem ("Minimize", new EventHandler (MinimizeItemHandler));
MenuItem maximize = new MenuItem ("Maximize", new EventHandler (MaximizeItemHandler));
MenuItem close = new MenuItem ("Close", new EventHandler (CloseItemHandler));
MenuItem next = new MenuItem ("Next", new EventHandler (NextItemHandler));
icon_menu.MenuItems.AddRange (new MenuItem [] { restore, move, size, minimize,
maximize, close, next });
@@ -270,21 +270,8 @@ namespace System.Windows.Forms {
ShowPopup (pnt);
}
internal void ShowPopup (Point pnt)
private void ShowPopup (Point pnt)
{
#if NET_2_0
// If we are using MainMenuStrip, display that menu instead
if (form.WindowState == FormWindowState.Maximized && form.MdiParent.MainMenuStrip != null)
if (form.MdiParent.MainMenuStrip.Items.Count > 0) {
ToolStripItem tsi = form.MdiParent.MainMenuStrip.Items[0];
if (tsi is MdiControlStrip.SystemMenuItem) {
(tsi as MdiControlStrip.SystemMenuItem).ShowDropDown ();
return;
}
}
#endif
icon_popup_menu.MenuItems[0].Enabled = form.window_state != FormWindowState.Normal; // restore
icon_popup_menu.MenuItems[1].Enabled = form.window_state != FormWindowState.Maximized; // move
icon_popup_menu.MenuItems[2].Enabled = form.window_state != FormWindowState.Maximized; // size
@@ -263,18 +263,11 @@ namespace System.Windows.Forms
// Calculate the width based on amount of buttons
tb_width = (button_width + button_space) * buttoncount;
// The form caption can also make us bigger
SizeF caption = TextRenderer.MeasureString (Text, new Font (DefaultFont, FontStyle.Bold));
// Use the bigger of the caption size (plus some arbitrary borders/close button)
// or the text size, up to 60% of the screen (max_size)
Size new_size = new SizeF (Math.Min (Math.Max (caption.Width + 40, tsize.Width), max_width), tsize.Height).ToSize ();
// Now we choose the good size for the form
if (new_size.Width > tb_width)
this.ClientSize = new Size (new_size.Width + (space_border * 2), Height = new_size.Height + (space_border * 4));
if (tsize.ToSize ().Width > tb_width)
this.ClientSize = new Size(tsize.ToSize().Width + (space_border * 2), Height = tsize.ToSize ().Height + (space_border * 4));
else
this.ClientSize = new Size (tb_width + (space_border * 2), Height = new_size.Height + (space_border * 4));
this.ClientSize = new Size(tb_width + (space_border * 2), Height = tsize.ToSize ().Height + (space_border * 4));
// Now we set the left of the buttons
button_left = (this.ClientSize.Width / 2) - (tb_width / 2) + 5;
@@ -2143,13 +2143,6 @@ namespace System.Windows.Forms {
this.OnDateChanged (new DateRangeEventArgs (SelectionStart, SelectionEnd));
e.Handled = true;
break;
case Keys.F4:
// Close ourselves on Alt-F4 if we are a popup
if (e.Alt && owner != null) {
this.Hide ();
e.Handled = true;
}
break;
default:
break;
}
@@ -297,12 +297,11 @@ namespace System.Windows.Forms.PropertyGridInternal {
string error = null;
bool changed = entry.SetValue (value, out error);
if (!changed && error != null) {
if (property_grid.ShowError (error, MessageBoxButtons.OKCancel) == DialogResult.Cancel)
UpdateItem (entry); // restore value, repaint, etc
else
if (property_grid.ShowError (error, MessageBoxButtons.OKCancel) == DialogResult.OK)
return false;
}
}
UpdateItem (entry); // restore value, repaint, etc
return true;
}
@@ -752,10 +751,10 @@ namespace System.Windows.Forms.PropertyGridInternal {
GridEntry entry = this.SelectedGridItem as GridEntry;
if (entry != null) {
grid_textbox.Text = (string) ((ListBox) sender).SelectedItem;
if (TrySetEntry (entry, (string) ((ListBox) sender).SelectedItem))
CloseDropDown ();
if (TrySetEntry (entry, grid_textbox.Text))
UnfocusSelection ();
}
CloseDropDown ();
}
private void DropDownButtonClicked (object sender, EventArgs e)
@@ -773,8 +772,11 @@ namespace System.Windows.Forms.PropertyGridInternal {
else {
ICollection std_values = entry.AcceptedValues;
if (std_values != null) {
if (dropdown_list == null)
if (dropdown_list == null) {
dropdown_list = new ListBox ();
dropdown_list.KeyDown += new KeyEventHandler (listBox_KeyDown);
dropdown_list.MouseUp += new MouseEventHandler (listBox_MouseUp);
}
dropdown_list.Items.Clear ();
dropdown_list.BorderStyle = BorderStyle.FixedSingle;
int selected_index = 0;
@@ -788,8 +790,6 @@ namespace System.Windows.Forms.PropertyGridInternal {
}
dropdown_list.Height = row_height * Math.Min (dropdown_list.Items.Count, 15);
dropdown_list.Width = ClientRectangle.Width - SplitterLocation - (vbar.Visible ? vbar.Width : 0);
dropdown_list.KeyDown += new KeyEventHandler (listBox_KeyDown);
dropdown_list.MouseUp+=new MouseEventHandler (listBox_MouseUp);
if (std_values.Count > 0)
dropdown_list.SelectedIndex = selected_index;
DropDownControl (dropdown_list);
@@ -911,8 +911,10 @@ namespace System.Windows.Forms.PropertyGridInternal {
if (newItem != null) {
UpdateItem (newItem);
ScrollToItem (newItem);
} else
} else {
grid_textbox.Visible = false;
vbar.Visible = false;
}
}
internal void UpdateView ()
@@ -74,7 +74,6 @@ namespace System.Windows.Forms {
#region Public Constructors
public RichTextBox() {
accepts_return = true;
auto_size = false;
auto_word_select = false;
bullet_indent = 0;
max_length = Int32.MaxValue;
@@ -84,7 +83,6 @@ namespace System.Windows.Forms {
document.CRLFSize = 1;
shortcuts_enabled = true;
base.EnableLinks = true;
richtext = true;
rtf_style = new RtfSectionStyle ();
rtf_section_stack = null;
@@ -1056,8 +1054,7 @@ namespace System.Windows.Forms {
public void Redo()
{
if (document.undo.Redo ())
OnTextChanged (EventArgs.Empty);
document.undo.Redo ();
}
public void SaveFile(Stream data, RichTextBoxStreamType fileType) {
@@ -1362,7 +1359,6 @@ namespace System.Windows.Forms {
remove { base.QueryContinueDrag -= value; }
}
[MonoTODO("Currently does not ever fire")]
public event EventHandler SelectionChanged {
add { Events.AddHandler (SelectionChangedEvent, value); }
remove { Events.RemoveHandler (SelectionChangedEvent, value); }
@@ -40,8 +40,6 @@ namespace System.Windows.Forms {
// default parameterless construcor, use default values
public SelectionRange () {
end = DateTime.MaxValue.Date;
start = DateTime.MinValue.Date;
}
// constructor that receives another range, copies it's Start and End values
@@ -53,11 +51,11 @@ namespace System.Windows.Forms {
// constructor that receives two dates, uses the lower of the two as start
public SelectionRange (DateTime lower, DateTime upper) {
if (lower <= upper) {
end = upper.Date;
start = lower.Date;
end = upper;
start = lower;
} else {
end = lower.Date;
start = upper.Date;
end = lower;
start = upper;
}
}
@@ -133,9 +133,6 @@ namespace System.Windows.Forms
#region Public Constructors
public SplitContainer ()
{
SetStyle (ControlStyles.SupportsTransparentBackColor, true);
SetStyle (ControlStyles.OptimizedDoubleBuffer, true);
fixed_panel = FixedPanel.None;
orientation = Orientation.Vertical;
@@ -65,7 +65,6 @@ namespace System.Windows.Forms {
scrollbars = RichTextBoxScrollBars.None;
alignment = HorizontalAlignment.Left;
this.LostFocus +=new EventHandler(TextBox_LostFocus);
this.RightToLeftChanged += new EventHandler (TextBox_RightToLeftChanged);
BackColor = SystemColors.Window;
ForeColor = SystemColors.WindowText;
@@ -94,53 +93,14 @@ namespace System.Windows.Forms {
document.multiline = false;
}
#endregion // Public Constructors
#region Private & Internal Methods
void TextBox_RightToLeftChanged (object sender, EventArgs e)
{
UpdateAlignment ();
}
private void TextBox_LostFocus(object sender, EventArgs e) {
if (hide_selection)
document.InvalidateSelectionArea ();
}
private void UpdateAlignment ()
{
HorizontalAlignment new_alignment = alignment;
RightToLeft rtol = GetInheritedRtoL ();
if (rtol == RightToLeft.Yes) {
if (new_alignment == HorizontalAlignment.Left)
new_alignment = HorizontalAlignment.Right;
else if (new_alignment == HorizontalAlignment.Right)
new_alignment = HorizontalAlignment.Left;
}
document.alignment = new_alignment;
// MS word-wraps if alignment isn't left
if (Multiline) {
if (alignment != HorizontalAlignment.Left) {
document.Wrap = true;
} else {
document.Wrap = word_wrap;
}
}
for (int i = 1; i <= document.Lines; i++) {
document.GetLine (i).Alignment = new_alignment;
}
document.RecalculateDocument (CreateGraphicsInternal ());
Invalidate (); // Make sure we refresh
}
internal override Color ChangeBackColor (Color backColor)
{
if (backColor == Color.Empty) {
@@ -362,8 +322,21 @@ namespace System.Windows.Forms {
if (value != alignment) {
alignment = value;
UpdateAlignment ();
document.alignment = value;
// MS word-wraps if alignment isn't left
if (Multiline) {
if (alignment != HorizontalAlignment.Left) {
document.Wrap = true;
} else {
document.Wrap = word_wrap;
}
}
for (int i = 1; i <= document.Lines; i++) {
document.GetLine(i).Alignment = value;
}
document.RecalculateDocument(CreateGraphicsInternal());
OnTextAlignChanged(EventArgs.Empty);
}
}
@@ -130,7 +130,6 @@ namespace System.Windows.Forms
FontChanged += new EventHandler(TextBoxBase_FontOrColorChanged);
ForeColorChanged += new EventHandler(TextBoxBase_FontOrColorChanged);
MouseWheel += new MouseEventHandler(TextBoxBase_MouseWheel);
RightToLeftChanged += new EventHandler (TextBoxBase_RightToLeftChanged);
scrollbars = RichTextBoxScrollBars.None;
@@ -454,9 +453,6 @@ namespace System.Windows.Forms
if (value != document.multiline) {
document.multiline = value;
if (this is TextBox)
SetStyle (ControlStyles.FixedHeight, !value);
// SetBoundsCore overrides the Height for multiline if it needs to,
// so we don't need to worry about it here.
SetBoundsCore (Left, Top, Width, ExplicitBounds.Height, BoundsSpecified.None);
@@ -861,8 +857,7 @@ namespace System.Windows.Forms
[MonoTODO("Deleting is classed as Typing, instead of its own Undo event")]
public void Undo ()
{
if (document.undo.Undo ())
OnTextChanged (EventArgs.Empty);
document.undo.Undo();
}
#if NET_2_0
@@ -1127,7 +1122,7 @@ namespace System.Windows.Forms
case Keys.Z:
if (control && read_only == false) {
Undo ();
Undo();
return true;
}
return false;
@@ -1714,10 +1709,6 @@ namespace System.Windows.Forms
}
}
internal override bool ScaleChildrenInternal {
get { return false; }
}
internal bool ShowSelection {
get {
if (show_selection || !hide_selection) {
@@ -1793,16 +1784,6 @@ namespace System.Windows.Forms
if (e.Button == MouseButtons.Left) {
// Special case when shift key is pressed and
// left mouse is clicked.. set selection from
// current cursor to mouse
if ((Control.ModifierKeys & Keys.Shift) > 0) {
document.PositionCaret (e.X + document.ViewPortX, e.Y + document.ViewPortY);
document.SetSelectionToCaret (false);
document.DisplayCaret ();
return;
}
dbliclick = IsDoubleClick (e);
if (current_link != null) {
@@ -1896,18 +1877,11 @@ namespace System.Windows.Forms
if (vscroll.Visible) {
//hscroll.Maximum += vscroll.Width;
canvas_width = ClientSize.Width - vscroll.Width;
if (GetInheritedRtoL () == RightToLeft.Yes) {
document.OffsetX = vscroll.Width;
} else {
document.OffsetX = 0;
}
} else {
canvas_width = ClientSize.Width;
document.OffsetX = 0;
}
document.ViewPortWidth = canvas_width;
document.ViewPortHeight = canvas_height;
}
@@ -1917,39 +1891,16 @@ namespace System.Windows.Forms
if (canvas_height < 1 || canvas_width < 1)
return;
int hmod = vscroll.Visible ? vscroll.Width : 0;
int vmod = hscroll.Visible ? hscroll.Height : 0;
if (GetInheritedRtoL () == RightToLeft.Yes) {
hscroll.Bounds = new Rectangle (ClientRectangle.Left + hmod,
Math.Max(0, ClientRectangle.Height - hscroll.Height),
ClientSize.Width,
// We always move them, they just might not be displayed
hscroll.Bounds = new Rectangle (ClientRectangle.Left,
Math.Max (0, ClientRectangle.Height - hscroll.Height),
Math.Max (0, ClientSize.Width - (vscroll.Visible ? vscroll.Width : 0)),
hscroll.Height);
vscroll.Bounds = new Rectangle (ClientRectangle.Left,
ClientRectangle.Top,
vscroll.Width,
Math.Max(0, ClientSize.Height - (vmod)));
} else {
hscroll.Bounds = new Rectangle (ClientRectangle.Left,
Math.Max(0, ClientRectangle.Height - hscroll.Height),
Math.Max(0, ClientSize.Width - hmod),
hscroll.Height);
vscroll.Bounds = new Rectangle (
Math.Max(0, ClientRectangle.Right - vscroll.Width),
ClientRectangle.Top,
vscroll.Width,
Math.Max(0, ClientSize.Height - vmod));
}
}
internal RightToLeft GetInheritedRtoL ()
{
for (Control c = this; c != null; c = c.Parent)
if (c.RightToLeft != RightToLeft.Inherit)
return c.RightToLeft;
return RightToLeft.No;
vscroll.Bounds = new Rectangle (Math.Max (0, ClientRectangle.Right - vscroll.Width),
ClientRectangle.Top, vscroll.Width,
Math.Max (0, ClientSize.Height - (hscroll.Visible ? hscroll.Height : 0)));
}
private void TextBoxBase_SizeChanged (object sender, EventArgs e)
@@ -1958,12 +1909,6 @@ namespace System.Windows.Forms
CalculateDocument ();
}
private void TextBoxBase_RightToLeftChanged (object o, EventArgs e)
{
if (IsHandleCreated)
CalculateDocument ();
}
private void TextBoxBase_MouseWheel (object sender, MouseEventArgs e)
{
if (!vscroll.Enabled)
@@ -2081,12 +2026,7 @@ namespace System.Windows.Forms
switch (scrollbars) {
case RichTextBoxScrollBars.Both:
case RichTextBoxScrollBars.Vertical:
if (richtext) {
vscroll.Visible = vscroll.Enabled;
} else {
vscroll.Visible = true;
}
vscroll.Visible = vscroll.Enabled;
break;
case RichTextBoxScrollBars.ForcedBoth:
case RichTextBoxScrollBars.ForcedVertical:
@@ -2098,8 +2038,6 @@ namespace System.Windows.Forms
}
PositionControls ();
SizeControls (); //Update sizings now we've decided whats visible
}
private void document_WidthChanged (object sender, EventArgs e)
@@ -2134,11 +2072,7 @@ namespace System.Windows.Forms
document.CaretLostFocus ();
if (vscroll.Visible) {
if (GetInheritedRtoL () == RightToLeft.Yes) {
XplatUI.ScrollWindow (this.Handle, new Rectangle (vscroll.Width, 0, ClientSize.Width - vscroll.Width, ClientSize.Height), old_viewport_x - this.hscroll.Value, 0, false);
} else {
XplatUI.ScrollWindow (this.Handle, new Rectangle (0, 0, ClientSize.Width - vscroll.Width, ClientSize.Height), old_viewport_x - this.hscroll.Value, 0, false);
}
XplatUI.ScrollWindow(this.Handle, new Rectangle(0, 0, ClientSize.Width - vscroll.Width, ClientSize.Height), old_viewport_x - this.hscroll.Value, 0, false);
} else {
XplatUI.ScrollWindow(this.Handle, ClientRectangle, old_viewport_x - this.hscroll.Value, 0, false);
}
@@ -2235,20 +2169,22 @@ namespace System.Windows.Forms
private void TextBoxBase_FontOrColorChanged (object sender, EventArgs e)
{
Line line;
if (!richtext) {
Line line;
document.SuspendRecalc ();
// Font changes apply to the whole document
for (int i = 1; i <= document.Lines; i++) {
line = document.GetLine(i);
if (LineTag.FormatText(line, 1, line.text.Length, Font, ForeColor,
Color.Empty, FormatSpecified.Font | FormatSpecified.Color))
document.RecalculateDocument (CreateGraphicsInternal (), line.LineNo, line.LineNo, false);
document.SuspendRecalc ();
// Font changes apply to the whole document
for (int i = 1; i <= document.Lines; i++) {
line = document.GetLine(i);
if (LineTag.FormatText(line, 1, line.text.Length, Font, ForeColor,
Color.Empty, FormatSpecified.Font | FormatSpecified.Color))
document.RecalculateDocument (CreateGraphicsInternal (), line.LineNo, line.LineNo, false);
}
document.ResumeRecalc (false);
// Make sure the caret height is matching the new font height
document.AlignCaret();
}
document.ResumeRecalc (false);
// Make sure the caret height is matching the new font height
document.AlignCaret();
}
private void ScrollTimerTickHandler (object sender, EventArgs e)
@@ -223,8 +223,6 @@ namespace System.Windows.Forms {
internal int viewport_x;
internal int viewport_y; // The visible area of the document
internal int offset_x;
internal int offset_y;
internal int viewport_width;
internal int viewport_height;
@@ -287,9 +285,6 @@ namespace System.Windows.Forms {
viewport_x = 0;
viewport_y = 0;
offset_x = 0;
offset_y = 0;
crlf_size = 2;
// Default selection is empty
@@ -430,32 +425,6 @@ namespace System.Windows.Forms {
}
}
internal int OffsetX
{
get
{
return offset_x;
}
set
{
offset_x = value;
}
}
internal int OffsetY
{
get
{
return offset_y;
}
set
{
offset_y = value;
}
}
internal int ViewPortWidth {
get {
return viewport_width;
@@ -869,11 +838,7 @@ namespace System.Windows.Forms {
// Lineheight changed, invalidate the rest of the document
if ((line.Y - viewport_y) >=0 ) {
// We formatted something that's in view, only draw parts of the screen
owner.Invalidate(new Rectangle(
offset_x,
line.Y - viewport_y + offset_y,
viewport_width,
owner.Height - line.Y - viewport_y));
owner.Invalidate(new Rectangle(0, line.Y - viewport_y, viewport_width, owner.Height - line.Y - viewport_y));
} else {
// The tag was above the visible area, draw everything
owner.Invalidate();
@@ -881,29 +846,17 @@ namespace System.Windows.Forms {
} else {
switch(line.alignment) {
case HorizontalAlignment.Left: {
owner.Invalidate(new Rectangle(
line.X + ((int)line.widths[pos] - viewport_x - 1) + offset_x,
line.Y - viewport_y + offset_y,
viewport_width,
line.height + 1));
owner.Invalidate(new Rectangle(line.X + (int)line.widths[pos] - viewport_x - 1, line.Y - viewport_y, viewport_width, line.height + 1));
break;
}
case HorizontalAlignment.Center: {
owner.Invalidate(new Rectangle(
line.X + offset_x,
line.Y - viewport_y + offset_y,
viewport_width,
line.height + 1));
owner.Invalidate(new Rectangle(line.X, line.Y - viewport_y, viewport_width, line.height + 1));
break;
}
case HorizontalAlignment.Right: {
owner.Invalidate(new Rectangle(
line.X + offset_x,
line.Y - viewport_y + offset_y,
(int)line.widths[pos + 1] - viewport_x + line.X,
line.height + 1));
owner.Invalidate(new Rectangle(line.X, line.Y - viewport_y, (int)line.widths[pos + 1] - viewport_x + line.X, line.height + 1));
break;
}
}
@@ -941,19 +894,15 @@ namespace System.Windows.Forms {
// Lineheight changed, invalidate the rest of the document
if ((line.Y - viewport_y) >=0 ) {
// We formatted something that's in view, only draw parts of the screen
owner.Invalidate(new Rectangle(
offset_x,
line.Y - viewport_y + offset_y,
viewport_width,
owner.Height - line.Y - viewport_y));
owner.Invalidate(new Rectangle(0, line.Y - viewport_y, viewport_width, owner.Height - line.Y - viewport_y));
} else {
// The tag was above the visible area, draw everything
owner.Invalidate();
}
} else {
int x = 0 - viewport_x + offset_x;
int x = 0 - viewport_x;
int w = viewport_width;
int y = Math.Min (start_line_top - viewport_y, line.Y - viewport_y) + offset_y;
int y = Math.Min (start_line_top - viewport_y, line.Y - viewport_y);
int h = Math.Max (end_line_bottom - y, end_line.Y + end_line.height - y);
owner.Invalidate (new Rectangle (x, y, w, h));
@@ -1251,9 +1200,7 @@ namespace System.Windows.Forms {
if (owner.Focused) {
if (caret.height != caret.tag.Height)
XplatUI.CreateCaret (owner.Handle, caret_width, caret.height);
XplatUI.SetCaretPos(owner.Handle,
offset_x + (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x,
offset_y + caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
XplatUI.SetCaretPos(owner.Handle, (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x, caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
}
if (CaretMoved != null) CaretMoved(this, EventArgs.Empty);
@@ -1279,9 +1226,7 @@ namespace System.Windows.Forms {
if (owner.ShowSelection && (!selection_visible || owner.show_caret_w_selection)) {
XplatUI.CreateCaret (owner.Handle, caret_width, caret.height);
XplatUI.SetCaretPos(owner.Handle,
(int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x + offset_x,
offset_y + caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
XplatUI.SetCaretPos(owner.Handle, (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x, caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
}
if (CaretMoved != null) CaretMoved(this, EventArgs.Empty);
@@ -1290,9 +1235,7 @@ namespace System.Windows.Forms {
internal void CaretHasFocus() {
if ((caret.tag != null) && owner.IsHandleCreated) {
XplatUI.CreateCaret(owner.Handle, caret_width, caret.height);
XplatUI.SetCaretPos(owner.Handle,
offset_x + (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x,
offset_y + caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
XplatUI.SetCaretPos(owner.Handle, (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x, caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
DisplayCaret ();
}
@@ -1325,22 +1268,11 @@ namespace System.Windows.Forms {
MoveCaretToTextTag ();
}
// if the caret has had SelectionFont changed to a
// different height, we reflect changes unless the new
// font is larger than the line (line recalculations
// ignore empty tags) in which case we make it equal
// the line height and then when text is entered
if (caret.tag.Height > caret.tag.Line.Height) {
caret.height = caret.line.height;
} else {
caret.height = caret.tag.Height;
}
caret.height = caret.tag.Height;
if (owner.Focused) {
XplatUI.CreateCaret(owner.Handle, caret_width, caret.height);
XplatUI.SetCaretPos (owner.Handle,
offset_x + (int) caret.tag.Line.widths [caret.pos] + caret.line.X - viewport_x,
offset_y + caret.line.Y + viewport_y + caret_shift);
XplatUI.SetCaretPos(owner.Handle, (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x, caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
DisplayCaret ();
}
@@ -1362,9 +1294,7 @@ namespace System.Windows.Forms {
}
if (owner.Focused) {
XplatUI.SetCaretPos(owner.Handle,
offset_x + (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x,
offset_y + caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
XplatUI.SetCaretPos(owner.Handle, (int)caret.tag.Line.widths[caret.pos] + caret.line.X - viewport_x, caret.line.Y + caret.tag.Shift - viewport_y + caret_shift);
DisplayCaret ();
}
@@ -1565,7 +1495,7 @@ namespace System.Windows.Forms {
case CaretDirection.PgUp: {
if (caret.line.line_no == 1 && owner.richtext) {
if (viewport_y == 0 && owner.richtext) {
owner.vscroll.Value = 0;
Line line = GetLine (1);
PositionCaret (line, 0);
@@ -1584,10 +1514,10 @@ namespace System.Windows.Forms {
case CaretDirection.PgDn: {
if (caret.line.line_no == lines && owner.richtext) {
if (viewport_y + viewport_height >= document_y && owner.richtext) {
owner.vscroll.Value = owner.vscroll.Maximum - viewport_height + 1;
Line line = GetLine (lines);
PositionCaret (line, line.TextLengthWithoutEnding());
PositionCaret (line, line.Text.Length);
}
int y_offset = caret.line.Y - viewport_y;
@@ -1695,11 +1625,11 @@ namespace System.Windows.Forms {
// First, figure out from what line to what line we need to draw
if (multiline) {
start = GetLineByPixel(clip.Top + viewport_y - offset_y, false).line_no;
end = GetLineByPixel(clip.Bottom + viewport_y - offset_y, false).line_no;
start = GetLineByPixel(clip.Top + viewport_y, false).line_no;
end = GetLineByPixel(clip.Bottom + viewport_y, false).line_no;
} else {
start = GetLineByPixel(clip.Left + viewport_x - offset_x, false).line_no;
end = GetLineByPixel(clip.Right + viewport_x - offset_x, false).line_no;
start = GetLineByPixel(clip.Left + viewport_x, false).line_no;
end = GetLineByPixel(clip.Right + viewport_x, false).line_no;
}
// remove links in the list (used for mouse down events) that are within the clip area.
@@ -1714,7 +1644,7 @@ namespace System.Windows.Forms {
/// Make sure that we aren't drawing one more line then we need to
line = GetLine (end - 1);
if (line != null && clip.Bottom == offset_y + line.Y + line.height - viewport_y)
if (line != null && clip.Bottom == line.Y + line.height - viewport_y)
end--;
line_no = start;
@@ -1730,9 +1660,9 @@ namespace System.Windows.Forms {
// Non multiline selection can be handled outside of the loop
if (!multiline && selection_visible && owner.ShowSelection) {
g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (ThemeEngine.Current.ColorHighlight),
offset_x + selection_start.line.widths [selection_start.pos] +
selection_start.line.widths [selection_start.pos] +
selection_start.line.X - viewport_x,
offset_y + selection_start.line.Y,
selection_start.line.Y,
(selection_end.line.X + selection_end.line.widths [selection_end.pos]) -
(selection_start.line.X + selection_start.line.widths [selection_start.pos]),
selection_start.line.height);
@@ -1740,7 +1670,7 @@ namespace System.Windows.Forms {
while (line_no <= end) {
line = GetLine (line_no);
float line_y = line.Y - viewport_y + offset_y;
float line_y = line.Y - viewport_y;
tag = line.tags;
if (!calc_pass) {
@@ -1776,7 +1706,7 @@ namespace System.Windows.Forms {
} else if (multiline) {
// lets draw some selection baby!! (non multiline selection is drawn outside the loop)
g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (ThemeEngine.Current.ColorHighlight),
offset_x + line.widths [line_selection_start - 1] + line.X - viewport_x,
line.widths [line_selection_start - 1] + line.X - viewport_x,
line_y, line.widths [line_selection_end - 1] - line.widths [line_selection_start - 1],
line.height);
}
@@ -1791,15 +1721,13 @@ namespace System.Windows.Forms {
continue;
}
if (((tag.X + tag.Width) < (clip.Left - viewport_x - offset_x)) &&
(tag.X > (clip.Right - viewport_x - offset_x))) {
if (((tag.X + tag.Width) < (clip.Left - viewport_x)) && (tag.X > (clip.Right - viewport_x))) {
tag = tag.Next;
continue;
}
if (tag.BackColor != Color.Empty) {
g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (tag.BackColor),
offset_x + tag.X + line.X - viewport_x,
g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (tag.BackColor), tag.X + line.X - viewport_x,
line_y + tag.Shift, tag.Width, line.height);
}
@@ -1834,7 +1762,7 @@ namespace System.Windows.Forms {
Rectangle text_size;
tag.Draw (g, current_color,
offset_x + line.X - viewport_x,
line.X - viewport_x,
line_y + tag.Shift,
old_tag_pos - 1, Math.Min (tag.Start + tag.Length, tag_pos) - 1,
text.ToString (), out text_size, tag.IsLink);
@@ -2027,7 +1955,7 @@ namespace System.Windows.Forms {
// Inserts a character at the current caret position
internal void InsertCharAtCaret (char ch, bool move_caret)
{
caret.line.InsertString (caret.pos, ch.ToString(), caret.tag);
caret.line.InsertString (caret.pos, ch.ToString ());
undo.RecordTyping (caret.line, caret.pos, ch);
@@ -2690,9 +2618,9 @@ namespace System.Windows.Forms {
#endif
owner.Invalidate(new Rectangle (
offset_x + (int)l1.widths[p1] + l1.X - viewport_x,
offset_y + l1.Y - viewport_y,
endpoint - (int) l1.widths [p1] + 1,
(int)l1.widths[p1] + l1.X - viewport_x,
l1.Y - viewport_y,
endpoint - (int)l1.widths[p1] + 1,
l1.height));
return;
}
@@ -2704,11 +2632,7 @@ namespace System.Windows.Forms {
// Three invalidates:
// First line from start
owner.Invalidate(new Rectangle(
offset_x + (int)l1.widths[p1] + l1.X - viewport_x,
offset_y + l1.Y - viewport_y,
viewport_width,
l1.height));
owner.Invalidate(new Rectangle((int)l1.widths[p1] + l1.X - viewport_x, l1.Y - viewport_y, viewport_width, l1.height));
// lines inbetween
@@ -2716,11 +2640,7 @@ namespace System.Windows.Forms {
int y;
y = GetLine(l1.line_no + 1).Y;
owner.Invalidate(new Rectangle(
offset_x,
offset_y + y - viewport_y,
viewport_width,
l2.Y - y));
owner.Invalidate(new Rectangle(0, y - viewport_y, viewport_width, l2.Y - y));
#if Debug
Console.WriteLine("Invaliding from {0}:{1} to {2}:{3} Middle => x={4}, y={5}, {6}x{7}", l1.line_no, p1, l2.line_no, p2, 0, y - viewport_y, viewport_width, l2.Y - y);
@@ -2729,14 +2649,10 @@ namespace System.Windows.Forms {
// Last line to end
owner.Invalidate(new Rectangle(
offset_x + (int)l2.widths[0] + l2.X - viewport_x,
offset_y + l2.Y - viewport_y,
(int)l2.widths[p2] + 1,
l2.height));
owner.Invalidate(new Rectangle((int)l2.widths[0] + l2.X - viewport_x, l2.Y - viewport_y, (int)l2.widths[p2] + 1, l2.height));
#if Debug
Console.WriteLine("Invaliding from {0}:{1} to {2}:{3} End => x={4}, y={5}, {6}x{7}", l1.line_no, p1, l2.line_no, p2, (int)l2.widths[0] + l2.X - viewport_x, l2.Y - viewport_y, (int)l2.widths[p2] + 1, l2.height);
#endif
}
@@ -3468,9 +3384,6 @@ namespace System.Windows.Forms {
{
Line line;
x -= offset_x;
y -= offset_y;
line = GetLineByPixel (multiline ? y : x, false);
LineTag tag = line.GetTag (x);
@@ -4137,13 +4050,16 @@ namespace System.Windows.Forms {
redo_actions.Clear();
}
internal bool Undo ()
internal void Undo ()
{
Action action;
bool user_action_finished = false;
if (undo_actions.Count == 0)
return false;
return;
// Nuke the redo queue
redo_actions.Clear ();
locked = true;
do {
@@ -4195,17 +4111,18 @@ namespace System.Windows.Forms {
} while (!user_action_finished && undo_actions.Count > 0);
locked = false;
return true;
}
internal bool Redo ()
internal void Redo ()
{
Action action;
bool user_action_finished = false;
if (redo_actions.Count == 0)
return false;
return;
// You can't undo anything after redoing
undo_actions.Clear ();
locked = true;
do {
@@ -4213,7 +4130,6 @@ namespace System.Windows.Forms {
int start_index;
action = (Action) redo_actions.Pop ();
undo_actions.Push (action);
switch (action.type) {
@@ -4267,8 +4183,6 @@ namespace System.Windows.Forms {
} while (!user_action_finished && redo_actions.Count > 0);
locked = false;
return true;
}
#endregion // Internal Methods
@@ -4279,9 +4193,6 @@ namespace System.Windows.Forms {
if (locked)
return;
// Nuke the redo queue
redo_actions.Clear ();
Action ua = new Action ();
ua.type = ActionType.UserActionBegin;
ua.data = name;
@@ -4306,9 +4217,6 @@ namespace System.Windows.Forms {
if (locked)
return;
// Nuke the redo queue
redo_actions.Clear ();
Action a = new Action ();
// We cant simply store the string, because then formatting would be lost
@@ -4325,9 +4233,6 @@ namespace System.Windows.Forms {
if (locked || str.Length == 0)
return;
// Nuke the redo queue
redo_actions.Clear ();
Action a = new Action ();
a.type = ActionType.InsertString;
@@ -4343,9 +4248,6 @@ namespace System.Windows.Forms {
if (locked)
return;
// Nuke the redo queue
redo_actions.Clear ();
Action a = null;
if (undo_actions.Count > 0)
@@ -50,6 +50,11 @@ namespace System.Windows.Forms
#endif
class TextRenderer
{
[ThreadStatic]
private static Bitmap static_bitmap;
[ThreadStatic]
private static Graphics static_graphics;
private TextRenderer ()
{
}
@@ -98,7 +103,7 @@ namespace System.Windows.Forms
public static Size MeasureText (string text, Font font)
{
return MeasureTextInternal (Hwnd.GraphicsContext, text, font, Size.Empty, TextFormatFlags.Default, false);
return MeasureTextInternal (StaticGraphics, text, font, Size.Empty, TextFormatFlags.Default, false);
}
public static Size MeasureText (IDeviceContext dc, string text, Font font)
@@ -108,7 +113,7 @@ namespace System.Windows.Forms
public static Size MeasureText (string text, Font font, Size proposedSize)
{
return MeasureTextInternal (Hwnd.GraphicsContext, text, font, proposedSize, TextFormatFlags.Default, false);
return MeasureTextInternal (StaticGraphics, text, font, proposedSize, TextFormatFlags.Default, false);
}
public static Size MeasureText (IDeviceContext dc, string text, Font font, Size proposedSize)
@@ -118,7 +123,7 @@ namespace System.Windows.Forms
public static Size MeasureText (string text, Font font, Size proposedSize, TextFormatFlags flags)
{
return MeasureTextInternal (Hwnd.GraphicsContext, text, font, proposedSize, flags, false);
return MeasureTextInternal (StaticGraphics, text, font, proposedSize, flags, false);
}
public static Size MeasureText (IDeviceContext dc, string text, Font font, Size proposedSize, TextFormatFlags flags)
@@ -285,9 +290,9 @@ namespace System.Windows.Forms
Size retval;
if (dc is Graphics)
retval = (dc as Graphics).MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
retval = (dc as Graphics).MeasureString (text, font, Int32.MaxValue, sf).ToSize ();
else
retval = TextRenderer.MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
retval = TextRenderer.MeasureString (text, font, Int32.MaxValue, sf).ToSize ();
if (retval.Width > 0 && (flags & TextFormatFlags.NoPadding) == 0)
retval.Width += 9;
@@ -334,7 +339,7 @@ namespace System.Windows.Forms
internal static Size MeasureTextInternal (string text, Font font, bool useMeasureString)
{
return MeasureTextInternal (Hwnd.GraphicsContext, text, font, Size.Empty, TextFormatFlags.Default, useMeasureString);
return MeasureTextInternal (StaticGraphics, text, font, Size.Empty, TextFormatFlags.Default, useMeasureString);
}
#if NET_2_0
@@ -351,7 +356,7 @@ namespace System.Windows.Forms
internal static Size MeasureTextInternal (string text, Font font, Size proposedSize, bool useMeasureString)
{
return MeasureTextInternal (Hwnd.GraphicsContext, text, font, proposedSize, TextFormatFlags.Default, useMeasureString);
return MeasureTextInternal (StaticGraphics, text, font, proposedSize, TextFormatFlags.Default, useMeasureString);
}
internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, Size proposedSize, bool useMeasureString)
@@ -362,54 +367,72 @@ namespace System.Windows.Forms
#endif
internal static Size MeasureTextInternal (string text, Font font, Size proposedSize, TextFormatFlags flags, bool useMeasureString)
{
return MeasureTextInternal (Hwnd.GraphicsContext, text, font, proposedSize, flags, useMeasureString);
return MeasureTextInternal (StaticGraphics, text, font, proposedSize, flags, useMeasureString);
}
#endregion
#region Thread-Safe Static Graphics Methods
internal static SizeF MeasureString (string text, Font font)
{
return Hwnd.GraphicsContext.MeasureString (text, font);
return StaticGraphics.MeasureString (text, font);
}
internal static SizeF MeasureString (string text, Font font, int width)
{
return Hwnd.GraphicsContext.MeasureString (text, font, width);
return StaticGraphics.MeasureString (text, font, width);
}
internal static SizeF MeasureString (string text, Font font, SizeF layoutArea)
{
return Hwnd.GraphicsContext.MeasureString (text, font, layoutArea);
return StaticGraphics.MeasureString (text, font, layoutArea);
}
internal static SizeF MeasureString (string text, Font font, int width, StringFormat format)
{
return Hwnd.GraphicsContext.MeasureString (text, font, width, format);
return StaticGraphics.MeasureString (text, font, width, format);
}
internal static SizeF MeasureString (string text, Font font, PointF origin, StringFormat stringFormat)
{
return Hwnd.GraphicsContext.MeasureString (text, font, origin, stringFormat);
return StaticGraphics.MeasureString (text, font, origin, stringFormat);
}
internal static SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat)
{
return Hwnd.GraphicsContext.MeasureString (text, font, layoutArea, stringFormat);
return StaticGraphics.MeasureString (text, font, layoutArea, stringFormat);
}
internal static SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat, out int charactersFitted, out int linesFilled)
{
return Hwnd.GraphicsContext.MeasureString (text, font, layoutArea, stringFormat, out charactersFitted, out linesFilled);
return StaticGraphics.MeasureString (text, font, layoutArea, stringFormat, out charactersFitted, out linesFilled);
}
internal static Region[] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat)
{
return Hwnd.GraphicsContext.MeasureCharacterRanges (text, font, layoutRect, stringFormat);
return StaticGraphics.MeasureCharacterRanges (text, font, layoutRect, stringFormat);
}
internal static SizeF GetDpi ()
{
return new SizeF (Hwnd.GraphicsContext.DpiX, Hwnd.GraphicsContext.DpiY);
return new SizeF (StaticGraphics.DpiX, StaticGraphics.DpiY);
}
internal static Bitmap StaticBitmap {
get {
if (static_bitmap == null)
static_bitmap = new Bitmap (1, 1, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
return static_bitmap;
}
}
internal static Graphics StaticGraphics {
get {
if (static_graphics == null)
static_graphics = Graphics.FromImage (StaticBitmap);
return static_graphics;
}
}
#endregion
@@ -960,13 +960,7 @@ namespace System.Windows.Forms
content_rect.Width -= check_size;
content_rect.Offset (check_size, 0);
Size proposed = Size.Empty;
// Force wrapping if we aren't AutoSize and our text is too long
if (!button.AutoSize)
proposed.Width = button.Width - glyphArea.Width - 2;
Size text_size = TextRenderer.MeasureTextInternal (text, button.Font, proposed, button.TextFormatFlags, button.UseCompatibleTextRendering);
Size text_size = TextRenderer.MeasureTextInternal (text, button.Font, Size.Empty, button.TextFormatFlags, button.UseCompatibleTextRendering);
Size image_size = image == null ? Size.Empty : image.Size;
textRectangle = Rectangle.Empty;
@@ -3334,19 +3328,12 @@ namespace System.Windows.Forms
}
}
Brush border_brush;
if (mc.owner == null)
border_brush = GetControlBackBrush (mc.BackColor);
else
border_brush = SystemBrushes.ControlDarkDark;
// finally paint the borders of the calendars as required
for (int i = 0; i <= mc.CalendarDimensions.Width; i++) {
if (i == 0 && clip_rectangle.X == client_rectangle.X) {
dc.FillRectangle (border_brush, client_rectangle.X, client_rectangle.Y, 1, client_rectangle.Height);
dc.FillRectangle (GetControlBackBrush (mc.BackColor), client_rectangle.X, client_rectangle.Y, 1, client_rectangle.Height);
} else if (i == mc.CalendarDimensions.Width && clip_rectangle.Right == client_rectangle.Right) {
dc.FillRectangle (border_brush, client_rectangle.Right - 1, client_rectangle.Y, 1, client_rectangle.Height);
dc.FillRectangle (GetControlBackBrush (mc.BackColor), client_rectangle.Right-1, client_rectangle.Y, 1, client_rectangle.Height);
} else {
Rectangle rect = new Rectangle (
client_rectangle.X + (month_size.Width*i) + (calendar_spacing.Width * (i-1)) + 1,
@@ -3354,15 +3341,15 @@ namespace System.Windows.Forms
calendar_spacing.Width,
client_rectangle.Height);
if (i < mc.CalendarDimensions.Width && i > 0 && clip_rectangle.IntersectsWith (rect)) {
dc.FillRectangle (border_brush, rect);
dc.FillRectangle (GetControlBackBrush (mc.BackColor), rect);
}
}
}
for (int i = 0; i <= mc.CalendarDimensions.Height; i++) {
if (i == 0 && clip_rectangle.Y == client_rectangle.Y) {
dc.FillRectangle (border_brush, client_rectangle.X, client_rectangle.Y, client_rectangle.Width, 1);
dc.FillRectangle (GetControlBackBrush (mc.BackColor), client_rectangle.X, client_rectangle.Y, client_rectangle.Width, 1);
} else if (i == mc.CalendarDimensions.Height && clip_rectangle.Bottom == client_rectangle.Bottom) {
dc.FillRectangle (border_brush, client_rectangle.X, client_rectangle.Bottom - 1, client_rectangle.Width, 1);
dc.FillRectangle (GetControlBackBrush (mc.BackColor), client_rectangle.X, client_rectangle.Bottom-1, client_rectangle.Width, 1);
} else {
Rectangle rect = new Rectangle (
client_rectangle.X,
@@ -3370,7 +3357,7 @@ namespace System.Windows.Forms
client_rectangle.Width,
calendar_spacing.Height);
if (i < mc.CalendarDimensions.Height && i > 0 && clip_rectangle.IntersectsWith (rect)) {
dc.FillRectangle (border_brush, rect);
dc.FillRectangle (GetControlBackBrush (mc.BackColor), rect);
}
}
}
@@ -3671,40 +3658,39 @@ namespace System.Windows.Forms
}
const int inflate = -1;
if (date == mc.SelectionStart.Date && date == mc.SelectionEnd.Date) {
if (date == mc.SelectionStart && date == mc.SelectionEnd) {
// see if the date is in the start of selection
date_color = mc.BackColor;
// draw the left hand of the back ground
Rectangle selection_rect = Rectangle.Inflate (rectangle, inflate, inflate);
dc.FillPie (ResPool.GetSolidBrush (mc.TitleBackColor), selection_rect, 0, 360);
} else if (date == mc.SelectionStart.Date) {
} else if (date == mc.SelectionStart) {
// see if the date is in the start of selection
date_color = mc.BackColor;
// draw the left hand of the back ground
Rectangle selection_rect = Rectangle.Inflate (rectangle, inflate, inflate);
dc.FillPie (ResPool.GetSolidBrush (mc.TitleBackColor), selection_rect, 90, 180);
// fill the other side as a straight rect
if (date < mc.SelectionEnd.Date)
if (date < mc.SelectionEnd)
{
// use rectangle instead of rectangle to go all the way to edge of rect
selection_rect.X = (int) Math.Floor((double)(rectangle.X + rectangle.Width / 2));
selection_rect.Width = Math.Max(rectangle.Right - selection_rect.X, 0);
dc.FillRectangle (ResPool.GetSolidBrush (mc.TitleBackColor), selection_rect);
}
} else if (date == mc.SelectionEnd.Date) {
} else if (date == mc.SelectionEnd) {
// see if it is the end of selection
date_color = mc.BackColor;
// draw the left hand of the back ground
Rectangle selection_rect = Rectangle.Inflate (rectangle, inflate, inflate);
dc.FillPie (ResPool.GetSolidBrush (mc.TitleBackColor), selection_rect, 270, 180);
// fill the other side as a straight rect
if (date > mc.SelectionStart.Date) {
if (date > mc.SelectionStart) {
selection_rect.X = rectangle.X;
selection_rect.Width = rectangle.Width - (rectangle.Width / 2);
dc.FillRectangle (ResPool.GetSolidBrush (mc.TitleBackColor), selection_rect);
}
} else if (date > mc.SelectionStart.Date && date < mc.SelectionEnd.Date) {
} else if (date > mc.SelectionStart && date < mc.SelectionEnd) {
// now see if it's in the middle
date_color = mc.BackColor;
// draw the left hand of the back ground
@@ -943,7 +943,7 @@ namespace System.Windows.Forms
protected override void OnMouseUp (MouseEventArgs mea)
{
// If we're currently over an item (set in MouseMove)
if (mouse_currently_over != null && !(mouse_currently_over is ToolStripControlHost) && mouse_currently_over.Enabled) {
if (mouse_currently_over != null && !(mouse_currently_over is ToolStripControlHost)) {
// Fire our ItemClicked event
OnItemClicked (new ToolStripItemClickedEventArgs (mouse_currently_over));
@@ -48,9 +48,6 @@ namespace System.Windows.Forms
#region Public Constructors
public ToolStripContainer () : base ()
{
SetStyle (ControlStyles.SupportsTransparentBackColor, true);
SetStyle (ControlStyles.ResizeRedraw, true);
content_panel = new ToolStripContentPanel ();
content_panel.Dock = DockStyle.Fill;
this.Controls.Add (content_panel);
@@ -1065,8 +1065,6 @@ namespace System.Windows.Forms {
internal Image StateImage {
get {
if (TreeView != null) {
if (TreeView.StateImageList == null)
return null;
if (state_image_index >= 0)
return TreeView.StateImageList.Images[state_image_index];
if (state_image_key != string.Empty)
@@ -827,7 +827,7 @@ namespace System.Windows.Forms {
return new TreeViewHitTestInfo (n, TreeViewHitTestLocations.Label);
else if (IsPlusMinusArea (n, x))
return new TreeViewHitTestInfo (n, TreeViewHitTestLocations.PlusMinus);
else if ((checkboxes || n.StateImage != null) && IsCheckboxArea (n, x))
else if (checkboxes && IsCheckboxArea (n, x))
return new TreeViewHitTestInfo (n, TreeViewHitTestLocations.StateImage);
else if (x > n.Bounds.Right)
return new TreeViewHitTestInfo (n, TreeViewHitTestLocations.RightOfLabel);
@@ -1176,10 +1176,6 @@ namespace System.Windows.Forms {
#endregion // Protected Instance Methods
#region Internal & Private Methods and Properties
internal override bool ScaleChildrenInternal {
get { return false; }
}
internal IntPtr CreateNodeHandle ()
{
return (IntPtr) handle_count++;
@@ -1286,11 +1282,6 @@ namespace System.Windows.Forms {
l -= ImageList.ImageSize.Width + 3;
if (checkboxes)
l -= 19;
#if NET_2_0
// StateImage is basically a custom checkbox
else if (node.StateImage != null)
l -= 19;
#endif
return (x > l && x < l + 8);
}
@@ -2493,4 +2484,3 @@ namespace System.Windows.Forms {
}
}
@@ -207,31 +207,18 @@ namespace System.Windows.Forms {
{
Size retsize = Size.Empty;
// Add up the requested sizes for Docked controls
foreach (Control child in Controls) {
if (!child.is_visible)
continue;
if (child.Dock == DockStyle.Left || child.Dock == DockStyle.Right)
retsize.Width += child.PreferredSize.Width;
else if (child.Dock == DockStyle.Top || child.Dock == DockStyle.Bottom)
retsize.Height += child.PreferredSize.Height;
}
// See if any non-Docked control is positioned lower or more right than our size
foreach (Control child in Controls) {
if (!child.is_visible)
continue;
if (child.Dock == DockStyle.Fill) {
if (child.Bounds.Right > retsize.Width)
retsize.Width = child.Bounds.Right;
} else if (child.Dock != DockStyle.Top && child.Dock != DockStyle.Bottom && (child.Anchor & AnchorStyles.Right) == 0 && (child.Bounds.Right + child.Margin.Right) > retsize.Width)
retsize.Width = child.Bounds.Right + child.Margin.Right;
if (child.Dock != DockStyle.None)
continue;
// If its anchored to the bottom or right, that doesn't really count
if ((child.Anchor & AnchorStyles.Bottom) == AnchorStyles.Bottom || (child.Anchor & AnchorStyles.Right) == AnchorStyles.Right)
continue;
retsize.Width = Math.Max (retsize.Width, child.Bounds.Right + child.Margin.Right);
retsize.Height = Math.Max (retsize.Height, child.Bounds.Bottom + child.Margin.Bottom);
if (child.Dock == DockStyle.Fill) {
if (child.Bounds.Bottom > retsize.Height)
retsize.Height = child.Bounds.Bottom;
} else if (child.Dock != DockStyle.Left && child.Dock != DockStyle.Right && (child.Anchor & AnchorStyles.Bottom) == 0 && (child.Bounds.Bottom + child.Margin.Bottom) > retsize.Height)
retsize.Height = child.Bounds.Bottom + child.Margin.Bottom;
}
return retsize;
@@ -267,7 +267,9 @@ namespace System.Windows.Forms
public override void Refresh ()
{
Refresh (WebBrowserRefreshOption.IfExpired);
documentReady = false;
document = null;
WebHost.Navigation.Reload (Mono.WebBrowser.ReloadOption.Full);
}
public void Refresh (WebBrowserRefreshOption opt)
@@ -307,7 +307,7 @@ namespace System.Windows.Forms
state = State.Loaded;
webHost.MouseClick += new Mono.WebBrowser.DOM.NodeEventHandler (OnWebHostMouseClick);
webHost.MouseClick += new EventHandler (OnWebHostMouseClick);
webHost.Focus += new EventHandler (OnWebHostFocus);
webHost.CreateNewWindow += new Mono.WebBrowser.CreateNewWindowEventHandler (OnWebHostCreateNewWindow);
webHost.Alert += new Mono.WebBrowser.AlertEventHandler (OnWebHostAlert);
@@ -51,7 +51,6 @@ namespace System.Windows.Forms {
private int lcid;
private bool num_state, cap_state;
private bool initialized;
private bool menu_state = false;
private int NumLockMask;
private int AltGrMask;
@@ -206,17 +205,9 @@ namespace System.Windows.Forms {
if (msg.message >= Msg.WM_KEYFIRST && msg.message <= Msg.WM_KEYLAST)
res = true;
if (msg.message == Msg.WM_SYSKEYUP && msg.wParam == (IntPtr) 0x12 && menu_state) {
msg.message = Msg.WM_KEYUP;
menu_state = false;
}
if (msg.message != Msg.WM_KEYDOWN && msg.message != Msg.WM_SYSKEYDOWN)
return res;
if ((key_state_table [(int) VirtualKeys.VK_MENU] & 0x80) != 0 && msg.wParam != (IntPtr) 0x12)
menu_state = true;
EnsureLayoutInitialized ();
string buffer;
@@ -721,7 +721,7 @@ namespace System.Windows.Forms {
if (client) {
hwnd.AddInvalidArea(x, y, width, height);
if (!hwnd.expose_pending && hwnd.visible) {
if (!hwnd.expose_pending) {
MSG msg = new MSG ();
msg.message = Msg.WM_PAINT;
msg.hwnd = hwnd.Handle;
@@ -730,7 +730,7 @@ namespace System.Windows.Forms {
}
} else {
hwnd.AddNcInvalidArea (x, y, width, height);
if (!hwnd.nc_expose_pending && hwnd.visible) {
if (!hwnd.nc_expose_pending) {
MSG msg = new MSG ();
Region rgn = new Region (hwnd.Invalid);
IntPtr hrgn = rgn.GetHrgn (null); // Graphics object isn't needed
@@ -740,7 +740,6 @@ namespace System.Windows.Forms {
msg.hwnd = hwnd.Handle;
MessageQueue.Enqueue (msg);
hwnd.nc_expose_pending = true;
}
}
}
@@ -1223,10 +1222,8 @@ namespace System.Windows.Forms {
CFRelease (hwnd.client_window);
*/
if (WindowMapping [hwnd.Handle] != null) {
if (WindowMapping [hwnd.Handle] != null)
DisposeWindow ((IntPtr)(WindowMapping [hwnd.Handle]));
WindowMapping.Remove (hwnd.Handle);
}
}
internal override IntPtr DispatchMessage(ref MSG msg) {
@@ -440,8 +440,7 @@ namespace System.Windows.Forms {
DefaultColormap = XDefaultColormap(DisplayHandle, ScreenNo);
// Create the foster parent
// it is important that border_width is kept in synch with the other XCreateWindow calls
FosterParent=XCreateSimpleWindow(DisplayHandle, RootWindow, 0, 0, 1, 1, 0, UIntPtr.Zero, UIntPtr.Zero);
FosterParent=XCreateSimpleWindow(DisplayHandle, RootWindow, 0, 0, 1, 1, 4, UIntPtr.Zero, UIntPtr.Zero);
if (FosterParent==IntPtr.Zero) {
Console.WriteLine("XplatUIX11 Constructor failed to create FosterParent");
}
@@ -3,7 +3,6 @@ System.Windows.Forms/ApplicationTest.cs
System.Windows.Forms/AutoCompleteStringCollectionTest.cs
System.Windows.Forms/ApplicationContextTest.cs
System.Windows.Forms/BindingTest.cs
System.Windows.Forms/BindingsCollectionTest.cs
System.Windows.Forms/BindingContextTest.cs
System.Windows.Forms/BindingManagerBaseTest.cs
System.Windows.Forms/BindingMemberInfoTest.cs
@@ -121,7 +120,6 @@ System.Windows.Forms/RichTextBoxTest.cs
System.Windows.Forms/SaveFileDialogTest.cs
System.Windows.Forms/ScrollableControlTest.cs
System.Windows.Forms/ScrollBarTest.cs
System.Windows.Forms/SelectionRangeTest.cs
System.Windows.Forms/SendKeysTest.cs
System.Windows.Forms/SplitterTest.cs
System.Windows.Forms/SplitContainerTests.cs
@@ -68,32 +68,5 @@ namespace MonoTests.System.Windows.Forms.DataBinding
Assert.AreEqual (bm2.Bindings[0], binding, "3");
}
#if NET_2_0
[Test]
public void IsBindingSuspendedTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
MockItem item = new MockItem ("A", 0);
MockItem [] items = new MockItem [] { item };
BindingManagerBase manager = c.BindingContext [item];
BindingManagerBase manager2 = c.BindingContext [items];
Assert.IsFalse (manager.IsBindingSuspended, "#A1");
Assert.IsFalse (manager2.IsBindingSuspended, "#A2");
manager.SuspendBinding ();
manager2.SuspendBinding ();
Assert.IsFalse (manager.IsBindingSuspended, "#B1");
Assert.IsTrue (manager2.IsBindingSuspended, "#B2");
manager.ResumeBinding ();
manager2.ResumeBinding ();
Assert.IsFalse (manager.IsBindingSuspended, "#C1");
Assert.IsFalse (manager2.IsBindingSuspended, "#C2");
}
#endif
}
}
@@ -61,13 +61,6 @@ namespace MonoTests.System.Windows.Forms.DataBinding {
Assert.AreSame (b.PropertyName, prop, "ctor5");
Assert.AreSame (b.DataSource, data_source, "ctor6");
#if NET_2_0
Assert.AreEqual (false, b.FormattingEnabled, "ctor7");
Assert.AreEqual (String.Empty, b.FormatString, "ctor8");
Assert.IsNull (b.FormatInfo, "ctor9");
Assert.IsNull (b.NullValue, "ctor10");
#endif
}
[Test]
@@ -242,292 +235,6 @@ namespace MonoTests.System.Windows.Forms.DataBinding {
Assert.AreEqual (DBNull.Value, c.Tag, "1");
}
// For this case to work, the data source property needs
// to have an associated 'PropertyChanged' event.
[Test]
public void DataSourcePropertyChanged ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
MockItem item = new MockItem ("A", 0);
Binding binding = new Binding ("Text", item, "Text");
c.DataBindings.Add (binding);
Assert.AreEqual ("A", c.Text, "#A1");
item.Text = "B";
Assert.AreEqual ("B", c.Text, "#B1");
}
[Test]
[Category ("NotWorking")]
public void IsBindingTest ()
{
MockItem [] items = new MockItem [] { new MockItem ("A", 0) };
Binding binding = new Binding ("Text", items, "Text");
Binding binding2 = new Binding ("Text", items [0], "Text");
Assert.IsFalse (binding.IsBinding, "#A1");
Assert.IsFalse (binding2.IsBinding, "#A2");
Control c = new Control ();
Control c2 = new Control ();
c.DataBindings.Add (binding);
c2.DataBindings.Add (binding2);
Assert.IsFalse (binding.IsBinding, "#B1");
Assert.IsFalse (binding2.IsBinding, "#B2");
c.CreateControl ();
c2.CreateControl ();
Assert.IsFalse (binding.IsBinding, "#C1");
Assert.IsFalse (binding2.IsBinding, "#C2");
Form form = new Form ();
form.ShowInTaskbar = false;
form.Controls.Add (c);
form.Controls.Add (c2);
Assert.IsTrue (binding.IsBinding, "#D1");
Assert.IsTrue (binding2.IsBinding, "#D2");
form.Show ();
// Important part -
// IsBinding is true ALWAYS with PropertyManager, even when
// ResumeBinding has been called
//
CurrencyManager curr_manager = (CurrencyManager)form.BindingContext [items];
PropertyManager prop_manager = (PropertyManager)form.BindingContext [items [0]];
curr_manager.SuspendBinding ();
prop_manager.SuspendBinding ();
//Assert.IsFalse (binding.IsBinding, "#E1"); // Comment by now
Assert.IsTrue (binding2.IsBinding, "#E2");
curr_manager.ResumeBinding ();
prop_manager.ResumeBinding ();
Assert.IsTrue (binding.IsBinding, "#F1");
Assert.IsTrue (binding2.IsBinding, "#F2");
form.Dispose ();
}
#if NET_2_0
[Test]
public void ReadValueTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
ChildMockItem item = new ChildMockItem ();
item.ObjectValue = "A";
Binding binding = new Binding ("Tag", item, "ObjectValue");
binding.ControlUpdateMode = ControlUpdateMode.Never;
c.DataBindings.Add (binding);
Assert.AreEqual (null, c.Tag, "#A1");
item.ObjectValue = "B";
Assert.AreEqual (null, c.Tag, "#B1");
binding.ReadValue ();
Assert.AreEqual ("B", c.Tag, "#C1");
item.ObjectValue = "C";
binding.ReadValue ();
Assert.AreEqual ("C", c.Tag, "#D1");
}
[Test]
[Category ("NotWorking")]
public void WriteValueTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
MockItem item = new MockItem ();
item.Text = "A";
Binding binding = new Binding ("Text", item, "Text");
binding.DataSourceUpdateMode = DataSourceUpdateMode.Never;
c.DataBindings.Add (binding);
Assert.AreEqual ("A", c.Text, "#A1");
c.Text = "B";
Assert.AreEqual ("A", item.Text, "#B1");
binding.WriteValue ();
Assert.AreEqual ("B", item.Text, "#C1");
}
[Test]
[Category ("NotWorking")]
public void BindableComponentTest ()
{
Control c = new Control ();
MockItem item = new MockItem (String.Empty, 0);
Binding binding = new Binding ("Text", item, "Text");
c.DataBindings.Add (binding);
Assert.AreEqual (c, binding.Control, "#A1");
Assert.AreEqual (c, binding.BindableComponent, "#A2");
//
// Now use IBindableComponent - update binding when property changes
// since ToolStripItem doesn't have validation at all
//
BindableToolStripItem toolstrip_item = new BindableToolStripItem ();
toolstrip_item.BindingContext = new BindingContext ();
Binding binding2 = new Binding ("Text", item, "Text");
binding2.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
item.Text = "A";
toolstrip_item.DataBindings.Add (binding2);
Assert.AreEqual (null, binding2.Control, "#B1");
Assert.AreEqual (toolstrip_item, binding2.BindableComponent, "#B2");
Assert.AreEqual (item.Text, toolstrip_item.Text, "#B3");
toolstrip_item.Text = "B";
Assert.AreEqual (toolstrip_item.Text, item.Text, "#C1");
}
[Test]
public void ControlUpdateModeTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
MockItem item = new MockItem ("A", 0);
Binding binding = new Binding ("Text", item, "Text");
binding.ControlUpdateMode = ControlUpdateMode.Never;
c.DataBindings.Add (binding);
Assert.AreEqual (String.Empty, c.Text, "#A1");
item.Text = "B";
Assert.AreEqual (String.Empty, c.Text, "#B1");
}
[Test]
[Category ("NotWorking")]
public void DataSourceUpdateModeTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
MockItem item = new MockItem ("A", 0);
Binding binding = new Binding ("Text", item, "Text");
binding.DataSourceUpdateMode = DataSourceUpdateMode.Never;
c.DataBindings.Add (binding);
Assert.AreEqual ("A", c.Text, "#A1");
c.Text = "B";
Assert.AreEqual ("A", item.Text, "#B1");
binding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
Assert.AreEqual ("A", item.Text, "#C1");
c.Text = "C";
Assert.AreEqual ("C", item.Text, "#D1");
// This requires a Validation even, which we can't test
// by directly modifying the property
binding.DataSourceUpdateMode = DataSourceUpdateMode.OnValidation;
c.Text = "D";
Assert.AreEqual ("C", item.Text, "#E1");
}
[Test]
[Category ("NotWorking")]
public void DataSourceNullValueTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
ChildMockItem item = new ChildMockItem ();
item.ObjectValue = "A";
Binding binding = new Binding ("Tag", item, "ObjectValue");
binding.DataSourceNullValue = "NonNull";
c.DataBindings.Add (binding);
Assert.AreEqual (c.Tag, "A", "#A1");
// Since Tag property doesn't have a
// TagChanged event, we need to force an update
c.Tag = null;
binding.WriteValue ();
Assert.AreEqual (item.ObjectValue, "NonNull", "#B1");
}
[Test]
[Category ("NotWorking")]
public void NullValueTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
DataTable table = new DataTable ();
table.Columns.Add ("Name", typeof (string));
table.Columns.Add ("Id", typeof (int));
table.Rows.Add (null, DBNull.Value);
Binding binding = new Binding ("Tag", table, "Name");
Binding binding2 = new Binding ("Width", table, "Id");
binding.FormattingEnabled = true;
binding.NullValue = "non-null";
binding2.FormattingEnabled = true;
binding2.NullValue = 101;
c.Width = 99;
c.DataBindings.Add (binding);
c.DataBindings.Add (binding2);
Assert.AreEqual ("non-null", c.Tag, "#A1");
Assert.AreEqual (101, c.Width, "#A2");
}
[Test]
public void FormattingEnabledTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
MockItem item = new MockItem ();
item.Value = 666;
Binding binding = new Binding ("Text", item, "Value");
binding.FormattingEnabled = true;
binding.FormatString = "p";
c.DataBindings.Add (binding);
Assert.AreEqual ((666).ToString ("p"), c.Text, "#A1");
binding.FormatString = "c";
Assert.AreEqual ((666).ToString ("c"), c.Text, "#B1");
Console.WriteLine (c.Text);
binding.FormattingEnabled = false;
Assert.AreEqual ((666).ToString (), c.Text, "#C1");
}
[Test]
public void FormatStringTest ()
{
Binding binding = new Binding ("Text", null, "Text");
binding.FormatString = null;
Assert.AreEqual (String.Empty, binding.FormatString, "#A1");
}
#endif
}
class ChildMockItem : MockItem
@@ -552,31 +259,5 @@ namespace MonoTests.System.Windows.Forms.DataBinding {
}
}
#if NET_2_0
class BindableToolStripItem : ToolStripItem, IBindableComponent
{
ControlBindingsCollection data_bindings;
BindingContext binding_context;
public ControlBindingsCollection DataBindings {
get {
if (data_bindings == null)
data_bindings = new ControlBindingsCollection (this);
return data_bindings;
}
}
public BindingContext BindingContext
{
get {
return binding_context;
}
set {
binding_context = value;
}
}
}
#endif
}
@@ -1,109 +0,0 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc.
//
// Authors:
// Carlos Alberto Cortez <[email protected]>
//
using System;
using System.ComponentModel;
using System.Windows.Forms;
using NUnit.Framework;
namespace MonoTests.System.Windows.Forms.DataBinding {
[TestFixture]
public class BindingsCollectionTest
{
[SetUp]
protected virtual void SetUp ()
{
}
[TearDown]
protected virtual void TearDown ()
{
}
#if NET_2_0
//
// CollectionChanging event test section
//
bool collection_changing_called;
int collection_expected_count;
string collection_expected_assert;
CollectionChangeAction collection_action_expected;
object collection_element_expected;
void CollectionChangingHandler (object o, CollectionChangeEventArgs args)
{
BindingsCollection coll = (BindingsCollection)o;
collection_changing_called = true;
Assert.AreEqual (collection_expected_count, coll.Count, collection_expected_assert + "-0");
Assert.AreEqual (collection_action_expected, args.Action, collection_expected_assert + "-1");
Assert.AreEqual (collection_element_expected, args.Element, collection_expected_assert + "-2");
}
[Test]
public void CollectionChangingTest ()
{
Control c = new Control ();
c.BindingContext = new BindingContext ();
c.CreateControl ();
ControlBindingsCollection binding_coll = c.DataBindings;
Binding binding = new Binding ("Text", new MockItem ("A", 0), "Text");
Binding binding2 = new Binding ("Name", new MockItem ("B", 0), "Text");
binding_coll.Add (binding);
binding_coll.CollectionChanging += CollectionChangingHandler;
collection_expected_count = 1;
collection_action_expected = CollectionChangeAction.Add;
collection_element_expected = binding2;
collection_expected_assert = "#A0";
binding_coll.Add (binding2);
Assert.IsTrue (collection_changing_called, "#A1");
collection_changing_called = false;
collection_expected_count = 2;
collection_action_expected = CollectionChangeAction.Remove;
collection_element_expected = binding;
collection_expected_assert = "#B0";
binding_coll.Remove (binding);
Assert.IsTrue (collection_changing_called, "#B1");
collection_changing_called = false;
collection_expected_count = 1;
collection_element_expected = null;
collection_action_expected = CollectionChangeAction.Refresh;
collection_expected_assert = "#C0";
binding_coll.Clear ();
Assert.IsTrue (collection_changing_called, "#C1");
}
#endif
}
}
@@ -1,140 +1,7 @@
2008-02-27 Jonathan Pobst <[email protected]>
* UserControlTest.cs: Add test for PreferredSize.
2008-02-26 Carlos Alberto Cortez <[email protected]>
* BindingTest.cs: Added a new test for 2.0 BindableComponent property
- again as not working ;-(. Also add a child class of ToolStripItem to
test this property.
* ControlBindingsCollectionTest.cs: Likewise.
2008-02-26 Carlos Alberto Cortez <[email protected]>
* BindingTest.cs: Added a new test for 2.0 NullValue property - mark
as NotWorking by now ;-(. Also add an assertion for this new property
in CtorTest.
2008-02-23 Carlos Alberto Cortez <[email protected]>
* BindingTest.cs: Update ctor test with 2.0 properties, and add new
tests for 2.0 FormattingEnabled and FormatString properties.
2008-02-21 Jonathan Pobst <[email protected]>
* ToolStripContainerTests.cs: Add test for bug #363555.
2008-02-20 Jonathan Pobst <[email protected]>
* SplitContainerTests.cs: Add test for bug #363303.
2008-02-19 Jonathan Pobst <[email protected]>
* SelectionRangeTest.cs: Add NET_2_0 so that 1.1 profile will build.
2008-02-19 Jonathan Pobst <[email protected]>
* SelectionRangeTest.cs: Add tests from Andy Hume.
2008-02-19 Jonathan Pobst <[email protected]>
* ComboBoxTest.cs: Use PreferredHeight in MethodScaleControl.
Fixes buildbot failure.
2008-02-19 Jonathan Pobst <[email protected]>
* FlowPanelTests.cs: Add test for bug #361448.
2008-02-19 Jonathan Pobst <[email protected]>
* ComboBoxTest.cs: Add test for bug #360862.
2008-02-18 Andreia Gaita <[email protected]>
* ControlTest.cs: New test to check if, when controls don't have
a parent and are then reparented, their location is not changed.
2008-02-11 Carlos Alberto Cortez <[email protected]>
* BindingTest.cs: New test for 2.0 DataSourceNullValue property -
which is not working by now (but should guide us to correctly
implement some missing features in data binding).
2008-02-10 Carlos Alberto Cortez <[email protected]>
* BindingTest.cs: New test for changes in data source property (with
a 'PropertyChange' event).
2008-02-08 Carlos Alberto Cortez <[email protected]>
* BindingTest.cs: Add new cases for DataSourceUpdateMode test,
and also add a 2.0 WriteValueTest test.
2008-02-08 Jonathan Pobst <[email protected]>
* ComboBoxTest.cs: MethodScaleControl needs to take Font into
account, which PreferredHeight does. Fixes a failing test.
2008_02-08 Carlos Alberto Cortez <[email protected]>
* ListControl.cs: Add setter and events for MockItem members -
we need them to test data binding.
* BindingTest.cs: Add tests for 2.0 members (ControlUpdateMode,
DataSourceUpdateMode, ReadValue), and for IsBinding property.
Mark as NotWorking IsBindingTest and DataSourceUpdateMode as they are
failing by now.
2008-02-08 Jonathan Pobst <[email protected]>
* FormTest.cs: Commit tests from James Purcell for his new
AutoScale implementation. [Bug #359098]
2008-02-07 Jonathan Pobst <[email protected]>
* MdiFormTest.cs: Add test for bug #336296.
2008-02-07 Jonathan Pobst <[email protected]>
* MdiFormTest.cs: Add test for bug #325473.
2008-02-06 Jonathan Pobst <[email protected]>
* TimerTest.cs: Several asserts in one test had the same name,
so I can't tell which assert is failing on the buildbot. Fixed.
2008-02-04 Carlos Alberto Cortez <[email protected]>
* BindingsCollectionTest.cs: New file.
2008-02-04 Carlos Alberto Cortez <[email protected]>
* CurrencyManagerTest.cs: New tests for 2.0 ListChanged event.
* ListControlTest.cs: Add a default ctor for MockItem.
2008-02-03 Luke Page <[email protected]>
* RichTextBoxTest.cs: Restored property test with failing tests
commented so that it tests the fix to bug 358379 that AutoSize
defaults to false.
2008-02-03 Luke Page <[email protected]>
* TextBoxTest.cs: Added test from James Purcell for bug #358229 to
test FixedHeight control style when multiline changed.
2008-02-01 Jonathan Pobst <[email protected]>
[Backport to 1.9]
* ListBoxTest.cs: Disable test that is default font dependent.
2008-02-01 Jonathan Pobst <[email protected]>
* ListBoxTest.cs: Commit some tests for bug #357152 from James
Purcell.
2008-01-30 Carlos Alberto Cortez <[email protected]>
* BindingManagerBaseTest.cs: New test for 2.0 IsBindingSuspended test.
2008-01-28 Carlos Alberto Cortez <[email protected]>
* ComboBoxTest.cs: New SelectedTextWithBinding test - for #333750.
@@ -1136,19 +1136,6 @@ namespace MonoTests.System.Windows.Forms
Assert.AreEqual (-1, cmbbox.SelectedIndex, "#S3");
}
[Test] // bug 360862
public void SizeChangesAtCreateHandle ()
{
ComboBox cb = new ComboBox ();
cb.Font = new Font ("Arial", 24f);
int original = cb.Height;
IntPtr h = cb.Handle;
Assert.IsTrue (cb.Height > original, string.Format ("ComboBox height ({0}) should be bigger than original ({1})", cb.Height, original));
}
#if NET_2_0
[Test]
public void BehaviorAutoSize ()
@@ -1262,25 +1249,25 @@ namespace MonoTests.System.Windows.Forms
gb.Location = new Point (5, 10);
f.Controls.Add (gb);
Assert.AreEqual (new Rectangle (5, 10, 121, gb.PreferredHeight), gb.Bounds, "A1");
Assert.AreEqual (new Rectangle (5, 10, 121, 21), gb.Bounds, "A1");
gb.PublicScaleControl (new SizeF (2.0f, 2.0f), BoundsSpecified.All);
Assert.AreEqual (new Rectangle (10, 20, 238, gb.PreferredHeight), gb.Bounds, "A2");
Assert.AreEqual (new Rectangle (10, 20, 238, 21), gb.Bounds, "A2");
gb.PublicScaleControl (new SizeF (.5f, .5f), BoundsSpecified.Location);
Assert.AreEqual (new Rectangle (5, 10, 238, gb.PreferredHeight), gb.Bounds, "A3");
Assert.AreEqual (new Rectangle (5, 10, 238, 21), gb.Bounds, "A3");
gb.PublicScaleControl (new SizeF (.5f, .5f), BoundsSpecified.Size);
Assert.AreEqual (new Rectangle (5, 10, 121, gb.PreferredHeight), gb.Bounds, "A4");
Assert.AreEqual (new Rectangle (5, 10, 121, 21), gb.Bounds, "A4");
Console.WriteLine ("DONE");
gb.PublicScaleControl (new SizeF (3.5f, 3.5f), BoundsSpecified.Size);
Assert.AreEqual (new Rectangle (5, 10, 414, gb.PreferredHeight), gb.Bounds, "A5");
Assert.AreEqual (new Rectangle (5, 10, 414, 21), gb.Bounds, "A5");
gb.PublicScaleControl (new SizeF (2.5f, 2.5f), BoundsSpecified.Size);
Assert.AreEqual (new Rectangle (5, 10, 1029, gb.PreferredHeight), gb.Bounds, "A6");
Assert.AreEqual (new Rectangle (5, 10, 1029, 21), gb.Bounds, "A6");
gb.PublicScaleControl (new SizeF (.2f, .2f), BoundsSpecified.Size);
Assert.AreEqual (new Rectangle (5, 10, 209, gb.PreferredHeight), gb.Bounds, "A7");
Assert.AreEqual (new Rectangle (5, 10, 209, 21), gb.Bounds, "A7");
f.Dispose ();
}
@@ -44,18 +44,6 @@ namespace MonoTests.System.Windows.Forms.DataBinding {
c2.DataBindings.Add ("Text", c1, "Text");
c2.DataBindings.Add ("Text", c1, "Text");
}
#if NET_2_0
[Test]
public void CtorTest ()
{
BindableToolStripItem item = new BindableToolStripItem ();
ControlBindingsCollection data_bindings = new ControlBindingsCollection (item);
Assert.AreEqual (item, data_bindings.BindableComponent, "#A1");
Assert.AreEqual (null, data_bindings.Control, "#A2");
}
#endif
}
}
Loaded 100 of 1047 files, more files were not shown because too many files have changed in this diff. Show more