GetPrimaryUI() public method

public GetPrimaryUI ( ) : UIElement
return LayoutFarm.UI.UIElement
        protected override void OnStartDemo(SampleViewport viewport)
        {
            textbox = new LayoutFarm.CustomWidgets.TextBox(400, 300, true);
            textbox.SetLocation(20, 20);
            var textSplitter = new Composers.ContentTextSplitter();

            textbox.TextSplitter = textSplitter;

            sgBox = new SuggestionWindowMx(300, 200);
            sgBox.Hide();
            //------------------------------------
            //create special text surface listener
            var textSurfaceListener = new LayoutFarm.Text.TextSurfaceEventListener();

            textSurfaceListener.CharacterAdded      += (s, e) => UpdateSuggestionList();
            textSurfaceListener.CharacterRemoved    += (s, e) => UpdateSuggestionList();
            textSurfaceListener.PreviewArrowKeyDown += new EventHandler <Text.TextDomEventArgs>(textSurfaceListener_PreviewArrowKeyDown);
            textSurfaceListener.PreviewEnterKeyDown += new EventHandler <Text.TextDomEventArgs>(textSurfaceListener_PreviewEnterKeyDown);
            textbox.TextEventListener = textSurfaceListener;
            //------------------------------------

            viewport.AddContent(textbox);
            viewport.AddContent(sgBox.GetPrimaryUI());
            //------------------------------------
            BuildSampleCountryList();
        }
Ejemplo n.º 2
0
        //
        protected override void OnStart(AppHost host)
        {
            _textbox = new LayoutFarm.CustomWidgets.TextBox(400, 300, true);
            _textbox.SetLocation(20, 20);
            var style1 = new TextEditing.TextSpanStyle();

            style1.ReqFont            = new PixelFarm.Drawing.RequestFont("tahoma", 14);
            style1.FontColor          = new PixelFarm.Drawing.Color(0, 0, 0);
            _textbox.DefaultSpanStyle = style1;

            var textSplitter = new CustomWidgets.ContentTextSplitter();

            _textbox.TextSplitter = textSplitter;
            _sgBox = new SuggestionWindowMx(300, 200);
            _sgBox.UserConfirmSelectedItem += new EventHandler(sgBox_UserConfirmSelectedItem);
            _sgBox.ListItemKeyboardEvent   += new EventHandler <UIKeyEventArgs>(sgBox_ListItemKeyboardEvent);
            _sgBox.Hide();
            //------------------------------------
            //create special text surface listener
            var textSurfaceListener = new LayoutFarm.TextEditing.TextSurfaceEventListener();

            textSurfaceListener.CharacterAdded      += (s, e) => UpdateSuggestionList();
            textSurfaceListener.CharacterRemoved    += (s, e) => UpdateSuggestionList();
            textSurfaceListener.PreviewArrowKeyDown += new EventHandler <TextEditing.TextDomEventArgs>(textSurfaceListener_PreviewArrowKeyDown);
            textSurfaceListener.PreviewEnterKeyDown += new EventHandler <TextEditing.TextDomEventArgs>(textSurfaceListener_PreviewEnterKeyDown);
            _textbox.TextEventListener = textSurfaceListener;
            //------------------------------------

            host.AddChild(_textbox);
            host.AddChild(_sgBox.GetPrimaryUI());
            //------------------------------------
            BuildSampleCountryList();
        }
        protected override void OnStartDemo(SampleViewport viewport)
        {
            textbox = new LayoutFarm.CustomWidgets.TextBox(400, 300, true);
            textbox.SetLocation(20, 20);
            var textSplitter = new CustomWidgets.ContentTextSplitter();
            textbox.TextSplitter = textSplitter;
            sgBox = new SuggestionWindowMx(300, 200);
            sgBox.UserConfirmSelectedItem += new EventHandler(sgBox_UserConfirmSelectedItem);
            sgBox.ListItemKeyboardEvent += new EventHandler<UIKeyEventArgs>(sgBox_ListItemKeyboardEvent);
            sgBox.Hide();
            //------------------------------------
            //create special text surface listener
            var textSurfaceListener = new LayoutFarm.Text.TextSurfaceEventListener();
            textSurfaceListener.CharacterAdded += (s, e) => UpdateSuggestionList();
            textSurfaceListener.CharacterRemoved += (s, e) => UpdateSuggestionList();
            textSurfaceListener.PreviewArrowKeyDown += new EventHandler<Text.TextDomEventArgs>(textSurfaceListener_PreviewArrowKeyDown);
            textSurfaceListener.PreviewEnterKeyDown += new EventHandler<Text.TextDomEventArgs>(textSurfaceListener_PreviewEnterKeyDown);
            textbox.TextEventListener = textSurfaceListener;
            //------------------------------------ 

            viewport.AddContent(textbox);
            viewport.AddContent(sgBox.GetPrimaryUI());
            //------------------------------------ 
            BuildSampleCountryList();
        }