public override void onRightMouseUp(GuiControl ctrl) { int fontColorPos, backgroundColorPos, fillColorPos, fontSizePos, lockPos, winSettingsPos, setTitlePos, bitmapPos; GuiCanvas Canvas = "Canvas"; ObjectCreator popupCreator = new ObjectCreator("PopupMenu", "", typeof (MenuBuilder)); popupCreator["isPopup"] = true.AsString(); popupCreator["object"] = "-1"; MenuBuilder popup = popupCreator.Create(); popup.removeAllItems(); popup["object"] = ctrl; if (ctrl.getName() != "") popup.appendItem(ctrl.getName() + '\t' + "" + '\t' + ""); else popup.appendItem(ctrl.getClassName() + '\t' + "" + '\t' + ""); popup.enableItem(0, false); if (ctrl.lockControl) { lockPos = popup.appendItem("Locked" + '\t' + "" + '\t' + ctrl + ".setControlLock(!" + ctrl + ".getControlLock());"); popup.checkItem(lockPos, ctrl.getControlLock()); } if (ctrl.contextFontColor) fontColorPos = popup.appendItem("Font Color..." + '\t' + "" + '\t' + "getColorI(\"" + ctrl.controlFontColor.AsString() + "\", \"" + ctrl + ".setControlFontColor\", " + ctrl.getRoot() + ", \"" + ctrl + ".setControlFontColor\", \"" + ctrl + ".setControlFontColor\" );"); if (ctrl.contextBackColor) backgroundColorPos = popup.appendItem("Background Color..." + '\t' + "" + '\t' + "IngameContext.transparentCheck(" + ctrl + ", \"backColor\");"); if (ctrl.contextFillColor) fillColorPos = popup.appendItem("Fill Color..." + '\t' + "" + '\t' + "IngameContext.transparentCheck(" + ctrl + ", \"fillColor\");"); if (ctrl.contextFontSize) fontSizePos = popup.appendItem("Font Size..." + '\t' + "" + '\t' + "ChangeFontSize.loadDialog(" + ctrl + ");"); if (ctrl.windowSettings) winSettingsPos = popup.appendItem("Window Settings" + '\t' + "" + '\t' + "WindowSettings.loadDialog(" + ctrl + ");"); if (ctrl.isMemberOfClass("GuiBitmapCtrl")) { if (((GuiControl) popup["object"])["setBitmap"].AsBool()) bitmapPos = popup.appendItem("Set Bitmap..." + '\t' + "" + '\t' + "getLoadFilename( \"All Image Files|*.png;*.jpeg;*.jpg;*.tga;*.jng;*.mng;*.gif;*.bmp;*.dds|png|*.png|jpeg|*.jpeg|jpg|*.jpg|tga|*.tga|jng|*.jng|mng|*.mng|gif|*.gif|bmp|*.bmp|dds|*.dds\"," + ctrl + "\".setBitmap\", \"\" );"); } if (ctrl.isMemberOfClass("GuiWindowCtrl")) { if (((GuiControl) popup["object"])["setTitle"].AsBool()) setTitlePos = popup.appendItem("Set Title..." + '\t' + "" + '\t' + "SetTitle.loadDialog(" + ctrl + ");"); } popup.showPopup(Canvas); }
public void transparentCheck(GuiControl ctrl, string colorName) { bool transparent = ctrl.transparentControlCheck(); if (transparent) return; if (colorName == "fillColor") ColorPickerDlg.GetColorI(ctrl.controlFillColor.AsString(), ctrl + ".setControlFillColor", ctrl.getRoot(), ctrl + ".setControlFillColor", ctrl + ".setControlFillColor"); else if (colorName == "backColor") ColorPickerDlg.GetColorI(ctrl.backgroundColor.AsString(), ctrl + ".setControlBackgroundColor", ctrl.getRoot(), ctrl + ".setControlBackgroundColor", ctrl + ".setControlBackgroundColor"); }