private void OnGenericViewRequested(object sender, GenericViewRequestedEventArgs e) { GenericWindow window = new GenericWindow(e.ViewModel); window.Owner = this; window.ShowDialog(); }
public List <object> ShowAsWindow(string windowTitle = "", Window ownerWindow = null, eWindowShowStyle windowStyle = eWindowShowStyle.Dialog, bool startupLocationWithOffset = false) { bOpenasWindow = true; ObservableList <Button> winButtons = new ObservableList <Button>(); Button selectBtn = new Button(); selectBtn.Content = "Select"; selectBtn.Click += new RoutedEventHandler(selectBtn_Click); winButtons.Add(selectBtn); if (windowTitle == string.Empty) { windowTitle = mitemTypeName + " Selection"; } if (ownerWindow == null) { ownerWindow = App.MainWindow; } GenericWindow.LoadGenericWindow(ref mPageGenericWin, ownerWindow, windowStyle, windowTitle, this, winButtons, true, "Close", CloseWinClicked, startupLocationWithOffset: startupLocationWithOffset); return(mSelectedItems); }
//for some widgets static public GenericWindow Show(bool showNow, string textHeader, ArrayList array) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(); } GenericWindowBox.hideWidgets(); foreach (ArrayList widgetArray in array) { GenericWindowBox.showWidgetsPowerful(widgetArray); } GenericWindowBox.generic_window.Resizable = false; GenericWindowBox.label_header.Text = textHeader; Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "stock_delete.png"); GenericWindowBox.image_delete.Pixbuf = pixbuf; GenericWindowBox.label_header.Text = textHeader; GenericWindowBox.Type = Types.UNDEFINED; if (showNow) { GenericWindowBox.generic_window.Show(); } GenericWindowBox.HideOnAccept = true; GenericWindowBox.DestroyOnAccept = false; return(GenericWindowBox); }
private void on_delete_event(object o, DeleteEventArgs args) { args.RetVal = true; GenericWindowBox.generic_window.Hide(); GenericWindowBox = null; }
protected override void createGenericWindow() { genericWinESR = GenericWindow.Show(false, //don't show now Catalog.GetString("Select persons to compare"), bigArray); genericWinESR.SetTreeview(columnsString, true, data, nonSensitiveRows, Constants.ContextMenu.NONE, false); //select this person row genericWinESR.SelectRowWithID(0, currentPerson.UniqueID); genericWinESR.ResetComboCheckBoxesOptions(); genericWinESR.CreateComboCheckBoxes(); genericWinESR.MarkActiveCurves(checkboxes); genericWinESR.ShowButtonCancel(false); genericWinESR.SetButtonAcceptSensitive(true); //to have encoderCompareInter without opening the select window updateEncoderCompareInterAndReps(); //used when we don't need to read data, //and we want to ensure next window will be created at needed size //genericWinESR.DestroyOnAccept=true; //here is comented because we are going to read the checkboxes genericWinESR.Type = GenericWindow.Types.ENCODER_SEL_REPS_GROUP_CURRENT_SESS; }
protected override void createGenericWindow() { genericWinESR = GenericWindow.Show(false, //don't show now //TODO: change message string.Format(Catalog.GetString("Compare repetitions between the following sessions"), currentPerson.Name), bigArray); //convert data from array of EncoderPersonCurvesInDB to array of strings [] ArrayList dataConverted = new ArrayList(); foreach (EncoderPersonCurvesInDB encPS in data) { dataConverted.Add(encPS.ToStringArray(true)); } genericWinESR.SetTreeview(columnsString, true, dataConverted, nonSensitiveRows, Constants.ContextMenu.NONE, false); genericWinESR.ResetComboCheckBoxesOptions(); genericWinESR.CreateComboCheckBoxes(); genericWinESR.MarkActiveCurves(checkboxes); genericWinESR.ShowButtonCancel(false); genericWinESR.SetButtonAcceptSensitive(true); //to have encoderCompareInter without opening the select window updateEncoderCompareInterAndReps(); updateEncoderInterSessionDateOnXWeights(); //used when we don't need to read data, //and we want to ensure next window will be created at needed size //genericWinESR.DestroyOnAccept=true; //here is comented because we are going to read the checkboxes genericWinESR.Type = GenericWindow.Types.ENCODER_SEL_REPS_IND_ALL_SESS; }
//for an array of widgets static public GenericWindow Show(string title, bool showNow, string textHeader, ArrayList array) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(title, textHeader); } else { GenericWindowBox.setTitle(title); GenericWindowBox.label_header.Text = textHeader; } GenericWindowBox.Type = Types.UNDEFINED; GenericWindowBox.hideWidgets(); foreach (ArrayList widgetArray in array) { GenericWindowBox.showWidgetsPowerful(widgetArray); } Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "stock_delete.png"); GenericWindowBox.image_delete.Pixbuf = pixbuf; if (showNow) { GenericWindowBox.generic_window.Show(); } return(GenericWindowBox); }
public void Release(Window wpfWindow = null, Form winForm = null) { if (wpfWindow != null) { GenericWindow gen = Tools.FirstOrDefault(x => x == wpfWindow); if (gen is GenericWindow) //can't use != due to ambiguity apparently { ReleaseGenericWindow(gen); } else { Debug.WriteLine("Releasing package that isn't in use by any window"); } } else if (winForm != null) { GenericWindow gen = Tools.FirstOrDefault(x => x == winForm); if (gen is GenericWindow) //can't use != due to ambiguity apparently { ReleaseGenericWindow(gen); } else { Debug.WriteLine("Releasing package that isn't in use by any window"); } } Dispose(); }
private void on_button_add_comment_clicked(object o, EventArgs args) { //new DialogMessage(Constants.MessageTypes.INFO, "not implemented yet"); //see if there's any comment string comment = ""; if (selected) { TreeModel model; TreeIter iter1; if (treeview1.Selection.GetSelected(out model, out iter1)) { string str = getRow(iter1); string [] statRow = str.ToString().Split(new char[] { '\t' }); comment = statRow[8]; } genericWin = GenericWindow.Show(Catalog.GetString("Add comment"), Catalog.GetString("Comment this statistic"), Constants.GenericWindowShow.TEXTVIEW); genericWin.SetTextview(comment); genericWin.Button_accept.Clicked += new EventHandler(on_comment_add_accepted); } }
private void Start() { EventManager.Instance.SubscribeToEvent(EventType.NextDay, OnNextDay); // Create a warning window warningWindow = Instantiate(warningWindowPrefab, mainCanvas.transform); warningWindow.gameObject.SetActive(false); }
public void ShowAsWindow() { GenericWindow genWin = null; this.Height = 400; this.Width = 400; GingerCore.General.LoadGenericWindow(ref genWin, null, eWindowShowStyle.Free, "Device View", this); }
private void ReleaseGenericWindow(GenericWindow gen) { Tools.Remove(gen); if (Tools.Count == 0) { noLongerOpenInTools?.Invoke(this, EventArgs.Empty); } gen.Dispose(); }
public void ShowAsWindow(eWindowShowStyle windowStyle = eWindowShowStyle.Dialog) { lblActionType.Visibility = System.Windows.Visibility.Collapsed; GenericWindow genWin = null; this.Height = 400; this.Width = 400; GingerCore.General.LoadGenericWindow(ref genWin, App.MainWindow, windowStyle, mAct.ActionDescription + " Description", this); }
private void on_delete_event(object o, DeleteEventArgs args) { LogB.Information("calling on_delete_event"); args.RetVal = true; GenericWindowBox.generic_window.Hide(); GenericWindowBox = null; }
protected override void createGenericWindow() { /* * Disabled because combo exercise is selected before (not on genericWinESR) * * add exercises to the combo (only the exercises done, and only unique) * ArrayList encoderExercisesNames = new ArrayList(); * foreach(EncoderSQL es in data) { * encoderExercisesNames = Util.AddToArrayListIfNotExist(encoderExercisesNames, Catalog.GetString(es.exerciseName)); * } */ genericWinESR = GenericWindow.Show(false, //don't show now string.Format(Catalog.GetString("Saved repetitions of athlete {0} on this session."), currentPerson.Name) + "\n" + Catalog.GetString("Activate the repetitions you want to use clicking on first column.") + "\n" + Catalog.GetString("If you want to edit or delete a row, right click on it.") + "\n", bigArray); genericWinESR.SetTreeview(columnsString, true, dataPrint, new ArrayList(), Constants.ContextMenu.EDITDELETE, false); genericWinESR.ResetComboCheckBoxesOptions(); //genericWinESR.AddOptionsToComboCheckBoxesOptions(encoderExercisesNames); genericWinESR.CreateComboCheckBoxes(); genericWinESR.MarkActiveCurves(checkboxes); //find all persons in current session ArrayList personsPre = SqlitePersonSession.SelectCurrentSessionPersons( currentSession.UniqueID, false); //means: do not returnPersonAndPSlist string [] persons = new String[personsPre.Count]; int count = 0; foreach (Person p in personsPre) { persons[count++] = p.UniqueID.ToString() + ":" + p.Name; } genericWinESR.SetComboValues(persons, currentPerson.UniqueID + ":" + currentPerson.Name); genericWinESR.SetComboLabel(Catalog.GetString("Change the owner of selected repetition") + " (" + Catalog.GetString("code") + ":" + Catalog.GetString("name") + ")"); genericWinESR.ShowEditRow(false); genericWinESR.CommentColumn = 10; genericWinESR.ShowButtonCancel(false); genericWinESR.SetButtonAcceptSensitive(true); genericWinESR.SetButtonCancelLabel(Catalog.GetString("Close")); //used when we don't need to read data, //and we want to ensure next window will be created at needed size //genericWinESR.DestroyOnAccept=true; //here is comented because we are going to read the checkboxes genericWinESR.Type = GenericWindow.Types.ENCODER_SEL_REPS_IND_CURRENT_SESS; }
public void RegisterTool(GenericWindow gen) { RefCount++; Tools.Add(gen); gen.RegisterClosed(() => { ReleaseGenericWindow(gen); Dispose(); }); }
public bool AddWindow(GenericWindow newWindow) { if (_windowsOpen.Count > 5) { MessageBox.Show("Too many windows open, close some windows."); return(false); } _windowsOpen.Add(newWindow); return(true); }
internal void ShowAsWindow(System.Windows.Window owner) { Button AddBtn = new Button(); AddBtn.Content = "Add"; AddBtn.Click += new RoutedEventHandler(AddButton_Click); ObservableList <Button> Buttons = new ObservableList <Button>(); Buttons.Add(AddBtn); GenericWindow.LoadGenericWindow(ref genWin, owner, eWindowShowStyle.Free, this.Title, this, Buttons); }
public void RunConcurrently(object sender, IRunnable runnable) { _context.Send(_ => { var owner = GetOwner(sender); var window = new GenericWindow { DataContext = runnable, Owner = owner }; window.Show(); }); }
private void on_button_accept_clicked(object o, EventArgs args) { if (HideOnAccept) { GenericWindowBox.generic_window.Hide(); } if (DestroyOnAccept) { GenericWindowBox = null; } }
static public System.IntPtr PrepareMainWndReady(int cTimeOut) { IntPtr mainWnd = GenericWindow.FindWindow("rctrl_renwnd32", null); int begin = Environment.TickCount; Tracer._Trace("Waiting while main window is loaded"); while ((int)mainWnd == 0 && (Environment.TickCount - begin) < cTimeOut) { mainWnd = GenericWindow.FindWindow("rctrl_renwnd32", null); } return(mainWnd); }
public void ShowAsWindow(eWindowShowStyle windowStyle = eWindowShowStyle.Dialog) { Button okBtn = new Button(); okBtn.Content = "OK"; okBtn.Click += new RoutedEventHandler(OKButton_Click); ObservableList <Button> winButtons = new ObservableList <Button>(); winButtons.Add(okBtn); GenericWindow.LoadGenericWindow(ref mGenericWindow, null, windowStyle, this.Title, this, winButtons, true, "Cancel"); }
public void ShowAsWindow(string Title, bool ShowEnlarge) { if (!ShowEnlarge) { EnlargeButton.Visibility = Visibility.Collapsed; } GenericWindow genWin = null; this.Height = 600; this.Width = 800; GingerCore.General.LoadGenericWindow(ref genWin, App.MainWindow, eWindowShowStyle.Free, "image viewer - " + mName, this); }
private void on_button_accept_clicked(object o, EventArgs args) { LogB.Information("called on_button_accept_clicked"); if (HideOnAccept) { GenericWindowBox.generic_window.Hide(); } if (DestroyOnAccept) { GenericWindowBox = null; } }
public void ShowAsWindow(eWindowShowStyle windowStyle = eWindowShowStyle.Dialog) { Button UploadButton = new Button(); UploadButton.Content = "Upload"; UploadButton.Click += new RoutedEventHandler(UploadBFs); GenericWindow genWin = null; GingerCore.General.LoadGenericWindow(ref genWin, App.MainWindow, windowStyle, this.Title, this, new ObservableList <Button> { UploadButton }); }
/// <summary> /// Open window to user to select an action /// User will be able to Edit the action properties after clicking add /// Add the selected action to ActionsList /// </summary> /// <param name="ActionsList">Existing list which the new action will be added to it if user click add</param> /// <param name="windowStyle"></param> public void ShowAsWindow(ObservableList <Act> ActionsList, eWindowShowStyle windowStyle = eWindowShowStyle.Dialog) { mActionsList = ActionsList; Button addActionBtn = new Button(); addActionBtn.Content = "Add Action"; addActionBtn.Click += new RoutedEventHandler(AddActionButton_Click); GenericWindow.LoadGenericWindow(ref _pageGenericWin, null, windowStyle, this.Title, this, new ObservableList <Button> { addActionBtn }); }
//for only one widget static public GenericWindow Show(string textHeader, Constants.GenericWindowShow stuff) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(textHeader); } GenericWindowBox.Type = Types.UNDEFINED; GenericWindowBox.showWidget(stuff); GenericWindowBox.generic_window.Show(); return(GenericWindowBox); }
internal DeltaElementInfo ShowAsWindow(string winTitle) { ObservableList <Button> windowButtons = new ObservableList <Button>(); Button selectBtn = new Button(); selectBtn.Content = "Select"; selectBtn.Click += new RoutedEventHandler(selectBtn_Click); windowButtons.Add(selectBtn); this.Height = 600; this.Width = 800; GenericWindow.LoadGenericWindow(ref mGenericWindow, null, eWindowShowStyle.Dialog, winTitle, this, windowButtons, true, "Cancel", CancelBtn_Click); return(mPomDeltaViewPage.mSelectedElement); }
public void Release(System.Windows.Window wpfWindow = null, System.Windows.Forms.Form winForm = null) { if (wpfWindow != null) { GenericWindow gen = Tools.First(x => x == wpfWindow); ReleaseGenericWindow(gen); } else if (winForm != null) { GenericWindow gen = Tools.First(x => x == winForm); ReleaseGenericWindow(gen); } Dispose(); }
public void ShowAsWindow(eWindowShowStyle windowStyle = eWindowShowStyle.Dialog) { ObservableList <Button> winButtons = new ObservableList <Button>(); Button ImportButton = new Button(); ImportButton.Content = "Import"; ImportButton.Click += new RoutedEventHandler(ImportButton_Click); winButtons.Add(ImportButton); genWin = null; this.Height = 400; this.Width = 400; GingerCore.General.LoadGenericWindow(ref genWin, App.MainWindow, windowStyle, "Import " + PlugInEditorName + " File", this, winButtons); }
//for some widgets public static GenericWindow Show(bool showNow, string textHeader, ArrayList array) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(textHeader); } GenericWindowBox.hideWidgets(); foreach(ArrayList widgetArray in array) GenericWindowBox.showWidgetsPowerful(widgetArray); Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_delete.png"); GenericWindowBox.image_delete.Pixbuf = pixbuf; GenericWindowBox.Type = Types.UNDEFINED; GenericWindowBox.label_header.Text = textHeader; if(showNow) GenericWindowBox.generic_window.Show (); return GenericWindowBox; }
private void on_button_add_comment_clicked(object o, EventArgs args) { //new DialogMessage(Constants.MessageTypes.INFO, "not implemented yet"); //see if there's any comment string comment = ""; if(selected) { TreeModel model; TreeIter iter1; if (treeview1.Selection.GetSelected (out model, out iter1)) { string str=getRow(iter1); string [] statRow = str.ToString().Split(new char[] {'\t'}); comment = statRow[8]; } genericWin = GenericWindow.Show(Catalog.GetString("Comment this statistic"), Constants.GenericWindowShow.TEXTVIEW); genericWin.SetTextview(comment); genericWin.Button_accept.Clicked += new EventHandler(on_comment_add_accepted); } }
void Awake() { background = gameObject.GetComponent<Image>(); gWindow = Panel.GetComponent<GenericWindow>(); }
//show spinbutton window asking for how many people to create private void on_person_add_multiple_clicked(object o, EventArgs args) { genericWin = GenericWindow.Show(Catalog.GetString("Select number of persons to add") + "\n" + Catalog.GetString("If you want to add more than 40 persons, do this process two times.") , Constants.GenericWindowShow.SPININT); genericWin.LabelSpinInt = ""; genericWin.SetSpinRange(1.0, 40.0); genericWin.Button_accept.Clicked += new EventHandler(on_person_add_multiple_prepared); }
//for only one widget public static GenericWindow Show(string textHeader, Constants.GenericWindowShow stuff) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(); } GenericWindowBox.hideWidgets(); GenericWindowBox.showWidget(stuff); GenericWindowBox.label_header.Text = textHeader; GenericWindowBox.generic_window.Show (); GenericWindowBox.HideOnAccept = true; GenericWindowBox.DestroyOnAccept = false; return GenericWindowBox; }
private void on_button_accept_clicked(object o, EventArgs args) { LogB.Information("called on_button_accept_clicked"); if(HideOnAccept) GenericWindowBox.generic_window.Hide(); if(DestroyOnAccept) GenericWindowBox = null; }
protected void on_button_accept_clicked(object o, EventArgs args) { if(HideOnAccept) GenericWindowBox.generic_window.Hide(); if(DestroyOnAccept) GenericWindowBox = null; }
//when ! HideOnAccept, use this to close window //also is better to call it always tat is closed clicking on accept (after data has been readed) public void HideAndNull() { GenericWindowBox.generic_window.Hide(); GenericWindowBox = null; }
void on_button_weight_metric_clicked(object obj, EventArgs args) { genericWin = GenericWindow.Show(Catalog.GetString("Select your weight in pounds"), Constants.GenericWindowShow.SPINDOUBLE); genericWin.Button_accept.Clicked += new EventHandler(on_button_weight_metric_accepted); }
void on_button_sport_add_clicked(object o, EventArgs args) { LogB.Information("sport add clicked"); genericWin = GenericWindow.Show(Catalog.GetString("Add new sport to database"), Constants.GenericWindowShow.ENTRY); genericWin.Button_accept.Clicked += new EventHandler(on_sport_add_accepted); }
void on_button_height_metric_clicked(object obj, EventArgs args) { genericWin = GenericWindow.Show(Catalog.GetString("Select your height"), Constants.GenericWindowShow.HEIGHTMETRIC); genericWin.Button_accept.Clicked += new EventHandler(on_button_height_metric_accepted); }
protected void on_button_cancel_clicked(object o, EventArgs args) { GenericWindowBox.generic_window.Hide(); GenericWindowBox = null; }
protected void on_delete_event(object o, DeleteEventArgs args) { GenericWindowBox.generic_window.Hide(); GenericWindowBox = null; }
//for some widgets public static GenericWindow Show(string textHeader, ArrayList array) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(); } GenericWindowBox.hideWidgets(); foreach(ArrayList widgetArray in array) GenericWindowBox.showWidgetsPowerful(widgetArray); GenericWindowBox.label_header.Text = textHeader; GenericWindowBox.generic_window.Show (); GenericWindowBox.HideOnAccept = true; GenericWindowBox.DestroyOnAccept = false; return GenericWindowBox; }
//for only one widget public static GenericWindow Show(string textHeader, Constants.GenericWindowShow stuff) { if (GenericWindowBox == null) { GenericWindowBox = new GenericWindow(textHeader); } GenericWindowBox.Type = Types.UNDEFINED; GenericWindowBox.showWidget(stuff); GenericWindowBox.generic_window.Show (); return GenericWindowBox; }