Question
Adding styles to objects that are dragged and dropped
Hi!<br /> Let me state my approach and my requirement. I need to create a set of textframes when I drag an widget from a pannel. I had already implemented the same, using the reference given in basicdragdrop sample file. But I need to attach a parastyle already created in the document to the created textframe. When I tried attaching the parastyle using the code given below:<br /><br />InterfacePtr<ICommand> applyStyleCmd(textModelCmds->ApplyStyleCmd(0, <br /> textModel->TotalLength(),styleUID_new, kCharAttrStrandBoss , kTrue,kFalse,kTrue));<br /><br /> ASSERT(applyStyleCmd);<br /> err = CmdUtils::ProcessCommand(applyStyleCmd);<br /> ASSERT(err== kSuccess);<br /><br />I get a debug error as "cannot instantiate the classid for the style". I hope it is because the object is in the scrap and maybe the scrap does not have the provision to store user defined style.<br />I could'nt find another solution to do the same for eg. to trap the end of drag drop operation and then apply the style to the objects created.<br />I would be happy if anyone could suggest me how to go about the same.<br /><br />Thanks in Advance<br />Vishnu