2 // System.Windows.Forms.Label.cs
5 // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
6 // implemented for Gtk+ by Rachel Hestilow (hestilow@ximian.com)
7 // Dennis Hayes (dennish@raytek.com)
8 // WineLib implementation started by John Sohn (jsohn@columbus.rr.com)
10 // (C) 2002 Ximian, Inc
13 namespace System
.Windows
.Forms
{
14 using System
.ComponentModel
;
21 public class Label
: Control
{
23 Image backgroundImage
;
24 BorderStyle borderStyle
;
27 ContentAlignment imageAlign
;
28 ImeMode defaultImeMode
;
29 bool renderTransparent
;
34 ContentAlignment textAlign
;
40 public Label () : base ()
46 // --- Public Properties
48 public virtual bool AutoSize
{
57 public override Image BackgroundImage
{
59 return backgroundImage
;
62 backgroundImage
= value;
63 // FIXME: force redraw
67 public virtual BorderStyle BorderStyle
{
77 public FlatStyle FlatStyle
{
95 public ContentAlignment ImageAlign
{
106 public int ImageIndex
{
108 throw new NotImplementedException ();
111 throw new NotImplementedException ();
116 public ImageList ImageList
{
118 throw new NotImplementedException ();
121 throw new NotImplementedException ();
126 public new ImeMode ImeMode
{
128 throw new NotImplementedException ();
131 throw new NotImplementedException ();
135 public int PreferredHeight
{
137 return preferredHeight
;
141 public int PreferredWidth
{
143 return preferredWidth
;
147 public new bool TabStop
{
157 public virtual ContentAlignment TextAlign
{
166 public bool UseMnemonic
{
176 // --- Protected Properties
179 protected override CreateParams CreateParams
{
181 CreateParams createParams
= new CreateParams ();
182 window
= new ControlNativeWindow (this);
184 createParams
.Caption
= Text
;
185 createParams
.ClassName
= "STATIC";
186 createParams
.X
= Left
;
187 createParams
.Y
= Top
;
188 createParams
.Width
= Width
;
189 createParams
.Height
= Height
;
190 createParams
.ClassStyle
= 0;
191 createParams
.ExStyle
= 0;
192 createParams
.Param
= 0;
193 createParams
.Parent
= Parent
.Handle
;
194 createParams
.Style
= (int) (
196 Win32
.WS_VISIBLE
| Win32
.SS_LEFT
);
197 window
.CreateHandle (createParams
);
202 protected override Size DefaultSize
{
204 // FIXME: use GetSystemMetrics?
205 throw new NotImplementedException ();
209 protected virtual bool RenderTransparent
{
211 return renderTransparent
;
214 renderTransparent
= value;
218 protected override ImeMode DefaultImeMode
{
220 return defaultImeMode
;
225 // --- Public Methods
228 public override bool Equals(object o
)
230 throw new NotImplementedException ();
233 public override int GetHashCode() {
234 //FIXME add our proprities
235 return base.GetHashCode();
238 public new void Select()
245 public override string ToString()
247 throw new NotImplementedException ();
253 public event EventHandler AutoSizeChanged
; // {
255 // throw new NotImplementedException ();
258 // throw new NotImplementedException ();
262 public event EventHandler TextAlignChanged
; // {
264 // throw new NotImplementedException ();
267 // throw new NotImplementedException ();
272 // --- Protected Methods
275 protected Rectangle
CalcImageRenderBounds (
276 Image image
, Rectangle rect
, ContentAlignment align
)
278 throw new NotImplementedException ();
282 // protected override AccessibleObject CreateAccessibilityInstance()
284 // throw new NotImplementedException ();
287 protected new virtual void Dispose()
289 //throw new NotImplementedException ();
292 protected override void Dispose(bool disposing
)
294 //throw new NotImplementedException ();
298 protected void DrawImage (Graphics g
, Image img
,
299 Rectangle r
, ContentAlignment align
)
301 throw new NotImplementedException ();
304 protected virtual void OnAutoSizeChanged (EventArgs e
) {
305 if (AutoSizeChanged
!= null)
306 AutoSizeChanged (this, e
);
310 protected override void OnEnabledChanged (EventArgs e
)
312 base.OnEnabledChanged (e
);
315 protected override void OnFontChanged (EventArgs e
)
317 base.OnFontChanged (e
);
320 protected override void OnPaint (PaintEventArgs e
)
326 protected override void OnParentChanged (EventArgs e
)
328 base.OnParentChanged (e
);
331 protected virtual void OnTextAlignChanged (EventArgs e
) {
332 if (TextAlignChanged
!= null)
333 TextAlignChanged (this, e
);
337 protected override void OnTextChanged (EventArgs e
) {
338 base.OnTextChanged (e
);
341 protected override void OnVisibleChanged (EventArgs e
)
343 base.OnVisibleChanged (e
);
346 protected override bool ProcessMnemonic(char charCode
)
348 return base.ProcessMnemonic (charCode
);
352 protected new ContentAlignment
RtlTranslateAlignment (
353 ContentAlignment alignment
)
355 throw new NotImplementedException ();
359 protected new HorizontalAlignment
RtlTranslateAlignment (
360 HorizontalAlignment alignment
)
362 throw new NotImplementedException ();
366 protected new LeftRightAlignment
RtlTranslateAlignment (
367 LeftRightAlignment align
)
369 throw new NotImplementedException ();
373 protected new virtual void Select (bool directed
, bool forward
)
375 throw new NotImplementedException ();
378 protected override void SetBoundsCore (
379 int x
, int y
, int width
, int height
,
380 BoundsSpecified specified
)
382 base.SetBoundsCore (x
, y
, width
, height
, specified
);
385 protected new void UpdateBounds()
387 base.UpdateBounds ();
390 protected new void UpdateBounds (int x
, int y
,
391 int width
, int height
)
393 base.UpdateBounds (x
, y
, width
, height
);
397 protected new void UpdateBounds (int x
, int y
, int width
,
398 int height
, int clientWidth
,
401 base.UpdateBounds (x
, y
, width
, height
, clientWidth
,
405 protected override void WndProc(ref Message m
)
407 base.WndProc (ref m
);