Unable to get ampersand (&) to display in a Delphi TActionMainMenuBar - delphi

I am in need of help trying to get the ampersand character to show up in a Delphi XE6 VCL TActionMainMenuBar. I have come across similar requests on Stack Overflow but none that directly address the problem I am having.
When creating an action in the TActionManager, I need the caption of an action to read Network & Database. I have tried using two ampersands in the caption Network && Database to escape the accelerator which did not work. When I included two ampersands, I ended up with Network _Database (See Screenshot1). I have also set the property of ActionBar > Items > AutoHotKeys to false and ActionMainMenuBar > PersistentHotKeys to false. Doing so did not rectify the my issue.
The one thing I did try out of pure desperation that I thought fixed it was to include four ampersands Network &&&& Database which when ran showed up as Network & Database (See Screenshot2). However during testing, if I were to press Alt to turn on hotkeys and navigate into the menu, the caption of the action would read Network && Database. I tried to include a screenshot of this however since I have less than 10 reputation points Stack Overflow limits my post to two attachments.
If anyone can point me in the right direction of if I have left out some information please let me know. I've run out of ideas on how to fix this and I cannot come across anything similar when searching Google. Thanks in advance for the help.

You can fix it on your form's onshow event
action3.caption := 'Network &&Database';

Related

How to copy class and function name in Blackfire report

When I am copy-pasting method name from Blackfire profile, I am getting a reversed string like this:
sgnitsiLredivorPdaol::yrotisopeRresopmoC\yrotisopeR\resopmoC
What is intended way to copy a proper method name (not reversed)?
Why does Blackfire has such behaviour? Is this some kind of stupid joke or copy-paste protection?
This is indeed a UX issue we currently have in Blackfire, let me explain it to you:
We want to display the end of the namespace/classname value in this part of the interface
We want to have a text-overflow ellipsis on the left part of the value.
Unfortunately, using text-overflow: ellipsis on the left of the text is not supported by modern browsers at the moment.
There are two ways to do that: Either know the width of the text, work with a fixed width column and truncate programmatically or use a hack, revert the letters, change the text direction from left-to-right to right-to-left locally and use traditional text-overflow.
As we deal with a resizable UI here, we chose the second option, and this is the one that provide the better experience at the moment. However, as you notice, this issue remains.
We're thinking about a fix for this issue. It might be with the Clipboard API.
In the meantime, here's the way you can copy/paste the value :
Just expand a node and copy from the inner box, see:
Hope it helps you until we find a better solution.

How do i change the value of ItemHeader.Text in ListView while using LiveBinding

I've been stuck on this problem for a while now. I have a ListView that's filled via a RESTclient etc. i get categories from the server that go from 0 to 15 and i want to rename the 0 to Test. I know this is easely solvable by just changing it server side but i want to try and fix this on client side so i learn more about delphi.
The problem mostly is getting the specific value out of an event. i can get the value from OnAssigningValue but its all dumped in variable and i have 2 .Text values linked to the listview so i can't go that way either.
i can't find any solution across the interwebs, any help would be appriciated

Virtual TreeView hint not showing

I have set ShowHint to true and HintMode to hmToolTip, but my OnGetHint() event handler doesn't even breakpoint when I hover the cursor over the control.
Any idea what I am doing wrong?
.
Additionally, does anyone have any hints as to good documentation, tutorials, etc? For instance, where do I find out what the various values of the HintMode property actually mean?
The documentation on the website is extremely incomplete, the phrase "Use other resources like the news group or the Delphi Gems message board to find a description" occurs 789 times in the HMTL help - generally where I really need help :-/
[Update] In fact, I'd be willing to use another component, even one less pwerful, if it were documented.
Thanks !
The source code is your best friend with VirtualTree...
TVTHintMode = (
hmDefault, // show the hint of the control
hmHint, // show node specific hint string returned by the application
hmHintAndDefault, // same as hmHint but show the control's hint if no node is concerned
hmTooltip // show the text of the node if it isn't already fully shown
);
I usually use these options to display the hint text of the node
ShowHint := True;
HintAnimation := hatFade;
HintMode := hmHint;
hmTooltip is using the text of the node so it may not call the OnGetHint in that case.

Intraweb question about improperly working (radiobutton)?

HI,
I created 4 radiobuttons in a intraweb application.
One is checked by default, the rest is not.
The belong to the same group called group. (I set the group properly of each TIWradiobutton)
There is twiimage image which has click event. In that click event, I tried to set the radiobuttons.
E.g.
radiobutton1.checked:=true;
The problem is that this sometimes set the radiobutton and sometimes it does not.
I found a fix by setting the rest of radiobuttons.checked to false. That fixed the problem.
I wonder what I did wrong in the first place when I just used one assignment.
Can you tell me if it is a bug in intraweb or I used radiobutton improperly?
Thanks.
just create a IWRadioGroup1(in iwstanderd pallet ) in your form
select IWRadioGroup1 , in the properties panenel dblclick on items
you will get a stringlist editor ,type the captions of your four radiobuttons line by line then click OK
now select your IWImage1 ,goto click events just type th above code
procedure TformMain.IWImage1Click(Sender: TObject);
begin
IWRadioGroup1.ItemIndex := 2 // 2 is the radiobutton number as you typed in stringlist editor
end;
sometimes IW or components build over the IW (e.g TMS suite for IW) have a strange behavior.you can find how it works by looking out in the code, how they manage the java script behind your radio groups.
Also sometimes you must manage the components exactly how Atozed say in their documentation.
Probably isn't the best answer, but if you'll work a lot with IW you'll see that it has a lots of limitations and strange behavior (only if you don't work in their style, which sometimes differs a lot from win32 style).
best regards,

special character coming when i am using & and p

I dont know what exactly i have to type in title for this ,i tried my best
anyway coming to topic
I am making one acc checker for that purpose ,i am sending user and pass from my bsskinedit1 and bsskinedit2
here is my code
s:='http:\\site.com..premlogin='+bsskinedit.text+'&password='+bsskinedit2.text
but it giving some error ,then i used showmessage whats wrong with it then i came with strange result
see below
observer after 4 & and p combining together and appearing as a some new symbol :(
can any one tell me why its coming like this ?
Your code (where you build the URL) is most likely correct (I guess the above has some typos?!), but when you display the URL in a label for instance, the & character is treated as indicator for an accelerator key.
By Windows design, accelerator keys
enable the user to access a menu
command from the keyboard by pressing
Alt along the appropriate letter,
indicated in your code by the
preceding ampersand (&). The character
after the and sign (&) appears
underlined in the menu.
If you want to display the & character itself, you have to set your string variable to &&.
By placing two ampesands together - you state that the character following the first one is not used as the accelerator - rather you actually want to get it (only one) displayed.
Just use your debugger if you want to see the real value that your string variables have, don't output them to a message box or the like... It may have side effects, as you can see.
Regarding the URL you build: I can't possibly know how it has to be correctly, but at least you should use the right slashes!
s := 'http://site.com...'
(All quotes from delphi.about.com)
In addition to what Mef said, you can use OutputDebugString to add your string to the event log in its raw form, so you don't need to modify it before displaying it. Delphi should capture those strings automatically if you're running from the debugger. If you aren't running it from Delphi you can use DebugView instead, which captures the messages from any running applications.

Resources