void AddWidget (object sender, AddWidgetArgs a)
		{
			a.Widget.Show ();
			vbox.PackStart (a.Widget, false, true, 0);
		}
		void OnAddWidget (object sender, AddWidgetArgs a)
		{
			a.Widget.Show ();
			this.Add (a.Widget);
		}
Пример #3
0
		static void OnWidgetAdd (object obj, AddWidgetArgs args)
		{
			if (args.Widget is Toolbar)
				toolbar = (Toolbar)args.Widget;
			args.Widget.Show ();
			box.PackStart (args.Widget, false, true, 0);
		}
Пример #4
0
    // pridanie menu a toolbarov do prislusnich widgetov
    private void OnWidgetAdd(object obj, AddWidgetArgs args)
    {
        if (args.Widget is Toolbar) {
            args.Widget.Show();
            if (args.Widget.Name == "toolbarLeft") {
                toolbarLeft = (Toolbar)args.Widget;

                toolbarLeft.ShowAll();
                toolbarLeft.IconSize = IconSize.LargeToolbar;

                vpMenuLeft.Pack1(toolbarLeft, false, false);

            }
            if (args.Widget.Name == "toolbarMiddle") {
                toolbarMiddle = (Toolbar)args.Widget;
                vbMenuMidle.PackEnd(toolbarMiddle,true, true, 0);//true, false,

                ToolItem tic = new ToolItem();
                ToolItem tic2 = new ToolItem();
                ToolItem tic3 = new ToolItem();
                ToolItem til1 = new ToolItem();
                ToolItem til2 = new ToolItem();
                ToolItem til3 = new ToolItem();

                /*Label lbl1 = new Label(MainClass.Languages.Translate("project"));
                Label lbl2 = new Label(MainClass.Languages.Translate("resolution"));
                Label lbl3 = new Label(MainClass.Languages.Translate("device"));*/
                Label lbl1 = new Label(MainClass.Languages.Translate(" "));
                Label lbl2 = new Label(MainClass.Languages.Translate(" "));
                Label lbl3 = new Label(MainClass.Languages.Translate(" "));
                til1.Add(lbl1);
                til2.Add(lbl2);
                til3.Add(lbl3);

                if(MainClass.Platform.IsMac){

                    VBox vboxMenu1 = new VBox();
                    vboxMenu1.PackStart(new Label(),true,false,0);
                    vboxMenu1.PackStart(ddbProject,false,false,0);
                    vboxMenu1.PackEnd(new Label(),true,false,0);

                    VBox vboxMenu2 = new VBox();
                    vboxMenu2.PackStart(new Label(),true,false,0);
                    vboxMenu2.PackStart(ddbResolution,false,false,0);
                    vboxMenu2.PackEnd(new Label(),true,false,0);

                    VBox vboxMenu3 = new VBox();
                    vboxMenu3.PackStart(new Label(),true,false,0);
                    vboxMenu3.PackStart(ddbDevice,false,false,0);
                    vboxMenu3.PackEnd(new Label(),true,false,0);

                    tic.Add(vboxMenu1);
                    tic2.Add(vboxMenu2);
                    tic3.Add(vboxMenu3);

                } else {
                    tic.Add(ddbProject);
                    tic2.Add(ddbResolution);
                    tic3.Add(ddbDevice);

                }
                toolbarMiddle.Insert(tic2, 0);
                toolbarMiddle.Insert(til2, 0);
                //toolbarMiddle.Insert(new SeparatorToolItem(), 0);
                toolbarMiddle.Insert(tic3, 0);
                toolbarMiddle.Insert(til3, 0);
                //toolbarMiddle.Insert(new SeparatorToolItem(), 0);
                toolbarMiddle.Insert(tic, 0);
                toolbarMiddle.Insert(til1, 0);

                toolbarMiddle.ShowAll();
            }
            if (args.Widget.Name == "toolbarRight1") {
                toolbarRight1 = (Toolbar)args.Widget;
                toolbarRight1.IconSize = IconSize.SmallToolbar;
                toolbarRight1.ToolbarStyle = ToolbarStyle.Icons;
                //toolbarRight.
                //hbMenuRight.PackStart(toolbarRight, true, true,0);
                //vbRight.PackStart(toolbarRight1, true, true,0);//Pack1(toolbarRight, true, true);
                tblMenuRight.Attach(toolbarRight1,1,2,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            }
            if (args.Widget.Name == "toolbarRight2") {
                toolbarRight2 = (Toolbar)args.Widget;
                toolbarRight2.IconSize = IconSize.SmallToolbar;
                toolbarRight2.ToolbarStyle = ToolbarStyle.Icons;
                //toolbarRight2.AccelCanActivate;
                //toolbarRight.
                //hbMenuRight.PackStart(toolbarRight, true, true,0);
                tblMenuRight.Attach(toolbarRight2,1,2,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
                //vbRight.PackEnd(toolbarRight2, true, true,0);//Pack1(toolbarRight, true, true);

            }
        }
        if (args.Widget is MenuBar) {
            mainMenu =(MenuBar)args.Widget;
            mainMenu.Show();

            if(!MainClass.Platform.IsMac)
                vbMenuMidle.PackStart(mainMenu, true, true, 0);
        }
    }