def on_linkType_changed(self, evt):
        """User changed link kind, so prepare available fields."""
        if self.current_idx < 0:
            evt.Skip()
            return
        n = self.linkType.GetSelection()
        lt_str = self.linkType.GetString(n)
        lt = self.link_code[lt_str]
        self.prep_link_details(lt)
            
        lnk = self.page_links[self.current_idx]
        lnk["update"] = True
        lnk["kind"] = lt
        self.enable_update()

        if lt == fitz.LINK_GOTO:
            if not self.toPage.Value.isdecimal():
                self.toPage.ChangeValue("1")
            self.toPage.Enable()
            if not self.toLeft.Value.isdecimal():
                self.toLeft.ChangeValue("0")
            self.toLeft.Enable()
            if not self.toHeight.Value.isdecimal():
                self.toHeight.ChangeValue("0")
            self.toHeight.Enable()
            lnk["page"] = int(self.toPage.Value) - 1
            lnk["to"] = fitz.Point(int(self.toLeft.Value),
                                   int(self.toHeight.Value))

        elif lt == fitz.LINK_GOTOR:
            if not self.toFile.Value:
                self.toFile.SetValue(self.text_in_rect())
                self.toFile.MarkDirty()
            if not self.toPage.Value.isdecimal():
                self.toPage.ChangeValue("1")
            if not self.toLeft.Value.isdecimal():
                self.toLeft.ChangeValue("0")
            if not self.toHeight.Value.isdecimal():
                self.toHeight.ChangeValue("0")
            self.toLeft.Enable()
            self.toPage.Enable()
            self.toFile.Enable()
            self.toHeight.Enable()
            lnk["file"] = self.toFile.Value
            lnk["page"] = int(self.toPage.Value) - 1
            lnk["to"] = fitz.Point(int(self.toLeft.Value),
                                   int(self.toHeight.Value))
            
        elif lt == fitz.LINK_URI:
            if not self.toURI.Value:
                self.toURI.SetValue(self.text_in_rect())
                self.toURI.MarkDirty()
            lnk["uri"] = self.toURI.Value
            self.toURI.Enable()
            
        elif lt == fitz.LINK_LAUNCH:
            if not self.toFile.Value:
                self.toFile.SetValue(self.text_in_rect())
                self.toFile.MarkDirty()
            lnk["file"] = self.toFile.Value
            self.toFile.Enable()
            
        elif lt == fitz.LINK_NAMED:
            self.toName.SetSelection(0)
            self.toName.Enable()
            
        self.page_links[self.current_idx] = lnk
            
        evt.Skip()
        return
User changed link kind, so prepare available fields.