Avoid checkbox captions from wrapping in Windows Vista dialogs - delphi

For a software project I need to align two additional personalized checkboxes in a microsoft windows vista dialog. I learned about adding checkboxes using Visual-Components and Visualgroups on a CustomizeInterface in delphi.
My Question: What do I need to do with those checkboxes' captions in order to avoid them from wrapping?
1st solution (showing the checkboxes one next to each other):
Dialog.QueryInterface(IFileDialogCustomize, lCustomizeInterface);
if getCheckBox1Caption <> '' then
lCustomizeInterface.AddCheckButton(DWORD(CheckBox1ID), pWideChar(getCheckBox1Caption), Checked1);
if getCheckBox2Caption <> '' then
lCustomizeInterface.AddCheckButton(DWORD(CheckBox2ID), pWideChar(getCheckBox2Caption), Checked2);
2nd solution (showing the checkboxes one below the other):
Dialog.QueryInterface(IFileDialogCustomize, lCustomizeInterface);
lCustomizeInterface.StartVisualGroup(DWORD(1005), pWideChar('Test'));
if getCheckBox1Caption <> '' then
lCustomizeInterface.AddCheckButton(DWORD(CheckBox1ID), pWideChar(getCheckBox1Caption), Checked1);
if getCheckBox2Caption <> '' then
lCustomizeInterface.AddCheckButton(DWORD(CheckBox2ID), pWideChar(getCheckBox2Caption), Checked2);
lCustomizeInterface.EndVisualGroup;

You cannot avoid them wrapping. The IFileDialogCustomize interface offers no functionality to control layout. The control does all of that.
The best you can do is to use a shorter caption if you wish to avoid wrapping onto multiple lines. Or add some extra spaces to avoid the rather nasty mid-word breaks. For instance if you use this text 'Generate expandable / collapsible Excel export' then the outcome is:

Related

PasswordChar in Delphi XE8's TMemo

I spent a few hours searching Google to see if anyone had shared their articles, but came up empty-handed.
If it's possible, I want to know how to enable/disable the PasswordChar in Delphi XE8's TMemo to hide user input like in TEdit. ? Maybe via a checkbox!
So when the checkbox is checked then all text turned to asterisks, and if the checkbox is unchecked, all text back to normal..
The VCL memo control is a loose wrapper around the Win32 multiline edit. The password character functionality of the edit control is only available for single line edits.
The behaviour is controlled by the ES_PASSWORD style for which the documentation says:
Displays an asterisk (*) for each character typed into the edit control. This style is valid only for single-line edit controls.
The FMX memo control offers no password character functionality for the multiline memo control.
Presumably these frameworks don't offer what you want because passwords are entered in single line edit controls. Developers tend not to provide functionality that has no clear case for being used.
Your options:
Use a single line TEdit.
Write your own multiline memo that supports your desired functionality.
Find a third party multiline memo that supports your desired functionality.
Now, since your question is so general I have assumed that you want full support for single line password character. That is, the user enters text and it appears masked.
But maybe you actually don't need editability. In that case it is simple enough. Do the following:
Load or add the true text into a separate TStringList.
When you want to display the true text assign the string list to the memo.
When you want to hide the content, process the true text into whatever you want to display, and display that.
Make the memo control read only.
if cBoxPassword.checked=false then
edtpassword.PasswordChar:='*';
if cBoxPassword.checked=true then
edtPassword.PasswordChar:=#0;

How can I add text to a work item

We have a few bugs and change requests which have a complicated iteration path. This results in people coming over the team to ask 'Where do we raise items' a lot.
As you can't set a default value for the iteration path in TFS 2010 we think the best solution would be to add a string of text under the field which we can manually update every 7 weeks with the correct area to raise items in.
However TFS doesn't seem to allow just a line of text on its work items as a control. Is there a way to add a line of display text i.e. Not a field you edit, but just to inform those writing the items?
Please note that it needs to be visible at all times, using the tooltip 'help text' field on a control is not enough in this case.
You can use the LabelControl for this purpose.
You can not have a default in the work item for the iteration path, but what you can do is making use or the template url in web access or the work item templates in the power tools to create a work item that is prepopulated with values.
What about a custom field with a display control in read-only? You can give a default value to the field and the "read-only" control prevent other to change it.

How can I setup TListView with CheckBoxes in only certain columns?

I'm using Delphi 2010, and I am trying to allow the user to select between 2 options per row in a TListView. With TListView, I can set the style to vsReport and enable Checkboxes, but that only gets me 1 checkbox per row. What I need is 2 checkboxes per row...specifically 1 for the 1st column and 1 for the 2nd column.
What I am trying to accomplish is very similar to the standard Windows file security dialog:
Does anyone have any suggestions for implementing something like this using TListView or even MustangPeak's TEasyListView?
Take a look at this
Put a TCheckBox inside a TStringGrid in Delphi
update
The link shows how to draw checkboxes. You can do the same using TListView.OnCustomDrawItem and/or OnCustomDrawSubItem events
I use my own modified version of ExGridView by Roman Mochalov, and full sources for my modified version, plus a demo here (open the Demo in the Demo2 folder) showing checkboxes.

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,

how can i hide TRibbon pages?

i'm using delphi 2009's TRibbon component. certain pages are not relevant depending on the application state. how can i hide a TRibbon page?
RibbonPage1.Visible:=false doesn't really hide the page...
is this maybe not allowed by the spec from microsoft?
thank you for you help!
mp
I do not think you can hide the individual ribbon pages, but you can hide or disable the individual RibbonGroups on the each page.
RibbonGroup1.Enabled := false;
RibbonGroup2.Visible := false;
Microsoft Office disables any groups which are not relevant to the current state. Have a look at these articles from the documentation for more help.
Creating an Application that Uses Ribbon Controls
Adding Commands to the Ribbon
You can't do this presently. It is the Tabs (not the Pages) that need to support visibility and they simply do not.
If you try to manipulate the Tabs themselves you will find the code is very dependent on maintaining the linkage between the pages and the tabs to the point of destroying your pages. I don't think there is a good workaround.
Register it as a bug in Quality Central. Support for "Context" aware tabs/pages is definitely something that should be supported. I imagine quite a few others would vote for it.
In fact this is the only hide/show thing that is handled correctly by that piece of borland crap.
MainRibbon.RemoveTab('TabName');
I am now searching how to hide group and individual actions. Visible = false is not ok, try to resize your form smaller and in the collapsed state all is still there.
maybe, try this: RibbonPage1.Free;
Try this: (Delphi XE6)
MainRibbon.Tabs[RibbonPage.Index].Visible := FALSE;
Then you can make it visible again by
MainRibbon.Tabs[RibbonPage.Index].Visible := TRUE;

Resources