25 #include "Riostream.h"
64 DragItemLbl->setText(
"");
65 DragClassLbl->setText(
"");
66 DragKindLbl->setText(
"");
68 PrintLbl->setText(
"");
70 QObject::connect(InfoBtn, SIGNAL(clicked()),
this, SLOT(
InfoBtn_clicked()));
71 QObject::connect(EditBtn, SIGNAL(clicked()),
this, SLOT(
EditBtn_clicked()));
72 QObject::connect(DrawBtn, SIGNAL(clicked()),
this, SLOT(
DrawBtn_clicked()));
73 QObject::connect(fxDrawCanvas, SIGNAL(CanvasDropEvent(QDropEvent*,TPad*)),
this, SLOT(
CanvasDropEventSlot(QDropEvent*,TPad*)));
78 fxDrawCanvas->getCanvas()->Clear();
94 default: kndlabel =
"undefined";
break;
97 kndlabel = QString(
"Kind of draged item: ") + kndlabel +
98 " (" + QString::number(kind) +
")";
107 switch (TabWidget->currentIndex()) {
109 DragLbl->setText(
"Go4 GUI asks if widget accept dragged item");
110 DragItemLbl->setText(itemname);
111 DragClassLbl->setText(QString(
"Class: ") + (cl==0 ?
"not exists (known)" : cl->GetName()));
117 PrintLbl->setText(QString(
"Class: ") + (cl==0 ?
"not exists (known)" : cl->GetName()));
127 switch (TabWidget->currentIndex()) {
129 DragLbl->setText(
"User dropped item");
130 DragItemLbl->setText(itemname);
131 DragClassLbl->setText(cl==0 ?
"No class specified" : cl->GetName());
136 PrintLbl->setText(
"Can not drop item of uncknown class");
138 PrintLbl->setText(QString(
"Print item: ") + itemname);
140 AddLink(itemname,
"PrintItem");
153 if (strcmp(linkname,
"PrintItem")==0)
156 if (strcmp(linkname,
"DrawItem")==0) {
157 fxDrawCanvas->getCanvas()->Clear();
158 fxDrawCanvas->getCanvas()->cd();
160 fxDrawCanvas->getCanvas()->Update();
166 if (strcmp(linkname,
"PrintItem")==0)
169 if (strcmp(linkname,
"DrawItem")==0) {
171 fxDrawCanvas->getCanvas()->Clear();
172 fxDrawCanvas->getCanvas()->Update();
198 int saved_stdout = dup(STDOUT_FILENO);
200 if( pipe(out_pipe) != 0 )
return;
202 dup2(out_pipe[1], STDOUT_FILENO);
203 ::close(out_pipe[1]);
211 memset(sbuf,0,
sizeof(sbuf));
212 read(out_pipe[0], sbuf,
sizeof(sbuf)-1);
214 dup2(saved_stdout, STDOUT_FILENO);
215 ::close(out_pipe[0]);
217 PrintEdit->setText(sbuf);
219 PrintEdit->setText(
"<not supported (yet) under windows>");
226 if (!event->mimeData()->hasText())
return;
227 QString eventstr =
event->mimeData()->text();
228 event->acceptProposedAction();
238 fxDrawCanvas->getCanvas()->Clear();
239 fxDrawCanvas->getCanvas()->cd();
241 fxDrawCanvas->getCanvas()->Update();
QUserPanel(QWidget *parent=0, const char *name=0)
virtual bool IsAcceptDrag(const char *itemname, TClass *cl, int kind)
virtual void EditBtn_clicked()
virtual void DrawObjectOnCanvas(const char *itemname)
virtual void linkedObjectRemoved(const char *linkname)
Q_DECL_EXPORT void * StartUserPanel(void *parent)
virtual void InfoBtn_clicked()
virtual void DropItem(const char *itemname, TClass *cl, int kind)
virtual void CanvasDropEventSlot(QDropEvent *, TPad *)
virtual void linkedObjectUpdated(const char *linkname, TObject *obj)
virtual void PrintObject(TObject *obj)
virtual void DrawBtn_clicked()
virtual QString kindString(int kind)