Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.GTK
comparison UIControl/Interfaces/IEditEquipmentUI.cs @ 64:e3fe48c4d794
Re #60: Add UI to add/remove/edit weapons in GTK
* Add most of basic "edit" interface, based on "add" interface
TODO:
* Set initial values
* Warn when setting to 0
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Thu, 02 Sep 2010 20:12:21 +0000 |
parents | |
children | 100626381159 |
comparison
equal
deleted
inserted
replaced
63:c2d79b4209e3 | 64:e3fe48c4d794 |
---|---|
1 // This file (IEditEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard | |
2 // | |
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. | |
4 using System; | |
5 using IBBoard.WarFoundry.API.Objects; | |
6 namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces | |
7 { | |
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) | |
10 /// </summary> | |
11 public interface IEditEquipmentUI : IDisposable | |
12 { | |
13 /// <summary> | |
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 } | |
109 } | |
110 |