Exemplo n.º 1
0
void PreviewModels::UpdateSelectedModel()
{
    wxString groupModels;
    wxXmlNode* e;
    e=(wxXmlNode*)(ListBoxModelGroups->GetClientData(ListBoxModelGroups->GetSelection()));
    groupModels = e->GetAttribute("models");
    ListBoxModelsInGroup->Clear();
    wxArrayString ModelsInGroup=wxSplit(groupModels,',');
    for(int i=0;i<ModelsInGroup.size();i++)
    {
        ListBoxModelsInGroup->Append(ModelsInGroup[i]);
    }
    TextModelGroupName->SetValue(ListBoxModelGroups->GetString(ListBoxModelGroups->GetSelection()));
    PopulateUnusedModels(ModelsInGroup);

    wxString v = e->GetAttribute("layout", "grid");
    if (v == "grid") {
        ChoiceModelLayoutType->SetSelection(0);
    }else if (v == "minimalGrid") {
        ChoiceModelLayoutType->SetSelection(1);
    } else if (v == "horizontal") {
        ChoiceModelLayoutType->SetSelection(2);
    } else if (v == "vertical") {
        ChoiceModelLayoutType->SetSelection(3);
    }

    wxCommandEvent evt;
    OnChoiceModelLayoutTypeSelect(evt);

    SizeSpinCtrl->SetValue(wxAtoi(e->GetAttribute("GridSize", "400")));
}
Exemplo n.º 2
0
void ViewsDialog::OnBtAddViewClick(wxCommandEvent& event)
{
    wxArrayString arrModels;
    wxXmlNode* e=new wxXmlNode(wxXML_ELEMENT_NODE, "view");
    e->AddAttribute("name", "New View");
    e->AddAttribute("models", "");
    views->AddChild(e);
    lstViews->Append("New View",e);
    lstViews->SetSelection(lstViews->GetCount()-1);
    Text_ViewName->SetValue("New View");
    PopulateUnusedModels(arrModels);
}
Exemplo n.º 3
0
void PreviewModels::OnButtonAddModelGroupClick(wxCommandEvent& event)
{
    wxArrayString arrModelsInGroup;
    wxXmlNode* e=new wxXmlNode(wxXML_ELEMENT_NODE, "modelGroup");
    e->AddAttribute("name", "New Model Group");
    e->AddAttribute("models", "");
    mModelGroups->AddChild(e);
    int item_index = ListBoxModelGroups->Append("New Model Group",e);
    ListBoxModelGroups->SetSelection(item_index);
    TextModelGroupName->SetValue("New Model Group");
    PopulateUnusedModels(arrModelsInGroup);
    ListBoxModelsInGroup->Clear();
}
Exemplo n.º 4
0
void ViewsDialog::OnlstViewsSelect(wxCommandEvent& event)
{
    wxString viewModels;
    wxXmlNode* e;
    e=(wxXmlNode*)(lstViews->GetClientData(lstViews->GetSelection()));
    viewModels = e->GetAttribute("models");
    debug(1,"Model=");
    lstModelsInView->Clear();
    wxArrayString model=wxSplit(viewModels,',');
    for(int i=0;i<model.size();i++)
    {
        lstModelsInView->Append(model[i]);
    }
    Text_ViewName->SetValue(lstViews->GetString(lstViews->GetSelection()));
    PopulateUnusedModels(model);
}