当前位置: 首页>>代码示例>>C++>>正文


C++ Fl_Tree_Item::labelfont方法代码示例

本文整理汇总了C++中Fl_Tree_Item::labelfont方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Tree_Item::labelfont方法的具体用法?C++ Fl_Tree_Item::labelfont怎么用?C++ Fl_Tree_Item::labelfont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fl_Tree_Item的用法示例。


在下文中一共展示了Fl_Tree_Item::labelfont方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mark_file

/*
   Name   : mark_file()
   Purpose: Set the marked attribute in the file metadata record.
            Gets the first selected item for the file system tree
            widget and looks up the file metadata record.
   Input  : None.
   Output : None.
*/
void Fineline_File_System_Tree::mark_file()
{
	Fl_Tree_Item *flti = first_selected_item();
   fl_file_record_t *flrec = NULL;
   char file_path[FL_PATH_MAX]; // FL_PATH_MAX 2048 is an FLTK constant, Fineline FL_PATH_MAX_LENGTH 4096
   string full_path;

   if (flti != 0)
   {
      if (item_pathname(file_path, FL_PATH_MAX, flti) != 0)
      {
         Fineline_Log::print_log_entry("Fineline_File_System_Tree::mark_file() <ERROR> Could not get tree item path.");
         fl_message(" <ERROR> Could not get tree item. ");
         return;
      }

      full_path.append(file_path);
      flrec = find_file(full_path);
      if (flrec != NULL)
      {
         flrec->marked = 1;
         flti->labelcolor(FL_DARK_GREEN);
         flti->labelfont(FL_COURIER_BOLD);
         if (flrec->file_type == TSK_FS_META_TYPE_DIR) //If a directory then mark all the files in the directory.
         {
            mark_children(flti);
         }
         Fl::awake();
         Fineline_Log::print_log_entry("Fineline_File_System_Tree::mark_file() <INFO> marked file.");
      }
   }
   return;
}
开发者ID:sanyaade-g2g-repos,项目名称:fineline-computer-forensics-timeline-tools,代码行数:41,代码来源:Fineline_File_System_Tree.cpp

示例2: populateCurveList

// TODO: populate the curve list once we actually have a list of curves.
void ModelerUserInterface::populateCurveList(Property* prop, Fl_Tree_Item* parent) {
	// Create a tree node for this property
	Fl_Tree_Item* item;
	if (parent == NULL) {
		// HACK: We have to add and remove a fake list item so that the tree
		// control will create a root node to put it under.
		curvesTree->remove(curvesTree->add("You shouldn't see this."));

		item = curvesTree->root();
		item->label(prop->getName());
	} else {
		item = curvesTree->add(parent, prop->getName());
	}
	item->labelfont(FL_HELVETICA_BOLD);
	if (GroupProperty* g = dynamic_cast<GroupProperty*>(prop)) {
		if (g->getCollapsed()) {
			item->close();
		}
	} else if (dynamic_cast<RGBProperty*>(prop)) {
		item->close();
	}

	// Examine the list of properties.
	PropertyList* controls = prop->getProperties();
	for (PropertyList::iterator iter = controls->begin();
		 iter != controls->end();
		 iter++) {
        // For now, only RangeProperty is supported by the Curve interface.
		// The RGBProperty is also indirectly supported because it can provide
	    // RangeProperties when its getProperties() method is called.
		// TODO: make this work with more property types (using a new
		// plotting widget?)
		if (RangeProperty* range = dynamic_cast<RangeProperty*>(*iter)) {
			// TODO: connect to Curve object instead of Property object.
			Fl_Tree_Item* childNode = curvesTree->add(item, range->getName());
			curveProps.push_back(range);
			childNode->user_data((void*)(curveProps.size() - 1));
			range->setCurveIndex(curveProps.size() - 1);
			graph->addCurve(range->getValue(), range->getMin(),
				range->getMax());
		} else if ((*iter)->getProperties() != NULL) {
			// Try to get a list of GroupProperties out of it.
			populateCurveList(*iter, item);
		}
	}
}
开发者ID:shayne1993,项目名称:ComputerGraphicProjects,代码行数:47,代码来源:modelerui.cpp

示例3: unmark_children

void Fineline_File_System_Tree::unmark_children(Fl_Tree_Item *flti)
{
   Fl_Tree_Item *fltc;
   fl_file_record_t *flrec = NULL;
   char file_path[FL_PATH_MAX]; // FL_PATH_MAX 2048 is an FLTK constant, Fineline FL_PATH_MAX_LENGTH 4096
   string full_path;
   int ccount, i;

   if ((ccount = flti->children()) > 0)
   {
      for (i = 0; i < ccount; i++)
      {
         fltc = flti->child(i);
         if (fltc != 0)
         {
            if (item_pathname(file_path, FL_PATH_MAX, fltc) != 0)
            {
               Fineline_Log::print_log_entry("Fineline_File_System_Tree::unmark_children() <ERROR> Could not get tree item path.");
               fl_message(" <ERROR> Could not get tree item. ");
               return;
            }

            full_path = file_path;
            flrec = find_file(full_path);
            if (flrec != NULL)
            {
               flrec->marked = 0;
               fltc->labelcolor(FL_FOREGROUND_COLOR);
               fltc->labelfont(FL_HELVETICA);
               if (flrec->file_type == TSK_FS_META_TYPE_DIR) //If a directory then mark all the files in the directory.
               {
                  unmark_children(fltc);
               }
               Fl::awake();
               Fineline_Log::print_log_entry("Fineline_File_System_Tree::unmark_children() <INFO> unmarked file.");
            }
         }
      }
   }
}
开发者ID:sanyaade-g2g-repos,项目名称:fineline-computer-forensics-timeline-tools,代码行数:40,代码来源:Fineline_File_System_Tree.cpp

示例4: unmark_file

void Fineline_File_System_Tree::unmark_file()
{
	Fl_Tree_Item *flti = first_selected_item();
   fl_file_record_t *flrec = NULL;
   char file_path[FL_PATH_MAX]; // FL_PATH_MAX 2048 is an FLTK constant, Fineline FL_PATH_MAX_LENGTH 4096
   string full_path;

   if (flti != 0)
   {
      if (item_pathname(file_path, FL_PATH_MAX, flti) != 0)
      {
         Fineline_Log::print_log_entry("Fineline_File_System_Tree::unmark_file() <ERROR> Could not get tree item path.");
         fl_message(" <ERROR> Could not get tree item. ");
          return;
      }

      full_path.append(file_path);
      flrec = find_file(full_path);
      if (flrec != NULL)
      {
         flrec->marked = 0;
         flti->labelcolor(FL_FOREGROUND_COLOR);
         flti->labelfont(FL_COURIER);
         if (flrec->file_type == TSK_FS_META_TYPE_DIR) //If a directory then mark all the files in the directory.
         {
            //TODO: recursively iterate through the tree subdirectory children and mark each one.
            if (flti->has_children())
            {
               unmark_children(flti);
            }
         }
         Fl::awake();
      }
   }
   return;
}
开发者ID:sanyaade-g2g-repos,项目名称:fineline-computer-forensics-timeline-tools,代码行数:36,代码来源:Fineline_File_System_Tree.cpp


注:本文中的Fl_Tree_Item::labelfont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。