protected override void OnLoad(EventArgs e) { base.OnLoad(e); Alt.GUI.Temporary.Gwen.Control.MenuStrip menu = new Alt.GUI.Temporary.Gwen.Control.MenuStrip(this); Alt.GUI.Temporary.Gwen.Control.MenuItem root = menu.AddItem("Original Size"); { root.Menu.AddItem("800%").SetAction(miZoom_Click); root.Menu.AddItem("600%").SetAction(miZoom_Click); root.Menu.AddItem("400%").SetAction(miZoom_Click); root.Menu.AddItem("200%").SetAction(miZoom_Click); root.Menu.AddItem("150%").SetAction(miZoom_Click); root.Menu.AddItem("100%").SetAction(miZoom_Click); root.Menu.AddItem("75%").SetAction(miZoom_Click); root.Menu.AddItem("50%").SetAction(miZoom_Click); root.Menu.AddItem("25%").SetAction(miZoom_Click); root.Menu.AddItem("10%").SetAction(miZoom_Click); root.Menu.AddDivider(); root.Menu.AddItem("Best Fit").SetAction(miBestFit_Click); root.Menu.AddItem("Full Page").SetAction(miFullPage_Click); } menu.AddItem("Full Page" //, "AltData/Gwen/test16.png" ).Clicked += miFullPage_Click; menu.AddItem("Best Fit" //, "AltData/Gwen/test16.png" ).Clicked += miBestFit_Click; menu.AddItem("Smaller" //, "AltData/Gwen/test16.png" ).Clicked += miSmaller_Click; menu.AddItem("Larger" //, "AltData/Gwen/test16.png" ).Clicked += miLarger_Click; #if !SILVERLIGHT menu.AddItem("Create PDF"//, "AltData/Gwen/test16.png" ).Clicked += miCreatePDF_Click; #endif Alt.GUI.Temporary.Gwen.Control.StatusBar sb = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this); m_StatisBarLabel = new Alt.GUI.Temporary.Gwen.Control.Label(sb); m_StatisBarLabel.AutoSizeToContents = true; m_StatisBarLabel.Text = ""; sb.AddControl(m_StatisBarLabel, false); m_PagePreview.SetRenderEvent(new Alt.GUI.PdfSharp.Temporary.Gwen.PagePreview.RenderEvent(Render)); m_PagePreview.PageSize = PageSizeConverter.ToSize(PageSize.A4); UpdateStatusBar(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Alt.GUI.Temporary.Gwen.Control.MenuStrip menu = new Alt.GUI.Temporary.Gwen.Control.MenuStrip(this); menu.Margin = Alt.GUI.Temporary.Gwen.Margin.Two; { Alt.GUI.Temporary.Gwen.Control.MenuItem root = menu.AddItem("File"); root.Menu.AddItem("New", "AltData/Gwen/test16.png", "Ctrl+N").SetAction(MenuItemSelect); root.Menu.AddItem("Load", "AltData/Gwen/test16.png", "Ctrl+L").SetAction(MenuItemSelect); root.Menu.AddItem("Save", String.Empty, "Ctrl+S").SetAction(MenuItemSelect); root.Menu.AddItem("Save As..", String.Empty, "Ctrl+A").SetAction(MenuItemSelect); root.Menu.AddItem("Quit", String.Empty, "Ctrl+Q").SetAction(MenuItemSelect); } { Alt.GUI.Temporary.Gwen.Control.MenuItem pRoot = menu.AddItem("\u043F\u0438\u0440\u0430\u0442\u0441\u0442\u0432\u043E"); pRoot.Menu.AddItem("\u5355\u5143\u6D4B\u8BD5").SetAction(MenuItemSelect); pRoot.Menu.AddItem("\u0111\u01A1n v\u1ECB th\u1EED nghi\u1EC7m", "AltData/Gwen/test16.png").SetAction(MenuItemSelect); } { Alt.GUI.Temporary.Gwen.Control.MenuItem pRoot = menu.AddItem("Submenu"); Alt.GUI.Temporary.Gwen.Control.MenuItem pCheckable = pRoot.Menu.AddItem("Checkable"); pCheckable.IsCheckable = true; pCheckable.IsCheckable = true; { Alt.GUI.Temporary.Gwen.Control.MenuItem pRootB = pRoot.Menu.AddItem("Two"); pRootB.Menu.AddItem("Two.One"); pRootB.Menu.AddItem("Two.Two"); pRootB.Menu.AddItem("Two.Three"); pRootB.Menu.AddItem("Two.Four"); pRootB.Menu.AddItem("Two.Five"); pRootB.Menu.AddItem("Two.Six"); pRootB.Menu.AddItem("Two.Seven"); pRootB.Menu.AddItem("Two.Eight"); pRootB.Menu.AddItem("Two.Nine", "AltData/Gwen/test16.png"); } pRoot.Menu.AddItem("Three"); pRoot.Menu.AddItem("Four"); pRoot.Menu.AddItem("Five"); { Alt.GUI.Temporary.Gwen.Control.MenuItem pRootB = pRoot.Menu.AddItem("Six"); pRootB.Menu.AddItem("Six.One"); pRootB.Menu.AddItem("Six.Two"); pRootB.Menu.AddItem("Six.Three"); pRootB.Menu.AddItem("Six.Four"); pRootB.Menu.AddItem("Six.Five", "AltData/Gwen/test16.png"); { Alt.GUI.Temporary.Gwen.Control.MenuItem pRootC = pRootB.Menu.AddItem("Six.Six"); pRootC.Menu.AddItem("Sheep"); pRootC.Menu.AddItem("Goose"); { Alt.GUI.Temporary.Gwen.Control.MenuItem pRootD = pRootC.Menu.AddItem("Camel"); pRootD.Menu.AddItem("Eyes"); pRootD.Menu.AddItem("Nose"); { Alt.GUI.Temporary.Gwen.Control.MenuItem pRootE = pRootD.Menu.AddItem("Hair"); pRootE.Menu.AddItem("Blonde"); pRootE.Menu.AddItem("Black"); { Alt.GUI.Temporary.Gwen.Control.MenuItem pRootF = pRootE.Menu.AddItem("Red"); pRootF.Menu.AddItem("Light"); pRootF.Menu.AddItem("Medium"); pRootF.Menu.AddItem("Dark"); } pRootE.Menu.AddItem("Brown"); } pRootD.Menu.AddItem("Ears"); } pRootC.Menu.AddItem("Duck"); } pRootB.Menu.AddItem("Six.Seven"); pRootB.Menu.AddItem("Six.Eight"); pRootB.Menu.AddItem("Six.Nine"); } pRoot.Menu.AddItem("Seven"); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); #if SILVERLIGHT || UNITY_WEBPLAYER Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(this); label.AutoSizeToContents = true; label.Text = //Description + "\n" + "(This example is not available in this Demo, please download SDK)"; "THIS EXAMPLE IS NOT AVAILABLE IN THIS DEMO,\nPLEASE DOWNLOAD AltGUI SDK"; label.TextColor = Color.Orange * 1.2; label.Dock = Pos.Top; label.Margin = new Alt.GUI.Temporary.Gwen.Margin(0, 0, 0, 5); label.Font = Example_NotAvailable_ScreenShot.Font; #endif // GUI { m_Menu = new Alt.GUI.Temporary.Gwen.Control.MenuStrip(this); { Alt.GUI.Temporary.Gwen.Control.MenuItem root = filtersItem = m_Menu.AddItem("Filters"); { (noneFiltersItem = root.Menu.AddItem("None")).SetAction(noneFiltersItem_Click); root.Menu.AddDivider(); #if !SILVERLIGHT //TEMP (grayscaleFiltersItem = root.Menu.AddItem("Grayscale")).SetAction(grayscaleFiltersItem_Click); (sepiaFiltersItem = root.Menu.AddItem("Sepia")).SetAction(sepiaFiltersItem_Click); (invertFiltersItem = root.Menu.AddItem("Invert")).SetAction(invertFiltersItem_Click); (rotateChannelFiltersItem = root.Menu.AddItem("Rotate channel")).SetAction(rotateChannelFiltersItem_Click); (colorFiltersItem = root.Menu.AddItem("Color filtering")).SetAction(colorFiltersItem_Click); (rgbLinearFiltersItem = root.Menu.AddItem("Levels linear correction")).SetAction(rgbLinearFiltersItem_Click); root.Menu.AddDivider(); (hueModifierFiltersItem = root.Menu.AddItem("Hue modifier")).SetAction(hueModifierFiltersItem_Click); (saturationAdjustingFiltersItem = root.Menu.AddItem("Saturation adjusting")).SetAction(saturationAdjustingFiltersItem_Click); (brightnessAdjustingFiltersItem = root.Menu.AddItem("Brightness adjusting")).SetAction(brightnessAdjustingFiltersItem_Click); (contrastAdjustingFiltersItem = root.Menu.AddItem("Contrast adjusting")).SetAction(contrastAdjustingFiltersItem_Click); (hslFiltersItem = root.Menu.AddItem("HSL filtering")).SetAction(hslFiltersItem_Click); root.Menu.AddDivider(); //TEMP (yCbCrLinearFiltersItem = root.Menu.AddItem("YCbCr linear correction")).SetAction(yCbCrLinearFiltersItem_Click); (yCbCrFiltersItem = root.Menu.AddItem("YCbCr filtering")).SetAction(yCbCrFiltersItem_Click); root.Menu.AddDivider(); //TEMP (thresholdFiltersItem = root.Menu.AddItem("Threshold binarization")).SetAction(thresholdFiltersItem_Click); //TEMP (floydFiltersItem = root.Menu.AddItem("Floyd-Steinberg dithering")).SetAction(floydFiltersItem_Click); //TEMP (orderedDitheringFiltersItem = root.Menu.AddItem("Ordered dithering")).SetAction(orderedDitheringFiltersItem_Click); //TEMP root.Menu.AddDivider(); (convolutionFiltersItem = root.Menu.AddItem("Convolution")).SetAction(convolutionFiltersItem_Click); (sharpenFiltersItem = root.Menu.AddItem("Sharpen")).SetAction(sharpenFiltersItem_Click); (gaussianFiltersItem = root.Menu.AddItem("Gaussian blur")).SetAction(gaussianFiltersItem_Click); root.Menu.AddDivider(); //TEMP (differenceEdgesFiltersItem = root.Menu.AddItem("Difference edge detector")).SetAction(differenceEdgesFiltersItem_Click); //TEMP (homogenityEdgesFiltersItem = root.Menu.AddItem("Homogenity edge detector")).SetAction(homogenityEdgesFiltersItem_Click); //TEMP (sobelEdgesFiltersItem = root.Menu.AddItem("Sobel edge detector")).SetAction(sobelEdgesFiltersItem_Click); //TEMP root.Menu.AddDivider(); (jitterFiltersItem = root.Menu.AddItem("Jitter")).SetAction(jitterFiltersItem_Click); (oilFiltersItem = root.Menu.AddItem("Oil Painting")).SetAction(oilFiltersItem_Click); (textureFiltersItem = root.Menu.AddItem("Texture")).SetAction(textureFiltersItem_Click); #else root.Menu.AddItem("Image filters are not available in Silverlight yet"); #endif } root = sizeItem = m_Menu.AddItem("Size mode"); { sizeItem.Click += new EventHandler(sizeItem_Popup); (normalSizeItem = root.Menu.AddItem("Normal")).SetAction(normalSizeItem_Click); (stretchedSizeItem = root.Menu.AddItem("Stretched")).SetAction(stretchedSizeItem_Click); (centeredSizeItem = root.Menu.AddItem("Centered")).SetAction(centeredSizeItem_Click); } } pictureBox = new Alt.GUI.Temporary.Gwen.Control.PictureBox(this); pictureBox.DrawBorder = true; pictureBox.BorderColor = Color.DodgerBlue; pictureBox.Dock = Pos.Fill; } // set default size mode of picture box pictureBox.SizeMode = PictureBoxSizeMode.StretchImage; LoadImage(); }