how can i hide TRibbon pages? - delphi

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;

Related

Avoid checkbox captions from wrapping in Windows Vista dialogs

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:

Teechart Data Editing disable

Can anyone let me know how we can restrict the user to change the data for for series or whether we can disable it.
Thanks
Akshay
Given such a generic answer and not knowing the nature of your applications we can't provide a specific answer. However, as a general rule of thumb, don't grant users access to the chart editor nor any functionality that would allow them to use data.
Also, this has been implemented for next TeeChart VCL/FMX release: http://bugs.teechart.net/show_bug.cgi?id=484#c1
This hasn't been implemented for the ActiveX version though now, build 2014.0.0.1 from 19th June. We will add it for the next maintenance release. It should be something like this:
TeeEditor1.Options.DataEditing = False
Other Current alternatives are:
You can use the ChartGrid component and set it to read-only: ChartGrid1.ReadOnly = True
Hiding Data tab in TeeEditor: TeeEditor1.ShowPages.SeriesData = False

Fastreport VCL Setting header visibility on odd pages

In fastreport VCL 4 is there a way to set headers visibility only on odd pages of report? Found no answer on google, neither on fastreport's site, documentation & forum.
You do it in code. In your page object's OnBeforePrint event, you put some code sort of like this:
procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);
begin
PageHeader1.Visible := (Frac(<Page#> / 2) > 0.01)
end;
Maybe there is an easier way to figure out whether you are on an odd page or not, but I resorted to the Frac function because they don't have a Mod function. In practice, I would probably add that function within my own code and make it accessible within the report.

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,

Resources