Page 1 of 1
TTeeCommander button bitmaps cut
Posted: Wed Nov 26, 2014 10:59 am
by 16561419
Hello,
I am using a TTeeCommander component in an iOS project.
But somehow the buttons/bitmaps are always cut on the bottom of
TeeCommander toolbar, like in the attached screen shot.
- TeeCommander.png (54 KiB) Viewed 19791 times
Is there any way to correctly display these button?
Re: TTeeCommander button bitmaps cut
Posted: Thu Nov 27, 2014 9:01 am
by yeray
Hello,
Have you tried to resize it?
Does it happen in the simulator or only in a real device?
Also note the editor/commander have been designed to help the developer to build and test their applications. These tools aren't designed to be accessed by the final users, so we don't recommend giving access to it.
Re: TTeeCommander button bitmaps cut
Posted: Thu Nov 27, 2014 9:34 am
by 16561419
Hello Yeray,
Yes, I tried to re-size it but it doesn't help. And the display is the same on the simulator too.
What is the recommended way to bind own toolbar buttons to the same functions?
Re: TTeeCommander button bitmaps cut
Posted: Tue Dec 02, 2014 2:24 pm
by 16561419
Hello Yeray,
It would be very nice if there were simply a set of actions available that I could use to link any UI element to those functions that are available on the TTeeCommander toolbar.
Re: TTeeCommander button bitmaps cut
Posted: Wed Dec 03, 2014 1:57 pm
by yeray
Hello,
Here you have what the buttons in the commander actually do:
Code: Select all
procedure TTeeCommander.ButtonNormalClick(Sender: TObject);
var tmp : TCircledSeries;
begin
tmp:=GetCircledSeries(0,0);
if Assigned(tmp) and tmp.Visible then
SetLabelCaption(CaptionPanel(TeeCommanMsg_NormalPieLabel))
else
SetLabelCaption(CaptionPanel(TeeCommanMsg_NormalLabel));
{$IFDEF FMX}
if Assigned(ButtonNormal) then
ButtonNormal.Down:=True;
{$ENDIF}
end;
procedure TTeeCommander.ButtonRotateClick(Sender: TObject);
begin
SetLabelCaption(CaptionPanel(TeeCommanMsg_RotateLabel));
{$IFDEF FMX}
if Assigned(ButtonRotate) then
ButtonRotate.Down:=True;
{$ENDIF}
end;
procedure TTeeCommander.ButtonMoveClick(Sender: TObject);
begin
SetLabelCaption(CaptionPanel(TeeCommanMsg_MoveLabel));
{$IFDEF FMX}
if Assigned(ButtonMove) then
ButtonMove.Down:=True;
{$ENDIF}
end;
procedure TTeeCommander.ButtonZoomClick(Sender: TObject);
begin
SetLabelCaption(CaptionPanel(TeeCommanMsg_ZoomLabel));
{$IFDEF FMX}
if Assigned(ButtonZoom) then
ButtonZoom.Down:=True;
{$ENDIF}
end;
procedure TTeeCommander.ButtonDepthClick(Sender: TObject);
begin
SetLabelCaption(CaptionPanel(TeeCommanMsg_DepthLabel));
{$IFDEF FMX}
if Assigned(ButtonDepth) then
ButtonDepth.Down:=True;
{$ENDIF}
end;
procedure TTeeCommander.Button3DClick(Sender: TObject);
begin
if Assigned(FPanel) then
begin
{$IFDEF CLX}
IChanging3D:=True;
{$ENDIF}
FPanel.View3D:={$IFDEF CLX}not {$ENDIF}FButton3D.Down;
{$IFDEF CLX}
IChanging3D:=False;
{$ENDIF}
end;
end;
procedure TTeeCommander.ButtonEditClick(Sender: TObject);
{$IFNDEF TEEOCXNOEDITOR}
var tmp : TCustomTeePanel;
{$ENDIF}
begin
{$IFNDEF TEEOCXNOEDITOR}
tmp:=nil;
if Assigned(FEditor) then
FEditor.Execute
else
if Assigned(FPanel) then
begin
tmp:=TTeePanelAccess(FPanel).GetEditablePanel;
if tmp is TCustomChart then
{$IFDEF FMX}
TChartEditForm.Edit(nil,TCustomChart(tmp))
{$ELSE}
{$IFDEF TEEOCX}
EditChart(self,TCustomChart(tmp)) //TA05015162
{$ELSE}
EditChart(nil,TCustomChart(tmp))
{$ENDIF}
{$ENDIF}
else
if tmp is TCustomTeePanelExtended then
{$IFDEF FMX}
TGradientEditor.Edit(nil,TCustomTeePanelExtended(tmp).Gradient);
{$ELSE}
EditTeeGradient(nil,TCustomTeePanelExtended(tmp).Gradient);
{$ENDIF}
end;
if Assigned(FOnEditedChart) then
if Assigned(tmp) and (tmp is TCustomChart) then
FOnEditedChart(Self,TCustomChart(tmp));
if Assigned(FButton3D) then
FButton3D.Down:=FPanel.View3D;
{$ENDIF}
end;
procedure TTeeCommander.ButtonPrintClick(Sender: TObject);
begin
{$IFNDEF TEEOCXNOEDITOR}
if Assigned(FPreviewer) then FPreviewer.Execute
else
if Assigned(FPanel) then
{$IFDEF FMX}
TChartPreview.Preview(nil, FPanel);
{$ELSE}
{$IFDEF TEEOCX}
ChartPreview(self,FPanel); //TA05015162
{$ELSE}
ChartPreview(nil,FPanel);
{$ENDIF}
{$ENDIF}
{$ENDIF}
end;
procedure TTeeCommander.ButtonCopyClick(Sender: TObject);
begin
if Assigned(FPanel) then FPanel.CopyToClipboardBitmap;
end;
procedure TTeeCommander.ButtonSaveClick(Sender: TObject);
begin
{$IFNDEF TEEOCXNOEDITOR}
if Assigned(FPanel) then
if FPanel is TCustomChart then
SaveChartDialog(FPanel as TCustomChart);
{$ENDIF}
end;
Re: TTeeCommander button bitmaps cut
Posted: Wed Dec 03, 2014 3:57 pm
by 16561419
Hello Yeray,
but call "SetLabelCaption" is private of "TTeeCommander" so I can't use this call in my code.
Or did you think about another way?
Re: TTeeCommander button bitmaps cut
Posted: Thu Dec 04, 2014 10:58 am
by yeray
Hello,
X-Ray wrote:but call "SetLabelCaption" is private of "TTeeCommander" so I can't use this call in my code.
Or did you think about another way?
I posted the relevant methods for you to have an idea about what they actually do.
I believe you own the TeeChart sources so there's no need to put here the complete TeeComma.pas unit.
Re: TTeeCommander button bitmaps cut
Posted: Thu Dec 04, 2014 11:17 am
by 16561419
Hello Yeray,
yes of course, but that would mean duplicating all the code in there!
It would be much more elegant to offer this functionality via Actions, this would remove all the
necessity to know about internals and to duplicate any code.
Re: TTeeCommander button bitmaps cut
Posted: Fri Dec 05, 2014 10:36 am
by yeray
Hi,
X-Ray wrote:yes of course, but that would mean duplicating all the code in there!
It would be much more elegant to offer this functionality via Actions, this would remove all the
necessity to know about internals and to duplicate any code.
Sorry, I understood you wanted to put your own buttons doing the same the buttons on the commander do. I don't see how this could be done without repeating some code.
I may have misunderstood you.