// Dennis Hayes (dennish@Raytek.com)
// Aleksey Ryabchuk (ryabchuk@yahoo.com)
//
-// (C) 2002 Ximian, Inc
+// (C) 2002/3 Ximian, Inc
//
using System;
Dock = DockStyle.Bottom;
showPanels = false;
sizingGrip = true;
- Size = DefaultSize;
+ base.TabStop = false;
}
public override string ToString()
return str;
}
- [MonoTODO]
protected override void CreateHandle()
{
+ initCommonControlsLibrary ( );
base.CreateHandle();
}
+ [MonoTODO]
+ protected override void Dispose(bool disposing) {
+ // FIXME:
+ base.Dispose(disposing);
+ }
+
protected virtual void OnDrawItem(StatusBarDrawItemEventArgs e)
{
if( DrawItem != null)
[MonoTODO]
protected override void OnLayout(LayoutEventArgs e)
{
- //FIXME:
base.OnLayout(e);
+ if ( IsHandleCreated )
+ UpdateParts ( );
}
[MonoTODO]
[MonoTODO]
protected override CreateParams CreateParams {
get {
- CreateParams createParams = new CreateParams ();
+ CreateParams createParams = base.CreateParams;
- createParams.Caption = Text;
createParams.ClassName = "msctls_statusbar32";
- createParams.X = Left;
- createParams.Y = Top;
- createParams.Width = Width;
- createParams.Height = Height;
- createParams.ClassStyle = 0;
- createParams.ExStyle = 0;
- createParams.Param = 0;
- createParams.Parent = Parent.Handle;
+
createParams.Style = (int) (
WindowStyles.WS_CHILD |
WindowStyles.WS_VISIBLE |
WindowStyles.WS_OVERLAPPED |
WindowStyles.WS_CLIPCHILDREN |
- WindowStyles.WS_CLIPCHILDREN );
+ WindowStyles.WS_CLIPCHILDREN ) |
+ (int)( CommonControlStyles.CCS_NORESIZE );
if( SizingGrip )
createParams.Style |= (int)StatusbarControlStyles.SBARS_SIZEGRIP;
CalculatePanelWidths ( array );
int size = array.Length;
- IntPtr buffer = Marshal.AllocCoTaskMem( Marshal.SizeOf( size ) * size );
+ IntPtr buffer = Marshal.AllocHGlobal ( Marshal.SizeOf( size ) * size );
Marshal.Copy( array, 0, buffer, size );
Win32.SendMessage( Handle, (int)StatusbarMessages.SB_SETPARTS, size, buffer.ToInt32() );
Win32.SendMessage( Handle, (int)StatusbarMessages.SB_SIMPLE, 0, 0 );
- Marshal.FreeCoTaskMem( buffer );
+ Marshal.FreeHGlobal ( buffer );
}
else {
Win32.SendMessage( Handle, (int)StatusbarMessages.SB_SIMPLE, 1, 0 );
}
}
+ private void initCommonControlsLibrary ( ) {
+ if ( !RecreatingHandle ) {
+ INITCOMMONCONTROLSEX initEx = new INITCOMMONCONTROLSEX();
+ initEx.dwICC = CommonControlInitFlags.ICC_BAR_CLASSES;
+ Win32.InitCommonControlsEx(initEx);
+ }
+ }
+
//
// System.Windows.Forms.StatusBar.StatusBarPanelCollection
//