Aligning left and right on the same line in WordPad - wordpad

Is it possible to align texts left and right on the same line in WordPad? For example, I want my name to the left and the date to the right. Both on the same line. How can I do this?

While WordPad does not allow you to modify the alignment of tab stops the RTF format supports tab stops with alignments and WordPad can display and edit documents containing such tab stops, for example when you create them in Microsoft Word and save as RTF.
If you don't have access to Microsoft Word you can create the tab stops in WordPad, save the file as RTF, then open it with a text editor and modify the tab stop definitions you are interested in.
Here is an example:
I created a simple RTF document in WordPad which contains the text Left<tab>Middle<tab>Right and created two tab stops. I want the first tab stop to align centered and the second tab stop to align right.
Then I save the document in RTF format on my desktop and open it in notepad. It looks like this:
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Riched20 10.0.14393}\viewkind4\uc1
\pard\sa200\sl276\slmult1\tx3976\tx7242\f0\fs22\lang7 Left\tab Middle\tab Right\par
}
Notice the \tx3976 and \tx7242 commands which define the tab stop positions (generally you look for \tx followed by some number).
Now you can insert the \tqc command for center-aligned tabstops or the \tqr command for right-aligned tabstops. You enter that command in front of the \tx command you want to modify. The RTF document now looks like this:
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Riched20 10.0.14393}\viewkind4\uc1
\pard\sa200\sl276\slmult1\tqc\tx3976\tqr\tx7242\f0\fs22\lang7 Left\tab Middle\tab Right\par
}
Now you can save the document and exit notepad, when you reopen the file in WordPad you should see it displaying with the correct tab stop alignments. It is also possible to move the tab stops around in WordPad without losing the alignments.
Tested on Windows 10 but it probably will work on earlier versions of WordPad since the required commands are not exactly new.

It's not possible using proper formatting.
For example, in Microsoft Word/LibreOffice Writer you'd use left- and right-aligning tabs, as demonstrated in this howto for Word. However, WordPad only has left-aligning tabs.
It is possible to fake it, as it was done in the old days (and still now, by those who don't know better), by clever usage of spaces (or a mix of spaces and tab stops).

Related

Issue with Delphi Menu

I am Using RAD Studio 2010 and I have problem in Menu text
There are Z and Y texts in my menu and I want to remove it
This will happen when I use Non English text
This is because of TMainMenu.AutoHotkeys. By default, the value of this property is maAutomatic, which means that the menu will automatically choose accelerator keys for your menu items.
For instance, in a typical English application, you might get a menu like this:
Notice the underlined characters. These are used to access the menu using the keyboard. For instance, to open the File menu, I can press Alt+F. And once the File menu is open, I can press the key corresponding to the underlined character in the caption of the menu item I wish to invoke.
For keyboard users like myself, such accelerators are extremely important. I use them all the time. I could use the mouse instead, but that would slow me down tremendously. (For instance, in the application in the screenshot, I am very used to press Alt+E, O to open the Sort Lines dialog box. That takes about 0.2 seconds. If I had to use the mouse, it would take much longer!)
Now, in your case, there aren't any Latin letters to underline, so instead the RTL adds these parentheses (with the Latin letter being the accelerator), so you still can access the menus using the keyboard.
I have very little experience with non-Latin-based versions of Windows, but I do believe menus like these are standard. If I were a Chinese or Arabic user (for instance), I think I would refuse to use an application without these. If I cannot access GUI menus and controls with the keyboard, I get really annoyed.
Still, if you insist, you can set AutoHotkeys to maManual.

Is it possible to move single open file between panes in VS Code?

I want to have the openned in VSCode file moved from one pane to another. Just like in Sublime ctrl+shift+1 / ctrl+shift+2. What command is in charge of this?
split editor vertically (the second pane is empty), I do this by workbench.action.editoLayoutTwoColumns
move current open file from the first pane to the second
Open the command palette and search for View: Move Editor into to bring up related commands. In this case, you might be specifically looking for the following:
Command
Move Editor into Next Group
Shortcuts
Mac: ctrl+cmd+right
Windows/Linux: ctrl+alt+right).

How to mass convert all spaces to tabs in Xilinx Vivado

