
Sun, 09/03/2006 - 13:52
hi everybody........
i want to take text from user through dialog box..
after entering text when user presses ok that text should be dispayed in OCC window..
the problem is that it is not converting from CString to TCollection _ExtendedString ...
in dialog box i have just one edit box whose type i have set as CString... varible name m_Text
my code looks like this
#include "TEXTDLG.h" //header file for dialog box
void CTextDoc::OnDisplayText()
{
CTEXTDLG dlg;
if(dlg.DoModal()!=IDOK)return;
TCollection_ExtendedString aTCoText=dlg.m_Text;//
gp_Pnt aPnt, OrigineDimZT(500,0,0);
BRepBuilderAPI_MakeVertex vert(OrigineDimZT);
Handle(AIS_Shape) sh = new AIS_Shape(vert);
myAISContext->Display(sh,Standard_False);
Handle(Prs3d_Presentation) aPresentation= new Prs3d_Presentation(myAISContext->CurrentViewer()->Viewer());
Handle(Prs3d_TextAspect) aTextAspect= new Prs3d_TextAspect();
aTextAspect->SetFont(Graphic3d_NOF_ASCII_ITALIC_TRIPLEX);
aTextAspect->SetHeight(2);
aTextAspect->SetColor(Quantity_NOC_CYAN1);
aTextAspect->SetSpace(20);
Prs3d_Text::Draw(aPresentation,aTextAspect,aTCoText, OrigineDimZT);
aPresentation->Display();
Sun, 09/03/2006 - 17:15
Try
TCollection_ExtendedString aTCoText(dlg.m_Text);
instead of
TCollection_ExtendedString aTCoText=dlg.m_Text;//