Ejemplo n.º 1
0
        public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType)
        {
            NSAlert al = new NSAlert();

            al.AlertStyle      = CocoaHelper.GetWinType(type);
            al.MessageText     = title;
            al.InformativeText = message;

            switch (bType)
            {
            case MessageWindowButtons.AbortRetryIgnore:
                al.AddButton(Message.GetString("Abort"));
                al.AddButton(Message.GetString("Retry"));
                al.AddButton(Message.GetString("Ignore"));
                break;

            case MessageWindowButtons.Cancel:
                al.AddButton(Message.GetString("Cancel"));
                break;

            case MessageWindowButtons.Close:
                al.AddButton(Message.GetString("Close"));
                break;

            case  MessageWindowButtons.Ok:
                al.AddButton(Message.GetString("Ok"));
                break;

            case MessageWindowButtons.OkCancel:
                al.AddButton(Message.GetString("Ok"));
                al.AddButton(Message.GetString("Cancel"));
                break;

            case MessageWindowButtons.RetryCancel:
                al.AddButton(Message.GetString("Retry"));
                al.AddButton(Message.GetString("Cancel"));
                break;

            case MessageWindowButtons.YesNo:
                al.AddButton(Message.GetString("Yes"));
                al.AddButton(Message.GetString("No"));
                break;

            case MessageWindowButtons.YesNoCancel:
                al.AddButton(Message.GetString("Yes"));
                al.AddButton(Message.GetString("No"));
                al.AddButton(Message.GetString("Cancel"));
                break;
            }

            WindowResponse resp = CocoaHelper.GetResponse(al.RunModal(), bType);

            al.Dispose();
            return(resp);
        }
Ejemplo n.º 2
0
 private void HandleTableSelectionChanged()
 {
     try
     {
         if (MainTable.SelectedRow >= 0 && TabChangeButton.SelectedSegment == (int)TabLocation.Filelist)
         {
             ThumbViewList.Image = CocoaHelper.ToNSImage(ProjectManager.CurrentProject.GetThumb(MainTable.SelectedRow));
         }
     }
     catch (Exception ex) { Error.Report("HandleTableSelectionChanged", ex); }
 }
Ejemplo n.º 3
0
        public void RefreshImages()
        {
            int val = FrameSelectSlider.IntValue;

            FrameSelectedLabel.StringValue = val.ToString();

            if (val >= 0 && val < ProjectManager.CurrentProject.Frames.Count)
            {
                ThumbEditView.Image  = CocoaHelper.ToNSImage(ProjectManager.CurrentProject.GetThumbEdited(val));
                ThumbViewGraph.Image = CocoaHelper.ToNSImage(ProjectManager.CurrentProject.GetThumb(val));
            }
        }
Ejemplo n.º 4
0
        public override WindowResponse Show()
        {
            WindowResponse resp;
            List <string>  filetypes = new List <string>();
            NSUrl          initDir   = null;

            if (Directory.Exists(InitialDirectory))
            {
                initDir = new NSUrl(InitialDirectory);
            }

            switch (DialogType)
            {
            case FileDialogType.OpenFile:
                ofdlg = new NSOpenPanel();
                if (initDir != null)
                {
                    ofdlg.DirectoryUrl = initDir;
                }
                ofdlg.Title                   = Title;
                ofdlg.CanChooseFiles          = true;
                ofdlg.CanChooseDirectories    = false;
                ofdlg.AllowsMultipleSelection = false;
                if (filetypes.Count > 0)
                {
                    foreach (FileTypeFilter arr in FileTypeFilters)
                    {
                        filetypes.AddRange(arr.Filter);
                    }
                    ofdlg.AllowedFileTypes = filetypes.ToArray();
                }

                resp         = CocoaHelper.GetResponse(ofdlg.RunModal());
                SelectedPath = ofdlg.Url.Path;
                return(resp);

            case FileDialogType.SelectFolder:
                ofdlg = new NSOpenPanel();
                if (initDir != null)
                {
                    ofdlg.DirectoryUrl = initDir;
                }
                ofdlg.Title                   = Title;
                ofdlg.CanChooseFiles          = false;
                ofdlg.CanChooseDirectories    = true;
                ofdlg.AllowsMultipleSelection = false;

                resp         = CocoaHelper.GetResponse(ofdlg.RunModal());
                SelectedPath = ofdlg.Url.Path;
                return(resp);

            case FileDialogType.SaveFile:
                sfdlg = new NSSavePanel();
                if (initDir != null)
                {
                    sfdlg.DirectoryUrl = initDir;
                }
                sfdlg.Title = Title;
                sfdlg.CanCreateDirectories = true;

                resp         = CocoaHelper.GetResponse(sfdlg.RunModal());
                SelectedPath = sfdlg.Url.Path;
                return(resp);
            }

            return(WindowResponse.None);
        }