control is removed from a control collecftion.
* XplatUIX11.cs: The first location for toplevel form is (22, 22).
Fixes FormPropertyTest (failed on rare occasions).
* XplatUIWin32.cs: Add a workaround in SetParent for strange behaviour
of Win32SetParent (when changing from no parent to a parent it
might add the new parent's location in screen coordinates to this
window's location).
* Form.cs: Rework ChangingParent once again, now the handle is
recreated whenever a FormWindowManager is added or removed (that is
whenever a normal form is parented or abandoned). Also change
CreateParams so that all non-toplevel windows always get the
specified sice (StartupPosition is never considered for
non-TopLevel forms).
* ContainerControl.cs: Add ChildControlRemoved, the container control
needs to be notified when a control is removed from it's
collection, in the case the removed control is the active control.
* Hwnd.cs: Completely reworked GetWindowRectangle and
GetClientRectangle - they are now passed a CreateParams and they
only use Style and ExStyle to determine the rectangles (they should
now work just like Win32AdjustWindowRectEx - though quite a few
special cases are probably missing). They should also be 100%
complimentary (i.e. GetWindowRectangle (GetClientRectangle (rect))
== rect), and all numbers (borders, menu sizes) are taken from the
current theme. Added a GetBorders helper function that will return
the borders for any given CreateParams (including captions and
menus), and GetBorderSize that returns the given border size only.
svn path=/trunk/mcs/; revision=75287
A selected control would not get a Focus call if:
- the default active control of the container is the same as
the one that was selected
- we are switching from one container to another
Under these conditions, the container being selected already has
an active_control, which is the same as the one being activated,
so set_ActiveControl would always return and not send the Focus
call. Fix to check if the currently active control of the container
is actually focused.
2007-02-13 Andreia Gaita <[email protected]
svn path=/trunk/mcs/; revision=72807
anymore.
* Control.cs (Controls.Add): Check if control to be added to the collection
is a top level control, and throw an ArgumentException if it is.
Remove ContainerSelectedFlag, not needed anymore.
* XplaUIWin32.cs (SetTopMost): Add flag SWP_NOACTIVATE so that setting the
top most control doesn't activate the form. This fixes a problem in the
MessageBox, where the default button wouldn't get focus because the form
was activated before being Loaded - when the Owner is set, SetTopMost is
called, and it would activate it.
2007-01-11 Andreia Gaita <[email protected]>
svn path=/trunk/mcs/; revision=70869
* ContainerControl.cs (set_ActiveControl): rework this a bit (and
add some nice ascii art pictures and explanation of the process).
(GetMostDeeplyNestedActiveControl): new utility function we need
because our ActiveControl can refer to a child container with its
own ActiveControl.
* Form.cs (OnActivated): remove the call to SelectActiveControl
from here, since you can override this method and not chain up,
and winforms still sets the active control.
(OnCreateControl): also remove the unnecessary SelectActiveControl
call from here.
(WndProc): it's actually called from the WM_ACTIVATE block, just
before calling OnActivated.
* Control.cs (Select (Control)): move the call to XplatUI.SetFocus
inside the else. the ActiveControl setter will end up setting
focus on @control. This keeps us from setting it again (and
generating an extra LostFocus/GotFocus pair).
(Select (bool, bool)): reindent.
svn path=/trunk/mcs/; revision=70804
* ContainerControl.cs: Use ContainerSelected flag to check if
a Container is directly selected, or if Select is called on a
non-container. If a container is directly selected, focus events
should not be raised.
Apply #80411 patch to throw exception on set_ActiveControl if
control is the same as the current one.
* Control.cs: Use ContainerSelected flag (see above).
Add invalidation check to raise event but not invalidate if
dimensions are 0.
Apply #80411 patch.
* ContainerControlTest.cs / FocusTest.cs: Moved Gert's
ActiveControl tests to FocusTest, for easier management.
Add Validation tests.
svn path=/trunk/mcs/; revision=70293
container control doesn't contain the control we're setting
ActiveControl to.
2006-12-30 Chris Toshok <[email protected]>
svn path=/trunk/mcs/; revision=70276
tree when the new activecontrol is a container.
When validating the active control, if it is a container, also
raise up the validation for it's active control. Fixes#80280
* Control.cs: Add internal property flag and check to prevent
Focus events from getting raised when Select() is called for
a ContainerControl. There are still too many focus events being
raised at the moment though.
Cleaned up the code a bit.
2006-12-22 Andreia Gaita <[email protected]>
svn path=/trunk/mcs/; revision=69980
* Button.cs, ComboBox.cs, ScrollBar.cs, UserControl.cs,
TextBoxBase.cs, ListView.cs, ContainerControl.cs,
ScrollableControl.cs: Add a handful of methods that are
overwritten in 2.0
svn path=/trunk/mcs/; revision=69566
not selectable, since it should receive WM_KEY* and WM_MOUSE
messages. Fixes#79907.
2006-12-11 Rolf Bjarne Kvinge <[email protected]>
svn path=/trunk/mcs/; revision=69409
* Win32DnD.cs: comment out some unused fields.
* XplatUIWin32.cs: comment out some unused pinvokes, and remove
some unused properties/methods.
* XplatUIX11.cs: fix MousePosition so we override the base class's
property instead of conflicting with it.
* PictureBox.cs: comment out some unused fields
* OSXStructs.cs: make some struct fields public.
* XplatUIOSX.cs: comment out some unused pinvokes, and fix
MousePosition so we override the base class's property instead of
conflicting with it.
* X11Dnd.cs: comment out some unused fields
* X11DesktopColors.cs: fix some struct field visibility to quiet
the compiler.
* X11Dnd.cs: remove some debug code.
* ThemeClearlooks.cs: comment out unused field.
* ThemeNice.cs: mark some methods as overriding ThemeWin32Classic as needed.
* ThemeGtk.cs: comment out some unused pinvokes.
* Timer.cs: remove some unused fields.
* ThemeClearlooks.cs: comment out unused field.
* UpDownBase.cs: comment out unused field.
* DataObject.cs: comment out unused field.
* DataGridBoolColumn.cs: reomve unused field.
* DataGrid.cs: remove unused field.
* Cursor.cs: remove old ToBitmap code.
* ControlPaint.cs: remove unused method.
* ScrollBar.cs: remove unused fields.
* ComboBox.cs: remove unused field, and chain up to
AccessibleObject ctor.
* ListBox.cs: remove unused field.
* ButtonBase.cs: wrap a couple fields in NET_2_0.
* GridEntry.cs: remove unused fields.
* Binding.cs: remove unused fields.
* AxHost.cs: remove unused method.
* ContainerControl.cs: remove unused field.
* ScrollableControl.cs: remove unused fields.
2006-12-01 Chris Toshok <[email protected]>
svn path=/trunk/mcs/; revision=68867
a reversion of rev.66853... eh).
* Control.cs: Fixes Reflector hang by changing Focus() call
to what it was before rev.66643 (calling Select() here sets
ActiveControl, which in some situations calls back Focus and
eventually does a stack overflow). Temp fix.
Changes to GetNextControl() to not look for children to select when
parent cannot be selectable (so it looks for siblings instead)
2006-10-31 Andreia Gaita <[email protected]>
svn path=/trunk/mcs/; revision=67203
ActiveControl due to hanging problems. This fix
partly regresses #79667 (button does not have
initial focus), so this might be a symptom for
a larger parenting problem (set_ActiveControl
is being called but the child control does
not have the parent set yet?)
2006-10-31 Andreia Gaita <[email protected]>
svn path=/trunk/mcs/; revision=67183
Fixes#79384, #79394, #79652, #79667
* Application.cs:
- Modal windows are now destroyed in the proper order for windows
* ContainerControl.cs:
- ActiveControl setter has more conditions on when to return:
- if we're reselecting the active control, but it actually
didn't have focus (window hidden or some such), it runs
- if the active control being selected doesn't actually
exist in the container, it returns
* Form.cs
- The ShowDialog now gets the current form as the owner when
invoking without parameters, and correctly activates the owner
when returning
* MessageBox.cs
- MessageBox now catches the Escape key to exit
svn path=/trunk/mcs/; revision=66846
* ContainerControl.cs: Make validation events fire in the
* correct
order. TODO: For some reason the first validation event is not
getting fired.
svn path=/trunk/mcs/; revision=63939
the next control in a container when the container is activated.
* UpDownBase.cs: Don't select the text box when the up down is
selected.
svn path=/trunk/mcs/; revision=63018
this way the container controls override will get called and the
whole ActiveControl chain will get triggered. TODO: probably
need
to make sure this gets done everywhere instead of the old
Select(Control).
* ContainerControl.cs: Implement the directed Select method to
find and activate the correct child control.
svn path=/trunk/mcs/; revision=62932
if the current control was focused.
- Don't handle enter/leave when setting/killing focus, this is
done by the container control.
- Remove is_selected, it's not needed anymore.
- Add utility methods for selecting a child control, and for
firing the Enter/Leave events.
* ContainerControl.cs: When a control is activated fire the
enter/leave events.
- Don't wrap when processing the tab key, so that focus can be
moved outside of the container.
svn path=/trunk/mcs/; revision=62436
* Control.cs
- Select: Implemented to just use activate. Seems to match MS
behaviour closest. Documented to only do actual control walking
based on it's parameters if in a container control so I moved
the code there.
- Removed selection check logic from our internal Select() method
* ContainerControl.cs:
- Select: Moved selection logic from Control here, since MS documents
that containers obey the bool arguments. No longer calling base
svn path=/trunk/mcs/; revision=61421
* ScrollableControl.cs:
- Rewrote DisplayRectangle code, now returning the proper x/y coords
(instead of 0,0) and we now return the real width/height instead of
just the clientrectangle, adjusted for padding. The rectangle is
now cached and created by the new CalculateDisplayRectangle method.
- Created new CalculateDisplayRectange method, which basically does
what get_DisplayRectangle() did originally, but now using the
right edge instead of DisplayRectangle to determine the size of
our scrollbars
- get_Canvas(): Fixed it to properly calculate canvas for
right/bottom controls which seem to be placed to the right/bottom
of any controls that have a fixed location
- Removed TODO that's taken care of
- Removed NotImplementeds and attempted to implement AdjustFormScrollBars
and SetDisplayRectLocation according to new MSDN2 docs
- Added call to PerformLayout in OnVisibleChanged, MS causes a layout
event when that is called, this is added for compatibility
- ScrollControlIntoView(): Implemented.
- Switched scrollbars to be implicit, they shouldn't be selectable
* ContainerControl: Now that ScrollControlIntoView is implemented, we
call it when the active control is set/changed
* ScrollBar.cs: Added support for generating Win32 scrollbar messages
* ImplicitHScrollBar.cs, ImplicitVScrollBar.cs: Now setting new base
implicit_control variable (used for native Win32 message generation)
* XplatUI.cs, XplatUIDriver.cs, XplatUIWin32.cs: Added new
HorizontalScrollBarHeight and VerticalScrollBarWidth properties
* ThemeWin32Classic.cs: Now calling the driver for the scrollbar sizes
* XplatUIStructs.cs: Added ScrollBarCommands enum
svn path=/trunk/mcs/; revision=59370
* PictureBox.cs: Implemented ISupportInitialize interface (fixes#77726)
* ContainerControl.cs: Partial implementation of some 2.0 scaling
methods. Moved the new 2.0 properties into alphabetical order with
other properties and added MonoTODO tags
svn path=/trunk/mcs/; revision=57767
the 2.0 enumeration.
* System.Windows.Forms/ContainerControl.cs: Added stub for
AutoScaleMode property; outputs a message to stderr to
encourage people familiar with its behaviour to implement
it. :-)
* System.Windows.Forms/Control.cs: Added stub for AutoScale;
outputs a message just like ContainerControl::AutoScaleMode.
* System.Windows.Forms.dll.sources: Added AutoScaleMode.cs to
the list of files to build.
svn path=/trunk/mcs/; revision=57763
* ContainerControl.cs: Instead of throwing an exception, print
a one-time warning about Validate not being implemented
* XplatUIWin32.cs: Removed debug output
svn path=/trunk/mcs/; revision=50426
- Implemented CheckBox.ProcessMnemonic
- Added handling of WM_SYSxxx keyboard messages to support mnemonic handling
- Added internal method to allow calling ProcessMnemonic from other controls
- Started support for handling validation chain handling
- Implemented ProcessMnemonic support
- Added Select() call to ContainerControl.ActiveControl, to make sure the
active control receives focus
- Marking Forms as TopLevel
- Fixed CheckBox and RadioButton to show hotkeys
- Removed WndProc override in CommonDialog, not needed
- Added various missing attributes
svn path=/trunk/mcs/; revision=40684
- Fixed Drawing Last month in grid (sometimes not showing)
* MonthCalendar.cs:
- Fixed title width calculation bug (makeing title small)
svn path=/trunk/mcs/; revision=36457