/// <summary> /// Moving from Choose Libraries to Create Solution page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void wpChooseLibraries_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { m_prevLibraryProjectIndex = cbProjectSelect_Library.SelectedIndex; m_generateComponentList.Clear(); // loop through each project foreach (ProjectComboData pcd in cbProjectSelect_Library.Items) { // skip the "all projects" combo box item if (pcd == m_pcdAll) continue; Dictionary<string, MFComponent> libCatLookup = new Dictionary<string, MFComponent>(); foreach (MFComponent cmpLib in pcd.Proj.Libraries) { Library lib = m_helper.FindLibrary(cmpLib); // If the selected library has a library category associated with it, then // we will need to note that we processed it for verification later if (lib != null && lib.HasLibraryCategory) { libCatLookup[lib.LibraryCategory.Guid.ToLower()] = cmpLib; // Rename the generate template component (to an appropriate name) // and add it to the template generation list if (lib.Name == c_GenerateTemplateString) { cmpLib.Name = lib.LibraryCategory.Name + "_" + m_solution.Name; LibraryCategory lc = m_helper.FindLibraryCategory(lib.LibraryCategory.Guid); m_generateComponentList.Add(new TemplateGenerationData(lc, cmpLib)); } } } ShowLibraryCategories(cbShowAllLibCatChoices.Checked); List<LibraryCategory> unresolvedItems = new List<LibraryCategory>(); List<LibraryCategory> removedItems = new List<LibraryCategory>(); UpdateProjectDependencies(pcd, unresolvedItems, removedItems); if (unresolvedItems.Count > 0) { MessageBox.Show(Properties.Resources.NotAllLibrariesResolved, Properties.Resources.SolutionWizard); if (cbShowAllLibCatChoices.Checked) { cbShowAllLibCatChoices.Checked = false; } if (!pcd.Proj.IsClrProject) { m_prevLibraryProjectIndex = cbProjectSelect_Library.SelectedIndex; cbProjectSelect_Library.SelectedItem = pcd; } e.Page = wpChooseLibraries; return; } } }
public static void ManageUsings(Gui.IProgressMonitor progressMonitor, string fileName, IDocument document, bool sort, bool removedUnused) { ParseInformation info = ParserService.ParseFile(fileName, document.TextContent); if (info == null) return; ICompilationUnit cu = info.MostRecentCompilationUnit; List<IUsing> newUsings = new List<IUsing>(cu.UsingScope.Usings); if (sort) { newUsings.Sort(CompareUsings); } if (removedUnused) { IList<IUsing> decl = cu.ProjectContent.Language.RefactoringProvider.FindUnusedUsingDeclarations(Gui.DomProgressMonitor.Wrap(progressMonitor), fileName, document.TextContent, cu); if (decl != null && decl.Count > 0) { foreach (IUsing u in decl) { string ns = null; for (int i = 0; i < u.Usings.Count; i++) { ns = u.Usings[i]; if (ns == "System") break; } if (ns != "System") { // never remove "using System;" newUsings.Remove(u); } } } } // put empty line after last System namespace if (sort) { PutEmptyLineAfterLastSystemNamespace(newUsings); } cu.ProjectContent.Language.CodeGenerator.ReplaceUsings(new TextEditorDocument(document), cu.UsingScope.Usings, newUsings); }
void Awake() { anim = GetComponent<Animator>(); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove)); }
private void wpChooseFeatures_CloseFromBack(object sender, Gui.Wizard.PageEventArgs e) { if (string.Compare(m_solution.Processor.Name, "windows", true) == 0) { e.Page = wpCreatePlatform; } }
void Start() { anim = GetComponent<Animator>(); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); player = GameObject.FindGameObjectsWithTag("Player")[0]; }
public static void Main(string[] args) { QApplication.initialize(args); // Parse any command-line arguments we're interested in. // For now, we just assume all arguments are hostnames // or IP addresses of peers we want to connect to. // This might change if/when we need more interesting options. ushort port = 0; // 0 means system-chosen port (default) foreach (string arg in args) { if (arg.StartsWith("-port:")) { port = UInt16.Parse(arg.Substring(6)); } else if (arg.StartsWith("-")) { Console.WriteLine( "Unknown command-line option" + arg); } else // Interpret the argument as a peer name. initPeers.Add(arg); } // Create the Net object implementing our network protocol // and our peer-to-peer system state model. Net net = new Net(port, initPeers); // Create and show the main GUI window // The Gui object can "see" the Net object but not vice versa. // This is intentional: we want to keep Net independent of Gui, // so that (for example) we can run a non-graphical instance // of our peer-to-peer system controlled some other way, // e.g., as a daemon or via command-line or Web-based control. Gui gui = new Gui(net); gui.show(); QApplication.exec(); }
private static void Main(string[] args) { var consoleGui = new Gui(args); var controller = new Controller(consoleGui, new DoublettenSuche( new DirectoryCrawler(new HashBuilder(new FileLengthFinder())), new DoublettenFinder())); consoleGui.Run(); }
void Awake() { // Setting up references. anim = GetComponent<Animator>(); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); breath = this.transform.FindChild("breathSound").gameObject; }
void Start() { anim = GetComponent<Animator>(); anim.Play("capulloWait"); ballSpawn = this.transform.FindChild("ballSpawn").gameObject; gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); }
void Start() { animations = (Animations)GameObject.FindObjectOfType(typeof(Animations)); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove)); anim = GetComponent<Animator>(); anim.Play("doorBathClosed"); }
void Start() { instancerHouse2 = (InstancerHouse2)GameObject.FindObjectOfType(typeof(InstancerHouse2)); animations = (Animations)GameObject.FindObjectOfType(typeof(Animations)); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); anim = GetComponent<Animator>(); anim.Play("armarioClosed"); }
void Start() { animations = (Animations)GameObject.FindObjectOfType(typeof(Animations)); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); instancer = (Instancer)GameObject.FindObjectOfType(typeof(Instancer)); anim = GetComponent<Animator>(); anim.Play("statueIdle"); }
public static void SetGui(Gui gui) { if (fadeTo == null) { guiSwitchTime = Time.time; fadeTo = gui; if(currentGui == null){ guiSwitchTime -= Gui.FadeOut; } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var repository = new NHibernateRepository(Configure.SQLite()); var accessPoint = new AccessPoint(new SimpliciTIDriver()); var watchPool = new WatchPool(); var watchDataSaver = new WatchDataSaver(repository, watchPool, accessPoint); var excelCreator = new SpreadsheetExporter(); var gui = new Gui(repository, accessPoint, watchPool, watchDataSaver, excelCreator); Application.Run(gui); }
static void Main(string[] args) { Board board = new Board(); // model Gui gui = new Gui(); // view Controller logic = new Controller(board, gui); // controller - model, view goes in here logic.test(); /* * board b contains internal board * puplic generateboard, clearboard, populateBoard, addPiecestorows, getTile (ref), getPiecesValidAMoves, * getTilesWithPieceMoves, isCoordTileOnBoard, isPieceOnKingRow, movePiece * */ }
public ConsoleDisplay(int width, int height, Gui.BitmapFont font, GraphicsDevice device, EpisodeContentManager content) { this.Width = width; this.Height = height; this.Font = font; effect = content.Load<Effect>("Content/draw-console"); //Prepare the index buffer. var indicies = new short[width * 6]; for (int i = 0; i < width; ++i) { indicies[i * 6 + 0] = (short)(i * 4 + 0); indicies[i * 6 + 1] = (short)(i * 4 + 1); indicies[i * 6 + 2] = (short)(i * 4 + 2); indicies[i * 6 + 3] = (short)(i * 4 + 2); indicies[i * 6 + 4] = (short)(i * 4 + 3); indicies[i * 6 + 5] = (short)(i * 4 + 0); } indexBuffer = new IndexBuffer(device, IndexElementSize.SixteenBits, indicies.Length, BufferUsage.WriteOnly); indexBuffer.SetData(indicies); //Prepare vertex buffers lines = new Line[height]; for (int y = 0; y < height; ++y) { lines[y] = new Line(); lines[y].verts = new ConsoleVertex[width * 4]; for (int i = 0; i < width; ++i) { lines[y].verts[i * 4 + 0].Position = new Vector3(i * font.glyphWidth, y * font.glyphHeight, 0); lines[y].verts[i * 4 + 1].Position = new Vector3((i + 1) * font.glyphWidth, y * font.glyphHeight, 0); lines[y].verts[i * 4 + 2].Position = new Vector3((i + 1) * font.glyphWidth, (y + 1) * font.glyphHeight, 0); lines[y].verts[i * 4 + 3].Position = new Vector3(i * font.glyphWidth, (y + 1) * font.glyphHeight, 0); lines[y].verts[i * 4 + 0].FGColor = Color.White.ToVector4(); lines[y].verts[i * 4 + 1].FGColor = Color.White.ToVector4(); lines[y].verts[i * 4 + 2].FGColor = Color.White.ToVector4(); lines[y].verts[i * 4 + 3].FGColor = Color.White.ToVector4(); lines[y].verts[i * 4 + 0].BGColor = Color.Black.ToVector4(); lines[y].verts[i * 4 + 1].BGColor = Color.Black.ToVector4(); lines[y].verts[i * 4 + 2].BGColor = Color.Black.ToVector4(); lines[y].verts[i * 4 + 3].BGColor = Color.Black.ToVector4(); } lines[y].buffer = new VertexBuffer(device, typeof(ConsoleVertex), lines[y].verts.Length, BufferUsage.None); } }
void Start() { playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove)); animations = (Animations)GameObject.FindObjectOfType(typeof(Animations)); gui = (Gui)GameObject.FindObjectOfType(typeof(Gui)); inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory)); anim = GetComponent<Animator>(); if(PlayerPrefs.GetInt("doorInOpen") == 0){ anim.Play("doorInClosed"); }else{ this.collider2D.enabled = false; this.gameObject.tag = "Untagged"; anim.Play("doorInOpened"); } }
public void Draw(Gui.Graphics g) { g.Begin(); for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (this[x, y] != 0 && !IsLadder(x, y)) { TileSet.Draw(g, new Point(x * TileSize.X, y * TileSize.Y), this[x, y]); } } } g.End(); }
// *************************************************** // Start [Monobehavior] // --------------------------------------------------- void Start() { Instance = this; // freeze keyboard frame #if UNITY_ANDROID || UNITY_IOS // TouchScreenKeyboard.autorotateToLandscapeLeft = false; // TouchScreenKeyboard.autorotateToLandscapeRight = false; // TouchScreenKeyboard.autorotateToPortrait = false; // TouchScreenKeyboard.autorotateToPortraitUpsideDown = false; // disable screen dimming Screen.sleepTimeout = 120; #endif }
static void Main(string[] args) { try { Console.Title = "Mustank Console"; Console.WriteLine("Client started..."); Map map = new Map(); Gui gui = new Gui(map); Application.Run(gui); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } }
private ContextMenuStrip HydraulicLoadsStateFailureMechanismContextMenuStrip(HydraulicLoadsStateFailureMechanismContext context, object parentData, TreeViewControl treeViewControl) { var builder = new RiskeerContextMenuBuilder(Gui.Get(context, treeViewControl)); return(builder.AddOpenItem() .AddSeparator() .AddPerformAllCalculationsInFailureMechanismItem( context, CalculateAllInFailureMechanism, EnableValidateAndCalculateMenuItemForFailureMechanism) .AddSeparator() .AddCollapseAllItem() .AddExpandAllItem() .AddSeparator() .AddPropertiesItem() .Build()); }
private void network_ReceivedNonCriticalError(Network network, Node from, MeshworkError error) { if (error is DirectoryNotFoundError) { string errorPath = ((DirectoryNotFoundError)error).DirPath; errorPath = errorPath.Substring(1); // FIXME: errorPath doesn't have network part, navigatingTo does!! if (true) //if (errorPath == navigatingTo) { Gui.ShowErrorDialog("Directory not found"); StopNavigating(); // FIXME: Maybe something should reset the state on the directory object } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { Gui.webBrowser = webBrowserEditor; Gui.htmlEditor = HtmlEditor1; Initialization.webeditor = this; ; if (SelectedArticle != null) { ArticleControl.vm.SetSelectedArticle(SelectedArticle); Gui.NewDocument(SelectedArticle.ArticleBody); } else { Gui.NewDocument(""); } Initialization.RibbonBoxFontsInitialization(); Initialization.RibbonBoxFontSizeInitialization(); Initialization.RibbonBoxFormatInitialization(); }
public static void ConvertEntity() { var ids = Interaction.GetSelection("\n选择对象"); if (ids.Length == 0) { return; } var choices = EntityManager.Entities.Select(x => string.Format("{0}.{1}", x.Key, x.Value.EntityName)).ToArray(); var choice = Gui.GetChoice("选择类型", choices); if (string.IsNullOrEmpty(choice)) { return; } var entityID = choice.Split('.')[0]; ids.SetStyles(entityID); }
void BrowseToolButtonClicked (object sender, EventArgs e) { try { TreeIter iter; if (resultsTree.Selection.GetSelected(out iter)) { SearchResult selectedResult = resultsTree.Model.GetValue(iter, 0) as SearchResult; if (selectedResult != null) { string path = PathUtil.Join(selectedResult.Node.Directory.FullPath, string.Join("/", selectedResult.FullPath.Split('/').Slice(0, -2))); UserBrowserPage.Instance.NavigateTo(path); Gui.MainWindow.SelectedPage = UserBrowserPage.Instance; } } } catch (Exception ex) { LoggingService.LogError(ex); Gui.ShowErrorDialog(ex.Message); } }
public void OnRenderObject() { float lHeightMenu = GuiStyleSet.StyleMenu.button.CalcSize(new GUIContent("")).y; float lHeightTitle = GuiStyleSet.StylePlayer.labelTitle.CalcSize(new GUIContent(title)).y; float lY = lHeightMenu + lHeightTitle + GuiStyleSet.StyleGeneral.box.margin.top + GuiStyleSet.StyleGeneral.box.padding.top; if (player != null && player.GetTimeLength().Second != 0.0d) { float lWidth = GuiStyleSet.StylePlayer.seekbar.fixedWidth; float lHeight = GuiStyleSet.StylePlayer.seekbar.fixedHeight; Gui.DrawSeekBar(new Rect(Screen.width / 2 - lWidth / 2, lY + lHeight, lWidth, lHeight), GuiStyleSet.StylePlayer.seekbarImage, ( float )(player.GetLoopPoint().start.Seconds / player.GetTimeLength().Seconds), ( float )(player.GetLoopPoint().end.Seconds / player.GetTimeLength().Seconds), ( float )player.Position); } else { float lWidth = GuiStyleSet.StylePlayer.seekbar.fixedWidth; float lHeight = GuiStyleSet.StylePlayer.seekbar.fixedHeight; Gui.DrawSeekBar(new Rect(Screen.width / 2 - lWidth / 2, lY + lHeight, lWidth, lHeight), GuiStyleSet.StylePlayer.seekbarImage, 0.0f, 0.0f, 0.0f); } }
public static Gui CreateMainMenuInterface(ref AnoleEngine.Engine_Base.Engine objEngineInstance, MainMenuState state) { float fltGameWindowWidth = objEngineInstance.GameWindow.Size.X; float fltGameWindowHeight = objEngineInstance.GameWindow.Size.Y; Gui UI = new Gui(objEngineInstance.GameWindow); Button closeButton = new Button("CLOSE"); closeButton.Size = new Vector2f(200, 50); float fltXPos = (fltGameWindowWidth / 2) - 100; float fltYPos = (fltGameWindowHeight / 2) - 25; closeButton.Position = new Vector2f(fltXPos, fltYPos); closeButton.SetRenderer(UI_Renderers.UIBackButtonRenderer.Data); UI.Add(closeButton, "closeButton"); Button objSettingsButton = new Button("SETTINGS"); objSettingsButton.Size = new Vector2f(200, 50); float fltSettingsXPos = ((fltGameWindowWidth / 2) - 100); float fltSettingsYPos = ((fltGameWindowHeight / 2) - 75) - UI_Constants.ControlSpacer; objSettingsButton.Position = new Vector2f(fltSettingsXPos, fltSettingsYPos); objSettingsButton.SetRenderer(UI_Renderers.UIButtonRenderer.Data); UI.Add(objSettingsButton, "Settings"); Button newGameButton = new Button("NEW SOLO GAME"); newGameButton.Size = new Vector2f(200, 50); float fltNewGameXPos = ((fltGameWindowWidth / 2) - 100); float fltNewGameYPos = ((fltGameWindowHeight / 2) - 125) - (UI_Constants.ControlDoubleSpacer); newGameButton.Position = new Vector2f(fltNewGameXPos, fltNewGameYPos); newGameButton.SetRenderer(UI_Renderers.UIButtonRenderer.Data); UI.Add(newGameButton, "NewGameButton"); ((Button)UI.Get("NewGameButton")).Clicked += new EventHandler <SignalArgsVector2f>(state.CreateNewGameEvent); ((Button)UI.Get("Settings")).Clicked += new EventHandler <SignalArgsVector2f>(state.SettingsEvent); ((Button)UI.Get("closeButton")).Clicked += new EventHandler <SignalArgsVector2f>(state.ExitGameEvent); return(UI); }
public ProfileWindow(Account account, JID jid) : base() { SetupUi(); webView.SetHtml("<p>Loading...</p>"); account.RequestVCard(jid, delegate(object sender, IQ iq, object data) { if (iq.Type == IQType.result) { Populate((VCard)iq.FirstChild); } else { Populate(null); } }, null); Gui.CenterWidgetOnScreen(this); }
private void columnsPage_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { // Ensure ID column has been defined string idColumnName = (idColumnComboBox.SelectedItem == null ? String.Empty : idColumnComboBox.SelectedItem.ToString()); if (idColumnName.Length == 0) { MessageBox.Show("You must specify the name of the column that holds the feature ID"); idColumnComboBox.Focus(); e.Page = columnsPage; return; } m_Edit.IdColumnName = idColumnName; // Ensure column domains are up to date. // For the time being, we do NOT establish or remove foreign keys in the // database - if that is considered desirable, bear in mind that the changes // being saved here may ultimately be discarded by the user (on exit from the // application). List<IColumnDomain> cds = new List<IColumnDomain>(); IEnvironmentFactory factory = EnvironmentContainer.Factory; foreach (DataGridViewRow row in columnsGrid.Rows) { IDomainTable dt = (row.Cells["dgcDomain"].Value as IDomainTable); if (dt != null) { IEditColumnDomain cd = factory.CreateColumnDomain(); cd.ParentTable = m_Edit; cd.ColumnName = row.Cells["dgcColumnName"].FormattedValue.ToString(); cd.Domain = dt; cds.Add(cd); } } m_Edit.ColumnDomains = cds.ToArray(); m_Edit.FinishEdit(); this.DialogResult = DialogResult.OK; Close(); }
public void Update() { if (!isUpdatePromptShowed && FiddlerUtils.UpdatesChecked) { isUpdatePromptShowed = true; if (FiddlerUtils.UpdateInfo.IsAvailable) { ShowUpdatePrompt(); } } keyCreateGUI.Update(); if (keyCreateGUI.HasBeenPressed()) { OpenGUI(); } Gui?.DoIfVisible(Gui.UpdateMaids); }
public override void Load() { gui = new Gui(); var panel = gui.Main.AddPanel(); panel.Docking = GuiDocking.Center; var container = panel.AddVerticalContainer(); container.Docking = GuiDocking.Center; container.AlignVertical = VAlignment.Stretch; container.AlignHorizontal = HAlignment.Stretch; var btn = container.AddButton("Click Me"); var check = container.AddCheckbox(); var slider = container.AddSlider(0, 100, 1, Orientation.Horizontal); }
private void ShowCredentials(object sender, RoutedEventArgs e) { var model = new LoginCredentialsViewModel(useBasic.IsChecked ?? false, useOAuth.IsChecked ?? false, usePat.IsChecked ?? false); if (!string.IsNullOrWhiteSpace(enterpriseUrl.Text)) { model.GitHubEnterpriseUrl = enterpriseUrl.Text; } if (!string.IsNullOrWhiteSpace(username.Text)) { model.UsernameOrEmail = username.Text; } var view = new LoginCredentialsView(); var window = new DialogWindow(model, view); Gui.ShowDialog(window, Handle); }
public static void Main(string[] args) { QApplication.initialize(args); // Parse any command-line arguments we're interested in. // For now, we just assume all arguments are hostnames // or IP addresses of peers we want to connect to. // This might change if/when we need more interesting options. ushort port = 0; // 0 means system-chosen port (default) foreach (string arg in args) { if (arg.StartsWith("-port:")) { port = UInt16.Parse(arg.Substring(6)); } else if (arg.StartsWith("-")) { Console.WriteLine( "Unknown command-line option" + arg); } else // Interpret the argument as a peer name. { initPeers.Add(arg); } } // Create the Net object implementing our network protocol // and our peer-to-peer system state model. Net net = new Net(port, initPeers); // Create and show the main GUI window // The Gui object can "see" the Net object but not vice versa. // This is intentional: we want to keep Net independent of Gui, // so that (for example) we can run a non-graphical instance // of our peer-to-peer system controlled some other way, // e.g., as a daemon or via command-line or Web-based control. Gui gui = new Gui(net); gui.show(); QApplication.exec(); }
public override void showGui() { var pos = new Vector3(-1.42f, -0.7f, 1.0f); if (mode != enMode.repairingUnder || skin.isNowDamaging()) { var skinSizeDr = skin.normalizedDurability * 0.5f + 0.2f; var skinSizeRc = skin.normalizedRecoverable * 0.4f + 0.2f; var foreSkinColor = mode == enMode.ready ? Gui.foreSafeColor : Color.Lerp(Gui.dangerColorOn, Gui.dangerColorOff, Time.time % 1.0f); var backSkinColor = mode == enMode.repairingSkin ? Gui.backDamageColor : (skin.durability < skin.recoverable ? Gui.backDamageColor : Gui.backSafeColor); var meshSkin = skin.normalizedRecoverable > under.normalizedDurability & skin.normalizedDurability > 0.1f ? Gui.meshHarfRound : Gui.meshFullRound; Gui.draw(pos, skinSizeDr, meshSkin, definition.skinCircleMaterial, Gui.idTintColor, foreSkinColor, 1.0f); Gui.draw(pos, skinSizeRc, meshSkin, definition.underCircleMaterial, Gui.idColor, backSkinColor, 1.1f); } var underSizeDr = under.normalizedDurability * 0.5f + 0.2f; var underSizeRc = under.normalizedRecoverable * 0.4f + 0.2f; var foreUnderColor = mode != enMode.repairingUnder ? Gui.backDangerColor : Color.Lerp(Gui.dangerColorOn, Gui.dangerColorOff, Time.time % 1.0f); var backUnderColor = mode == enMode.repairingUnder ? foreUnderColor : Color.black; //( under.durability < under.recoverable ? Gui.dangerColorOff : Color.black );//Gui.backDangerColor ); Gui.draw(pos, underSizeDr, Gui.meshFullRound, definition.skinCircleMaterial, Gui.idTintColor, foreUnderColor, 1.5f); Gui.draw(pos, underSizeRc, Gui.meshFullRound, definition.underCircleMaterial, Gui.idColor, backUnderColor, 1.6f); Gui.draw(pos, 0.2f, Gui.meshFullRound, definition.underCircleMaterial, Gui.idColor, Color.yellow, 0.8f); }
private void joinButton_Clicked(object sender, EventArgs e) { Network selectedNetwork = GetSelectedNetwork(); if (selectedNetwork == null) { Gui.ShowMessageDialog("No network selected.", Dialog, Gtk.MessageType.Error, Gtk.ButtonsType.Ok); return; } try { string roomName = roomNameCombo.Entry.Text.Trim(); string password = passwordEntry.Text; string roomId = (passwordCheck.Active) ? Common.Utils.SHA512Str(roomName + password) : Common.Utils.SHA512Str(roomName); ChatRoom room = selectedNetwork.GetChatRoom(roomId); if (room != null && room.InRoom) { // Already in here! ChatRoomSubpage window = (ChatRoomSubpage)room.Properties["Window"]; window.GrabFocus(); } else { if (passwordCheck.Active == true) { selectedNetwork.JoinOrCreateChat(roomName, passwordEntry.Text); } else { selectedNetwork.JoinOrCreateChat(roomName, null); } } } catch (Exception ex) { LoggingService.LogError(ex); Gui.ShowMessageDialog(ex.Message, Dialog); Dialog.Respond(ResponseType.None); return; } Dialog.Respond(ResponseType.Ok); }
private void ListThings(IReadOnlyCollection <IThing> things) { var maxNameWidth = things.Max(x => x.Name.Length) + 2; var maxIdWidth = things.Max(x => x.Id.ToString().Length) + 2; Output.WriteLine("List all things of gateway"); Output.WriteLine(); Gui.PrintColumns( new ConsoleTextColumn { Text = "Name", Width = maxNameWidth }, new ConsoleTextColumn { Text = "Id", Width = maxIdWidth }, new ConsoleTextColumn { Text = "State" }); Gui.PrintColumns( new ConsoleTextColumn { Text = "----", Width = maxNameWidth }, new ConsoleTextColumn { Text = "--", Width = maxIdWidth }, new ConsoleTextColumn { Text = "-----" }); things.ForEach(thing => Gui.PrintColumns( new ConsoleTextColumn { Text = thing.Name, Width = maxNameWidth }, new ConsoleTextColumn { Text = thing.Id.ToString(), Width = maxIdWidth }, new ConsoleTextColumn { Text = thing.State.ToString() })); }
void OnRenderObject() { Gui.BeginArea(new Rect(80.0f, 80.0f, Screen.width, Screen.height)); { //GUILayout.BeginHorizontal(); { //GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); Gui.Button("", GuiStyleSet.StylePlayer.toggleStartPause); /* * TextArea(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * Label(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * HorizontalScrollbar(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * HorizontalSlider(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * Toggle(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * ButtonPrevious(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * ToggleStartPause(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * ButtonNext(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * LabelTime(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * ButtonCircleMinus(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * Volumebar(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * ButtonCirclePlus(); * GUILayout.Label( new GUIContent( "", "StyleGeneral.PartitionVertical" ), GuiStyleSet.StyleGeneral.partitionVertical ); * * GUILayout.FlexibleSpace(); */ } //GUILayout.EndHorizontal(); } Gui.EndArea(); }
public override void showGui() { var pos = new Vector3(-1.42f, -0.7f, 1.0f); if (outer.durability > 0.0f) { var skinSizeDr = outer.normalizedDurability * 0.5f + 0.2f; var skinSizeRc = outer.normalizedRecoverable * 0.4f + 0.2f; var foreSkinColor = Gui.foreSafeColor; var backSkinColor = outer.durability < outer.recoverable ? Gui.backDamageColor : Gui.backSafeColor; var meshSkin = outer.normalizedRecoverable > inner.normalizedDurability & outer.normalizedDurability > 0.1f ? Gui.meshHarfRound : Gui.meshFullRound; Gui.draw(pos, skinSizeDr, meshSkin, definition.outerCircleMaterial, Gui.idTintColor, foreSkinColor, 1.0f); Gui.draw(pos, skinSizeRc, meshSkin, definition.innerCircleMaterial, Gui.idColor, backSkinColor, 1.1f); } var underSizeDr = inner.normalizedDurability * 0.5f + 0.2f; var underSizeRc = inner.normalizedRecoverable * 0.4f + 0.2f; var foreUnderColor = inner.normalizedDurability > 0.2f ? Gui.backDangerColor : Color.Lerp(Gui.dangerColorOn, Gui.dangerColorOff, Time.time % 1.0f); var backUnderColor = Color.black; Gui.draw(pos, underSizeDr, Gui.meshFullRound, definition.outerCircleMaterial, Gui.idTintColor, foreUnderColor, 1.5f); Gui.draw(pos, underSizeRc, Gui.meshFullRound, definition.innerCircleMaterial, Gui.idColor, backUnderColor, 1.6f); Gui.draw(pos, 0.2f, Gui.meshFullRound, definition.innerCircleMaterial, Gui.idColor, Color.yellow, 0.8f); }
public void Render(Gui gui) { if (gui == null) { return; } GL.Disable(EnableCap.DepthTest); GL.BindVertexArray(GuiQuad.VaoID); MouseState state = Mouse.GetCursorState(); Point mouse = SharpCraft.Instance.PointToClient(new Point(state.X, state.Y)); gui.Render(mouse.X, mouse.Y); GL.BindVertexArray(0); GL.Enable(EnableCap.DepthTest); }
public override void Load() { _ui = new Gui() { DebugMode = false }; var container = new Container("container", _ui.Width, _ui.Height); var button = new Button("button", "BUTTON1\nSUBTEXT"); var button2 = new Button("button2", "BUTTON2"); container.Add(button); container.Add(button2); container.Layout(Orientation.Vertical, ContainerAlignment.Center, ContainerAlignment.Center, 10, 10); _ui.Add(container); }
private void addNetworkButton_Clicked(object o, EventArgs args) { AddNetworkDialog addDialog = new AddNetworkDialog(dialog); if (addDialog.Run() == (int)ResponseType.Ok) { foreach (object[] row in networksListStore) { NetworkInfo networkInfo = (NetworkInfo)row[0]; if (networkInfo.NetworkName == addDialog.NetworkInfo.NetworkName) { Gui.ShowErrorDialog("A network with that name has already been added."); return; } } networksListStore.AppendValues(addDialog.NetworkInfo); PopulateAutoConnectList(); } }
void HandleActivityLinkClicked(QUrl url) { try { Uri uri = new Uri(url.ToString()); if (uri.Scheme == "http" || uri.Scheme == "https") { Util.Open(uri.ToString()); } else { if (uri.Scheme == "xmpp") { JID jid = new JID(uri.AbsolutePath); var query = XmppUriQueryInfo.ParseQuery(uri.Query); switch (query.QueryType) { case "message": // FIXME: Should not ask which account to use, should use whichever account generated the event. var account = Gui.ShowAccountSelectMenu(this); if (account != null) { Gui.TabbedChatsWindow.StartChat(account, jid); } break; default: throw new NotSupportedException("Unsupported query type: " + query.QueryType); } } else if (uri.Scheme == "activity-item") { string itemId = uri.AbsolutePath; string action = uri.Query.Substring(1); m_ActivityFeedItems[itemId].TriggerAction(action); } } } catch (Exception ex) { Console.Error.WriteLine(ex); QMessageBox.Critical(null, "Synapse Error", ex.Message); } }
public override void UpdateValues(ToolFormUpdateType type) { if (Mem == null || Gui == null || Emu == null || GI?.GetRomName() == "Null") { return; } switch (type) { case ToolFormUpdateType.PreFrame: UpdateFog(); break; case ToolFormUpdateType.PostFrame: if (CbxEnableControlsSection.Checked) { ReportControls(); } ReportAngles(); ReportPosition(); if (CbxEnableOverlayCameraReporting.Checked) { ReportOverlayInfo(); } //ReportMisc(); Gui.WithSurface(DisplaySurfaceID.EmuCore, DrawStuff); if (CbxStats.Checked) { ReportStats(); } //GetRegisterTest(); if (CbxTriggersAutoUpdate.Checked) { CheckForUpdatedTriggers(); } break; default: break; } }
public override void Draw(RenderWindow rw) { rw.SetView(camera); rw.Draw(worldMap); deliverySpace.Draw(rw); if (Game.Debug) { foreach (var ads in addresses) { var ad = ads.Value; // Nothing to do with checking vehicle exit path. Just using this // so I don't have to create another object. vehicleExitArea.Position = new Vector2f(ad.X, ad.Y); vehicleExitArea.Size = new Vector2f(16, 16); rw.Draw(vehicleExitArea); } } var dstPos = deliverySuccessTextPos; for (int i = 0; i < entities.Count; i++) { entities[i].Draw(rw); } Gui.FloatUpText(rw, "+1", dstPos.X, dstPos.Y, 10, deliverySuccessPopupY); for (int i = 0; i < tiles.Count; i++) { tiles[i].Draw(rw); } if (Game.Debug) { DrawDebug(rw); } DrawGUI(rw); }
public override void Paint(Qyoto.QPainter painter, Qyoto.QStyleOptionGraphicsItem option, Qyoto.QWidget widget) { painter.SetRenderHint(QPainter.RenderHint.Antialiasing, true); int iconSize = m_Grid.IconSize; // Parent opacity overrides item opacity. var parentGroup = (RosterItemGroup)base.Group(); if (parentGroup == null) // This happens while the item is being removed. { return; } if (parentGroup.Opacity != 1) { painter.SetOpacity(parentGroup.Opacity); } else { painter.SetOpacity(m_Opacity); } QPixmap pixmap = (QPixmap)m_Grid.Model.GetImage(m_Item); Gui.DrawAvatar(painter, iconSize, iconSize, pixmap); if (IsHover) { // FIXME: Do something? } if (m_Grid.ListMode) { var rect = BoundingRect(); var pen = new QPen(); pen.SetBrush(m_Grid.Palette.Text()); painter.SetPen(pen); int x = iconSize + m_Grid.IconPadding; painter.DrawText(x, 0, (int)rect.Width() - x, (int)rect.Height(), (int)Qt.TextFlag.TextSingleLine, m_Grid.Model.GetName(m_Item)); } }
// Called when the node enters the scene tree for the first time. public override void _Ready() { _followerCount = 0; _oldFollowerCount = _followerCount; _rawFollowerCount = _followerCount; Money = 50; _oldMoney = Money; _currentDate = new DateTimeOffset(new DateTime(2012, 12, 22)); _gui = GetParent().GetNode <Gui>("GUI/GUI"); _cashJingle = GetParent().GetNode <AudioStreamPlayer>("CashJingle"); GetParent().GetNode <AudioStreamPlayer>("Music").Play(); Connect(nameof(FollowersChange), _gui, "OnFollowerUpdate"); EmitSignal(nameof(FollowersChange), _followerCount); Connect(nameof(MoneyChanges), _gui, "OnMoneyUpdate"); EmitSignal(nameof(MoneyChanges), Money); Connect(nameof(DateChanges), _gui, "OnDateUpdate"); EmitSignal(nameof(DateChanges), _currentDate.ToUnixTimeSeconds()); Connect(nameof(RatesUpdated), _gui, "OnRatesUpdated"); Connect(nameof(Victory), _gui, "OnVictory"); // Setup global upgrades using (var file = new File()) { file.Open("res://upgradeData.json", File.ModeFlags.Read); var upgradeScene = (PackedScene)ResourceLoader.Load("res://scenes/Upgrade.tscn"); _upgrades = new List <Upgrade>(); var upgradesData = JsonConvert.DeserializeObject <UpgradeData[]>(file.GetAsText()); // Initialise upgrades foreach (var upgradeData in upgradesData.Where(u => u.Global)) { var upgrade = (Upgrade)(upgradeScene.Instance()); _upgrades.Add(upgrade); _gui.UpgradesElement.AddChild(upgrade); upgrade.Initialise(upgradeData, this); } } }
public InsertSnippetDialog(QWidget parent) : base(parent) { SetupUi(); buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel; ChatWindow chatWindow = (ChatWindow)parent; toLabel.Text = (chatWindow.Handler is ChatHandler) ? ((ChatHandler)chatWindow.Handler).Jid.ToString() : ((MucHandler)chatWindow.Handler).Room.JID.ToString(); var service = ServiceManager.Get <CodeSnippetsService>(); foreach (var highlighter in service.Highlighters) { typeComboBox.AddItem(highlighter.FullName, highlighter.Name); } QObject.Connect(this, Qt.SIGNAL("accepted()"), HandleDialogAccepted); Gui.CenterWidgetOnScreen(this); }
public override void Load() { gui = new Gui(); gui.Main.Padding = 0; var topbar = gui.Main.AddPanel(); topbar.Padding = 0; topbar.Resize(Canvas.Width, 30); var topbar_layout = topbar.AddHorizontalContainer(); topbar_layout.Docking = GuiDocking.Center; topbar_layout.Padding = 0; topbar_layout.ItemSpacing = 0; topbar_layout.AlignVertical = VAlignment.Stretch; var file_button = topbar_layout.AddButton("File"); var help_button = topbar_layout.AddButton("Help"); }
// ================================================================================ // Control management // ================================================================================ /// <summary> /// Creates the panels and adds all the widgets for the 'Maps' panel. /// </summary> private void createPanels() { int leftcolumn = 192 + 8; int maps_height = 84; Gui.AddWidgets(new Widget[] { panelMaps = new Elements.Window(4, 4 + 24, leftcolumn, maps_height), panelControls = new Elements.Window(4, 4 + 28 + maps_height, leftcolumn, 592 - 28 - maps_height), panelCurrentMap = new Elements.Window(leftcolumn + 8, 4 + 24, 800 - leftcolumn - 12, 592 - 24), }); panelMaps.AddWidgets(new Widget[] { lblMapCount = new Label(8, 14, string.Empty), new Button(leftcolumn - 82, 4, 32, "+", click_AddMap), new Button(leftcolumn - 46, 4, 32, "-", click_RemoveMap), cmbMaps = new ComboBox(4, 40, leftcolumn - 30, string.Empty) { OnSelectionChanged = cmbMaps_SelectionChanged }, }); }
public override void WindowOnGUI() { if (resizer == null) { resizer = new CWindowResizer(); set_Window_resizer(this, resizer); resizer.minWindowSize = MarginsSize(); resizer.UpdateSize = (ref Vector2 winSize) => { var fixedSize = winSize - MarginsSize(); Gui.UpdateWindowGuide(fixedSize); Gui.InRect = new Rect(Vector2.zero, fixedSize); Gui.UpdateLayoutIfNeeded(); winSize = Gui.Bounds.size + MarginsSize(); }; } base.WindowOnGUI(); }
private void manager_NewFileTransfer(IFileTransfer transfer) { try { // Add transfer to list transferListStore.AppendValues(transfer); // Watch a few other events transfer.PeerAdded += (FileTransferPeerEventHandler)DispatchService.GuiDispatch( new FileTransferPeerEventHandler(transfer_PeerAdded) ); transfer.Error += (FileTransferErrorEventHandler)DispatchService.GuiDispatch( new FileTransferErrorEventHandler(transfer_Error) ); Gui.MainWindow.RefreshCounts(); } catch (Exception ex) { LoggingService.LogError(ex); Gui.ShowErrorDialog(ex.ToString(), Gui.MainWindow.Window); } }
public Controller(Board board, Gui gui) { this.board = board; this.gui = gui; }
/// <summary> /// Handles the CloseFromNext event of the wizardPageWebProject control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Gui.Wizard.PageEventArgs"/> instance containing the event data.</param> private void wizardPageWebProject_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { bool v1 = true; if (cbConfigureWebProject.Checked) { v1 = usrWebProject.ValidateControl(); } bool pageValid = v1; if (!pageValid) { e.Page = wizardPageWebProject; } }
private void wizardPageWebCommonProject_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { }
/// <summary> /// Handles the CloseFromNext event of the wizardPageSolutionInfo control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Gui.Wizard.PageEventArgs"/> instance containing the event data.</param> private void wizardPageSolutionInfo_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { bool v1 = ValidationUtils.ValidateRequiredTextBox(txtApplicationName); bool pageValid = v1; if (!pageValid) { e.Page = wizardPageSolutionInfo; } }
/// <summary> /// Handles the CloseFromNext event of the wizardPageSchemaExportProject control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Gui.Wizard.PageEventArgs"/> instance containing the event data.</param> private void wizardPageSchemaExportProject_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { bool v1 = true; if (cbCreateSchemaExport.Checked) { v1 = ValidationUtils.ValidateRequiredTextBox(txtSchemaExportProject); } bool pageValid = v1; if (!pageValid) { e.Page = wizardPageSchemaExportProject; } }
/// <summary> /// Handles the CloseFromNext event of the wizardPageCoreProject control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Gui.Wizard.PageEventArgs"/> instance containing the event data.</param> private void wizardPageCoreProject_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { bool v1 = usrCoreProject.ValidateControl(); bool pageValid = v1; if (!pageValid) { e.Page = wizardPageCoreProject; } }
private void wizardPageOLASqlServer_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { e.Page = wizardPageOLASelEvent; }
private void wizardPageOLASelRace_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e) { BroadCastProject pr = new BroadCastProject(); Competition c = cmbOnlineEvent.SelectedItem as Competition; pr.EventDate = c.Date; pr.EventID = c.Id; pr.EventName = c.Name; pr.Password = txtOnlinePassword.Text; EventSoftwareOLA ola = new EventSoftwareOLA(); ola.ConnectionType = (cmbOlaType.SelectedItem as OlaParser.OlaListItem).ConnectionType; ola.EventID = (cmbOlaEvent.SelectedItem as OlaComp).Id; ola.RaceID = (cmbOlaRace.SelectedItem as OlaComp).Id; pr.EventSoftwareType = ola; if (ola.ConnectionType == OlaParser.OLA_CONNECTION_TYPE.OLA5_INTERNAL_DB) { ola.ConnectionSettings = txtOlaDBLoc.Text; } else { ola.ConnectionSettings = txtSQLHost.Text + ";" + txtSQLUser.Text + ";" + txtSQLPort.Text + ";" + txtSQLPassword.Text; } MainApp.CurrentProject = pr; MainApp.LastProjects.Insert(0, pr); MainApp.SaveRecentProjects(); }
private void wizardPage5_CloseFromBack(object sender, Gui.Wizard.PageEventArgs e) { wizard1.PageIndex = 2; }