예제 #1
0
// Initialize custom grid with saved values
// Must be called AFTER Choice_DisplayAs & SpinCtrl_parm1 & SpinCtrl_parm2 have been set
void ModelDialog::SetCustomGridData(const wxString& customChannelData)
{
    wxString value;
    wxArrayString cols;

    if (!IsCustom()) return;

    HasCustomData = true;
    if (customChannelData.IsEmpty())
    {
        ResizeCustomGrid();
        return;
    }

    wxArrayString rows=wxSplit(customChannelData,';');
    for(size_t row=0; row < rows.size(); row++)
    {
        if (row >= GridCustom->GetNumberRows()) GridCustom->AppendRows();
        cols=wxSplit(rows[row],',');
        for(size_t col=0; col < cols.size(); col++)
        {
            if (col >= GridCustom->GetNumberCols()) GridCustom->AppendCols();
            value=cols[col];
            if (!value.IsEmpty() && value != wxT("0"))
            {
                GridCustom->SetCellValue(row,col,value);
            }
        }
    }
    SpinCtrl_parm1->SetValue(GridCustom->GetNumberCols());
    SpinCtrl_parm2->SetValue(GridCustom->GetNumberRows());
}
예제 #2
0
void ModelDialog::OnSpinCtrl_parm2Change(wxSpinEvent& event)
{
    if (IsCustom()) {
        ResizeCustomGrid();
    } else {
        UpdateStartChannels();
    }
}
예제 #3
0
void ModelDialog::UpdateCustom()
{
    bool CustomFlag = IsCustom();
    GridCustom->Show(CustomFlag);
    RadioButton_BotRight->Enable(!CustomFlag);
    RadioButton_TopRight->Enable(!CustomFlag);
    RadioButton_BotLeft->Enable(!CustomFlag);
    RadioButton_TopLeft->Enable(!CustomFlag);
    if (CustomFlag && !HasCustomData) ResizeCustomGrid();
}
예제 #4
0
void ModelDialog::UpdateLabels()
{
    wxString DisplayAs=Choice_DisplayAs->GetStringSelection();
    wxString StringType=Choice_StringType->GetStringSelection();
    wxString NodeLabel = ModelClass::HasSingleChannel(StringType) ? _("lights") : _("RGB Nodes");
    wxString s;

    if (DisplayAs == "Arches")
    {
        StaticText_Strings->SetLabelText(_("# of Arches"));
        s=_("# of ") + NodeLabel + _(" per Arch");
        StaticText_Nodes->SetLabelText(s);
        StaticText_Strands->SetLabelText(_("n/a"));
        SpinCtrl_parm3->SetValue(1);
        SpinCtrl_parm3->Enable(false);
    }
    else if (DisplayAs == "Window Frame")
    {
        s=_("# of ") + NodeLabel + _(" Top");
        StaticText_Strings->SetLabelText(s);
        s=_("# of ") + NodeLabel + _(" Left/Right");
        StaticText_Nodes->SetLabelText(s);
        s=_("# of ") + NodeLabel + _(" Bottom");
        StaticText_Strands->SetLabelText(s);
        SpinCtrl_parm3->Enable(true);
    }
    else if (DisplayAs == "Star"
            )
    {
        StaticText_Strings->SetLabelText(_("Actual # of Strings"));
        s=_("# of ") + NodeLabel + _(" per String");
        StaticText_Nodes->SetLabelText(s);
        StaticText_Strands->SetLabelText(_("# of points"));
        SpinCtrl_parm3->Enable(true);
    }
    else if (DisplayAs == "Single Line" || DisplayAs == "Wreath")
    {
        StaticText_Strings->SetLabelText(_("Actual # of Strings"));
        s=_("# of ") + NodeLabel + _(" per String");
        StaticText_Nodes->SetLabelText(s);
        StaticText_Strands->SetLabelText(_("n/a"));
        SpinCtrl_parm3->SetValue(1);
        SpinCtrl_parm3->Enable(false);
    }
    else if (DisplayAs == "Custom")
    {
        StaticText_Strings->SetLabelText(_("Model Width"));
        StaticText_Nodes->SetLabelText(_("Model Height"));
        StaticText_Strands->SetLabelText(_("n/a"));
        SpinCtrl_parm3->SetValue(1);
        SpinCtrl_parm3->Enable(false);
    }
    else
    {
        // matrix or tree or wreath
        StaticText_Strings->SetLabelText(_("Actual # of Strings"));
        s=_("# of ") + NodeLabel + _(" per String");
        StaticText_Nodes->SetLabelText(s);
        StaticText_Strands->SetLabelText(_("# of Strands per String"));
        SpinCtrl_parm3->Enable(true);
    }
    UpdateStartChannels();
    bool CustomFlag = IsCustom();
    GridCustom->Show(CustomFlag);

    // set start corner text
    if (DisplayAs == "Wreath" || DisplayAs == "Star")
    {
        RadioButton_BotRight->SetLabelText(_("Btm ctr, CCW"));
        RadioButton_TopRight->SetLabelText(_("Top ctr, CW"));
        RadioButton_BotLeft->SetLabelText (_("Btm ctr, CW"));
        RadioButton_TopLeft->SetLabelText (_("Top ctr, CCW"));
    }
    else if (CustomFlag)
    {
        RadioButton_BotRight->SetLabelText(_("n/a"));
        RadioButton_TopRight->SetLabelText(_("n/a"));
        RadioButton_BotLeft->SetLabelText (_("n/a"));
        RadioButton_TopLeft->SetLabelText (_("n/a"));
    }
    else
    {
        RadioButton_BotRight->SetLabelText(_("Bottom Right"));
        RadioButton_TopRight->SetLabelText(_("Top Right"));
        RadioButton_BotLeft->SetLabelText (_("Bottom Left"));
        RadioButton_TopLeft->SetLabelText (_("Top Left"));
    }
    RadioButton_BotRight->Enable(!CustomFlag);
    RadioButton_TopRight->Enable(!CustomFlag);
    RadioButton_BotLeft->Enable(!CustomFlag);
    RadioButton_TopLeft->Enable(!CustomFlag);
    if (CustomFlag && !HasCustomData) ResizeCustomGrid();
}