コード例 #1
0
ファイル: QUserPanel.cpp プロジェクト: svn2github/Go4
void QUserPanel::DropItem(const char* itemname, TClass* cl, int kind)
{
   switch (TabWidget->currentIndex()) {
      case 0:
         DragLbl->setText("User dropped item");
         DragItemLbl->setText(itemname);
         DragClassLbl->setText(cl==0 ? "No class specified" : cl->GetName());
         DragKindLbl->setText(kindString(kind));
         break;
      case 1:
         if (cl==0) {
            PrintLbl->setText("Can not drop item of uncknown class");
         } else {
            PrintLbl->setText(QString("Print item: ") + itemname);
            RemoveLink("PrintItem");
            AddLink(itemname, "PrintItem");
            PrintObject(GetLinked("PrintItem", 2));
         }

         break;
      case 2:
        DrawObjectOnCanvas(itemname);
        break;
   }
}
コード例 #2
0
ファイル: QUserPanel.cpp プロジェクト: svn2github/Go4
bool QUserPanel::IsAcceptDrag(const char* itemname, TClass* cl, int kind)
{
   bool res = false;

   switch (TabWidget->currentIndex()) {
      case 0:
        DragLbl->setText("Go4 GUI asks if widget accept dragged item");
        DragItemLbl->setText(itemname);
        DragClassLbl->setText(QString("Class: ") + (cl==0 ? "not exists (known)" : cl->GetName()));
        DragKindLbl->setText(kindString(kind));
        res = cl!=0;
        break;

     case 1:
        PrintLbl->setText(QString("Class: ") + (cl==0 ? "not exists (known)" : cl->GetName()));
        res = cl!=0;
        break;
   }
   // we will accept only items with known classes
   return res;
}
コード例 #3
0
ファイル: ModuleScope.cpp プロジェクト: PuerkitoBio/locic
		std::string ModuleScope::toString() const {
			return makeString("%s(name = %s, version = %s)",
				kindString().c_str(),
				moduleName().toString().c_str(),
				moduleVersion().toString().c_str());
		}