public void on_layout_changed(object s, EventArgs e) { mycanvas.Width = ActualWidth; mycanvas.Height = ActualHeight; var fre = new eq.gui.FrameResizeEvent(); fre.set_width(get_width()); fre.set_height(get_height()); _event(fre); }
public void on_size_changed(double w, double h) { mycanvas.Width = w; mycanvas.Height = h; foreach (var fp in this.Children) { if (fp is FramePanel) { ((FramePanel)fp).update_popup_position(w, h); } } var fre = new eq.gui.FrameResizeEvent(); fre.set_width(w); fre.set_height(h); _event(fre); }
public void on_loaded_custom(object src, System.Windows.RoutedEventArgs e) { var main = create_main_object(); if (main is eq.gui.FrameController == false) { return; } this.controller = (eq.gui.FrameController)main; /*if(eq.api.StringStatic.eq_api_StringStatic_for_strptr("fullscreen").equals((eq.api.Object)this.controller.get_preferred_type())) { * Microsoft.Phone.Shell.SystemTray.IsVisible = false; * }*/ mycanvas = new MyCanvas(this) { Width = ActualWidth, Height = ActualHeight }; Children.Add(mycanvas); controller.initialize_frame(this); var pp = this.Parent as FramePanel; while (pp != null) { var px = pp.Parent as FramePanel; if (px != null) { pp = px; continue; } break; } var parent = pp; if (parent != null) { parent.set_input_enabled(false); double width = 480, height = 270; var sz = this.controller.get_preferred_size(); if (sz != null) { width = sz.get_width(); height = sz.get_height(); } if (width > parent.get_width()) { width = parent.get_width(); } if (height > parent.get_height()) { height = parent.get_height(); } double pw = parent.get_width(), ph = parent.get_height(); Canvas.SetLeft(this, pw / 2 - width / 2); Canvas.SetTop(this, ph / 2 - height / 2); this.Width = width; this.Height = height; mycanvas.Width = width; mycanvas.Height = height; } var fre = new eq.gui.FrameResizeEvent(); fre.set_width(mycanvas.Width); fre.set_height(mycanvas.Height); _event(fre); on_activate(); Loaded -= on_loaded_custom; LayoutUpdated += on_layout_changed; do_add_bottom_element(); }