Beispiel #1
0
        private void UpdateControls()
        {
            GEDCOMIndividualRecord husband, wife;

            if (fFamily == null)
            {
                husband = null;
                wife    = null;

                LockEditor(true);
            }
            else
            {
                husband = fFamily.GetHusband();
                wife    = fFamily.GetWife();

                LockEditor(fFamily.Restriction == GEDCOMRestriction.rnLocked);
            }

            txtHusband.Text          = (husband != null) ? GKUtils.GetNameString(husband, true, false) : LangMan.LS(LSID.LSID_UnkMale);
            btnHusbandAdd.Enabled    = (husband == null);
            btnHusbandDelete.Enabled = (husband != null);
            btnHusbandSel.Enabled    = (husband != null);

            txtWife.Text          = (wife != null) ? GKUtils.GetNameString(wife, true, false) : LangMan.LS(LSID.LSID_UnkFemale);
            btnWifeAdd.Enabled    = (wife == null);
            btnWifeDelete.Enabled = (wife != null);
            btnWifeSel.Enabled    = (wife != null);

            fChildrenList.UpdateSheet();
            fEventsList.UpdateSheet();
            fNotesList.UpdateSheet();
            fMediaList.UpdateSheet();
            fSourcesList.UpdateSheet();
        }
Beispiel #2
0
        private void ControlsRefresh()
        {
            GEDCOMFileReferenceWithTitle fileRef = fMediaRec.FileReferences[0];

            fIsNew = (fileRef.StringValue == "");

            txtName.Text = fileRef.Title;
            cmbMediaType.SelectedIndex = (int)fileRef.MediaType;
            txtFile.Text = fileRef.StringValue;

            if (fIsNew)
            {
                RefreshStoreTypes(GlobalOptions.Instance.AllowMediaStoreReferences, true, MediaStoreType.mstReference);
            }
            else
            {
                MediaStore mediaStore = fBase.Context.GetStoreType(fileRef);
                RefreshStoreTypes((mediaStore.StoreType == MediaStoreType.mstReference),
                                  (mediaStore.StoreType == MediaStoreType.mstArchive), mediaStore.StoreType);
            }

            btnFileSelect.Enabled = fIsNew;
            cmbStoreType.Enabled  = fIsNew;

            fNotesList.UpdateSheet();
            fSourcesList.UpdateSheet();
        }
Beispiel #3
0
        private void ControlsRefresh()
        {
            if (fLocation != null)
            {
                txtEventPlace.Text      = fLocation.LocationName;
                txtEventPlace.ReadOnly  = true;
                txtEventPlace.BackColor = SystemColors.Control;
                btnPlaceAdd.Enabled     = false;
                btnPlaceDelete.Enabled  = true;
            }
            else
            {
                txtEventPlace.Text      = fEvent.Place.StringValue;
                txtEventPlace.ReadOnly  = false;
                txtEventPlace.BackColor = SystemColors.Window;
                btnPlaceAdd.Enabled     = true;
                btnPlaceDelete.Enabled  = false;
            }

            fNotesList.UpdateSheet();
            fMediaList.UpdateSheet();
            fSourcesList.UpdateSheet();
        }
Beispiel #4
0
        private void UpdateControls(bool totalUpdate = false)
        {
            bool locked = (cmbRestriction.SelectedIndex == (int)GEDCOMRestriction.rnLocked);

            if (fPerson.ChildToFamilyLinks.Count != 0)
            {
                GEDCOMFamilyRecord family = fPerson.ChildToFamilyLinks[0].Family;
                btnParentsAdd.Enabled    = false;
                btnParentsEdit.Enabled   = true && !locked;
                btnParentsDelete.Enabled = true && !locked;

                GEDCOMIndividualRecord relPerson = family.GetHusband();
                if (relPerson != null)
                {
                    btnFatherAdd.Enabled    = false;
                    btnFatherDelete.Enabled = true && !locked;
                    btnFatherSel.Enabled    = true && !locked;
                    txtFather.Text          = GKUtils.GetNameString(relPerson, true, false);
                }
                else
                {
                    btnFatherAdd.Enabled    = true && !locked;
                    btnFatherDelete.Enabled = false;
                    btnFatherSel.Enabled    = false;
                    txtFather.Text          = "";
                }

                relPerson = family.GetWife();
                if (relPerson != null)
                {
                    btnMotherAdd.Enabled    = false;
                    btnMotherDelete.Enabled = true && !locked;
                    btnMotherSel.Enabled    = true && !locked;
                    txtMother.Text          = GKUtils.GetNameString(relPerson, true, false);
                }
                else
                {
                    btnMotherAdd.Enabled    = true && !locked;
                    btnMotherDelete.Enabled = false;
                    btnMotherSel.Enabled    = false;
                    txtMother.Text          = "";
                }
            }
            else
            {
                btnParentsAdd.Enabled    = true && !locked;
                btnParentsEdit.Enabled   = false;
                btnParentsDelete.Enabled = false;

                btnFatherAdd.Enabled    = true && !locked;
                btnFatherDelete.Enabled = false;
                btnFatherSel.Enabled    = false;

                btnMotherAdd.Enabled    = true && !locked;
                btnMotherDelete.Enabled = false;
                btnMotherSel.Enabled    = false;

                txtFather.Text = "";
                txtMother.Text = "";
            }

            if (totalUpdate)
            {
                fEventsList.UpdateSheet();
                fNotesList.UpdateSheet();
                fMediaList.UpdateSheet();
                fSourcesList.UpdateSheet();
                fAssociationsList.UpdateSheet();

                fGroupsList.UpdateSheet();
                fNamesList.UpdateSheet();
                fSpousesList.UpdateSheet();
                fUserRefList.UpdateSheet();
            }

            UpdatePortrait(totalUpdate);

            // controls lock
            txtName.Enabled       = !locked;
            cmbPatronymic.Enabled = !locked;
            txtSurname.Enabled    = !locked;

            cmbSex.Enabled       = !locked;
            chkPatriarch.Enabled = !locked;
            chkBookmark.Enabled  = !locked;

            txtNamePrefix.Enabled    = !locked;
            txtNickname.Enabled      = !locked;
            txtSurnamePrefix.Enabled = !locked;
            txtNameSuffix.Enabled    = !locked;

            fEventsList.ReadOnly       = locked;
            fNotesList.ReadOnly        = locked;
            fMediaList.ReadOnly        = locked;
            fSourcesList.ReadOnly      = locked;
            fSpousesList.ReadOnly      = locked;
            fAssociationsList.ReadOnly = locked;
            fGroupsList.ReadOnly       = locked;
            fUserRefList.ReadOnly      = locked;

            ICulture culture = fBase.Context.Culture;

            txtSurname.Enabled    = txtSurname.Enabled && culture.HasSurname();
            cmbPatronymic.Enabled = cmbPatronymic.Enabled && culture.HasPatronymic();
        }