00001 // $Id: linwthop.cpp 1282 2006-06-09 09:46:49Z alex $ 00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00003 ================================XARAHEADERSTART=========================== 00004 00005 Xara LX, a vector drawing and manipulation program. 00006 Copyright (C) 1993-2006 Xara Group Ltd. 00007 Copyright on certain contributions may be held in joint with their 00008 respective authors. See AUTHORS file for details. 00009 00010 LICENSE TO USE AND MODIFY SOFTWARE 00011 ---------------------------------- 00012 00013 This file is part of Xara LX. 00014 00015 Xara LX is free software; you can redistribute it and/or modify it 00016 under the terms of the GNU General Public License version 2 as published 00017 by the Free Software Foundation. 00018 00019 Xara LX and its component source files are distributed in the hope 00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00022 See the GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with Xara LX (see the file GPL in the root directory of the 00026 distribution); if not, write to the Free Software Foundation, Inc., 51 00027 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00028 00029 00030 ADDITIONAL RIGHTS 00031 ----------------- 00032 00033 Conditional upon your continuing compliance with the GNU General Public 00034 License described above, Xara Group Ltd grants to you certain additional 00035 rights. 00036 00037 The additional rights are to use, modify, and distribute the software 00038 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00039 library and any other such library that any version of Xara LX relased 00040 by Xara Group Ltd requires in order to compile and execute, including 00041 the static linking of that library to XaraLX. In the case of the 00042 "CDraw" library, you may satisfy obligation under the GNU General Public 00043 License to provide source code by providing a binary copy of the library 00044 concerned and a copy of the license accompanying it. 00045 00046 Nothing in this section restricts any of the rights you have under 00047 the GNU General Public License. 00048 00049 00050 SCOPE OF LICENSE 00051 ---------------- 00052 00053 This license applies to this program (XaraLX) and its constituent source 00054 files only, and does not necessarily apply to other Xara products which may 00055 in part share the same code base, and are subject to their own licensing 00056 terms. 00057 00058 This license does not apply to files in the wxXtra directory, which 00059 are built into a separate library, and are subject to the wxWindows 00060 license contained within that directory in the file "WXXTRA-LICENSE". 00061 00062 This license does not apply to the binary libraries (if any) within 00063 the "libs" directory, which are subject to a separate license contained 00064 within that directory in the file "LIBS-LICENSE". 00065 00066 00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00068 ---------------------------------------------- 00069 00070 Subject to the terms of the GNU Public License (see above), you are 00071 free to do whatever you like with your modifications. However, you may 00072 (at your option) wish contribute them to Xara's source tree. You can 00073 find details of how to do this at: 00074 http://www.xaraxtreme.org/developers/ 00075 00076 Prior to contributing your modifications, you will need to complete our 00077 contributor agreement. This can be found at: 00078 http://www.xaraxtreme.org/developers/contribute/ 00079 00080 Please note that Xara will not accept modifications which modify any of 00081 the text between the start and end of this header (marked 00082 XARAHEADERSTART and XARAHEADEREND). 00083 00084 00085 MARKS 00086 ----- 00087 00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00089 designs are registered or unregistered trademarks, design-marks, and/or 00090 service marks of Xara Group Ltd. All rights in these marks are reserved. 00091 00092 00093 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00094 http://www.xara.com/ 00095 00096 =================================XARAHEADEREND============================ 00097 */ 00098 /* 00099 //*/ 00100 00101 // Implementation of the OpChangeLineWidthOpDesc 00102 00103 #include "camtypes.h" 00104 #include "linwthop.h" 00105 //#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 #include "lineattr.h" 00107 //#include "document.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00108 //#include "convert.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00109 #include "attrappl.h" 00110 //#include "mario.h" 00111 //#include "simon.h" 00112 //#include "bars.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00113 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00114 //#include "selmsg.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00115 //#include "range.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00116 //#include "attrmgr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00117 //#include "tool.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00118 #include <limits.h> 00119 //#include "selmsg.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00120 //#include "assoc.h" 00121 00122 // There is no maximum line width. We set it to a large positive INT32 value 00123 #define MAX_LINE_WIDTH_MP 2834646 // 1 metre 00124 00125 #define new CAM_DEBUG_NEW 00126 00127 00128 /******************************************************************************************** 00129 00130 > OpChangeLineWidthOpDesc::OpChangeLineWidthOpDesc( 00131 UINT32 toolID, 00132 UINT32 txID, 00133 CCRuntimeClass* Op, 00134 TCHAR* tok, 00135 pfnGetState gs, 00136 UINT32 helpId = 0, 00137 UINT32 bubbleID = 0, 00138 UINT32 resourceID = 0, 00139 UINT32 controlID = 0, 00140 BOOL ReceiveMessages = TRUE, 00141 BOOL Smart = FALSE, 00142 BOOL Clean = FALSE 00143 ): 00144 00145 00146 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00147 Created: 3/6/94 00148 Inputs: - 00149 Outputs: - 00150 Returns: - 00151 Purpose: Simply calls the UndoableOpDescriptor::UndoableOpDescriptor base class 00152 Errors: - 00153 SeeAlso: UndoableOpDescriptor::UndoableOpDescriptor 00154 00155 ********************************************************************************************/ 00156 00157 OpChangeLineWidthOpDesc::OpChangeLineWidthOpDesc( UINT32 toolID, 00158 UINT32 txID, 00159 CCRuntimeClass* Op, 00160 TCHAR* tok, 00161 pfnGetState gs, 00162 UINT32 helpId, 00163 UINT32 bubbleID, 00164 UINT32 resourceID, 00165 UINT32 controlID, 00166 BOOL ReceiveMessages, 00167 BOOL Smart, 00168 BOOL Clean 00169 ) 00170 :UndoableOpDescriptor(toolID, txID, Op, tok, gs, helpId, bubbleID, 00171 resourceID, controlID, ReceiveMessages, Smart, Clean, 0, 0 /*GREY_WHEN_NO_CURRENT_DOC*/) 00172 00173 { 00174 00175 } 00176 00177 /******************************************************************************************** 00178 00179 BOOL OpChangeLineWidthOpDesc::SetCurrentSelWidth() 00180 00181 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00182 Created: 10/6/94 00183 Outputs: - 00184 Returns: FALSE if we run out of memory 00185 Purpose: Sets the currently selected line width value. 00186 00187 If no objects are selected, or no selected objects require a line width 00188 attribute then the current line width attribute for the tool is displayed. 00189 00190 If all selected objects (which require a line width) share the same line 00191 width attribute then this is displayed. 00192 00193 if the selected objects have more than one line width value then the 00194 string 'MANY' is displayed. 00195 00196 Errors: ERROR is set if we run out of memory 00197 Scope: private 00198 SeeAlso: - 00199 00200 ********************************************************************************************/ 00201 00202 BOOL OpChangeLineWidthOpDesc::SetCurrentSelWidth() 00203 { 00204 // This check should not be neccessary ! (It is a bodge, there should always be a 00205 // current tool, however at the moment it can be NULL ?? 00206 if (Tool::GetCurrent() != NULL) 00207 { 00208 00209 if (Document::GetCurrent() != NULL) 00210 { 00211 //AttrLineWidth* LineAttr; 00212 NodeAttribute* LineAttr; 00213 NodeAttribute* LineColour; 00214 00215 // Determine if there is a common attribute (line width) 00216 SelRange::CommonAttribResult Result = GetApplication()->FindSelection()-> 00217 FindCommonAttribute(CC_RUNTIME_CLASS(AttrLineWidth), 00218 &LineAttr); 00219 00220 String_256 StrLinWidth; 00221 00222 switch (Result) 00223 { 00224 case SelRange::ATTR_COMMON: 00225 // noparachute 00226 case SelRange::ATTR_NONE: 00227 { 00228 // When ATTR_NODE LineAttr will be the current line width attribute 00229 00230 if (LineAttr == NULL) // There is "no" line width currently 00231 return(TRUE); // - but it is not an error, so return TRUE 00232 00233 ENSURE(LineAttr->GetRuntimeClass() == CC_RUNTIME_CLASS(AttrLineWidth), 00234 "LineAttr of wrong type"); 00235 00236 SelRange *pSel = GetApplication()->FindSelection(); 00237 00238 // set to NO_COLOUR, but only if all the line colours are transparent 00239 00240 // Determine if there is a common attribute (colour) 00241 pSel->FindCommonAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), &LineColour); 00242 00243 if ((LineColour != NULL) && 00244 ((AttrStrokeColour*)LineColour)->GetStartColour()->IsTransparent()) 00245 StrLinWidth = String_8(_R(IDS_NONE)); // there is a common attr and it's transparent 00246 else 00247 { 00248 // go through the selection and search the applied 00249 // line colour attributes for a transparent one 00250 00251 Node *pNode = pSel->FindFirst(); 00252 00253 while (pNode != NULL) 00254 { 00255 NodeAttribute *pAppliedAttr = NULL; 00256 00257 // find the applied line colour for this node 00258 if (pNode->IS_KIND_OF(NodeRenderableInk)) 00259 ((NodeRenderableInk *)pNode)->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), &pAppliedAttr); 00260 00261 // then check if it's transparent 00262 if ((pAppliedAttr) && 00263 ((AttrStrokeColour*)pAppliedAttr)->GetStartColour()->IsTransparent()) 00264 break; // found a transparent applied attr 00265 00266 // go to the next one 00267 pNode = pSel->FindNext(pNode); 00268 } 00269 00270 if (pNode != NULL) 00271 { 00272 // found a transparent attr, but not all are transparent, so set to 'Many' 00273 StrLinWidth = String_8(_R(IDS_MANY)); 00274 } 00275 else 00276 { 00277 // set the common line width 00278 00279 // Find the current line width attribute 00280 MILLIPOINT LineWidth = ((AttrLineWidth*)LineAttr)->Value.LineWidth; 00281 00282 // Convert the line width to a string using default number of decimal places 00283 Convert::MillipointsToString(LineWidth, COMP_POINTS, &StrLinWidth); 00284 } 00285 } 00286 00287 break; 00288 } 00289 case SelRange::ATTR_MANY: // it's either "many" or "none" 00290 { 00291 StrLinWidth = String_8(_R(IDS_MANY)); 00292 00293 // get the colour selection 00294 SelRange::CommonAttribResult Result = GetApplication()->FindSelection()-> 00295 FindCommonAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), 00296 &LineColour); 00297 00298 // only one colour and it has to be transparent 00299 if (( (Result == SelRange::ATTR_NONE) || (Result == SelRange::ATTR_COMMON)) && 00300 (((AttrStrokeColour*)LineColour)->GetStartColour()->IsTransparent())) 00301 { 00302 // ok, so it's "none" 00303 StrLinWidth = String_8(_R(IDS_NONE)); 00304 } 00305 break; 00306 } 00307 } 00308 00309 // Set the string in all gadgets associated with the OpDescriptor 00310 if (!SetStringInGadgets(StrLinWidth)) 00311 return FALSE; 00312 } 00313 else 00314 { 00315 // There is no document so blank all gadgets 00316 String_256 dummy; 00317 if (!SetStringInGadgets(dummy)) 00318 return FALSE; 00319 } 00320 00321 } // end bodge if 00322 return TRUE; 00323 } 00324 00325 00326 /******************************************************************************************** 00327 00328 > BOOL OpChangeLineWidthOpDesc::SetStringInGadgets(String_256& Str) 00329 00330 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00331 Created: 24/4/95 00332 Inputs: Str: The string to set in all line width combo's 00333 Outputs: - 00334 Returns: FALSE if we run out of memory 00335 00336 Purpose: This function finds all gadgets associated with the OpDescriptor and sets 00337 the edit field in the gadgets to Str. 00338 Errors: - 00339 Scope: private 00340 SeeAlso: - 00341 00342 ********************************************************************************************/ 00343 00344 BOOL OpChangeLineWidthOpDesc::SetStringInGadgets(String_256& Str) 00345 { 00346 // Create a list for the dialogue manager to put gadget ID's on. 00347 List* pGadgetList = new List; 00348 if (pGadgetList == 0) 00349 { 00350 InformError(_R(IDE_NOMORE_MEMORY)); 00351 return FALSE; 00352 } 00353 00354 // Obtain a list of all line width controls 00355 if (BuildGadgetList(pGadgetList)) 00356 { 00357 00358 GadgetListItem* GadgetItem; 00359 for (GadgetItem = (GadgetListItem*) pGadgetList->GetHead(); 00360 GadgetItem != 0; 00361 GadgetItem = (GadgetListItem*) pGadgetList->GetNext(GadgetItem)) 00362 { 00363 00364 // If the gadget has no items in its list then initialise it now 00365 InitialiseControl(GadgetItem->pDialogOp, GadgetItem->gidGadgetID); 00366 00367 GadgetItem->pDialogOp->SetStringGadgetValue(GadgetItem->gidGadgetID, 00368 Str, 00369 FALSE, 00370 -1); 00371 } 00372 } 00373 pGadgetList->DeleteAll(); 00374 delete pGadgetList; 00375 00376 return TRUE; 00377 } 00378 00379 00380 00381 /******************************************************************************************** 00382 00383 > BOOL OpChangeLineWidthOpDesc::SetLineWidthGadgets(String_256& Str) 00384 00385 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00386 Created: 24/4/95 00387 Inputs: Str: The string to set in all line width combo's 00388 Outputs: - 00389 Returns: FALSE if we run out of memory 00390 00391 Purpose: public interface to SetStringInGadget 00392 Errors: - 00393 Scope: public 00394 SeeAlso: - 00395 00396 ********************************************************************************************/ 00397 00398 BOOL OpChangeLineWidthOpDesc::SetLineWidthGadgets(String_256& Str) 00399 { 00400 return SetStringInGadgets(Str); 00401 } 00402 00403 /******************************************************************************************** 00404 00405 virtual void OpChangeLineWidthOpDesc::OnControlCreate(OpDescControlCreateMsg* CreateMsg); 00406 00407 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00408 Created: 10/6/94 00409 Inputs: - 00410 Outputs: - 00411 Returns: - 00412 Purpose: This function is called whenever a combo control associated with the 00413 ` OpDescriptor gets created. 00414 Errors: - 00415 SeeAlso: - 00416 00417 ********************************************************************************************/ 00418 00419 // Function to initialise the Combo with line widths 00420 void OpChangeLineWidthOpDesc::OnControlCreate(OpDescControlCreateMsg* CreateMsg) 00421 { 00422 SetCurrentSelWidth(); 00423 } 00424 00425 /******************************************************************************************** 00426 00427 > void OpChangeLineWidthOpDesc::InitialiseControl(DialogOp* pDialogOp, CGadgetID GadgetID) 00428 00429 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00430 Created: 24/4/95 00431 Inputs: pDlg: The bar 00432 SetGadgetID: The gadget on the bar to initialise 00433 Outputs: - 00434 Returns: - 00435 Purpose: This function checks to see if the combo's list has been initialised. 00436 if it has not then we add the list items 00437 Errors: - 00438 SeeAlso: - 00439 00440 ********************************************************************************************/ 00441 00442 void OpChangeLineWidthOpDesc::InitialiseControl(DialogOp* pDlg, CGadgetID SetGadgetID) 00443 { 00444 // We don't do anything if a Document does not exist 00445 if (Document::GetCurrent() != NULL) 00446 { 00447 // Does the combo's list need to be initialised ? 00448 INT32 NumItems = 0; 00449 00450 pDlg->GetValueCount(SetGadgetID, &NumItems); 00451 if (NumItems == 0) // combo has not been initialised. 00452 { 00453 // Make sure decimal points are localised. 00454 String_8 str025pt(TEXT("0.25pt")), str05pt(TEXT("0.5pt")); 00455 if (Convert::GetDecimalPointChar() != '.') 00456 { 00457 Convert::ReplaceDecimalPoint(&str025pt); 00458 Convert::ReplaceDecimalPoint(&str05pt); 00459 } 00460 00461 // Fill up the gadget combo-box. 00462 String_256 s; 00463 s=_R(IDS_NONE); pDlg->SetStringGadgetValue(SetGadgetID, s); 00464 pDlg->SetStringGadgetValue(SetGadgetID, str025pt); 00465 pDlg->SetStringGadgetValue(SetGadgetID, str05pt); 00466 s=_T("1pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00467 s=_T("2pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00468 s=_T("4pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00469 s=_T("8pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00470 s=_T("12pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00471 s=_T("16pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00472 s=_T("24pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00473 s=_T("36pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00474 s=_T("48pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00475 s=_T("72pt"); pDlg->SetStringGadgetValue(SetGadgetID, s); 00476 00477 // Set the default line width units 00478 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 250); // 0.25pt 00479 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 500); // 0.5pt 00480 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 1000); // 1pt 00481 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 2000); // 2pt 00482 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 4000); // 4t 00483 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 8000); // 8pt 00484 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 12000); // 12pt 00485 //pDlg->SetUnitGadgetValue(SetGadgetID, COMP_POINTS, 16000); // 16pt 00486 00487 pDlg->SetComboListLength(SetGadgetID); 00488 } 00489 } 00490 } 00491 00492 00493 /******************************************************************************************** 00494 00495 > virtual void OpChangeLineWidthOpDesc::OnSelectionChange(OpDescControlMsg* SelChangedMsg, 00496 List* GadgetList) 00497 00498 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00499 Created: 10/6/94 00500 Inputs: - 00501 Outputs: - 00502 Returns: - 00503 Purpose: This function gets called whenever a selection is made from a combo 00504 box. It invokes the operation to set the line width. 00505 Errors: - 00506 SeeAlso: - 00507 00508 ********************************************************************************************/ 00509 00510 00511 // Function to handle a selection from the combo 00512 void OpChangeLineWidthOpDesc::OnSelectionChange(OpDescControlMsg* SelChangedMsg, 00513 List* GadgetList) 00514 { 00515 DialogOp* pDlg = SelChangedMsg->pDlgOp; 00516 CGadgetID SetGadgetID = SelChangedMsg->SetGadgetID; 00517 00518 BOOL Valid; 00519 00520 // First check whether it's "none" or not 00521 String_256 str; 00522 str = pDlg->GetStringGadgetValue(SetGadgetID, &Valid, -1); 00523 00524 if (str.IsIdentical(String_8(_R(IDS_NONE)))) // it's "none" => no colour 00525 { 00526 // create a new attribute 00527 NodeAttribute *Attr = NULL; 00528 DocColour ColourToApply(COLOUR_TRANS); 00529 00530 Attr = new AttrStrokeColourChange(TRUE); 00531 if (Attr == NULL) 00532 return; 00533 00534 ((AttrStrokeColourChange *)Attr)->SetStartColour(&ColourToApply); 00535 00536 if (Attr == NULL) 00537 return; 00538 00539 // AttributeSelected knows what to do with a selected attribute 00540 AttributeManager::AttributeSelected(NULL,Attr); 00541 } 00542 else // it's another value 00543 { 00544 00545 // Obtain the value entered in the dialog 00546 MILLIPOINT LineWidth = 00547 pDlg->GetUnitGadgetValue(SetGadgetID, COMP_POINTS, 0, MAX_LINE_WIDTH_MP, 00548 _R(IDS_NOT_VALID_LINE_WIDTH), &Valid); 00549 00550 // Has a valid value been entered ? 00551 if (Valid) 00552 { 00553 // Create a new line width NodeAttribute 00554 AttrLineWidth* Attr = new AttrLineWidth(); 00555 00556 if (Attr == NULL) 00557 return; 00558 00559 Attr->Value.LineWidth = LineWidth; 00560 00561 // AttributeSelected knows what to do with a selected attribute 00562 AttributeManager::AttributeSelected(Attr); 00563 } 00564 } 00565 00566 // Update all Combos 00567 // Note we must do this even if we have just set a new attribute, as a SelChanging message will not be 00568 // always be broadcast. 00569 SetCurrentSelWidth(); // Reset to the selection 00570 } 00571 00572 00573 /******************************************************************************************** 00574 00575 > virtual BOOL OpChangeLineWidthOpDesc::OnSelChangingMsg(SelChangingMsg::SelectionState State) 00576 00577 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00578 Created: 6/7/94 00579 Returns: FALSE if we run out of memory 00580 Purpose: This gets called when the selection state has changed. The SelWidth combo 00581 gets updated to reflect the new selection. 00582 00583 ********************************************************************************************/ 00584 00585 00586 BOOL OpChangeLineWidthOpDesc::OnSelChangingMsg(SelChangingMsg::SelectionState State) 00587 { 00588 // We require more refined Sel msg handling here 00589 //if (State != SelChangingMsg::COLOURATTCHANGED) 00590 //{ 00591 // return (SetCurrentSelWidth()); 00592 //} 00593 //Moved to OnCommonAttrsChangedMsg 00594 return TRUE; 00595 } 00596 00597 /******************************************************************************************** 00598 00599 > virtual BOOL OpChangeLineWidthOpDesc::OnCommonAttrsChangedMsg(SelChangingMsg::SelectionState State) 00600 00601 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00602 Created: 6/7/94 00603 Returns: FALSE if we run out of memory 00604 Purpose: This gets called when the common attributes have changed. The SelWidth combo 00605 gets updated to reflect this. 00606 00607 ********************************************************************************************/ 00608 00609 00610 BOOL OpChangeLineWidthOpDesc::OnCommonAttrsChangedMsg() 00611 { 00612 return (SetCurrentSelWidth()); 00613 } 00614 00615 00616 /******************************************************************************************** 00617 00618 > virtual BOOL OpChangeLineWidthOpDesc::OnDocChangingMsg(Document* pChangingDoc, DocState State) 00619 00620 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00621 Created: 15/6/94 00622 Inputs: - 00623 Outputs: - 00624 Returns: 00625 00626 Purpose: To update the selection width combo whenever the document changes 00627 00628 Errors: - 00629 SeeAlso: DocChangingMsg 00630 00631 00632 ********************************************************************************************/ 00633 00634 00635 BOOL OpChangeLineWidthOpDesc::OnDocChangingMsg(Document* pChangingDoc, DocChangingMsg::DocState State) 00636 { 00637 return (SetCurrentSelWidth()); 00638 } 00639 00640 /******************************************************************************************** 00641 00642 > static OpState OpChangeLineWidthOpDesc::GetState(String_256* Description, OpDescriptor*); 00643 00644 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00645 Created: 7/6/94 00646 Inputs: - 00647 Outputs: - 00648 Returns: - 00649 Purpose: GetState function for the OpChangeLineWidthOpDesc 00650 Errors: - 00651 SeeAlso: - 00652 00653 ********************************************************************************************/ 00654 00655 OpState OpChangeLineWidthOpDesc::GetState(String_256* Description, OpDescriptor*) 00656 { 00657 OpState Blobby; 00658 if (!Document::GetSelected()) Blobby.Greyed = TRUE; 00659 return Blobby; 00660 }