Bolding certain characters in a CCombobox entry (C++, MFC) - c++

I have a CComboBox containing strings of serial numbers. I want to be able to bold individual characters in the string. Like for instance, I would like to be able to make the second string 87650123 show up as 87650123.
I have seen some posts about bolding a whole individual string entry in a CCombobox, but not individual characters. Would this be possible? Thanks in advance.
I have attempted bolding the entire entry to start, which was successful, but have not been able to do individual characters.

Related

Does Taifun's sortable listview trim spaces

I am using the sortable list view by #Taifun in one of my apps, and I am trying to debug a problem with the values that I get from the list.
The user adds items to the list and then they are saved to a custom tinyWebDB.
My question is this- Does the sortable list remove leading or trailing spaces either when loading the list or when getting the value back out? If so, is there any way to disable or fix this behavior?
I can't figure out why the values my app is storing are wrong, and I can't see whether the items have trailing spaces just from looking at the list view.
If it isn't the list view, it might be the way I am sorting the items.
As I wrote in the comment above, I wrote a procedure to replace the leading and trailing spaces with ^ in the list view and convert them back when saving.
Here is a link to the aia file.
The aia is set up for what I was using it for- displaying two lists side by side. I did this by adding a dash "‒" between the items of each list. If you are not using the list in this way, you only need to copy the two procedures that are shown below.
This procedure replaces leading and trailing spaces with the ^ mark by checking if the first or last characters are spaces. If the string is longer than 2 characters, those are put in the middle without changing.
This procedure does the opposite and converts the ^'s that are in the first and last characters back into spaces.

ICU Layout sample renders text differently than Microsoft Notepad and Word

I have a bidirectional text
1002 -ابو ماجد الانصاري
Most editors notepad++, notepad etc. show the text as it is shown here. But when I get this text processed through ICU the number is shifted to the right then spaces and hyphen and then Arabic. ICU's sample application layout.exe also shows the number on the right.
I have modified paragraphlayout.cpp and set all possible reordering modes but result is still the same:
Can someone help to configure ICU to provide output as other display engines do.
If I understand correctly, your text 'begins' with the numeric, which is followed by the hyphen and text. Notepad and other editors let you choose the 'writing direction'. If you choose right-to-left, you get the same result as your screenshot,
If you want to maintain left-to-right writing direction, you can set it explicitly
ubidi_setPara(para, "1002 -ابو ماجد الانصاري", ‭25, UBIDI_LTR, NULL, pErrorCode);
or you can embed a UNICODE flag U+202A (LEFT-TO-RIGHT EMBEDDING) into your string that will enforce this direction. If your code is in C++, you can write something like
icu::UnicodeString string_to_layout = "\x202a";
string_to_layout += "1002 -ابو ماجد الانصاري";
and not you can use string_to_layout as input parameter for renderParagraph() (see http://icu-project.org/apiref/icu4c-latest/ubidi_8h.htm).

(VBS) Make a list of multiple selection entries

I have a text in Word and I select some words from it using Ctrl+Click, then after the paragraph I make a numerated list of those selected words. It looks like this
I was wondering if it was possible to use VBS to create a macros, which would put a number after selected words and make a list of them afterwards. So far I have only managed to do something like this:
Sub MakeAList()
With Selection
.Copy
.MoveDown Unit:=wdParagraph, Count:=1
.TypeParagraph
.Paste
End With
End Sub
It copies the selected words and makes each one a paragraph right after the main one. I still make a list and put (*) after the word in the original text.
To clear up any confusion, the language is Chinese, and the words are not separated by spaces, but I'll try to use the "Split". What's important is when I select several words, let's say for 2-character words, the programm shows that I have selected 8 words (4*2), but 4 lines, even if those words are in the same line. So I think I shouls experiment with the line counter, if there is any.

C++ - Displaying and Storing Japanese Characters

So, I'm attempting to use C++ and Windows Forms to create an application that will help me study Japanese (for now, Hiragana and possibly Katakana only). The aim is to be able to create a program that has the user select the character sets they want to use (A through O, KA through KO, etc.), and either view the cards freely or have the program test them over the characters. For debugging purposes, I currently have the View button set to output 5 values to 5 different text boxes - the Roman pronunciation, the corresponding character, its position in an array in which all of the characters are stored, and a Boolean value.
My problem lies in the fact that the characters all show up as "?", and I get multiple warnings when I compile. An example of this warning:
1>c:\users\cameron\documents\visual studio 2010\projects\japanesecards\japanesecards\Form1.h(218): warning C4566: character represented by universal-character-name '\u3093' cannot be represented in the current code page (1252)
This shows up 46 times, 1 for each Japanese character in the array. The array's declaration line is,
std::string hiraList[5][11][2];
An example of inserting a Romanji-Hiragana pair is,
hiraCheck[0][0][0] = "A";
hiraCheck[0][0][1] = "あ";
Finally, the Hiragana is being inserted into a text box using the following code:
System::String^ displayText = gcnew String(hiraList[x][y][1].c_str());
textBox5 -> Text = displayText;
Basically, given all of this, my question is - How can I get my form to display Japanese characters properly in a text box?
Okay! I've done a bit of tweaking and experimenting with wchar_t, and I've found out a solution.
First, I reduced the hiraList array to a two-dimensional array, and moved the Hiragana characters into their own, array, defined like so:
wchar_t hiraChar[5][11];
And added values like so:
hiraChar[0][0] = L'あ';
Then, I went down to the code for the 'View' button and made a few changes:
Deleted the method for declaring and filling the displayText variable
Updated the line of code which assigns textBox5 its text value to read from hiraChar[x][y]
A line of the new code has been pasted below:
textBox5 -> Text = hiraChar[x][y].ToString();
In essence, the program now creates three variables for Hiragana - One to monitor check boxes, one to store the romanji values, and one to store Hiragana characters. When at least one check box is selected, and the View button pressed, five things are outputted to text boxes - the character, its position in the array (x and y are separate boxes), its romanji equivalent, and a 'True' value which was used earlier in development for debugging purposes.

How to convert escape codes in a wxString

I'm using a wxWebView to retrieve the displayed contents of a webpage (using GetPageText( )). This returns me a wxString.
This wxString contains a lot of text, including names, such as D\u00e1vid K\u00e1m\u00e1n (instead of Dávid Káán)
I then process the string, split it into its various components, and display some of the values (& names) in a wxGrid.
What I am looking for is a way to convert the wxString containing the escape coded characters into a wxString that will contain the actual characters so that I can display the correct output in the wxGrid.
I can't see any obvious method available though...
One obvious method could be to use regular expressions to find these places, and replace them with the actual letter. Do it in a loop until no matches are found.