⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spreg.pas

📁 P2P即时通讯源码(DELPHI编写)
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  RegisterPropertyEditor(TypeInfo(string), TspSkinOpenPictureDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinSavePictureDialog, 'LVHeaderSkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinButton, 'SkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinEdit, 'SkinDataName', TspEditSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinSpinEdit, 'SkinDataName', TspSpinEditSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinButtonsBar, 'SectionButtonSkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinHeaderControl, 'SkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinGauge, 'SkinDataName', TspGaugeSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinMenuButton, 'SkinDataName', TspMenuButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinSpeedButton, 'SkinDataName', TspButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinMenuSpeedButton, 'SkinDataName', TspMenuButtonSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinPanel, 'SkinDataName', TspPanelSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinListBox, 'SkinDataName', TspListBoxSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinCheckListBox, 'SkinDataName', TspCheckListBoxSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinSplitter, 'SkinDataName', TspSplitterSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TspSkinComboBox, 'SkinDataName', TspComboBoxSkinDataNameProperty);
  RegisterPropertyEditor(TypeInfo(TStrings),  TspSkinNoteBook, 'Pages', TspSetPagesProperty);
  RegisterComponentEditor(TspSkinPageControl, TspSkinPageControlEditor);
  RegisterComponentEditor(TspSkinTabSheet, TspSkinPageControlEditor);
  RegisterComponentEditor(TspSkinStatusBar, TspSkinStatusBarEditor);
  RegisterComponentEditor(TspSkinToolBar, TspSkinToolBarEditor);
end;

function TspSkinPageControlEditor.GetVerb(Index: Integer): string;
begin
  case Index of
    0:  result := sNEW_PAGE;
    1:  result := sDEL_PAGE;
  end;
end;


procedure TspSkinPageControlEditor.ExecuteVerb(Index: Integer);
var
  NewPage: TspSkinCustomTabSheet;
  PControl : TspSkinPageControl;
begin
  if Component is TspSkinPageControl then
    PControl := TspSkinPageControl(Component)
  else PControl := TspSkinPageControl(TspSkinTabSheet(Component).PageControl);
  case Index of
    0:  begin
          NewPage := TspSkinTabSheet.Create(Designer.GetRoot);
          with NewPage do
          begin
            Parent := PControl;
            PageControl := PControl;
            Name := Designer.UniqueName(ClassName);
            Caption := Name;
          end;
        end;
    1:  begin
          with PControl do
          begin
            NewPage := TspSkinCustomTabSheet(ActivePage);
            NewPage.PageControl := nil;
            NewPage.Free;
          end;
        end;
  end;
  if Designer <> nil then Designer.Modified;
end;

function TspSkinPageControlEditor.GetVerbCount: Integer;
begin
  Result := 2;
end;

procedure TspSkinStatusBarEditor.ExecuteVerb(Index: Integer);
var
  NewPanel: TspSkinStatusPanel;
  NewGauge: TspSkinGauge;
  NewEdit: TspSkinEdit;
  NewSpinEdit: TspSkinSpinEdit;
  NewComboBox: TspSkinComboBox;
  PControl : TspSkinStatusBar;
begin
  if Component is TspSkinStatusBar
  then
    PControl := TspSkinStatusBar(Component)
  else
    Exit;
  case Index of
    0:  begin
          NewPanel := TspSkinStatusPanel.Create(Designer.GetRoot);
          with NewPanel do
          begin
            Left := PControl.Width;
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            SkinData := PControl.SkinData;
            Designer.SelectComponent(NewPanel);
          end;
        end;
    1:  begin
          NewGauge := TspSkinGauge.Create(Designer.GetRoot);
          with NewGauge do
          begin
            Left := PControl.Width;
            SkinDataName := 'statusgauge';
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            SkinData := PControl.SkinData;
            Designer.SelectComponent(NewGauge);
          end;
        end;
    2:
       begin
         NewEdit := TspSkinEdit.Create(Designer.GetRoot);
          with NewEdit do
          begin
            Left := PControl.Width;
            SkinDataName := 'statusedit';
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            SkinData := PControl.SkinData;
            Designer.SelectComponent(NewEdit);
          end;
       end;
    3:
       begin
         NewEdit := TspSkinEdit.Create(Designer.GetRoot);
         with NewEdit do
         begin
           ButtonMode := True;
           Left := PControl.Width;
           SkinDataName := 'statusbuttonedit';
           Parent := PControl;
           Align := alLeft;
           Name := Designer.UniqueName(ClassName);
           SkinData := PControl.SkinData;
           Designer.SelectComponent(NewEdit);
         end;
       end;
    4:
       begin
         NewSpinEdit := TspSkinSpinEdit.Create(Designer.GetRoot);
         with NewSpinEdit do
         begin
           Left := PControl.Width;
           SkinDataName := 'statusspinedit';
           Parent := PControl;
           Align := alLeft;
           Name := Designer.UniqueName(ClassName);
           SkinData := PControl.SkinData;
           Designer.SelectComponent(NewEdit);
         end;
       end;
     5:
       begin
         NewComboBox := TspSkinComboBox.Create(Designer.GetRoot);
         with NewComboBox do
         begin
           Left := PControl.Width;
           SkinDataName := 'statuscombobox';
           Parent := PControl;
           Align := alLeft;
           Name := Designer.UniqueName(ClassName);
           SkinData := PControl.SkinData;
           Designer.SelectComponent(NewEdit);
         end;
       end;
  end;
  if Designer <> nil then Designer.Modified;
end;

