void GradientsMergeMosaicInterface::UpdateTargetImageItem( size_type i )
{
   TreeBox::Node* node = GUI->TargetImages_TreeBox[i];
   if ( node == 0 )
      return;

   const GradientsMergeMosaicInstance::ImageItem& item = instance.targetFrames[i];

   node->SetText( 0, String( i+1 ) );
   node->SetAlignment( 0, TextAlign::Right );

   node->SetIcon( 1, Bitmap( ScaledResource( item.enabled ? ":/icons/enabled.png" : ":/icons/disabled.png" ) ) );
   node->SetAlignment( 1, TextAlign::Left );

   node->SetIcon( 2, Bitmap( ScaledResource( ":/icons/document.png" ) ) );
   if ( GUI->FullPaths_CheckBox.IsChecked() )
      node->SetText( 2, item.path );
   else
   {
      String fileName = File::ExtractName( item.path ) + File::ExtractExtension( item.path );
      node->SetText( 2, fileName );
      node->SetToolTip( 2, item.path );
   }
   node->SetAlignment( 2, TextAlign::Left );
}
예제 #2
0
파일: TreeBox.cpp 프로젝트: aleixpuig/PCL
TreeBox::Node::Node( TreeBox::Node& parent, int index ) :
   UIObject( (*API->TreeBox->CreateTreeBoxNode)( ModuleHandle(), this ) )
{
   if ( IsNull() )
      throw APIFunctionError( "CreateTreeBoxNode" );
   if ( !parent.IsNull() )
      parent.Insert( index, this );
}
void DrizzleIntegrationInterface::UpdateInputDataItem( size_type i )
{
   TreeBox::Node* node = GUI->InputData_TreeBox[i];
   if ( node == 0 )
      return;

   const DrizzleIntegrationInstance::DataItem& item = m_instance.p_inputData[i];

   node->SetText( 0, String( i+1 ) );
   node->SetAlignment( 0, TextAlign::Right );

   node->SetIcon( 1, Bitmap( String( item.enabled ? ":/browser/enabled.png" : ":/browser/disabled.png" ) ) );
   node->SetAlignment( 1, TextAlign::Left );

   String fileText;
   if ( GUI->FullPaths_CheckBox.IsChecked() )
      fileText.Append( item.path );
   else
      fileText.Append( File::ExtractNameAndSuffix( item.path ) );

   node->SetText( 2, fileText );
   node->SetAlignment( 2, TextAlign::Left );
   if ( !GUI->FullPaths_CheckBox.IsChecked() )
      node->SetToolTip( 2, item.path );
}
예제 #4
0
void MultiViewSelectionDialog::ButtonClick( Button& sender, bool checked )
{
   if ( sender == SelectAll_PushButton )
   {
      for ( int i = 0, n = Views_TreeBox.NumberOfChildren(); i < n; ++i )
      {
         TreeBox::Node* node = Views_TreeBox[i];
         if ( node != nullptr )
            node->Check();
      }
   }
   else if ( sender == UnselectAll_PushButton )
   {
      for ( int i = 0, n = Views_TreeBox.NumberOfChildren(); i < n; ++i )
      {
         TreeBox::Node* node = Views_TreeBox[i];
         if ( node != nullptr )
            node->Uncheck();
      }
   }
   else if ( sender == OK_PushButton )
   {
      m_selectedViews.Clear();
      for ( int i = 0, n = Views_TreeBox.NumberOfChildren(); i < n; ++i )
      {
         const TreeBox::Node* node = Views_TreeBox[i];
         if ( node != nullptr && node->IsChecked() )
         {
            View view = View::ViewById( node->Text( 0 ) );
            if ( !view.IsNull() )
               m_selectedViews.Add( view );
         }
      }
      Ok();
   }
   else if ( sender == Cancel_PushButton )
   {
      m_selectedViews.Clear();
      Cancel();
   }
}
예제 #5
0
void MultiViewSelectionDialog::Regenerate()
{
   Views_TreeBox.Clear();

   Array<View> views = View::AllViews();

   bool includeMainViews = !m_allowPreviews || IncludeMainViews_CheckBox.IsChecked();
   bool includePreviews = m_allowPreviews && IncludePreviews_CheckBox.IsChecked();

   for ( Array<View>::const_iterator i = views.Begin(); i != views.End(); ++i )
   {
      bool isPreview = i->IsPreview();
      if ( isPreview ? includePreviews : includeMainViews )
      {
         TreeBox::Node* node = new TreeBox::Node( Views_TreeBox );
         node->SetCheckable();
         node->Uncheck();
         node->SetText( 0, i->FullId() );
      }
   }

   Views_TreeBox.AdjustColumnWidthToContents( 0 );
}
예제 #6
0
void HDRCompositionInterface::UpdateInputImagesItem( size_type i )
{
   TreeBox::Node* node = GUI->InputImages_TreeBox[i];
   if ( node == 0 )
      return;

   const HDRCompositionInstance::ImageItem& item = instance.images[i];

   node->SetText( 0, String( i+1 ) );
   node->SetAlignment( 0, TextAlign::Right );

   node->SetIcon( 1, Bitmap( ScaledResource( item.enabled ? ":/browser/enabled.png" : ":/browser/disabled.png" ) ) );
   node->SetAlignment( 1, TextAlign::Left );

   if ( GUI->FullPaths_CheckBox.IsChecked() )
      node->SetText( 2, item.path );
   else
      node->SetText( 2, File::ExtractNameAndSuffix( item.path ) );
   node->SetToolTip( 2, item.path );
   node->SetAlignment( 2, TextAlign::Left );
}