#include <pentool.h>
Inheritance diagram for PenToolInfoBarOp:
Public Member Functions | |
PenToolInfoBarOp () | |
MsgResult | Message (Msg *) |
Pen tool info bar dialog message handler. | |
Public Attributes | |
PenTool * | pPenTool |
Definition at line 242 of file pentool.h.
|
Definition at line 246 of file pentool.h.
|
|
Pen tool info bar dialog message handler.
Reimplemented from InformationBarOp. Definition at line 500 of file pentool.cpp. 00501 { 00502 if (MESSAGE_IS_A(Message,OpMsg)) // Check for undo/redo 00503 { 00504 OpMsg* pOpMsg = (OpMsg*)Message; 00505 00506 if (pOpMsg->MsgType == OpMsg::AFTER_UNDO) 00507 { 00508 pPenTool->ClearInternalState(); 00509 } 00510 00511 if (pOpMsg->MsgType == OpMsg::END) 00512 { 00513 // an operation has ended, so lets check our own opstate 00514 00515 if (IS_A(pOpMsg->pOp, OpPenCreateInternal) || 00516 IS_A(pOpMsg->pOp, OpPenEditInternal)) 00517 if (pPenTool->GetPenOpState() == OS_EditInternal) 00518 { 00519 if (!(pOpMsg->pOp->GetOpFlgs()).Failed) 00520 pPenTool->SetInternalState(); 00521 pPenTool->ClearOp(); 00522 } 00523 00524 if (IS_A(pOpMsg->pOp, OpPenCreatePath)) 00525 if (pPenTool->GetPenOpState() == OS_CreatePath) 00526 { 00527 if (!(pOpMsg->pOp->GetOpFlgs()).Failed) 00528 pPenTool->CreateNewPath(); 00529 pPenTool->ClearPath(); 00530 pPenTool->ClearOp(); 00531 } 00532 00533 if (IS_A(pOpMsg->pOp, OpPenAddElement)) 00534 if (pPenTool->GetPenOpState() == OS_AddElement) 00535 { 00536 if (!(pOpMsg->pOp->GetOpFlgs()).Failed) 00537 pPenTool->AddElementToPath(); 00538 pPenTool->ClearPath(); 00539 pPenTool->ClearOp(); 00540 } 00541 00542 if (IS_A(pOpMsg->pOp, OpPenClosePath)) 00543 if (pPenTool->GetPenOpState() == OS_ClosePath) 00544 { 00545 if (!(pOpMsg->pOp->GetOpFlgs()).Failed) 00546 pPenTool->CloseWithPath(); 00547 pPenTool->ClearPath(); 00548 pPenTool->ClearOp(); 00549 } 00550 } 00551 } 00552 else if (MESSAGE_IS_A(Message,DocChangingMsg)) // Check for changes in the doc system 00553 { 00554 DocChangingMsg* pDocChangingMsg = (DocChangingMsg*)Message; 00555 // Document* pDoc = pDocChangingMsg->pChangingDoc; 00556 00557 switch (pDocChangingMsg->State) 00558 { 00559 case DocChangingMsg::SELCHANGED: 00560 case DocChangingMsg::KILLED: 00561 pPenTool->ClearInternalState(); 00562 break; 00563 default: 00564 break; 00565 } 00566 } 00567 00568 // Pass the message on 00569 return (DialogBarOp::Message(Message)); 00570 }
|
|
|