コード例 #1
0
ファイル: GtkSharpGui.cs プロジェクト: rene-schoene/racr
    [AgRule("Widget", "Group")] static Box GroupWidget(Ast n)
    {
        VBox  contentBox = new VBox(false, 5);
        Frame frame      = new Frame(n.GetExpression().SExpr());

        frame.BorderWidth = 5;
        frame.Add(contentBox);
        if (!n.IsLValid())
        {
            Gdk.Color col = new Gdk.Color();
            Gdk.Color.Parse("red", ref col);
            frame.ModifyBg(StateType.Normal, col);
        }
        n.Parent().Widget().PackStart(frame, false, false, 5);
        frame.Show();
        return(contentBox);
    }
コード例 #2
0
ファイル: GtkSharpGui.cs プロジェクト: rene-schoene/racr
    [AgRule("Widget", "ComputedQuestion")] static Box ComputedQuestionWidget(Ast n)
    {
        Widget dialog = (Widget)n.Dialog();

        dialog.Sensitive = false;
        HBox box = new HBox(false, 5);

        if (!n.IsLValid())
        {
            Image warning = new Image(Stock.DialogWarning, IconSize.Button);
            box.PackStart(warning, false, false, 3);
        }
        box.PackStart(new Label(n.GetLabel()), false, false, 5);
        box.PackStart(dialog, true, true, 5);
        n.Parent().Widget().PackStart(box, false, false, 5);
        box.ShowAll();
        return(box);
    }
コード例 #3
0
ファイル: GtkSharpGui.cs プロジェクト: rene-schoene/racr
    [AgRule("Widget", "OrdinaryQuestion")] static Box OrdinaryQuestionWidget(Ast n)
    {
        QDialog      dialog = n.Dialog();
        EventHandler h      = (object o, EventArgs a) => {
            n.SetValue(dialog.GetValue());
            n.Root().Render();
        };

        dialog.AddEventHandler(h);
        HBox box = new HBox(false, 5);

        if (!n.IsLValid())
        {
            Image warning = new Image(Stock.DialogWarning, IconSize.Button);
            box.PackStart(warning, false, false, 3);
        }
        box.PackStart(new Label(n.GetLabel()), false, false, 5);
        box.PackStart((Widget)dialog, true, true, 5);
        n.Parent().Widget().PackStart(box, false, false, 5);
        box.ShowAll();
        return(box);
    }
コード例 #4
0
ファイル: Language.cs プロジェクト: rene-schoene/racr
 [AgRule("IsValid", "Question")] static bool QuestionIsValid(Ast n)
 {
     return(n.IsLValid());
 }
コード例 #5
0
ファイル: Language.cs プロジェクト: rene-schoene/racr
 [AgRule("IsValid", "Group")] static bool GroupIsValid(Ast n)
 {
     return(n.IsLValid() && n.GetBody().Children().All(x => ((Ast)x).IsValid()));
 }
コード例 #6
0
ファイル: Questionnaire.cs プロジェクト: localchart/racr
 static bool QuestionIsValid(Racr.AstNode n)
 {
     return(n.IsLValid());
 }
コード例 #7
0
ファイル: Questionnaire.cs プロジェクト: localchart/racr
 static bool GroupIsValid(Racr.AstNode n)
 {
     return(n.IsLValid() && n.GetBody().Children().All(x => ((Racr.AstNode)x).IsValid()));
 }