Selected component ?
Hi,
Iin delphi unit, I would know the component's ClassName which is selected on
the designer.
I tried :
MyReport.ActiveReport.Components[MyReport.ActiveReport.ComponentIndex] but
it isn't the component the end-user has selected.
Is-there a possibilite to know that ?
Iin delphi unit, I would know the component's ClassName which is selected on
the designer.
I tried :
MyReport.ActiveReport.Components[MyReport.ActiveReport.ComponentIndex] but
it isn't the component the end-user has selected.
Is-there a possibilite to know that ?
This discussion has been closed.
Comments
components:
procedure TForm1.ppDesigner1SelectionChanged(Components:
TppDesignerSelectionList);
begin
Components[0].ClassName;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
designer form's ActiveControl property returns a TEdit which is a
"KeyCatcher" that listens to the keyboard strokes made while the designer is
open.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
When The end-user move a component with the mouse, at MouseUp an event
"OnDrawItem" is generated to the EditToolBar.ComboBox(2) component. I
implement this event and it's in my procedure that I require the classname
to the selectionned's component.
My code:
Begin
MyToolbarManager := TppDesignerWindow(MyDesigner.Form).ToolbarManager;
MyEditToolBar := TppEditToolBar(MyToolbarManager.FindToolbar('Edit'));
MyEditToolBar.ComboBox.OnDrawItem := ParamToolBarCombo;
...
End;
Procedure ParamToolBarComboParamToolBarCombo(Control: TWinControl; Index:
Integer;
Rect: TRect; State: TOwnerDrawState);
Begin
MyClassName := ? ? ? ? The Componet's class moved by the end-user
...
End;
Sorry for my english and thanks
currently selected. The OnDrawItem event should fire after that, because the
user must select the combo box in the toolbar after selecting a component.
Have you tried this?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com