Пример #1
0
        public Mistelix(string [] args, params object [] props)
            : base("mistelix", Defines.VERSION, Modules.UI,  args, props)
        {
            Gtk.Application.Init ();
            Logger.Info ("Mistelix " + Defines.VERSION + " starting");

            Catalog.Init ("mistelix", Defines.GNOME_LOCALE_DIR);

            GtkBeans.Builder builder = new GtkBeans.Builder ("mistelix.ui");
            builder.Autoconnect (this);

            foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes ("/Mistelix/SlideTransitions"))
                Logger.Info ("Extension:" + node.CreateInstance ());

            foreach (TypeExtensionNode node in EffectManager.List)
                Logger.Info ("Extension:" + node.CreateInstance ());

            //project = authoring_view.Project = element_view.Project = new Project ();
            //project.Load ("/home/jordi/dev/mistelix/projects/Project_TwoSlidesShows.mistelix");
            //element_view.LoadElements ();
            //authoring_view.UpdateTheme ();

            CreateViews ();

            if (preferences.GetBoolValue (Preferences.SafeAreaKey) == true)
                safearea_menuitem.Active = true;

            recent_submenu = new ExtendedMenu ();
            recent_menuitem.Submenu = recent_submenu;

            app_window.IconName = "mistelix";
            hpaned.Position = 30; // H (right), controls position of top "Project elements" button bar
            vpaned.Position = 700; // W (left)
            LoadWindowPosition ();
            SensitiveToProjectContext ();
        }
Пример #2
0
        void OnRecentFiles(object sender,EventArgs args)
        {
            recent_submenu = new ExtendedMenu ();
            recent_menuitem.Submenu = recent_submenu;

            recent_files.Sort ();
            for (int i = 0; i < recent_files.Items.Count; i++)
            {
                string label;
                MenuItemData item;

                label = recent_files.Items[i].filename;
                label = label.Replace ("_", "__");
                item = new MenuItemData (label);
                item.Data = recent_files.Items[i];

                recent_submenu.Append (item);
                item.Show ();
                item.Activated += OnRecentMenuItem;
            }
        }
Пример #3
0
        void HandleButtonPress(object o, ButtonPressEventArgs args)
        {
            Logger.Debug ("AuthoringPaneView.HandleButtonPress");

            if (project == null)
                return;

            if (args.Event.Type == EventType.TwoButtonPress) {
                DoubleClick (o, args);
                return;
            }

            int x = (int) args.Event.X;
            int y = (int) args.Event.Y;
            int b = ButtonIDFromCoordinates (x, y);

            if (b == -1)
                return;

            if (args.Event.Button == 3) {
                active_item = b;
                ExtendedMenu menu = new ExtendedMenu ();
                menu.AddItem (Catalog.GetString ("Element properties"), OnShowElementProperties);
                menu.AddItem (Catalog.GetString ("Delete element from project"), OnDeleteElement);
                menu.Popup (args);
            }

            button = b;
            x_delta = x >= project.Buttons[b].X ?  project.Buttons[b].X - x: x - project.Buttons[b].X;
            y_delta = y >= project.Buttons[b].Y ?  project.Buttons[b].Y - y: y - project.Buttons[b].Y;
            moving_button = new Core.Button (x + x_delta, y + y_delta, project.Buttons[b].LinkedId);
            GdkWindow.Cursor = new Gdk.Cursor (Gdk.CursorType.Hand1);
            QueueDraw ();
            Logger.Debug ("AuthoringPaneView.HandleButtonPress. Button {0}", project.Buttons[b].LinkedId);
        }