value,
m_precision,
!(argFlags & wxPG_FULL_VALUE),
- (wxString*) NULL);
+ NULL);
}
return text;
}
}
int wxEnumProperty::ms_nextIndex = -2;
-int wxEnumProperty::ms_prevIndex = -1;
void wxEnumProperty::OnSetValue()
{
setAsNextIndex = -1;
value = text;
}
- else if ( m_index != useIndex )
+ else if ( useIndex != GetIndex() )
{
if ( useIndex != -1 )
{
}
else
{
- if ( m_index != intVal )
+ if ( intVal != GetIndex() )
{
ms_nextIndex = intVal;
}
wxEnumProperty::OnValidationFailure( wxVariant& WXUNUSED(pendingValue) )
{
// Revert index
- m_index = ms_prevIndex;
ResetNextIndex();
}
void wxEnumProperty::SetIndex( int index )
{
- ms_prevIndex = m_index;
ms_nextIndex = -2;
m_index = index;
}
int wxEnumProperty::GetIndex() const
{
+ if ( m_value.IsNull() )
+ return -1;
+
if ( ms_nextIndex != -2 )
return ms_nextIndex;
+
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;
{
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() )
{
thisValue = (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;
+}
+
// -----------------------------------------------------------------------
// wxDirProperty
// -----------------------------------------------------------------------
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 );
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& )