How do you convert an entire HDL file from spaces to tabs in Xilinx Vivado?
I've given my own answer below but won't vote on it one way or the other.
Is there a better way that anyone knows?
To convert an entire HDL module in Vivado from spaces to tabs:
Set the environment to use the tab character when the tab key is struck (in lieu of four spaces).
Indent the entire HDL file in the text editor by highlighting everything and pressing the Tab key.
De-indent the entire HDL file by highlighting everything and pressing Shift-Tab.
To change to Tab mode in the first place, select the Tools->Settings menu.
On the left side of the settings window that shows up, under Tool Settings, click the carrot next to the Text Editor to reveal the options. Then click on the Tabs label to reveal the Tab options panel.
Check the box that says "Use Tabs Character".

code that does what the home button is supposed to do in a line of text

I have an arabic line with english letters in it.
Ex: أنا في abcd البيت
I opened notepad. I started writing.
What I wanted to write is I'm at abcd home but what you see now (left to right) is at I'm abcd home
To fix this, I click anywhere on that line. I press the HOME button. You'll see the cursor moving to the beginning of the arabic word that to the left of the english word. I right click, choose INSERT UNICODE CONTROL CHARACTER then I choose RLE.
When i do that, the reads I'm at abcd home. It's fixed.
If you right click again and choose SHOW UNICODE CONTROL CHARACTER. you'll see that the very first "character" is the unicode character I inserted.
I wish to automate this process.
How do I do that? :D
I can tell you that RLE is represented as \u202B
Thanx
There's no very easy way to automate the process, but there are a couple of things that you can try:
Press Ctrl-Shift on the right-hand side of your keyboard. This will work in Notepad and in many other programs on Windows: Word, Internet Explorer, Google Chrome. It may work in Firefox, too, but if it doesn't, use Ctrl-Shift-X to set right-to-left direction in Firefox. Note that this will correct the display of the text and the cursor movement for you while you are writing it, but not necessarily for the people to whom you send this text.
Use the Microsoft Keyboard Layout Creator to add the RLE character to your keyboard. This program will let you create a new keyboard layout that you will be able to use in all the programs. Load the keyboard layout that you are currently using, find a key that is not assigned to any character and assign the RLE to it. Note that if you use RLE, you must also use the PDF character (U+202C) in the end of the right-to-left text, so assign this to some key, too (this is similar to writing <span dir="rtl">أنا في abcd البيت<span> in HTML—you must use the closing tag). This will fix your text, although it's tricky. Also, note that some websites remove characters like RLE when you try to post on them - Facebook and Twitter do this, for example.
Finally, note that this problem is unique to plain text. If you use a real word processor, like MS-Word or LibreOffice, or write your text as HTML with proper dir attributes, then it's a lot easier, but you'll have to store and send your text in these formats.

Using Unicode characters with Delphi XE2

I'm looking at converting one of our applications to Delphi XE2 and generally take the opportunity to bring it up to date.
One of the features of the application is a StringGrid that displays a number of check marks in a couple of columns. To achieve this the grid is actually 2 aligned grids - the second of which is setup with the font as Wingdings in order to display the check marks.
Am I wrong in thinking that I should be able to use something like a TListView and use the checkmark char (U+2713) alongside the rest of the text... If so how the heck do I do this?
Do I need to set the font to Wingdings for that column? Does this need to be in OnDraw?
Am I barking up the wrong tree...
File->New->VCL Forms application
In the Component Palette, expand the Win32 tab and choose TListView, and drop it on the form.
Right-click the newly added TreeView1, and choose Items Editor... from the context menu.
Click New Item. Type in any text (for instance x Testing, using the 'x' as a placeholder for now).
Start the Windows Character Map application (Start button, type Chara in the search box, or Start->Programs->Accessories->Character Map). Change the font to Arial Unicode MS, and navigate to the character you want (it's in there).
Click the character, and then the Copy button. Switch back to the IDE, select the x placeholder you put in the edit, and hit Ctrl+V to paste the character you just chose from Character Map. You should now see your check mark (or whatever character you chose), followed by Testing.
(The steps above are the two-minute process I followed to find out how to do this, and that quick experiment showed that you could.)

Resources