void LiveEffectsTool::OnClick( DocCoord PointerPos, ClickType Click, ClickModifiers ClickMods, Spread* pSpread ) { // Stub out this function if the tool isn't wanted #ifndef NO_ADVANCED_TOOLS if (ClickMods.Menu) return; // Don't do anything if the user clicked the Menu button // See if there is already a drag going on if (Operation::GetCurrentDragOp()!=NULL) return; // If we get a click, treat it like a mouse move, allowing the tool to set up // any info that is passed to the operation in the drag // NEW 17/4/2000 Now we also want to click-select in the Freehand tool if (Click==CLICKTYPE_SINGLE) { OnMouseMove(PointerPos, pSpread, ClickMods); DragTool::OnClick (PointerPos, Click, ClickMods, pSpread); } if (Click == CLICKTYPE_UP) { // so long as we are not interfering with any drawing operations we will // try and change the selection //if (JoinInfo.pJoinPath == NULL) { DragTool::OnClick (PointerPos, Click, ClickMods, pSpread); SelRange* pSelRange = GetApplication()->FindSelection(); if (pSelRange) pSelRange->MakePartialSelectionWhole(TRUE, FALSE, TRUE); BROADCAST_TO_ALL(CommonAttrsChangedMsg); } } #endif // NO_ADVANCED_TOOLS }
void LiveEffectsTool::SelectChange(BOOL isSelected) { // Stub out this function if the tool isn't wanted #ifndef NO_ADVANCED_TOOLS if (isSelected) { //MessageBox(NULL, "SelectChange 1", "Debug", MB_OK); // Load the cursors if (!LoadCursors()) InformError(); // Update the list of plug-ins //MessageBox(NULL, "SelectChange 2", "Debug", MB_OK); XPEHost::UpdateEditorsList(); //MessageBox(NULL, "SelectChange 3", "Debug", MB_OK); SelRange* pSelRange = GetApplication()->FindSelection(); if (pSelRange) pSelRange->MakePartialSelectionWhole(TRUE, FALSE, TRUE); ScreenChanged(FALSE); //MessageBox(NULL, "SelectChange 4", "Debug", MB_OK); // Find the blob manager ready for later BlobManager* BlobMgr = GetApplication()->GetBlobManager(); // Create and display my info bar please if (m_pInfoBarOp != NULL) { m_pInfoBarOp->Create(); m_pInfoBarOp->SetToolActiveState(TRUE); } // Make sure that Objects blobs are on if (BlobMgr != NULL) { // Decide which blobs to display BlobStyle MyBlobs; MyBlobs.Object = TRUE; // tell the blob manager BlobMgr->ToolInterest(MyBlobs); } //MessageBox(NULL, "SelectChange 5", "Debug", MB_OK); } else { // Deselection of the tool // Get rid of all the tools cursors RemoveCursors(); // Close any open XPE editing XPEHost::EndEditLiveEffect(); // Hide and destroy my info bar please if (m_pInfoBarOp != NULL) { m_pInfoBarOp->SetToolActiveState(FALSE); // Close any open dialogs related to the info bar here m_pInfoBarOp->Delete(); } // ensure that the colour picker is working // SetColourEditorProcessing(TRUE); // ensure any tool object blobs are removed. BlobManager* BlobMgr = GetApplication()->GetBlobManager(); if (BlobMgr != NULL) { BlobStyle bsRemoves; bsRemoves.ToolObject = TRUE; BlobMgr->RemoveInterest(bsRemoves); } } #endif // NO_ADVANCED_TOOLS }