public override Rectangle Apply( ScrollableControl control, Size sizeToShow) { control.AutoScroll = false; control.Invalidate(); return CalcFitRectangle( control.ClientSize, sizeToShow); }
/// <summary> /// Reloads resources specific to the <c>ScrollableControl</c> type. /// </summary> /// <param name="control"> /// <c>Control</c> object for which resources should be reloaded. /// </param> /// <param name="resources"> /// <c>ResourceManager</c> object. /// </param> private void ReloadScrollableControlProperties(System.Windows.Forms.ScrollableControl control, System.Resources.ResourceManager resources) { SetProperty(control, "AutoScroll", resources); SetProperty(control, "AutoScrollMargin", resources); SetProperty(control, "AutoScrollMinSize", resources); SetProperty(control, "AutoScrollPosition", resources); }
/// <summary> /// Cette méthode crée des controles de type chckbox ou radio button dans un controle de type panel. /// Elle va chercher les données dans la base de données et crée autant de controles (les uns au dessous des autres /// qu'il y a de lignes renvoyées par la base de données. /// </summary> /// <param name="UneForme">Le formulaire concerné</param> /// <param name="UneConnexion">L'objet connexion à utiliser pour la connexion à la BD</param> /// <param name="pUneTable">Le nom de la source de données qui va fournir les données. Il s'agit en fait d'une vue de type /// VXXXXOn ou XXXX représente le nom de la tabl à partir de laquelle la vue est créée. n représente un numéro de séquence</param> /// <param name="pPrefixe">les noms des controles sont standard : NomControle_XX /// ou XX estl'id de l'enregistrement récupéré dans la vue qui /// sert de source de données</param> /// <param name="UnPanel">panel ou groupbox dans lequel on va créer les controles</param> /// <param name="unTypeControle">type de controle à créer : checkbox ou radiobutton</param> /// <param name="callback"> Le pointeur de fonction. En fait le pointeur sur la fonction qui réagira à l'événement déclencheur </param> public static void CreerDesControles(Form UneForme, Bdd UneConnexion, String pUneTable, String pPrefixe, ScrollableControl UnPanel, String unTypeControle, Action<object, EventArgs> callback) { DataTable UneTable = UneConnexion.ObtenirDonnesOracle(pUneTable); // on va récupérer les statuts dans un datatable puis on va parcourir les lignes(rows) de ce datatable pour // construire dynamiquement les boutons radio pour le statut de l'intervenant dans son atelier Int16 i = 0; foreach (DataRow UneLigne in UneTable.Rows) { //object UnControle = Activator.CreateInstance(object unobjet, unTypeControle); //UnControle=Convert.ChangeType(UnControle, TypeC); if (unTypeControle == "CheckBox") { CheckBox UnControle = new CheckBox(); AffecterControle(UneForme, UnPanel, UnControle, pPrefixe, UneLigne, i++, callback); } else if (unTypeControle == "RadioButton") { RadioButton UnControle = new RadioButton(); AffecterControle(UneForme, UnPanel, UnControle, pPrefixe, UneLigne, i++, callback); UnControle.CheckedChanged += new System.EventHandler(callback); } i++; } UnPanel.Height = 20 * i + 5; }
public void PropertyLargeChange () { ScrollableControl sc = new ScrollableControl (); ScrollProperties sp = sc.HorizontalScroll; sp.LargeChange = 25; Assert.AreEqual (25, sp.LargeChange, "B1"); }
public override Control InitializeWatchWindow() { _pnlMemory = new DoubleBufferedPanel(); _pnlMemory.Paint += paintMemoryPanel; _scroll = new ScrollableControl { Dock = DockStyle.Fill, AutoScroll = true }; _scroll.Controls.Add(_pnlMemory); return _scroll; }
public MainForm() { InitializeComponent(); m_Window = splitContainer1.Panel2; m_CurrentViewState = new NormalViewState(); InitD3D(); SlimDX.Windows.MessagePump.Run(this, Render); }
public void PropertyMaximum () { ScrollableControl sc = new ScrollableControl (); ScrollProperties sp = sc.HorizontalScroll; sp.Maximum = 200; Assert.AreEqual (200, sp.Maximum, "B1"); }
public void PropertyEnabled () { ScrollableControl sc = new ScrollableControl (); ScrollProperties sp = sc.HorizontalScroll; sp.Enabled = false; Assert.AreEqual (false, sp.Enabled, "B1"); }
public ControlPanel(ScrollableControl parent) { initialize(parent); parent.Controls.Add(panel); panel.BackColor = Color.Blue; Label ddd = new Label(); ddd.Text = "--------------------------------"; panel.Controls.Add(ddd); }
/// <summary> /// Créé une combobox dans un container avec le nom passé en paramètre /// </summary> /// <param name="UnContainer">panel ou groupbox</param> /// <param name="unNom">nom de la groupbox à créer</param> /// <param name="UnTop">positionnement haut dans le container </param> /// <param name="UnLeft">positionnement bas dans le container </param> public static void CreerCombo(ScrollableControl UnContainer, String unNom, Int16 UnTop, Int16 UnLeft) { CheckBox UneCheckBox= new CheckBox(); UneCheckBox.Name=unNom; UneCheckBox.Top=UnTop; UneCheckBox.Left=UnLeft; UneCheckBox.Visible=true; UnContainer.Controls.Add(UneCheckBox); }
/// <summary> /// Creates a new instance of phone. /// </summary> /// <param name="location">The location of the phone.</param> /// <param name="panel">The place to add the phone.</param> public Phone(Point location, ScrollableControl control, Random r) : base(location, new Size (99, 178), Resources.phone, control) { timer.Stop (); random = r; vanishTimer = new TickOnceTimer (random.Next (700, 1700), vanishTimerTick); timer.Interval = random.Next (1000, 3000); picture.Click += pictureClick; }
public ToolBarManager(ScrollableControl dockStation, Form mainForm) { this.DockStation = dockStation; this.MainForm = mainForm; _left = new ToolBarDockArea(this, DockStyle.Left); _right = new ToolBarDockArea(this, DockStyle.Right); _top = new ToolBarDockArea(this, DockStyle.Top); _bottom = new ToolBarDockArea(this, DockStyle.Bottom); Application.AddMessageFilter(this); }
public static void CreerComposantVac(ScrollableControl UnContainer, String unNom, Int16 UnTop) { ComposantPPE.ComposantPPE CP = new ComposantPPE.ComposantPPE(); CP.Name = unNom; CP.Top = UnTop; CP.Left = 8; CP.Width = 326; CP.Height= 21; CP.Visible = true; UnContainer.Controls.Add(CP); }
/// <summary> /// 获取被移动控件对象和容器对象 /// </summary> /// <param name="c">被设置为可运行时移动的控件</param> /// <param name="parentContain">可移动控件的容器</param> public ControlMoveResize(Control c, ScrollableControl parentContain) { ctrl = c; this.Containe = parentContain; //ctrl.MouseDown += new MouseEventHandler(MouseDown); //ctrl.MouseMove += new MouseEventHandler(MouseMove); //ctrl.MouseUp += new MouseEventHandler(MouseUp); ctrl.MouseDown += new MouseEventHandler(MouseDown); ctrl.MouseMove += new MouseEventHandler(MouseMove); ctrl.MouseUp += new MouseEventHandler(MouseUp); }
public void Move(Control child, int x, int y) { SWF.ScrollableControl parent = Widget.Container.ControlObject as SWF.ScrollableControl; SWF.Control ctl = child.GetContainerControl(); SD.Point pt = new SD.Point(x, y); if (parent != null) { pt.Offset(parent.AutoScrollPosition); } ctl.Location = pt; }
public Caret(ScrollableControl owner) { this.owner=owner; timer=new Timer(); timer.Tick+=new EventHandler(Toggle); timer.Interval=500; timer.Enabled=true; owner.LostFocus+=new EventHandler(LeaveControl); owner.GotFocus+=new EventHandler(EnterControl); owner.Paint+=new PaintEventHandler(PaintComplete); }
public void Constructor () { ScrollableControl sc = new ScrollableControl (); ScrollProperties sp = sc.HorizontalScroll; Assert.AreEqual (true, sp.Enabled, "A1"); Assert.AreEqual (10, sp.LargeChange, "A2"); Assert.AreEqual (100, sp.Maximum, "A3"); Assert.AreEqual (0, sp.Minimum, "A4"); Assert.AreEqual (1, sp.SmallChange, "A5"); Assert.AreEqual (0, sp.Value, "A6"); Assert.AreEqual (false, sp.Visible, "A7"); }
private void ScrollActiveControlIntoView() { Control last = activeControl; if (last != null) { ScrollableControl scrollParent = FindScrollableParent(last); while (scrollParent != null) { scrollParent.ScrollControlIntoView(activeControl); last = scrollParent; scrollParent = FindScrollableParent(scrollParent); } } }
private new void ScrollControlIntoView(Control control) { // Find scrollable parent. while (true) { control = control.Parent; if (control == null) { return; } ScrollableControl scrollableControl = control as ScrollableControl; if (scrollableControl != null) { scrollableControl.ScrollControlIntoView(activeControl); continue; } } }
public SimpleCheckRadioList() { _Scroller = new ScrollableControl(); _Scroller.AutoScroll = true; this.Controls.Add(_Scroller); _Scroller.Dock = DockStyle.Fill; _FlowPanel = new FlowLayoutPanel(); _FlowPanel.AutoSize = true; _FlowPanel.FlowDirection = FlowDirection.TopDown; _Scroller.Controls.Add(_FlowPanel); this.BackColor = Color.White; }
internal static WebBrowserContainer FindContainerForControl(WebBrowserBase ctl) { if (ctl != null) { if (ctl.container != null) { return(ctl.container); } ScrollableControl f = ctl.ContainingControl; if (f != null) { WebBrowserContainer container = ctl.CreateWebBrowserContainer(); if (container.RegisterControl(ctl)) { container.AddControl(ctl); return(container); } } } return(null); }
public void ResizeAnchoredTest () { ScrollableControl sc = new ScrollableControl (); object h = sc.Handle; sc.Size = new Size (23, 45); Label lbl = new Label (); lbl.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; lbl.Size = sc.ClientSize; sc.Controls.Add (lbl); sc.Height *= 2; sc.Height *= 2; Assert.AreEqual (lbl.Location, Point.Empty, "#1"); Assert.AreEqual (lbl.Size, sc.ClientSize, "#2"); TestHelper.RemoveWarning (h); }
public void AutoScroll () { ScrollableControl sc = new ScrollableControl (); Assert.IsFalse (sc.AutoScroll, "#A1"); Assert.AreEqual (0, sc.Controls.Count, "#A2"); sc.AutoScroll = true; Assert.IsTrue(sc.AutoScroll, "#B1"); Assert.AreEqual (0, sc.Controls.Count, "#B2"); sc.AutoScroll = false; Assert.IsFalse (sc.AutoScroll, "#C1"); Assert.AreEqual (0, sc.Controls.Count, "#C2"); }
protected ScrollProperties (ScrollableControl container) { parentControl = container; }
/// <summary> /// Returns an observable sequence wrapping the Scroll event on the ScrollableControl instance. /// </summary> /// <param name="instance">The ScrollableControl instance to observe.</param> /// <returns>An observable sequence wrapping the Scroll event on the ScrollableControl instance.</returns> public static IObservable <EventPattern <ScrollEventArgs> > ScrollObservable(this ScrollableControl instance) { return(Observable.FromEventPattern <ScrollEventHandler, ScrollEventArgs>( handler => instance.Scroll += handler, handler => instance.Scroll -= handler)); }
/// <include file='doc\VScrollProperties.uex' path='docs/doc[@for="ScrollProperties.VScrollProperties"]/*' /> public VScrollProperties(ScrollableControl container) : base(container) { }
public static void SetupScrollState(ScrollableControl scrollableControl) { Type scrollableControlType = typeof(ScrollableControl); MethodInfo setScrollStateMethod = scrollableControlType.GetMethod("SetScrollState", BindingFlags.NonPublic | BindingFlags.Instance); setScrollStateMethod.Invoke(scrollableControl, new object[] { 0x10 /*ScrollableControl.ScrollStateFullDrag*/, true }); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Attach a container and a grip handle. The handle must support mouse move events. /// </summary> /// <param name="container">container to make dockable/floatable</param> /// <param name="handle">grip handle used to drag the container</param> /// <returns> /// the floaty that manages the container's behaviour /// </returns> /// ------------------------------------------------------------------------------------ public IFloaty Attach(ScrollableControl container, Control handle) { return Attach(container, handle, null); }
public void Padding () { ScrollableControl c = new ScrollableControl (); c.Dock = DockStyle.Fill; c.Padding = new Padding (40); Assert.AreEqual (40, c.Padding.All, "A1"); Assert.AreEqual (40, c.DockPadding.All, "A2"); c.DockPadding.Right = 20; Assert.AreEqual (20, c.Padding.Right, "A3"); Assert.AreEqual (20, c.DockPadding.Right, "A4"); c.Padding = new Padding (40, 40, 40, 40); Assert.AreEqual (40, c.Padding.Right, "A5"); Assert.AreEqual (40, c.DockPadding.Right, "A6"); Form f = new Form (); f.Controls.Add (c); Button b = new Button (); c.Controls.Add (b); f.Show (); // Padding does not affect laying out the controls Assert.AreEqual (new Point (0, 0), b.Location, "A7"); f.Close (); f.Dispose (); }
private protected override int GetPageSize(ScrollableControl parent) => parent.ClientRectangle.Width;
private protected override int GetHorizontalDisplayPosition(ScrollableControl parent) => parent.DisplayRectangle.X;
private protected override int GetHorizontalDisplayPosition(ScrollableControl parent) => - _value;
private protected override int GetVerticalDisplayPosition(ScrollableControl parent) => parent.DisplayRectangle.Y;
internal DockPaddingEdges(ScrollableControl owner) { this.owner = owner; all = true; top = left = right = bottom = 0; }
public void AutoScrollMinSize () { ScrollableControl sc = new ScrollableControl (); Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#A1"); Assert.IsFalse (sc.AutoScroll, "#A2"); sc.AutoScrollMinSize = Size.Empty; Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#B1"); Assert.IsFalse (sc.AutoScroll, "#B2"); sc.AutoScrollMinSize = new Size (10, 20); Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#C1"); Assert.IsTrue (sc.AutoScroll, "#C2"); sc.AutoScroll = false; Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#D1"); Assert.IsFalse (sc.AutoScroll, "#D2"); sc.AutoScrollMinSize = new Size (10, 20); Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#E1"); Assert.IsFalse (sc.AutoScroll, "#E2"); sc.AutoScrollMinSize = new Size (20, 20); Assert.AreEqual (new Size (20, 20), sc.AutoScrollMinSize, "#F1"); Assert.IsTrue (sc.AutoScroll, "#F2"); sc.AutoScroll = false; Assert.AreEqual (new Size (20, 20), sc.AutoScrollMinSize, "#G1"); Assert.IsFalse (sc.AutoScroll, "#G2"); sc.AutoScrollMinSize = Size.Empty; Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#H1"); Assert.IsTrue (sc.AutoScroll, "#H2"); sc.AutoScrollMinSize = new Size (10, 20); Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#I1"); Assert.IsTrue (sc.AutoScroll, "#I2"); sc.AutoScrollMinSize = Size.Empty; Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#J1"); Assert.IsTrue (sc.AutoScroll, "#J2"); }
/// ------------------------------------------------------------------------------------ /// <summary> /// attach this class to any dockable type of container control to make it dockable. /// Attach a container control and use it as a grip hande. The handle must support mouse /// move events. Supply a splitter control to allow resizing of the docked container /// </summary> /// <param name="container">control to be dockable</param> /// <param name="handle">handle to be used to track the mouse movement (e.g. caption of /// the container)</param> /// <param name="splitter">splitter to resize the docked container (optional)</param> /// <returns></returns> /// ------------------------------------------------------------------------------------ public IFloaty Attach(ScrollableControl container, Control handle, Splitter splitter) { if (container == null) throw new ArgumentException("container cannot be null"); if (handle == null) throw new ArgumentException("handle cannot be null"); DockState dockState = new DockState(); dockState.Container = container; dockState.Handle = handle; dockState.OrgDockHost = _dockHost; dockState.Splitter = splitter; dockState.OrgFloatingBounds = container.Bounds; Floaty floaty = new Floaty(this); floaty.Persistence = m_persistence; floaty.Attach(dockState); _floaties.Add(floaty); return floaty; }
public void AutoScrollPositionTest () { ScrollableControl sc; sc = new ScrollableControl (); sc.AutoScroll = true; sc.AutoScrollPosition = new Point (-25, -50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#01"); sc.AutoScrollPosition = new Point (2500, 5000); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#02"); sc.AutoScrollPosition = new Point (25, 50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#03"); object o = sc.Handle; sc.AutoScrollPosition = new Point (-25, -50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#04"); sc.AutoScrollPosition = new Point (2500, 5000); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#05"); sc.AutoScrollPosition = new Point (25, 50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#06"); sc.Size = new Size (200, 400); sc.Location = new Point (20, 40); sc.AutoScrollPosition = new Point (-25, -50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#07"); sc.AutoScrollPosition = new Point (2500, 5000); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#08"); sc.AutoScrollPosition = new Point (25, 50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#09"); Control c1, c2; c1 = new Control (); c1.Location = new Point (-100, -200); c1.Size = new Size (10, 10); sc.Controls.Add (c1); c2 = new Control (); c2.Location = new Point (400, 800); c2.Size = new Size (10, 10); sc.Controls.Add (c2); Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#10"); sc.ScrollControlIntoView (c2); Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#11"); Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#12"); Assert.AreEqual (new Point (-326, -626), c1.Location, "#13"); Assert.AreEqual (new Point (174, 374), c2.Location, "#14"); sc.AutoScrollPosition = new Point (-25, -50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#01"); Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#15"); Assert.AreEqual (new Point (-100, -200), c1.Location, "#16"); Assert.AreEqual (new Point (400, 800), c2.Location, "#17"); sc.AutoScrollPosition = new Point (2500, 5000); Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#18"); Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#19"); Assert.AreEqual (new Point (-326, -626), c1.Location, "#20"); Assert.AreEqual (new Point (174, 374), c2.Location, "#21"); sc.AutoScrollPosition = new Point (25, 50); Assert.AreEqual (new Point (-25, -50), sc.AutoScrollPosition, "#22"); Assert.AreEqual (new Rectangle (-25, -50, 410, 810), sc.DisplayRectangle, "#23"); Assert.AreEqual (new Point (-125, -250), c1.Location, "#24"); Assert.AreEqual (new Point (375, 750), c2.Location, "#25"); sc.ScrollControlIntoView (c1); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#26"); Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#27"); Assert.AreEqual (new Point (-100, -200), c1.Location, "#28"); Assert.AreEqual (new Point (400, 800), c2.Location, "#29"); sc.AutoScrollPosition = new Point (2500, 5000); Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#30"); Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#31"); Assert.AreEqual (new Point (-326, -626), c1.Location, "#32"); Assert.AreEqual (new Point (174, 374), c2.Location, "#33"); sc.AutoScrollPosition = new Point (25, 50); Assert.AreEqual (new Point (-25, -50), sc.AutoScrollPosition, "#34"); Assert.AreEqual (new Rectangle (-25, -50, 410, 810), sc.DisplayRectangle, "#35"); Assert.AreEqual (new Point (-125, -250), c1.Location, "#36"); Assert.AreEqual (new Point (375, 750), c2.Location, "#37"); sc.ScrollControlIntoView (c2); Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#38"); Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#39"); Assert.AreEqual (new Point (-326, -626), c1.Location, "#40"); Assert.AreEqual (new Point (174, 374), c2.Location, "#41"); sc.AutoScrollPosition = new Point (-25, -50); Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#42"); Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#43"); Assert.AreEqual (new Point (-100, -200), c1.Location, "#44"); Assert.AreEqual (new Point (400, 800), c2.Location, "#45"); sc.AutoScrollPosition = new Point (2500, 5000); Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#46"); Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#47"); Assert.AreEqual (new Point (-326, -626), c1.Location, "#48"); Assert.AreEqual (new Point (174, 374), c2.Location, "#49"); sc.AutoScrollPosition = new Point (25, 50); Assert.AreEqual (new Point (-25, -50), sc.AutoScrollPosition, "#50"); Assert.AreEqual (new Rectangle (-25, -50, 410, 810), sc.DisplayRectangle, "#51"); Assert.AreEqual (new Point (-125, -250), c1.Location, "#52"); Assert.AreEqual (new Point (375, 750), c2.Location, "#53"); }
/// ------------------------------------------------------------------------------------ /// <summary> /// attach this class to any dockable type of container control to make it dockable. /// Attach a container control and use it as a grip hande. The handle must support mouse /// move events. /// </summary> /// <param name="container">control to be dockable</param> /// <param name="handle">handle to be used to track the mouse movement (e.g. caption /// of the container)</param> /// <param name="fSplit"><c>true</c> to display a splitter, otherwise <c>false</c>.</param> /// <param name="persistence">The persistence object to pass on to the floaty.</param> /// <returns></returns> /// ------------------------------------------------------------------------------------ public IFloaty Attach(ScrollableControl container, Control handle, bool fSplit, Persistence persistence) { m_persistence = persistence; return Attach(container, handle, fSplit); }
public VScrollProperties(ScrollableControl container) : base(container) { }
/// ------------------------------------------------------------------------------------ /// <summary> /// attach this class to any dockable type of container control to make it dockable. /// Attach a container control and use it as a grip hande. The handle must support mouse /// move events. /// </summary> /// <param name="container">control to be dockable</param> /// <param name="handle">handle to be used to track the mouse movement (e.g. caption /// of the container)</param> /// <param name="fSplit"><c>true</c> to display a splitter, otherwise <c>false</c>.</param> /// <returns></returns> /// ------------------------------------------------------------------------------------ public IFloaty Attach(ScrollableControl container, Control handle, bool fSplit) { if (container == null) throw new ArgumentException("container cannot be null"); if (handle == null) throw new ArgumentException("handle cannot be null"); if (container.Parent == null) throw new ArgumentException("Parent of container cannot be null"); if (fSplit) { Splitter splitter = new Splitter(); container.Parent.Controls.Add(splitter); return Attach(container, handle, splitter); } return Attach(container, handle, null); }
public ICaret CreateCaret(ScrollableControl ctrl) { return new Caret(ctrl); }
protected ScrollProperties(ScrollableControl container) { parentControl = container; }
public void Init(System.String LoadFN, bool StreamMode) { streamMode = StreamMode; // application // Closing += new System.ComponentModel.CancelEventHandler(this.MainWindow_Closing_DISPOSE_ON_CLOSE); // JFrame.setDefaultLookAndFeelDecorated(false); //UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'" //GetType(); //UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'" mainIcon = new Bitmap(Utility.GetFullPath("images\\MainIcon.png")); //Icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap) mainIcon).GetHicon()); //UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'" GetType(); //UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'" mainLogo = new Bitmap(Utility.GetFullPath("/images/MainLogo.png")); templ = new Templates(); // toolbar ImageList temp_ImageList; temp_ImageList = new System.Windows.Forms.ImageList(); // temp_ToolBar = new System.Windows.Forms.ToolBar(); toolButtons = new Button[TOOL_COUNT]; //UPGRADE_TODO: Class 'javax.swing.Image' was converted to 'System.Drawing.Image' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingImageIcon'" toolIcons = new System.Drawing.Image[TOOL_COUNT]; //UPGRADE_TODO: Class 'javax.swing.ButtonGroup' was converted to 'System.Collections.IList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'" toolGroup = new ArrayList(); for (int n = 0; n < TOOL_COUNT; n++) { //UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'" toolIcons[n] = new Bitmap(Utility.GetFullPath("/images/" + IMAGE_TOOL[n] + ".png")); if (ACTIVE_TOOL[n]) { toolButtons[n] = new Button(); toolButtons[n].Image = toolIcons[n]; toolGroup.Add((System.Object) toolButtons[n]); System.Windows.Forms.ToolBarButton temp_ToolBarButton; //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'" // tools.Items.Add(toolButtons[n]); SupportClass.CommandManager.CheckCommand(toolButtons[n]); SupportClass.ToolTipSupport.setToolTipText(toolButtons[n], TOOL_TIPS[n]); } /*else {toolButtons[n]=new JButton(toolIcons[n]); tools.Add(toolButtons[n]); toolButtons[n].addActionListener(this);}*/ } //UPGRADE_TODO: Method 'javax.swing.AbstractButton.getModel' was converted to 'ToolStripButtonBase' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'" SupportClass.ButtonGroupSupport.SetSelected(toolGroup, toolButtons[TOOL_CURSOR], true); toolButtons[TOOL_SETATOM].MouseDown += new System.Windows.Forms.MouseEventHandler(mouseDown); toolButtons[TOOL_SETATOM].MouseDown += new System.Windows.Forms.MouseEventHandler(this.mousePressed); toolButtons[TOOL_SETATOM].KeyDown += new System.Windows.Forms.KeyEventHandler(keyDown); toolButtons[TOOL_SETATOM].KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed); toolButtons[TOOL_SETATOM].KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped); toolButtons[TOOL_TEMPLATE].MouseDown += new System.Windows.Forms.MouseEventHandler(mouseDown); toolButtons[TOOL_TEMPLATE].MouseDown += new System.Windows.Forms.MouseEventHandler(this.mousePressed); SelectElement("C"); // menus System.Windows.Forms.MainMenu menubar = new System.Windows.Forms.MainMenu(); System.Windows.Forms.MenuItem menufile = new System.Windows.Forms.MenuItem("&File"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menufile.setMnemonic((int) System.Windows.Forms.Keys.F); menufile.MenuItems.Add(MenuItem("New", (int) System.Windows.Forms.Keys.N, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('N' | (int) System.Windows.Forms.Keys.Control)))); menufile.MenuItems.Add(MenuItem("New Window", (int) System.Windows.Forms.Keys.W, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('N' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); menufile.MenuItems.Add(MenuItem("Open", (int) System.Windows.Forms.Keys.O, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('O' | (int) System.Windows.Forms.Keys.Control)))); if (!streamMode) menufile.MenuItems.Add(MenuItem("Save", (int) System.Windows.Forms.Keys.S, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('S' | (int) System.Windows.Forms.Keys.Control)))); menufile.MenuItems.Add(MenuItem("Save As", (int) System.Windows.Forms.Keys.A)); System.Windows.Forms.MenuItem menuexport = new System.Windows.Forms.MenuItem("&Export"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menuexport.setMnemonic((int) System.Windows.Forms.Keys.X); menuexport.MenuItems.Add(MenuItem("as MDL MOL", (int) System.Windows.Forms.Keys.M, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('M' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); menuexport.MenuItems.Add(MenuItem("as CML XML", (int) System.Windows.Forms.Keys.X, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('X' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); menufile.MenuItems.Add(menuexport); menufile.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); if (!streamMode) menufile.MenuItems.Add(MenuItem("Quit", (int) System.Windows.Forms.Keys.Q, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Q' | (int) System.Windows.Forms.Keys.Control)))); else menufile.MenuItems.Add(MenuItem("Save & Quit", (int) System.Windows.Forms.Keys.Q, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Q' | (int) System.Windows.Forms.Keys.Control)))); System.Windows.Forms.MenuItem menuedit = new System.Windows.Forms.MenuItem("&Edit"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menuedit.setMnemonic((int) System.Windows.Forms.Keys.E); menuedit.MenuItems.Add(MenuItem("Edit...", (int) System.Windows.Forms.Keys.E, toolIcons[TOOL_DIALOG], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) (' ' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Undo", (int) System.Windows.Forms.Keys.U, toolIcons[TOOL_UNDO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Z' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Redo", (int) System.Windows.Forms.Keys.R, toolIcons[TOOL_REDO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Z' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); menuedit.MenuItems.Add(MenuItem("Cut", (int) System.Windows.Forms.Keys.X, toolIcons[TOOL_CUT], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('X' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Copy", (int) System.Windows.Forms.Keys.C, toolIcons[TOOL_COPY], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('C' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Paste", (int) System.Windows.Forms.Keys.V, toolIcons[TOOL_PASTE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('V' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); menuedit.MenuItems.Add(MenuItem("Select All", (int) System.Windows.Forms.Keys.S, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('A' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Next Atom", (int) System.Windows.Forms.Keys.N, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('E' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Previous Atom", (int) System.Windows.Forms.Keys.P, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('E' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); menuedit.MenuItems.Add(MenuItem("Next Group", (int) System.Windows.Forms.Keys.G, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('G' | (int) System.Windows.Forms.Keys.Control)))); menuedit.MenuItems.Add(MenuItem("Previous Group", (int) System.Windows.Forms.Keys.R, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('G' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); menuedit.MenuItems.Add(MenuItem("Flip Horizontal", (int) System.Windows.Forms.Keys.H, null, null)); menuedit.MenuItems.Add(MenuItem("Flip Vertical", (int) System.Windows.Forms.Keys.V, null, null)); menuedit.MenuItems.Add(MenuItem("Rotate +45°", (int) System.Windows.Forms.Keys.D4, null, null)); menuedit.MenuItems.Add(MenuItem("Rotate -45°", (int) System.Windows.Forms.Keys.D5, null, null)); menuedit.MenuItems.Add(MenuItem("Rotate +90°", (int) System.Windows.Forms.Keys.D9, null, null)); menuedit.MenuItems.Add(MenuItem("Rotate -90°", (int) System.Windows.Forms.Keys.D0, null, null)); menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); menuedit.MenuItems.Add(MenuItem("Add Temporary Template", (int) System.Windows.Forms.Keys.T, null, null)); menuedit.MenuItems.Add(MenuItem("Normalise Bond Lengths", (int) System.Windows.Forms.Keys.N, null, null)); System.Windows.Forms.MenuItem menuview = new System.Windows.Forms.MenuItem("&View"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menuview.setMnemonic((int) System.Windows.Forms.Keys.V); menuview.MenuItems.Add(MenuItem("Zoom Full", (int) System.Windows.Forms.Keys.F, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('0' | (int) System.Windows.Forms.Keys.Control)))); menuview.MenuItems.Add(MenuItem("Zoom In", (int) System.Windows.Forms.Keys.I, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('=' | (int) System.Windows.Forms.Keys.Control)))); menuview.MenuItems.Add(MenuItem("Zoom Out", (int) System.Windows.Forms.Keys.O, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('-' | (int) System.Windows.Forms.Keys.Control)))); menuview.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); //UPGRADE_TODO: Class 'javax.swing.ButtonGroup' was converted to 'System.Collections.IList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'" System.Collections.IList showBG = new ArrayList(); menuview.MenuItems.Add(RadioMenuItem("Show Elements", (int) System.Windows.Forms.Keys.E, true, showBG)); menuview.MenuItems.Add(RadioMenuItem("Show All Elements", (int) System.Windows.Forms.Keys.A, false, showBG)); menuview.MenuItems.Add(RadioMenuItem("Show Indices", (int) System.Windows.Forms.Keys.I, false, showBG)); menuview.MenuItems.Add(RadioMenuItem("Show Ring ID", (int) System.Windows.Forms.Keys.R, false, showBG)); menuview.MenuItems.Add(RadioMenuItem("Show CIP Priority", (int) System.Windows.Forms.Keys.C, false, showBG)); System.Windows.Forms.MenuItem menutool = new System.Windows.Forms.MenuItem("&Tool"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menutool.setMnemonic((int) System.Windows.Forms.Keys.T); menutool.MenuItems.Add(MenuItem("Cursor", (int) System.Windows.Forms.Keys.C, toolIcons[TOOL_CURSOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ((int) System.Windows.Forms.Keys.Escape | 0)))); menutool.MenuItems.Add(MenuItem("Rotator", (int) System.Windows.Forms.Keys.R, toolIcons[TOOL_ROTATOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('R' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Erasor", (int) System.Windows.Forms.Keys.E, toolIcons[TOOL_ERASOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('D' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Edit Atom", (int) System.Windows.Forms.Keys.A, toolIcons[TOOL_EDIT], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) (',' | (int) System.Windows.Forms.Keys.Control)))); //UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'" GetType(); //UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'" menutool.MenuItems.Add(MenuItem("Set Atom", (int) System.Windows.Forms.Keys.S, new Bitmap(Utility.GetFullPath("/images/ASelMenu.png")), new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('.' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Single Bond", (int) System.Windows.Forms.Keys.D1, toolIcons[TOOL_SINGLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('1' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Double Bond", (int) System.Windows.Forms.Keys.D2, toolIcons[TOOL_DOUBLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('2' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Triple Bond", (int) System.Windows.Forms.Keys.D3, toolIcons[TOOL_TRIPLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('3' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Zero Bond", (int) System.Windows.Forms.Keys.D0, toolIcons[TOOL_ZERO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('0' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Inclined Bond", (int) System.Windows.Forms.Keys.I, toolIcons[TOOL_INCLINED])); menutool.MenuItems.Add(MenuItem("Declined Bond", (int) System.Windows.Forms.Keys.D, toolIcons[TOOL_DECLINED])); menutool.MenuItems.Add(MenuItem("Unknown Bond", (int) System.Windows.Forms.Keys.U, toolIcons[TOOL_UNKNOWN])); menutool.MenuItems.Add(MenuItem("Charge", (int) System.Windows.Forms.Keys.H, toolIcons[TOOL_CHARGE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('H' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Template Tool", (int) System.Windows.Forms.Keys.T, toolIcons[TOOL_TEMPLATE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('T' | (int) System.Windows.Forms.Keys.Control)))); menutool.MenuItems.Add(MenuItem("Select Template", (int) System.Windows.Forms.Keys.T, toolIcons[TOOL_TEMPLATE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('T' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift)))); System.Windows.Forms.MenuItem menuhydr = new System.Windows.Forms.MenuItem("H&ydrogen"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menuhydr.setMnemonic((int) System.Windows.Forms.Keys.Y); chkShowHydr = new System.Windows.Forms.MenuItem("Show H&ydrogen"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // chkShowHydr.setMnemonic((int) System.Windows.Forms.Keys.Y); chkShowHydr.Checked = true; chkShowHydr.Click += new System.EventHandler(this.actionPerformed); SupportClass.CommandManager.CheckCommand(chkShowHydr); menuhydr.MenuItems.Add(chkShowHydr); menuhydr.MenuItems.Add(MenuItem("Set Explicit", (int) System.Windows.Forms.Keys.E)); menuhydr.MenuItems.Add(MenuItem("Clear Explicit", (int) System.Windows.Forms.Keys.X)); menuhydr.MenuItems.Add(MenuItem("Zero Explicit", (int) System.Windows.Forms.Keys.Z)); menuhydr.MenuItems.Add(MenuItem("Create Actual", (int) System.Windows.Forms.Keys.C)); menuhydr.MenuItems.Add(MenuItem("Delete Actual", (int) System.Windows.Forms.Keys.D)); System.Windows.Forms.MenuItem menuster = new System.Windows.Forms.MenuItem("&Stereochemistry"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" //menuster.setMnemonic((int) System.Windows.Forms.Keys.S); chkShowSter = new System.Windows.Forms.MenuItem("Show Stereo&labels"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // chkShowSter.setMnemonic((int) System.Windows.Forms.Keys.L); chkShowSter.Checked = false; chkShowSter.Click += new System.EventHandler(this.actionPerformed); SupportClass.CommandManager.CheckCommand(chkShowSter); menuster.MenuItems.Add(chkShowSter); menuster.MenuItems.Add(MenuItem("Invert Stereochemistry", (int) System.Windows.Forms.Keys.I)); menuster.MenuItems.Add(MenuItem("Set R/Z", (int) System.Windows.Forms.Keys.R)); menuster.MenuItems.Add(MenuItem("Set S/E", (int) System.Windows.Forms.Keys.S)); menuster.MenuItems.Add(MenuItem("Cycle Wedges", (int) System.Windows.Forms.Keys.C)); menuster.MenuItems.Add(MenuItem("Remove Wedges", (int) System.Windows.Forms.Keys.W)); System.Windows.Forms.MenuItem menuhelp = new System.Windows.Forms.MenuItem("&Help"); //UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'" // menuhelp.setMnemonic((int) System.Windows.Forms.Keys.H); menuhelp.MenuItems.Add(MenuItem("About", (int) System.Windows.Forms.Keys.A)); menubar.MenuItems.Add(menufile); menubar.MenuItems.Add(menuedit); menubar.MenuItems.Add(menuview); menubar.MenuItems.Add(menutool); menubar.MenuItems.Add(menuhydr); menubar.MenuItems.Add(menuster); //UPGRADE_ISSUE: Method 'javax.swing.Box.createHorizontalGlue' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingBox'" //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'" // TODO: Figure out what horizontal glue is and find equiv //System.Windows.Forms.Control temp_Control; //temp_Control = Box.createHorizontalGlue(); //menubar.Controls.Add(temp_Control); menubar.MenuItems.Add(menuhelp); // molecule editor = new EditorPane(this.Width, this.Height, false); editor.SetMolSelectListener((MolSelectListener)this); //UPGRADE_TODO: Class 'javax.swing.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'" //UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'" System.Windows.Forms.ScrollableControl temp_scrollablecontrol; temp_scrollablecontrol = new System.Windows.Forms.ScrollableControl(); temp_scrollablecontrol.AutoScroll = true; temp_scrollablecontrol.Controls.Add(editor); System.Windows.Forms.ScrollableControl scroll = temp_scrollablecontrol; // overall layout //UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'" //UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'" //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'" /* ((System.Windows.Forms.ContainerControl) this).setLayout(new BorderLayout());*/ //UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'" //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'" ((System.Windows.Forms.ContainerControl) this).Controls.Add(scroll); scroll.Dock = System.Windows.Forms.DockStyle.Fill; scroll.BringToFront(); //UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'" //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'" // ((System.Windows.Forms.ContainerControl) this).Controls.Add(menubar); // menubar.Dock = System.Windows.Forms.DockStyle.Top; // menubar.SendToBack(); //UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'" //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'" //UPGRADE_ISSUE: Method 'java.awt.Window.pack' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtWindowpack'" // pack(); editor.Focus(); editor.SetToolCursor(); if (LoadFN != null) { try { //UPGRADE_TODO: Constructor 'java.io.FileInputStream.FileInputStream' was converted to 'System.IO.FileStream.FileStream' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioFileInputStreamFileInputStream_javalangString'" System.IO.FileStream istr = new System.IO.FileStream(LoadFN, System.IO.FileMode.Open, System.IO.FileAccess.Read); Molecule frag = MoleculeStream.ReadUnknown(istr); editor.AddArbitraryFragment(frag); istr.Close(); } catch (System.IO.IOException e) { //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.toString' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" SupportClass.OptionPaneSupport.ShowMessageDialog(null, e.ToString(), "Open Failed", (int) System.Windows.Forms.MessageBoxIcon.Error); return ; } SetFilename(LoadFN); editor.NotifySaved(); } if (streamMode) ReadStream(); KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed); KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped); editor.KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed); editor.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped); }
public DialogEdit(Control Parent, Molecule Mol, List <int> SelIdx) { // super(Parent, "Edit Molecule", true) mol = Mol.Clone(); aselidx = SelIdx; //UPGRADE_ISSUE: The following fragment of code could not be parsed and was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1156'" bselidx = new List <int>(); for (int n = 1; n <= mol.NumBonds(); n++) { if (aselidx.IndexOf(mol.BondFrom(n)) >= 0 && aselidx.IndexOf(mol.BondTo(n)) >= 0) { bselidx.Add(n); } } //UPGRADE_ISSUE: Method 'javax.swing.JDialog.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJDialogsetLayout_javaawtLayoutManager'" //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'" /* * setLayout(new BorderLayout());*/ atoms = new AnonymousClassJTable(this, CompileAtomData(), new System.String[] { "#", "El", "X", "Y", "Charge", "Unpaired", "HExplicit" }); bonds = new AnonymousClassJTable1(this, CompileBondData(), new System.String[] { "#", "From", "To", "Order", "Type" }); //UPGRADE_TODO: Method 'javax.swing.table.TableColumn.setCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1095'" //UPGRADE_TODO: The equivalent in .NET for method 'javax.swing.table.TableColumnModel.getColumn' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" // ((System.Data.DataTable)atoms.DataSource).Columns[0].setCellEditor(null); System.Windows.Forms.ComboBox bondTypes = new System.Windows.Forms.ComboBox(); for (int n = 0; n < BOND_TYPES.Length; n++) { bondTypes.Items.Add(BOND_TYPES[n]); } //UPGRADE_TODO: Method 'javax.swing.table.TableColumn.setCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1095'" //UPGRADE_TODO: The equivalent in .NET for method 'javax.swing.table.TableColumnModel.getColumn' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" //UPGRADE_ISSUE: Constructor 'javax.swing.DefaultCellEditor.DefaultCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingDefaultCellEditor'" // TODO: Have to see this in action before I can tel what they need to do. // ((System.Data.DataTable)bonds.DataSource).Columns[4].setCellEditor(new DefaultCellEditor(bondTypes)); System.Windows.Forms.Panel tabAtoms = new System.Windows.Forms.Panel(), tabBonds = new System.Windows.Forms.Panel(); //UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'" //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'" /* * tabAtoms.setLayout(new BorderLayout());*/ //UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'" //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'" /* * tabBonds.setLayout(new BorderLayout());*/ //UPGRADE_ISSUE: Method 'javax.swing.JTable.setPreferredScrollableViewportSize' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTablesetPreferredScrollableViewportSize_javaawtDimension'" // TODO: atoms.setPreferredScrollableViewportSize(new System.Drawing.Size(350, 200)); //UPGRADE_ISSUE: Method 'javax.swing.JTable.setPreferredScrollableViewportSize' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTablesetPreferredScrollableViewportSize_javaawtDimension'" // TODO: bonds.setPreferredScrollableViewportSize(new System.Drawing.Size(350, 200)); //UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'" System.Windows.Forms.ScrollableControl temp_scrollablecontrol2; temp_scrollablecontrol2 = new System.Windows.Forms.ScrollableControl(); temp_scrollablecontrol2.AutoScroll = true; temp_scrollablecontrol2.Controls.Add(atoms); //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'" System.Windows.Forms.Control temp_Control; temp_Control = temp_scrollablecontrol2; tabAtoms.Controls.Add(temp_Control); //UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'" System.Windows.Forms.ScrollableControl temp_scrollablecontrol4; temp_scrollablecontrol4 = new System.Windows.Forms.ScrollableControl(); temp_scrollablecontrol4.AutoScroll = true; temp_scrollablecontrol4.Controls.Add(bonds); //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'" System.Windows.Forms.Control temp_Control2; temp_Control2 = temp_scrollablecontrol4; tabBonds.Controls.Add(temp_Control2); tabs = new System.Windows.Forms.TabControl(); //UPGRADE_TODO: Method 'javax.swing.JTabbedPane.addTab' was converted to 'SupportClass.TabControlSupport.AddTab' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJTabbedPaneaddTab_javalangString_javaawtComponent'" SupportClass.TabControlSupport.AddTab(tabs, "Atoms", tabAtoms); //UPGRADE_TODO: Method 'javax.swing.JTabbedPane.addTab' was converted to 'SupportClass.TabControlSupport.AddTab' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJTabbedPaneaddTab_javalangString_javaawtComponent'" SupportClass.TabControlSupport.AddTab(tabs, "Bonds", tabBonds); //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'" Controls.Add(tabs); tabs.Dock = System.Windows.Forms.DockStyle.Fill; tabs.BringToFront(); System.Windows.Forms.Panel buttons = new System.Windows.Forms.Panel(); //UPGRADE_TODO: Constructor 'java.awt.FlowLayout.FlowLayout' was converted to 'System.Object[]' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtFlowLayoutFlowLayout_int'" buttons.Tag = new System.Object[] { (int)System.Drawing.ContentAlignment.TopRight, 5, 5 }; buttons.Layout += new System.Windows.Forms.LayoutEventHandler(SupportClass.FlowLayoutResize); accept = SupportClass.ButtonSupport.CreateStandardButton("Accept"); accept.Click += new System.EventHandler(this.actionPerformed); SupportClass.CommandManager.CheckCommand(accept); reject = SupportClass.ButtonSupport.CreateStandardButton("Reject"); reject.Click += new System.EventHandler(this.actionPerformed); SupportClass.CommandManager.CheckCommand(reject); //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'" buttons.Controls.Add(accept); //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'" buttons.Controls.Add(reject); //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'" Controls.Add(buttons); buttons.Dock = System.Windows.Forms.DockStyle.Bottom; buttons.SendToBack(); // TODO: What does pack do? // pack(); }
protected ScrollProperties(ScrollableControl container) { this.parent = container; }
internal DockPaddingEdges(ScrollableControl owner) { _owner = owner; }