📄 fcpropedt.pas
字号:
else}
result := inherited GetVerb(Index);
// end;
end;
function TfcImgBtnEditor.GetVerbCount: Integer;
begin
result := inherited GetVerbCount// + 1;
end;
procedure TfcImgBtnEditor.ExecuteVerb(Index: Integer);
begin
case Index of
FC_BTN_SETSHADECOLORS:
if (Component as TfcCustomImageBtn).Color = clNone then
(Component as TfcCustomImageBtn).UpdateShadeColors((Component as TfcCustomImageBtn).ColorAtPoint(ClickedPoint))
else inherited ExecuteVerb(Index);
// FC_IMGBTN_SPLIT: if Component is TfcCustomImageBtn then (Component as TfcCustomImageBtn).SplitImage;
else
inherited ExecuteVerb(Index);
end;
end;
// TfcImageBtnImageEditor - PropertyEditor for the
// Image property of TfcImageBtn
function TfcImageBtnImageEditor.GetAttributes: TPropertyAttributes;
begin
result := [paDialog, paMultiSelect];
end;
function TfcImageBtnImageEditor.GetValue: string;
begin
if TBitmap(Pointer(GetOrdValue)).Empty then
result := '(None)'
else result := '(TBitmap)';
end;
procedure TfcImageBtnImageEditor.Edit;
begin
fcExecutePictureEditor(TfcBitmap(Pointer(GetOrdValue)), Pointer(GetOrdValue));
Designer.Modified;
end;
// TfcLabelCaptionEditor - PropertyEditor for the
// Caption property of TfcLabel
function TfcLabelCaptionEditor.GetAttributes: TPropertyAttributes;
begin
result := [paDialog, paAutoUpdate];
end;
function TfcLabelCaptionEditor.GetValue: string;
begin
result := (GetComponent(0) as TfcCustomLabel).Caption;
if pos(#13#10, result) <> 0 then result := Copy(result, 1, Pos(#13#10, result) - 1);
end;
procedure TfcLabelCaptionEditor.SetValue(const Value: string);
begin
(GetComponent(0) as TfcCustomLabel).Caption := Value;
Designer.Modified;
end;
procedure TfcLabelCaptionEditor.Edit;
begin
fcExecuteTextEditor(GetComponent(0), 'Caption', (GetComponent(0) as TComponent).Name + '.Caption');
Designer.Modified;
end;
// TfcButtonCaptionEditor - PropertyEditor for
// Caption property of TfcCustomBitBtn
function TfcButtonCaptionEditor.GetAttributes: TPropertyAttributes;
begin
result := [paDialog, paAutoUpdate];
end;
function TfcButtonCaptionEditor.GetValue: string;
begin
result := (GetComponent(0) as TfcCustomBitBtn).Caption;
if pos(#13#10, result) <> 0 then result := Copy(result, 1, Pos(#13#10, result) - 1);
end;
procedure TfcButtonCaptionEditor.SetValue(const Value: string);
begin
(GetComponent(0) as TfcCustomBitBtn).Caption := Value;
Designer.Modified;
end;
procedure TfcButtonCaptionEditor.Edit;
begin
fcExecuteTextEditor(GetComponent(0), 'Caption', (GetComponent(0) as TComponent).Name + '.Caption');
Designer.Modified;
end;
// TfcButtonGroupEditor - ComponentEditor for
// TfcCustomButtonGroup.
procedure TfcButtonGroupEditor.GetObscuredEditor;
var Control: TControl;
function ControlUnderMouse: TControl;
var i: Integer;
p: TPoint;
begin
result := nil;
with TfcCustomButtonGroup(Component) do
begin
p := ScreenToClient(ExecutionPoint);
for i := 0 to ControlCount - 1 do
begin
if PtInRect(Controls[i].BoundsRect, p) and not (Controls[i] is TfcCustomImager) then
begin
result := Controls[i];
Break;
end;
end;
end;
end;
begin
Editor := nil;
with TfcCustomButtonGroup(Component) do
begin
Control := ControlUnderMouse;
if Control <> nil then Editor := GetComponentEditor(Control, Designer);
end;
end;
function TfcButtonGroupEditor.GetVerb(Index: Integer): string;
begin
result := '';
case Index of
FC_CG_NEWBUTTON: result := '&New Button';
else
result := inherited GetVerb(Index);
end;
ExecutionPoint := fcGetCursorPos;
GetObscuredEditor;
if (Index >= FC_CG_COUNT) and (Index <> GetVerbCount - 1) and (Editor <> nil) then with Editor do
result := Component.ClassName + ' - ' + GetVerb(Index - FC_CG_COUNT);
{ Editor.Free;
Editor := nil;}
end;
function TfcButtonGroupEditor.GetVerbCount: Integer;
var CreatedEditor: Boolean;
begin
ExecutionPoint := fcGetCursorPos;
result := inherited GetVerbCount + FC_CG_COUNT;
CreatedEditor := Editor = nil;
if CreatedEditor then GetObscuredEditor;
if Editor <> nil then inc(result, Editor.GetVerbCount - 1);
if CreatedEditor then
begin
{$ifndef fcDelphi6Up}
Editor.Free;
{$endif}
Editor := nil;
end;
end;
procedure TfcButtonGroupEditor.ExecuteVerb(Index: Integer);
begin
case Index of
FC_CG_NEWBUTTON: (Component as TfcCustomButtonGroup).ButtonItems.AddItem;
else
inherited;
end;
if (Index >= FC_CG_COUNT) and (Index <> GetVerbCount - 1) then
begin
// GetObscuredEditor;
if (Editor <> nil) then Editor.ExecuteVerb(Index - FC_CG_COUNT);
end;
{$ifndef fcDelphi6Up}
Editor.Free;
{$endif}
Editor := nil;
end;
procedure TfcButtonGroupEditor.Edit;
begin
fcExecuteCollectionEditor(Component.Name + '.Buttons',
TFormDesigner(Designer), 'ButtonItems', TfcButtonGroup(Component).ButtonItems, nil);
end;
// TfcButtonGroupItemsEditor - PropertyEditor for the
// Items property of TfcCustomButtonGroup.
function TfcButtonGroupItemsEditor.GetAttributes: TPropertyAttributes;
begin
result := [paDialog];
end;
function TfcButtonGroupItemsEditor.GetValue: string;
begin
result := '(TfcButtonGroupItems)';
end;
procedure TfcButtonGroupItemsEditor.Edit;
begin
fcExecuteCollectionEditor(TComponent(GetComponent(0)).Name + '.Buttons',
TFormDesigner(Designer), 'ButtonItems', TfcButtonGroup(GetComponent(0)).ButtonItems, nil);
end;
// TfcButtonGroupControlClassEditor - PropertyEditor
// for the ControlClass property of TfcCustomButtonGroup.
function TfcButtonGroupControlClassEditor.GetAttributes: TPropertyAttributes;
begin
result := [paValueList];
end;
function TfcButtonGroupControlClassEditor.GetValue: string;
begin
result := TfcButtonGroup(GetComponent(0)).ButtonClassName;
end;
procedure TfcButtonGroupControlClassEditor.GetValues(Proc: TGetStrProc);
begin
Proc('TfcShapeBtn');
Proc('TfcImageBtn');
end;
procedure TfcButtonGroupControlClassEditor.SetValue(const Value: string);
begin
TfcButtonGroup(GetComponent(0)).ButtonClassName := Value;
end;
// TfcTreeComboEditor - ComponentEditor for TfcTreeCombo
procedure TfcTreeComboEditor.Edit;
begin
ExecuteTreeNodesEditor(Designer, (Component as TfcCustomTreeCombo).TreeView);
end;
// TfcTreeComboItemsProperty - PropertyEditor for
// the Items property of TfcTreeCombo.
procedure TfcTreeComboItemsProperty.Edit;
begin
ExecuteTreeNodesEditor(Designer, (GetComponent(0) as TfcCustomTreeCombo).TreeView);
end;
function TfcTreeComboItemsProperty.GetAttributes: TPropertyAttributes;
begin
Result:= [paDialog, paReadOnly];
end;
function TfcTreeComboItemsProperty.GetValue: string;
begin
result:= '(TfcTreeNodes)'
end;
// TfcStatusBarEditor - ComponentEditor for TfcStatusBar
procedure TfcStatusBarEditor.Edit;
begin
fcExecuteCollectionEditor(Component.Name + '.Panels', Designer as TFormDesigner, 'Panels',
TfcCustomStatusBar(Component).Panels, nil);
end;
// TfcStatusBarPanelsEditor - PropertyEditor for the
// Panels property of TfcStatusBar.
procedure TfcStatusBarPanelsEditor.Edit;
begin
fcExecuteCollectionEditor(TComponent(GetComponent(0)).Name + '.Panels', Designer as TFormDesigner, 'Panels',
TfcCustomStatusBar(GetComponent(0)).Panels, nil);
end;
function TfcStatusBarPanelsEditor.GetValue: string;
begin
result := '(TfcStatusPanels)';
end;
function TfcStatusBarPanelsEditor.GetAttributes: TPropertyAttributes;
begin
result := [paDialog, paReadOnly];
end;
procedure TfcImagerEditor.Edit;
begin
fcExecutePictureEditor((Component as TfcCustomImager).Picture.Graphic, (Component as TfcCustomImager).Picture);
Designer.Modified;
end;
function TfcOutlookPanelEditor.GetVerb(Index: Integer): string;
begin
case Index of
FC_OTLKPNL_ADDOUTLOOKLIST: result := '&Create OutlookList';
{$ifdef fcdelphi4up} { Delphi 3 does not support paste properly }
FC_OTLKPNL_PASTE: result := '&Paste';
{$endif}
else
result := inherited GetVerb(Index);
end;
end;
function TfcOutlookPanelEditor.GetVerbCount: Integer;
begin
{$ifdef fcdelphi4up} { Delphi 3 does not support paste properly }
result := 2;
{$else}
result := 1;
{$endif}
inc(result, inherited GetVerbCount);
end;
procedure TfcOutlookPanelEditor.ExecuteVerb(Index: Integer);
begin
case Index of
FC_OTLKPNL_ADDOUTLOOKLIST: with (Component as TfcOutlookPanel) do
TfcOutlookPage(OutlookPage).CreateOutlookList;
{$ifdef fcdelphi4up} { Delphi 3 does not support paste properly }
FC_OTLKPNL_PASTE: begin
if not (Component is TfcOutlookPanel) then exit;
// try
if (Designer<>nil) then Designer.SelectComponent(Component);
// for i:= 1 to 10000 do Application.ProcessMessages;
// (TfcOutlookPanel(Component).parent as TfcOutlookBar).InPaste:= True;
keybd_event(VK_CONTROL, 0, 0, 0); { Key down }
keybd_event(ORD('V'), 0, 0, 0); { Key down }
keybd_event(ORD('V'), 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
// for i:= 1 to 100000 do Application.ProcessMessages;
// except
// if (Designer<>nil) then Designer.SelectComponent(TWinControl(Component).parent);
// end;
// (TfcOutlookPanel(Component).parent as TfcOutlookBar).InPaste:= False;
//
// except
// NoSel := TComponentList.Create;
// Designer.SetSelections(NoSel);
// NoSel.Free;
// end;
// PostMessage(TfcOutlookPanel(Component).Handle, WM_FC_DOCTRLV, 0, 0);
// TfcOutlookPanel(Component).DesignPasteFromClipboard;
end;
{$endif}
else inherited;
end;
end;
procedure TfcImageFormEditor.Edit;
var ABitmap: TBitmap;
begin
ABitmap := TBitmap.Create;
if fcExecutePictureEditor((Component as TfcCustomImageForm).Picture.Graphic, ABitmap) then
(Component as TfcCustomImageForm).Picture.Graphic := ABitmap;
ABitmap.Free;
Designer.Modified;
end;
procedure TfcBitmapEditor.Edit;
var ABitmap: TfcBitmap;
OrigBitmap: TfcBitmap;
i: Integer;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -