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


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

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


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

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