function TspSkinStatusBarEditor.GetVerbCount: Integer;
begin
  Result := 6;
end;

function TspSkinStatusBarEditor.GetVerb(Index: Integer): string;
begin
  case Index of
    0: Result := sNEW_STATUSPANEL;
    1: Result := sNEW_STATUSGAUGE;
    2: Result := sNEW_STATUSEDIT;
    3: Result := sNEW_STATUSBUTTONEDIT;
    4: Result := sNEW_STATUSSPINEDIT;
    5: Result := sNEW_STATUSCOMBOBOX;
  end;
end;

procedure TspSkinToolBarEditor.ExecuteVerb(Index: Integer);
var
  NewSpeedButton: TspSkinSpeedButton;
  NewMenuSpeedButton: TspSkinMenuSpeedButton;
  NewBevel: TspSkinBevel;
  NewEdit: TspSkinEdit;
  NewSpinEdit: TspSkinSpinEdit;
  NewComboBox: TspSkinComboBox;
  PControl : TspSkinToolBar;
begin
  if Component is TspSkinToolBar
  then
    PControl := TspSkinToolBar(Component)
  else
    Exit;
  case Index of
    0:  begin
          NewSpeedButton := TspSkinSpeedButton.Create(Designer.GetRoot);
          with NewSpeedButton do
          begin
            Flat := PControl.Flat;
            SkinData := PControl.SkinData;
            Left := PControl.Width;
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            if PControl.SkinDataName = 'bigtoolpanel'
            then
              SkinDataName := 'bigtoolbutton'
            else
              SkinDataName := 'toolbutton';
            Designer.SelectComponent(NewSpeedButton);
          end;
        end;
    1:  begin
          NewMenuSpeedButton := TspSkinMenuSpeedButton.Create(Designer.GetRoot);
          with NewMenuSpeedButton do
          begin
            Flat := PControl.Flat;
            SkinData := PControl.SkinData;
            Left := PControl.Width;
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            if PControl.SkinDataName = 'bigtoolpanel'
            then
              SkinDataName := 'bigtoolmenubutton'
            else
              SkinDataName := 'toolmenubutton';
            Designer.SelectComponent(NewMenuSpeedButton);
          end;
        end;
    2:  begin
          NewMenuSpeedButton := TspSkinMenuSpeedButton.Create(Designer.GetRoot);
          with NewMenuSpeedButton do
          begin
            Flat := PControl.Flat;
            SkinData := PControl.SkinData;
            Left := PControl.Width;
            TrackButtonMode := True;
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            if PControl.SkinDataName = 'bigtoolpanel'
            then
              SkinDataName := 'bigtoolmenutrackbutton'
            else
              SkinDataName := 'toolmenutrackbutton';
            Designer.SelectComponent(NewMenuSpeedButton);
          end;
        end;
    3: begin
          NewBevel := TspSkinBevel.Create(Designer.GetRoot);
          with NewBevel do
          begin
            SkinData := PControl.SkinData;
            Left := PControl.Width;
            Width := 25;
            DividerMode := True;
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            Designer.SelectComponent(NewBevel);
          end;
        end;
    4:
       begin
         NewEdit := TspSkinEdit.Create(Designer.GetRoot);
          with NewEdit do
          begin
            Left := PControl.Width;
            SkinDataName := 'tooledit';
            Parent := PControl;
            Align := alLeft;
            Name := Designer.UniqueName(ClassName);
            SkinData := PControl.SkinData;
            Designer.SelectComponent(NewEdit);
          end;
       end;
    5:
       begin
         NewEdit := TspSkinEdit.Create(Designer.GetRoot);
         with NewEdit do
         begin
           ButtonMode := True;
           Left := PControl.Width;
           SkinDataName := 'toolbuttonedit';
           Parent := PControl;
           Align := alLeft;
           Name := Designer.UniqueName(ClassName);
           SkinData := PControl.SkinData;
           Designer.SelectComponent(NewEdit);
         end;
       end;
    6:
       begin
         NewSpinEdit := TspSkinSpinEdit.Create(Designer.GetRoot);
         with NewSpinEdit do
         begin
           Left := PControl.Width;
           SkinDataName := 'toolspinedit';
           Parent := PControl;
           Align := alLeft;
           Name := Designer.UniqueName(ClassName);
           SkinData := PControl.SkinData;
           Designer.SelectComponent(NewEdit);
         end;
       end;
    7:
       begin
         NewComboBox := TspSkinComboBox.Create(Designer.GetRoot);
         with NewComboBox do
         begin
           Left := PControl.Width;
           SkinDataName := 'toolcombobox';
           Parent := PControl;
           Align := alLeft;
           Name := Designer.UniqueName(ClassName);
           SkinData := PControl.SkinData;
           Designer.SelectComponent(NewEdit);
         end;
       end;
  end;
  if Designer <> nil then Designer.Modified;
end;

function TspSkinToolBarEditor.GetVerbCount: Integer;
begin
  Result := 8;
end;

function TspSkinToolBarEditor.GetVerb(Index: Integer): string;
begin
  case Index of
    0: Result := sNEW_TOOLBUTTON;
    1: Result := sNEW_TOOLMENUBUTTON;
    2: Result := sNEW_TOOLMENUTRACKBUTTON;
    3: Result := sNEW_TOOLSEPARATOR;
    4: Result := sNEW_TOOLEDIT;
    5: Result := sNEW_TOOLBUTTONEDIT;
    6: Result := sNEW_TOOLSPINEDIT;
    7: Result := sNEW_TOOLCOMBOBOX;
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -