Ejemplo n.º 1
0
void wxDataFormat::SetType( wxDataFormatId type )
{
    PrepareFormats();

    m_type = type;

#if wxUSE_UNICODE
    if (m_type == wxDF_UNICODETEXT)
        m_format = g_textAtom;
    else if (m_type == wxDF_TEXT)
        m_format = g_altTextAtom;
#else // !wxUSE_UNICODE
    // notice that we don't map wxDF_UNICODETEXT to g_textAtom here, this
    // would lead the code elsewhere to treat data objects with this format as
    // containing UTF-8 data which is not true
    if (m_type == wxDF_TEXT)
        m_format = g_textAtom;
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
    else
    if (m_type == wxDF_BITMAP)
        m_format = g_pngAtom;
    else
    if (m_type == wxDF_FILENAME)
        m_format = g_fileAtom;
    else
    {
       wxFAIL_MSG( wxT("invalid dataformat") );
    }
}
Ejemplo n.º 2
0
void wxDataFormat::SetType( wxDataFormatId type )
{
    PrepareFormats();

    m_type = type;

#if wxUSE_UNICODE
    if (m_type == wxDF_UNICODETEXT)
        m_format = g_textAtom;
    else if (m_type == wxDF_TEXT)
        m_format = g_altTextAtom;
#else
    if (m_type == wxDF_TEXT || m_type == wxDF_UNICODETEXT)
        m_format = g_textAtom;
#endif
    else
    if (m_type == wxDF_BITMAP)
        m_format = g_pngAtom;
    else
    if (m_type == wxDF_FILENAME)
        m_format = g_fileAtom;
    else
    {
       wxFAIL_MSG( wxT("invalid dataformat") );
    }
}
Ejemplo n.º 3
0
void wxDataFormat::SetId( const wxString& id )
{
    PrepareFormats();
    m_type = wxDF_PRIVATE;
    m_format = XInternAtom( wxGlobalDisplay(),
                            id.mbc_str(), False );
}
Ejemplo n.º 4
0
void wxDataFormat::SetId( const wxString& id )
{
#if !wxUSE_NANOX
    PrepareFormats();
    m_type = wxDF_PRIVATE;
    m_format = XInternAtom( (Display*) wxGetDisplay(), id.ToAscii(), FALSE );
#endif
}
Ejemplo n.º 5
0
void wxDataFormat::SetId( NativeFormat format )
{
    PrepareFormats();
    m_format = format;

    if (m_format == g_textAtom)
#if wxUSE_UNICODE
        m_type = wxDF_UNICODETEXT;
#else
        m_type = wxDF_TEXT;
#endif
    else if (m_format == g_altTextAtom)
Ejemplo n.º 6
0
void wxDataFormat::SetId( NativeFormat format )
{
    PrepareFormats();
    m_format = format;

    if (m_format == g_textAtom)
        m_type = wxDF_TEXT;
    else
    if (m_format == g_bitmapAtom)
        m_type = wxDF_BITMAP;
    else
    if (m_format == g_fileAtom)
        m_type = wxDF_FILENAME;
    else
        m_type = wxDF_PRIVATE;
}
Ejemplo n.º 7
0
void wxDataFormat::SetType( wxDataFormatId type )
{
    PrepareFormats();
    m_type = type;

    if (m_type == wxDF_TEXT)
        m_format = g_textAtom;
    else
    if (m_type == wxDF_BITMAP)
        m_format = g_bitmapAtom;
    else
    if (m_type == wxDF_FILENAME)
        m_format = g_fileAtom;
    else
    {
       wxFAIL_MSG( wxT("invalid dataformat") );
    }
}
Ejemplo n.º 8
0
wxDataFormat::wxDataFormat( NativeFormat format )
{
    PrepareFormats();
    SetId( format );
}
Ejemplo n.º 9
0
void wxDataFormat::InitFromString( const wxString &id )
{
    PrepareFormats();
    SetId( id );
}
Ejemplo n.º 10
0
wxDataFormat::wxDataFormat( wxDataFormatId type )
{
    PrepareFormats();
    SetType( type );
}
Ejemplo n.º 11
0
wxDataFormat::wxDataFormat( const wxString &id )
{
    PrepareFormats();
    SetId( id );
}
Ejemplo n.º 12
0
wxDataFormat::wxDataFormat( const wxChar *id )
{
    PrepareFormats();
    SetId( id );
}