00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 #ifndef OPTOKEN_BARCREATIONOP
00099
00100 #include "cutop.h"
00101 #include "opdupbar.h"
00102
00103 #define OPTOKEN_BARCREATIONOP _T("BarCreationOp")
00104
00105 #define NEW_BAR 0
00106 #define ONLY_BAR 1
00107 #define REPLACE_SOME_STATES 2
00108
00109 class NodeBarProperty;
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 class CCAPI OpBarCreation: public CarbonCopyOp
00127
00128 {
00129 CC_DECLARE_DYNCREATE( OpBarCreation )
00130
00131 public:
00132
00133 OpBarCreation();
00134 static BOOL Init();
00135 static OpState GetState(String_256*, OpDescriptor*);
00136 virtual void Do(OpDescriptor* token);
00137 void DoWithParam(OpDescriptor* token, OpParam* pOpParam);
00138
00139
00140 Layer * AddLayer(String_256 LayerName, INT32 NewLayerNo);
00141 BOOL ApplyNameAttr(String_256 * pNameAttr, Node * pNode, BOOL UseBarName = TRUE);
00142 void ShiftColourValue(DocColour* pdoccol, INT32 PercentColourChange);
00143 void FindAttribColours(Node * pAttrNode, INT32 PercentColourChange, INT32 State);
00144 BOOL CleanSelection (Range * pSel, List * pSelectionList, List * pDeletionList, INT32 LayerNumToCreate);
00145
00146
00147 BOOL CreateOrEditBar (OpParam* pOpParam);
00148 BOOL CreateFromDefaultState (OpParam* pOpParam);
00149 BOOL CreateBackBarFromSelection (OpParam* pOpParam, BOOL Extend = FALSE);
00150 BOOL CreateBarAndBackBar (OpParam* pOpParam);
00151
00152 void ShowState(INT32 ShowLayer);
00153 INT32 GetBarNumber() {return SliceHelper::GetBarNumberFromBarName(m_BarName);}
00154
00155
00156
00157 private:
00158 String_256 m_RolloverName[5];
00159 String_256 m_BarName;
00160
00161 DocRect m_BarSelectionRect;
00162 DocRect m_FinishedBarRect;
00163
00164 };
00165
00166
00167 class OpParamBarCreation : public OpParam
00168 {
00169
00170
00171 public:
00172 OpParamBarCreation()
00173 {
00174 m_WantMouse = TRUE;
00175 m_WantClicked = FALSE;
00176 m_WantSelected = TRUE;
00177 m_IsVertical = TRUE;
00178 m_SuggestDesign = FALSE;
00179 m_NoOfButtons = 4;
00180 m_WantDefault = TRUE;
00181 m_StateReuse = REPLACE_SOME_STATES;
00182 m_BarName = _T("Bar1");
00183 m_ContinuousBar = FALSE;
00184 m_ButtonsAllSameSize = FALSE;
00185 m_Spacing = 0;
00186 m_FromSelection = TRUE;
00187 m_WantBackBar = FALSE;
00188 m_ExtendFlags = 3;
00189 m_DelExistingState = FALSE;
00190 }
00191
00192 OpParamBarCreation(BOOL WantMouse, BOOL WantClicked, BOOL WantSelected, BOOL WantBackBar, BOOL IsVertical, BOOL SuggestDesign, INT32 NoOfButtons, BOOL WantDefault = TRUE, INT32 StateReuse = REPLACE_SOME_STATES,
00193 INT32 Spacing = 0,
00194 BOOL ContinuousBar = FALSE, BOOL ButtonsAllSameSize = FALSE, String_256 BarName = "Bar1", BOOL FromSelection = TRUE, BYTE ExtendFlags = 3,
00195 BOOL DelExistingState = FALSE)
00196 {
00197 m_WantMouse = WantMouse;
00198 m_WantClicked = WantClicked;
00199 m_WantSelected = WantSelected;
00200 m_IsVertical = IsVertical;
00201 m_SuggestDesign = SuggestDesign;
00202 m_NoOfButtons = NoOfButtons;
00203 m_WantDefault = WantDefault;
00204 m_StateReuse = StateReuse;
00205 m_Spacing = Spacing;
00206 m_BarName = BarName;
00207 m_ContinuousBar = ContinuousBar;
00208 m_ButtonsAllSameSize = ButtonsAllSameSize;
00209 m_FromSelection = FromSelection;
00210 m_WantBackBar = WantBackBar;
00211 m_ExtendFlags = ExtendFlags;
00212 m_DelExistingState = DelExistingState;
00213 }
00214
00215 BOOL m_WantMouse;
00216 BOOL m_WantClicked;
00217 BOOL m_WantSelected;
00218 BOOL m_IsVertical;
00219 BOOL m_SuggestDesign;
00220 BOOL m_ContinuousBar;
00221 BOOL m_ButtonsAllSameSize;
00222 INT32 m_NoOfButtons;
00223 BOOL m_WantDefault;
00224 INT32 m_StateReuse;
00225 String_256 m_BarName;
00226 INT32 m_Spacing;
00227 BOOL m_FromSelection;
00228 BOOL m_WantBackBar;
00229 BYTE m_ExtendFlags;
00230 BOOL m_DelExistingState;
00231 };
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 struct BarDataType
00245 {
00246
00247 BYTE SameSize;
00248 unsigned IsLive : 1;
00249 unsigned IsHorizontal : 1;
00250 unsigned RequiresShuffle : 1;
00251 unsigned ButtonsExtend : 1;
00252 unsigned ButtonsScale : 1;
00253 unsigned GroupsStretch : 1;
00254 INT32 Spacing;
00255
00256 BarDataType()
00257 : SameSize(0), IsLive(1), IsHorizontal(1), RequiresShuffle(1),
00258 ButtonsExtend(1), ButtonsScale(0), GroupsStretch(1), Spacing(0)
00259 { }
00260 };
00261
00262
00263
00264 NodeBarProperty* GetBarData();
00265
00266 #endif // have defined this class before