private void UserControlForm_Shown(object sender, EventArgs e) // as launched, it may not be in front (as its launched from a control).. bring to front { //System.Diagnostics.Debug.WriteLine("UCF Shown+"); this.BringToFront(); if (IsTransparencySupported) { TransparentMode = (TransparencyMode)EliteDangerousCore.DB.UserDatabase.Instance.GetSettingInt(DBRefName + "Transparent", deftransparent ? (int)TransparencyMode.On : (int)TransparencyMode.Off); } bool wantedTopMost = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingBool(DBRefName + "TopMost", deftopmost); //kludge SetTopMost(wantedTopMost); SetTopMost(!wantedTopMost); SetTopMost(wantedTopMost); // this also establishes transparency var top = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingInt(DBRefName + "Top", -999); //System.Diagnostics.Debug.WriteLine("Position Top is {0} {1}", dbrefname, top); if (UserControl != null) { System.Diagnostics.Debug.WriteLine("UCCB Call set curosr, load layout, initial display"); UserControl.SetCursor(UserControl.discoveryform.PrimaryCursor); UserControl.LoadLayout(); UserControl.InitialDisplay(); } IsLoaded = true; //System.Diagnostics.Debug.WriteLine("UCF Shown-"); }
private void UserControlForm_Shown(object sender, EventArgs e) // as launched, it may not be in front (as its launched from a control).. bring to front { this.BringToFront(); if (IsTransparencySupported) { transparentmode = (TransparencyMode)SQLiteDBClass.GetSettingInt(dbrefname + "Transparent", deftransparent ? (int)TransparencyMode.On : (int)TransparencyMode.Off); } bool wantedTopMost = SQLiteDBClass.GetSettingBool(dbrefname + "TopMost", deftopmost); //kludge SetTopMost(wantedTopMost); SetTopMost(!wantedTopMost); SetTopMost(wantedTopMost); // this also establishes transparency var top = SQLiteDBClass.GetSettingInt(dbrefname + "Top", -999); //System.Diagnostics.Debug.WriteLine("Position Top is {0} {1}", dbrefname, top); if (UserControl != null) { UserControl.SetCursor(UserControl.discoveryform.PrimaryCursor); UserControl.LoadLayout(); UserControl.InitialDisplay(); } IsLoaded = true; }
private void UserControlForm_Activated(object sender, EventArgs e) { isactive = true; if (UserControl != null) { UserControl.LoadLayout(); } }
public void SetFormSize() { var top = SQLiteDBClass.GetSettingInt(dbrefname + "Top", -1); if (top >= 0 && norepositionwindow == false) { var left = SQLiteDBClass.GetSettingInt(dbrefname + "Left", 0); var height = SQLiteDBClass.GetSettingInt(dbrefname + "Height", 800); var width = SQLiteDBClass.GetSettingInt(dbrefname + "Width", 800); // Adjust so window fits on screen; just in case user unplugged a monitor or something var screen = SystemInformation.VirtualScreen; if (height > screen.Height) { height = screen.Height; } if (top + height > screen.Height + screen.Top) { top = screen.Height + screen.Top - height; } if (width > screen.Width) { width = screen.Width; } if (left + width > screen.Width + screen.Left) { left = screen.Width + screen.Left - width; } if (top < screen.Top) { top = screen.Top; } if (left < screen.Left) { left = screen.Left; } this.Top = top; this.Left = left; this.Height = height; this.Width = width; this.CreateParams.X = this.Left; this.CreateParams.Y = this.Top; this.StartPosition = FormStartPosition.Manual; } if (UserControl != null) { UserControl.LoadLayout(); } isloaded = true; }
void TabPostCreate(ExtendedControls.TabStrip t, Control ctrl, int i) // called by tab strip after control has been added.. { // now we can do the configure of it, with the knowledge the tab has the right size int displaynumber = (int)t.Tag; // tab strip - use tag to remember display id which helps us save context. UserControlCommonBase uc = ctrl as UserControlCommonBase; if (uc != null) { uc.Init(_discoveryForm, userControlTravelGrid, displaynumber); uc.LoadLayout(); uc.Display(userControlTravelGrid.GetCurrentHistoryEntry, _discoveryForm.history); } //System.Diagnostics.Debug.WriteLine("And theme {0}", i); _discoveryForm.theme.ApplyToControls(t); }
public void UserControlPostCreate(int displaynumber, UserControlCommonBase ctrl) { ctrl.Init(_discoveryForm, displaynumber); ctrl.LoadLayout(); if (ctrl is UserControlLog) { UserControlLog sc = ctrl as UserControlLog; sc.AppendText(_discoveryForm.LogText, _discoveryForm.theme.TextBlockColor); } else if (ctrl is UserControlStarDistance) { UserControlStarDistance sc = ctrl as UserControlStarDistance; if (lastclosestsystems != null) // if we have some, fill in this grid { sc.FillGrid(lastclosestname, lastclosestsystems); } } else if (ctrl is UserControlMaterials) { UserControlMaterials ucm = ctrl as UserControlMaterials; } else if (ctrl is UserControlCommodities) { UserControlCommodities ucm = ctrl as UserControlCommodities; } else if (ctrl is UserControlLedger) { UserControlLedger ucm = ctrl as UserControlLedger; ucm.OnGotoJID += GotoJID; } else if (ctrl is UserControlJournalGrid) { UserControlJournalGrid ucm = ctrl as UserControlJournalGrid; ucm.NoHistoryIcon(); ucm.NoPopOutIcon(); } else if (ctrl is UserControlTravelGrid) { UserControlTravelGrid ucm = ctrl as UserControlTravelGrid; ucm.NoHistoryIcon(); ucm.NoPopOutIcon(); } }
private void UserControlForm_Shown(object sender, EventArgs e) // as launched, it may not be in front (as its launched from a control).. bring to front { this.BringToFront(); bool tr = SQLiteDBClass.GetSettingBool(dbrefname + "Transparent", deftransparent); if (tr && IsTransparencySupported) // the check is for paranoia { SetTransparency(true); // only call if transparent.. may not be fully set up so don't merge with above } SetTopMost(SQLiteDBClass.GetSettingBool(dbrefname + "TopMost", deftopmost)); var top = SQLiteDBClass.GetSettingInt(dbrefname + "Top", -1); if (top >= 0 && norepositionwindow == false) { var left = SQLiteDBClass.GetSettingInt(dbrefname + "Left", 0); var height = SQLiteDBClass.GetSettingInt(dbrefname + "Height", 800); var width = SQLiteDBClass.GetSettingInt(dbrefname + "Width", 800); // Adjust so window fits on screen; just in case user unplugged a monitor or something var screen = SystemInformation.VirtualScreen; if (height > screen.Height) { height = screen.Height; } if (top + height > screen.Height + screen.Top) { top = screen.Height + screen.Top - height; } if (width > screen.Width) { width = screen.Width; } if (left + width > screen.Width + screen.Left) { left = screen.Width + screen.Left - width; } if (top < screen.Top) { top = screen.Top; } if (left < screen.Left) { left = screen.Left; } this.Top = top; this.Left = left; this.Height = height; this.Width = width; this.CreateParams.X = this.Left; this.CreateParams.Y = this.Top; this.StartPosition = FormStartPosition.Manual; } if (UserControl != null) { UserControl.LoadLayout(); } isloaded = true; }
private void UserControlForm_Shown(object sender, EventArgs e) // as launched, it may not be in front (as its launched from a control).. bring to front { this.BringToFront(); if (IsTransparencySupported) { transparentmode = (TransparencyMode)SQLiteDBClass.GetSettingInt(dbrefname + "Transparent", deftransparent ? (int)TransparencyMode.On : (int)TransparencyMode.Off); } SetTopMost(SQLiteDBClass.GetSettingBool(dbrefname + "TopMost", deftopmost)); // this also establishes transparency var top = SQLiteDBClass.GetSettingInt(dbrefname + "Top", -999); //System.Diagnostics.Debug.WriteLine("Position Top is {0} {1}", dbrefname, top); if (top != -999 && norepositionwindow == false) { var left = SQLiteDBClass.GetSettingInt(dbrefname + "Left", 0); var height = SQLiteDBClass.GetSettingInt(dbrefname + "Height", 800); var width = SQLiteDBClass.GetSettingInt(dbrefname + "Width", 800); System.Diagnostics.Debug.WriteLine("Position {0} {1} {2} {3} {4}", dbrefname, top, left, width, height); // Adjust so window fits on screen; just in case user unplugged a monitor or something var screen = SystemInformation.VirtualScreen; if (height > screen.Height) { height = screen.Height; } if (top + height > screen.Height + screen.Top) { top = screen.Height + screen.Top - height; } if (width > screen.Width) { width = screen.Width; } if (left + width > screen.Width + screen.Left) { left = screen.Width + screen.Left - width; } if (top < screen.Top) { top = screen.Top; } if (left < screen.Left) { left = screen.Left; } this.Top = top; this.Left = left; this.Height = height; this.Width = width; this.CreateParams.X = this.Left; this.CreateParams.Y = this.Top; this.StartPosition = FormStartPosition.Manual; } if (UserControl != null) { UserControl.LoadLayout(); } isloaded = true; }