/// <summary> /// constructor /// </summary> public IndexCard(TabSetupSettings settings) { InitializeComponent(); DemoType = 0; GeneralSettings = new PhoneNumberSetupSettings(); GeneralSettings.ShowGrid = settings.ShowGrid; GeneralSettings.ShowName = settings.ShowName; GeneralSettings.ShowCanonical = settings.ShowCanonical; GeneralSettings.CellWidth = settings.CellWidth; GeneralSettings.CellHeight = settings.CellHeight; GeneralSettings.FontSize = 0; //default until manually set GridCells = new List <PhoneNumber>(); //create a tabitem that we will show in the "tabholder" tabbar VisualTab = new TabItem(); VisualTab.Content = this; VisualTab.ContextMenu = Resources["contextMenu"] as ContextMenu; VisualTab.Style = Resources["tabItem"] as Style; //not used, just for the sake of sanity SetName("Unsaved new"); SetVisible(false); //show ourself in the tabholder MainWindow MainObject = (MainWindow)App.Current.MainWindow; MainObject.TabHolder.Items.Add(VisualTab); }
public MainWindow() { InitializeComponent(); GeneralSettings = new TabSetupSettings(); //load settings GeneralSettings.ShowGrid = true; GeneralSettings.ShowName = false; TopmostWindow = false; GeneralSettings.ShowCanonical = false; GeneralSettings.CellWidth = GridContentArea.GetDefaultCellWidth(); GeneralSettings.CellHeight = GridContentArea.GetDefaultCellHeight(); AdminPassw = "HIPATH"; HasAdminPriviledges = false; BLFServerPort = 5059; BLFServerIP = "127.0.0.1"; //load saved tabs LoadIndexCards(); //use loaded settings to init data //generate grid layout based on the size of the window RedrawIndexCards(); //set status code background colors InitStatusBar(); // after all settings have been loaded // in case we resize the window, we will redraw the grid //last thing, add hotkeys AddHotKeys(); }
public void OnFontSettingChanged(TabSetupSettings settings) { //new cells should be created with updated settings GeneralSettings.FontFamily = settings.FontFamily; GeneralSettings.FontSize = settings.FontSize; GeneralSettings.FontWeight_ = settings.FontWeight_; GeneralSettings.FontStyle_ = settings.FontStyle_; //each cell should cahnge it's current size foreach (var cell in GridCells) { cell.OnFontSettingChanged(GeneralSettings); } }
/// <summary> /// constructor /// </summary> public IndexCard(TabSetupSettings settings) { InitializeComponent(); DemoType = 0; GeneralSettings = new PhoneNumberSetupSettings(); GeneralSettings.ShowGrid = settings.ShowGrid; GeneralSettings.ShowName = settings.ShowName; GeneralSettings.ShowCanonical = settings.ShowCanonical; GeneralSettings.CellWidth = settings.CellWidth; GeneralSettings.CellHeight = settings.CellHeight; GeneralSettings.Prefix = settings.Prefix; DrawArea.SetCellSize(GeneralSettings.CellWidth, GeneralSettings.CellHeight); GridCells = new List <PhoneNumber>(); //create a tabitem that we will show in the "tabholder" tabbar VisualTab = new DragableTabItem(); VisualTab.Content = this; VisualTab.ContextMenu = Resources["contextMenu"] as ContextMenu; VisualTab.Style = Resources["tabItem"] as Style; //not used, just for the sake of sanity SetName(Globals.MultilangManager.GetTranslation("Unsaved new")); SetVisible(false); //show ourself in the tabholder MainWindow MainObject = (MainWindow)App.Current.MainWindow; MainObject.TabHolder.Items.Add(VisualTab); //create a timer that periodically updates the phones double DemoTimer = Globals.IniFile.GetConfigNum("Options", "DemoTimer", 0.5); UpdateTimer = new Timer(DemoTimer * 60 * 1000); UpdateTimer.Enabled = false; // do not trigger the update event until we become visible UpdateTimer.Elapsed += new ElapsedEventHandler(PeriodicStatusUpdate); Globals.FolderManager.IndexCardAdd(this); TranslateLocalize(); }