-
Notifications
You must be signed in to change notification settings - Fork 689
/
KryptonPage.cs
1470 lines (1324 loc) · 53.9 KB
/
KryptonPage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// *****************************************************************************
//
// © Component Factory Pty Ltd 2017. All rights reserved.
// The software and associated documentation supplied hereunder are the
// proprietary information of Component Factory Pty Ltd, 13 Swallows Close,
// Mornington, Vic 3931, Australia and are supplied subject to licence terms.
//
// Version 4.6.0.0 www.ComponentFactory.com
// *****************************************************************************
using System;
using System.IO;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using ComponentFactory.Krypton.Toolkit;
namespace ComponentFactory.Krypton.Navigator
{
/// <summary>
/// Page class used inside visual containers.
/// </summary>
[ToolboxItem(false)]
[ToolboxBitmap(typeof(KryptonPage), "ToolboxBitmaps.KryptonPage.bmp")]
[DefaultEvent("Click")]
[DefaultProperty("Text")]
[Designer("ComponentFactory.Krypton.Navigator.KryptonPageDesigner, ComponentFactory.Krypton.Navigator, Version=4.6.0.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e")]
[DesignerCategory("code")]
[DesignTimeVisible(false)]
public class KryptonPage : VisualPanel
{
#region Instance Fields
private ViewDrawPanel _drawPanel;
private PaletteRedirectDoubleMetric _redirectNavigator;
private PaletteRedirectDoubleMetric _redirectNavigatorHeaderGroup;
private PaletteRedirectTripleMetric _redirectNavigatorHeaderPrimary;
private PaletteRedirectTripleMetric _redirectNavigatorHeaderSecondary;
private PaletteRedirectTripleMetric _redirectNavigatorHeaderBar;
private PaletteRedirectTripleMetric _redirectNavigatorHeaderOverflow;
private PaletteRedirectTriple _redirectNavigatorCheckButton;
private PaletteRedirectTriple _redirectNavigatorOverflowButton;
private PaletteRedirectTriple _redirectNavigatorMiniButton;
private PaletteRedirectTriple _redirectNavigatorTab;
private PaletteRedirectRibbonTabContent _redirectNavigatorRibbonTab;
private PaletteRedirectMetric _redirectNavigatorBar;
private PaletteRedirectDouble _redirectNavigatorPage;
private PaletteRedirectDoubleMetric _redirectNavigatorSeparator;
private PaletteNavigatorRedirect _stateCommon;
private PaletteNavigator _stateDisabled;
private PaletteNavigator _stateNormal;
private PaletteNavigatorOtherEx _stateTracking;
private PaletteNavigatorOtherEx _statePressed;
private PaletteNavigatorOther _stateSelected;
private PaletteNavigatorOtherRedirect _stateFocus;
private NeedPaintHandler _needDisabledPaint;
private NeedPaintHandler _needNormalPaint;
private PageButtonSpecCollection _buttonSpecs;
private BoolFlags31 _flags;
private string _textTitle;
private string _textDescription;
private string _toolTipTitle;
private string _toolTipBody;
private string _uniqueName;
private Image _imageSmall;
private Image _imageMedium;
private Image _imageLarge;
private Image _toolTipImage;
private Color _toolTipImageTransparentColor;
private bool _setVisible;
private LabelStyle _toolTipStyle;
private KryptonContextMenu _kcm;
private Size _autoHiddenSlideSize;
#endregion
#region Events
/// <summary>
/// Occurs when the control is loaded.
/// </summary>
[Category("Page")]
[Description("Occurs when the control is loaded.")]
public event EventHandler Load;
/// <summary>
/// Occurs when an appearance specific page property has changed.
/// </summary>
[Category("Page")]
[Description("Occurs when an appearance specific page property has changed.")]
public event PropertyChangedEventHandler AppearancePropertyChanged;
/// <summary>
/// Occurs when the flags have changed.
/// </summary>
[Category("Page")]
[Description("Occurs when the flags have changed.")]
public event KryptonPageFlagsEventHandler FlagsChanged;
/// <summary>
/// Occurs when the AutoHiddenSlideSize property has changed.
/// </summary>
[Category("Page")]
[Description("Occurs when the auto hidden slide size have changed.")]
public event EventHandler AutoHiddenSlideSizeChanged;
/// <summary>
/// Occurs when the value of the Dock property changes.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new event EventHandler DockChanged;
/// <summary>
/// Occurs when the value of the Location property changes.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new event EventHandler LocationChanged;
/// <summary>
/// Occurs when the value of the TabIndex property changes.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new event EventHandler TabIndexChanged;
/// <summary>
/// Occurs when the value of the TabStop property changes.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new event EventHandler TabStopChanged;
#endregion
#region Identity
/// <summary>
/// Initialize a new instance of the KryptonPage class.
/// </summary>
public KryptonPage()
: this("Page", null)
{
}
/// <summary>
/// Initialize a new instance of the KryptonPage class.
/// </summary>
/// <param name="text">Initial text.</param>
public KryptonPage(string text)
: this(text, null, null)
{
}
/// <summary>
/// Initialize a new instance of the KryptonPage class.
/// </summary>
/// <param name="text">Initial text.</param>
/// <param name="uniqueName">Initial unique name.</param>
public KryptonPage(string text, string uniqueName)
: this(text, null, uniqueName)
{
}
/// <summary>
/// Initialize a new instance of the KryptonPage class.
/// </summary>
/// <param name="text">Initial text.</param>
/// <param name="imageSmall">Initial small image.</param>
/// <param name="uniqueName">Initial unique name.</param>
public KryptonPage(string text, Image imageSmall, string uniqueName)
{
// Default properties
Text = text;
MinimumSize = new Size(50, 50);
_textTitle = "Page Title";
_textDescription = "Page Description";
_toolTipTitle = "Page ToolTip";
_toolTipBody = string.Empty;
_toolTipImage = null;
_toolTipStyle = LabelStyle.ToolTip;
_toolTipImageTransparentColor = Color.Empty;
_imageSmall = imageSmall;
_setVisible = true;
_autoHiddenSlideSize = new Size(200, 200);
_uniqueName = (string.IsNullOrEmpty(uniqueName) ? CommonHelper.UniqueString : uniqueName);
_flags.Flags = (int)(KryptonPageFlags.All);
_flags.ClearFlags((int)KryptonPageFlags.PageInOverflowBarForOutlookMode);
// Create delegates
_needDisabledPaint = new NeedPaintHandler(OnNeedDisabledPaint);
_needNormalPaint = new NeedPaintHandler(OnNeedNormalPaint);
// Create redirector for inheriting from owning navigator
_redirectNavigator = new PaletteRedirectDoubleMetric(Redirector);
_redirectNavigatorPage = new PaletteRedirectDouble(Redirector);
_redirectNavigatorHeaderGroup = new PaletteRedirectDoubleMetric(Redirector);
_redirectNavigatorHeaderPrimary = new PaletteRedirectTripleMetric(Redirector);
_redirectNavigatorHeaderSecondary = new PaletteRedirectTripleMetric(Redirector);
_redirectNavigatorHeaderBar = new PaletteRedirectTripleMetric(Redirector);
_redirectNavigatorHeaderOverflow = new PaletteRedirectTripleMetric(Redirector);
_redirectNavigatorCheckButton = new PaletteRedirectTriple(Redirector);
_redirectNavigatorOverflowButton = new PaletteRedirectTriple(Redirector);
_redirectNavigatorMiniButton = new PaletteRedirectTriple(Redirector);
_redirectNavigatorBar = new PaletteRedirectMetric(Redirector);
_redirectNavigatorSeparator = new PaletteRedirectDoubleMetric(Redirector);
_redirectNavigatorTab = new PaletteRedirectTriple(Redirector);
_redirectNavigatorRibbonTab = new PaletteRedirectRibbonTabContent(Redirector);
// Create the palette storage
_stateCommon = new PaletteNavigatorRedirect(null,
_redirectNavigator,
_redirectNavigatorPage,
_redirectNavigatorHeaderGroup,
_redirectNavigatorHeaderPrimary,
_redirectNavigatorHeaderSecondary,
_redirectNavigatorHeaderBar,
_redirectNavigatorHeaderOverflow,
_redirectNavigatorCheckButton,
_redirectNavigatorOverflowButton,
_redirectNavigatorMiniButton,
_redirectNavigatorBar,
new PaletteRedirectBorder(Redirector),
_redirectNavigatorSeparator,
_redirectNavigatorTab,
_redirectNavigatorRibbonTab,
new PaletteRedirectRibbonGeneral(Redirector),
NeedPaintDelegate);
_stateDisabled = new PaletteNavigator(_stateCommon, _needDisabledPaint);
_stateNormal = new PaletteNavigator(_stateCommon, _needNormalPaint);
_stateTracking = new PaletteNavigatorOtherEx(_stateCommon, _needNormalPaint);
_statePressed = new PaletteNavigatorOtherEx(_stateCommon, _needNormalPaint);
_stateSelected = new PaletteNavigatorOther(_stateCommon, _needNormalPaint);
_stateFocus = new PaletteNavigatorOtherRedirect(_redirectNavigatorCheckButton,
_redirectNavigatorOverflowButton,
_redirectNavigatorMiniButton,
_redirectNavigatorTab,
_redirectNavigatorRibbonTab, _needNormalPaint);
// Our view contains just a simple canvas that covers entire client area
_drawPanel = new ViewDrawPanel(_stateNormal.Page);
// Create page specific button spec storage
_buttonSpecs = new PageButtonSpecCollection(this);
// Create the view manager instance
ViewManager = new ViewManager(this, _drawPanel);
}
/// <summary>
/// Obtains the String representation of this instance.
/// </summary>
/// <returns>User readable name of the instance.</returns>
public override string ToString()
{
return "KryptonPage " + Text;
}
#endregion
#region Public
/// <summary>
/// Gets or sets the palette to be applied.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new PaletteMode PaletteMode
{
[System.Diagnostics.DebuggerStepThrough]
get { return base.PaletteMode; }
set { throw new OperationCanceledException("Cannot change PaletteMode property"); }
}
/// <summary>
/// Gets and sets the custom palette implementation.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new IPalette Palette
{
[System.Diagnostics.DebuggerStepThrough]
get { return base.Palette; }
set { throw new OperationCanceledException("Cannot change PaletteMode property"); }
}
/// <summary>
/// Gets the collection of button specifications.
/// </summary>
[Category("Visuals")]
[Description("Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PageButtonSpecCollection ButtonSpecs
{
get { return _buttonSpecs; }
}
/// <summary>
/// Gets access to the common page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining common page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigatorRedirect StateCommon
{
[System.Diagnostics.DebuggerStepThrough]
get { return _stateCommon; }
}
private bool ShouldSerializeStateCommon()
{
return !StateCommon.IsDefault;
}
/// <summary>
/// Gets access to the disabled page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining disabled page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigator StateDisabled
{
[System.Diagnostics.DebuggerStepThrough]
get { return _stateDisabled; }
}
private bool ShouldSerializeStateDisabled()
{
return !StateDisabled.IsDefault;
}
/// <summary>
/// Gets access to the normal page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining normal page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigator StateNormal
{
[System.Diagnostics.DebuggerStepThrough]
get { return _stateNormal; }
}
private bool ShouldSerializeStateNormal()
{
return !StateNormal.IsDefault;
}
/// <summary>
/// Gets access to the tracking page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining tracking page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigatorOtherEx StateTracking
{
[System.Diagnostics.DebuggerStepThrough]
get { return _stateTracking; }
}
private bool ShouldSerializeStateTracking()
{
return !StateTracking.IsDefault;
}
/// <summary>
/// Gets access to the pressed page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining pressed page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigatorOtherEx StatePressed
{
[System.Diagnostics.DebuggerStepThrough]
get { return _statePressed; }
}
private bool ShouldSerializeStatePressed()
{
return !StatePressed.IsDefault;
}
/// <summary>
/// Gets access to the selected page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining selected page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigatorOther StateSelected
{
[System.Diagnostics.DebuggerStepThrough]
get { return _stateSelected; }
}
private bool ShouldSerializeStateSelected()
{
return !StateSelected.IsDefault;
}
/// <summary>
/// Gets access to the focus page appearance entries.
/// </summary>
[Category("Visuals")]
[Description("Overrides for defining focus page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteNavigatorOtherRedirect OverrideFocus
{
[System.Diagnostics.DebuggerStepThrough]
get { return _stateFocus; }
}
private bool ShouldSerializeOverrideFocus()
{
return !OverrideFocus.IsDefault;
}
/// <summary>
/// Gets and sets the page text.
/// </summary>
[Bindable(true)]
[Browsable(true)]
[Category("Appearance")]
[Description("The page text.")]
[DefaultValue("Page")]
[EditorBrowsable(EditorBrowsableState.Always)]
public override string Text
{
[System.Diagnostics.DebuggerStepThrough]
get { return base.Text; }
set
{
if (base.Text != value)
{
base.Text = value;
OnAppearancePropertyChanged("Text");
}
}
}
/// <summary>
/// Gets and sets the title text for the page.
/// </summary>
[Bindable(true)]
[Localizable(true)]
[Category("Appearance")]
[Description("The title text for the page.")]
[DefaultValue("Page Title")]
public virtual string TextTitle
{
[System.Diagnostics.DebuggerStepThrough]
get { return _textTitle; }
set
{
if (_textTitle != value)
{
_textTitle = value;
OnAppearancePropertyChanged("TextTitle");
}
}
}
/// <summary>
/// Resets the TextTitle property to its default value.
/// </summary>
public void ResetTextTitle()
{
TextTitle = null;
}
/// <summary>
/// Gets and sets the description text for the page.
/// </summary>
[Bindable(true)]
[Localizable(true)]
[Category("Appearance")]
[Description("The description text for the page.")]
[DefaultValue("Page Description")]
public virtual string TextDescription
{
[System.Diagnostics.DebuggerStepThrough]
get { return _textDescription; }
set
{
if (_textDescription != value)
{
_textDescription = value;
OnAppearancePropertyChanged("TextDescription");
}
}
}
/// <summary>
/// Resets the TextDescription property to its default value.
/// </summary>
public void ResetTextDescription()
{
TextDescription = null;
}
/// <summary>
/// Gets and sets the small image for the page.
/// </summary>
[Category("Appearance")]
[Description("The small image that represents the page.")]
[Localizable(true)]
[DefaultValue(null)]
public virtual Image ImageSmall
{
[System.Diagnostics.DebuggerStepThrough]
get { return _imageSmall; }
set
{
if (_imageSmall != value)
{
_imageSmall = value;
OnAppearancePropertyChanged("ImageSmall");
}
}
}
/// <summary>
/// Resets the ImageSmall property to its default value.
/// </summary>
public void ResetImageSmall()
{
ImageSmall = null;
}
/// <summary>
/// Gets and sets the medium image for the page.
/// </summary>
[Category("Appearance")]
[Description("The medium image that represents the page.")]
[Localizable(true)]
[DefaultValue(null)]
public virtual Image ImageMedium
{
[System.Diagnostics.DebuggerStepThrough]
get { return _imageMedium; }
set
{
if (_imageMedium != value)
{
_imageMedium = value;
OnAppearancePropertyChanged("ImageMedium");
}
}
}
/// <summary>
/// Resets the ImageMedium property to its default value.
/// </summary>
public void ResetImageMedium()
{
ImageMedium = null;
}
/// <summary>
/// Gets and sets the large image for the page.
/// </summary>
[Category("Appearance")]
[Description("The large image that represents the page.")]
[Localizable(true)]
[DefaultValue(null)]
public virtual Image ImageLarge
{
[System.Diagnostics.DebuggerStepThrough]
get { return _imageLarge; }
set
{
if (_imageLarge != value)
{
_imageLarge = value;
OnAppearancePropertyChanged("ImageLarge");
}
}
}
/// <summary>
/// Resets the ImageLarge property to its default value.
/// </summary>
public void ResetImageLarge()
{
ImageLarge = null;
}
/// <summary>
/// Gets and sets the page tooltip image.
/// </summary>
[Localizable(true)]
[Category("Appearance")]
[Description("Page tooltip image.")]
[DefaultValue(null)]
public virtual Image ToolTipImage
{
get { return _toolTipImage; }
set
{
if (_toolTipImage != value)
{
_toolTipImage = value;
OnAppearancePropertyChanged("ToolTipImage");
}
}
}
private bool ShouldSerializeToolTipImage()
{
return ToolTipImage != null;
}
/// <summary>
/// Resets the ToolTipImage property to its default value.
/// </summary>
public void ResetToolTipImage()
{
ToolTipImage = null;
}
/// <summary>
/// Gets and sets the tooltip image transparent color.
/// </summary>
[Localizable(true)]
[Category("Appearance")]
[Description("Page tooltip image transparent color.")]
[KryptonDefaultColorAttribute()]
public virtual Color ToolTipImageTransparentColor
{
get { return _toolTipImageTransparentColor; }
set
{
if (_toolTipImageTransparentColor != value)
{
_toolTipImageTransparentColor = value;
OnAppearancePropertyChanged("ToolTipImageTransparentColor");
}
}
}
private bool ShouldSerializeToolTipImageTransparentColor()
{
return ToolTipImageTransparentColor != Color.Empty;
}
/// <summary>
/// Resets the ToolTipImageTransparentColor property to its default value.
/// </summary>
public void ResetToolTipImageTransparentColor()
{
ToolTipImageTransparentColor = Color.Empty;
}
/// <summary>
/// Gets and sets the page tooltip title text.
/// </summary>
[Localizable(true)]
[Category("Appearance")]
[Description("Page tooltip title text.")]
[Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[DefaultValue("")]
public virtual string ToolTipTitle
{
get { return _toolTipTitle; }
set
{
if (_toolTipTitle != value)
{
_toolTipTitle = value;
OnAppearancePropertyChanged("ToolTipTitle");
}
}
}
private bool ShouldSerializeToolTipTitle()
{
return ToolTipTitle != string.Empty;
}
/// <summary>
/// Resets the ToolTipTitle property to its default value.
/// </summary>
public void ResetToolTipTitle()
{
ToolTipTitle = string.Empty;
}
/// <summary>
/// Gets and sets the page tooltip body text.
/// </summary>
[Localizable(true)]
[Category("Appearance")]
[Description("Page tooltip body text.")]
[Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[DefaultValue("")]
public virtual string ToolTipBody
{
get { return _toolTipBody; }
set
{
if (_toolTipBody != value)
{
_toolTipBody = value;
OnAppearancePropertyChanged("ToolTipBody");
}
}
}
private bool ShouldSerializeToolTipBody()
{
return ToolTipBody != string.Empty;
}
/// <summary>
/// Resets the ToolTipBody property to its default value.
/// </summary>
public void ResetToolTipBody()
{
ToolTipBody = string.Empty;
}
/// <summary>
/// Gets and sets the tooltip label style.
/// </summary>
[Category("Appearance")]
[Description("Page tooltip label style.")]
[DefaultValue(typeof(LabelStyle), "ToolTip")]
public virtual LabelStyle ToolTipStyle
{
get { return _toolTipStyle; }
set
{
if (_toolTipStyle != value)
{
_toolTipStyle = value;
OnAppearancePropertyChanged("ToolTipStyle");
}
}
}
private bool ShouldSerializeToolTipStyle()
{
return ToolTipStyle != LabelStyle.ToolTip;
}
/// <summary>
/// Resets the ToolTipStyle property to its default value.
/// </summary>
public void ResetToolTipStyle()
{
ToolTipStyle = LabelStyle.ToolTip;
}
/// <summary>
/// Gets and sets the KryptonContextMenu to show when right clicked.
/// </summary>
[Category("Behavior")]
[Description("The shortcut menu to show when the user right-clicks the page.")]
[DefaultValue(null)]
public virtual KryptonContextMenu KryptonContextMenu
{
get { return _kcm; }
set
{
if (_kcm != value)
{
if (_kcm != null)
_kcm.Disposed += new EventHandler(OnKryptonContextMenuDisposed);
_kcm = value;
if (_kcm != null)
_kcm.Disposed -= new EventHandler(OnKryptonContextMenuDisposed);
}
}
}
/// <summary>
/// Gets and sets the unique name of the page.
/// </summary>
[Category("Appearance")]
[Description("The unique name of the page.")]
public virtual string UniqueName
{
[System.Diagnostics.DebuggerStepThrough]
get { return _uniqueName; }
[System.Diagnostics.DebuggerStepThrough]
set { _uniqueName = value; }
}
/// <summary>
/// Resets the UniqueName property to its default value.
/// </summary>
public void ResetUniqueName()
{
UniqueName = CommonHelper.UniqueString;
}
/// <summary>
/// Fix the control to a particular palette state.
/// </summary>
/// <param name="state">Palette state to fix.</param>
public virtual void SetFixedState(PaletteState state)
{
// Request fixed state from the view
_drawPanel.FixedState = state;
}
/// <summary>
/// Gets and sets the preferred size for the page when inside an auto hidden slide panel.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
public virtual Size AutoHiddenSlideSize
{
get { return _autoHiddenSlideSize; }
set
{
if (_autoHiddenSlideSize != value)
{
_autoHiddenSlideSize = value;
OnAutoHiddenSlideSizeChanged(EventArgs.Empty);
}
}
}
/// <summary>
/// Define the state to use when inheriting state values.
/// </summary>
/// <param name="alignControl">Control to use when aligning rectangles.</param>
/// <param name="common">State palette for inheriting common values.</param>
/// <param name="disabled">State palette for inheriting disabled values.</param>
/// <param name="normal">State palette for inheriting normal values.</param>
/// <param name="tracking">State palette for inheriting tracking values.</param>
/// <param name="pressed">State palette for inheriting pressed values.</param>
/// <param name="selected">State palette for inheriting selected values.</param>
/// <param name="focus">State palette for inheriting focus values.</param>
public virtual void SetInherit(Control alignControl,
PaletteNavigatorRedirect common,
PaletteNavigator disabled,
PaletteNavigator normal,
PaletteNavigatorOtherEx tracking,
PaletteNavigatorOtherEx pressed,
PaletteNavigatorOther selected,
PaletteNavigatorOtherRedirect focus)
{
ViewManager.AlignControl = alignControl;
// Setup the redirection states
_redirectNavigator.SetRedirectStates(disabled, disabled, normal, normal);
_redirectNavigatorPage.SetRedirectStates(disabled.PalettePage, normal.PalettePage);
_redirectNavigatorHeaderGroup.SetRedirectStates(disabled.HeaderGroup, disabled.HeaderGroup, normal.HeaderGroup, normal.HeaderGroup);
_redirectNavigatorHeaderPrimary.SetRedirectStates(disabled.HeaderGroup.HeaderPrimary, disabled.HeaderGroup.HeaderPrimary, normal.HeaderGroup.HeaderPrimary, normal.HeaderGroup.HeaderPrimary);
_redirectNavigatorHeaderSecondary.SetRedirectStates(disabled.HeaderGroup.HeaderSecondary, disabled.HeaderGroup.HeaderSecondary, normal.HeaderGroup.HeaderSecondary, normal.HeaderGroup.HeaderSecondary);
_redirectNavigatorHeaderBar.SetRedirectStates(disabled.HeaderGroup.HeaderBar, disabled.HeaderGroup.HeaderBar, normal.HeaderGroup.HeaderBar, normal.HeaderGroup.HeaderBar);
_redirectNavigatorHeaderOverflow.SetRedirectStates(disabled.HeaderGroup.HeaderOverflow, disabled.HeaderGroup.HeaderOverflow, normal.HeaderGroup.HeaderOverflow, normal.HeaderGroup.HeaderOverflow);
_redirectNavigatorCheckButton.SetRedirectStates(disabled.CheckButton, normal.CheckButton, pressed.CheckButton, tracking.CheckButton, selected.CheckButton, selected.CheckButton, selected.CheckButton, focus.CheckButton, null);
_redirectNavigatorOverflowButton.SetRedirectStates(disabled.OverflowButton, normal.OverflowButton, pressed.OverflowButton, tracking.OverflowButton, selected.OverflowButton, selected.OverflowButton, selected.OverflowButton, focus.OverflowButton, null);
_redirectNavigatorMiniButton.SetRedirectStates(disabled.MiniButton, normal.MiniButton, pressed.MiniButton, tracking.MiniButton, selected.MiniButton, selected.MiniButton, selected.MiniButton, focus.MiniButton, null);
_redirectNavigatorBar.SetRedirectStates(common.Bar, common.Bar);
_redirectNavigatorSeparator.SetRedirectStates(disabled.Separator, disabled.Separator, normal.Separator, normal.Separator, pressed.Separator, pressed.Separator, tracking.Separator, tracking.Separator);
_redirectNavigatorTab.SetRedirectStates(disabled.Tab, normal.Tab, pressed.Tab, tracking.Tab, selected.Tab, selected.Tab, selected.Tab, focus.Tab, null);
_redirectNavigatorRibbonTab.SetRedirectStates(disabled.RibbonTab, normal.RibbonTab, pressed.RibbonTab, tracking.RibbonTab, selected.RibbonTab, focus.RibbonTab);
_stateCommon.RedirectBorderEdge = new PaletteRedirectBorderEdge(Redirector, disabled.BorderEdge, normal.BorderEdge);
_stateCommon.RedirectRibbonGeneral = new PaletteRedirectRibbonGeneral(Redirector);
}
/// <summary>
/// Reset the state palettes so they no longer inherit from external source.
/// </summary>
/// <param name="alignControl">Only if inherited values are still the same as when the aligned control was set are they reset.</param>
public virtual void ResetInherit(Control alignControl)
{
if (alignControl == ViewManager.AlignControl)
{
ViewManager.AlignControl = this;
// Clear down the redirection states
_redirectNavigator.ResetRedirectStates();
_redirectNavigatorPage.ResetRedirectStates();
_redirectNavigatorHeaderGroup.ResetRedirectStates();
_redirectNavigatorHeaderPrimary.ResetRedirectStates();
_redirectNavigatorHeaderSecondary.ResetRedirectStates();
_redirectNavigatorHeaderBar.ResetRedirectStates();
_redirectNavigatorHeaderOverflow.ResetRedirectStates();
_redirectNavigatorCheckButton.ResetRedirectStates();
_redirectNavigatorOverflowButton.ResetRedirectStates();
_redirectNavigatorMiniButton.ResetRedirectStates();
_redirectNavigatorBar.ResetRedirectStates();
_redirectNavigatorSeparator.ResetRedirectStates();
_redirectNavigatorTab.ResetRedirectStates();
_redirectNavigatorRibbonTab.ResetRedirectStates();
_stateCommon.RedirectBorderEdge = new PaletteRedirectBorder(Redirector);
_stateCommon.RedirectRibbonGeneral = new PaletteRedirectRibbonGeneral(Redirector);
}
}
/// <summary>
/// Gets or sets the background color for the control.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override Color BackColor
{
get { return base.BackColor; }
set { base.BackColor = value; }
}
/// <summary>
/// Gets or sets which edges of the control are anchored to the edges of its container.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override AnchorStyles Anchor
{
get { return base.Anchor; }
set { base.Anchor = value; }
}
/// <summary>
/// Gets or sets a value indicating whether the control is automatically resized to display its entire contents.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool AutoSize
{
get { return base.AutoSize; }
set { base.AutoSize = value; }
}
/// <summary>
/// Gets or sets the size of the control.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public new Size Size
{
get { return base.Size; }
set { base.Size = value; }
}
/// <summary>
/// Gets or sets a value indicating whether the control is automatically resized to display its entire contents.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override AutoSizeMode AutoSizeMode
{
get { return base.AutoSizeMode; }
set { base.AutoSizeMode = value; }
}
/// <summary>
/// Gets or sets which edge of the parent container a control is docked to.
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override DockStyle Dock
{
get { return base.Dock; }
set { base.Dock = value; }
}
/// <summary>
/// Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container.
/// </summary>
[Browsable(false)]
[Bindable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Point Location