| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- //
- // System.Windows.Forms.Label.cs
- //
- // Author:
- // stubbed out by Daniel Carrera ([email protected])
- // implemented for Gtk+ by Rachel Hestilow ([email protected])
- // Dennis Hayes ([email protected])
- // WineLib implementation started by John Sohn ([email protected])
- //
- // (C) 2002 Ximian, Inc
- //
-
- namespace System.Windows.Forms {
- using System.ComponentModel;
- using System.Drawing;
-
- // <summary>
- //
- // </summary>
-
- public class Label : Control {
-
- Image backgroundImage;
- BorderStyle borderStyle;
- bool autoSize;
- Image image;
- ContentAlignment imageAlign;
- ImeMode defaultImeMode;
- bool renderTransparent;
- FlatStyle flatStyle;
- int preferredHeight;
- int preferredWidth;
- bool tabStop;
- ContentAlignment textAlign;
- bool useMnemonic;
-
- //
- // --- Constructor
- //
- public Label () : base ()
- {
-
- }
-
- //
- // --- Public Properties
- //
- public virtual bool AutoSize {
- get {
- return autoSize;
- }
- set {
- autoSize = value;
- }
- }
-
- public override Image BackgroundImage {
- get {
- return backgroundImage;
- }
- set {
- backgroundImage = value;
- // FIXME: force redraw
- }
- }
-
- public virtual BorderStyle BorderStyle {
- get {
- return borderStyle;
- }
- set {
- borderStyle = value;
- }
- }
-
-
- public FlatStyle FlatStyle {
- get {
- return flatStyle;
- }
- set {
- flatStyle = value;
- }
- }
-
- public Image Image {
- get {
- return image;
- }
- set {
- image = value;
- }
- }
-
- public ContentAlignment ImageAlign {
- get {
- return imageAlign;
- }
- set {
- imageAlign = value;
- }
- }
-
-
- [MonoTODO]
- public int ImageIndex {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public ImageList ImageList {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public new ImeMode ImeMode {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public int PreferredHeight {
- get {
- return preferredHeight;
- }
- }
-
- public int PreferredWidth {
- get {
- return preferredWidth;
- }
- }
-
- public new bool TabStop {
- get {
- return tabStop;
- }
- set {
- tabStop = value;
- }
- }
-
- //Compact Framework
- public virtual ContentAlignment TextAlign {
- get {
- return textAlign;
- }
- set {
- textAlign = value;
- }
- }
-
- public bool UseMnemonic {
- get {
- return useMnemonic;
- }
- set {
- useMnemonic = value;
- }
- }
-
- //
- // --- Protected Properties
- //
-
- protected override CreateParams CreateParams {
- get {
- CreateParams createParams = new CreateParams ();
- window = new ControlNativeWindow (this);
-
- createParams.Caption = Text;
- createParams.ClassName = "STATIC";
- 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) (
- Win32.WS_CHILD |
- Win32.WS_VISIBLE | Win32.SS_LEFT );
- window.CreateHandle (createParams);
- return createParams;
- }
- }
-
- protected override Size DefaultSize {
- get {
- // FIXME: use GetSystemMetrics?
- throw new NotImplementedException ();
- }
- }
-
- protected virtual bool RenderTransparent {
- get {
- return renderTransparent;
- }
- set {
- renderTransparent = value;
- }
- }
-
- protected override ImeMode DefaultImeMode {
- get {
- return defaultImeMode;
- }
- }
-
- //
- // --- Public Methods
- //
- [MonoTODO]
- public override bool Equals(object o)
- {
- throw new NotImplementedException ();
- }
-
- public override int GetHashCode() {
- //FIXME add our proprities
- return base.GetHashCode();
- }
-
- public new void Select()
- {
- base.Select ();
- }
-
- //Compact Framework
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
-
- //
- // --- Public Events
- //
- public event EventHandler AutoSizeChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler TextAlignChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- //
- // --- Protected Methods
- //
- [MonoTODO]
- protected Rectangle CalcImageRenderBounds (
- Image image, Rectangle rect, ContentAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- // [MonoTODO]
- // protected override AccessibleObject CreateAccessibilityInstance()
- // {
- // throw new NotImplementedException ();
- // }
-
- protected new virtual void Dispose()
- {
- //throw new NotImplementedException ();
- }
-
- protected override void Dispose(bool disposing)
- {
- //throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void DrawImage (Graphics g, Image img,
- Rectangle r, ContentAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- protected virtual void OnAutoSizeChanged (EventArgs e) {
- if (AutoSizeChanged != null)
- AutoSizeChanged (this, e);
-
- }
-
- protected override void OnEnabledChanged (EventArgs e)
- {
- base.OnEnabledChanged (e);
- }
-
- protected override void OnFontChanged (EventArgs e)
- {
- base.OnFontChanged (e);
- }
-
- protected override void OnPaint (PaintEventArgs e)
- {
-
- }
-
- //Compact Framework
- protected override void OnParentChanged (EventArgs e)
- {
- base.OnParentChanged (e);
- }
-
- protected virtual void OnTextAlignChanged (EventArgs e) {
- if (TextAlignChanged != null)
- TextAlignChanged (this, e);
- }
-
- //Compact Framework
- protected override void OnTextChanged (EventArgs e) {
- base.OnTextChanged (e);
- }
-
- protected override void OnVisibleChanged (EventArgs e)
- {
- base.OnVisibleChanged (e);
- }
-
- protected override bool ProcessMnemonic(char charCode)
- {
- return base.ProcessMnemonic (charCode);
- }
-
- [MonoTODO]
- protected new ContentAlignment RtlTranslateAlignment (
- ContentAlignment alignment)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected new HorizontalAlignment RtlTranslateAlignment (
- HorizontalAlignment alignment)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected new LeftRightAlignment RtlTranslateAlignment (
- LeftRightAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected new virtual void Select (bool directed, bool forward)
- {
- throw new NotImplementedException ();
- }
-
- protected override void SetBoundsCore (
- int x, int y, int width, int height,
- BoundsSpecified specified)
- {
- base.SetBoundsCore (x, y, width, height, specified);
- }
-
- protected new void UpdateBounds()
- {
- base.UpdateBounds ();
- }
-
- protected new void UpdateBounds (int x, int y,
- int width, int height)
- {
- base.UpdateBounds (x, y, width, height);
- }
-
-
- protected new void UpdateBounds (int x, int y, int width,
- int height, int clientWidth,
- int clientHeight)
- {
- base.UpdateBounds (x, y, width, height, clientWidth,
- clientHeight);
- }
-
- protected override void WndProc(ref Message m)
- {
- base.WndProc (ref m);
- }
- }
- }
|