wtitle->SetFont(font);
sizer->Add( wtitle, 0, wxALL, 5 );
sizer->Add( new wxStaticText( window, -1,
- wxU( vlc_wraptext( psz_text , TEXTWIDTH, false ) ) ),
+ wxU( vlc_wraptext( psz_text , TEXTWIDTH ) ) ),
0, wxALL, 5 );
}
wxBOTTOM, 5 );
mainSizer->Add( new wxStaticText(this, -1,
- wxU( vlc_wraptext(HELLO_NOTICE , TEXTWIDTH , false ))),
+ wxU( vlc_wraptext(HELLO_NOTICE , TEXTWIDTH ))),
0, wxALL, 5 );
SetSizer(mainSizer);
/* Line 3 : text */
video_text = new wxStaticText( this, -1,
- wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH, false) ) );
+ wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH ) ) );
/* Fill the main video sizer */
video_sizer->Add( video_sizer1 , 0, wxEXPAND , 5 );
video_sizer->Add( video_text, 0, wxLEFT|wxTOP , 5 );
/* Line 3 : text */
audio_text = new wxStaticText( this, -1,
- wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH, false) ) );
+ wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH ) ) );
audio_sizer->Add(audio_sizer1, 0, wxEXPAND, 5);
audio_sizer->Add( audio_text, 0, wxLEFT | wxTOP, 5 );
{
struct codec *c = (struct codec*)
(video_combo->GetClientData(video_combo->GetSelection()));
- video_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH, false) ) );
+ video_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH ) ) );
i_video_codec = video_combo->GetSelection();
vcodec = strdup(c->psz_codec);
}
{
struct codec *c = (struct codec*)
(audio_combo->GetClientData(audio_combo->GetSelection()));
- audio_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH, false) ) );
+ audio_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH ) ) );
i_audio_codec = audio_combo->GetSelection();
acodec = strdup(c->psz_codec);
/* Big kludge, we take the longest text to get the size */
address_text = new wxStaticText(this, -1,
- wxU( vlc_wraptext(methods_array[2].psz_address,
- TEXTWIDTH, false ) ),
+ wxU( vlc_wraptext(methods_array[2].psz_address, TEXTWIDTH ) ),
wxDefaultPosition, wxDefaultSize );
address_txtctrl = new wxTextCtrl( this, -1, wxU(""), wxDefaultPosition,
/* Set the minimum size */
address_sizer->SetMinSize( address_sizer->GetSize() );
address_text->SetLabel( wxU(
- vlc_wraptext( _(methods_array[0].psz_address), TEXTWIDTH, false)));
+ vlc_wraptext( _(methods_array[0].psz_address), TEXTWIDTH )));
mainSizer->Add( method_sizer, 0, wxALL | wxEXPAND, 5 );
mainSizer->Add( address_sizer, 0, wxALL | wxEXPAND, 5 );
{
i_method = event.GetId() - MethodRadio0_Event;
address_text->SetLabel( wxU(
- vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH, false)));
+ vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH )));
address_sizer->Layout();
mainSizer->Layout();
}
* wraptext: inserts \n at convenient places to wrap the text.
* Returns the modified string in a new buffer.
*****************************************************************************/
-char *vlc_wraptext( const char *psz_text, int i_line, vlc_bool_t b_utf8 )
+char *vlc_wraptext( const char *psz_text, int i_line )
{
int i_len;
char *psz_line, *psz_new_text;
psz_line = psz_new_text = strdup( psz_text );
- if( b_utf8 )
- i_len = count_utf8_string( psz_text );
- else
- i_len = strlen( psz_text );
+ i_len = count_utf8_string( psz_text );
while( i_len > i_line )
{
int i_count = 0;
while( i_count <= i_line && *psz_parser != '\n' )
{
- if( b_utf8 )
- {
- while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
- }
+ while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
psz_parser++;
i_count++;
}
/* Find the furthest space. */
while( psz_parser > psz_line && *psz_parser != ' ' )
{
- if( b_utf8 )
- {
- while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser--;
- }
+ while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser--;
psz_parser--;
i_count--;
}
/* Wrapping has failed. Find the first space or newline */
while( i_count < i_len && *psz_parser != ' ' && *psz_parser != '\n' )
{
- if( b_utf8 )
- {
- while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
- }
+ while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
psz_parser++;
i_count++;
}