protected override void OnStartDemo(SampleViewport viewport) { //-------------------------------- { //background element var bgbox = new LayoutFarm.CustomWidgets.SimpleBox(800, 600); bgbox.BackColor = Color.White; bgbox.SetLocation(0, 0); SetupBackgroundProperties(bgbox); viewport.AddContent(bgbox); } //-------------------------------- //ninespace compartment ninespaceBox = new UINinespaceBox(800, 600); viewport.AddContent(ninespaceBox); ninespaceBox.SetSize(800, 600); }
protected override void OnStartDemo(SampleViewport viewport) { //-------------------------------- { //background element var bgbox = new LayoutFarm.CustomWidgets.SimpleBox(800, 600); bgbox.BackColor = Color.White; bgbox.SetLocation(0, 0); SetupBackgroundProperties(bgbox); viewport.AddContent(bgbox); } //-------------------------------- //ninespace compartment ninespaceBox = new UINinespaceBox(800, 600); viewport.AddContent(ninespaceBox); ninespaceBox.SetSize(800, 600); //-------------------------------- //test add some content to the ninespace box textbox = new LayoutFarm.CustomWidgets.TextBox(400, 30, false); listView = new CustomWidgets.ListView(300, 200); listView.SetLocation(0, 40); listView.Visible = false; //------------------------------------ //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; //------------------------------------ //------------------------------------ BuildSampleCountryList(); ninespaceBox.LeftSpace.AddChild(textbox); ninespaceBox.RightSpace.AddChild(listView); }
protected override void OnStartDemo(SampleViewport viewport) { //-------------------------------- { //background element var bgbox = new LayoutFarm.CustomWidgets.SimpleBox(800, 600); bgbox.BackColor = Color.White; bgbox.SetLocation(0, 0); SetupBackgroundProperties(bgbox); viewport.AddContent(bgbox); } //-------------------------------- //ninespace compartment ninespaceBox = new UINinespaceBox(800, 600); viewport.AddContent(ninespaceBox); ninespaceBox.SetSize(800, 600); //-------------------------------- //test add some content to the ninespace box textbox = new LayoutFarm.CustomWidgets.TextBox(400, 30, false); listView = new CustomWidgets.ListView(300, 200); listView.SetLocation(0, 40); listView.Visible = false; //------------------------------------ //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; //------------------------------------ //------------------------------------ BuildSampleCountryList(); ninespaceBox.LeftSpace.AddChild(textbox); ninespaceBox.RightSpace.AddChild(listView); }