if ( name == wxPG_STRING_PASSWORD )
{
m_flags &= ~(wxPG_PROP_PASSWORD);
- if ( wxPGVariantToInt(value) ) m_flags |= wxPG_PROP_PASSWORD;
+ if ( value.GetLong() ) m_flags |= wxPG_PROP_PASSWORD;
RecreateEditor();
return false;
}
{
return wxString::Format(wxS("%li"),value.GetLong());
}
- else if ( value.GetType() == wxLongLong_VariantType )
+ else if ( value.GetType() == wxPG_VARIANT_TYPE_LONGLONG )
{
- wxLongLong ll;
- ll << value;
+ wxLongLong ll = value.GetLongLong();
return ll.ToString();
}
int firstNonZeroPos = 0;
- for ( ; i != iMax; i++ )
+ for ( ; i != iMax; ++i )
{
wxChar c = *i;
if ( c != wxS('0') && c != wxS(' ') )
{
bool doChangeValue = isPrevLong;
- if ( !isPrevLong && variantType == wxLongLong_VariantType )
+ if ( !isPrevLong && variantType == wxPG_VARIANT_TYPE_LONGLONG )
{
- wxLongLong oldValue;
- oldValue << variant;
+ wxLongLong oldValue = variant.GetLongLong();
if ( oldValue.GetValue() != value64 )
doChangeValue = true;
}
if ( doChangeValue )
{
wxLongLong ll(value64);
- variant << ll;
+ variant = ll;
return true;
}
}
variant = property->GetAttribute(wxPGGlobalVars->m_strMin);
if ( !variant.IsNull() )
{
- wxPGVariantToLongLong(variant, &min);
+ min = variant.GetLongLong().GetValue();
minOk = true;
}
variant = property->GetAttribute(wxPGGlobalVars->m_strMax);
if ( !variant.IsNull() )
{
- wxPGVariantToLongLong(variant, &max);
+ max = variant.GetLongLong().GetValue();
maxOk = true;
}
return true;
}
-bool wxIntProperty::ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const
+bool wxIntProperty::ValidateValue( wxVariant& value,
+ wxPGValidationInfo& validationInfo ) const
{
- wxLongLong_t ll;
- if ( wxPGVariantToLongLong(value, &ll) )
- return DoValidation(this, ll, &validationInfo, wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);
- return true;
+ wxLongLong_t ll = value.GetLongLong().GetValue();
+ return DoValidation(this, ll, &validationInfo,
+ wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);
}
wxValidator* wxIntProperty::GetClassValidator()
if ( value.GetType() == wxPG_VARIANT_TYPE_LONG )
{
- return wxString::Format(gs_uintTemplates32[index], (unsigned long)value.GetLong());
+ return wxString::Format(gs_uintTemplates32[index],
+ (unsigned long)value.GetLong());
}
- wxULongLong ull;
- ull << value;
+ wxULongLong ull = value.GetULongLong();
return wxString::Format(gs_uintTemplates64[index], ull.GetValue());
}
{
bool doChangeValue = isPrevLong;
- if ( !isPrevLong && variantType == wxULongLong_VariantType )
+ if ( !isPrevLong && variantType == wxPG_VARIANT_TYPE_ULONGLONG )
{
- wxULongLong oldValue;
- oldValue << variant;
+ wxULongLong oldValue = variant.GetULongLong();
if ( oldValue.GetValue() != value64 )
doChangeValue = true;
}
if ( doChangeValue )
{
- wxULongLong ull(value64);
- variant << ull;
+ variant = wxULongLong(value64);
return true;
}
}
return false;
}
-#ifdef ULLONG_MAX
- #define wxUINT64_MAX ULLONG_MAX
- #define wxUINT64_MIN wxULL(0)
-#else
- #define wxUINT64_MAX wxULL(0xFFFFFFFFFFFFFFFF)
- #define wxUINT64_MIN wxULL(0)
-#endif
-
bool wxUIntProperty::ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const
{
// Check for min/max
- wxULongLong_t ll;
- if ( wxPGVariantToULongLong(value, &ll) )
- {
- wxULongLong_t min = wxUINT64_MIN;
- wxULongLong_t max = wxUINT64_MAX;
- wxVariant variant;
+ wxULongLong_t ll = value.GetULongLong().GetValue();
+
+ wxULongLong_t min = 0;
+ wxULongLong_t max = wxUINT64_MAX;
+ wxVariant variant;
- variant = GetAttribute(wxPGGlobalVars->m_strMin);
- if ( !variant.IsNull() )
+ variant = GetAttribute(wxPGGlobalVars->m_strMin);
+ if ( !variant.IsNull() )
+ {
+ min = variant.GetULongLong().GetValue();
+ if ( ll < min )
{
- wxPGVariantToULongLong(variant, &min);
- if ( ll < min )
- {
- validationInfo.SetFailureMessage(
- wxString::Format(_("Value must be %llu or higher"),min)
- );
- return false;
- }
+ validationInfo.SetFailureMessage(
+ wxString::Format(_("Value must be %llu or higher"),min)
+ );
+ return false;
}
- variant = GetAttribute(wxPGGlobalVars->m_strMax);
- if ( !variant.IsNull() )
+ }
+ variant = GetAttribute(wxPGGlobalVars->m_strMax);
+ if ( !variant.IsNull() )
+ {
+ max = variant.GetULongLong().GetValue();
+ if ( ll > max )
{
- wxPGVariantToULongLong(variant, &max);
- if ( ll > max )
- {
- validationInfo.SetFailureMessage(
- wxString::Format(_("Value must be %llu or less"),max)
- );
- return false;
- }
+ validationInfo.SetFailureMessage(
+ wxString::Format(_("Value must be %llu or less"),max)
+ );
+ return false;
}
}
+
return true;
}
wxString::const_iterator i = target.end() - 1;
size_t new_len = target.length() - 1;
- for ( ; i != target.begin(); i-- )
+ for ( ; i != target.begin(); --i )
{
if ( *i != wxS('0') )
break;
value,
m_precision,
!(argFlags & wxPG_FULL_VALUE),
- (wxString*) NULL);
+ NULL);
}
return text;
}
return false;
}
-bool wxFloatProperty::DoValidation( const wxPGProperty* property, double& value, wxPGValidationInfo* pValidationInfo, int mode )
+bool wxFloatProperty::DoValidation( const wxPGProperty* property,
+ double& value,
+ wxPGValidationInfo* pValidationInfo,
+ int mode )
{
// Check for min/max
double min = (double)wxINT64_MIN;
variant = property->GetAttribute(wxPGGlobalVars->m_strMin);
if ( !variant.IsNull() )
{
- wxPGVariantToDouble(variant, &min);
+ min = variant.GetDouble();
minOk = true;
}
variant = property->GetAttribute(wxPGGlobalVars->m_strMax);
if ( !variant.IsNull() )
{
- wxPGVariantToDouble(variant, &max);
+ max = variant.GetDouble();
maxOk = true;
}
if ( maxOk )
{
- wxPGVariantToDouble(variant, &max);
+ max = variant.GetDouble();
if ( value > max )
{
if ( mode == wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE )
return true;
}
-bool wxFloatProperty::ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const
+bool
+wxFloatProperty::ValidateValue( wxVariant& value,
+ wxPGValidationInfo& validationInfo ) const
{
- double fpv;
- if ( wxPGVariantToDouble(value, &fpv) )
- return DoValidation(this, fpv, &validationInfo, wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);
- return true;
+ double fpv = value.GetDouble();
+ return DoValidation(this, fpv, &validationInfo,
+ wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);
}
bool wxFloatProperty::DoSetAttribute( const wxString& name, wxVariant& value )
#if wxPG_INCLUDE_CHECKBOX
if ( name == wxPG_BOOL_USE_CHECKBOX )
{
- int ival = wxPGVariantToInt(value);
- if ( ival )
+ if ( value.GetLong() )
m_flags |= wxPG_PROP_USE_CHECKBOX;
else
m_flags &= ~(wxPG_PROP_USE_CHECKBOX);
#endif
if ( name == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING )
{
- int ival = wxPGVariantToInt(value);
- if ( ival )
+ if ( value.GetLong() )
m_flags |= wxPG_PROP_USE_DCC;
else
m_flags &= ~(wxPG_PROP_USE_DCC);
}
// -----------------------------------------------------------------------
-// wxBaseEnumProperty
+// wxEnumProperty
// -----------------------------------------------------------------------
-int wxBaseEnumProperty::ms_nextIndex = -2;
+IMPLEMENT_DYNAMIC_CLASS(wxEnumProperty, wxPGProperty)
+
+WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEnumProperty,long,Choice)
+
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+ const long* values, int value ) : wxPGProperty(label,name)
+{
+ SetIndex(0);
+
+ if ( labels )
+ {
+ m_choices.Add(labels,values);
+
+ if ( GetItemCount() )
+ SetValue( (long)value );
+ }
+}
+
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+ const long* values, wxPGChoices* choicesCache, int value )
+ : wxPGProperty(label,name)
+{
+ SetIndex(0);
+
+ wxASSERT( choicesCache );
+
+ if ( choicesCache->IsOk() )
+ {
+ m_choices.Assign( *choicesCache );
+ m_value = wxPGVariant_Zero;
+ }
+ else if ( labels )
+ {
+ m_choices.Add(labels,values);
+
+ if ( GetItemCount() )
+ SetValue( (long)value );
+ }
+}
+
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
+ const wxArrayString& labels, const wxArrayInt& values, int value )
+ : wxPGProperty(label,name)
+{
+ SetIndex(0);
+
+ if ( &labels && labels.size() )
+ {
+ m_choices.Set(labels, values);
-wxBaseEnumProperty::wxBaseEnumProperty( const wxString& label, const wxString& name )
+ if ( GetItemCount() )
+ SetValue( (long)value );
+ }
+}
+
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
+ wxPGChoices& choices, int value )
: wxPGProperty(label,name)
{
- m_value = wxPGVariant_Zero;
+ m_choices.Assign( choices );
+
+ if ( GetItemCount() )
+ SetValue( (long)value );
}
-/** If has values array, then returns number at index with value -
- otherwise just returns the value.
-*/
-int wxBaseEnumProperty::GetIndexForValue( int value ) const
+int wxEnumProperty::GetIndexForValue( int value ) const
{
+ if ( !m_choices.IsOk() )
+ return -1;
+
+ int intVal = m_choices.Index(value);
+ if ( intVal >= 0 )
+ return intVal;
+
return value;
}
-void wxBaseEnumProperty::OnSetValue()
+wxEnumProperty::~wxEnumProperty ()
+{
+}
+
+int wxEnumProperty::ms_nextIndex = -2;
+
+void wxEnumProperty::OnSetValue()
{
wxString variantType = m_value.GetType();
else if ( variantType == wxPG_VARIANT_TYPE_STRING )
ValueFromString_( m_value, m_value.GetString(), 0 );
else
- wxASSERT( false );
+ wxFAIL;
if ( ms_nextIndex != -2 )
{
}
}
-bool wxBaseEnumProperty::ValidateValue( wxVariant& value, wxPGValidationInfo& WXUNUSED(validationInfo) ) const
+bool wxEnumProperty::ValidateValue( wxVariant& value, wxPGValidationInfo& WXUNUSED(validationInfo) ) const
{
// Make sure string value is in the list,
// unless property has string as preferred value type
return true;
}
-wxString wxBaseEnumProperty::ValueToString( wxVariant& value,
+wxString wxEnumProperty::ValueToString( wxVariant& value,
int WXUNUSED(argFlags) ) const
{
if ( value.GetType() == wxPG_VARIANT_TYPE_STRING )
return m_choices.GetLabel(index);
}
-bool wxBaseEnumProperty::StringToValue( wxVariant& variant, const wxString& text, int argFlags ) const
+bool wxEnumProperty::StringToValue( wxVariant& variant, const wxString& text, int argFlags ) const
{
return ValueFromString_( variant, text, argFlags );
}
-bool wxBaseEnumProperty::IntToValue( wxVariant& variant, int intVal, int argFlags ) const
+bool wxEnumProperty::IntToValue( wxVariant& variant, int intVal, int argFlags ) const
{
return ValueFromInt_( variant, intVal, argFlags );
}
-bool wxBaseEnumProperty::ValueFromString_( wxVariant& value, const wxString& text, int argFlags ) const
+bool wxEnumProperty::ValueFromString_( wxVariant& value, const wxString& text, int argFlags ) const
{
- size_t i = 0;
- const wxString* entryLabel;
- int entryValue;
int useIndex = -1;
long useValue = 0;
- entryLabel = GetEntry(i, &entryValue);
- while ( entryLabel )
+ for ( unsigned int i=0; i<m_choices.GetCount(); i++ )
{
- if ( text.CmpNoCase(*entryLabel) == 0 )
+ const wxString& entryLabel = m_choices.GetLabel(i);
+ if ( text.CmpNoCase(entryLabel) == 0 )
{
useIndex = (int)i;
- useValue = (long)entryValue;
+ useValue = m_choices.GetValue(i);
break;
}
-
- i++;
- entryLabel = GetEntry(i, &entryValue);
}
bool asText = false;
setAsNextIndex = -1;
value = text;
}
- else if ( m_index != useIndex )
+ else if ( useIndex != GetIndex() )
{
if ( useIndex != -1 )
{
return false;
}
-bool wxBaseEnumProperty::ValueFromInt_( wxVariant& variant, int intVal, int argFlags ) const
+bool wxEnumProperty::ValueFromInt_( wxVariant& variant, int intVal, int argFlags ) const
{
// If wxPG_FULL_VALUE is *not* in argFlags, then intVal is index from combo box.
//
}
else
{
- if ( m_index != intVal )
+ if ( intVal != GetIndex() )
{
ms_nextIndex = intVal;
}
if ( ms_nextIndex != -2 )
{
if ( !(argFlags & wxPG_FULL_VALUE) )
- GetEntry(intVal, &intVal);
+ intVal = m_choices.GetValue(intVal);
variant = (long)intVal;
return false;
}
-void wxBaseEnumProperty::SetIndex( int index )
+void
+wxEnumProperty::OnValidationFailure( wxVariant& WXUNUSED(pendingValue) )
{
- ms_nextIndex = -2;
- m_index = index;
+ // Revert index
+ ResetNextIndex();
}
-int wxBaseEnumProperty::GetIndex() const
+void wxEnumProperty::SetIndex( int index )
{
- if ( ms_nextIndex != -2 )
- return ms_nextIndex;
- return m_index;
-}
-
-// -----------------------------------------------------------------------
-// wxEnumProperty
-// -----------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxEnumProperty, wxPGProperty)
-
-WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEnumProperty,long,Choice)
-
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
- const long* values, int value ) : wxBaseEnumProperty(label,name)
-{
- SetIndex(0);
-
- if ( labels )
- {
- m_choices.Add(labels,values);
-
- if ( GetItemCount() )
- SetValue( (long)value );
- }
-}
-
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
- const long* values, wxPGChoices* choicesCache, int value )
- : wxBaseEnumProperty(label,name)
-{
- SetIndex(0);
-
- wxASSERT( choicesCache );
-
- if ( choicesCache->IsOk() )
- {
- m_choices.Assign( *choicesCache );
- m_value = wxPGVariant_Zero;
- }
- else if ( labels )
- {
- m_choices.Add(labels,values);
-
- if ( GetItemCount() )
- SetValue( (long)value );
- }
-}
-
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
- const wxArrayString& labels, const wxArrayInt& values, int value ) : wxBaseEnumProperty(label,name)
-{
- SetIndex(0);
-
- if ( &labels && labels.size() )
- {
- m_choices.Set(labels, values);
-
- if ( GetItemCount() )
- SetValue( (long)value );
- }
-}
-
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
- wxPGChoices& choices, int value )
- : wxBaseEnumProperty(label,name)
-{
- m_choices.Assign( choices );
-
- if ( GetItemCount() )
- SetValue( (long)value );
+ ms_nextIndex = -2;
+ m_index = index;
}
-int wxEnumProperty::GetIndexForValue( int value ) const
+int wxEnumProperty::GetIndex() const
{
- if ( !m_choices.IsOk() )
+ if ( m_value.IsNull() )
return -1;
- if ( m_choices.HasValues() )
- {
- int intVal = m_choices.Index(value);
- if ( intVal >= 0 )
- return intVal;
- }
-
- return value;
-}
-
-wxEnumProperty::~wxEnumProperty ()
-{
-}
-
-const wxString* wxEnumProperty::GetEntry( size_t index, int* pvalue ) const
-{
- if ( m_choices.IsOk() && index < m_choices.GetCount() )
- {
- int value = (int)index;
- if ( m_choices.HasValue(index) )
- value = m_choices.GetValue(index);
-
- if ( pvalue )
- *pvalue = value;
+ if ( ms_nextIndex != -2 )
+ return ms_nextIndex;
- return &m_choices.GetLabel(index);
- }
- return (const wxString*) NULL;
+ return m_index;
}
// -----------------------------------------------------------------------
void wxFlagsProperty::Init()
{
- SetParentalType(wxPG_PROP_AGGREGATE);
-
long value = m_value;
//
m_children.clear();
+ // Relay wxPG_BOOL_USE_CHECKBOX and wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING
+ // to child bool property controls.
+ long attrUseCheckBox = GetAttributeAsLong(wxPG_BOOL_USE_CHECKBOX, 0);
+ long attrUseDCC = GetAttributeAsLong(wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING,
+ 0);
+
if ( m_choices.IsOk() )
{
const wxPGChoices& choices = m_choices;
for ( i=0; i<GetItemCount(); i++ )
{
bool child_val;
- if ( choices.HasValue(i) )
- child_val = ( value & choices.GetValue(i) )?true:false;
- else
- child_val = ( value & (1<<i) )?true:false;
+ child_val = ( value & choices.GetValue(i) )?true:false;
wxPGProperty* boolProp;
wxString label = GetLabel(i);
{
boolProp = new wxBoolProperty( label, label, child_val );
}
- AddChild(boolProp);
+ if ( attrUseCheckBox )
+ boolProp->SetAttribute(wxPG_BOOL_USE_CHECKBOX,
+ true);
+ if ( attrUseDCC )
+ boolProp->SetAttribute(wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING,
+ true);
+ AddPrivateChild(boolProp);
}
m_oldChoicesData = m_choices.GetDataPtr();
wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
const wxChar** labels, const long* values, long value ) : wxPGProperty(label,name)
{
- m_oldChoicesData = (wxPGChoicesData*) NULL;
+ m_oldChoicesData = NULL;
if ( labels )
{
const wxArrayString& labels, const wxArrayInt& values, int value )
: wxPGProperty(label,name)
{
- m_oldChoicesData = (wxPGChoicesData*) NULL;
+ m_oldChoicesData = NULL;
if ( &labels && labels.size() )
{
wxPGChoices& choices, long value )
: wxPGProperty(label,name)
{
- m_oldChoicesData = (wxPGChoicesData*) NULL;
+ m_oldChoicesData = NULL;
if ( choices.IsOk() )
{
const wxPGChoices& choices = m_choices;
for ( i = 0; i < GetItemCount(); i++ )
{
- if ( choices.HasValue(i) )
- fullFlags |= choices.GetValue(i);
- else
- fullFlags |= (1<<i);
+ fullFlags |= choices.GetValue(i);
}
val &= fullFlags;
{
int flag;
- if ( choices.HasValue(i) )
- flag = choices.GetValue(i);
- else
- flag = (1<<i);
+ flag = choices.GetValue(i);
if ( (newFlags & flag) != (m_oldValue & flag) )
Item(i)->SetFlag( wxPG_PROP_MODIFIED );
for ( i = 0; i < GetItemCount(); i++ )
{
int doAdd;
- if ( choices.HasValue(i) )
- doAdd = ( flags & choices.GetValue(i) );
- else
- doAdd = ( flags & (1<<i) );
+ doAdd = ( flags & choices.GetValue(i) );
if ( doAdd )
{
{
if ( id == GetLabel(i) )
{
- if ( m_choices.HasValue(i) )
- return m_choices.GetValue(i);
- return (1<<i);
+ return m_choices.GetValue(i);
}
}
return -1;
{
long flag;
- if ( choices.HasValue(i) )
- flag = choices.GetValue(i);
- else
- flag = (1<<i);
+ flag = choices.GetValue(i);
long subVal = flags & flag;
wxPGProperty* p = Item(i);
m_oldValue = flags;
}
-void wxFlagsProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
+wxVariant wxFlagsProperty::ChildChanged( wxVariant& thisValue,
+ int childIndex,
+ wxVariant& childValue ) const
{
long oldValue = thisValue.GetLong();
long val = childValue.GetLong();
- unsigned long vi = (1<<childIndex);
- if ( m_choices.HasValue(childIndex) ) vi = m_choices.GetValue(childIndex);
+ unsigned long vi = m_choices.GetValue(childIndex);
+
if ( val )
- thisValue = (long)(oldValue | vi);
- else
- thisValue = (long)(oldValue & ~(vi));
+ return (long) (oldValue | vi);
+
+ return (long) (oldValue & ~(vi));
+}
+
+bool wxFlagsProperty::DoSetAttribute( const wxString& name, wxVariant& value )
+{
+ if ( name == wxPG_BOOL_USE_CHECKBOX ||
+ name == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING )
+ {
+ for ( size_t i=0; i<GetChildCount(); i++ )
+ {
+ Item(i)->SetAttribute(name, value);
+ }
+ // Must return false so that the attribute is stored in
+ // flag property's actual property storage
+ return false;
+ }
+ return false;
}
// -----------------------------------------------------------------------
// stored in m_attributes.
if ( name == wxPG_FILE_SHOW_FULL_PATH )
{
- if ( wxPGVariantToInt(value) )
+ if ( value.GetLong() )
m_flags |= wxPG_PROP_SHOW_FULL_FILENAME;
else
m_flags &= ~(wxPG_PROP_SHOW_FULL_FILENAME);
rowsizer->Add( ed, 1, wxEXPAND|wxALL, spacing );
topsizer->Add( rowsizer, 1, wxEXPAND, 0 );
- rowsizer = new wxBoxSizer( wxHORIZONTAL );
- const int but_sz_flags =
- wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT;
- rowsizer->Add( new wxButton(dlg,wxID_OK,_("Ok")),
- 0, but_sz_flags, spacing );
- rowsizer->Add( new wxButton(dlg,wxID_CANCEL,_("Cancel")),
- 0, but_sz_flags, spacing );
- topsizer->Add( rowsizer, 0, wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL, 0 );
+
+ wxStdDialogButtonSizer* buttonSizer = new wxStdDialogButtonSizer();
+ buttonSizer->AddButton(new wxButton(dlg, wxID_OK));
+ buttonSizer->AddButton(new wxButton(dlg, wxID_CANCEL));
+ buttonSizer->Realize();
+ topsizer->Add( buttonSizer, 0,
+ wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxRIGHT,
+ spacing );
dlg->SetSizer( topsizer );
topsizer->SetSizeHints( dlg );
// On wxMAC the dialog shows incorrectly if style is not exactly wxCAPTION
// FIXME: This should be only a temporary fix.
#ifdef __WXMAC__
+ wxUnusedVar(style);
int useStyle = wxCAPTION;
#else
int useStyle = style;
m_curFocus = 1;
- const int but_sz_flags =
- wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxALL; //wxBOTTOM|wxLEFT|wxRIGHT;
-
wxBoxSizer* topsizer = new wxBoxSizer( wxVERTICAL );
// Message
// Manipulator buttons
wxBoxSizer* colsizer = new wxBoxSizer( wxVERTICAL );
- m_butCustom = (wxButton*) NULL;
+ m_butCustom = NULL;
if ( m_custBtText )
{
m_butCustom = new wxButton(this,28,::wxGetTranslation(m_custBtText));
topsizer->Add( new wxStaticLine(this,-1),
0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, spacing );
- // buttons
- rowsizer = new wxBoxSizer( wxHORIZONTAL );
- /*
- const int but_sz_flags =
- wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT;
- */
- rowsizer->Add( new wxButton(this,wxID_OK,_("Ok")),
- 0, but_sz_flags, spacing );
- rowsizer->Add( new wxButton(this,wxID_CANCEL,_("Cancel")),
- 0, but_sz_flags, spacing );
- topsizer->Add( rowsizer, 0, wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL, 0 );
+ // Standard dialog buttons
+ wxStdDialogButtonSizer* buttonSizer = new wxStdDialogButtonSizer();
+ buttonSizer->AddButton(new wxButton(this, wxID_OK));
+ buttonSizer->AddButton(new wxButton(this, wxID_CANCEL));
+ buttonSizer->Realize();
+ topsizer->Add( buttonSizer, 0,
+ wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxALL,
+ spacing );
m_edValue->SetFocus();
void wxPGArrayStringEditorDialog::Init()
{
- m_pCallingClass = (wxArrayStringProperty*) NULL;
+ m_pCallingClass = NULL;
}
void wxPGArrayStringEditorDialog::OnCustomEditClick(wxCommandEvent& )
unsigned int i;
unsigned int itemCount = src.size();
- wxChar preas[2];
+ wxChar preas[2] = { 0, 0 };
dst.Empty();
- if ( !preDelim )
- preas[0] = 0;
- else if ( (flags & 1) )
+ if ( flags & 1 )
{
preas[0] = preDelim;
- preas[1] = 0;
pdr = wxS("\\");
pdr += preDelim;
}