m_arrowCursor = new wxCursor(wxCURSOR_ARROW);
wxString name = wxTheApp->GetAppName();
- if (name.Length() <= 0) name = wxT("forty");
+ if ( name.empty() ) name = wxT("forty");
m_scoreFile = new ScoreFile(name);
m_game = new Game(0, 0, 0);
m_game->Deal();
*/
void FortyCanvas::UpdateScores()
{
- if (m_player.Length() > 0 && m_scoreFile && m_game)
+ if (!m_player.empty() && m_scoreFile && m_game)
{
m_scoreFile->WritePlayersScore(
m_player,
#if 0
// if player name not set (and selection dialog is not displayed)
// then ask the player for their name
- if (m_player.Length() == 0 && !m_playerDialog)
+ if (m_player.empty() && !m_playerDialog)
{
m_playerDialog = new PlayerSelectionDialog(this, m_scoreFile);
m_playerDialog->ShowModal();
m_player = m_playerDialog->GetPlayersName();
- if (m_player.Length() > 0)
+ if ( !m_player.empty() )
{
// user entered a name - lookup their score
int wins, games, score;
{
// if player name not set (and selection dialog is not displayed)
// then ask the player for their name
- if (m_player.Length() == 0 && !m_playerDialog)
+ if (m_player.empty() && !m_playerDialog)
{
m_playerDialog = new PlayerSelectionDialog(this, m_scoreFile);
m_playerDialog->ShowModal();
m_player = m_playerDialog->GetPlayersName();
- if (m_player.Length() > 0)
+ if ( !m_player.empty() )
{
// user entered a name - lookup their score
int wins, games, score;
if (event.GetId() == wxID_OK)
{
wxString name = m_textField->GetValue();
- if (!name.IsNull() && name.Length() > 0)
+ if ( !name.empty() )
{
if (name.Contains(wxT('@')))
{
void SetCustomButton( const wxString& custBtText,
wxArrayStringProperty* pcc )
{
- if ( custBtText.length() )
+ if ( !custBtText.empty() )
{
EnableCustomNewAction();
m_pCallingClass = pcc;
static int n = 0;
wxString text;
- if (ctrl_text.Length() > 0)
+ if ( !ctrl_text.empty() )
text = ctrl_text;
else
text.Printf(wxT("This is text box %d"), ++n);
wxString s = ::wxGetSingleChoice(wxT("Message"),
wxT("Caption"),
m_choices.GetLabels());
- if ( s.length() )
+ if ( !s.empty() )
{
SetValue(s);
return true;
WX_PG_TOKENIZER1_BEGIN(text,delimiter)
- if ( token.length() )
+ if ( !token.empty() )
{
// If token was invalid, exit the loop now
::wxSetCursor( *wxHOURGLASS_CURSOR );
- if ( filepath.length() )
+ if ( !filepath.empty() )
{
if ( pStr )
{
true);
}
- if ( text.length() )
+ if ( !text.empty() )
dc.DrawText(text,
rect.x + m_imgAreaWidth + 1,
rect.y + (rect.height-dc.GetCharHeight())/2);
}
// This must be done after creation
- if ( m_valueString.length() )
+ if ( !m_valueString.empty() )
{
iface->SetStringValue(m_valueString);
//Refresh();
{
wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawRotatedText - invalid DC") );
- if ( str.length() == 0 )
+ if ( str.empty() )
return;
if ( !m_logicalFunctionSupported )
return;
{
wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawText - invalid DC") );
- if ( str.length() == 0 )
+ if ( str.empty() )
return;
if ( !m_logicalFunctionSupported )
if (is_dir)
{
- if (m_Path.length() > 0 && m_Path.Last() != wxT('/') && m_Path.Last() != wxT(':'))
+ if (!m_Path.empty() && m_Path.Last() != wxT('/') && m_Path.Last() != wxT(':'))
m_Path << wxT('/');
}
right = rightPart.GetFullPath(wxPATH_UNIX);
}
- if (right.Length() && right.GetChar(0) == wxT('/')) right = right.Mid(1);
+ if (!right.empty() && right.GetChar(0) == wxT('/')) right = right.Mid(1);
if (!m_cache)
m_cache = new wxArchiveFSCache;
if (m_lastError != wxPROTO_NOERR)
return false;
- if (line.length() == 0)
+ if ( line.empty() )
break;
wxString left_str = line.BeforeFirst(':');
case wxHTTP_POST:
request = wxT("POST");
- if ( GetHeader( wxT("Content-Length") ).IsNull() )
+ if ( GetHeader( wxT("Content-Length") ).empty() )
SetHeader( wxT("Content-Length"), wxString::Format( wxT("%lu"), (unsigned long)m_post_buf.Len() ) );
break;
m_http_response = 0;
// If there is no User-Agent defined, define it.
- if (GetHeader(wxT("User-Agent")).IsNull())
+ if ( GetHeader(wxT("User-Agent")).empty() )
SetHeader(wxT("User-Agent"), wxT("wxWidgets 2.x"));
// Send authentication information
ok = ok && wxGIFHandler_WriteLoop(stream);
}
- if (comment.length())
+ if ( !comment.empty() )
{
ok = ok && wxGIFHandler_WriteComment(stream, comment);
}
wxStringImpl::iterator wxStringImpl::begin()
{
- if (length() > 0)
+ if ( !empty() )
CopyBeforeWrite();
return m_pchData;
}
wxStringImpl::iterator wxStringImpl::end()
{
- if (length() > 0)
+ if ( !empty() )
CopyBeforeWrite();
return m_pchData + length();
}
if ( length() >= str.length() )
{
// avoids a corner case later
- if ( length() == 0 && str.length() == 0 )
+ if ( empty() && str.empty() )
return 0;
// "top" is the point where search starts from
i != prefixes.end();
++i )
{
- if (i->length() == 0)
+ if ( i->empty() )
continue;
wxDir dir;
if ( !dir.Open(*i) )
{
if (m_scheme == info->m_protoname)
{
- if (m_port.IsNull())
+ if ( m_port.empty() )
m_port = info->m_servname;
m_protoinfo = info;
m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject();
// properties were written in the xml
for ( size_t j = 0; j < propertyNames.size(); ++j )
{
- if ( propertyNames[j].length() )
+ if ( !propertyNames[j].empty() )
{
PropertyNodes::iterator propiter = propertyNodes.find( propertyNames[j] );
if ( propiter != propertyNodes.end() )
if (m_colourChoice)
{
wxString name(wxTheColourDatabase->FindName(m_fontData.GetColour()));
- if (name.length())
- m_colourChoice->SetStringSelection(name);
- else
+ if ( name.empty() )
m_colourChoice->SetStringSelection(wxT("BLACK"));
+ else
+ m_colourChoice->SetStringSelection(name);
}
if (m_underLineCheckBox)
file << m_helpDir << wxFILE_SEP_PATH << contents;
if (file.Contains(wxT('#')))
file = file.BeforeLast(wxT('#'));
- if (contents.length() && wxFileExists(file))
+ if ( wxFileExists(file) )
rc = DisplaySection(WXEXTHELP_CONTENTS_ID);
// if not found, open homemade toc:
// Find initial selection
wxString strValue = m_combo->GetValue();
- if ( strValue.length() )
+ if ( !strValue.empty() )
m_value = m_strings.Index(strValue);
}
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
- if (value.IsNull()) return;
+ if ( value.empty() ) return;
gint pos = (gint)to;
#if wxUSE_UNICODE
static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* child )
{
wxString s = child->GetTitle();
- if (s.IsNull()) s = _("MDI child");
+ if ( s.empty() ) s = _("MDI child");
GtkWidget *label_widget = gtk_label_new( s.mbc_str() );
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
Widget shell = XtParent(fileSel);
- if (!m_message.IsNull())
+ if ( !m_message.empty() )
XtVaSetValues(shell,
XmNtitle, (const char*)m_message.mb_str(),
NULL);
#if 0
// TODO: Is this relevant? What does it do?
int noCols = 2;
- if (!value.IsNull() && (value.length() > (unsigned int) noCols))
+ if (!value.empty() && (value.length() > (unsigned int) noCols))
noCols = value.length();
XtVaSetValues((Widget) m_mainWidget,
XmNcolumns, noCols,
m_maxY = -10000;
// m_title = NULL;
- if (!file.IsNull() && wxFileExists(file))
+ if ( wxFileExists(file) )
wxRemoveFile(file);
- if (!file.IsNull() && (file != wxEmptyString))
- m_hDC = (WXHDC) CreateMetaFile(file);
- else
+ if ( file.empty() )
m_hDC = (WXHDC) CreateMetaFile(NULL);
+ else
+ m_hDC = (WXHDC) CreateMetaFile(file);
m_ok = (m_hDC != (WXHDC) 0) ;
int namedArgCount = 0;
int i;
for (i = 0; i < noArgs; i++)
- if (!INVOKEARG(i).GetName().IsNull())
+ if ( !INVOKEARG(i).GetName().empty() )
{
namedArgCount ++;
}
int j = 0;
for (i = 0; i < namedArgCount; i++)
{
- if (!INVOKEARG(i).GetName().IsNull())
+ if ( !INVOKEARG(i).GetName().empty() )
{
argNames[(namedArgCount-j)] = wxConvertStringToOle(INVOKEARG(i).GetName());
j ++;
//
// Must defer setting the title until after dialog is created and sized
//
- if (!rsTitle.IsNull())
+ if ( !rsTitle.empty() )
SetTitle(rsTitle);
return true;
} // end of wxDialog::Create
m_maxY = -10000;
// m_title = NULL;
- if (!file.IsNull() && wxFileExists(file))
+ if ( wxFileExists(file) )
wxRemoveFile(file);
// TODO
m_vLastY = m_yMargin;
}
pTool->m_vX = m_vLastX + pTool->GetWidth();
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
+ if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
pTool->m_vY = m_vLastY + (nMaxToolHeight - m_vTextY) + m_toolPacking;
else
pTool->m_vY = m_vLastY + (nMaxToolHeight - (int)(pTool->GetHeight()/2));
{
RaiseTool(pTool);
}
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
+ if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
{
wxCoord vX;
wxCoord vY;
,pTool->m_vY
,bUseMask
);
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
+ if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
{
wxCoord vX;
wxCoord vY;
{
wxToolBarTool* pTool = (wxToolBarTool *)node->GetData();
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
+ if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
{
if ((vX >= (pTool->m_vX - ((wxCoord)(pTool->GetWidth()/2) - 2))) &&
(vY >= (pTool->m_vY - 2)) &&
}
CFRelease( flavorTypeArray );
}
- if (filenamesPassed.length() > 0)
+ if ( !filenamesPassed.empty() )
{
wxCharBuffer buf = filenamesPassed.fn_str();
SetData( wxDF_FILENAME, strlen( buf ), (const char*)buf );
wxString extension = m_extensions[i];
// Remove leading '*'
- if (extension.length() && (extension.GetChar(0) == '*'))
+ if ( !extension.empty() && (extension.GetChar(0) == '*') )
extension = extension.Mid( 1 );
// Remove leading '.'
- if (extension.length() && (extension.GetChar(0) == '.'))
+ if ( !extension.empty() && (extension.GetChar(0) == '.') )
extension = extension.Mid( 1 );
if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator ))
{
const UtiMap::const_iterator itr = m_utiMap.find( uti );
- if( itr == m_utiMap.end() || itr->second.description.IsNull() )
+ if( itr == m_utiMap.end() || itr->second.description.empty() )
{
*desc = wxEmptyString;
return false;
wxString faceName = font.GetFaceName();
// If font was not in there, add it now
- if ( faceName.length() &&
+ if ( !faceName.empty() &&
wxPGGlobalVars->m_fontFamilyChoices->Index(faceName) == wxNOT_FOUND )
wxPGGlobalVars->m_fontFamilyChoices->AddAsSorted(faceName);
else
drawFace = m_value_wxFont.GetFaceName();
- if ( drawFace.length() )
+ if ( !drawFace.empty() )
{
// Draw the background
dc.SetBrush( wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)) );
const wxString& wxPGGetDefaultImageWildcard()
{
// Form the wildcard, if not done yet
- if ( !wxPGGlobalVars->m_pDefaultImageWildcard.length() )
+ if ( wxPGGlobalVars->m_pDefaultImageWildcard.empty() )
{
wxString str;
if ( !dateTime.IsValid() )
return wxT("Invalid");
- if ( !ms_defaultDateFormat.length() )
+ if ( ms_defaultDateFormat.empty() )
{
#if wxUSE_DATEPICKCTRL
bool showCentury = m_dpStyle & wxDP_SHOWCENTURY ? true : false;
ms_defaultDateFormat = DetermineDefaultDateFormat( showCentury );
}
- if ( m_format.length() &&
+ if ( !m_format.empty() &&
!(argFlags & wxPG_FULL_VALUE) )
format = m_format.c_str();
wxTextCtrl* tc = wxStaticCast(ctrl, wxTextCtrl);
wxString textVal = tc->GetValue();
- if ( property->UsesAutoUnspecified() && !textVal.length() )
+ if ( property->UsesAutoUnspecified() && textVal.empty() )
{
variant.MakeNull();
return true;
if ( index >= 0 && index < (int)cb->GetCount() )
{
cb->SetSelection( index );
- if ( defString.length() )
+ if ( !defString.empty() )
cb->SetText( defString );
}
- else if ( !(extraStyle & wxCB_READONLY) && defString.length() )
+ else if ( !(extraStyle & wxCB_READONLY) && !defString.empty() )
{
propGrid->SetupTextCtrlValue(defString);
cb->SetValue( defString );
wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
wxString textVal = cb->GetValue();
- if ( property->UsesAutoUnspecified() && !textVal.length() )
+ if ( property->UsesAutoUnspecified() && textVal.empty() )
{
variant.MakeNull();
return true;
state->InitNonCatMode();
}
- if ( label.length() )
+ if ( !label.empty() )
{
wxASSERT_MSG( !pageObj->m_label.length(),
wxT("If page label is given in constructor, empty label must be given in AddPage"));
{
text = propertyGrid->GetCommonValueLabel(cmnVal);
DrawText( dc, rect, 0, text );
- if ( text.length() )
+ if ( !text.empty() )
return true;
}
return false;
if ( propertyGrid->GetColumnCount() <= 2 )
{
wxString unitsString = property->GetAttribute(wxPGGlobalVars->m_strUnits, wxEmptyString);
- if ( unitsString.length() )
+ if ( !unitsString.empty() )
text = wxString::Format(wxS("%s %s"), text.c_str(), unitsString.c_str() );
}
}
- if ( text.length() == 0 )
+ if ( text.empty() )
{
text = property->GetHintText();
- if ( text.length() > 0 )
+ if ( !text.empty() )
{
res = true;
{
wxPGProperty* parent = GetParent();
- if ( !m_name.length() || !parent || parent->IsCategory() || parent->IsRoot() )
+ if ( m_name.empty() || !parent || parent->IsCategory() || parent->IsRoot() )
return m_name;
return m_parent->GetName() + wxS(".") + m_name;
(*childResults)[curChild->GetName()] = s;
bool skip = false;
- if ( (argFlags & wxPG_UNEDITABLE_COMPOSITE_FRAGMENT) && !s.length() )
+ if ( (argFlags & wxPG_UNEDITABLE_COMPOSITE_FRAGMENT) && s.empty() )
skip = true;
if ( !curChild->GetChildCount() || skip )
token = text.substr(startPos,pos-startPos-1);
- if ( !token.length() )
+ if ( token.empty() )
break;
const wxPGProperty* child = Item(curChild);
{
const wxChar* fs = gs_propFlagToString[i];
wxASSERT(fs);
- if ( s.length() )
+ if ( !s.empty() )
s << wxS("|");
s << fs;
}
wxString& wxPropertyGrid::ExpandEscapeSequences( wxString& dst_str, wxString& src_str )
{
- if ( src_str.length() == 0 )
+ if ( src_str.empty() )
{
dst_str = src_str;
return src_str;
wxString& wxPropertyGrid::CreateEscapeSequences( wxString& dst_str, wxString& src_str )
{
- if ( src_str.length() == 0 )
+ if ( src_str.empty() )
{
dst_str = src_str;
return src_str;
void wxPropertyGrid::DoShowPropertyError( wxPGProperty* WXUNUSED(property), const wxString& msg )
{
- if ( !msg.length() )
+ if ( msg.empty() )
return;
#if wxUSE_STATUSBAR
{
wxString msg = m_validationInfo.m_failureMessage;
- if ( !msg.length() )
+ if ( msg.empty() )
msg = _("You have entered invalid value. Press ESC to cancel editing.");
#if wxUSE_STATUSBAR
wxStatusBar* statusbar = GetStatusBar();
if ( statusbar )
{
- if ( pHelpString && pHelpString->length() )
+ if ( pHelpString && !pHelpString->empty() )
{
// Set help box text.
statusbar->SetStatusText( *pHelpString );
//
// Show help as a tool tip on the editor control.
//
- if ( pHelpString && pHelpString->length() &&
+ if ( pHelpString && !pHelpString->empty() &&
primaryCtrl )
{
primaryCtrl->SetToolTip(*pHelpString);
RegisterDefaultEditors();
wxString name = editorName;
- if ( name.length() == 0 )
+ if ( name.empty() )
name = editorClass->GetName();
// Existing editor under this name?
else
{
bool found = false;
- if ( idString.length() )
+ if ( !idString.empty() )
{
wxPGHashMapS2P::iterator it = m_dictIdChoices.find(idString);
if ( it != m_dictIdChoices.end() )
}
// Assign to id
- if ( idString.length() )
+ if ( !idString.empty() )
m_dictIdChoices[idString] = choices.GetData();
}
}
wxString valuel = value.Lower();
wxVariant variant;
- if ( type.length() == 0 )
+ if ( type.empty() )
{
long v;
wxPG_PROP_ARG_CALL_PROLOG()
wxPGCell& cell = p->GetCell(column);
- if ( text.length() && text != wxPG_LABEL )
+ if ( !text.empty() && text != wxPG_LABEL )
cell.SetText(text);
if ( bitmap.IsOk() )
cell.SetBitmap(bitmap);
}
// Remove last '|'
- if ( result.length() )
+ if ( !result.empty() )
result.RemoveLast();
return result;
{
if ( pageState->IsDisplayed() )
{
- if ( values[0].length() )
+ if ( !values[0].empty() )
newSelection = GetPropertyByName(value);
pgSelectionSet = true;
}
else
{
- if ( values[0].length() )
+ if ( !values[0].empty() )
pageState->DoSetSelection(GetPropertyByName(value));
else
pageState->DoClearSelection();
if ( parent->IsCategory() || parent->IsRoot() )
{
- if ( p->GetBaseName().length() )
+ if ( !p->GetBaseName().empty() )
m_dictName.erase( p->GetBaseName() );
- if ( newName.length() )
+ if ( !newName.empty() )
m_dictName[newName] = (void*) p;
}
wxASSERT( wxStrcmp(current->GetClassInfo()->GetClassName(),wxT("wxVariant")) == 0 );
const wxString& name = current->GetName();
- if ( name.length() > 0 )
+ if ( !name.empty() )
{
//
// '@' signified a special entry
wxVariant *current = (wxVariant*)*node;
const wxString& name = current->GetName();
- if ( name.length() > 0 )
+ if ( !name.empty() )
{
//
// '@' signified a special entry
}
// Only add name to hashmap if parent is root or category
- if ( property->m_name.length() &&
+ if ( !property->m_name.empty() &&
(parentIsCategory || parentIsRoot) )
m_dictName[property->m_name] = (void*) property;
}
}
- if ( item->GetBaseName().length() &&
+ if ( !item->GetBaseName().empty() &&
(parent->IsCategory() || parent->IsRoot()) )
m_dictName.erase(item->GetBaseName());
wxTextCtrl* tc = static_cast<wxTextCtrl*>(wnd);
wxString text = tc->GetValue();
- if ( !text.length() )
+ if ( text.empty() )
return false;
return true;
wxString s;
long value32;
- if ( text.length() == 0 )
+ if ( text.empty() )
{
variant.MakeNull();
return true;
wxString variantType = variant.GetType();
bool isPrevLong = variantType == wxPG_VARIANT_TYPE_LONG;
- if ( text.length() == 0 )
+ if ( text.empty() )
{
variant.MakeNull();
return true;
if (!precTemplate)
precTemplate = &text1;
- if ( !precTemplate->length() )
+ if ( precTemplate->empty() )
{
*precTemplate = wxS("%.");
*precTemplate << wxString::Format( wxS("%i"), precision );
target.Printf( wxS("%f"), value );
}
- if ( removeZeroes && precision != 0 && target.length() )
+ if ( removeZeroes && precision != 0 && !target.empty() )
{
// Remove excess zeroes (do not remove this code just yet,
// since sprintf can't do the same consistently across platforms).
wxString s;
double value;
- if ( text.length() == 0 )
+ if ( text.empty() )
{
variant.MakeNull();
return true;
text.CmpNoCase(m_label) == 0 )
boolValue = true;
- if ( text.length() == 0 )
+ if ( text.empty() )
{
variant.MakeNull();
return true;
// semicolons are no longer valid delimeters
WX_PG_TOKENIZER1_BEGIN(text,wxS(','))
- if ( token.length() )
+ if ( !token.empty() )
{
// Determine which one it is
long bit = IdToBit( token );
path = filename.GetPath();
indFilter = fileProp->m_indFilter;
- if ( !path.length() && fileProp->m_basePath.length() )
+ if ( path.empty() && !fileProp->m_basePath.empty() )
path = fileProp->m_basePath;
}
else
}
// Find index for extension.
- if ( m_indFilter < 0 && fnstr.length() )
+ if ( m_indFilter < 0 && !fnstr.empty() )
{
wxString ext = filename.GetExt();
int curind = 0;
pos = len;
wxString found_ext = m_wildcard.substr(ext_begin, pos-ext_begin);
- if ( found_ext.length() > 0 )
+ if ( !found_ext.empty() )
{
if ( found_ext[0] == wxS('*') )
{
return wxEmptyString;
wxString fullName = filename.GetFullName();
- if ( !fullName.length() )
+ if ( fullName.empty() )
return wxEmptyString;
if ( argFlags & wxPG_FULL_VALUE )
}
else if ( m_flags & wxPG_PROP_SHOW_FULL_FILENAME )
{
- if ( m_basePath.Length() )
+ if ( !m_basePath.empty() )
{
wxFileName fn2(filename);
fn2.MakeRelativeTo(m_basePath);
wxBoxSizer* topsizer = new wxBoxSizer( wxVERTICAL );
// Message
- if ( message.length() )
+ if ( !message.empty() )
topsizer->Add( new wxStaticText(this,-1,message),
0, wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxALL, spacing );
if ( flags & Escape )
{
str.Replace( wxS("\\"), wxS("\\\\"), true );
- if ( pdr.length() )
+ if ( !pdr.empty() )
str.Replace( preas, pdr, true );
}
int length = action->GetNewParagraphs().GetOwnRange().GetLength();
- if (text.length() > 0 && text.Last() != wxT('\n'))
+ if (!text.empty() && text.Last() != wxT('\n'))
{
// Don't count the newline when undoing
length --;
action->GetNewParagraphs().SetPartialParagraph(true);
}
- else if (text.length() > 0 && text.Last() == wxT('\n'))
+ else if (!text.empty() && text.Last() == wxT('\n'))
length --;
action->SetPosition(pos);
stc->GetEventHandler()->ProcessEvent(evt);
dragText = evt.GetDragText();
- if (dragText.length()) {
+ if ( !dragText.empty() ) {
wxDropSource source(stc);
wxTextDataObject data(dragText);
wxDragResult result;
void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno)
{
- if(hostname.length() == 0)
+ if( hostname.empty() )
{
m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST;
m_BeaconPort = 80;
// does hostname contain a port number?
wxString port = hostname.After(wxT(':'));
- if(port.length())
+ if( !port.empty() )
{
m_BeaconHost = hostname.Before(wxT(':'));
m_BeaconPort = wxAtoi(port);
{
wxLogNull ln; // suppress all error messages
- wxASSERT_MSG( m_IfconfigPath.length(),
+ wxASSERT_MSG( !m_IfconfigPath.empty(),
wxT("can't use ifconfig if it wasn't found") );
wxString tmpfile = wxFileName::CreateTempFileName( wxT("_wxdialuptest") );
{
/// does hostname contain a port number?
wxString port = hostname.After(':');
- if(port.Length())
+ if(port.empty())
{
- m_BeaconHost = hostname.Before(':');
- m_BeaconPort = atoi(port);
+ m_BeaconHost = hostname;
+ m_BeaconPort = portno;
}
else
{
- m_BeaconHost = hostname;
- m_BeaconPort = portno;
+ m_BeaconHost = hostname.Before(':');
+ m_BeaconPort = atoi(port);
}
}
// Let's try the ifconfig method first, should be fastest:
if(m_CanUseIfconfig != 0) // unknown or yes
{
- wxASSERT(m_IfconfigPath.length());
+ wxASSERT( !m_IfconfigPath.empty() );
wxString tmpfile = wxFileName::CreateTempFileName("_wxdialuptest");
wxString cmd = "/bin/sh -c \'";
size_t pos = 0;
wxString token( GetNextToken( line, pos ) );
- while (!token.IsNull())
+ while ( !token.empty() )
{
if (m_keywords.Index( token ) != wxNOT_FOUND)
{
{
const XRCWidgetData& w = m_wdata.Item(i);
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
- if( w.GetName().Length() == 0 ) continue;
+ if( w.GetName().empty() ) continue;
file.Write(
wxT(" ") + w.GetClass() + wxT("* ") + w.GetName()
+ wxT(";\n"));
{
const XRCWidgetData& w = m_wdata.Item(i);
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
- if( w.GetName().Length() == 0 ) continue;
+ if( w.GetName().empty() ) continue;
file.Write( wxT(" ")
+ w.GetName()
+ wxT(" = XRCCTRL(*this,\"")