StatusBar.cs :  » GUI » wx-NET » wx » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » GUI » wx NET 
wx NET » wx » StatusBar.cs
//-----------------------------------------------------------------------------
// wx.NET - statusbr.h
// 
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: StatusBar.cs,v 1.10 2007/11/25 18:32:34 harald_meyer Exp $
//-----------------------------------------------------------------------------

using System;
using System.Runtime.InteropServices;
using System.Drawing;

namespace wx{
  public class StatusBar : Window
  {
    public const int wxST_SIZEGRIP         = 0x0010;
    public const int wxST_NO_AUTORESIZE    = 0x0001;
    
    public const int wxSB_NORMAL  = 0x000;
    public const int wxSB_FLAT  = 0x001;
    public const int wxSB_RAISED  = 0x002; 
  
    //-----------------------------------------------------------------------------
  
    [DllImport("wx-c")] static extern IntPtr wxStatusBar_ctor();
        [DllImport("wx-c")]
        [return: MarshalAs(UnmanagedType.U1)]
        static extern bool wxStatusBar_Create(IntPtr self, IntPtr parent, int id, uint style, IntPtr name);
  
    [DllImport("wx-c")] static extern void   wxStatusBar_SetFieldsCount(IntPtr self, int number, int[] widths);
        [DllImport("wx-c")]
        [return: MarshalAs(UnmanagedType.U1)]
        static extern bool wxStatusBar_GetFieldRect(IntPtr self, int i, ref Rectangle rect);
    [DllImport("wx-c")] static extern int    wxStatusBar_GetBorderY(IntPtr self);
    [DllImport("wx-c")] static extern IntPtr wxStatusBar_GetStatusText(IntPtr self, int number);
    [DllImport("wx-c")] static extern int    wxStatusBar_GetBorderX(IntPtr self);
    [DllImport("wx-c")] static extern void   wxStatusBar_SetStatusText(IntPtr self, IntPtr text, int number);
    [DllImport("wx-c")] static extern void   wxStatusBar_SetStatusWidths(IntPtr self, int n, int[] widths);
    
    [DllImport("wx-c")] static extern int    wxStatusBar_GetFieldsCount(IntPtr self);
    [DllImport("wx-c")] static extern void   wxStatusBar_PopStatusText(IntPtr self, int field);
    [DllImport("wx-c")] static extern void   wxStatusBar_PushStatusText(IntPtr self, IntPtr xstring, int field);
    [DllImport("wx-c")] static extern void   wxStatusBar_SetMinHeight(IntPtr self, int height);
    [DllImport("wx-c")] static extern void   wxStatusBar_SetStatusStyles(IntPtr self, int n, [In,Out] int[] styles);
  
    //-----------------------------------------------------------------------------

    public StatusBar(IntPtr wxObject) 
      : base(wxObject) { }

    public StatusBar()
      : this(wxStatusBar_ctor()) { }

    public StatusBar(Window parent)
      : this(parent, Window.UniqueID, wxST_SIZEGRIP, "statusBar") { }
      
    public StatusBar(Window parent, int id, uint style)
      : this(parent, id, style, "statusBar") { }

    public StatusBar(Window parent, int id, uint style, string name)
    : this()
    {
      if (!Create(parent, id, style, name))
      {
        throw new InvalidOperationException("Failed to create StatusBar");
      }
    }
    
    //---------------------------------------------------------------------
    // ctors with self created id
    
    public StatusBar(Window parent, uint style)
      : this(parent, Window.UniqueID, style, "statusBar") { }

    public StatusBar(Window parent, uint style, string name)
      : this(parent, Window.UniqueID, style, name) {}
    
    //-----------------------------------------------------------------------------

        public bool Create(Window parent, int id, uint style, string name)
        {
            return this.Create(parent, id, style, wxString.SafeNew(name));
        }
    public bool Create(Window parent, int id, uint style, wxString name)
    {
      return wxStatusBar_Create(wxObject, Object.SafePtr(parent), id, (uint)style, Object.SafePtr(name));
    }

    //-----------------------------------------------------------------------------
        
    public void SetFieldsCount(int number, int[] widths)
    {
      wxStatusBar_SetFieldsCount(wxObject, number, widths);
    }
    
    public int FieldsCount
    {
      get { return wxStatusBar_GetFieldsCount(wxObject); }
    }

    //-----------------------------------------------------------------------------

    public int BorderY
    {
      get { return wxStatusBar_GetBorderY(wxObject); }
    }

    public int BorderX
    {
      get { return wxStatusBar_GetBorderX(wxObject); }
    }

    //-----------------------------------------------------------------------------

    public bool GetFieldRect(int i, ref Rectangle rect)
    {
      return wxStatusBar_GetFieldRect(wxObject, i, ref rect);
    }

    //-----------------------------------------------------------------------------

    public string StatusText
    {
      set { SetStatusText(value); }
      get { return GetStatusText(0); }
    }

    public void SetStatusText(string text) 
    { SetStatusText(text, 0); }

        public void SetStatusText(string text, int number)
        {
            this.SetStatusText(wxString.SafeNew(text), number);
        }
    public void SetStatusText(wxString text, int number)
    {
      wxStatusBar_SetStatusText(wxObject, Object.SafePtr( text), number);
    }

    public string GetStatusText(int number)
    {
      return new wxString(wxStatusBar_GetStatusText(wxObject, number), true);
    }

    //-----------------------------------------------------------------------------

    public int[] StatusWidths
    {
      set { SetStatusWidths(value.Length, value); }
    }

    public void SetStatusWidths(int n, int[] widths)
    {
      wxStatusBar_SetStatusWidths(wxObject, n, widths);
    }
    
    //-----------------------------------------------------------------------------
    
    public void PopStatusText()
    {
      PopStatusText(0);
    }
    
    public void PopStatusText(int field)
    {
      wxStatusBar_PopStatusText(wxObject, field);
    }
    
    //-----------------------------------------------------------------------------
    
    public void PushStatusText(string xstring)
    {
      PushStatusText(xstring, 0);
    }

        public void PushStatusText(string xstring, int field)
        {
            this.PushStatusText(wxString.SafeNew(xstring), field);
        }
    public void PushStatusText(wxString xstring, int field)
    {
      wxStatusBar_PushStatusText(wxObject, Object.SafePtr( xstring), field);
    }
    
    //-----------------------------------------------------------------------------
    
    public new int MinHeight
    {
      set { wxStatusBar_SetMinHeight(wxObject, value); }
    }
    
    //-----------------------------------------------------------------------------
    
    public int[] StatusStyles
    {
      set { wxStatusBar_SetStatusStyles(wxObject, value.Length, value); }
    }
  }
}

www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.