Mercurial > repos > IBBoard.WarFoundry.GUI.GTK
comparison UIControl/Interfaces/IEditEquipmentUI.cs @ 66:100626381159
Re #60: Add UI to add/remove/edit weapons in GTK
* Rip apart UI controls and put all the common code in a base class
* Add additional interfaces for common UI behaviour between equipment widgets
Not tested, but should provide a base for Replace widget
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 04 Sep 2010 20:11:05 +0000 |
parents | e3fe48c4d794 |
children | 4b82515586ac |
comparison
equal
deleted
inserted
replaced
65:77448375d2f9 | 66:100626381159 |
---|---|
6 namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces | 6 namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces |
7 { | 7 { |
8 /// <summary> | 8 /// <summary> |
9 /// The interface that UI components should implement to represent "Edit Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments) | 9 /// The interface that UI components should implement to represent "Edit Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments) |
10 /// </summary> | 10 /// </summary> |
11 public interface IEditEquipmentUI : IDisposable | 11 public interface IEditEquipmentUI : IBaseEquipmentUI |
12 { | 12 { |
13 /// <summary> | 13 //Marker interface |
14 /// Occurs when the unit equipment amount type changes (e.g. percentage to numeric) | |
15 /// </summary> | |
16 event MethodInvoker UnitEquipmentAmountTypeChanged; | |
17 | |
18 /// <summary> | |
19 /// Occurs when the unit equipment amount changes | |
20 /// </summary> | |
21 event MethodInvoker UnitEquipmentAmountChanged; | |
22 | |
23 /// <summary> | |
24 /// Sets the limits for the currently selected equipment item | |
25 /// </summary> | |
26 /// <param name='isRatioLimit'> | |
27 /// <code>True</code> if the current limit is a ratio limit, else <code>false</code> for absolute limits | |
28 /// </param> | |
29 /// <param name='minPercent'> | |
30 /// The minimum limit as a percentage | |
31 /// </param> | |
32 /// <param name='maxPercent'> | |
33 /// The maximum limit as a percentage | |
34 /// </param> | |
35 /// <param name='minNumber'> | |
36 /// The minimum number as an absolute figure | |
37 /// </param> | |
38 /// <param name='maxNumber'> | |
39 /// The maximum number as an absolute figure | |
40 /// </param> | |
41 void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber); | |
42 | |
43 /// <summary> | |
44 /// Sets whether the unit equipment limit UI components should be enabled and able to accept input. This will | |
45 /// generally pass the values on to the <see cref="SetNumericAmountEnabledState(bool)"/> and | |
46 /// <see cref="SetPercentageAmountEnabledState(bool)"/> methods and is included for convenience | |
47 /// </summary> | |
48 /// <param name='isEnabled'> | |
49 /// <code>True</code> if the UI components should accept input, else <code>false</code> | |
50 /// </param> | |
51 void SetUnitEquipmentLimitsEnabled(bool isEnabled); | |
52 | |
53 /// <summary> | |
54 /// Shows the control and awaits a user action (close or okay) | |
55 /// </summary> | |
56 /// <returns> | |
57 /// <code>true</code> if the control was closed with "Okay", else <code>false</code> | |
58 /// </returns> | |
59 bool ShowControl(); | |
60 | |
61 /// <summary> | |
62 /// Gets a value indicating whether the equipment amount is a ratio or an absolute number. | |
63 /// </summary> | |
64 /// <value> | |
65 /// <c>true</c> if the selected amount is a ratio type (percentage or "all"); otherwise, <c>false</c>. | |
66 /// </value> | |
67 bool IsRatioEquipmentAmount { get; } | |
68 | |
69 /// <summary> | |
70 /// Gets and sets the numeric amount for the current equipment amount. This number is meaningless if <see cref="IsRatioEquipmentAmount"/> is <code>true</code> | |
71 /// </summary> | |
72 /// <value> | |
73 /// The absolue number of items taken. | |
74 /// </value> | |
75 int EquipmentNumericAmount { get; set; } | |
76 | |
77 /// <summary> | |
78 /// Gets and sets the percentage amount for the current equipment amount. This number is meaningless if <see cref="IsRatioEquipmentAmount"/> is <code>false</code> | |
79 /// </summary> | |
80 /// <value> | |
81 /// The number of items taken as a percentage of the unit size. | |
82 /// </value> | |
83 double EquipmentPercentageAmount { get; set; } | |
84 | |
85 /// <summary> | |
86 /// Sets the state of the Okay button. | |
87 /// </summary> | |
88 /// <param name='enabled'> | |
89 /// <code>true</code> to enable the button, else <code>false</code> | |
90 /// </param> | |
91 void SetOkayEnabledState(bool enabled); | |
92 | |
93 /// <summary> | |
94 /// Sets the state of the numeric equipment amount control. | |
95 /// </summary> | |
96 /// <param name='enabled'> | |
97 /// <code>true</code> to enable the control, else <code>false</code> | |
98 /// </param> | |
99 void SetNumericAmountEnabledState(bool enabled); | |
100 | |
101 /// <summary> | |
102 /// Sets the state of the percentage equipment amount control. | |
103 /// </summary> | |
104 /// <param name='enabled'> | |
105 /// <code>true</code> to enable the control, else <code>false</code> | |
106 /// </param> | |
107 void SetPercentageAmountEnabledState(bool enabled); | |
108 } | 14 } |
109 } | 15 } |
110 | 16 |