#include <brushop.h>
Inheritance diagram for OpSelectBrush:
Public Member Functions | |
OpSelectBrush () | |
Constructor. | |
~OpSelectBrush () | |
destructor | |
virtual void | Do (OpDescriptor *) |
the all-important Do function | |
virtual void | GetOpName (String_256 *OpName) |
like the title says | |
Static Public Member Functions | |
static BOOL | Declare () |
Adds the operation to the list of all known operations. | |
static OpState | GetState (String_256 *Description, OpDescriptor *) |
Find out the state of the operation at the specific time, in this instance the operation can only be launched when we are in the freehand tool. |
Definition at line 257 of file brushop.h.
|
Constructor.
Definition at line 1523 of file brushop.cpp.
|
|
destructor
Definition at line 1539 of file brushop.cpp.
|
|
Adds the operation to the list of all known operations.
Definition at line 1555 of file brushop.cpp. 01556 { 01557 return (RegisterOpDescriptor( 01558 0, 01559 _R(IDS_BRUSH_MAKESELECTED), 01560 CC_RUNTIME_CLASS(OpSelectBrush), 01561 OPTOKEN_SELECTBRUSH, 01562 OpSelectBrush::GetState, 01563 0, /* help ID */ 01564 0, /* bubble ID */ 01565 0 /* bitmap ID */ 01566 )); 01567 }
|
|
the all-important Do function
Reimplemented from Operation. Definition at line 1647 of file brushop.cpp. 01648 { 01649 01650 AttrBrushType* pSelBrush = CBrushEditDlg::GetSingleSelectedBrushAttribute(); 01651 01652 if (pSelBrush == NULL) 01653 { 01654 ERROR3("No selected brush in OpSelectBrush::Do"); 01655 return; 01656 } 01657 01658 BrushHandle SelHandle = pSelBrush->GetBrushHandle(); 01659 01660 // all we need to do is send a message 01661 BROADCAST_TO_ALL(BrushMsg(SelHandle)); 01662 01663 End(); 01664 }
|
|
like the title says
Reimplemented from Operation. Definition at line 1626 of file brushop.cpp. 01627 { 01628 *OpName = String_256(_R(IDS_BRUSH_MAKESELECTED)); 01629 }
|
|
Find out the state of the operation at the specific time, in this instance the operation can only be launched when we are in the freehand tool.
Definition at line 1586 of file brushop.cpp. 01587 { 01588 OpState State; 01589 01590 // make sure we have one and only one brush in the selection before we launch the op 01591 AttrBrushType* pAttrBrush = CBrushEditDlg::GetSingleSelectedBrushAttribute(); 01592 BrushHandle Handle = BrushHandle_NoBrush; 01593 if (pAttrBrush != NULL) 01594 Handle = pAttrBrush->GetBrushHandle(); 01595 01596 // likewise we must be in the freehand tool 01597 Tool* pTool = Tool::GetCurrent(); 01598 if (pTool != NULL && pTool->GetID() != TOOLID_FREEHAND) 01599 pTool = NULL; 01600 01601 // plus its only worth doing if we are selecting an actual brush 01602 if (Handle != BrushHandle_NoBrush && pTool != NULL) 01603 State.Greyed = FALSE; 01604 else 01605 State.Greyed = TRUE; 01606 01607 return State; 01608 01609 }
|