def on_linkType_changed(self, evt):
if self.current_idx < <NUM_LIT:0>:<EOL><INDENT>evt.Skip()<EOL>return<EOL><DEDENT>n = self.linkType.GetSelection()<EOL>lt_str = self.linkType.GetString(n)<EOL>lt = self.link_code[lt_str]<EOL>self.prep_link_details(lt)<EOL>lnk = self.page_links[self.current_idx]<EOL>lnk["<STR_LIT>"] = True<EOL>lnk["<STR_LIT>"] = lt<EOL>self.enable_update()<EOL>if lt == fitz.LINK_GOTO:<EOL><INDENT>if not self.toPage.Value.isdecimal():<EOL><INDENT>self.toPage.ChangeValue("<STR_LIT:1>")<EOL><DEDENT>self.toPage.Enable()<EOL>if not self.toLeft.Value.isdecimal():<EOL><INDENT>self.toLeft.ChangeValue("<STR_LIT:0>")<EOL><DEDENT>self.toLeft.Enable()<EOL>if not self.toHeight.Value.isdecimal():<EOL><INDENT>self.toHeight.ChangeValue("<STR_LIT:0>")<EOL><DEDENT>self.toHeight.Enable()<EOL>lnk["<STR_LIT>"] = int(self.toPage.Value) - <NUM_LIT:1><EOL>lnk["<STR_LIT:to>"] = fitz.Point(int(self.toLeft.Value),<EOL>int(self.toHeight.Value))<EOL><DEDENT>elif lt == fitz.LINK_GOTOR:<EOL><INDENT>if not self.toFile.Value:<EOL><INDENT>self.toFile.SetValue(self.text_in_rect())<EOL>self.toFile.MarkDirty()<EOL><DEDENT>if not self.toPage.Value.isdecimal():<EOL><INDENT>self.toPage.ChangeValue("<STR_LIT:1>")<EOL><DEDENT>if not self.toLeft.Value.isdecimal():<EOL><INDENT>self.toLeft.ChangeValue("<STR_LIT:0>")<EOL><DEDENT>if not self.toHeight.Value.isdecimal():<EOL><INDENT>self.toHeight.ChangeValue("<STR_LIT:0>")<EOL><DEDENT>self.toLeft.Enable()<EOL>self.toPage.Enable()<EOL>self.toFile.Enable()<EOL>self.toHeight.Enable()<EOL>lnk["<STR_LIT:file>"] = self.toFile.Value<EOL>lnk["<STR_LIT>"] = int(self.toPage.Value) - <NUM_LIT:1><EOL>lnk["<STR_LIT:to>"] = fitz.Point(int(self.toLeft.Value),<EOL>int(self.toHeight.Value))<EOL><DEDENT>elif lt == fitz.LINK_URI:<EOL><INDENT>if not self.toURI.Value:<EOL><INDENT>self.toURI.SetValue(self.text_in_rect())<EOL>self.toURI.MarkDirty()<EOL><DEDENT>lnk["<STR_LIT>"] = self.toURI.Value<EOL>self.toURI.Enable()<EOL><DEDENT>elif lt == fitz.LINK_LAUNCH:<EOL><INDENT>if not self.toFile.Value:<EOL><INDENT>self.toFile.SetValue(self.text_in_rect())<EOL>self.toFile.MarkDirty()<EOL><DEDENT>lnk["<STR_LIT:file>"] = self.toFile.Value<EOL>self.toFile.Enable()<EOL><DEDENT>elif lt == fitz.LINK_NAMED:<EOL><INDENT>self.toName.SetSelection(<NUM_LIT:0>)<EOL>self.toName.Enable()<EOL><DEDENT>self.page_links[self.current_idx] = lnk<EOL>evt.Skip()<EOL>return<EOL>
User changed link kind, so prepare available fields.