@@ -45,8 +45,8 @@ TFrmAbout = class(TfpgForm)
4545 txtFpgAuthors: TfpgPanel;
4646 lblFpgLicense: TfpgPanel;
4747 txtFpgLicense: TfpgPanel;
48- lblHomeDir : TfpgPanel;
49- txtHomeDir : TfpgPanel;
48+ lblUnicodeFormat : TfpgPanel;
49+ txtUnicodeConfig : TfpgPanel;
5050 lblConfigDir: TfpgPanel;
5151 txtConfigDir: TfpgPanel;
5252 lblEntities: TfpgPanel;
@@ -59,11 +59,12 @@ TFrmAbout = class(TfpgForm)
5959 constructor Create(AOwner: TComponent); override;
6060 destructor Destroy; override;
6161 procedure AfterCreate ; override;
62- published
6362 procedure DoOnShow ({ %H-} Sender: TObject);
63+ published
6464 procedure FormClose ({ %H-} Sender: TObject);
6565 procedure GoToChangelog ({ %H-} Sender: TObject);
6666 procedure GoToEntities ({ %H-} Sender: TObject);
67+ procedure ShowConfigForm ({ %H-} Sender: TObject);
6768 procedure FollowPath (Sender: TObject);
6869 procedure ShowLink (Sender: TObject);
6970 procedure RevertCursor (Sender: TObject);
@@ -87,10 +88,10 @@ implementation
8788
8889uses
8990 SysUtils,
90- StrUtils,
9191 Windows,
9292 L_SpecialFolders,
9393 NppPlugin,
94+ ConfigForm,
9495 U_Npp_HTMLTag;
9596
9697constructor TFrmAbout.Create(AOwner: TComponent);
@@ -145,17 +146,19 @@ constructor TFrmAbout.Create(AOwner: TComponent);
145146 txtFpgLicense := MakeText(FpgLicense);
146147 lblSpacer2 := MakeText(' ' , 8 );
147148
148- lblHomeDir := MakeText(' Plugin location' );
149- txtHomeDir := MakeText(UTF8ToAnsi(UTF8Encode(ExtractFileDir(FDLLName))), 24 );
150- WrapFilePath(txtHomeDir);
151-
152149 lblConfigDir := MakeText(' Config location' );
153150 txtConfigDir := MakeText(UTF8ToAnsi(UTF8Encode(Npp.PluginConfigDir)), 24 );
154151 WrapFilePath(txtConfigDir);
155152
156153 lblEntities := MakeText(' HTML entities file' );
157154 txtEntities := MakeText(' ' , 24 );
158155
156+ lblUnicodeFormat := MakeText(' Unicode character format: ' + Npp.Options.UnicodePrefix + ' 0000' );
157+ txtUnicodeConfig := MakeText(' Configure' , 24 );
158+ SetUrl(txtUnicodeConfig);
159+ txtUnicodeConfig.Onclick := ShowConfigForm;
160+ txtUnicodeConfig.FontDesc := FPG_DEFAULT_FONT_DESC;
161+
159162 btnSpacer := MakeText(' ' , 12 );
160163
161164 btnClose := CreateButton(self, 0 , 0 , BtnWidth, ' OK' , FormClose);
@@ -226,9 +229,25 @@ procedure TFrmAbout.GoToEntities({%H-}Sender: TObject);
226229 Close;
227230end ;
228231
232+ procedure TFrmAbout.ShowConfigForm ({ %H-} Sender: TObject);
233+ var
234+ Frm : TFrmConfig;
235+ Current: ShortString;
236+ begin
237+ Current := Npp.Options.UnicodePrefix;
238+ try
239+ fpgApplication.CreateForm(TFrmConfig, Frm);
240+ if (Frm.ShowModal = mrOK) then
241+ lblUnicodeFormat.Text := LeftStr(lblUnicodeFormat.Text, 25 ) +
242+ StringReplace(Copy(lblUnicodeFormat.Text, 26 , MaxInt), Current, Npp.Options.UnicodePrefix, []);
243+ finally
244+ FreeAndNil(Frm);
245+ end ;
246+ end ;
247+
229248procedure TFrmAbout.FollowPath (Sender: TObject);
230249begin
231- Npp.ShellExecute(PChar(ReplaceStr (TfpgPanel(Sender).Hint, NewLine, ' ' )));
250+ Npp.ShellExecute(PChar(StringReplace (TfpgPanel(Sender).Hint, NewLine, ' ' , [] )));
232251 Close;
233252end ;
234253
@@ -249,7 +268,7 @@ procedure TFrmAbout.RevertCursor(Sender: TObject);
249268 TfpgPanel(Sender).TextColor := fpgColor($0 , $BF, $FF)
250269else
251270 TfpgPanel(Sender).TextColor := clHyperLink;
252- TfpgPanel(Sender).FontDesc := ReplaceStr (TfpgPanel(Sender).FontDesc, ' :Underline' , ' ' );
271+ TfpgPanel(Sender).FontDesc := StringReplace (TfpgPanel(Sender).FontDesc, ' :Underline' , ' ' , [] );
253272end ;
254273
255274function TFrmAbout.MakeText (const Txt: string; const Height: TfpgCoord): TfpgPanel;
@@ -288,7 +307,7 @@ procedure TFrmAbout.SetConfigFilePath(Path: TfpgPanel);
288307 else
289308 begin
290309 Text := ' Not found' ;
291- FontDesc := ReplaceStr (FontDesc, ' :Underline' , ' ' );
310+ FontDesc := StringReplace (FontDesc, ' :Underline' , ' ' , [] );
292311 if Npp.DarkModeEnabled then
293312 TextColor := fpgColor($FF, $63 , $47 )
294313 else
@@ -333,7 +352,7 @@ procedure TFrmAbout.WrapFilePath(Path: TfpgPanel);
333352 end
334353 else
335354 begin
336- WrapAt := Round (BtnWidth * 0.8 ) ;
355+ WrapAt := (BtnWidth div 10 )* 9 ;
337356 if (OS > WV_WIN10) then
338357 LineSpc := 8
339358 else
@@ -374,8 +393,8 @@ procedure TFrmAbout.SetDefaultStyles;
374393 lblFpgLicense.TextColor := clBlack;
375394 txtFpgAuthors.TextColor := clBlack;
376395 txtFpgLicense.TextColor := clBlack;
377- lblHomeDir .TextColor := clBlack;
378- txtHomeDir .TextColor := clBlack ;
396+ lblUnicodeFormat .TextColor := clBlack;
397+ txtUnicodeConfig .TextColor := clHyperLink ;
379398 lblConfigDir.TextColor := clBlack;
380399 txtConfigDir.TextColor := clBlack;
381400 lblEntities.TextColor := clBlack;
@@ -399,8 +418,8 @@ procedure TFrmAbout.SetDarkStyles;
399418 lblFpgLicense.TextColor := clWhite;
400419 txtFpgAuthors.TextColor := clWhite;
401420 txtFpgLicense.TextColor := clWhite;
402- lblHomeDir .TextColor := clWhite;
403- txtHomeDir .TextColor := clWhite ;
421+ lblUnicodeFormat .TextColor := clWhite;
422+ txtUnicodeConfig .TextColor := fpgColor($ 0 , $BF, $FF) ;
404423 lblConfigDir.TextColor := clWhite;
405424 txtConfigDir.TextColor := clWhite;
406425 lblEntities.TextColor := clWhite;
0 commit comments