@@ -65,6 +65,15 @@ TArrayView<FUnicodeBlockRange const> UnicodeBrowser::GetUnicodeBlockRanges()
65
65
return BlockRange;
66
66
}
67
67
68
+ int32 UnicodeBrowser::GetRangeIndex (EUnicodeBlockRange BlockRange)
69
+ {
70
+ return GetUnicodeBlockRanges ().IndexOfByPredicate (
71
+ [BlockRange](FUnicodeBlockRange const & Range)
72
+ {
73
+ return Range.Index == BlockRange;
74
+ }
75
+ );
76
+ }
68
77
69
78
TSharedPtr<SUbCheckBoxList> SUnicodeBrowserWidget::MakeRangeSelector ()
70
79
{
@@ -108,7 +117,7 @@ FReply SUnicodeBrowserWidget::OnCharacterMouseMove(FGeometry const& Geometry, FP
108
117
if (CurrentRow == Row) return FReply::Unhandled ();
109
118
CurrentRow = Row;
110
119
CurrentCharacterView->SetText (FText::FromString (CurrentRow->Character ));
111
- CurrentCharacterView->SetToolTipText (FText::FromString (FString::Printf (TEXT (" Char Code: 0x% 04X. Double-Click to copy: %s." ), CurrentRow->Codepoint , *CurrentRow->Character )));
120
+ CurrentCharacterView->SetToolTipText (FText::FromString (FString::Printf (TEXT (" Char Code: U+%-06. 04X. Double-Click to copy: %s." ), CurrentRow->Codepoint , *CurrentRow->Character )));
112
121
return FReply::Handled ();
113
122
}
114
123
@@ -161,7 +170,7 @@ void SUnicodeBrowserWidget::RebuildGridColumns(FUnicodeBlockRange const Range, T
161
170
.Font (this , &SUnicodeBrowserWidget::GetFont)
162
171
.Justification (ETextJustify::Center)
163
172
.IsEnabled (true )
164
- .ToolTipText (FText::FromString (FString::Printf (TEXT (" Char Code: 0x% 04X. Double-Click to copy: %s." ), Row->Codepoint , *Row->Character )))
173
+ .ToolTipText (FText::FromString (FString::Printf (TEXT (" Char Code: U+%-06. 04X. Double-Click to copy: %s." ), Row->Codepoint , *Row->Character )))
165
174
.Text (FText::FromString (FString::Printf (TEXT (" %s" ), *Row->Character )))
166
175
];
167
176
@@ -306,7 +315,7 @@ void SUnicodeBrowserWidget::Construct(FArguments const& InArgs)
306
315
.Font (this , &SUnicodeBrowserWidget::GetFont)
307
316
.Justification (ETextJustify::Center)
308
317
.IsEnabled (true )
309
- .ToolTipText (FText::FromString (FString::Printf (TEXT (" Char Code: % 04X. Double-Click to copy: %s." ), CurrentRow->Codepoint , *CurrentRow->Character )))
318
+ .ToolTipText (FText::FromString (FString::Printf (TEXT (" Char Code: U+%-06. 04X. Double-Click to copy: %s." ), CurrentRow->Codepoint , *CurrentRow->Character )))
310
319
.Text (FText::FromString (FString::Printf (TEXT (" %s" ), *CurrentRow->Character )))
311
320
]
312
321
]
@@ -474,10 +483,6 @@ FString SUnicodeBrowserWidget::GetUnicodeCharacterName(int32 const CharCode)
474
483
{
475
484
UChar32 const uChar = static_cast <UChar32>(CharCode);
476
485
UErrorCode errorCode = U_ZERO_ERROR;
477
- // uint32 bufferSize = 256;
478
- // char *name= (char *)uprv_malloc(bufferSize*sizeof(char));
479
- // (char *)uprv_malloc(bufferSize*sizeof(char));
480
- // char name[256];
481
486
char * name = new char [256 ];
482
487
483
488
// Get the Unicode character name using ICU
0 commit comments