2 // System.Windows.Forms.ToolBar
5 // stubbed out by Jackson Harper (jackson@latitudegeo.com)
6 // Dennis Hayes (dennish@Raytek.com)
8 // (C) 2002 Ximian, Inc
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System
.Collections
;
33 using System
.ComponentModel
;
35 namespace System
.Windows
.Forms
{
41 public class ToolBar
: Control
{
42 private Size buttonSize
;
43 private bool dropDownArrows
;
44 private bool showToolTips
;
47 // --- Public Constructors
53 buttonSize
= new Size ( 24, 22 );
54 dropDownArrows
= false;
58 // --- Public Properties
61 public ToolBarAppearance Appearance
{
63 throw new NotImplementedException ();
70 public bool AutoSize
{
72 throw new NotImplementedException ();
79 [EditorBrowsable (EditorBrowsableState
.Never
)]
80 public override Color BackColor
{
81 get { return base.BackColor; }
82 set { base.BackColor = value; }
85 [EditorBrowsable (EditorBrowsableState
.Never
)]
86 public override Image BackgroundImage
{
87 get { return base.BackgroundImage; }
88 set { base.BackgroundImage = value; }
92 public BorderStyle BorderStyle
{
94 throw new NotImplementedException ();
97 throw new NotImplementedException ();
101 public ToolBar
.ToolBarButtonCollection Buttons
{
103 throw new NotImplementedException ();
107 public Size ButtonSize
{
112 if ( value.Width
< 0 || value.Height
< 0 )
113 throw new ArgumentOutOfRangeException( "value" );
119 public bool Divider
{
121 throw new NotImplementedException ();
124 throw new NotImplementedException ();
128 public override DockStyle Dock
{
130 if ( base.Dock
== DockStyle
.Fill
)
131 return DockStyle
.Top
;
140 public bool DropDownArrows
{
142 return dropDownArrows
;
145 dropDownArrows
= value;
149 [EditorBrowsable (EditorBrowsableState
.Never
)]
150 public override Color ForeColor
{
151 get { return base.ForeColor; }
152 set { base.ForeColor = value; }
155 public ImageList ImageList
{
157 throw new NotImplementedException ();
160 throw new NotImplementedException ();
164 public Size ImageSize
{
166 throw new NotImplementedException ();
170 public new ImeMode ImeMode
{
172 throw new NotImplementedException ();
175 throw new NotImplementedException ();
179 public override RightToLeft RightToLeft
{
181 throw new NotImplementedException ();
184 throw new NotImplementedException ();
189 public bool ShowToolTips
{
194 showToolTips
= value;
198 public override string Text
{
207 public ToolBarTextAlign TextAlign
{
209 throw new NotImplementedException ();
212 throw new NotImplementedException ();
216 public bool Wrappable
{
218 throw new NotImplementedException ();
221 throw new NotImplementedException ();
225 // --- Public Methods
228 public override string ToString()
230 throw new NotImplementedException ();
236 public event ToolBarButtonClickEventHandler ButtonClick
;
238 public event ToolBarButtonClickEventHandler ButtonDropDown
;
240 // --- Protected Properties
243 protected override CreateParams CreateParams
{
245 CreateParams createParams
= base.CreateParams
;
247 createParams
.ClassName
= Win32
.TOOLBAR_CLASS
;
248 createParams
.Style
|= (int) WindowStyles
.WS_CHILD
;
253 protected override ImeMode DefaultImeMode
{
255 throw new NotImplementedException ();
259 protected override Size DefaultSize
{
261 return new Size ( 100, 22 );
265 // --- Protected Methods
268 protected override void CreateHandle()
270 initCommonControlsLibrary ( );
275 protected override void Dispose(bool disposing
) {
277 base.Dispose(disposing
);
281 protected virtual void OnButtonClick(ToolBarButtonClickEventArgs e
)
286 protected virtual void OnButtonDropDown(ToolBarButtonClickEventArgs e
)
291 protected override void OnFontChanged(EventArgs e
)
296 protected override void OnHandleCreated(EventArgs e
)
298 base.OnHandleCreated ( e
);
302 protected override void OnResize(EventArgs e
)
307 protected override void SetBoundsCore(int x
, int y
, int width
, int height
, BoundsSpecified specified
)
309 base.SetBoundsCore ( x
, y
, width
, height
, specified
);
312 protected override void WndProc(ref Message m
)
316 private void initCommonControlsLibrary ( ) {
317 if ( !RecreatingHandle
) {
318 INITCOMMONCONTROLSEX initEx
= new INITCOMMONCONTROLSEX();
319 initEx
.dwICC
= CommonControlInitFlags
.ICC_TAB_CLASSES
;
320 Win32
.InitCommonControlsEx(initEx
);
324 public class ToolBarButtonCollection
: IList
, ICollection
, IEnumerable
{
326 // --- Public Constructor
329 public ToolBarButtonCollection(ToolBar owner
)
334 // --- Public Properties
339 throw new NotImplementedException ();
343 public bool IsReadOnly
{
345 throw new NotImplementedException ();
349 public virtual ToolBarButton
this[int index
] {
351 throw new NotImplementedException ();
354 throw new NotImplementedException ();
358 // --- Public Methods
361 public int Add(string text
)
363 throw new NotImplementedException ();
366 public int Add(ToolBarButton button
)
368 throw new NotImplementedException ();
371 public void AddRange(ToolBarButton
[] buttons
)
381 public bool Contains(ToolBarButton button
)
383 throw new NotImplementedException ();
386 public IEnumerator
GetEnumerator()
388 throw new NotImplementedException ();
391 public int IndexOf(ToolBarButton button
)
393 throw new NotImplementedException ();
396 public void Insert(int index
, ToolBarButton button
)
398 throw new NotImplementedException ();
401 //public void Insert(int index, ToolBarButton button) {
402 // throw new NotImplementedException ();
405 public void Remove(ToolBarButton button
)
407 throw new NotImplementedException ();
410 public void RemoveAt(int index
)
412 throw new NotImplementedException ();
415 /// IList Interface implmentation.
417 bool IList
.IsReadOnly
{
419 // We allow addition, removeal, and editing of items after creation of the list.
423 bool IList
.IsFixedSize
{
425 // We allow addition and removeal of items after creation of the list.
431 object IList
.this[int index
]{
433 throw new NotImplementedException ();
436 throw new NotImplementedException ();
442 throw new NotImplementedException ();
446 int IList
.Add( object value){
447 throw new NotImplementedException ();
451 bool IList
.Contains( object value){
452 throw new NotImplementedException ();
456 int IList
.IndexOf( object value){
457 throw new NotImplementedException ();
461 void IList
.Insert(int index
, object value){
462 throw new NotImplementedException ();
466 void IList
.Remove( object value){
467 throw new NotImplementedException ();
471 void IList
.RemoveAt( int index
){
472 throw new NotImplementedException ();
474 // End of IList interface
476 /// ICollection Interface implmentation.
478 int ICollection
.Count
{
480 throw new NotImplementedException ();
483 bool ICollection
.IsSynchronized
{
485 throw new NotImplementedException ();
488 object ICollection
.SyncRoot
{
490 throw new NotImplementedException ();
493 void ICollection
.CopyTo(Array array
, int index
){
494 throw new NotImplementedException ();
496 // End Of ICollection