public void bt_filebox_Click(object sender, RoutedEventArgs e) { if (main.Children.Contains(fBox) == false) { fBox = new FileBox3(); main.Children.Add(fBox); fBoxProp.ElementSupport.AddSupport(TouchAction.Tap); fBoxProp.ElementSupport.AddSupport(TouchAction.Drag); fBoxProp.ElementSupport.AddSupport(TouchAction.ScrollY); fBoxCont = new MTSmoothContainer(fBox, main, fBoxProp); fBoxCont.SetPosition(thisPosition.X, thisPosition.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); framework.RegisterElement(fBoxCont); fBox.setInit(main, window, framework, fBoxCont, thisAngle, userIP); isCreated = true; } else { main.Children.Remove(fBox); framework.UnregisterElement(fBoxCont.Id); fBox = new FileBox3(); isCreated = false; } }
void addControl() { //Center Menu ElementProperties prop_c = new ElementProperties(); prop_c.ElementSupport.AddSupport(TouchFramework.TouchAction.Tap); CenterMenuCont = new MTSmoothContainer(center_menu, MainElement, prop_c); CenterMenuCont.SetPosition((float)MainElement.ActualWidth / 2, (float)MainElement.ActualHeight / 2, 0, 1.0); framework.RegisterElement(CenterMenuCont); center_menu.setInit(MainElement, window, framework, CenterMenuCont, 0); MainElement.Children.Add(center_menu); //SmartPhoneCont ElementProperties prop2 = new ElementProperties(); prop2.ElementSupport.AddSupportForAll(); smartPhoneCont = new MTSmoothContainer(smartPhone_img, MainElement, prop2); framework.RegisterElement(smartPhoneCont); //createSmartArea(); }
public void bt1_Click(object sender, RoutedEventArgs e) { if (main.Children.Contains(fBox) == false) { fBox = new FileBox3(); main.Children.Add(fBox); fBoxProp.ElementSupport.AddSupport(TouchAction.Tap); fBoxProp.ElementSupport.AddSupport(TouchAction.Drag); fBoxProp.ElementSupport.AddSupport(TouchAction.ScrollY); fBoxCont = new MTSmoothContainer(fBox, main, fBoxProp); fBoxCont.SetPosition(thisPosition.X, thisPosition.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); framework.RegisterElement(fBoxCont); fBox.setInit(main, window, framework, fBoxCont, thisAngle, userIP); fBox.Tag = "f/" + userIP; SingleToneTrans.getInstance().addToFileBox(fBox); isCreated = true; } else { main.Children.Remove(fBox); framework.UnregisterElement(fBoxCont.Id); fBox = new FileBox3(); SingleToneTrans.getInstance().removeFileBox(fBox); isCreated = false; } }
public void createSmartArea(string _ip, PointF pt, double angle) { //Init SmartArea Control SmartArea smartArea = new SmartArea(); ElementProperties prop = new ElementProperties(); prop.ElementSupport.AddSupport(TouchFramework.TouchAction.Drag); prop.ElementSupport.AddSupport(TouchFramework.TouchAction.Tap); smartAreaCont = new MTSmoothContainer(smartArea, MainElement, prop); framework.RegisterElement(smartAreaCont); smartArea.Tag = _ip; smartAreaCont.userIP = _ip; MainElement.Children.Add(smartArea); smartArea.setInit(MainElement, window, framework, smartAreaCont, _ip, angle); smartAreaCont.SetPosition(pt.X, pt.Y, angle, 1.0); SingleToneTrans.getInstance().addToArea(smartArea); SingleToneTrans.getInstance().addToCont(smartAreaCont); _smartArea = smartArea; }
public void Item_TouchUp(PointF p, string ipAddress) { //절대 좌표로 변경 PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); if (IsSelecting == true) { IsSelecting = false; main.Children.Remove(contactsObj); if (itemState == 1) //연락처 전송 { contactsObj.sendContact(ipAddress); } else if (itemState == 2) { } else { ContactsObject cObj = new ContactsObject(window, main, contactsObj.contacts); ElementProperties cObjProp = new ElementProperties(); cObjProp.ElementSupport.AddSupportForAll(); MTSmoothContainer cObjCont = new MTSmoothContainer(cObj, main, cObjProp); framework.RegisterElement(cObjCont); cObj.setInit(framework, cObjCont); main.Children.Add(cObj); cObjCont.SetPosition(globalPt.X, globalPt.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); } } }
void bt1_Click(object sender, RoutedEventArgs e) { if (!(main.Children.Contains(pMenu))) { PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); pMenu = new phoneMenu(); main.Children.Add(pMenu); pMenuProp.ElementSupport.AddSupportForAll(); pMenuCont = new MTSmoothContainer(pMenu, main, pMenuProp); pMenuCont.SetPosition(globalPt.X, globalPt.Y, gridRotateTrans.Angle, 1.0); framework.RegisterElement(pMenuCont); pMenu.setInit(main, window, framework, pMenuCont, gridRotateTrans.Angle, userIP); } else { main.Children.Remove(pMenu); framework.UnregisterElement(pMenuCont.Id); pMenuCont.isRemoved = true; } }
public void Item_TouchMove(PointF p, int state) { //절대 좌표로 변경 PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); if (IsSelecting == true) { if (state == 1) { fileBoxObject.img_send.Visibility = Visibility.Visible; } else { fileBoxObject.img_send.Visibility = Visibility.Hidden; } fileBoxObject.setPosition(globalPt, thisAngle + thisCont.RotateFilter.Target); } else if (IsMoving == true) { thisCont.SetPosition(globalPt.X - ((float)fileBoxCon.Width / 2) + (float)bt_move.Width, globalPt.Y - ((float)fileBoxCon.Height / 2) + (float)bt_move.Height, thisAngle + thisCont.RotateFilter.Target, 1.0); } else if (IsRotating == true) { // System.Windows.Point tmpt = bt_rotate.TransformToAncestor(window).Transform(new System.Windows.Point(0, 0)); // CenterPoint.X = (float)tmpt.X + (float)(bt_rotate.Width / 2); // CenterPoint.Y = (float)tmpt.Y + (float)(bt_rotate.Height / 2); // // PointF DistanceVector = new PointF((globalPt.X - CenterPoint.X), (CenterPoint.Y - globalPt.Y)); // // double CurrentAngle = Math.Atan2(DistanceVector.Y, DistanceVector.X) * (180 / Math.PI); // // if (!firstAng) // { // // 처음 각도 // thisAngle = CurrentAngle + rotateTrans.Angle; // firstAng = true; // } // // 현재 각도 // double AngleDiff = (thisAngle - CurrentAngle + 360) % 360; // rotateTrans.Angle = AngleDiff; // // //fileBoxCon.RenderTransform = rotateTrans; // thisCont.SetPosition(CenterPoint.X, CenterPoint.Y, // AngleDiff, 1.0); // //thisCont.RotateFileBox(AngleDiff, globalPt, CenterPoint); } }
private void smartPhone_img_Click(object sender, RoutedEventArgs e) { //Console.WriteLine(smartPhoneCont.ObjectTouches.MoveCenter.X + " , " + smartPhoneCont.ObjectTouches.MoveCenter.Y); Console.WriteLine(smartPhoneCont.CenterFilter.Target.X + " , " + smartPhoneCont.CenterFilter.Target.Y); //smartPhoneCont.updatePosition(); PointF smartPos = new PointF(); double smartAngle = new double(); smartPos.X = smartPhoneCont.CenterFilter.Target.X; smartPos.Y = smartPhoneCont.CenterFilter.Target.Y; smartAngle = smartPhoneCont.RotateFilter.Target; _smartArea.setPosition(smartPos, smartAngle); smartAreaCont.SetPosition(smartPos.X, smartPos.Y, smartAngle, 1.0); if (_smartArea.Opacity == 0) { DoubleAnimation widthAnimation = new DoubleAnimation(); DoubleAnimation sizeAni = new DoubleAnimation(); sizeAni.From = 0; sizeAni.To = 1.0; sizeAni.Duration = TimeSpan.FromSeconds(0.2); widthAnimation.From = 0; widthAnimation.To = 1; widthAnimation.Duration = TimeSpan.FromSeconds(0.2); ScaleTransform oTransform = new ScaleTransform(); smartAreaCont.transforms = new TransformGroup(); smartAreaCont.transforms.Children.Add(oTransform); smartAreaCont.WorkingObject.RenderTransform = smartAreaCont.transforms; _smartArea.BeginAnimation(System.Windows.Controls.Image.OpacityProperty, widthAnimation); oTransform.BeginAnimation(ScaleTransform.ScaleXProperty, sizeAni); oTransform.BeginAnimation(ScaleTransform.ScaleYProperty, sizeAni); } else { DoubleAnimation widthAnimation = new DoubleAnimation(); DoubleAnimation sizeAni = new DoubleAnimation(); sizeAni.From = 1.0; sizeAni.To = 0; sizeAni.Duration = TimeSpan.FromSeconds(0.2); widthAnimation.From = 1.0; widthAnimation.To = 0; widthAnimation.Duration = TimeSpan.FromSeconds(0.2); ScaleTransform oTransform = new ScaleTransform(); smartAreaCont.transforms = new TransformGroup(); smartAreaCont.transforms.Children.Add(oTransform); smartAreaCont.WorkingObject.RenderTransform = smartAreaCont.transforms; _smartArea.BeginAnimation(System.Windows.Controls.Image.OpacityProperty, widthAnimation); oTransform.BeginAnimation(ScaleTransform.ScaleXProperty, sizeAni); oTransform.BeginAnimation(ScaleTransform.ScaleYProperty, sizeAni); } }
public void Item_TouchUp(PointF p) { //절대 좌표로 변경 PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); if (IsSelecting == true) { IsSelecting = false; main.Children.Remove(fileBoxObject); if (fileBoxObject.fileType == "image") { ImageView imgView = new ImageView(); main.Children.Add(imgView); ElementProperties imgViewProp = new ElementProperties(); imgViewProp.ElementSupport.AddSupportForAll(); MTSmoothContainer imgViewCont = new MTSmoothContainer(imgView, main, imgViewProp); imgViewCont.SetPosition(globalPt.X, globalPt.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); framework.RegisterElement(imgViewCont); imgView.setInit(main, window, framework, imgViewCont, thisAngle + thisCont.RotateFilter.Target, fileBoxObject.objInfo); } else if (fileBoxObject.fileType == "ppt") { PptViewer pptViewer = new PptViewer(); main.Children.Add(pptViewer); ElementProperties pptViewerProp = new ElementProperties(); pptViewerProp.ElementSupport.AddSupportForAll(); MTSmoothContainer pptViewerCont = new MTSmoothContainer(pptViewer, main, pptViewerProp); pptViewerCont.SetPosition(globalPt.X, globalPt.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); framework.RegisterElement(pptViewerCont); pptViewer.setInit(main, window, framework, pptViewerCont, thisAngle + thisCont.RotateFilter.Target, fileBoxObject.objInfo); } else if (fileBoxObject.fileType == "video") { VideoControl videoCon = new VideoControl(); System.Windows.Shapes.Rectangle i = videoCon.SetVideo(fileBoxObject.objInfo.FilePath); ElementProperties vprop = new ElementProperties(); vprop.ElementSupport.AddSupportForAll(); MTSmoothContainer cont = new MTSmoothContainer(videoCon, main, vprop); cont.SetPosition(globalPt.X, globalPt.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); framework.RegisterElement(cont); main.Children.Add(videoCon); // // cont.MaxX = (int)(this.screen_width); // cont.MaxY = (int)(this.screen_height); // cont.MinX = (int)(this.screen_width / 10); // cont.MinY = (int)(this.screen_height / 10); } else if (fileBoxObject.fileType == "doc") { DocViewer dv = new DocViewer(); ElementProperties vprop = new ElementProperties(); vprop.ElementSupport.AddSupportForAll(); MTSmoothContainer cont = new MTSmoothContainer(dv, main, vprop); cont.SetPosition(globalPt.X, globalPt.Y, thisAngle + thisCont.RotateFilter.Target, 1.0); framework.RegisterElement(cont); dv.setInit(main, window, framework, cont, thisAngle + thisCont.RotateFilter.Target, fileBoxObject.objInfo); main.Children.Add(dv); // // cont.MaxX = (int)(this.screen_width); // cont.MaxY = (int)(this.screen_height); // cont.MinX = (int)(this.screen_width / 10); // cont.MinY = (int)(this.screen_height / 10); } } if (IsMoving == true) { IsMoving = false; } if (IsRotating == true) { IsRotating = false; firstAng = false; } }