Exemplo n.º 1
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            //******************************************************************************
            // Note: There is a significant difference between WPF and Form for labels.
            //       Need to adjust font settings for label text to show up...
            //******************************************************************************
            fontfamily = "Microsoft Sans Serif";
            fontsize   = "7.8";
            string o = "\t\t<Label ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            o += "</Label>";
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            w.WriteLine(o);
        }
Exemplo n.º 2
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<ListBox ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            //******************************************************************************
            // Write specific control settings...
            //******************************************************************************
            if (selectionMode != String.Empty)
            {
                o += "SelectionMode=\"" + selectionMode + "\" ";
            }
            if (selectedindexchangedEvent != String.Empty)
            {
                o += "SelectionChanged=\"" + selectedindexchangedEvent + "\" ";
            }
            //******************************************************************************
            // Control contains child items - if there are none just close
            //******************************************************************************
            if (items.Count == 0)
            {
                o += "/>";
            }
            else
            {
                o += ">\n";     // terminate XML statement
                //**************************************************************************
                // Add child items
                //**************************************************************************
                foreach (string item in items)
                {
                    o += "\t\t\t<ListBoxItem>";
                    o += XAML.encodeText(item);
                    o += "</ListBoxItem>";
                    o += "\n";
                }
                //**************************************************************************
                // Close control
                //**************************************************************************
                o += "\t\t</ListBox>";
            }
            //******************************************************************************
            w.WriteLine(o);
        }
Exemplo n.º 3
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<TextBox ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            //******************************************************************************
            // Write specific control settings...
            //******************************************************************************
            if (IsReadOnly)
            {
                o += "IsReadOnly=\"True\" ";
            }
            if (AcceptsReturn)
            {
                o += "AcceptsReturn=\"True\" ";
            }
            if (WordWrap)
            {
                o += "TextWrapping=\"Wrap\" ";
            }

            if (RighttoLeft)
            {
                o += "FlowDirection=\"RightToLeft\" ";
            }

            if (CharacterCasing != String.Empty)
            {
                o += "CharacterCasing=\"" + CharacterCasing + "\" ";
            }

            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            o += "</TextBox>";
            w.WriteLine(o);
        }
Exemplo n.º 4
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<Button ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            o += "</Button>";
            w.WriteLine(o);
        }
Exemplo n.º 5
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<CheckBox ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            //******************************************************************************
            // Write specific control settings...
            //******************************************************************************
            if (IsChecked)
            {
                o += "IsChecked=\"True\" ";
            }
            if (IsThreeState)
            {
                o += "IsThreeState=\"True\" ";
            }

            if (checkEvent != String.Empty)
            {
                o += "Checked=\"" + checkEvent + "\" ";
            }
            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            o += "</CheckBox>";
            w.WriteLine(o);
        }