Example #1
0
String Label::Text() const
{
   size_type len = 0;
   (*API->Label->GetLabelText)( handle, 0, &len );

   String text;
   if ( len > 0 )
   {
      text.SetLength( len );
      if ( (*API->Label->GetLabelText)( handle, text.Begin(), &len ) == api_false )
         throw APIFunctionError( "GetLabelText" );
      text.ResizeToNullTerminated();
   }
   return text;
}
Example #2
0
String FileFormat::Status() const
{
   size_type len = 0;
   (*API->FileFormat->GetFileFormatStatus)( m_data->handle, 0, &len, 0/*reserved*/ );

   String status;
   if ( len > 0 )
   {
      status.SetLength( len );
      if ( (*API->FileFormat->GetFileFormatStatus)( m_data->handle, status.Begin(), &len, 0/*reserved*/ ) == api_false )
         throw APIFunctionError( "GetFileFormatStatus" );
      status.ResizeToNullTerminated();
   }
   return status;
}
Example #3
0
String FileFormat::Implementation() const
{
   size_type len = 0;
   (*API->FileFormat->GetFileFormatImplementation)( m_data->handle, 0, &len );

   String implementation;
   if ( len > 0 )
   {
      implementation.SetLength( len );
      if ( (*API->FileFormat->GetFileFormatImplementation)( m_data->handle, implementation.Begin(), &len ) == api_false )
         throw APIFunctionError( "GetFileFormatImplementation" );
      implementation.ResizeToNullTerminated();
   }
   return implementation;
}
Example #4
0
String SpinBox::MinimumValueText() const
{
   size_type len = 0;
   (*API->SpinBox->GetSpinBoxMinimumValueText)( handle, 0, &len );

   String text;
   if ( len > 0 )
   {
      text.SetLength( len );
      if ( (*API->SpinBox->GetSpinBoxMinimumValueText)( handle, text.Begin(), &len ) == api_false )
         throw APIFunctionError( "GetSpinBoxMinimumValueText" );
      text.ResizeToNullTerminated();
   }
   return text;
}
Example #5
0
String SpinBox::Suffix() const
{
   size_type len = 0;
   (*API->SpinBox->GetSpinBoxSuffix)( handle, 0, &len );

   String suffix;
   if ( len > 0 )
   {
      suffix.SetLength( len );
      if ( (*API->SpinBox->GetSpinBoxSuffix)( handle, suffix.Begin(), &len ) == api_false )
         throw APIFunctionError( "GetSpinBoxSuffix" );
      suffix.ResizeToNullTerminated();
   }
   return suffix;
}
Example #6
0
String SVG::Description() const
{
   if ( !IsNull() )
   {
      size_type len = 0;
      (*API->SVG->GetSVGDescription)( handle, 0, &len );
      if ( len > 0 )
      {
         String description;
         description.SetLength( len );
         if ( (*API->SVG->GetSVGDescription)( handle, description.Begin(), &len ) == api_false )
            throw APIFunctionError( "GetSVGDescription" );
         description.ResizeToNullTerminated();
         return description;
      }
   }

   return String();
}
Example #7
0
String SVG::Title() const
{
   if ( !IsNull() )
   {
      size_type len = 0;
      (*API->SVG->GetSVGTitle)( handle, 0, &len );
      if ( len > 0 )
      {
         String title;
         title.SetLength( len );
         if ( (*API->SVG->GetSVGTitle)( handle, title.Begin(), &len ) == api_false )
            throw APIFunctionError( "GetSVGTitle" );
         title.ResizeToNullTerminated();
         return title;
      }
   }

   return String();
}
Example #8
0
String SVG::FilePath() const
{
   if ( !IsNull() )
   {
      size_type len = 0;
      (*API->SVG->GetSVGFilePath)( handle, 0, &len );
      if ( len > 0 )
      {
         String path;
         path.SetLength( len );
         if ( (*API->SVG->GetSVGFilePath)( handle, path.Begin(), &len ) == api_false )
            throw APIFunctionError( "GetSVGFilePath" );
         path.ResizeToNullTerminated();
         return path;
      }
   }

   return String();
}
Example #9
0
bool OpenFileDialog::Execute()
{
   q->fileNames.Clear();

   String apiFilters = p->MakeAPIFilters();

   String fileName;
   fileName.Reserve( 8192 );
   *fileName.c_str() = CharTraits::Null();

   if ( q->multipleSelections )
   {
      if ( (*API->Dialog->ExecuteOpenMultipleFilesDialog)( fileName.c_str(),
               AddFileNameToList, &q->fileNames,
               p->caption.c_str(),
               p->initialPath.c_str(), apiFilters.c_str(), p->fileExtension.c_str() ) == api_false )
      {
         return false;
      }
   }
   else
   {
      if ( (*API->Dialog->ExecuteOpenFileDialog)( fileName.c_str(),
               p->caption.c_str(),
               p->initialPath.c_str(), apiFilters.c_str(), p->fileExtension.c_str() ) == api_false )
      {
         return false;
      }

      fileName.ResizeToNullTerminated();
      if ( !fileName.IsEmpty() )
         q->fileNames.Add( fileName );
   }

   if ( !q->fileNames.IsEmpty() )
   {
      p->fileExtension = File::ExtractExtension( *q->fileNames );
      return true;
   }

   return false;
}